Changeset 142739 in webkit


Ignore:
Timestamp:
Feb 13, 2013 5:45:05 AM (4 years ago)
Author:
commit-queue@webkit.org
Message:

Implement css-conditional's CSS.supports()
https://bugs.webkit.org/show_bug.cgi?id=100324

Patch by Pablo Flouret <pablof@motorola.com> on 2013-02-13
Reviewed by Antti Koivisto.

Source/WebCore:

http://dev.w3.org/csswg/css3-conditional/#the-css-interface

The supports() method provides the css @supports rule's corresponding
dom api.
The patch also adds the CSS interface on DOMWindow, which holds "useful
CSS-related functions that do not belong elsewhere". This is where
supports() lives.

Test: css3/supports-dom-api.html

  • CMakeLists.txt:
  • DerivedSources.cpp:
  • DerivedSources.make:
  • DerivedSources.pri:
  • GNUmakefile.list.am:
  • Target.pri:
  • WebCore.exp.in:
  • WebCore.gypi:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/gobject/GNUmakefile.am:
  • bindings/scripts/CodeGeneratorGObject.pm:

(SkipFunction):

Add DOMWindowCSS.* to the build systems.

  • bindings/scripts/CodeGenerator.pm:

(WK_lcfirst):

Handle CSS prefixes correctly (s/cSS/css/).

  • css/CSSGrammar.y.in:
  • css/CSSParser.cpp:

(WebCore::CSSParser::CSSParser):
(WebCore::CSSParser::parseSupportsCondition):
(WebCore::CSSParser::detectAtToken):

  • css/CSSParser.h:

webkit_supports_condition parses just the condition part of an
@supports rule and evaluates it, outputting whether the condition
is supported or not.

  • css/CSSAllInOne.cpp:
  • css/DOMWindowCSS.cpp: Added.
  • css/DOMWindowCSS.h: Added.
  • css/DOMWindowCSS.idl: Added.

The CSS interface object.

  • page/DOMWindow.cpp:

(WebCore::DOMWindow::css):

  • page/DOMWindow.h:
  • page/DOMWindow.idl:

window.CSS

LayoutTests:

  • css3/supports-dom-api-expected.txt: Added.
  • css3/supports-dom-api.html: Added.
  • platform/chromium/TestExpectations:
  • platform/efl/TestExpectations:
  • platform/gtk/TestExpectations:
  • platform/mac/TestExpectations:
  • platform/qt/TestExpectations:
  • platform/win/TestExpectations:
  • platform/wincairo/TestExpectations:
  • platform/wk2/TestExpectations:
