Changeset 140115 in webkit


Ignore:
Timestamp:
Jan 18, 2013 2:28:10 AM (11 years ago)
Author:
tasak@google.com
Message:

Implement CSSHostRule for @host @-rules.
https://bugs.webkit.org/show_bug.cgi?id=102344

Reviewed by Dimitri Glazkov.

Source/WebCore:

CSSHostRule is defined in Shadow DOM spec:
http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#css-host-rule-interface
To see or to modify @host @-rules by using inspector, we need to
implement CSSHostRule interface.

Test: fast/dom/shadow/css-hostrule-api.html

  • DerivedSources.cpp:

Modified to include JSCSSHostRule.cpp.

  • CMakeLists.txt:
  • DerivedSources.make:
  • DerivedSources.pri:
  • GNUmakefile.list.am:
  • Target.pri:
  • WebCore.gypi:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:

Added CSSHostRule.cpp, CSSHostRule.h, and CSSHostRule.idl.

  • bindings/js/JSCSSRuleCustom.cpp:

(WebCore::toJS):
Add a new case that the given rule is @host @-rules to support @host
@-rules.

  • bindings/objc/DOMCSS.mm:

(kitClass):
Add a new case that the given rule is @host @-rules to support @host
@-rules.

  • bindings/v8/custom/V8CSSRuleCustom.cpp:

(WebCore::wrap):

  • css/CSSAllInOne.cpp:
  • css/CSSHostRule.cpp: Added.

(WebCore):
(WebCore::CSSHostRule::CSSHostRule):
(WebCore::CSSHostRule::cssText):

  • css/CSSHostRule.h: Added.

(WebCore):
(CSSHostRule):
(WebCore::CSSHostRule::create):
Implemented class CSSHostRule which inherits CSSGroupingRule.
Since CSSHostRule has the same interface as CSSGroupingRule, it is
required to implement its constructor and to override only type
method and cssText method.

  • css/CSSHostRule.idl: Added.
  • css/CSSRule.h:
  • css/CSSRule.idl:

Added internal HOST_RULE type number.

  • css/StyleResolver.cpp:

(WebCore::collectCSSOMWrappers):

  • css/StyleRule.cpp:

(WebCore::StyleRuleBase::reportMemoryUsage):
(WebCore::StyleRuleBase::destroy):
(WebCore::StyleRuleBase::copy):
(WebCore::StyleRuleBase::createCSSOMWrapper):
Modified to handle StyleRuleHost.

  • css/StyleRule.h:

(WebCore::StyleRuleBase::isHostRule):
(WebCore::StyleRuleHost::StyleRuleHost):

  • css/StyleSheetContents.cpp:

(WebCore::childRulesHaveFailedOrCanceledSubresources):

  • page/DOMWindow.idl:

Added CSSHostRule constructor.

LayoutTests:

  • fast/dom/shadow/css-hostrule-api-expected.txt: Added.
  • fast/dom/shadow/css-hostrule-api.html: Added.
