Implement CSSGroupingRule for @host @-rules and @supports.
authortasak@google.com <tasak@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Jan 2013 07:08:28 +0000 (07:08 +0000)
committertasak@google.com <tasak@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Jan 2013 07:08:28 +0000 (07:08 +0000)
commit1429f794b04278906f995f7ec1f4375755e1f9e0
treeb53f93acbbb106d3e65358d9266fe187b4433514
parent600cb19dbe5d0eddabc23756e627530871cbefcd
Implement CSSGroupingRule for @host @-rules and @supports.
https://bugs.webkit.org/show_bug.cgi?id=106418

Reviewed by Antti Koivisto.

CSSGroupingRule is to share code between CSSMediaRule, CSSSupportsRule
and CSSHostRule. @supports and @host @-rules are dervied from
CSSGroupingRule:
http://www.w3.org/TR/2012/WD-css3-conditional/#the-cssgroupingrule-interface
https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#css-host-rule-interface
Since @media is also derived from CSSGroupingRule and @region has the
same interface as CSSGroupingRule, modify to use CSSGroupingRule:
http://dev.w3.org/csswg/css3-regions/#the-at-region-style-rule

No new tests, because no new feature is implemented.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
Added CSSGroupingRule.h and CSSGroupingRule.cpp.
* css/CSSAllInOne.cpp:
Modified to include CSSGroupingRule.cpp.
* css/CSSGroupingRule.cpp: Added.
(WebCore):
(WebCore::CSSGroupingRule::CSSGroupingRule):
(WebCore::CSSGroupingRule::~CSSGroupingRule):
(WebCore::CSSGroupingRule::insertRule):
(WebCore::CSSGroupingRule::deleteRule):
(WebCore::CSSGroupingRule::appendCssTextForItems):
(WebCore::CSSGroupingRule::length):
(WebCore::CSSGroupingRule::item):
(WebCore::CSSGroupingRule::cssRules):
(WebCore::CSSGroupingRule::reattach):
(WebCore::CSSGroupingRule::reportMemoryUsage):
These codes are moved from CSSMediaRule and WebKitCSSRegionRule.
* css/CSSGroupingRule.h:
(WebCore):
(CSSGroupingRule):
* css/CSSMediaRule.cpp:
(WebCore::CSSMediaRule::CSSMediaRule):
(WebCore::CSSMediaRule::~CSSMediaRule):
Make CSSMediaRule inherit CSSGroupingRule.
(WebCore::CSSMediaRule::media):
(WebCore::CSSMediaRule::reattach):
Keep the code for updating media queries' CSSOMWrapper.
(WebCore::CSSMediaRule::reportMemoryUsage):
We need to report media queries' CSSOMWrapper memory usage.
(WebCore::CSSMediaRule::mediaQueries):
(WebCore::CSSMediaRule::cssText):
* css/CSSMediaRule.h:
* css/WebKitCSSRegionRule.cpp:
Make WebKitCSSRegionRule inherit CSSGroupingRule.
(WebCore::WebKitCSSRegionRule::WebKitCSSRegionRule):
(WebCore::WebKitCSSRegionRule::cssText):
* css/WebKitCSSRegionRule.h:
* css/StyleRule.h:
Added inlined accessor to obtain StyleRuleMedia* and StyleRuleRegion*
from StyleRuleBlock*.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@139409 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/CSSAllInOne.cpp
Source/WebCore/css/CSSGroupingRule.cpp [new file with mode: 0644]
Source/WebCore/css/CSSGroupingRule.h [new file with mode: 0644]
Source/WebCore/css/CSSMediaRule.cpp
Source/WebCore/css/CSSMediaRule.h
Source/WebCore/css/StyleRule.h
Source/WebCore/css/WebKitCSSRegionRule.cpp
Source/WebCore/css/WebKitCSSRegionRule.h