Changeset 166909 in webkit
- Timestamp:
- Apr 7, 2014 9:47:05 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r166902 r166909 1 2014-04-07 Zoltan Horvath <zoltan@webkit.org> 2 3 [CSS Shapes] Simplify the parsing of width arguments for Inset shapes 4 https://bugs.webkit.org/show_bug.cgi?id=131305 5 6 Reviewed by Andreas Kling. 7 8 This code introduces some helper functions for setting the size arguments of inset shapes. This change 9 also modifies the code to be the same as in Blink, so it helps us to keep the shapes code similar. 10 11 No new tests, no behavior change. 12 13 * css/CSSBasicShapes.h: 14 (WebCore::CSSBasicShapeInset::updateShapeSize4Values): 15 (WebCore::CSSBasicShapeInset::updateShapeSize1Value): 16 (WebCore::CSSBasicShapeInset::updateShapeSize2Values): 17 (WebCore::CSSBasicShapeInset::updateShapeSize3Values): 18 * css/CSSParser.cpp: 19 (WebCore::CSSParser::parseBasicShapeInset): 20 1 21 2014-04-07 Martin Robinson <mrobinson@igalia.com> 2 22 -
trunk/Source/WebCore/css/CSSBasicShapes.h
r165843 r166909 82 82 void setLeft(PassRefPtr<CSSPrimitiveValue> left) { m_left = left; } 83 83 84 void updateShapeSize4Values(CSSPrimitiveValue* top, CSSPrimitiveValue* right, CSSPrimitiveValue* bottom, CSSPrimitiveValue* left) 85 { 86 setTop(top); 87 setRight(right); 88 setBottom(bottom); 89 setLeft(left); 90 } 91 92 void updateShapeSize1Value(CSSPrimitiveValue* value1) 93 { 94 updateShapeSize4Values(value1, value1, value1, value1); 95 } 96 97 void updateShapeSize2Values(CSSPrimitiveValue* value1, CSSPrimitiveValue* value2) 98 { 99 updateShapeSize4Values(value1, value2, value1, value2); 100 } 101 102 void updateShapeSize3Values(CSSPrimitiveValue* value1, CSSPrimitiveValue* value2, CSSPrimitiveValue* value3) 103 { 104 updateShapeSize4Values(value1, value2, value3, value2); 105 } 106 84 107 void setTopLeftRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_topLeftRadius = radius; } 85 108 void setTopRightRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_topRightRadius = radius; } -
trunk/Source/WebCore/css/CSSParser.cpp
r166883 r166909 5429 5429 switch (widthArguments.size()) { 5430 5430 case 1: { 5431 shape->setTop(widthArguments[0]); 5432 shape->setRight(widthArguments[0]); 5433 shape->setBottom(widthArguments[0]); 5434 shape->setLeft(widthArguments[0]); 5431 shape->updateShapeSize1Value(widthArguments[0].get()); 5435 5432 break; 5436 5433 } 5437 5434 case 2: { 5438 shape->setTop(widthArguments[0]); 5439 shape->setRight(widthArguments[1]); 5440 shape->setBottom(widthArguments[0]); 5441 shape->setLeft(widthArguments[1]); 5435 shape->updateShapeSize2Values(widthArguments[0].get(), widthArguments[1].get()); 5442 5436 break; 5443 5437 } 5444 5438 case 3: { 5445 shape->setTop(widthArguments[0]); 5446 shape->setRight(widthArguments[1]); 5447 shape->setBottom(widthArguments[2]); 5448 shape->setLeft(widthArguments[1]); 5439 shape->updateShapeSize3Values(widthArguments[0].get(), widthArguments[1].get(), widthArguments[2].get()); 5449 5440 break; 5450 5441 } 5451 5442 case 4: { 5452 shape->setTop(widthArguments[0]); 5453 shape->setRight(widthArguments[1]); 5454 shape->setBottom(widthArguments[2]); 5455 shape->setLeft(widthArguments[3]); 5443 shape->updateShapeSize4Values(widthArguments[0].get(), widthArguments[1].get(), widthArguments[2].get(), widthArguments[3].get()); 5456 5444 break; 5457 5445 }
Note: See TracChangeset
for help on using the changeset viewer.