Changeset 207971 in webkit
- Timestamp:
- Oct 27, 2016, 2:54:57 AM (10 years ago)
- Location:
- releases/WebKitGTK/webkit-2.14
- Files:
-
- 2 added
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/css/implicit-property-restore-expected.txt (added)
-
LayoutTests/fast/css/implicit-property-restore.html (added)
-
LayoutTests/fast/css/remove-shorthand-expected.txt (modified) (1 diff)
-
Source/WTF/ChangeLog (modified) (1 diff)
-
Source/WTF/wtf/TemporaryChange.h (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/parser/CSSParser.cpp (modified) (9 diffs)
-
Source/WebCore/css/parser/SVGCSSParser.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.14/LayoutTests/ChangeLog
r207961 r207971 1 2016-10-18 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 SVGCSSParser: m_implicitShorthand value is not reset after adding the shorthand property 4 https://bugs.webkit.org/show_bug.cgi?id=116470 5 6 Reviewed by Simon Fraser. 7 8 * fast/css/implicit-property-restore-expected.txt: Added. 9 * fast/css/implicit-property-restore.html: Added. 10 11 * fast/css/remove-shorthand-expected.txt: 12 Rebase-line the test expected results because of fixing the leak of 13 m_implicitShorthand. The bug was happening because "background: ..." property 14 comes immediately before the "list-style: ...." property. 15 1 16 2016-10-14 Antti Koivisto <antti@apple.com> 2 17 -
releases/WebKitGTK/webkit-2.14/LayoutTests/fast/css/remove-shorthand-expected.txt
r200357 r207971 49 49 and adds "". 50 50 Removing list-style 51 removes "list-style -type, list-style-position, list-style-image"51 removes "list-style" 52 52 and adds "". 53 53 Removing margin -
releases/WebKitGTK/webkit-2.14/Source/WTF/ChangeLog
r207103 r207971 1 2016-10-18 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 SVGCSSParser: m_implicitShorthand value is not reset after adding the shorthand property 4 https://bugs.webkit.org/show_bug.cgi?id=116470 5 6 Reviewed by Simon Fraser. 7 8 * wtf/TemporaryChange.h: 9 (WTF::TemporaryChange::TemporaryChange): 10 Add a new constructor to make TemporaryChange work as a restorer. The 11 temporary change will happen after we construct the object. 12 1 13 2016-09-26 Michael Catanzaro <mcatanzaro@igalia.com> 2 14 -
releases/WebKitGTK/webkit-2.14/Source/WTF/wtf/TemporaryChange.h
r111778 r207971 44 44 WTF_MAKE_NONCOPYABLE(TemporaryChange); 45 45 public: 46 TemporaryChange(T& scopedVariable , T newValue)46 TemporaryChange(T& scopedVariable) 47 47 : m_scopedVariable(scopedVariable) 48 48 , m_originalValue(scopedVariable) 49 { 50 } 51 TemporaryChange(T& scopedVariable, T newValue) 52 : TemporaryChange(scopedVariable) 49 53 { 50 54 m_scopedVariable = newValue; … … 55 59 m_scopedVariable = m_originalValue; 56 60 } 57 58 61 59 62 private: -
releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog
r207969 r207971 1 2016-10-18 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 SVGCSSParser: m_implicitShorthand value is not reset after adding the shorthand property 4 https://bugs.webkit.org/show_bug.cgi?id=116470 5 6 Reviewed by Simon Fraser. 7 8 When we encounter a shorthand css property, we set m_implicitShorthand 9 to true to tell addProperty() later that the individual properties are 10 all set through a short hand one. We need to make sure that setting 11 m_implicitShorthand to true will not be leaked after finishing parsing 12 the short hand property. 13 14 Test: fast/css/implicit-property-restore.html 15 16 * css/parser/CSSParser.cpp: 17 (WebCore::CSSParser::parseValue): 18 (WebCore::CSSParser::parseFillShorthand): 19 (WebCore::CSSParser::parseShorthand): 20 (WebCore::CSSParser::parse4Values): 21 (WebCore::CSSParser::parseBorderRadius): 22 (WTF::ImplicitScope::ImplicitScope): Deleted. 23 (WTF::ImplicitScope::~ImplicitScope): Deleted. 24 Get rid of ImplicitScope and replace its calls by TemporaryChange<bool>. 25 26 * css/parser/SVGCSSParser.cpp: 27 (WebCore::CSSParser::parseSVGValue): 28 Restore m_implicitShorthand value after setting it temporarily to true. 29 1 30 2016-10-17 Alberto Garcia <berto@igalia.com> 2 31 -
releases/WebKitGTK/webkit-2.14/Source/WebCore/css/parser/CSSParser.cpp
r205620 r207971 107 107 #include <wtf/NeverDestroyed.h> 108 108 #include <wtf/StdLibExtras.h> 109 #include <wtf/TemporaryChange.h> 109 110 #include <wtf/dtoa.h> 110 111 #include <wtf/text/StringBuffer.h> … … 135 136 136 137 using namespace WTF; 137 138 namespace {139 140 enum PropertyType {141 PropertyExplicit,142 PropertyImplicit143 };144 145 class ImplicitScope {146 WTF_MAKE_NONCOPYABLE(ImplicitScope);147 public:148 ImplicitScope(WebCore::CSSParser& parser, PropertyType propertyType)149 : m_parser(parser)150 {151 m_parser.m_implicitShorthand = propertyType == PropertyImplicit;152 }153 154 ~ImplicitScope()155 {156 m_parser.m_implicitShorthand = false;157 }158 159 private:160 WebCore::CSSParser& m_parser;161 };162 163 } // namespace164 138 165 139 namespace WebCore { … … 2230 2204 result = true; 2231 2205 } 2232 m_implicitShorthand = false;2233 2206 return result; 2234 2207 } … … 3623 3596 3624 3597 ShorthandScope scope(this, propId); 3598 TemporaryChange<bool> change(m_implicitShorthand); 3625 3599 3626 3600 bool parsedProperty[cMaxFillProperties] = { false }; … … 4037 4011 // Fill in any remaining properties with the initial value. 4038 4012 auto& cssValuePool = CSSValuePool::singleton(); 4039 ImplicitScope implicitScope(*this, PropertyImplicit);4013 TemporaryChange<bool> change(m_implicitShorthand, true); 4040 4014 const StylePropertyShorthand* propertiesForInitialization = shorthand.propertiesForInitialization(); 4041 4015 for (unsigned i = 0; i < shorthand.length(); ++i) { … … 4074 4048 return false; 4075 4049 CSSValue* value = m_parsedProperties.last().value(); 4076 ImplicitScope implicitScope(*this, PropertyImplicit);4050 TemporaryChange<bool> change(m_implicitShorthand, true); 4077 4051 addProperty(properties[1], value, important); 4078 4052 addProperty(properties[2], value, important); … … 4084 4058 return false; 4085 4059 CSSValue* value = m_parsedProperties[m_parsedProperties.size() - 2].value(); 4086 ImplicitScope implicitScope(*this, PropertyImplicit);4060 TemporaryChange<bool> change(m_implicitShorthand, true); 4087 4061 addProperty(properties[2], value, important); 4088 4062 value = m_parsedProperties[m_parsedProperties.size() - 2].value(); … … 4094 4068 return false; 4095 4069 CSSValue* value = m_parsedProperties[m_parsedProperties.size() - 2].value(); 4096 ImplicitScope implicitScope(*this, PropertyImplicit);4070 TemporaryChange<bool> change(m_implicitShorthand, true); 4097 4071 addProperty(properties[3], value, important); 4098 4072 break; … … 8731 8705 completeBorderRadii(radii[1]); 8732 8706 8733 ImplicitScope implicitScope(*this, PropertyImplicit);8707 TemporaryChange<bool> change(m_implicitShorthand, true); 8734 8708 addProperty(CSSPropertyBorderTopLeftRadius, createPrimitiveValuePair(WTFMove(radii[0][0]), WTFMove(radii[1][0])), important); 8735 8709 addProperty(CSSPropertyBorderTopRightRadius, createPrimitiveValuePair(WTFMove(radii[0][1]), WTFMove(radii[1][1])), important); -
releases/WebKitGTK/webkit-2.14/Source/WebCore/css/parser/SVGCSSParser.cpp
r204852 r207971 31 31 #include "RenderTheme.h" 32 32 #include "SVGPaint.h" 33 34 #include <wtf/TemporaryChange.h> 33 35 34 36 namespace WebCore { … … 292 294 { 293 295 ShorthandScope scope(this, propId); 294 m_implicitShorthand = true;296 TemporaryChange<bool> change(m_implicitShorthand, true); 295 297 if (!parseValue(CSSPropertyMarkerStart, important)) 296 298 return false; … … 302 304 addProperty(CSSPropertyMarkerMid, value, important); 303 305 addProperty(CSSPropertyMarkerEnd, value, important); 304 m_implicitShorthand = false;305 306 return true; 306 307 }
Note:
See TracChangeset
for help on using the changeset viewer.