Changeset 89396 in webkit
- Timestamp:
- Jun 21, 2011 5:26:01 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r89395 r89396 1 2011-06-21 Tony Chang <tony@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 add css parsing of flex() 6 https://bugs.webkit.org/show_bug.cgi?id=62050 7 8 Add a new script-test, but skip it on all platforms since we don't 9 build with ENABLE_CSS3_FLEXBOX anywhere. 10 11 * css3/flexbox/flex-parsing-expected.txt: Added. 12 * css3/flexbox/flex-parsing.html: Added. 13 * css3/flexbox/script-tests/TEMPLATE.html: Added. 14 * css3/flexbox/script-tests/flex-parsing.js: Added. 15 (testFlex): 16 * platform/chromium/test_expectations.txt: 17 * platform/gtk/Skipped: 18 * platform/mac/Skipped: 19 * platform/qt/Skipped: 20 * platform/win/Skipped: 21 1 22 2011-06-21 Ryosuke Niwa <rniwa@webkit.org> 2 23 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r89395 r89396 3912 3912 BUGCR85293 LINUX : svg/text/foreignObject-text-clipping-bug.xml = IMAGE PASS 3913 3913 3914 // New flexbox is not yet enabled. 3915 BUGWK62048 SKIP : css3/flexbox = PASS 3916 3914 3917 BUGCR85394 : fast/js/eval-var-decl.html = FAIL PASS 3915 3918 BUGCR85755 : fast/js/exception-properties.html = TEXT -
trunk/LayoutTests/platform/gtk/Skipped
r89374 r89396 1536 1536 http/tests/security/webgl-remote-read-remote-image-blocked-no-crossorigin.html 1537 1537 1538 # New flexbox is not yet enabled. http://webkit.org/b/62048 1539 css3/flexbox 1540 1538 1541 # Failing because GTK DumpRenderTree doesn't block external network requests like the 1539 1542 # willSendRequest method does for other ports (bug 62585). -
trunk/LayoutTests/platform/mac/Skipped
r88896 r89396 372 372 svg/zoom/page/zoom-svg-through-object-with-text.xhtml 373 373 374 # New flexbox is not yet enabled. http://webkit.org/b/62048 375 css3/flexbox 376 374 377 # JSC does not support setIsolatedWorldSecurityOrigin (http://webkit.org/b/61540) 375 378 http/tests/security/isolatedWorld/cross-origin-xhr.html -
trunk/LayoutTests/platform/qt/Skipped
r89341 r89396 2542 2542 fast/events/touch/touch-gesture-scroll.html 2543 2543 2544 # New flexbox is not yet enabled. http://webkit.org/b/62048 2545 css3/flexbox 2546 2544 2547 # https://bugs.webkit.org/show_bug.cgi?id=62278 2545 2548 # The profiler test is entirely unrelated to the original change r88337 -
trunk/LayoutTests/platform/win/Skipped
r88801 r89396 1340 1340 http/tests/security/webgl-remote-read-remote-image-blocked-no-crossorigin.html 1341 1341 1342 # New flexbox is not yet enabled. http://webkit.org/b/62048 1343 css3/flexbox 1344 1342 1345 # Causes a SyntaxError (http://webkit.org/b/62595). 1343 1346 fast/workers/worker-crash-with-invalid-location.html -
trunk/Source/WebCore/CMakeLists.txt
r89364 r89396 430 430 css/CSSComputedStyleDeclaration.cpp 431 431 css/CSSCursorImageValue.cpp 432 css/CSSFlexValue.cpp 432 433 css/CSSFontFace.cpp 433 434 css/CSSFontFaceRule.cpp -
trunk/Source/WebCore/ChangeLog
r89394 r89396 1 2011-06-21 Tony Chang <tony@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 add css parsing of flex() 6 https://bugs.webkit.org/show_bug.cgi?id=62050 7 8 Test: css3/flexbox/flex-parsing.html 9 10 * CMakeLists.txt: Add CSSFlexValue.* 11 * GNUmakefile.list.am: Ditto. 12 * WebCore.gypi: Ditto. 13 * WebCore.pro: Ditto. 14 * WebCore.vcproj/WebCore.vcproj: Ditto. 15 * WebCore.xcodeproj/project.pbxproj: Ditto. 16 * css/CSSFlexValue.cpp: Added. 17 (WebCore::CSSFlexValue::~CSSFlexValue): 18 (WebCore::CSSFlexValue::cssText): 19 * css/CSSFlexValue.h: Added. 20 (WebCore::CSSFlexValue::create): Hold positive flex, negative flex and sizing. 21 (WebCore::CSSFlexValue::CSSFlexValue): 22 * css/CSSParser.cpp: 23 (WebCore::CSSParser::parseValidPrimitive): Pull out code from parseValue. 24 (WebCore::CSSParser::parseValue): 25 (WebCore::CSSParser::parseFlex): Parse the different version of flex(). 26 * css/CSSParser.h: 27 1 28 2011-06-21 Adrienne Walker <enne@google.com> 2 29 -
trunk/Source/WebCore/GNUmakefile.list.am
r89321 r89396 923 923 Source/WebCore/css/CSSCursorImageValue.cpp \ 924 924 Source/WebCore/css/CSSCursorImageValue.h \ 925 Source/WebCore/css/CSSFlexValue.cpp \ 926 Source/WebCore/css/CSSFlexValue.h \ 925 927 Source/WebCore/css/CSSFontFace.cpp \ 926 928 Source/WebCore/css/CSSFontFace.h \ -
trunk/Source/WebCore/WebCore.gypi
r89386 r89396 2289 2289 'css/CSSComputedStyleDeclaration.cpp', 2290 2290 'css/CSSCursorImageValue.cpp', 2291 'css/CSSFlexValue.cpp', 2292 'css/CSSFlexValue.h', 2291 2293 'css/CSSFontFace.cpp', 2292 2294 'css/CSSFontFace.h', -
trunk/Source/WebCore/WebCore.pro
r89321 r89396 388 388 css/CSSComputedStyleDeclaration.cpp \ 389 389 css/CSSCursorImageValue.cpp \ 390 css/CSSFlexValue.cpp \ 390 391 css/CSSFontFace.cpp \ 391 392 css/CSSFontFaceRule.cpp \ … … 1377 1378 css/CSSComputedStyleDeclaration.h \ 1378 1379 css/CSSCursorImageValue.h \ 1380 css/CSSFlexValue.h \ 1379 1381 css/CSSFontFace.h \ 1380 1382 css/CSSFontFaceRule.h \ -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r89386 r89396 32407 32407 </File> 32408 32408 <File 32409 RelativePath="..\css\CSSFlexValue.cpp" 32410 > 32411 </File> 32412 <File 32413 RelativePath="..\css\CSSFlexValue.h" 32414 > 32415 </File> 32416 <File 32409 32417 RelativePath="..\css\CSSFontFace.cpp" 32410 32418 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r89325 r89396 1413 1413 521D46F611AEC98100514613 /* KillRingMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 521D46F511AEC98100514613 /* KillRingMac.mm */; }; 1414 1414 521D46F811AEC9B100514613 /* KillRing.h in Headers */ = {isa = PBXBuildFile; fileRef = 521D46F711AEC9B100514613 /* KillRing.h */; }; 1415 5325E4D713A6C88B00404A36 /* CSSFlexValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5325E4D513A6C88B00404A36 /* CSSFlexValue.cpp */; }; 1416 5325E4D813A6C88B00404A36 /* CSSFlexValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 5325E4D613A6C88B00404A36 /* CSSFlexValue.h */; }; 1415 1417 54C50F7B0E801DF3009832A0 /* XMLDocumentParserLibxml2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 54C50F7A0E801DF3009832A0 /* XMLDocumentParserLibxml2.cpp */; }; 1416 1418 550A0BC9085F6039007353D6 /* QualifiedName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 550A0BC7085F6039007353D6 /* QualifiedName.cpp */; }; … … 7932 7934 521D46F511AEC98100514613 /* KillRingMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KillRingMac.mm; sourceTree = "<group>"; }; 7933 7935 521D46F711AEC9B100514613 /* KillRing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KillRing.h; sourceTree = "<group>"; }; 7936 5325E4D513A6C88B00404A36 /* CSSFlexValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFlexValue.cpp; sourceTree = "<group>"; }; 7937 5325E4D613A6C88B00404A36 /* CSSFlexValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFlexValue.h; sourceTree = "<group>"; }; 7934 7938 54C50F7A0E801DF3009832A0 /* XMLDocumentParserLibxml2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLDocumentParserLibxml2.cpp; sourceTree = "<group>"; }; 7935 7939 550A0BC7085F6039007353D6 /* QualifiedName.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = QualifiedName.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; … … 19041 19045 AA0978ED0ABAA6E100874480 /* CSSCursorImageValue.cpp */, 19042 19046 AA0978EE0ABAA6E100874480 /* CSSCursorImageValue.h */, 19047 5325E4D513A6C88B00404A36 /* CSSFlexValue.cpp */, 19048 5325E4D613A6C88B00404A36 /* CSSFlexValue.h */, 19043 19049 BC64B4CD0CB4298A005F2B62 /* CSSFontFace.cpp */, 19044 19050 BC64B4CE0CB4298A005F2B62 /* CSSFontFace.h */, … … 20288 20294 BCEA4790097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h in Headers */, 20289 20295 AA21ECCD0ABF0FC6002B834C /* CSSCursorImageValue.h in Headers */, 20296 5325E4D813A6C88B00404A36 /* CSSFlexValue.h in Headers */, 20290 20297 BC64B4D60CB4298A005F2B62 /* CSSFontFace.h in Headers */, 20291 20298 A80E6CFD0A1989CA007FB8C5 /* CSSFontFaceRule.h in Headers */, … … 23532 23539 BCEA478F097CAAC80094C9E4 /* CSSComputedStyleDeclaration.cpp in Sources */, 23533 23540 AA21ECCA0ABF0FBA002B834C /* CSSCursorImageValue.cpp in Sources */, 23541 5325E4D713A6C88B00404A36 /* CSSFlexValue.cpp in Sources */, 23534 23542 BC64B4D50CB4298A005F2B62 /* CSSFontFace.cpp in Sources */, 23535 23543 A80E6CE70A1989CA007FB8C5 /* CSSFontFaceRule.cpp in Sources */, -
trunk/Source/WebCore/css/CSSParser.cpp
r88448 r89396 30 30 #include "CSSCharsetRule.h" 31 31 #include "CSSCursorImageValue.h" 32 #include "CSSFlexValue.h" 32 33 #include "CSSFontFaceRule.h" 33 34 #include "CSSFontFaceSrcValue.h" … … 780 781 } 781 782 783 inline PassRefPtr<CSSValue> CSSParser::parseValidPrimitive(int id, CSSParserValue* value) 784 { 785 if (id) 786 return primitiveValueCache()->createIdentifierValue(id); 787 if (value->unit == CSSPrimitiveValue::CSS_STRING) 788 return primitiveValueCache()->createValue(value->string, (CSSPrimitiveValue::UnitTypes) value->unit); 789 if (value->unit >= CSSPrimitiveValue::CSS_NUMBER && value->unit <= CSSPrimitiveValue::CSS_KHZ) 790 return primitiveValueCache()->createValue(value->fValue, (CSSPrimitiveValue::UnitTypes) value->unit); 791 if (value->unit >= CSSPrimitiveValue::CSS_TURN && value->unit <= CSSPrimitiveValue::CSS_REMS) 792 return primitiveValueCache()->createValue(value->fValue, (CSSPrimitiveValue::UnitTypes) value->unit); 793 if (value->unit >= CSSParserValue::Q_EMS) 794 return CSSQuirkPrimitiveValue::create(value->fValue, CSSPrimitiveValue::CSS_EMS); 795 return 0; 796 } 797 782 798 bool CSSParser::parseValue(int propId, bool important) 783 799 { … … 1286 1302 case CSSPropertyHeight: // <length> | <percentage> | auto | inherit 1287 1303 case CSSPropertyWidth: // <length> | <percentage> | auto | inherit 1288 case CSSPropertyWebkitLogicalWidth: 1304 case CSSPropertyWebkitLogicalWidth: 1289 1305 case CSSPropertyWebkitLogicalHeight: 1290 1306 if (id == CSSValueAuto || id == CSSValueIntrinsic || id == CSSValueMinIntrinsic) 1291 1307 validPrimitive = true; 1292 else 1308 else if (!id && validUnit(value, FLength | FPercent | FNonNeg, m_strict)) 1293 1309 // ### handle multilength case where we allow relative units 1294 validPrimitive = (!id && validUnit(value, FLength | FPercent | FNonNeg, m_strict)); 1310 validPrimitive = true; 1311 else if (value->unit == CSSParserValue::Function) 1312 return parseFlex(propId, important); 1295 1313 break; 1296 1314 … … 2046 2064 2047 2065 if (validPrimitive) { 2048 if (id != 0) 2049 parsedValue = primitiveValueCache()->createIdentifierValue(id); 2050 else if (value->unit == CSSPrimitiveValue::CSS_STRING) 2051 parsedValue = primitiveValueCache()->createValue(value->string, (CSSPrimitiveValue::UnitTypes) value->unit); 2052 else if (value->unit >= CSSPrimitiveValue::CSS_NUMBER && value->unit <= CSSPrimitiveValue::CSS_KHZ) 2053 parsedValue = primitiveValueCache()->createValue(value->fValue, (CSSPrimitiveValue::UnitTypes) value->unit); 2054 else if (value->unit >= CSSPrimitiveValue::CSS_TURN && value->unit <= CSSPrimitiveValue::CSS_REMS) 2055 parsedValue = primitiveValueCache()->createValue(value->fValue, (CSSPrimitiveValue::UnitTypes) value->unit); 2056 else if (value->unit >= CSSParserValue::Q_EMS) 2057 parsedValue = CSSQuirkPrimitiveValue::create(value->fValue, CSSPrimitiveValue::CSS_EMS); 2066 parsedValue = parseValidPrimitive(id, value); 2058 2067 m_valueList->next(); 2059 2068 } … … 4766 4775 } 4767 4776 4777 bool CSSParser::parseFlex(int propId, bool important) 4778 { 4779 #if ENABLE(CSS3_FLEXBOX) 4780 CSSParserValue* value = m_valueList->current(); 4781 CSSParserValueList* args = value->function->args.get(); 4782 if (!equalIgnoringCase(value->function->name, "-webkit-flex(") || !args || args->size() > 3 || m_valueList->next()) 4783 return false; 4784 4785 static const double unsetValue = -1; 4786 double positiveFlex = unsetValue; 4787 double negativeFlex = unsetValue; 4788 RefPtr<CSSValue> preferredSize; 4789 4790 while (CSSParserValue* arg = args->current()) { 4791 if (validUnit(arg, FNumber | FNonNeg, m_strict)) { 4792 if (positiveFlex == unsetValue) 4793 positiveFlex = arg->fValue; 4794 else if (negativeFlex == unsetValue) 4795 negativeFlex = arg->fValue; 4796 else if (!arg->fValue) { 4797 // flex() only allows a size of 0 if the positive and negative flex values have already been set. 4798 preferredSize = primitiveValueCache()->createValue(0, CSSPrimitiveValue::CSS_PX); 4799 } else { 4800 // We only allow 3 numbers without units if the last value is 0. E.g., flex(1 1 1) is invalid. 4801 return false; 4802 } 4803 } else if (!preferredSize && (arg->id == CSSValueAuto || validUnit(arg, FLength | FPercent | FNonNeg, m_strict))) 4804 preferredSize = parseValidPrimitive(arg->id, arg); 4805 else { 4806 // Not a valid arg for flex(). 4807 return false; 4808 } 4809 args->next(); 4810 } 4811 4812 if (positiveFlex == unsetValue) 4813 positiveFlex = 1; 4814 if (negativeFlex == unsetValue) 4815 negativeFlex = 0; 4816 if (!preferredSize) 4817 preferredSize = primitiveValueCache()->createIdentifierValue(CSSValueAuto); 4818 4819 RefPtr<CSSFlexValue> flex = CSSFlexValue::create(positiveFlex, negativeFlex, preferredSize); 4820 addProperty(propId, flex.release(), important); 4821 return true; 4822 #else 4823 UNUSED_PARAM(propId); 4824 UNUSED_PARAM(important); 4825 #endif // ENABLE(CSS3_FLEXBOX) 4826 return false; 4827 } 4828 4768 4829 struct BorderImageParseContext { 4769 4830 BorderImageParseContext(CSSPrimitiveValueCache* primitiveValueCache) -
trunk/Source/WebCore/css/CSSParser.h
r86135 r89396 65 65 static bool parseColor(RGBA32& color, const String&, bool strict = false); 66 66 static bool parseSystemColor(RGBA32& color, const String&, Document*); 67 PassRefPtr<CSSValue> parseValidPrimitive(int propId, CSSParserValue*); 67 68 bool parseColor(CSSMutableStyleDeclaration*, const String&); 68 69 bool parseDeclaration(CSSMutableStyleDeclaration*, const String&, RefPtr<CSSStyleSourceData>* styleSourceData = 0); … … 162 163 163 164 bool parseReflect(int propId, bool important); 165 166 bool parseFlex(int propId, bool important); 164 167 165 168 // Image generators -
trunk/Source/WebKit/chromium/ChangeLog
r89393 r89396 1 2011-06-21 Tony Chang <tony@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 add css parsing of flex() 6 https://bugs.webkit.org/show_bug.cgi?id=62050 7 8 * features.gypi: Add a gyp flag (enable_css3_flexbox) for setting ENABLE_CSS3_FLEXBOX. 9 1 10 2011-06-21 Zhenyao Mo <zmo@google.com> 2 11 -
trunk/Source/WebKit/chromium/features.gypi
r89305 r89396 109 109 'enable_touch_icon_loading%' : 0, 110 110 'enable_smooth_scrolling%': 0, 111 'enable_css3_flexbox%': 0, 111 112 }, 112 113 'use_accelerated_compositing%': '<(use_accelerated_compositing)', … … 159 160 ], 160 161 }], 162 ['enable_css3_flexbox==1', { 163 'feature_defines': [ 164 'ENABLE_CSS3_FLEXBOX=1', 165 ], 166 }], 161 167 ], 162 168 },
Note: See TracChangeset
for help on using the changeset viewer.