Split WebKitCSSKeyframeRule into internal and CSSOM types
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Mar 2012 10:17:19 +0000 (10:17 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Mar 2012 10:17:19 +0000 (10:17 +0000)
commit7684a72dcc6cff728eb64b7f270e56b84854dcdb
tree0d8f8c11513bf4f12728f0b3715d598656d04b5e
parent3ebf85d358ec498f6e88f50f778c98bd99594e38
Split WebKitCSSKeyframeRule into internal and CSSOM types
https://bugs.webkit.org/show_bug.cgi?id=82490

Reviewed by Andreas Kling.

WebKitCSSKeyframeRule is a CSSOM type and should not be used internally.

- Add StyleKeyframe as the internal data structure for keyframes.
- WebKitCSSKeyframeRule becomes a wrapper for StyleKeyframe.
- Use StyleKeyframe internally so WebKitCSSKeyframeRules are created on CSSOM access only.

* css/CSSGrammar.y:

    Use StyleKeyframes instead of WebKitCSSKeyframeRules.

* css/CSSMediaRule.h:
(CSSMediaRule):
(WebCore::CSSMediaRule::length):
(WebCore::CSSMediaRule::item):

    Adapt to LiveCSSRuleList changes.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseKeyframeRule):
(WebCore::CSSParser::createKeyframe):
* css/CSSParser.h:
(WebCore):
(CSSParser):

    Construct StyleKeyframes.

* css/CSSRuleList.h:
(WebCore::LiveCSSRuleList::length):
(WebCore::LiveCSSRuleList::item):

    Make LiveCSSRuleList call rule item()/length() to avoid accessor duplication.

* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::collectMatchingRulesForList):
* css/CSSStyleSelector.h:
(CSSStyleSelector):
* css/WebKitCSSKeyframeRule.cpp:

    Use StyleKeyframe.
    Make 0% and 100% keyframes static.

(WebCore):
(WebCore::StyleKeyframe::setProperties):
(WebCore::StyleKeyframe::parseKeyString):
(WebCore::StyleKeyframe::cssText):
(WebCore::WebKitCSSKeyframeRule::WebKitCSSKeyframeRule):
(WebCore::WebKitCSSKeyframeRule::~WebKitCSSKeyframeRule):
(WebCore::WebKitCSSKeyframeRule::style):
* css/WebKitCSSKeyframeRule.h:
(WebCore):
(WebCore::StyleKeyframe::create):
(WebCore::StyleKeyframe::keyText):
(WebCore::StyleKeyframe::setKeyText):
(StyleKeyframe):
(WebCore::StyleKeyframe::properties):
(WebCore::StyleKeyframe::StyleKeyframe):
(WebKitCSSKeyframeRule):
(WebCore::WebKitCSSKeyframeRule::keyText):
(WebCore::WebKitCSSKeyframeRule::setKeyText):
(WebCore::WebKitCSSKeyframeRule::cssText):

    Split to internal and CSSOM wrapper type. The wrapper refs StyleKeyframe.

* css/WebKitCSSKeyframesRule.cpp:
(WebCore::WebKitCSSKeyframesRule::~WebKitCSSKeyframesRule):
(WebCore::WebKitCSSKeyframesRule::parserAppendKeyframe):
(WebCore::WebKitCSSKeyframesRule::insertRule):
(WebCore::WebKitCSSKeyframesRule::deleteRule):
(WebCore::WebKitCSSKeyframesRule::findRule):
(WebCore::WebKitCSSKeyframesRule::findKeyframeIndex):
(WebCore::WebKitCSSKeyframesRule::cssText):
(WebCore):
(WebCore::WebKitCSSKeyframesRule::item):
* css/WebKitCSSKeyframesRule.h:
(WebCore):
(WebCore::WebKitCSSKeyframesRule::keyframes):
(WebKitCSSKeyframesRule):
(WebCore::WebKitCSSKeyframesRule::length):

    Keep StyleKeyframes and the wrappers (WebKitCSSKeyframeRules) in separate vectors.
    Construct the wrapper vector and wrappers themselves on demand.
    Keep the vectors in sync during mutations.

* css/WebKitCSSRegionRule.h:

    Adapt to LiveCSSRuleList changes.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112516 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/CSSGrammar.y
Source/WebCore/css/CSSMediaRule.h
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebCore/css/CSSRuleList.h
Source/WebCore/css/CSSStyleSelector.cpp
Source/WebCore/css/CSSStyleSelector.h
Source/WebCore/css/WebKitCSSKeyframeRule.cpp
Source/WebCore/css/WebKitCSSKeyframeRule.h
Source/WebCore/css/WebKitCSSKeyframesRule.cpp
Source/WebCore/css/WebKitCSSKeyframesRule.h
Source/WebCore/css/WebKitCSSRegionRule.h