Changeset 207556 in webkit
- Timestamp:
- Oct 19, 2016 12:19:27 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r207554 r207556 1 2016-10-19 Dave Hyatt <hyatt@apple.com> 2 3 [CSS Parser] Fix background-position parsing 4 https://bugs.webkit.org/show_bug.cgi?id=163681 5 6 Reviewed by Dean Jackson. 7 8 The new parser has a more efficient parsed representation of background positions. When 9 background-position is "center" or when no length unit is specified for a dimension, 10 then rather than creating a pair, the new parser makes a singleton primitive value. 11 12 Patch the StyleBuilder code to handle this case, resolving center to (left,50%) or 13 (top,50%) as appropriate and also handling top/left without any associated length. 14 15 * css/CSSToStyleMap.cpp: 16 (WebCore::CSSToStyleMap::mapFillXPosition): 17 (WebCore::CSSToStyleMap::mapFillYPosition): 18 1 19 2016-10-19 Antoine Quint <graouts@apple.com> 2 20 -
trunk/Source/WebCore/css/CSSToStyleMap.cpp
r207396 r207556 239 239 ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPositionX || propertyID == CSSPropertyWebkitMaskPositionX); 240 240 primitiveValue = pair->second(); 241 } else if (primitiveValue->isValueID()) { 242 if (primitiveValue->valueID() == CSSValueCenter) { 243 layer.setBackgroundXOrigin(Edge::Left); 244 layer.setXPosition(Length(50, Percent)); 245 } else { 246 layer.setBackgroundXOrigin(*primitiveValue); 247 layer.setXPosition(Length()); 248 } 249 return; 241 250 } 242 251 … … 271 280 ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPositionY || propertyID == CSSPropertyWebkitMaskPositionY); 272 281 primitiveValue = pair->second(); 282 } else if (primitiveValue->isValueID()) { 283 if (primitiveValue->valueID() == CSSValueCenter) { 284 layer.setBackgroundYOrigin(Edge::Top); 285 layer.setYPosition(Length(50, Percent)); 286 } else { 287 layer.setBackgroundYOrigin(*primitiveValue); 288 layer.setYPosition(Length()); 289 } 290 return; 273 291 } 274 292
Note: See TracChangeset
for help on using the changeset viewer.