Changeset 139866 in webkit
- Timestamp:
- Jan 16, 2013, 3:30:50 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 37 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/css3/supports-cssom-expected.txt (added)
-
LayoutTests/css3/supports-cssom.html (added)
-
LayoutTests/css3/supports-expected.txt (modified) (1 diff)
-
LayoutTests/css3/supports.html (modified) (3 diffs)
-
LayoutTests/platform/chromium/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/efl/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/gtk/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/mac/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/qt/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/win/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/wincairo/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/wk2/TestExpectations (modified) (1 diff)
-
Source/WebCore/CMakeLists.txt (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/DerivedSources.cpp (modified) (1 diff)
-
Source/WebCore/DerivedSources.make (modified) (1 diff)
-
Source/WebCore/DerivedSources.pri (modified) (1 diff)
-
Source/WebCore/GNUmakefile.list.am (modified) (3 diffs)
-
Source/WebCore/Target.pri (modified) (2 diffs)
-
Source/WebCore/WebCore.exp.in (modified) (1 diff)
-
Source/WebCore/WebCore.gypi (modified) (4 diffs)
-
Source/WebCore/WebCore.vcproj/WebCore.vcproj (modified) (2 diffs)
-
Source/WebCore/WebCore.xcodeproj/project.pbxproj (modified) (11 diffs)
-
Source/WebCore/bindings/js/JSCSSRuleCustom.cpp (modified) (3 diffs)
-
Source/WebCore/bindings/objc/DOMCSS.mm (modified) (2 diffs)
-
Source/WebCore/bindings/v8/custom/V8CSSRuleCustom.cpp (modified) (2 diffs)
-
Source/WebCore/css/CSSGrammar.y.in (modified) (3 diffs)
-
Source/WebCore/css/CSSParser.cpp (modified) (1 diff)
-
Source/WebCore/css/CSSParser.h (modified) (2 diffs)
-
Source/WebCore/css/CSSPropertySourceData.h (modified) (1 diff)
-
Source/WebCore/css/CSSRule.h (modified) (1 diff)
-
Source/WebCore/css/CSSRule.idl (modified) (1 diff)
-
Source/WebCore/css/CSSSupportsRule.cpp (added)
-
Source/WebCore/css/CSSSupportsRule.h (added)
-
Source/WebCore/css/CSSSupportsRule.idl (added)
-
Source/WebCore/css/RuleSet.cpp (modified) (1 diff)
-
Source/WebCore/css/StyleResolver.cpp (modified) (2 diffs)
-
Source/WebCore/css/StyleRule.cpp (modified) (6 diffs)
-
Source/WebCore/css/StyleRule.h (modified) (4 diffs)
-
Source/WebCore/css/StyleSheetContents.cpp (modified) (1 diff)
-
Source/WebCore/inspector/InspectorStyleSheet.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r139865 r139866 1 2013-01-16 Pablo Flouret <pablof@motorola.com> 2 3 Implement CSSSupportsRule 4 https://bugs.webkit.org/show_bug.cgi?id=104822 5 6 Reviewed by Allan Sandfeld Jensen. 7 8 * css3/supports-cssom-expected.txt: Added. 9 * css3/supports-cssom.html: Added. 10 * css3/supports-expected.txt: 11 * css3/supports.html: 12 13 * platform/chromium/TestExpectations: 14 * platform/efl/TestExpectations: 15 * platform/gtk/TestExpectations: 16 * platform/mac/TestExpectations: 17 * platform/qt/TestExpectations: 18 * platform/win/TestExpectations: 19 * platform/wincairo/TestExpectations: 20 * platform/wk2/TestExpectations: 21 1 22 2013-01-16 Kent Tamura <tkent@chromium.org> 2 23 -
trunk/LayoutTests/css3/supports-expected.txt
r131783 r139866 39 39 PASS getComputedStyle(document.getElementById('t33')).content is "APPLIED" 40 40 PASS getComputedStyle(document.getElementById('t34')).content is "UNTOUCHED" 41 PASS getComputedStyle(document.getElementById('t35')).content is "APPLIED" 42 PASS getComputedStyle(document.getElementById('t36')).content is "UNTOUCHED" 41 43 PASS successfullyParsed is true 42 44 -
trunk/LayoutTests/css3/supports.html
r131783 r139866 85 85 } 86 86 87 /* Nesting. */88 @supports (display: none) {89 @supports (display: deadbeef) {90 #t18 { content: "FAIL" }91 }92 @supports (display: inline) {93 #t19 { content: "APPLIED" }94 }95 @supports (display: inline) {96 }97 @media all {98 #t20 { content: "APPLIED" }99 @supports (display: inline) {100 #t21 { content: "APPLIED" }101 }102 }103 }104 105 87 /* Whitespace/Syntax */ 106 88 @supports not( display: deadbeef) { … … 158 140 } 159 141 142 /* Nesting. */ 143 @supports (display: none) { 144 @supports (display: deadbeef) { 145 #t18 { content: "FAIL" } 146 } 147 @supports (display: inline) { 148 #t19 { content: "APPLIED" } 149 } 150 @supports (display: inline) { 151 } 152 @media all { 153 #t20 { content: "APPLIED" } 154 @supports (display: inline) { 155 #t21 { content: "APPLIED" } 156 } 157 } 158 } 159 160 @media all { 161 @supports (display: inline) { 162 @media all { 163 @supports (display: none) { 164 #t35 { content: "APPLIED" } 165 } 166 } 167 } 168 } 169 170 @media not all { 171 @supports (display: none) { 172 #t36 { content: "FAIL" } 173 } 174 } 160 175 </style> 161 176 </head> … … 165 180 <script> 166 181 description("Test the @supports rule."); 167 var numTests = 3 5;168 var untouchedTests = [1, 3, 5, 8, 12, 13, 14, 18, 28, 29, 34 ]; // Tests whose content shouldn't change from the UNTOUCHED default.182 var numTests = 37; 183 var untouchedTests = [1, 3, 5, 8, 12, 13, 14, 18, 28, 29, 34, 36]; // Tests whose content shouldn't change from the UNTOUCHED default. 169 184 170 185 var container = document.getElementById("test_container"); -
trunk/LayoutTests/platform/chromium/TestExpectations
r139865 r139866 3928 3928 # css3-conditionals support is not yet enabled. 3929 3929 webkit.org/b/86146 css3/supports.html 3930 webkit.org/b/104822 css3/supports-cssom.html 3930 3931 3931 3932 # CSS Device Adaptation is not enabled. -
trunk/LayoutTests/platform/efl/TestExpectations
r139861 r139866 1559 1559 # css3-conditionals support is not yet enabled. 1560 1560 webkit.org/b/86146 css3/supports.html 1561 webkit.org/b/104822 css3/supports-cssom.html 1561 1562 1562 1563 # Occasionally fails if run after right after -
trunk/LayoutTests/platform/gtk/TestExpectations
r139855 r139866 403 403 # css3-conditionals support is not yet enabled. 404 404 webkit.org/b/86146 css3/supports.html 405 webkit.org/b/104822 css3/supports-cssom.html 405 406 406 407 # Requires Resolution Media Query support -
trunk/LayoutTests/platform/mac/TestExpectations
r139846 r139866 1162 1162 # css3-conditionals support is not yet enabled. 1163 1163 webkit.org/b/86146 css3/supports.html 1164 webkit.org/b/104822 css3/supports-cssom.html 1164 1165 1165 1166 # CSS Device Adaptation is not enabled. -
trunk/LayoutTests/platform/qt/TestExpectations
r139846 r139866 2397 2397 # css3-conditionals support is not yet enabled. 2398 2398 webkit.org/b/86146 css3/supports.html 2399 webkit.org/b/104822 css3/supports-cssom.html 2399 2400 2400 2401 # CSS Device Adaptation is not enabled. -
trunk/LayoutTests/platform/win/TestExpectations
r139846 r139866 2389 2389 css3/flexbox/flexbox-baseline-margins.html 2390 2390 2391 # css3-conditionals support is not yet enabled. http://webkit.org/b/86146 2391 # css3-conditionals support is not yet enabled. http://webkit.org/b/86146 http://webkit.org/b/104822 2392 2392 css3/supports.html 2393 css3/supports-cssom.html 2393 2394 2394 2395 # https://bugs.webkit.org/show_bug.cgi?id=98169 -
trunk/LayoutTests/platform/wincairo/TestExpectations
r139846 r139866 2894 2894 css3/flexbox/flexbox-baseline-margins.html 2895 2895 2896 # css3-conditionals support is not yet enabled. http://webkit.org/b/86146 2896 # css3-conditionals support is not yet enabled. http://webkit.org/b/86146 http://webkit.org/b/104822 2897 2897 css3/supports.html 2898 css3/supports-cssom.html 2898 2899 2899 2900 # https://bugs.webkit.org/show_bug.cgi?id=98169 -
trunk/LayoutTests/platform/wk2/TestExpectations
r139242 r139866 346 346 # css3-conditionals support is not yet enabled. 347 347 webkit.org/b/86146 css3/supports.html 348 webkit.org/b/104822 css3/supports-cssom.html 348 349 349 350 # Text Autosizing is not yet enabled. -
trunk/Source/WebCore/CMakeLists.txt
r139706 r139866 322 322 css/CSSStyleRule.idl 323 323 css/CSSStyleSheet.idl 324 css/CSSSupportsRule.idl 324 325 css/CSSValue.idl 325 326 css/CSSValueList.idl … … 1056 1057 css/CSSStyleRule.cpp 1057 1058 css/CSSStyleSheet.cpp 1059 css/CSSSupportsRule.cpp 1058 1060 css/CSSTimingFunctionValue.cpp 1059 1061 css/CSSToStyleMap.cpp -
trunk/Source/WebCore/ChangeLog
r139865 r139866 1 2013-01-16 Pablo Flouret <pablof@motorola.com> 2 3 Implement CSSSupportsRule 4 https://bugs.webkit.org/show_bug.cgi?id=104822 5 6 Reviewed by Allan Sandfeld Jensen. 7 8 http://dev.w3.org/csswg/css3-conditional/#the-csssupportsrule-interface 9 10 Right now, @supports is not implemented as a proper CSSRule. Apart from 11 the CSSOM implications it gives wrong results when, for instance, an 12 @supports rule is nested inside a @media rule. 13 14 Test: css3/supports-cssom.html 15 16 * CMakeLists.txt: 17 * DerivedSources.cpp: 18 * DerivedSources.make: 19 * DerivedSources.pri: 20 * GNUmakefile.list.am: 21 * Target.pri: 22 * WebCore.exp.in: 23 * WebCore.gypi: 24 * WebCore.vcproj/WebCore.vcproj: 25 * WebCore.xcodeproj/project.pbxproj: 26 Add CSSSupportsRule.* and associated files. 27 28 * bindings/js/JSCSSRuleCustom.cpp: 29 (WebCore::toJS): 30 * bindings/objc/DOMCSS.mm: 31 (kitClass): 32 * bindings/v8/custom/V8CSSRuleCustom.cpp: 33 (WebCore::wrap): 34 Create the correct wrappers for the rule. 35 36 * css/CSSGrammar.y.in: 37 * css/CSSParser.cpp: 38 (WebCore::CSSParser::createSupportsRule): 39 (WebCore::CSSParser::markSupportsRuleHeaderStart): 40 (WebCore::CSSParser::markSupportsRuleHeaderEnd): 41 * css/CSSParser.h: 42 Create the supports rule when parsing and add it where it corresponds, 43 instead of directly adding the child rules to the stylesheet. 44 45 * css/CSSPropertySourceData.h: 46 * css/CSSRule.h: 47 * css/CSSRule.idl: 48 Add SUPPORTS_RULE type to enums. 49 50 * css/CSSSupportsRule.cpp: Added. 51 (WebCore::CSSSupportsRule::CSSSupportsRule): 52 (WebCore::CSSSupportsRule::~CSSSupportsRule): 53 (WebCore::CSSSupportsRule::cssText): 54 (WebCore::CSSSupportsRule::conditionText): 55 * css/CSSSupportsRule.h: Added. 56 (WebCore::CSSSupportsRule::create): 57 * css/CSSSupportsRule.idl: Added. 58 DOM interface. 59 60 * css/RuleSet.cpp: 61 (WebCore::RuleSet::addChildRules): 62 Add rules included in the @supports rule. 63 64 * css/StyleResolver.cpp: 65 (WebCore::collectCSSOMWrappers): 66 Collect CSSSupportsRule wrappers. 67 68 * css/StyleRule.cpp: 69 (WebCore::StyleRuleBase::reportMemoryUsage): 70 (WebCore::StyleRuleBase::destroy): 71 (WebCore::StyleRuleBase::copy): 72 (WebCore::StyleRuleBase::createCSSOMWrapper): 73 (WebCore::StyleRuleSupports::StyleRuleSupports): 74 * css/StyleRule.h: 75 (StyleRuleBase): 76 (WebCore::StyleRuleBase::isSupportsRule): 77 (StyleRuleSupports): 78 (WebCore::StyleRuleSupports::create): 79 (WebCore::StyleRuleSupports::conditionText): 80 (WebCore::StyleRuleSupports::conditionIsSupported): 81 (WebCore::StyleRuleSupports::copy): 82 (WebCore::toStyleRuleSupports): 83 New subclass of StyleRuleBlock: StyleRuleSupports. 84 85 * css/StyleSheetContents.cpp: 86 (WebCore::childRulesHaveFailedOrCanceledSubresources): 87 * inspector/InspectorStyleSheet.cpp: 88 (flattenSourceData): 89 (WebCore::asCSSRuleList): 90 Handle @supports rules where needed. 91 1 92 2013-01-16 Kent Tamura <tkent@chromium.org> 2 93 -
trunk/Source/WebCore/DerivedSources.cpp
r137507 r139866 65 65 #include "JSCSSStyleRule.cpp" 66 66 #include "JSCSSStyleSheet.cpp" 67 #include "JSCSSSupportsRule.cpp" 67 68 #include "JSCSSValue.cpp" 68 69 #include "JSCSSValueList.cpp" -
trunk/Source/WebCore/DerivedSources.make
r139331 r139866 179 179 $(WebCore)/css/CSSStyleRule.idl \ 180 180 $(WebCore)/css/CSSStyleSheet.idl \ 181 $(WebCore)/css/CSSSupportsRule.idl \ 181 182 $(WebCore)/css/CSSUnknownRule.idl \ 182 183 $(WebCore)/css/CSSValue.idl \ -
trunk/Source/WebCore/DerivedSources.pri
r139331 r139866 199 199 $$PWD/css/CSSStyleRule.idl \ 200 200 $$PWD/css/CSSStyleSheet.idl \ 201 $$PWD/css/CSSSupportsRule.idl \ 201 202 $$PWD/css/CSSValue.idl \ 202 203 $$PWD/css/CSSValueList.idl \ -
trunk/Source/WebCore/GNUmakefile.list.am
r139768 r139866 134 134 DerivedSources/WebCore/JSCSSStyleSheet.cpp \ 135 135 DerivedSources/WebCore/JSCSSStyleSheet.h \ 136 DerivedSources/WebCore/JSCSSSupportsRule.cpp \ 137 DerivedSources/WebCore/JSCSSSupportsRule.h \ 136 138 DerivedSources/WebCore/JSCSSValue.cpp \ 137 139 DerivedSources/WebCore/JSCSSValue.h \ … … 1330 1332 $(WebCore)/css/CSSStyleRule.idl \ 1331 1333 $(WebCore)/css/CSSStyleSheet.idl \ 1334 $(WebCore)/css/CSSSupportsRule.idl \ 1332 1335 $(WebCore)/css/CSSValue.idl \ 1333 1336 $(WebCore)/css/CSSValueList.idl \ … … 2593 2596 Source/WebCore/css/CSSStyleSheet.cpp \ 2594 2597 Source/WebCore/css/CSSStyleSheet.h \ 2598 Source/WebCore/css/CSSSupportsRule.cpp \ 2599 Source/WebCore/css/CSSSupportsRule.h \ 2595 2600 Source/WebCore/css/CSSTimingFunctionValue.cpp \ 2596 2601 Source/WebCore/css/CSSTimingFunctionValue.h \ -
trunk/Source/WebCore/Target.pri
r139666 r139866 288 288 css/CSSStyleRule.cpp \ 289 289 css/CSSStyleSheet.cpp \ 290 css/CSSSupportsRule.cpp \ 290 291 css/CSSTimingFunctionValue.cpp \ 291 292 css/CSSToStyleMap.cpp \ … … 1499 1500 css/CSSStyleRule.h \ 1500 1501 css/CSSStyleSheet.h \ 1502 css/CSSSupportsRule.h \ 1501 1503 css/CSSTimingFunctionValue.h \ 1502 1504 css/CSSToStyleMap.h \ -
trunk/Source/WebCore/WebCore.exp.in
r139796 r139866 1577 1577 .objc_class_name_DOMCSSStyleRule 1578 1578 .objc_class_name_DOMCSSStyleSheet 1579 .objc_class_name_DOMCSSSupportsRule 1579 1580 .objc_class_name_DOMCSSUnknownRule 1580 1581 .objc_class_name_DOMCSSValue -
trunk/Source/WebCore/WebCore.gypi
r139860 r139866 170 170 'css/CSSStyleRule.idl', 171 171 'css/CSSStyleSheet.idl', 172 'css/CSSSupportsRule.idl', 172 173 'css/CSSUnknownRule.idl', 173 174 'css/CSSValue.idl', … … 1506 1507 'css/CSSStyleSheet.cpp', 1507 1508 'css/CSSStyleSheet.h', 1509 'css/CSSSupportsRule.cpp', 1510 'css/CSSSupportsRule.h', 1508 1511 'css/CSSTimingFunctionValue.cpp', 1509 1512 'css/CSSTimingFunctionValue.h', … … 5585 5588 '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMCSSStyleSheet.mm', 5586 5589 '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMCSSStyleSheetInternal.h', 5590 '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMCSSSupportsRule.mm', 5591 '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMCSSSupportsRuleInternal.h', 5587 5592 '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMCSSUnknownRule.mm', 5588 5593 '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMCSSUnknownRuleInternal.h', … … 6145 6150 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSCSSStyleSheet.cpp', 6146 6151 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSCSSStyleSheet.h', 6152 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSCSSSupportsRule.cpp', 6153 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSCSSSupportsRule.h', 6147 6154 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSCSSUnknownRule.cpp', 6148 6155 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSCSSUnknownRule.h', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r139860 r139866 2363 2363 </File> 2364 2364 <File 2365 RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSCSSSupportsRule.cpp" 2366 > 2367 <FileConfiguration 2368 Name="Debug|Win32" 2369 ExcludedFromBuild="true" 2370 > 2371 <Tool 2372 Name="VCCLCompilerTool" 2373 /> 2374 </FileConfiguration> 2375 <FileConfiguration 2376 Name="Release|Win32" 2377 ExcludedFromBuild="true" 2378 > 2379 <Tool 2380 Name="VCCLCompilerTool" 2381 /> 2382 </FileConfiguration> 2383 <FileConfiguration 2384 Name="Debug_Cairo_CFLite|Win32" 2385 ExcludedFromBuild="true" 2386 > 2387 <Tool 2388 Name="VCCLCompilerTool" 2389 /> 2390 </FileConfiguration> 2391 <FileConfiguration 2392 Name="Release_Cairo_CFLite|Win32" 2393 ExcludedFromBuild="true" 2394 > 2395 <Tool 2396 Name="VCCLCompilerTool" 2397 /> 2398 </FileConfiguration> 2399 <FileConfiguration 2400 Name="Debug_All|Win32" 2401 ExcludedFromBuild="true" 2402 > 2403 <Tool 2404 Name="VCCLCompilerTool" 2405 /> 2406 </FileConfiguration> 2407 <FileConfiguration 2408 Name="Production|Win32" 2409 ExcludedFromBuild="true" 2410 > 2411 <Tool 2412 Name="VCCLCompilerTool" 2413 /> 2414 </FileConfiguration> 2415 </File> 2416 <File 2417 RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSCSSSupportsRule.h" 2418 > 2419 </File> 2420 <File 2365 2421 RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSCSSValue.cpp" 2366 2422 > … … 37367 37423 </File> 37368 37424 <File 37425 RelativePath="..\css\CSSSupportsRule.cpp" 37426 > 37427 <FileConfiguration 37428 Name="Debug|Win32" 37429 ExcludedFromBuild="true" 37430 > 37431 <Tool 37432 Name="VCCLCompilerTool" 37433 /> 37434 </FileConfiguration> 37435 <FileConfiguration 37436 Name="Release|Win32" 37437 ExcludedFromBuild="true" 37438 > 37439 <Tool 37440 Name="VCCLCompilerTool" 37441 /> 37442 </FileConfiguration> 37443 <FileConfiguration 37444 Name="Debug_Cairo_CFLite|Win32" 37445 ExcludedFromBuild="true" 37446 > 37447 <Tool 37448 Name="VCCLCompilerTool" 37449 /> 37450 </FileConfiguration> 37451 <FileConfiguration 37452 Name="Release_Cairo_CFLite|Win32" 37453 ExcludedFromBuild="true" 37454 > 37455 <Tool 37456 Name="VCCLCompilerTool" 37457 /> 37458 </FileConfiguration> 37459 <FileConfiguration 37460 Name="Debug_All|Win32" 37461 ExcludedFromBuild="true" 37462 > 37463 <Tool 37464 Name="VCCLCompilerTool" 37465 /> 37466 </FileConfiguration> 37467 <FileConfiguration 37468 Name="Production|Win32" 37469 ExcludedFromBuild="true" 37470 > 37471 <Tool 37472 Name="VCCLCompilerTool" 37473 /> 37474 </FileConfiguration> 37475 </File> 37476 <File 37477 RelativePath="..\css\CSSSupportsRule.h" 37478 > 37479 </File> 37480 <File 37369 37481 RelativePath="..\css\CSSTimingFunctionValue.cpp" 37370 37482 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r139666 r139866 6446 6446 FBD6AF8D15EF260A008B7110 /* BasicShapes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FBD6AF8215EF21A3008B7110 /* BasicShapes.cpp */; }; 6447 6447 FBF89045169E9F1F0052D86E /* CSSGroupingRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FBF89044169E9F1F0052D86E /* CSSGroupingRule.cpp */; }; 6448 FC63BDB3167AABAC00F9380F /* CSSSupportsRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC63BDB0167AABAC00F9380F /* CSSSupportsRule.cpp */; }; 6449 FC63BDB4167AABAC00F9380F /* CSSSupportsRule.h in Sources */ = {isa = PBXBuildFile; fileRef = FC63BDB1167AABAC00F9380F /* CSSSupportsRule.h */; }; 6450 FC7E66E91680EF1F00283716 /* JSCSSSupportsRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC84802D167AB444008CD100 /* JSCSSSupportsRule.cpp */; }; 6451 FC7E66EA1680EF2200283716 /* JSCSSSupportsRule.h in Sources */ = {isa = PBXBuildFile; fileRef = FC84802E167AB444008CD100 /* JSCSSSupportsRule.h */; }; 6452 FCD8832A16A49F8200962227 /* DOMCSSSupportsRule.h in Headers */ = {isa = PBXBuildFile; fileRef = FCD8832816A49F8200962227 /* DOMCSSSupportsRule.h */; }; 6453 FCD8832B16A49F8200962227 /* DOMCSSSupportsRule.mm in Sources */ = {isa = PBXBuildFile; fileRef = FCD8832916A49F8200962227 /* DOMCSSSupportsRule.mm */; }; 6454 FCD8832C16A49FB000962227 /* DOMCSSSupportsRule.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = FCD8832816A49F8200962227 /* DOMCSSSupportsRule.h */; }; 6455 FCEBBAAB16A4967A00FA20A6 /* DOMCSSSupportsRuleInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = FCEBBAAA16A4967A00FA20A6 /* DOMCSSSupportsRuleInternal.h */; }; 6448 6456 FD00D7A414A3F61900734011 /* SincResampler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD00D7A214A3F61900734011 /* SincResampler.cpp */; }; 6449 6457 FD00D7A514A3F61900734011 /* SincResampler.h in Headers */ = {isa = PBXBuildFile; fileRef = FD00D7A314A3F61900734011 /* SincResampler.h */; }; … … 6775 6783 85F74E090AA8DF8C000DC284 /* DOMCSSStyleRule.h in Copy Generated Headers */, 6776 6784 858C39BD0AA905EF00B187A4 /* DOMCSSStyleSheet.h in Copy Generated Headers */, 6785 FCD8832C16A49FB000962227 /* DOMCSSSupportsRule.h in Copy Generated Headers */, 6777 6786 85F74E0A0AA8DF8C000DC284 /* DOMCSSUnknownRule.h in Copy Generated Headers */, 6778 6787 858C39B80AA905EF00B187A4 /* DOMCSSValue.h in Copy Generated Headers */, … … 14025 14034 FBD6AF8715EF21D4008B7110 /* CSSBasicShapes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSBasicShapes.h; sourceTree = "<group>"; }; 14026 14035 FBF89044169E9F1F0052D86E /* CSSGroupingRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSGroupingRule.cpp; sourceTree = "<group>"; }; 14036 FC63BDB0167AABAC00F9380F /* CSSSupportsRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSSupportsRule.cpp; sourceTree = "<group>"; }; 14037 FC63BDB1167AABAC00F9380F /* CSSSupportsRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSSupportsRule.h; sourceTree = "<group>"; }; 14038 FC63BDB2167AABAC00F9380F /* CSSSupportsRule.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CSSSupportsRule.idl; sourceTree = "<group>"; }; 14039 FC84802D167AB444008CD100 /* JSCSSSupportsRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSSupportsRule.cpp; sourceTree = "<group>"; }; 14040 FC84802E167AB444008CD100 /* JSCSSSupportsRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCSSSupportsRule.h; sourceTree = "<group>"; }; 14041 FCD8832816A49F8200962227 /* DOMCSSSupportsRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DOMCSSSupportsRule.h; path = DOMCSSSupportsRule.h; sourceTree = "<group>"; }; 14042 FCD8832916A49F8200962227 /* DOMCSSSupportsRule.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DOMCSSSupportsRule.mm; path = DOMCSSSupportsRule.mm; sourceTree = "<group>"; }; 14043 FCEBBAAA16A4967A00FA20A6 /* DOMCSSSupportsRuleInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DOMCSSSupportsRuleInternal.h; path = DOMCSSSupportsRuleInternal.h; sourceTree = "<group>"; }; 14027 14044 FCEBCD711623A7910029965E /* CSSGrammar.y.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.yacc; path = CSSGrammar.y.in; sourceTree = "<group>"; }; 14028 14045 FCEBCD721623A7910029965E /* CSSGrammar.y.includes */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.yacc; path = CSSGrammar.y.includes; sourceTree = "<group>"; }; … … 16424 16441 858C39260AA8FF9D00B187A4 /* DOMCSSStyleSheet.h */, 16425 16442 858C39270AA8FF9D00B187A4 /* DOMCSSStyleSheet.mm */, 16443 FCD8832816A49F8200962227 /* DOMCSSSupportsRule.h */, 16444 FCD8832916A49F8200962227 /* DOMCSSSupportsRule.mm */, 16426 16445 85032DD50AA8C9BE007D3B7D /* DOMCSSUnknownRule.h */, 16427 16446 85032DD60AA8C9BE007D3B7D /* DOMCSSUnknownRule.mm */, … … 17123 17142 85909CD90ACC7A7E00DF01F1 /* DOMCSSStyleRuleInternal.h */, 17124 17143 85909CDA0ACC7A7E00DF01F1 /* DOMCSSStyleSheetInternal.h */, 17144 FCEBBAAA16A4967A00FA20A6 /* DOMCSSSupportsRuleInternal.h */, 17125 17145 85909CDB0ACC7A7E00DF01F1 /* DOMCSSUnknownRuleInternal.h */, 17126 17146 85B498F20ADB336A00925CBB /* DOMCSSValueInternal.h */, … … 19242 19262 BCC5BDFE0C0E93110011C2DB /* JSCSSStyleSheet.cpp */, 19243 19263 BCC5BDFF0C0E93110011C2DB /* JSCSSStyleSheet.h */, 19264 FC84802D167AB444008CD100 /* JSCSSSupportsRule.cpp */, 19265 FC84802E167AB444008CD100 /* JSCSSSupportsRule.h */, 19244 19266 14CF78A309F58CBF00EB3665 /* JSCSSValue.cpp */, 19245 19267 14CF78A509F58CD800EB3665 /* JSCSSValue.h */, … … 21597 21619 A8EA7FFF0A19516E00A8EF5F /* CSSStyleSheet.h */, 21598 21620 858C39100AA8FF0000B187A4 /* CSSStyleSheet.idl */, 21621 FC63BDB0167AABAC00F9380F /* CSSSupportsRule.cpp */, 21622 FC63BDB1167AABAC00F9380F /* CSSSupportsRule.h */, 21623 FC63BDB2167AABAC00F9380F /* CSSSupportsRule.idl */, 21599 21624 BC80C9850CD294EE00A0B7B3 /* CSSTimingFunctionValue.cpp */, 21600 21625 BC80C9860CD294EE00A0B7B3 /* CSSTimingFunctionValue.h */, … … 23219 23244 858C39280AA8FF9D00B187A4 /* DOMCSSStyleSheet.h in Headers */, 23220 23245 85909CE30ACC7A7E00DF01F1 /* DOMCSSStyleSheetInternal.h in Headers */, 23246 FCD8832A16A49F8200962227 /* DOMCSSSupportsRule.h in Headers */, 23247 FCEBBAAB16A4967A00FA20A6 /* DOMCSSSupportsRuleInternal.h in Headers */, 23221 23248 85032DE90AA8C9BE007D3B7D /* DOMCSSUnknownRule.h in Headers */, 23222 23249 85909CE40ACC7A7E00DF01F1 /* DOMCSSUnknownRuleInternal.h in Headers */, … … 26688 26715 A80E6CEF0A1989CA007FB8C5 /* CSSStyleRule.cpp in Sources */, 26689 26716 A8EA80080A19516E00A8EF5F /* CSSStyleSheet.cpp in Sources */, 26717 FC63BDB3167AABAC00F9380F /* CSSSupportsRule.cpp in Sources */, 26718 FC63BDB4167AABAC00F9380F /* CSSSupportsRule.h in Sources */, 26690 26719 BC80C9870CD294EE00A0B7B3 /* CSSTimingFunctionValue.cpp in Sources */, 26691 26720 A882DA201593846A000115ED /* CSSToStyleMap.cpp in Sources */, … … 26808 26837 85032DE80AA8C9BE007D3B7D /* DOMCSSStyleRule.mm in Sources */, 26809 26838 858C39290AA8FF9D00B187A4 /* DOMCSSStyleSheet.mm in Sources */, 26839 FCD8832B16A49F8200962227 /* DOMCSSSupportsRule.mm in Sources */, 26810 26840 85032DEA0AA8C9BE007D3B7D /* DOMCSSUnknownRule.mm in Sources */, 26811 26841 858C381D0AA8E29600B187A4 /* DOMCSSValue.mm in Sources */, … … 27624 27654 E1AD14E81297377400ACA989 /* JSCSSStyleRuleCustom.cpp in Sources */, 27625 27655 BCC5BE000C0E93110011C2DB /* JSCSSStyleSheet.cpp in Sources */, 27656 FC7E66E91680EF1F00283716 /* JSCSSSupportsRule.cpp in Sources */, 27657 FC7E66EA1680EF2200283716 /* JSCSSSupportsRule.h in Sources */, 27626 27658 14CF78A409F58CBF00EB3665 /* JSCSSValue.cpp in Sources */, 27627 27659 BC20FB7F0C0E8E6C00D1447F /* JSCSSValueCustom.cpp in Sources */, -
trunk/Source/WebCore/bindings/js/JSCSSRuleCustom.cpp
r135564 r139866 33 33 #include "CSSPageRule.h" 34 34 #include "CSSStyleRule.h" 35 #include "CSSSupportsRule.h" 35 36 #include "JSCSSCharsetRule.h" 36 37 #include "JSCSSFontFaceRule.h" … … 39 40 #include "JSCSSPageRule.h" 40 41 #include "JSCSSStyleRule.h" 42 #include "JSCSSSupportsRule.h" 41 43 #include "JSNode.h" 42 44 #include "JSWebKitCSSKeyframeRule.h" … … 97 99 wrapper = CREATE_DOM_WRAPPER(exec, globalObject, WebKitCSSKeyframesRule, rule); 98 100 break; 101 #if ENABLE(CSS3_CONDITIONAL_RULES) 102 case CSSRule::SUPPORTS_RULE: 103 wrapper = CREATE_DOM_WRAPPER(exec, globalObject, CSSSupportsRule, rule); 104 break; 105 #endif 99 106 #if ENABLE(CSS_DEVICE_ADAPTATION) 100 107 case CSSRule::WEBKIT_VIEWPORT_RULE: -
trunk/Source/WebCore/bindings/objc/DOMCSS.mm
r135564 r139866 41 41 #import "DOMCSSStyleRule.h" 42 42 #import "DOMCSSStyleSheet.h" 43 #if ENABLE(CSS3_CONDITIONAL_RULES) 44 #import "DOMCSSSupportsRule.h" 45 #endif 43 46 #import "DOMCSSUnknownRule.h" 44 47 #import "DOMCSSValueInternal.h" … … 100 103 case DOM_WEBKIT_KEYFRAME_RULE: 101 104 return [DOMWebKitCSSKeyframeRule class]; 105 #if ENABLE(CSS3_CONDITIONAL_RULES) 106 case DOM_SUPPORTS_RULE: 107 return [DOMCSSSupportsRule class]; 108 #endif 102 109 #if ENABLE(CSS_DEVICE_ADAPTATION) 103 110 case DOM_WEBKIT_VIEWPORT_RULE: -
trunk/Source/WebCore/bindings/v8/custom/V8CSSRuleCustom.cpp
r135564 r139866 38 38 #include "V8CSSPageRule.h" 39 39 #include "V8CSSStyleRule.h" 40 #if ENABLE(CSS3_CONDITIONAL_RULES) 41 #include "V8CSSSupportsRule.h" 42 #endif 40 43 #include "V8WebKitCSSKeyframeRule.h" 41 44 #include "V8WebKitCSSKeyframesRule.h" … … 73 76 case CSSRule::WEBKIT_KEYFRAMES_RULE: 74 77 return wrap(static_cast<WebKitCSSKeyframesRule*>(impl), creationContext, isolate); 78 #if ENABLE(CSS3_CONDITIONAL_RULES) 79 case CSSRule::SUPPORTS_RULE: 80 return wrap(static_cast<CSSSupportsRule*>(impl), creationContext, isolate); 81 #endif 75 82 #if ENABLE(CSS_DEVICE_ADAPTATION) 76 83 case CSSRule::WEBKIT_VIEWPORT_RULE: -
trunk/Source/WebCore/css/CSSGrammar.y.in
r139594 r139866 465 465 | media 466 466 | keyframes 467 #if ENABLE_CSS3_CONDITIONAL_RULES 468 | supports 469 #endif 467 470 #if ENABLE_CSS_DEVICE_ADAPTATION 468 471 | viewport … … 477 480 | import 478 481 | region 479 #if ENABLE_CSS3_CONDITIONAL_RULES480 | supports481 #endif482 482 ; 483 483 … … 677 677 #if ENABLE_CSS3_CONDITIONAL_RULES 678 678 supports: 679 SUPPORTS_SYM maybe_space supports_condition '{' maybe_space block_rule_list save_block { 680 CSSParser* p = static_cast<CSSParser*>(parser); 681 if ($3 && $6 && p->m_styleSheet) { 682 for (unsigned i = 0; i < $6->size(); i++) 683 p->m_styleSheet->parserAppendRule($6->at(i).release()); 684 } 685 $$ = 0; 679 before_supports_rule SUPPORTS_SYM maybe_space supports_condition at_supports_rule_header_end '{' at_rule_body_start maybe_space block_rule_list save_block { 680 $$ = parser->createSupportsRule($4, $9); 681 } 682 ; 683 684 before_supports_rule: 685 /* empty */ { 686 parser->markRuleHeaderStart(CSSRuleSourceData::SUPPORTS_RULE); 687 parser->markSupportsRuleHeaderStart(); 688 } 689 ; 690 691 at_supports_rule_header_end: 692 /* empty */ { 693 parser->markRuleHeaderEnd(); 694 parser->markSupportsRuleHeaderEnd(); 686 695 } 687 696 ; -
trunk/Source/WebCore/css/CSSParser.cpp
r139836 r139866 10704 10704 } 10705 10705 10706 #if ENABLE(CSS3_CONDITIONAL_RULES) 10707 StyleRuleBase* CSSParser::createSupportsRule(bool conditionIsSupported, RuleList* rules) 10708 { 10709 m_allowImportRules = m_allowNamespaceDeclarations = false; 10710 10711 ASSERT(!m_supportsRuleDataStack->isEmpty()); 10712 RefPtr<CSSRuleSourceData> data = m_supportsRuleDataStack->last(); 10713 m_supportsRuleDataStack->removeLast(); 10714 if (m_supportsRuleDataStack->isEmpty()) 10715 m_supportsRuleDataStack.clear(); 10716 10717 RefPtr<StyleRuleSupports> rule; 10718 String conditionText; 10719 unsigned conditionOffset = data->ruleHeaderRange.start + 9; 10720 unsigned conditionLength = data->ruleHeaderRange.length() - 9; 10721 10722 if (is8BitSource()) 10723 conditionText = String(m_dataStart8.get() + conditionOffset, conditionLength).stripWhiteSpace(); 10724 else 10725 conditionText = String(m_dataStart16.get() + conditionOffset, conditionLength).stripWhiteSpace(); 10726 10727 if (rules) 10728 rule = StyleRuleSupports::create(conditionText, conditionIsSupported, *rules); 10729 else { 10730 RuleList emptyRules; 10731 rule = StyleRuleSupports::create(conditionText, conditionIsSupported, emptyRules); 10732 } 10733 10734 StyleRuleSupports* result = rule.get(); 10735 m_parsedRules.append(rule.release()); 10736 processAndAddNewRuleToSourceTreeIfNeeded(); 10737 10738 return result; 10739 } 10740 10741 void CSSParser::markSupportsRuleHeaderStart() 10742 { 10743 if (!m_supportsRuleDataStack) 10744 m_supportsRuleDataStack = adoptPtr(new RuleSourceDataList()); 10745 10746 RefPtr<CSSRuleSourceData> data = CSSRuleSourceData::create(CSSRuleSourceData::SUPPORTS_RULE); 10747 data->ruleHeaderRange.start = tokenStartOffset(); 10748 m_supportsRuleDataStack->append(data); 10749 } 10750 10751 void CSSParser::markSupportsRuleHeaderEnd() 10752 { 10753 ASSERT(!m_supportsRuleDataStack->isEmpty()); 10754 10755 if (is8BitSource()) 10756 m_supportsRuleDataStack->last()->ruleHeaderRange.end = tokenStart<LChar>() - m_dataStart8.get(); 10757 else 10758 m_supportsRuleDataStack->last()->ruleHeaderRange.end = tokenStart<UChar>() - m_dataStart16.get(); 10759 } 10760 #endif 10761 10706 10762 CSSParser::RuleList* CSSParser::createRuleList() 10707 10763 { -
trunk/Source/WebCore/css/CSSParser.h
r139836 r139866 293 293 StyleRuleBase* createRegionRule(Vector<OwnPtr<CSSParserSelector> >* regionSelector, RuleList* rules); 294 294 StyleRuleBase* createMarginAtRule(CSSSelector::MarginBoxType); 295 #if ENABLE(CSS3_CONDITIONAL_RULES) 296 StyleRuleBase* createSupportsRule(bool conditionIsSupported, RuleList*); 297 void markSupportsRuleHeaderStart(); 298 void markSupportsRuleHeaderEnd(); 299 #endif 295 300 #if ENABLE(SHADOW_DOM) 296 301 StyleRuleBase* createHostRule(RuleList* rules); … … 567 572 RefPtr<CSSCalcValue> m_parsedCalculation; 568 573 574 #if ENABLE(CSS3_CONDITIONAL_RULES) 575 OwnPtr<RuleSourceDataList> m_supportsRuleDataStack; 576 #endif 577 569 578 // defines units allowed for a certain property, used in parseUnit 570 579 enum Units { -
trunk/Source/WebCore/css/CSSPropertySourceData.h
r136370 r139866 98 98 REGION_RULE, 99 99 HOST_RULE, 100 VIEWPORT_RULE 100 VIEWPORT_RULE, 101 SUPPORTS_RULE 101 102 }; 102 103 -
trunk/Source/WebCore/css/CSSRule.h
r135465 r139866 51 51 WEBKIT_KEYFRAMES_RULE, 52 52 WEBKIT_KEYFRAME_RULE, 53 #if ENABLE(CSS3_CONDITIONAL_RULES) 54 SUPPORTS_RULE = 12, 55 #endif 53 56 #if ENABLE(CSS_DEVICE_ADAPTATION) 54 57 WEBKIT_VIEWPORT_RULE = 15, -
trunk/Source/WebCore/css/CSSRule.idl
r135564 r139866 38 38 const unsigned short WEBKIT_KEYFRAMES_RULE = 7; 39 39 const unsigned short WEBKIT_KEYFRAME_RULE = 8; 40 #if defined(ENABLE_CSS3_CONDITIONAL_RULES) && ENABLE_CSS3_CONDITIONAL_RULES 41 const unsigned short SUPPORTS_RULE = 12; 42 #endif 40 43 #if defined(ENABLE_CSS_DEVICE_ADAPTATION) && ENABLE_CSS_DEVICE_ADAPTATION 41 44 const unsigned short WEBKIT_VIEWPORT_RULE = 15; -
trunk/Source/WebCore/css/RuleSet.cpp
r139594 r139866 321 321 } 322 322 #endif 323 #if ENABLE(CSS3_CONDITIONAL_RULES) 324 else if (rule->isSupportsRule() && static_cast<StyleRuleSupports*>(rule)->conditionIsSupported()) 325 addChildRules(static_cast<StyleRuleSupports*>(rule)->childRules(), medium, resolver, scope, hasDocumentSecurityOrigin, addRuleFlags); 326 #endif 323 327 } 324 328 } -
trunk/Source/WebCore/css/StyleResolver.cpp
r139824 r139866 49 49 #include "CSSStyleRule.h" 50 50 #include "CSSStyleSheet.h" 51 #include "CSSSupportsRule.h" 51 52 #include "CSSTimingFunctionValue.h" 52 53 #include "CSSValueList.h" … … 2639 2640 collectCSSOMWrappers(wrapperMap, static_cast<CSSMediaRule*>(cssRule)); 2640 2641 break; 2642 #if ENABLE(CSS3_CONDITIONAL_RULES) 2643 case CSSRule::SUPPORTS_RULE: 2644 collectCSSOMWrappers(wrapperMap, static_cast<CSSSupportsRule*>(cssRule)); 2645 break; 2646 #endif 2641 2647 #if ENABLE(CSS_REGIONS) 2642 2648 case CSSRule::WEBKIT_REGION_RULE: -
trunk/Source/WebCore/css/StyleRule.cpp
r137417 r139866 29 29 #include "CSSPageRule.h" 30 30 #include "CSSStyleRule.h" 31 #include "CSSSupportsRule.h" 31 32 #include "CSSUnknownRule.h" 32 33 #include "StyleRuleImport.h" … … 82 83 static_cast<const StyleRuleKeyframes*>(this)->reportDescendantMemoryUsage(memoryObjectInfo); 83 84 return; 85 #if ENABLE(CSS3_CONDITIONAL_RULES) 86 case Supports: 87 #endif 84 88 #if ENABLE(SHADOW_DOM) 85 89 case Host: … … 119 123 delete static_cast<StyleRuleMedia*>(this); 120 124 return; 125 #if ENABLE(CSS3_CONDITIONAL_RULES) 126 case Supports: 127 delete static_cast<StyleRuleSupports*>(this); 128 return; 129 #endif 121 130 #if ENABLE(CSS_REGIONS) 122 131 case Region: … … 163 172 case Media: 164 173 return static_cast<const StyleRuleMedia*>(this)->copy(); 174 #if ENABLE(CSS3_CONDITIONAL_RULES) 175 case Supports: 176 return static_cast<const StyleRuleSupports*>(this)->copy(); 177 #endif 165 178 #if ENABLE(CSS_REGIONS) 166 179 case Region: … … 211 224 rule = CSSMediaRule::create(static_cast<StyleRuleMedia*>(self), parentSheet); 212 225 break; 226 #if ENABLE(CSS3_CONDITIONAL_RULES) 227 case Supports: 228 rule = CSSSupportsRule::create(static_cast<StyleRuleSupports*>(self), parentSheet); 229 break; 230 #endif 213 231 #if ENABLE(CSS_REGIONS) 214 232 case Region: … … 405 423 } 406 424 425 426 #if ENABLE(CSS3_CONDITIONAL_RULES) 427 StyleRuleSupports::StyleRuleSupports(const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase> >& adoptRules) 428 : StyleRuleBlock(Supports, adoptRules) 429 , m_conditionText(conditionText) 430 , m_conditionIsSupported(conditionIsSupported) 431 { 432 } 433 434 StyleRuleSupports::StyleRuleSupports(const StyleRuleSupports& o) 435 : StyleRuleBlock(o) 436 , m_conditionText(o.m_conditionText) 437 , m_conditionIsSupported(o.m_conditionIsSupported) 438 { 439 } 440 #endif 441 407 442 StyleRuleRegion::StyleRuleRegion(Vector<OwnPtr<CSSParserSelector> >* selectors, Vector<RefPtr<StyleRuleBase> >& adoptRules) 408 443 : StyleRuleBlock(Region, adoptRules) -
trunk/Source/WebCore/css/StyleRule.h
r139409 r139866 50 50 Host, 51 51 #endif 52 #if ENABLE(CSS3_CONDITIONAL_RULES) 53 Supports = 12, 54 #endif 52 55 #if ENABLE(CSS_DEVICE_ADAPTATION) 53 56 Viewport = 15, … … 64 67 bool isStyleRule() const { return type() == Style; } 65 68 bool isRegionRule() const { return type() == Region; } 69 #if ENABLE(CSS3_CONDITIONAL_RULES) 70 bool isSupportsRule() const { return type() == Supports; } 71 #endif 66 72 #if ENABLE(CSS_DEVICE_ADAPTATION) 67 73 bool isViewportRule() const { return type() == Viewport; } … … 215 221 RefPtr<MediaQuerySet> m_mediaQueries; 216 222 }; 223 224 #if ENABLE(CSS3_CONDITIONAL_RULES) 225 class StyleRuleSupports : public StyleRuleBlock { 226 public: 227 static PassRefPtr<StyleRuleSupports> create(const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase> >& adoptRules) 228 { 229 return adoptRef(new StyleRuleSupports(conditionText, conditionIsSupported, adoptRules)); 230 } 231 232 String conditionText() const { return m_conditionText; } 233 bool conditionIsSupported() const { return m_conditionIsSupported; } 234 PassRefPtr<StyleRuleSupports> copy() const { return adoptRef(new StyleRuleSupports(*this)); } 235 236 private: 237 StyleRuleSupports(const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase> >& adoptRules); 238 StyleRuleSupports(const StyleRuleSupports&); 239 240 String m_conditionText; 241 bool m_conditionIsSupported; 242 }; 243 #endif 217 244 218 245 class StyleRuleRegion : public StyleRuleBlock { … … 282 309 } 283 310 311 #if ENABLE(CSS3_CONDITIONAL_RULES) 312 inline const StyleRuleSupports* toStyleRuleSupports(const StyleRuleBlock* rule) 313 { 314 ASSERT(!rule || rule->isSupportsRule()); 315 return static_cast<const StyleRuleSupports*>(rule); 316 } 317 #endif 318 284 319 inline const StyleRuleRegion* toStyleRuleRegion(const StyleRuleBlock* rule) 285 320 { -
trunk/Source/WebCore/css/StyleSheetContents.cpp
r139589 r139866 457 457 case StyleRuleBase::Charset: 458 458 case StyleRuleBase::Keyframe: 459 #if ENABLE(CSS3_CONDITIONAL_RULES) 460 case StyleRuleBase::Supports: 461 #endif 459 462 #if ENABLE(CSS_DEVICE_ADAPTATION) 460 463 case StyleRuleBase::Viewport: -
trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp
r138460 r139866 38 38 #include "CSSStyleRule.h" 39 39 #include "CSSStyleSheet.h" 40 #include "CSSSupportsRule.h" 40 41 #include "ContentSecurityPolicy.h" 41 42 #include "Document.h" … … 110 111 else if (data->type == CSSRuleSourceData::MEDIA_RULE) 111 112 flattenSourceData(&data->childRules, target); 113 #if ENABLE(CSS3_CONDITIONAL_RULES) 114 else if (data->type == CSSRuleSourceData::SUPPORTS_RULE) 115 flattenSourceData(&data->childRules, target); 116 #endif 112 117 } 113 118 } … … 209 214 if (rule->type() == CSSRule::WEBKIT_KEYFRAMES_RULE) 210 215 return static_cast<WebKitCSSKeyframesRule*>(rule)->cssRules(); 216 217 #if ENABLE(CSS3_CONDITIONAL_RULES) 218 if (rule->type() == CSSRule::SUPPORTS_RULE) 219 return static_cast<CSSSupportsRule*>(rule)->cssRules(); 220 #endif 211 221 212 222 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.