Changeset 207629 in webkit
- Timestamp:
- Oct 20, 2016 11:35:56 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r207627 r207629 1 2016-10-20 Dave Hyatt <hyatt@apple.com> 2 3 [CSS Parser] Fix region, column and page break parsing 4 https://bugs.webkit.org/show_bug.cgi?id=163743 5 6 Reviewed by Simon Fraser. 7 8 * css/parser/CSSParserFastPaths.cpp: 9 (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): 10 Add the missing values for break support. 11 12 * css/parser/CSSPropertyParser.cpp: 13 (WebCore::isLegacyBreakProperty): 14 (WebCore::CSSPropertyParser::parseValueStart): 15 Add a special case for handling legacy break properties. Blink treats them like 16 shorthands, but we can't do that without breaking the old parser, so for now 17 we add a special case. 18 19 (WebCore::mapFromPageBreakBetween): 20 (WebCore::mapFromColumnBreakBetween): 21 (WebCore::mapFromRegionBreakBetween): 22 Updated to have the AvoidXXX values (where XXX is Column/Page/Region). 23 24 (WebCore::CSSPropertyParser::parseShorthand): 25 Remove the consumeLegacyBreak from the shorthand function, since we can't treat 26 the legacy break properties as shorthands yet. 27 1 28 2016-10-20 Sam Weinig <sam@webkit.org> 2 29 -
trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp
r207622 r207629 597 597 case CSSPropertyBreakAfter: 598 598 case CSSPropertyBreakBefore: 599 return valueID == CSSValueAuto || valueID == CSSValueAvoid || valueID == CSSValueAvoidPage || valueID == CSSValuePage || valueID == CSSValueLeft || valueID == CSSValueRight || valueID == CSSValueRecto || valueID == CSSValueVerso || valueID == CSSValueAvoidColumn || valueID == CSSValueColumn; 599 return valueID == CSSValueAuto || valueID == CSSValueAvoid || valueID == CSSValueAvoidPage || valueID == CSSValuePage || valueID == CSSValueLeft || valueID == CSSValueRight || valueID == CSSValueRecto || valueID == CSSValueVerso || valueID == CSSValueAvoidColumn || valueID == CSSValueColumn 600 #if ENABLE(CSS_REGIONS) 601 || valueID == CSSValueRegion || valueID == CSSValueAvoidRegion 602 #endif 603 ; 600 604 case CSSPropertyBreakInside: 601 return valueID == CSSValueAuto || valueID == CSSValueAvoid || valueID == CSSValueAvoidPage || valueID == CSSValueAvoidColumn; 605 return valueID == CSSValueAuto || valueID == CSSValueAvoid || valueID == CSSValueAvoidPage || valueID == CSSValueAvoidColumn 606 #if ENABLE(CSS_REGIONS) 607 || valueID == CSSValueAvoidRegion 608 #endif 609 ; 602 610 case CSSPropertyPointerEvents: 603 611 // none | visiblePainted | visibleFill | visibleStroke | visible | -
trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp
r207622 r207629 267 267 } 268 268 269 static bool isLegacyBreakProperty(CSSPropertyID propertyID) 270 { 271 switch (propertyID) { 272 case CSSPropertyPageBreakAfter: 273 case CSSPropertyPageBreakBefore: 274 case CSSPropertyPageBreakInside: 275 case CSSPropertyWebkitColumnBreakAfter: 276 case CSSPropertyWebkitColumnBreakBefore: 277 case CSSPropertyWebkitColumnBreakInside: 278 #if ENABLE(CSS_REGIONS) 279 case CSSPropertyWebkitRegionBreakAfter: 280 case CSSPropertyWebkitRegionBreakBefore: 281 case CSSPropertyWebkitRegionBreakInside: 282 #endif 283 return true; 284 default: 285 break; 286 } 287 return false; 288 } 289 269 290 bool CSSPropertyParser::parseValueStart(CSSPropertyID propertyID, bool important) 270 291 { … … 278 299 // Variable references will fail to parse here and will fall out to the variable ref parser below. 279 300 if (parseShorthand(propertyID, important)) 301 return true; 302 } else if (isLegacyBreakProperty(propertyID)) { 303 // FIXME-NEWPARSER: Can turn this into a shorthand once old parser is gone, and then 304 // we don't need the special case. 305 if (consumeLegacyBreakProperty(propertyID, important)) 280 306 return true; 281 307 } else { … … 4004 4030 if (value == CSSValueAlways) 4005 4031 return CSSValuePage; 4006 if (value == CSSValueAuto || value == CSSValue Avoid || value == CSSValueLeft || value == CSSValueRight)4032 if (value == CSSValueAuto || value == CSSValueLeft || value == CSSValueRight) 4007 4033 return value; 4034 if (value == CSSValueAvoid) 4035 return CSSValueAvoidPage; 4008 4036 return CSSValueInvalid; 4009 4037 } … … 4013 4041 if (value == CSSValueAlways) 4014 4042 return CSSValueColumn; 4015 if (value == CSSValueAuto || value == CSSValueAvoid)4043 if (value == CSSValueAuto) 4016 4044 return value; 4045 if (value == CSSValueAvoid) 4046 return CSSValueAvoidColumn; 4017 4047 return CSSValueInvalid; 4018 4048 } … … 4023 4053 if (value == CSSValueAlways) 4024 4054 return CSSValueRegion; 4025 if (value == CSSValueAuto || value == CSSValueAvoid)4055 if (value == CSSValueAuto) 4026 4056 return value; 4057 if (value == CSSValueAvoid) 4058 return CSSValueAvoidRegion; 4027 4059 return CSSValueInvalid; 4028 4060 } … … 4572 4604 case CSSPropertyBorderImage: 4573 4605 return consumeBorderImage(property, important); 4574 case CSSPropertyPageBreakAfter:4575 case CSSPropertyPageBreakBefore:4576 case CSSPropertyPageBreakInside:4577 case CSSPropertyWebkitColumnBreakAfter:4578 case CSSPropertyWebkitColumnBreakBefore:4579 case CSSPropertyWebkitColumnBreakInside:4580 return consumeLegacyBreakProperty(property, important);4581 4606 case CSSPropertyWebkitMaskPosition: 4582 4607 case CSSPropertyBackgroundPosition: {
Note: See TracChangeset
for help on using the changeset viewer.