Location:
trunk
Files:
5 added
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r140114 r140115  
     12013-01-18  Takashi Sakamoto  <tasak@google.com>
     2
     3        Implement CSSHostRule for @host @-rules.
     4        https://bugs.webkit.org/show_bug.cgi?id=102344
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        * fast/dom/shadow/css-hostrule-api-expected.txt: Added.
     9        * fast/dom/shadow/css-hostrule-api.html: Added.
     10
    1112013-01-18  John J. Barton  <johnjbarton@chromium.org>
    212
  • trunk/Source/WebCore/CMakeLists.txt

    r140097 r140115  
    313313    css/CSSCharsetRule.idl
    314314    css/CSSFontFaceRule.idl
     315    css/CSSHostRule.idl
    315316    css/CSSImportRule.idl
    316317    css/CSSMediaRule.idl
     
    10341035    css/CSSGradientValue.cpp
    10351036    css/CSSGroupingRule.cpp
     1037    css/CSSHostRule.cpp
    10361038    css/CSSImageGeneratorValue.cpp
    10371039    css/CSSImageSetValue.cpp
  • trunk/Source/WebCore/ChangeLog

    r140114 r140115  
     12013-01-18  Takashi Sakamoto  <tasak@google.com>
     2
     3        Implement CSSHostRule for @host @-rules.
     4        https://bugs.webkit.org/show_bug.cgi?id=102344
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        CSSHostRule is defined in Shadow DOM spec:
     9        http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#css-host-rule-interface
     10        To see or to modify @host @-rules by using inspector, we need to
     11        implement CSSHostRule interface.
     12
     13        Test: fast/dom/shadow/css-hostrule-api.html
     14
     15        * DerivedSources.cpp:
     16        Modified to include JSCSSHostRule.cpp.
     17        * CMakeLists.txt:
     18        * DerivedSources.make:
     19        * DerivedSources.pri:
     20        * GNUmakefile.list.am:
     21        * Target.pri:
     22        * WebCore.gypi:
     23        * WebCore.vcproj/WebCore.vcproj:
     24        * WebCore.xcodeproj/project.pbxproj:
     25        Added CSSHostRule.cpp, CSSHostRule.h, and CSSHostRule.idl.
     26        * bindings/js/JSCSSRuleCustom.cpp:
     27        (WebCore::toJS):
     28        Add a new case that the given rule is @host @-rules to support @host
     29        @-rules.
     30        * bindings/objc/DOMCSS.mm:
     31        (kitClass):
     32        Add a new case that the given rule is @host @-rules to support @host
     33        @-rules.
     34        * bindings/v8/custom/V8CSSRuleCustom.cpp:
     35        (WebCore::wrap):
     36        * css/CSSAllInOne.cpp:
     37        * css/CSSHostRule.cpp: Added.
     38        (WebCore):
     39        (WebCore::CSSHostRule::CSSHostRule):
     40        (WebCore::CSSHostRule::cssText):
     41        * css/CSSHostRule.h: Added.
     42        (WebCore):
     43        (CSSHostRule):
     44        (WebCore::CSSHostRule::create):
     45        Implemented class CSSHostRule which inherits CSSGroupingRule.
     46        Since CSSHostRule has the same interface as CSSGroupingRule, it is
     47        required to implement its constructor and to override only type
     48        method and cssText method.
     49        * css/CSSHostRule.idl: Added.
     50        * css/CSSRule.h:
     51        * css/CSSRule.idl:
     52        Added internal HOST_RULE type number.
     53        * css/StyleResolver.cpp:
     54        (WebCore::collectCSSOMWrappers):
     55        * css/StyleRule.cpp:
     56        (WebCore::StyleRuleBase::reportMemoryUsage):
     57        (WebCore::StyleRuleBase::destroy):
     58        (WebCore::StyleRuleBase::copy):
     59        (WebCore::StyleRuleBase::createCSSOMWrapper):
     60        Modified to handle StyleRuleHost.
     61        * css/StyleRule.h:
     62        (WebCore::StyleRuleBase::isHostRule):
     63        (WebCore::StyleRuleHost::StyleRuleHost):
     64        * css/StyleSheetContents.cpp:
     65        (WebCore::childRulesHaveFailedOrCanceledSubresources):
     66        * page/DOMWindow.idl:
     67        Added CSSHostRule constructor.
     68
    1692013-01-18  John J. Barton  <johnjbarton@chromium.org>
    270
  • trunk/Source/WebCore/DerivedSources.cpp

    r139866 r140115  
    5656#include "JSCSSCharsetRule.cpp"
    5757#include "JSCSSFontFaceRule.cpp"
     58#include "JSCSSHostRule.cpp"
    5859#include "JSCSSImportRule.cpp"
    5960#include "JSCSSMediaRule.cpp"
  • trunk/Source/WebCore/DerivedSources.make

    r139918 r140115  
    176176    $(WebCore)/css/CSSCharsetRule.idl \
    177177    $(WebCore)/css/CSSFontFaceRule.idl \
     178    $(WebCore)/css/CSSHostRule.idl \
    178179    $(WebCore)/css/CSSImportRule.idl \
    179180    $(WebCore)/css/CSSMediaRule.idl \
  • trunk/Source/WebCore/DerivedSources.pri

    r139866 r140115  
    190190    $$PWD/css/CSSCharsetRule.idl \
    191191    $$PWD/css/CSSFontFaceRule.idl \
     192    $$PWD/css/CSSHostRule.idl \
    192193    $$PWD/css/CSSImportRule.idl \
    193194    $$PWD/css/CSSMediaRule.idl \
  • trunk/Source/WebCore/GNUmakefile.list.am

    r140097 r140115  
    116116        DerivedSources/WebCore/JSCSSFontFaceRule.cpp \
    117117        DerivedSources/WebCore/JSCSSFontFaceRule.h \
     118        DerivedSources/WebCore/JSCSSHostRule.cpp \
     119        DerivedSources/WebCore/JSCSSHostRule.h \
    118120        DerivedSources/WebCore/JSCSSImportRule.cpp \
    119121        DerivedSources/WebCore/JSCSSImportRule.h \
     
    13231325        $(WebCore)/css/CSSCharsetRule.idl \
    13241326        $(WebCore)/css/CSSFontFaceRule.idl \
     1327        $(WebCore)/css/CSSHostRule.idl \
    13251328        $(WebCore)/css/CSSImportRule.idl \
    13261329        $(WebCore)/css/CSSMediaRule.idl \
     
    25462549        Source/WebCore/css/CSSGroupingRule.h \
    25472550        Source/WebCore/css/CSSHelper.h \
     2551        Source/WebCore/css/CSSHostRule.cpp \
     2552        Source/WebCore/css/CSSHostRule.h \
    25482553        Source/WebCore/css/CSSImageGeneratorValue.cpp \
    25492554        Source/WebCore/css/CSSImageGeneratorValue.h \
  • trunk/Source/WebCore/Target.pri

    r140097 r140115  
    265265    css/CSSGradientValue.cpp \
    266266    css/CSSGroupingRule.cpp \
     267    css/CSSHostRule.cpp \
    267268    css/CSSImageValue.cpp \
    268269    css/CSSImageGeneratorValue.cpp \
  • trunk/Source/WebCore/WebCore.gypi

    r140097 r140115  
    161161            'css/CSSCharsetRule.idl',
    162162            'css/CSSFontFaceRule.idl',
     163            'css/CSSHostRule.idl',
    163164            'css/CSSImportRule.idl',
    164165            'css/CSSMediaRule.idl',
     
    14691470            'css/CSSGroupingRule.cpp',
    14701471            'css/CSSGroupingRule.h',
     1472            'css/CSSHostRule.cpp',
     1473            'css/CSSHostRule.h',
    14711474            'css/CSSImageGeneratorValue.cpp',
    14721475            'css/CSSImageSetValue.cpp',
     
    55755578            '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMCSSFontFaceRule.mm',
    55765579            '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMCSSFontFaceRuleInternal.h',
     5580            '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMCSSHostRule.mm',
     5581            '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMCSSHostRuleInternal.h',
    55775582            '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMCSSImportRule.mm',
    55785583            '<(PRODUCT_DIR)/DerivedSources/WebCore/DOMCSSImportRuleInternal.h',
     
    61376142            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSCSSFontFaceRule.cpp',
    61386143            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSCSSFontFaceRule.h',
     6144            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSCSSHostRule.cpp',
     6145            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSCSSHostRule.h',
    61396146            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSCSSImportRule.cpp',
    61406147            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSCSSImportRule.h',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r140097 r140115  
    18591859                        </File>
    18601860                        <File
     1861                                RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSCSSHostRule.cpp"
     1862                                >
     1863                                <FileConfiguration
     1864                                        Name="Debug|Win32"
     1865                                        ExcludedFromBuild="true"
     1866                                        >
     1867                                        <Tool
     1868                                                Name="VCCLCompilerTool"
     1869                                        />
     1870                                </FileConfiguration>
     1871                                <FileConfiguration
     1872                                        Name="Release|Win32"
     1873                                        ExcludedFromBuild="true"
     1874                                        >
     1875                                        <Tool
     1876                                                Name="VCCLCompilerTool"
     1877                                        />
     1878                                </FileConfiguration>
     1879                                <FileConfiguration
     1880                                        Name="Debug_Cairo_CFLite|Win32"
     1881                                        ExcludedFromBuild="true"
     1882                                        >
     1883                                        <Tool
     1884                                                Name="VCCLCompilerTool"
     1885                                        />
     1886                                </FileConfiguration>
     1887                                <FileConfiguration
     1888                                        Name="Release_Cairo_CFLite|Win32"
     1889                                        ExcludedFromBuild="true"
     1890                                        >
     1891                                        <Tool
     1892                                                Name="VCCLCompilerTool"
     1893                                        />
     1894                                </FileConfiguration>
     1895                                <FileConfiguration
     1896                                        Name="Debug_All|Win32"
     1897                                        ExcludedFromBuild="true"
     1898                                        >
     1899                                        <Tool
     1900                                                Name="VCCLCompilerTool"
     1901                                        />
     1902                                </FileConfiguration>
     1903                                <FileConfiguration
     1904                                        Name="Production|Win32"
     1905                                        ExcludedFromBuild="true"
     1906                                        >
     1907                                        <Tool
     1908                                                Name="VCCLCompilerTool"
     1909                                        />
     1910                                </FileConfiguration>
     1911                        </File>
     1912                        <File
     1913                                RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSCSSHostRule.h"
     1914                                >
     1915                        </File>
     1916                        <File
    18611917                                RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSCSSImportRule.cpp"
    18621918                                >
     
    3631536371                        </File>
    3631636372                        <File
     36373                                RelativePath="..\css\CSSHostRule.cpp"
     36374                                >
     36375                                <FileConfiguration
     36376                                        Name="Debug|Win32"
     36377                                        ExcludedFromBuild="true"
     36378                                        >
     36379                                        <Tool
     36380                                                Name="VCCLCompilerTool"
     36381                                        />
     36382                                </FileConfiguration>
     36383                                <FileConfiguration
     36384                                        Name="Release|Win32"
     36385                                        ExcludedFromBuild="true"
     36386                                        >
     36387                                        <Tool
     36388                                                Name="VCCLCompilerTool"
     36389                                        />
     36390                                </FileConfiguration>
     36391                                <FileConfiguration
     36392                                        Name="Debug_Cairo_CFLite|Win32"
     36393                                        ExcludedFromBuild="true"
     36394                                        >
     36395                                        <Tool
     36396                                                Name="VCCLCompilerTool"
     36397                                        />
     36398                                </FileConfiguration>
     36399                                <FileConfiguration
     36400                                        Name="Release_Cairo_CFLite|Win32"
     36401                                        ExcludedFromBuild="true"
     36402                                        >
     36403                                        <Tool
     36404                                                Name="VCCLCompilerTool"
     36405                                        />
     36406                                </FileConfiguration>
     36407                                <FileConfiguration
     36408                                        Name="Debug_All|Win32"
     36409                                        ExcludedFromBuild="true"
     36410                                        >
     36411                                        <Tool
     36412                                                Name="VCCLCompilerTool"
     36413                                        />
     36414                                </FileConfiguration>
     36415                                <FileConfiguration
     36416                                        Name="Production|Win32"
     36417                                        ExcludedFromBuild="true"
     36418                                        >
     36419                                        <Tool
     36420                                                Name="VCCLCompilerTool"
     36421                                        />
     36422                                </FileConfiguration>
     36423                        </File>
     36424                        <File
     36425                                RelativePath="..\css\CSSHostRule.h"
     36426                                >
     36427                        </File>
     36428                        <File
    3631736429                                RelativePath="..\css\CSSImageGeneratorValue.cpp"
    3631836430                                >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r140097 r140115  
    64596459                FB2C15C3165D649D0039C9F8 /* CachedSVGDocumentReference.h in Headers */ = {isa = PBXBuildFile; fileRef = FB2C15C2165D64900039C9F8 /* CachedSVGDocumentReference.h */; settings = {ATTRIBUTES = (Private, ); }; };
    64606460                FB3056C2169E5DAC0096A232 /* CSSGroupingRule.h in Headers */ = {isa = PBXBuildFile; fileRef = FB3056C1169E5DAC0096A232 /* CSSGroupingRule.h */; };
     6461                FB49C39A16784932007FFB5D /* CSSHostRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FB49C39916784932007FFB5D /* CSSHostRule.cpp */; };
     6462                FB49C39D16784947007FFB5D /* CSSHostRule.h in Headers */ = {isa = PBXBuildFile; fileRef = FB49C39C16784947007FFB5D /* CSSHostRule.h */; };
    64616463                FB78AD2E151BF5E600FE54D3 /* CSSParserMode.h in Headers */ = {isa = PBXBuildFile; fileRef = FB78AD2C151BF5D200FE54D3 /* CSSParserMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
    64626464                FB92DF4B15FED08700994433 /* ClipPathOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = FB92DF4915FED08700994433 /* ClipPathOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    1407514077                FB2C15C2165D64900039C9F8 /* CachedSVGDocumentReference.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedSVGDocumentReference.h; sourceTree = "<group>"; };
    1407614078                FB3056C1169E5DAC0096A232 /* CSSGroupingRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSGroupingRule.h; sourceTree = "<group>"; };
     14079                FB49C39916784932007FFB5D /* CSSHostRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSHostRule.cpp; sourceTree = "<group>"; };
     14080                FB49C39C16784947007FFB5D /* CSSHostRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSHostRule.h; sourceTree = "<group>"; };
     14081                FB49C39E16784954007FFB5D /* CSSHostRule.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CSSHostRule.idl; sourceTree = "<group>"; };
    1407714082                FB78AD2C151BF5D200FE54D3 /* CSSParserMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSParserMode.h; sourceTree = "<group>"; };
    1407814083                FB92DF4915FED08700994433 /* ClipPathOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClipPathOperation.h; sourceTree = "<group>"; };
     
    2166321668                                FB3056C1169E5DAC0096A232 /* CSSGroupingRule.h */,
    2166421669                                BC772B360C4EA91E0083285F /* CSSHelper.h */,
     21670                                FB49C39916784932007FFB5D /* CSSHostRule.cpp */,
     21671                                FB49C39C16784947007FFB5D /* CSSHostRule.h */,
     21672                                FB49C39E16784954007FFB5D /* CSSHostRule.idl */,
    2166521673                                BC23E76B0DAE88A9009FDC91 /* CSSImageGeneratorValue.cpp */,
    2166621674                                BC23EE910DAED2BC009FDC91 /* CSSImageGeneratorValue.h */,
     
    2624326251                                977E2E0F12F0FC9C00C13379 /* XSSAuditor.h in Headers */,
    2624426252                                FD537353137B651800008DCE /* ZeroPole.h in Headers */,
     26253                                FB49C39D16784947007FFB5D /* CSSHostRule.h in Headers */,
    2624526254                        );
    2624626255                        runOnlyForDeploymentPostprocessing = 0;
     
    2939029399                                977E2E0E12F0FC9C00C13379 /* XSSAuditor.cpp in Sources */,
    2939129400                                FD537352137B651800008DCE /* ZeroPole.cpp in Sources */,
     29401                                FB49C39A16784932007FFB5D /* CSSHostRule.cpp in Sources */,
    2939229402                        );
    2939329403                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/Source/WebCore/bindings/js/JSCSSRuleCustom.cpp

    r139866 r140115  
    3636#include "JSCSSCharsetRule.h"
    3737#include "JSCSSFontFaceRule.h"
     38#include "JSCSSHostRule.h"
    3839#include "JSCSSImportRule.h"
    3940#include "JSCSSMediaRule.h"
     
    114115            break;
    115116#endif
     117#if ENABLE(SHADOW_DOM)
     118        case CSSRule::HOST_RULE:
     119            wrapper = CREATE_DOM_WRAPPER(exec, globalObject, CSSHostRule, rule);
     120            break;
     121#endif
    116122        default:
    117123            wrapper = CREATE_DOM_WRAPPER(exec, globalObject, CSSRule, rule);
  • trunk/Source/WebCore/bindings/objc/DOMCSS.mm

    r139866 r140115  
    6767#if ENABLE(SVG_DOM_OBJC_BINDINGS)
    6868#import "DOMSVGPaint.h"
     69#endif
     70
     71#if ENABLE(SHADOW_DOM)
     72#import "DOMCSSHostRule.h"
    6973#endif
    7074
     
    115119            return [DOMWebKitCSSRegionRule class];
    116120#endif
     121#if ENABLE(SHADOW_DOM)
     122        case DOM_HOST_RULE:
     123            return [DOMCSSHostRule class];
     124#endif
    117125    }
    118126    ASSERT_NOT_REACHED();
  • trunk/Source/WebCore/bindings/v8/custom/V8CSSRuleCustom.cpp

    r139866 r140115  
    3434#include "V8CSSCharsetRule.h"
    3535#include "V8CSSFontFaceRule.h"
     36#include "V8CSSHostRule.h"
    3637#include "V8CSSImportRule.h"
    3738#include "V8CSSMediaRule.h"
     
    8687    case CSSRule::WEBKIT_REGION_RULE:
    8788        return wrap(static_cast<WebKitCSSRegionRule*>(impl), creationContext, isolate);
     89#if ENABLE(SHADOW_DOM)
     90    case CSSRule::HOST_RULE:
     91        return wrap(static_cast<CSSHostRule*>(impl), creationContext, isolate);
     92#endif
    8893    }
    8994    return V8CSSRule::createWrapper(impl, creationContext, isolate);
  • trunk/Source/WebCore/css/CSSAllInOne.cpp

    r139409 r140115  
    4343#include "CSSGradientValue.cpp"
    4444#include "CSSGroupingRule.cpp"
     45#include "CSSHostRule.cpp"
    4546#include "CSSImageGeneratorValue.cpp"
    4647#include "CSSImageValue.cpp"
  • trunk/Source/WebCore/css/CSSRule.h

    r139866 r140115  
    5858#endif
    5959#if ENABLE(CSS_REGIONS)
    60         WEBKIT_REGION_RULE = 16
     60        WEBKIT_REGION_RULE = 16,
     61#endif
     62#if ENABLE(SHADOW_DOM)
     63        HOST_RULE = 1001,
    6164#endif
    6265    };
  • trunk/Source/WebCore/css/CSSRule.idl

    r139866 r140115  
    4747    const unsigned short WEBKIT_REGION_RULE = 16;
    4848#endif
     49#if defined(ENABLE_SHADOW_DOM) && ENABLE_SHADOW_DOM
     50    const unsigned short HOST_RULE = 1001;
     51#endif
    4952
    5053    readonly attribute unsigned short   type;
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r140075 r140115  
    3636#include "CSSFontFaceRule.h"
    3737#include "CSSFontSelector.h"
     38#include "CSSHostRule.h"
    3839#include "CSSImportRule.h"
    3940#include "CSSLineBoxContainValue.h"
     
    26582659            break;
    26592660#endif
     2661#if ENABLE(SHADOW_DOM)
     2662        case CSSRule::HOST_RULE:
     2663            collectCSSOMWrappers(wrapperMap, static_cast<CSSHostRule*>(cssRule));
     2664            break;
     2665#endif
    26602666        case CSSRule::STYLE_RULE:
    26612667            wrapperMap.add(static_cast<CSSStyleRule*>(cssRule)->styleRule(), static_cast<CSSStyleRule*>(cssRule));
  • trunk/Source/WebCore/css/StyleRule.cpp

    r139866 r140115  
    2525#include "CSSCharsetRule.h"
    2626#include "CSSFontFaceRule.h"
     27#include "CSSHostRule.h"
    2728#include "CSSImportRule.h"
    2829#include "CSSMediaRule.h"
     
    8788#endif
    8889#if ENABLE(SHADOW_DOM)
    89     case Host:
    90         static_cast<const StyleRuleBlock*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
     90    case HostInternal:
     91        static_cast<const StyleRuleHost*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
    9192        return;
    9293#endif
     
    140141        return;
    141142#if ENABLE(SHADOW_DOM)
    142     case Host:
     143    case HostInternal:
    143144        delete static_cast<StyleRuleHost*>(this);
    144145        return;
     
    187188        return static_cast<const StyleRuleKeyframes*>(this)->copy();
    188189#if ENABLE(SHADOW_DOM)
    189     case Host:
     190    case HostInternal:
    190191        return static_cast<const StyleRuleHost*>(this)->copy();
    191192#endif
     
    246247#endif
    247248#if ENABLE(SHADOW_DOM)
    248     case Host:
    249         // FIXME: The current CSSOM editor's draft (http://dev.w3.org/csswg/cssom/) does not handle @host rules (see bug 102344).
    250         rule = adoptRef(new CSSUnknownRule());
     249    case HostInternal:
     250        rule = CSSHostRule::create(static_cast<StyleRuleHost*>(self), parentSheet);
    251251        break;
    252252#endif
  • trunk/Source/WebCore/css/StyleRule.h

    r139866 r140115  
    4747        Keyframes,
    4848        Keyframe, // Not used. These are internally non-rule StyleKeyframe objects.
    49 #if ENABLE(SHADOW_DOM)
    50         Host,
    51 #endif
    5249#if ENABLE(CSS3_CONDITIONAL_RULES)
    5350        Supports = 12,
     
    5653        Viewport = 15,
    5754#endif
    58         Region = 16
     55        Region = 16,
     56#if ENABLE(SHADOW_DOM)
     57        HostInternal = 17, // Spec says Host = 1001, but we can use only 5 bit for type().
     58#endif
    5959    };
     60
    6061    Type type() const { return static_cast<Type>(m_type); }
    6162   
     
    7576    bool isImportRule() const { return type() == Import; }
    7677#if ENABLE(SHADOW_DOM)
    77     bool isHostRule() const { return type() == Host; }
     78    bool isHostRule() const { return type() == HostInternal; }
    7879#endif
    7980
     
    274275
    275276private:
    276     StyleRuleHost(Vector<RefPtr<StyleRuleBase> >& adoptRules) : StyleRuleBlock(Host, adoptRules) { }
     277    StyleRuleHost(Vector<RefPtr<StyleRuleBase> >& adoptRules) : StyleRuleBlock(HostInternal, adoptRules) { }
    277278    StyleRuleHost(const StyleRuleHost& o) : StyleRuleBlock(o) { }
    278279};
  • trunk/Source/WebCore/css/StyleSheetContents.cpp

    r139866 r140115  
    445445            break;
    446446#if ENABLE(SHADOW_DOM)
    447         case StyleRuleBase::Host:
     447        case StyleRuleBase::HostInternal:
    448448            if (childRulesHaveFailedOrCanceledSubresources(static_cast<const StyleRuleHost*>(rule)->childRules()))
    449449                return true;
  • trunk/Source/WebCore/page/DOMWindow.idl

    r140010 r140115  
    352352    attribute CSSCharsetRuleConstructor CSSCharsetRule;
    353353    attribute CSSFontFaceRuleConstructor CSSFontFaceRule;
     354#if defined(ENABLE_SHADOW_DOM) && ENABLE_SHADOW_DOM
     355    attribute CSSHostRuleConstructor CSSHostRule;
     356#endif
    354357    attribute CSSImportRuleConstructor CSSImportRule;
    355358    attribute CSSMediaRuleConstructor CSSMediaRule;
Note: See TracChangeset for help on using the changeset viewer.