Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Side by Side Diff: Source/core/css/StylePropertySerializer.cpp

Issue 16736004: Stylesheet rule.cssText of content property should be quoted when the value is string. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSValueList.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
5 * Copyright (C) 2013 Intel Corporation. All rights reserved. 5 * Copyright (C) 2013 Intel Corporation. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 continue; 79 continue;
80 case CSSPropertyBackgroundPositionY: 80 case CSSPropertyBackgroundPositionY:
81 positionYPropertyIndex = n; 81 positionYPropertyIndex = n;
82 continue; 82 continue;
83 case CSSPropertyBackgroundRepeatX: 83 case CSSPropertyBackgroundRepeatX:
84 repeatXPropertyIndex = n; 84 repeatXPropertyIndex = n;
85 continue; 85 continue;
86 case CSSPropertyBackgroundRepeatY: 86 case CSSPropertyBackgroundRepeatY:
87 repeatYPropertyIndex = n; 87 repeatYPropertyIndex = n;
88 continue; 88 continue;
89 case CSSPropertyContent:
90 if (property.value()->isValueList())
91 value = toCSSValueList(property.value())->customCssText(AlwaysQu oteCSSString);
92 break;
89 case CSSPropertyBorderTopWidth: 93 case CSSPropertyBorderTopWidth:
90 case CSSPropertyBorderRightWidth: 94 case CSSPropertyBorderRightWidth:
91 case CSSPropertyBorderBottomWidth: 95 case CSSPropertyBorderBottomWidth:
92 case CSSPropertyBorderLeftWidth: 96 case CSSPropertyBorderLeftWidth:
93 if (!borderFallbackShorthandProperty) 97 if (!borderFallbackShorthandProperty)
94 borderFallbackShorthandProperty = CSSPropertyBorderWidth; 98 borderFallbackShorthandProperty = CSSPropertyBorderWidth;
95 case CSSPropertyBorderTopStyle: 99 case CSSPropertyBorderTopStyle:
96 case CSSPropertyBorderRightStyle: 100 case CSSPropertyBorderRightStyle:
97 case CSSPropertyBorderBottomStyle: 101 case CSSPropertyBorderBottomStyle:
98 case CSSPropertyBorderLeftStyle: 102 case CSSPropertyBorderLeftStyle:
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 unsigned shortPropertyIndex = shorthandPropertyID - firstCSSProperty; 212 unsigned shortPropertyIndex = shorthandPropertyID - firstCSSProperty;
209 if (shorthandPropertyID) { 213 if (shorthandPropertyID) {
210 if (shorthandPropertyUsed.get(shortPropertyIndex)) 214 if (shorthandPropertyUsed.get(shortPropertyIndex))
211 continue; 215 continue;
212 if (!shorthandPropertyAppeared.get(shortPropertyIndex) && value.isNu ll()) 216 if (!shorthandPropertyAppeared.get(shortPropertyIndex) && value.isNu ll())
213 value = m_propertySet.getPropertyValue(shorthandPropertyID); 217 value = m_propertySet.getPropertyValue(shorthandPropertyID);
214 shorthandPropertyAppeared.set(shortPropertyIndex); 218 shorthandPropertyAppeared.set(shortPropertyIndex);
215 } 219 }
216 220
217 if (!value.isNull()) { 221 if (!value.isNull()) {
218 propertyID = shorthandPropertyID; 222 if (shorthandPropertyID) {
219 shorthandPropertyUsed.set(shortPropertyIndex); 223 propertyID = shorthandPropertyID;
224 shorthandPropertyUsed.set(shortPropertyIndex);
225 }
220 } else 226 } else
221 value = property.value()->cssText(); 227 value = property.value()->cssText();
222 228
223 if (value == "initial" && !CSSProperty::isInheritedProperty(propertyID)) 229 if (value == "initial" && !CSSProperty::isInheritedProperty(propertyID))
224 continue; 230 continue;
225 231
226 if (numDecls++) 232 if (numDecls++)
227 result.append(' '); 233 result.append(' ');
228 result.append(getPropertyName(propertyID)); 234 result.append(getPropertyName(propertyID));
229 result.appendLiteral(": "); 235 result.appendLiteral(": ");
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 if (!result.isEmpty()) 753 if (!result.isEmpty())
748 result.append(' '); 754 result.append(' ');
749 result.append(value); 755 result.append(value);
750 } 756 }
751 if (isInitialOrInherit(commonValue)) 757 if (isInitialOrInherit(commonValue))
752 return commonValue; 758 return commonValue;
753 return result.isEmpty() ? String() : result.toString(); 759 return result.isEmpty() ? String() : result.toString();
754 } 760 }
755 761
756 } 762 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSValueList.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698