Location:
trunk
Files:
5 added
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r142734 r142739  
     12013-02-13  Pablo Flouret  <pablof@motorola.com>
     2
     3        Implement css-conditional's CSS.supports()
     4        https://bugs.webkit.org/show_bug.cgi?id=100324
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * css3/supports-dom-api-expected.txt: Added.
     9        * css3/supports-dom-api.html: Added.
     10        * platform/chromium/TestExpectations:
     11        * platform/efl/TestExpectations:
     12        * platform/gtk/TestExpectations:
     13        * platform/mac/TestExpectations:
     14        * platform/qt/TestExpectations:
     15        * platform/win/TestExpectations:
     16        * platform/wincairo/TestExpectations:
     17        * platform/wk2/TestExpectations:
     18
    1192013-02-13  Mike West  <mkwst@chromium.org>
    220
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r142723 r142739  
    39233923webkit.org/b/86146 css3/supports.html
    39243924webkit.org/b/104822 css3/supports-cssom.html
     3925webkit.org/b/100324 css3/supports-dom-api.html
    39253926
    39263927# CSS Device Adaptation is not enabled.
  • trunk/LayoutTests/platform/efl/TestExpectations

    r142683 r142739  
    15931593webkit.org/b/86146 css3/supports.html
    15941594webkit.org/b/104822 css3/supports-cssom.html
     1595webkit.org/b/100324 css3/supports-dom-api.html
    15951596
    15961597# Occasionally fails if run after right after
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r142723 r142739  
    412412webkit.org/b/86146 css3/supports.html
    413413webkit.org/b/104822 css3/supports-cssom.html
     414webkit.org/b/100324 css3/supports-dom-api.html
    414415
    415416# Requires Resolution Media Query support
  • trunk/LayoutTests/platform/mac/TestExpectations

    r142686 r142739  
    11791179webkit.org/b/86146 css3/supports.html
    11801180webkit.org/b/104822 css3/supports-cssom.html
     1181webkit.org/b/100324 css3/supports-dom-api.html
    11811182
    11821183# CSS Device Adaptation is not enabled.
  • trunk/LayoutTests/platform/qt/TestExpectations

    r142729 r142739  
    24842484webkit.org/b/86146 css3/supports.html
    24852485webkit.org/b/104822 css3/supports-cssom.html
     2486webkit.org/b/100324 css3/supports-dom-api.html
    24862487
    24872488# CSS Device Adaptation is not enabled.
  • trunk/LayoutTests/platform/win/TestExpectations

    r142694 r142739  
    24102410css3/flexbox/flexbox-baseline-margins.html
    24112411
    2412 # css3-conditionals support is not yet enabled. http://webkit.org/b/86146 http://webkit.org/b/104822
     2412# css3-conditionals support is not yet enabled. http://webkit.org/b/86146 http://webkit.org/b/104822 http://webkit.org/b/100324
    24132413css3/supports.html
    24142414css3/supports-cssom.html
     2415css3/supports-dom-api.html
    24152416
    24162417# https://bugs.webkit.org/show_bug.cgi?id=98169
  • trunk/LayoutTests/platform/wincairo/TestExpectations

    r142694 r142739  
    29092909css3/flexbox/flexbox-baseline-margins.html
    29102910
    2911 # css3-conditionals support is not yet enabled. http://webkit.org/b/86146 http://webkit.org/b/104822
     2911# css3-conditionals support is not yet enabled. http://webkit.org/b/86146 http://webkit.org/b/104822 http://webkit.org/b/100324
    29122912css3/supports.html
    29132913css3/supports-cssom.html
     2914css3/supports-dom-api.html
    29142915
    29152916# https://bugs.webkit.org/show_bug.cgi?id=98169
  • trunk/LayoutTests/platform/wk2/TestExpectations

    r142683 r142739  
    330330webkit.org/b/86146 css3/supports.html
    331331webkit.org/b/104822 css3/supports-cssom.html
     332webkit.org/b/100324 css3/supports-dom-api.html
    332333
    333334# Text Autosizing is not yet enabled.
  • trunk/Source/WebCore/CMakeLists.txt

    r142698 r142739  
    319319    css/CSSValue.idl
    320320    css/CSSValueList.idl
     321    css/DOMWindowCSS.idl
    321322    css/MediaList.idl
    322323    css/MediaQueryList.idl
     
    10641065    css/CSSValueList.cpp
    10651066    css/CSSValuePool.cpp
     1067    css/DOMWindowCSS.cpp
    10661068    css/DocumentRuleSets.cpp
    10671069    css/FontFeatureValue.cpp
  • trunk/Source/WebCore/ChangeLog

    r142738 r142739  
     12013-02-13  Pablo Flouret  <pablof@motorola.com>
     2
     3        Implement css-conditional's CSS.supports()
     4        https://bugs.webkit.org/show_bug.cgi?id=100324
     5
     6        Reviewed by Antti Koivisto.
     7
     8        http://dev.w3.org/csswg/css3-conditional/#the-css-interface
     9
     10        The supports() method provides the css @supports rule's corresponding
     11        dom api.
     12        The patch also adds the CSS interface on DOMWindow, which holds "useful
     13        CSS-related functions that do not belong elsewhere". This is where
     14        supports() lives.
     15
     16        Test: css3/supports-dom-api.html
     17
     18        * CMakeLists.txt:
     19        * DerivedSources.cpp:
     20        * DerivedSources.make:
     21        * DerivedSources.pri:
     22        * GNUmakefile.list.am:
     23        * Target.pri:
     24        * WebCore.exp.in:
     25        * WebCore.gypi:
     26        * WebCore.vcproj/WebCore.vcproj:
     27        * WebCore.xcodeproj/project.pbxproj:
     28        * bindings/gobject/GNUmakefile.am:
     29        * bindings/scripts/CodeGeneratorGObject.pm:
     30        (SkipFunction):
     31            Add DOMWindowCSS.* to the build systems.
     32
     33        * bindings/scripts/CodeGenerator.pm:
     34        (WK_lcfirst):
     35            Handle CSS prefixes correctly (s/cSS/css/).
     36
     37        * css/CSSGrammar.y.in:
     38        * css/CSSParser.cpp:
     39        (WebCore::CSSParser::CSSParser):
     40        (WebCore::CSSParser::parseSupportsCondition):
     41        (WebCore::CSSParser::detectAtToken):
     42        * css/CSSParser.h:
     43            webkit_supports_condition parses just the condition part of an
     44            @supports rule and evaluates it, outputting whether the condition
     45            is supported or not.
     46
     47        * css/CSSAllInOne.cpp:
     48        * css/DOMWindowCSS.cpp: Added.
     49        * css/DOMWindowCSS.h: Added.
     50        * css/DOMWindowCSS.idl: Added.
     51            The CSS interface object.
     52
     53        * page/DOMWindow.cpp:
     54        (WebCore::DOMWindow::css):
     55        * page/DOMWindow.h:
     56        * page/DOMWindow.idl:
     57            window.CSS
     58
    1592013-02-13  Vladislav Kaznacheev  <kaznacheev@chromium.org>
    260
  • trunk/Source/WebCore/DerivedSources.cpp

    r142072 r142739  
    107107#include "JSDOMURL.cpp"
    108108#include "JSDOMWindow.cpp"
     109#include "JSDOMWindowCSS.cpp"
    109110#include "JSElement.cpp"
    110111#include "JSEntity.cpp"
  • trunk/Source/WebCore/DerivedSources.make

    r142549 r142739  
    194194    $(WebCore)/css/CSSValueList.idl \
    195195    $(WebCore)/css/Counter.idl \
     196    $(WebCore)/css/DOMWindowCSS.idl \
    196197    $(WebCore)/css/MediaList.idl \
    197198    $(WebCore)/css/MediaQueryList.idl \
  • trunk/Source/WebCore/DerivedSources.pri

    r142072 r142739  
    203203    $$PWD/css/CSSValue.idl \
    204204    $$PWD/css/CSSValueList.idl \
     205    $$PWD/css/DOMWindowCSS.idl \
    205206    $$PWD/css/MediaList.idl \
    206207    $$PWD/css/MediaQueryList.idl \
  • trunk/Source/WebCore/GNUmakefile.list.am

    r142724 r142739  
    222222        DerivedSources/WebCore/JSDOMWindow.cpp \
    223223        DerivedSources/WebCore/JSDOMWindow.h \
     224        DerivedSources/WebCore/JSDOMWindowCSS.cpp \
     225        DerivedSources/WebCore/JSDOMWindowCSS.h \
    224226        DerivedSources/WebCore/JSDynamicsCompressorNode.h \
    225227        DerivedSources/WebCore/JSDynamicsCompressorNode.cpp \
     
    13411343        $(WebCore)/css/CSSValueList.idl \
    13421344        $(WebCore)/css/Counter.idl \
     1345        $(WebCore)/css/DOMWindowCSS.idl \
    13431346        $(WebCore)/css/MediaList.idl \
    13441347        $(WebCore)/css/MediaQueryList.idl \
     
    26372640        Source/WebCore/css/CSSValuePool.h \
    26382641        Source/WebCore/css/CSSVariableValue.h \
     2642        Source/WebCore/css/DOMWindowCSS.cpp \
     2643        Source/WebCore/css/DOMWindowCSS.h \
    26392644        Source/WebCore/css/DashboardRegion.h \
    26402645        Source/WebCore/css/DocumentRuleSets.cpp \
  • trunk/Source/WebCore/Target.pri

    r142735 r142739  
    306306    css/CSSValueList.cpp \
    307307    css/CSSValuePool.cpp \
     308    css/DOMWindowCSS.cpp \
    308309    css/DocumentRuleSets.cpp \
    309310    css/FontFeatureValue.cpp \
     
    15391540    css/CSSValuePool.h \
    15401541    css/CSSVariableValue.h \
     1542    css/DOMWindowCSS.h \
    15411543    css/FontFeatureValue.h \
    15421544    css/FontValue.h \
  • trunk/Source/WebCore/WebCore.exp.in

    r142580 r142739  
    170170__ZN7WebCore11writeToFileEiPKci
    171171__ZN7WebCore12ChromeClient23paintCustomOverhangAreaEPNS_15GraphicsContextERKNS_7IntRectES5_S5_
     172#if ENABLE(CSS3_CONDITIONAL_RULES)
     173__ZN7WebCore12DOMWindowCSS6createEv
     174#endif
    172175__ZN7WebCore12EditingStyleD1Ev
    173176__ZN7WebCore12EventHandler10mouseMovedERKNS_18PlatformMouseEventE
     
    809812__ZN7WebCore4coreEP28NSURLAuthenticationChallenge
    810813__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_10ClientRectE
     814#if ENABLE(CSS3_CONDITIONAL_RULES)
     815__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_12DOMWindowCSSE
     816#endif
    811817__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_13DOMStringListE
    812818__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_14ClientRectListE
  • trunk/Source/WebCore/WebCore.gypi

    r142731 r142739  
    174174            'css/CSSValueList.idl',
    175175            'css/Counter.idl',
     176            'css/DOMWindowCSS.idl',
    176177            'css/MediaList.idl',
    177178            'css/MediaQueryList.idl',
     
    15391540            'css/CSSVariableValue.h',
    15401541            'css/Counter.h',
     1542            'css/DOMWindowCSS.cpp',
     1543            'css/DOMWindowCSS.h',
    15411544            'css/DashboardRegion.h',
    15421545            'css/DocumentRuleSets.cpp',
     
    62916294            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSDOMURL.h',
    62926295            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSDOMWindow.cpp',
     6296            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSDOMWindowCSS.cpp',
     6297            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSDOMWindowCSS.h',
    62936298            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSDataView.cpp',
    62946299            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSDataView.h',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r142641 r142739  
    44644464                        </File>
    44654465                        <File
     4466                                RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSDOMWindowCSS.cpp"
     4467                                >
     4468                                <FileConfiguration
     4469                                        Name="Debug|Win32"
     4470                                        ExcludedFromBuild="true"
     4471                                        >
     4472                                        <Tool
     4473                                                Name="VCCLCompilerTool"
     4474                                        />
     4475                                </FileConfiguration>
     4476                                <FileConfiguration
     4477                                        Name="Release|Win32"
     4478                                        ExcludedFromBuild="true"
     4479                                        >
     4480                                        <Tool
     4481                                                Name="VCCLCompilerTool"
     4482                                        />
     4483                                </FileConfiguration>
     4484                                <FileConfiguration
     4485                                        Name="Debug_Cairo_CFLite|Win32"
     4486                                        ExcludedFromBuild="true"
     4487                                        >
     4488                                        <Tool
     4489                                                Name="VCCLCompilerTool"
     4490                                        />
     4491                                </FileConfiguration>
     4492                                <FileConfiguration
     4493                                        Name="Release_Cairo_CFLite|Win32"
     4494                                        ExcludedFromBuild="true"
     4495                                        >
     4496                                        <Tool
     4497                                                Name="VCCLCompilerTool"
     4498                                        />
     4499                                </FileConfiguration>
     4500                                <FileConfiguration
     4501                                        Name="Debug_All|Win32"
     4502                                        ExcludedFromBuild="true"
     4503                                        >
     4504                                        <Tool
     4505                                                Name="VCCLCompilerTool"
     4506                                        />
     4507                                </FileConfiguration>
     4508                                <FileConfiguration
     4509                                        Name="Production|Win32"
     4510                                        ExcludedFromBuild="true"
     4511                                        >
     4512                                        <Tool
     4513                                                Name="VCCLCompilerTool"
     4514                                        />
     4515                                </FileConfiguration>
     4516                        </File>
     4517                        <File
     4518                                RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSDOMWindowCSS.h"
     4519                                >
     4520                        </File>
     4521                        <File
    44664522                                RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSElement.cpp"
    44674523                                >
     
    3794037996                        </File>
    3794137997                        <File
     37998                                RelativePath="..\css\DOMWindowCSS.cpp"
     37999                                >
     38000                                <FileConfiguration
     38001                                        Name="Debug|Win32"
     38002                                        ExcludedFromBuild="true"
     38003                                        >
     38004                                        <Tool
     38005                                                Name="VCCLCompilerTool"
     38006                                        />
     38007                                </FileConfiguration>
     38008                                <FileConfiguration
     38009                                        Name="Release|Win32"
     38010                                        ExcludedFromBuild="true"
     38011                                        >
     38012                                        <Tool
     38013                                                Name="VCCLCompilerTool"
     38014                                        />
     38015                                </FileConfiguration>
     38016                                <FileConfiguration
     38017                                        Name="Debug_Cairo_CFLite|Win32"
     38018                                        ExcludedFromBuild="true"
     38019                                        >
     38020                                        <Tool
     38021                                                Name="VCCLCompilerTool"
     38022                                        />
     38023                                </FileConfiguration>
     38024                                <FileConfiguration
     38025                                        Name="Release_Cairo_CFLite|Win32"
     38026                                        ExcludedFromBuild="true"
     38027                                        >
     38028                                        <Tool
     38029                                                Name="VCCLCompilerTool"
     38030                                        />
     38031                                </FileConfiguration>
     38032                                <FileConfiguration
     38033                                        Name="Debug_All|Win32"
     38034                                        ExcludedFromBuild="true"
     38035                                        >
     38036                                        <Tool
     38037                                                Name="VCCLCompilerTool"
     38038                                        />
     38039                                </FileConfiguration>
     38040                                <FileConfiguration
     38041                                        Name="Production|Win32"
     38042                                        ExcludedFromBuild="true"
     38043                                        >
     38044                                        <Tool
     38045                                                Name="VCCLCompilerTool"
     38046                                        />
     38047                                </FileConfiguration>
     38048                        </File>
     38049                        <File
     38050                                RelativePath="..\css\DOMWindowCSS.h"
     38051                                >
     38052                        </File>
     38053                        <File
    3794238054                                RelativePath="..\css\CSSValuePool.cpp"
    3794338055                                >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r142698 r142739  
    65246524                FCD8832C16A49FB000962227 /* DOMCSSSupportsRule.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = FCD8832816A49F8200962227 /* DOMCSSSupportsRule.h */; };
    65256525                FCEBBAAB16A4967A00FA20A6 /* DOMCSSSupportsRuleInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = FCEBBAAA16A4967A00FA20A6 /* DOMCSSSupportsRuleInternal.h */; };
     6526                FC9A0F74164094CF003D6B8D /* DOMWindowCSS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC9A0F71164094CF003D6B8D /* DOMWindowCSS.cpp */; };
     6527                FC9A0F75164094CF003D6B8D /* DOMWindowCSS.h in Headers */ = {isa = PBXBuildFile; fileRef = FC9A0F72164094CF003D6B8D /* DOMWindowCSS.h */; };
     6528                FC9E0E4D16419C1E00392BE3 /* JSDOMWindowCSS.h in Headers */ = {isa = PBXBuildFile; fileRef = FC9E0E4B16419C1E00392BE3 /* JSDOMWindowCSS.h */; };
     6529                FC9E0E5116419C7F00392BE3 /* JSDOMWindowCSS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC9E0E4A16419C1E00392BE3 /* JSDOMWindowCSS.cpp */; };
    65266530                FD00D7A414A3F61900734011 /* SincResampler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD00D7A214A3F61900734011 /* SincResampler.cpp */; };
    65276531                FD00D7A514A3F61900734011 /* SincResampler.h in Headers */ = {isa = PBXBuildFile; fileRef = FD00D7A314A3F61900734011 /* SincResampler.h */; };
     
    1421914223                FCD8832916A49F8200962227 /* DOMCSSSupportsRule.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMCSSSupportsRule.mm; sourceTree = "<group>"; };
    1422014224                FCEBBAAA16A4967A00FA20A6 /* DOMCSSSupportsRuleInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMCSSSupportsRuleInternal.h; sourceTree = "<group>"; };
     14225                FC9A0F71164094CF003D6B8D /* DOMWindowCSS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowCSS.cpp; sourceTree = "<group>"; };
     14226                FC9A0F72164094CF003D6B8D /* DOMWindowCSS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWindowCSS.h; sourceTree = "<group>"; };
     14227                FC9A0F73164094CF003D6B8D /* DOMWindowCSS.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMWindowCSS.idl; sourceTree = "<group>"; };
     14228                FC9E0E4A16419C1E00392BE3 /* JSDOMWindowCSS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMWindowCSS.cpp; sourceTree = "<group>"; };
     14229                FC9E0E4B16419C1E00392BE3 /* JSDOMWindowCSS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMWindowCSS.h; sourceTree = "<group>"; };
    1422114230                FCEBCD711623A7910029965E /* CSSGrammar.y.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.yacc; path = CSSGrammar.y.in; sourceTree = "<group>"; };
    1422214231                FCEBCD721623A7910029965E /* CSSGrammar.y.includes */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.yacc; path = CSSGrammar.y.includes; sourceTree = "<group>"; };
     
    1949819507                                A8D05FA90A23B30F005E7203 /* JSCSSValueList.cpp */,
    1949919508                                A8D05FAA0A23B30F005E7203 /* JSCSSValueList.h */,
     19509                                FC9E0E4A16419C1E00392BE3 /* JSDOMWindowCSS.cpp */,
     19510                                FC9E0E4B16419C1E00392BE3 /* JSDOMWindowCSS.h */,
    1950019511                                BC3C39B40C0D3D8D005F4D7A /* JSMediaList.cpp */,
    1950119512                                BC3C39B50C0D3D8D005F4D7A /* JSMediaList.h */,
     
    2196221973                                4A4F48A816B0DFC000EDBB29 /* DocumentRuleSets.h */,
    2196321974                                4A6E9FC113C17D1D0046A7F8 /* FontFeatureValue.cpp */,
     21975                                FC9A0F71164094CF003D6B8D /* DOMWindowCSS.cpp */,
     21976                                FC9A0F72164094CF003D6B8D /* DOMWindowCSS.h */,
     21977                                FC9A0F73164094CF003D6B8D /* DOMWindowCSS.idl */,
    2196421978                                4A6E9FC213C17D1D0046A7F8 /* FontFeatureValue.h */,
    2196521979                                A80E6CC70A1989CA007FB8C5 /* FontValue.cpp */,
     
    2416324177                                85989DD10ACC8BBD00A0BC51 /* DOMWheelEventInternal.h in Headers */,
    2416424178                                1403B99709EB13AF00797C7F /* DOMWindow.h in Headers */,
     24179                                FC9A0F75164094CF003D6B8D /* DOMWindowCSS.h in Headers */,
    2416524180                                51FA2D78152132B300C1BA0B /* DOMWindowExtension.h in Headers */,
    2416624181                                9712A5AE15004EDA0048AF10 /* DOMWindowIndexedDatabase.h in Headers */,
     
    2478924804                                2E37E00612DBC5A400A6B233 /* JSDOMURL.h in Headers */,
    2479024805                                BC6932740D7E293900AE44D1 /* JSDOMWindowBase.h in Headers */,
     24806                                FC9E0E4D16419C1E00392BE3 /* JSDOMWindowCSS.h in Headers */,
    2479124807                                652FBBBC0DE27CB60001D386 /* JSDOMWindowCustom.h in Headers */,
    2479224808                                BCBFB53D0DCD29CF0019B3E5 /* JSDOMWindowShell.h in Headers */,
     
    2751227528                                85C7F5E80AAFBAFB004014DD /* DOMWheelEvent.mm in Sources */,
    2751327529                                1403B99809EB13AF00797C7F /* DOMWindow.cpp in Sources */,
     27530                                FC9A0F74164094CF003D6B8D /* DOMWindowCSS.cpp in Sources */,
    2751427531                                517FBA1E151AB17C00B57959 /* DOMWindowExtension.cpp in Sources */,
    2751527532                                9712A5AD15004EDA0048AF10 /* DOMWindowIndexedDatabase.cpp in Sources */,
     
    2810428121                                1403BA0C09EB18C700797C7F /* JSDOMWindow.cpp in Sources */,
    2810528122                                BC6932730D7E293900AE44D1 /* JSDOMWindowBase.cpp in Sources */,
     28123                                FC9E0E5116419C7F00392BE3 /* JSDOMWindowCSS.cpp in Sources */,
    2810628124                                BCD9C2620C17AA67005C90A2 /* JSDOMWindowCustom.cpp in Sources */,
    2810728125                                BCBFB53C0DCD29CF0019B3E5 /* JSDOMWindowShell.cpp in Sources */,
  • trunk/Source/WebCore/bindings/gobject/GNUmakefile.am

    r140672 r142739  
    5858        DerivedSources/webkitdom/WebKitDOMDOMTokenListPrivate.h \
    5959        DerivedSources/webkitdom/WebKitDOMDOMWindow.cpp \
     60        DerivedSources/webkitdom/WebKitDOMDOMWindowCSS.cpp \
     61        DerivedSources/webkitdom/WebKitDOMDOMWindowCSSPrivate.h \
    6062        DerivedSources/webkitdom/WebKitDOMDOMWindowPrivate.h \
    6163        DerivedSources/webkitdom/WebKitDOMElement.cpp \
     
    394396        DerivedSources/webkitdom/WebKitDOMConsole.h \
    395397        DerivedSources/webkitdom/WebKitDOMCustom.h \
     398        DerivedSources/webkitdom/WebKitDOMDOMWindowCSS.h \
    396399        DerivedSources/webkitdom/WebKitDOMDOMWindow.h \
    397400        DerivedSources/webkitdom/WebKitDOMDOMSelection.h \
  • trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm

    r141360 r142739  
    511511    $ret =~ s/xML/xml/ if $ret =~ /^xML/;
    512512    $ret =~ s/xSLT/xslt/ if $ret =~ /^xSLT/;
     513    $ret =~ s/cSS/css/ if $ret =~ /^cSS/;
    513514
    514515    # For HTML5 FileSystem API Flags attributes.
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm

    r142646 r142739  
    260260
    261261    if ($codeGenerator->GetSequenceType($functionReturnType)) {
     262        return 1;
     263    }
     264
     265    if ($function->signature->name eq "supports" && @{$function->parameters} == 1) {
    262266        return 1;
    263267    }
  • trunk/Source/WebCore/css/CSSAllInOne.cpp

    r142573 r142739  
    7070#include "CSSValueList.cpp"
    7171#include "CSSValuePool.cpp"
     72#include "DOMWindowCSS.cpp"
    7273#include "DocumentRuleSets.cpp"
    7374#include "InspectorCSSOMWrappers.cpp"
  • trunk/Source/WebCore/css/CSSGrammar.y.in

    r142640 r142739  
    112112%token WEBKIT_REGION_RULE_SYM
    113113%token WEBKIT_VIEWPORT_RULE_SYM
     114#if ENABLE_CSS3_CONDITIONAL_RULES
     115%token WEBKIT_SUPPORTS_CONDITION_SYM
     116#endif
    114117#if ENABLE_CSS_SHADERS
    115118%token WEBKIT_FILTER_RULE_SYM
     
    313316  | webkit_selector maybe_space
    314317  | webkit_keyframe_rule maybe_space
     318#if ENABLE_CSS3_CONDITIONAL_RULES
     319  | webkit_supports_condition maybe_space
     320#endif
    315321  ;
    316322
     
    359365    }
    360366;
     367
     368#if ENABLE_CSS3_CONDITIONAL_RULES
     369webkit_supports_condition:
     370    WEBKIT_SUPPORTS_CONDITION_SYM '{' maybe_space supports_condition '}' {
     371        parser->m_supportsCondition = $4;
     372    }
     373;
     374#endif
    361375
    362376maybe_space:
  • trunk/Source/WebCore/css/CSSParser.cpp

    r142640 r142739  
    261261    , m_id(CSSPropertyInvalid)
    262262    , m_styleSheet(0)
     263#if ENABLE(CSS3_CONDITIONAL_RULES)
     264    , m_supportsCondition(false)
     265#endif
    263266    , m_selectorListForParseSelector(0)
    264267    , m_numParsedPropertiesBeforeMarginBox(INVALID_NUM_PARSED_PROPERTIES)
     
    433436    return m_keyframe.release();
    434437}
     438
     439#if ENABLE(CSS3_CONDITIONAL_RULES)
     440bool CSSParser::parseSupportsCondition(const String& string)
     441{
     442    m_supportsCondition = false;
     443    setupParser("@-webkit-supports-condition{ ", string, "} ");
     444    cssyyparse(this);
     445    return m_supportsCondition;
     446}
     447#endif
    435448
    436449static inline bool isColorPropertyID(CSSPropertyID propertyId)
     
    1025210265                m_token = WEBKIT_KEYFRAME_RULE_SYM;
    1025310266            return;
     10267
     10268        case 27:
     10269#if ENABLE(CSS3_CONDITIONAL_RULES)
     10270            if (isEqualToCSSIdentifier(name + 2, "webkit-supports-condition")) {
     10271                m_parsingMode = SupportsMode;
     10272                m_token = WEBKIT_SUPPORTS_CONDITION_SYM;
     10273            }
     10274#endif
     10275            return;
    1025410276        }
    1025510277    }
  • trunk/Source/WebCore/css/CSSParser.h

    r142640 r142739  
    8181    PassRefPtr<StyleRuleBase> parseRule(StyleSheetContents*, const String&);
    8282    PassRefPtr<StyleKeyframe> parseKeyframeRule(StyleSheetContents*, const String&);
     83#if ENABLE(CSS3_CONDITIONAL_RULES)
     84    bool parseSupportsCondition(const String&);
     85#endif
    8386    static bool parseValue(StylePropertySet*, CSSPropertyID, const String&, bool important, CSSParserMode, StyleSheetContents*);
    8487    static bool parseColor(RGBA32& color, const String&, bool strict = false);
     
    353356    OwnPtr<MediaQuery> m_mediaQuery;
    354357    OwnPtr<CSSParserValueList> m_valueList;
     358#if ENABLE(CSS3_CONDITIONAL_RULES)
     359    bool m_supportsCondition;
     360#endif
     361
    355362    typedef Vector<CSSProperty, 256> ParsedPropertyVector;
    356363    ParsedPropertyVector m_parsedProperties;
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r142271 r142739  
    4444#include "DOMTokenList.h"
    4545#include "DOMURL.h"
     46#include "DOMWindowCSS.h"
    4647#include "DOMWindowExtension.h"
    4748#include "DOMWindowNotifications.h"
     
    15671568#endif
    15681569
     1570#if ENABLE(CSS3_CONDITIONAL_RULES)
     1571DOMWindowCSS* DOMWindow::css()
     1572{
     1573    if (!m_css)
     1574        m_css = DOMWindowCSS::create();
     1575    return m_css.get();
     1576}
     1577#endif
     1578
    15691579static void didAddStorageEventListener(DOMWindow* window)
    15701580{
  • trunk/Source/WebCore/page/DOMWindow.h

    r142075 r142739  
    7070    class StyleMedia;
    7171    class WebKitPoint;
     72    class DOMWindowCSS;
    7273
    7374#if ENABLE(REQUEST_ANIMATION_FRAME)
     
    264265        int webkitRequestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback>);
    265266        void cancelAnimationFrame(int id);
     267#endif
     268
     269#if ENABLE(CSS3_CONDITIONAL_RULES)
     270        DOMWindowCSS* css();
    266271#endif
    267272
     
    458463        mutable RefPtr<Performance> m_performance;
    459464#endif
     465
     466#if ENABLE(CSS3_CONDITIONAL_RULES)
     467        mutable RefPtr<DOMWindowCSS> m_css;
     468#endif
    460469    };
    461470
  • trunk/Source/WebCore/page/DOMWindow.idl

    r142549 r142739  
    219219    DOMString btoa(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString string)
    220220        raises(DOMException);
     221
     222    attribute [Replaceable,Conditional=CSS3_CONDITIONAL_RULES] DOMWindowCSS CSS;
    221223
    222224    // Events
Note: See TracChangeset for help on using the changeset viewer.