Changeset 90863 in webkit
- Timestamp:
- Jul 12, 2011 3:34:04 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r90856 r90863 1 2011-07-12 Alexandru Chiculita <achicu@adobe.com> 2 3 Reviewed by David Hyatt. 4 5 [CSS Exclusions] Parse wrap-shape property 6 https://bugs.webkit.org/show_bug.cgi?id=61726 7 8 * fast/exclusions/parsing-wrap-shape-expected.txt: Added. 9 * fast/exclusions/parsing-wrap-shape.html: Added. 10 * fast/exclusions/script-tests/parsing-wrap-shape.js: Added. 11 (testCSSText): 12 (testComputedStyle): 13 (testNotInherited): 14 (test): 15 (negative_test): 16 1 17 2011-07-12 Joseph Pecoraro <joepeck@webkit.org> 2 18 -
trunk/Source/WebCore/ChangeLog
r90860 r90863 1 2011-07-12 Alexandru Chiculita <achicu@adobe.com> 2 3 Reviewed by David Hyatt. 4 5 [CSS Exclusions] Parse wrap-shape property 6 https://bugs.webkit.org/show_bug.cgi?id=61726 7 8 Parsing wrap-shape: rect, circle, ellipse and polygon. 9 Moved WindRule from Path.h to it's own file. 10 11 Test: fast/exclusions/parsing-wrap-shape.html 12 13 * WebCore.vcproj/WebCore.vcproj: 14 * WebCore.xcodeproj/project.pbxproj: 15 * css/CSSComputedStyleDeclaration.cpp: 16 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): 17 * css/CSSParser.cpp: 18 (WebCore::CSSParser::parseValue): 19 (WebCore::CSSParser::parseWrapShapeRect): 20 (WebCore::CSSParser::parseWrapShapeCircle): 21 (WebCore::CSSParser::parseWrapShapeEllipse): 22 (WebCore::CSSParser::parseWrapShapePolygon): 23 (WebCore::CSSParser::parseWrapShape): 24 * css/CSSParser.h: 25 * css/CSSPrimitiveValue.cpp: 26 (WebCore::CSSPrimitiveValue::init): 27 (WebCore::CSSPrimitiveValue::cleanup): 28 (WebCore::CSSPrimitiveValue::cssText): 29 * css/CSSPrimitiveValue.h: 30 (WebCore::CSSPrimitiveValue::getShapeValue): 31 * css/CSSPropertyNames.in: 32 * css/CSSStyleSelector.cpp: 33 (WebCore::CSSStyleSelector::applyProperty): 34 * css/CSSValueKeywords.in: 35 * css/CSSWrapShapes.cpp: Added. 36 (WebCore::CSSWrapShapeRect::cssText): 37 (WebCore::CSSWrapShapeCircle::cssText): 38 (WebCore::CSSWrapShapeEllipse::cssText): 39 (WebCore::CSSWrapShapePolygon::cssText): 40 * css/CSSWrapShapes.h: Added. 41 (WebCore::CSSWrapShape::~CSSWrapShape): 42 (WebCore::CSSWrapShape::CSSWrapShape): 43 (WebCore::CSSWrapShapeRect::create): 44 (WebCore::CSSWrapShapeRect::left): 45 (WebCore::CSSWrapShapeRect::top): 46 (WebCore::CSSWrapShapeRect::width): 47 (WebCore::CSSWrapShapeRect::height): 48 (WebCore::CSSWrapShapeRect::radiusX): 49 (WebCore::CSSWrapShapeRect::radiusY): 50 (WebCore::CSSWrapShapeRect::setLeft): 51 (WebCore::CSSWrapShapeRect::setTop): 52 (WebCore::CSSWrapShapeRect::setWidth): 53 (WebCore::CSSWrapShapeRect::setHeight): 54 (WebCore::CSSWrapShapeRect::setRadiusX): 55 (WebCore::CSSWrapShapeRect::setRadiusY): 56 (WebCore::CSSWrapShapeRect::type): 57 (WebCore::CSSWrapShapeRect::CSSWrapShapeRect): 58 (WebCore::CSSWrapShapeCircle::create): 59 (WebCore::CSSWrapShapeCircle::left): 60 (WebCore::CSSWrapShapeCircle::top): 61 (WebCore::CSSWrapShapeCircle::radius): 62 (WebCore::CSSWrapShapeCircle::setLeft): 63 (WebCore::CSSWrapShapeCircle::setTop): 64 (WebCore::CSSWrapShapeCircle::setRadius): 65 (WebCore::CSSWrapShapeCircle::type): 66 (WebCore::CSSWrapShapeCircle::CSSWrapShapeCircle): 67 (WebCore::CSSWrapShapeEllipse::create): 68 (WebCore::CSSWrapShapeEllipse::left): 69 (WebCore::CSSWrapShapeEllipse::top): 70 (WebCore::CSSWrapShapeEllipse::radiusX): 71 (WebCore::CSSWrapShapeEllipse::radiusY): 72 (WebCore::CSSWrapShapeEllipse::setLeft): 73 (WebCore::CSSWrapShapeEllipse::setTop): 74 (WebCore::CSSWrapShapeEllipse::setRadiusX): 75 (WebCore::CSSWrapShapeEllipse::setRadiusY): 76 (WebCore::CSSWrapShapeEllipse::type): 77 (WebCore::CSSWrapShapeEllipse::CSSWrapShapeEllipse): 78 (WebCore::CSSWrapShapePolygon::create): 79 (WebCore::CSSWrapShapePolygon::appendPoint): 80 (WebCore::CSSWrapShapePolygon::getXAt): 81 (WebCore::CSSWrapShapePolygon::getYAt): 82 (WebCore::CSSWrapShapePolygon::setWindRule): 83 (WebCore::CSSWrapShapePolygon::windRule): 84 (WebCore::CSSWrapShapePolygon::type): 85 (WebCore::CSSWrapShapePolygon::CSSWrapShapePolygon): 86 * css/SVGCSSValueKeywords.in: 87 * platform/graphics/Path.h: 88 * platform/graphics/WindRule.h: Added. 89 * rendering/style/RenderStyle.cpp: 90 (WebCore::RenderStyle::diff): 91 * rendering/style/RenderStyle.h: 92 (WebCore::InheritedFlags::setWrapShape): 93 (WebCore::InheritedFlags::wrapShape): 94 (WebCore::InheritedFlags::initialWrapShape): 95 * rendering/style/StyleRareNonInheritedData.cpp: 96 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): 97 (WebCore::StyleRareNonInheritedData::operator==): 98 * rendering/style/StyleRareNonInheritedData.h: 99 1 100 2011-07-12 Simon Fraser <simon.fraser@apple.com> 2 101 -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r90849 r90863 27702 27702 </File> 27703 27703 <File 27704 RelativePath="..\platform\graphics\WindRule.h" 27705 > 27706 </File> 27707 <File 27704 27708 RelativePath="..\platform\graphics\WOFFFileFormat.cpp" 27705 27709 > … … 32899 32903 </File> 32900 32904 <File 32905 RelativePath="..\css\CSSWrapShapes.cpp" 32906 > 32907 </File> 32908 <File 32909 RelativePath="..\css\CSSWrapShapes.h" 32910 > 32911 </File> 32912 <File 32901 32913 RelativePath="..\css\StyleBase.cpp" 32902 32914 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r90849 r90863 1290 1290 4FD8D0F2119C718B002FA825 /* ScriptGCEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FD8D0F0119C718B002FA825 /* ScriptGCEvent.cpp */; }; 1291 1291 4FD8D0F3119C718B002FA825 /* ScriptGCEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FD8D0F1119C718B002FA825 /* ScriptGCEvent.h */; }; 1292 501BA9E21393CEA000F7ACEB /* CSSWrapShapes.h in Headers */ = {isa = PBXBuildFile; fileRef = 501BA9E11393CEA000F7ACEB /* CSSWrapShapes.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1293 501BAAA913950E2C00F7ACEB /* WindRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 501BAAA813950E2C00F7ACEB /* WindRule.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1294 50E566D6139E38C500214433 /* CSSWrapShapes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 501BAAB11395114B00F7ACEB /* CSSWrapShapes.cpp */; }; 1292 1295 510184690B08602A004A825F /* CachedPage.h in Headers */ = {isa = PBXBuildFile; fileRef = 510184670B08602A004A825F /* CachedPage.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1293 1296 5101846A0B08602A004A825F /* CachedPage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510184680B08602A004A825F /* CachedPage.cpp */; }; … … 7822 7825 4FD8D0F0119C718B002FA825 /* ScriptGCEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptGCEvent.cpp; sourceTree = "<group>"; }; 7823 7826 4FD8D0F1119C718B002FA825 /* ScriptGCEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptGCEvent.h; sourceTree = "<group>"; }; 7827 501BA9E11393CEA000F7ACEB /* CSSWrapShapes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSWrapShapes.h; sourceTree = "<group>"; }; 7828 501BAAA813950E2C00F7ACEB /* WindRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindRule.h; sourceTree = "<group>"; }; 7829 501BAAB11395114B00F7ACEB /* CSSWrapShapes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSWrapShapes.cpp; sourceTree = "<group>"; }; 7824 7830 510184670B08602A004A825F /* CachedPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedPage.h; sourceTree = "<group>"; }; 7825 7831 510184680B08602A004A825F /* CachedPage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedPage.cpp; sourceTree = "<group>"; }; … … 17994 18000 isa = PBXGroup; 17995 18001 children = ( 18002 501BAAA813950E2C00F7ACEB /* WindRule.h */, 17996 18003 076F0D0812B8192700C26AA4 /* avfoundation */, 17997 18004 499B3EC0128CCC1800E726C2 /* ca */, … … 19117 19124 isa = PBXGroup; 19118 19125 children = ( 19126 501BA9E11393CEA000F7ACEB /* CSSWrapShapes.h */, 19119 19127 93CA4C9C09DF93FA00DF8677 /* maketokenizer */, 19120 19128 A80E6CDA0A1989CA007FB8C5 /* Counter.h */, … … 19309 19317 BC9ADD220CC4032600098C4C /* WebKitCSSTransformValue.h */, 19310 19318 31611E540E1C4D4A00F6A579 /* WebKitCSSTransformValue.idl */, 19319 501BAAB11395114B00F7ACEB /* CSSWrapShapes.cpp */, 19311 19320 ); 19312 19321 path = css; … … 22086 22095 8C0E334D138A92C7008DA94F /* LevelDBTransaction.h in Headers */, 22087 22096 8C0E334F138A92C7008DA94F /* LevelDBWriteBatch.h in Headers */, 22097 501BA9E21393CEA000F7ACEB /* CSSWrapShapes.h in Headers */, 22098 501BAAA913950E2C00F7ACEB /* WindRule.h in Headers */, 22088 22099 84730D911248F0B300D3A9C9 /* LightSource.h in Headers */, 22089 22100 B22279650D00BF220071B782 /* LinearGradientAttributes.h in Headers */, … … 24790 24801 FDF6BAF8134A4C9800822920 /* JSOfflineAudioCompletionEvent.cpp in Sources */, 24791 24802 2E24476813959173004B6C19 /* JSOperationNotAllowedException.cpp in Sources */, 24803 50E566D6139E38C500214433 /* CSSWrapShapes.cpp in Sources */, 24792 24804 A826EC480A1B0CBE00CD1BB6 /* JSOptionConstructor.cpp in Sources */, 24793 24805 1A0D57400A5C7867007EDD4C /* JSOverflowEvent.cpp in Sources */, -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r90642 r90863 1776 1776 case CSSPropertyWebkitTransition: 1777 1777 break; 1778 1779 #if ENABLE(CSS_EXCLUSIONS) 1780 case CSSPropertyWebkitWrapShape: 1781 if (!style->wrapShape()) 1782 return primitiveValueCache->createIdentifierValue(CSSValueAuto); 1783 1784 return primitiveValueCache->createValue(style->wrapShape()); 1785 #endif 1786 1778 1787 #if ENABLE(SVG) 1779 1788 case CSSPropertyClipPath: -
trunk/Source/WebCore/css/CSSParser.cpp
r90642 r90863 83 83 #endif 84 84 85 #if ENABLE(CSS_EXCLUSIONS) 86 #include "CSSWrapShapes.h" 87 #endif 88 85 89 #define YYDEBUG 0 86 90 … … 2077 2081 return parseLineBoxContain(important); 2078 2082 break; 2083 2084 #if ENABLE(CSS_EXCLUSIONS) 2085 case CSSPropertyWebkitWrapShape: 2086 if (id == CSSValueAuto) 2087 validPrimitive = true; 2088 else if (value->unit == CSSParserValue::Function) 2089 return parseWrapShape(important); 2090 break; 2091 #endif 2079 2092 2080 2093 #if ENABLE(SVG) … … 3650 3663 } 3651 3664 3665 #if ENABLE(CSS_EXCLUSIONS) 3666 PassRefPtr<CSSWrapShape> CSSParser::parseWrapShapeRect(CSSParserValueList* args) 3667 { 3668 ASSERT(args); 3669 3670 // rect(x, y, width, height, [[rx], ry]) 3671 if (args->size() != 7 && args->size() != 9 && args->size() != 11) 3672 return 0; 3673 3674 bool valid = true; 3675 3676 RefPtr<CSSWrapShapeRect> shape = CSSWrapShapeRect::create(); 3677 3678 unsigned argumentNumber = 0; 3679 CSSParserValue* argument = args->current(); 3680 while (argument) { 3681 valid = validUnit(argument, FLength, m_strict); 3682 if (!valid) 3683 break; 3684 3685 RefPtr<CSSPrimitiveValue> length = primitiveValueCache()->createValue(argument->fValue, 3686 (CSSPrimitiveValue::UnitTypes) argument->unit); 3687 ASSERT(argumentNumber < 6); 3688 switch (argumentNumber) { 3689 case 0: 3690 shape->setLeft(length); 3691 break; 3692 case 1: 3693 shape->setTop(length); 3694 break; 3695 case 2: 3696 shape->setWidth(length); 3697 break; 3698 case 3: 3699 shape->setHeight(length); 3700 break; 3701 case 4: 3702 shape->setRadiusX(length); 3703 break; 3704 case 5: 3705 shape->setRadiusY(length); 3706 break; 3707 } 3708 argument = args->next(); 3709 if (argument) { 3710 if (argument->unit == CSSParserValue::Operator && argument->iValue == ',') 3711 argument = args->next(); 3712 else { 3713 valid = false; 3714 break; 3715 } 3716 } 3717 argumentNumber++; 3718 } 3719 3720 if (!valid || argumentNumber < 4) 3721 return 0; 3722 return shape; 3723 } 3724 3725 PassRefPtr<CSSWrapShape> CSSParser::parseWrapShapeCircle(CSSParserValueList* args) 3726 { 3727 ASSERT(args); 3728 3729 // circle(x, y, r) 3730 if (args->size() != 5) 3731 return 0; 3732 3733 bool valid = true; 3734 3735 RefPtr<CSSWrapShapeCircle> shape = CSSWrapShapeCircle::create(); 3736 3737 unsigned argumentNumber = 0; 3738 CSSParserValue* argument = args->current(); 3739 while (argument) { 3740 valid = validUnit(argument, FLength, m_strict); 3741 if (!valid) 3742 break; 3743 3744 RefPtr<CSSPrimitiveValue> length = primitiveValueCache()->createValue(argument->fValue, 3745 (CSSPrimitiveValue::UnitTypes) argument->unit); 3746 ASSERT(argumentNumber < 3); 3747 switch (argumentNumber) { 3748 case 0: 3749 shape->setLeft(length); 3750 break; 3751 case 1: 3752 shape->setTop(length); 3753 break; 3754 case 2: 3755 shape->setRadius(length); 3756 break; 3757 } 3758 3759 argument = args->next(); 3760 if (argument) { 3761 if (argument->unit == CSSParserValue::Operator && argument->iValue == ',') 3762 argument = args->next(); 3763 else { 3764 valid = false; 3765 break; 3766 } 3767 } 3768 argumentNumber++; 3769 } 3770 3771 if (!valid || argumentNumber < 3) 3772 return 0; 3773 return shape; 3774 } 3775 3776 PassRefPtr<CSSWrapShape> CSSParser::parseWrapShapeEllipse(CSSParserValueList* args) 3777 { 3778 ASSERT(args); 3779 3780 // ellipse(x, y, rx, ry) 3781 if (args->size() != 7) 3782 return 0; 3783 3784 bool valid = false; 3785 3786 RefPtr<CSSWrapShapeEllipse> shape = CSSWrapShapeEllipse::create(); 3787 unsigned argumentNumber = 0; 3788 CSSParserValue* argument = args->current(); 3789 while (argument) { 3790 valid = validUnit(argument, FLength, m_strict); 3791 if (!valid) 3792 break; 3793 3794 RefPtr<CSSPrimitiveValue> length = primitiveValueCache()->createValue(argument->fValue, 3795 (CSSPrimitiveValue::UnitTypes) argument->unit); 3796 ASSERT(argumentNumber < 4); 3797 switch (argumentNumber) { 3798 case 0: 3799 shape->setLeft(length); 3800 break; 3801 case 1: 3802 shape->setTop(length); 3803 break; 3804 case 2: 3805 shape->setRadiusX(length); 3806 break; 3807 case 3: 3808 shape->setRadiusY(length); 3809 break; 3810 } 3811 3812 argument = args->next(); 3813 if (argument) { 3814 if (argument && argument->unit == CSSParserValue::Operator && argument->iValue == ',') 3815 argument = args->next(); 3816 else { 3817 valid = false; 3818 break; 3819 } 3820 } 3821 argumentNumber++; 3822 } 3823 3824 if (!valid || argumentNumber < 4) 3825 return 0; 3826 return shape; 3827 } 3828 3829 PassRefPtr<CSSWrapShape> CSSParser::parseWrapShapePolygon(CSSParserValueList* args) 3830 { 3831 ASSERT(args); 3832 3833 unsigned size = args->size(); 3834 if (!size) 3835 return 0; 3836 3837 RefPtr<CSSWrapShapePolygon> shape = CSSWrapShapePolygon::create(); 3838 3839 CSSParserValue* argument = args->current(); 3840 if (argument->id == CSSValueEvenodd || argument->id == CSSValueNonzero) { 3841 shape->setWindRule(argument->id == CSSValueEvenodd ? RULE_EVENODD : RULE_NONZERO); 3842 3843 CSSParserValue* comma = args->next(); 3844 if (!comma || comma->unit != CSSParserValue::Operator || comma->iValue != ',') 3845 return 0; 3846 3847 argument = args->next(); 3848 size -= 2; 3849 } 3850 3851 // <length>, <length> ... <length>, <length> -> each pair has 3 elements 3852 if (!size || (size % 3)) 3853 return 0; 3854 3855 CSSParserValue* argumentX = argument; 3856 while (argumentX) { 3857 if (!validUnit(argumentX, FLength, m_strict)) 3858 return 0; 3859 3860 CSSParserValue* comma = args->next(); 3861 if (!comma || comma->unit != CSSParserValue::Operator || comma->iValue != ',') 3862 return 0; 3863 3864 CSSParserValue* argumentY = args->next(); 3865 if (!argumentY || !validUnit(argumentY, FLength, m_strict)) 3866 return 0; 3867 3868 RefPtr<CSSPrimitiveValue> xLength = primitiveValueCache()->createValue(argumentX->fValue, 3869 (CSSPrimitiveValue::UnitTypes) argumentX->unit); 3870 RefPtr<CSSPrimitiveValue> yLength = primitiveValueCache()->createValue(argumentY->fValue, 3871 (CSSPrimitiveValue::UnitTypes) argumentY->unit); 3872 3873 shape->appendPoint(xLength.release(), yLength.release()); 3874 3875 argumentX = args->next(); 3876 } 3877 3878 return shape; 3879 } 3880 3881 bool CSSParser::parseWrapShape(bool important) 3882 { 3883 CSSParserValue* value = m_valueList->current(); 3884 CSSParserValueList* args = value->function->args.get(); 3885 3886 if (!args) 3887 return false; 3888 3889 RefPtr<CSSWrapShape> shape; 3890 3891 if (equalIgnoringCase(value->function->name, "rect(")) 3892 shape = parseWrapShapeRect(args); 3893 else if (equalIgnoringCase(value->function->name, "circle(")) 3894 shape = parseWrapShapeCircle(args); 3895 else if (equalIgnoringCase(value->function->name, "ellipse(")) 3896 shape = parseWrapShapeEllipse(args); 3897 else if (equalIgnoringCase(value->function->name, "polygon(")) 3898 shape = parseWrapShapePolygon(args); 3899 3900 if (shape) { 3901 addProperty(CSSPropertyWebkitWrapShape, primitiveValueCache()->createValue(shape.release()), important); 3902 m_valueList->next(); 3903 return true; 3904 } 3905 3906 return false; 3907 } 3908 #endif // ENABLE(CSS_EXCLUSIONS) 3909 3652 3910 // [ 'font-style' || 'font-variant' || 'font-weight' ]? 'font-size' [ / 'line-height' ]? 'font-family' 3653 3911 bool CSSParser::parseFont(bool important) -
trunk/Source/WebCore/css/CSSParser.h
r90642 r90863 54 54 class WebKitCSSKeyframesRule; 55 55 56 #if ENABLE(CSS_EXCLUSIONS) 57 class CSSWrapShape; 58 #endif 59 56 60 class CSSParser { 57 61 public: … … 125 129 126 130 bool parseShape(int propId, bool important); 131 132 #if ENABLE(CSS_EXCLUSIONS) 133 bool parseWrapShape(bool important); 134 PassRefPtr<CSSWrapShape> parseWrapShapeRect(CSSParserValueList* args); 135 PassRefPtr<CSSWrapShape> parseWrapShapeCircle(CSSParserValueList* args); 136 PassRefPtr<CSSWrapShape> parseWrapShapeEllipse(CSSParserValueList* args); 137 PassRefPtr<CSSWrapShape> parseWrapShapePolygon(CSSParserValueList* args); 138 #endif 127 139 128 140 bool parseFont(bool important); -
trunk/Source/WebCore/css/CSSPrimitiveValue.cpp
r90642 r90863 42 42 #if ENABLE(DASHBOARD_SUPPORT) 43 43 #include "DashboardRegion.h" 44 #endif 45 46 #if ENABLE(CSS_EXCLUSIONS) 47 #include "CSSWrapShapes.h" 44 48 #endif 45 49 … … 211 215 } 212 216 217 #if ENABLE(CSS_EXCLUSIONS) 218 void CSSPrimitiveValue::init(PassRefPtr<CSSWrapShape> shape) 219 { 220 m_type = CSS_SHAPE; 221 m_hasCachedCSSText = false; 222 m_value.shape = shape.releaseRef(); 223 } 224 #endif 225 213 226 CSSPrimitiveValue::~CSSPrimitiveValue() 214 227 { … … 242 255 if (m_value.region) 243 256 m_value.region->deref(); 257 break; 258 #endif 259 #if ENABLE(CSS_EXCLUSIONS) 260 case CSS_SHAPE: 261 m_value.shape->deref(); 244 262 break; 245 263 #endif … … 827 845 text = quoteCSSStringIfNeeded(m_value.string); 828 846 break; 847 #if ENABLE(CSS_EXCLUSIONS) 848 case CSS_SHAPE: 849 text = m_value.shape->cssText(); 850 break; 851 #endif 829 852 } 830 853 -
trunk/Source/WebCore/css/CSSPrimitiveValue.h
r90642 r90863 37 37 class Rect; 38 38 class RenderStyle; 39 40 #if ENABLE(CSS_EXCLUSIONS) 41 class CSSWrapShape; 42 #endif 39 43 40 44 struct Length; … … 96 100 // This is used internally for counter names (as opposed to counter values) 97 101 CSS_COUNTER_NAME = 109, 98 CSS_FROM_FLOW = 110 102 CSS_FROM_FLOW = 110, 103 104 // This is used by the CSS Exclusions draft 105 CSS_SHAPE = 111 99 106 }; 100 107 … … 176 183 DashboardRegion* getDashboardRegionValue() const { return m_type != CSS_DASHBOARD_REGION ? 0 : m_value.region; } 177 184 185 #if ENABLE(CSS_EXCLUSIONS) 186 CSSWrapShape* getShapeValue() const { return m_type != CSS_SHAPE ? 0 : m_value.shape; } 187 #endif 188 178 189 int getIdent() const; 179 190 template<typename T> inline operator T() const; // Defined in CSSPrimitiveValueMappings.h … … 215 226 void init(PassRefPtr<Pair>); 216 227 void init(PassRefPtr<DashboardRegion>); // FIXME: Dashboard region should not be a primitive value. 228 #if ENABLE(CSS_EXCLUSIONS) 229 void init(PassRefPtr<CSSWrapShape>); 230 #endif 217 231 bool getDoubleValueInternal(UnitTypes targetUnitType, double* result) const; 218 232 … … 234 248 Pair* pair; 235 249 DashboardRegion* region; 250 #if ENABLE(CSS_EXCLUSIONS) 251 CSSWrapShape* shape; 252 #endif 236 253 } m_value; 237 254 }; -
trunk/Source/WebCore/css/CSSPropertyNames.in
r90541 r90863 330 330 -webkit-flow 331 331 #endif 332 #if defined(ENABLE_CSS_EXCLUSIONS) && ENABLE_CSS_EXCLUSIONS 333 -webkit-wrap-shape 334 #endif -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r90642 r90863 5333 5333 return; 5334 5334 } 5335 5336 #if ENABLE(CSS_EXCLUSIONS) 5337 case CSSPropertyWebkitWrapShape: 5338 if (isInitial) { 5339 HANDLE_INITIAL_COND(CSSPropertyWebkitWrapShape, WrapShape) 5340 return; 5341 } 5342 5343 if (primitiveValue && primitiveValue->getIdent() == CSSValueAuto) 5344 m_style->setWrapShape(0); 5345 5346 if (primitiveValue && primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_SHAPE) 5347 m_style->setWrapShape(primitiveValue->getShapeValue()); 5348 5349 return; 5350 #endif 5335 5351 5336 5352 // These properties are implemented in the CSSStyleApplyProperty lookup table. -
trunk/Source/WebCore/css/CSSValueKeywords.in
r89864 r90863 811 811 optimizeQuality 812 812 -webkit-optimize-contrast 813 814 #if defined(ENABLE_CSS_EXCLUSIONS) && ENABLE_CSS_EXCLUSIONS 815 // -webkit-wrap-shape 816 nonzero 817 evenodd 818 #endif -
trunk/Source/WebCore/css/SVGCSSValueKeywords.in
r89362 r90863 163 163 // CSS_PROP_CLIP_PATH 164 164 // CSS_PROP_CLIP_RULE 165 #if !defined(ENABLE_CSS_EXCLUSIONS) || !ENABLE_CSS_EXCLUSIONS 166 // CSS exclusions also uses nonzero and evenodd, so don't duplicate the values 167 // if ENABLED_CSS_EXCLUSIONS is enabled. 165 168 nonzero 166 169 evenodd 170 #endif 167 171 168 172 // CSS_PROP_MASK -
trunk/Source/WebCore/platform/graphics/Path.h
r90832 r90863 30 30 31 31 #include "RoundedRect.h" 32 #include "WindRule.h" 32 33 #include <wtf/FastAllocBase.h> 33 34 #include <wtf/Forward.h> … … 81 82 class GraphicsContext; 82 83 class StrokeStyleApplier; 83 84 enum WindRule {85 RULE_NONZERO = 0,86 RULE_EVENODD = 187 };88 84 89 85 enum PathElementType { -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r90832 r90863 36 36 #include <wtf/StdLibExtras.h> 37 37 #include <algorithm> 38 39 #if ENABLE(EXCLUSION) 40 #include "CSSWrapShapes.h" 41 #endif 38 42 39 43 using namespace std; … … 569 573 || rareInheritedData->m_imageRendering != other->rareInheritedData->m_imageRendering) 570 574 return StyleDifferenceRepaint; 575 576 #if ENABLE(CSS_EXCLUSIONS) 577 // FIXME: The current spec is being reworked to remove dependencies between exclusions and affected 578 // content. There's a proposal to use floats instead. In that case, wrap-shape should actually relayout 579 // the parent container. For sure, I will have to revisit this code, but for now I've added this in order 580 // to avoid having diff() == StyleDifferenceEqual where wrap-shapes actually differ. 581 // Tracking bug: https://bugs.webkit.org/show_bug.cgi?id=62991 582 if (rareNonInheritedData->m_wrapShape != other->rareNonInheritedData->m_wrapShape) 583 return StyleDifferenceRepaint; 584 #endif 571 585 572 586 #if USE(ACCELERATED_COMPOSITING) -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r90832 r90863 1150 1150 float floodOpacity() const { return svgStyle()->floodOpacity(); } 1151 1151 void setFloodOpacity(float f) { accessSVGStyle()->setFloodOpacity(f); } 1152 #endif 1153 1154 #if ENABLE(CSS_EXCLUSIONS) 1155 void setWrapShape(PassRefPtr<CSSWrapShape> shape) 1156 { 1157 if (rareNonInheritedData->m_wrapShape != shape) 1158 rareNonInheritedData.access()->m_wrapShape = shape; 1159 } 1160 CSSWrapShape* wrapShape() const { return rareNonInheritedData->m_wrapShape.get(); } 1161 static CSSWrapShape* initialWrapShape() { return 0; } 1152 1162 #endif 1153 1163 -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
r90642 r90863 59 59 , m_flowThread(RenderStyle::initialFlowThread()) 60 60 , m_regionThread(RenderStyle::initialRegionThread()) 61 #endif 62 #if ENABLE(CSS_EXCLUSIONS) 63 , m_wrapShape(RenderStyle::initialWrapShape()) 61 64 #endif 62 65 { … … 103 106 , m_regionThread(o.m_regionThread) 104 107 #endif 108 #if ENABLE(CSS_EXCLUSIONS) 109 , m_wrapShape(o.m_wrapShape) 110 #endif 105 111 { 106 112 } … … 153 159 && (m_regionThread == o.m_regionThread) 154 160 #endif 161 #if ENABLE(CSS_EXCLUSIONS) 162 && (m_wrapShape == o.m_wrapShape) 163 #endif 155 164 ; 156 165 } -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
r90642 r90863 36 36 #include <wtf/PassRefPtr.h> 37 37 #include <wtf/Vector.h> 38 39 #if ENABLE(CSS_EXCLUSIONS) 40 #include "CSSWrapShapes.h" 41 #endif 38 42 39 43 namespace WebCore { … … 137 141 #endif 138 142 143 #if ENABLE(CSS_EXCLUSIONS) 144 RefPtr<CSSWrapShape> m_wrapShape; 145 #endif 146 139 147 private: 140 148 StyleRareNonInheritedData();
Note: See TracChangeset
for help on using the changeset viewer.