Remove stylesheet pointer from StylePropertySet
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2012 13:49:15 +0000 (13:49 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2012 13:49:15 +0000 (13:49 +0000)
commit708a278f8414777506cb41d538b3cee1ad5a3054
tree3e2a5bcca29b9277f5687b396bcfcfb2843f934a
parent8ad1f7f14db17f2a31155c8a895c8c9b26ffb316
Remove stylesheet pointer from StylePropertySet
https://bugs.webkit.org/show_bug.cgi?id=79092

Reviewed by Andreas Kling.

The context should be passed as an argument for CSS parser invoking setters that actually need it.

- Remove the context stylesheet pointer.
- Add context stylesheet argument to setters.
- Drop an unnecessary StylePropertySet constructor, pass strict parsing flag directly.
- Adapt to changes by passing in the context stylesheet where needed.
- Add StyledElement::applyPresentationAttributeToStyle helpers for building up the attribute style.

* css/CSSFontFaceRule.cpp:
(WebCore::CSSFontFaceRule::addSubresourceStyleURLs):
* css/CSSParser.cpp:
(WebCore::parseColorValue):
(WebCore::parseSimpleLengthValue):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseDeclaration):
(WebCore::CSSParser::createStyleRule):
(WebCore::CSSParser::createFontFaceRule):
(WebCore::CSSParser::createPageRule):
(WebCore::CSSParser::createKeyframeRule):
* css/CSSParser.h:
(CSSParser):
* css/CSSStyleRule.cpp:
(WebCore::CSSStyleRule::addSubresourceStyleURLs):
* css/StylePropertySet.cpp:
(WebCore::PropertySetCSSStyleDeclaration::contextStyleSheet):
(WebCore::PropertySetCSSStyleDeclaration::setNeedsStyleRecalc):
(RuleCSSStyleDeclaration):
(InlineCSSStyleDeclaration):
(WebCore):
(WebCore::StylePropertySet::StylePropertySet):
(WebCore::StylePropertySet::setProperty):
(WebCore::StylePropertySet::parseDeclaration):
(WebCore::StylePropertySet::addSubresourceStyleURLs):
(WebCore::StylePropertySet::clearParentRule):
(WebCore::StylePropertySet::clearParentElement):
(WebCore::PropertySetCSSStyleDeclaration::setCssText):
(WebCore::PropertySetCSSStyleDeclaration::setProperty):
(WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal):
(WebCore::PropertySetCSSStyleDeclaration::parentStyleSheet):
(WebCore::RuleCSSStyleDeclaration::setNeedsStyleRecalc):
(WebCore::RuleCSSStyleDeclaration::contextStyleSheet):
(WebCore::InlineCSSStyleDeclaration::contextStyleSheet):
(SameSizeAsStylePropertySet):
* css/StylePropertySet.h:
(WebCore::StylePropertySet::create):
(StylePropertySet):
* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::setMatrixValue):
* dom/ElementAttributeData.cpp:
(WebCore::ElementAttributeData::ensureInlineStyleDecl):
* dom/StyledElement.cpp:
(WebCore):
(WebCore::StyledElement::parseAttribute):
(WebCore::StyledElement::setInlineStyleProperty):
(WebCore::StyledElement::addSubresourceAttributeURLs):
(WebCore::StyledElement::updateAttributeStyle):
* dom/StyledElement.h:
(StyledElement):
(WebCore::StyledElement::applyPresentationAttributeToStyle):
(WebCore):
* html/HTMLBRElement.cpp:
(WebCore::HTMLBRElement::collectStyleForAttribute):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::collectStyleForAttribute):
* html/HTMLDivElement.cpp:
(WebCore::HTMLDivElement::collectStyleForAttribute):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::applyBorderAttributeToStyle):
(WebCore::HTMLElement::mapLanguageAttributeToLocale):
(WebCore::HTMLElement::collectStyleForAttribute):
(WebCore::HTMLElement::applyAlignmentAttributeToStyle):
(WebCore::HTMLElement::addHTMLLengthToStyle):
(WebCore::HTMLElement::addHTMLColorToStyle):
* html/HTMLElement.h:
(HTMLElement):
* html/HTMLFontElement.cpp:
(WebCore::HTMLFontElement::collectStyleForAttribute):
* html/HTMLHRElement.cpp:
(WebCore::HTMLHRElement::collectStyleForAttribute):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::collectStyleForAttribute):
* html/HTMLLIElement.cpp:
(WebCore::HTMLLIElement::collectStyleForAttribute):
* html/HTMLMarqueeElement.cpp:
(WebCore::HTMLMarqueeElement::collectStyleForAttribute):
* html/HTMLOListElement.cpp:
(WebCore::HTMLOListElement::collectStyleForAttribute):
* html/HTMLParagraphElement.cpp:
(WebCore::HTMLParagraphElement::collectStyleForAttribute):
* html/HTMLTableCaptionElement.cpp:
(WebCore::HTMLTableCaptionElement::collectStyleForAttribute):
* html/HTMLTableCellElement.cpp:
(WebCore::HTMLTableCellElement::collectStyleForAttribute):
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::collectStyleForAttribute):
* html/HTMLTablePartElement.cpp:
(WebCore::HTMLTablePartElement::collectStyleForAttribute):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::collectStyleForAttribute):
* html/HTMLUListElement.cpp:
(WebCore::HTMLUListElement::collectStyleForAttribute):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setFont):
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::collectStyleForAttribute):
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::insertedIntoDocument):
(WebCore::SVGFontFaceElement::removedFromDocument):
(WebCore::SVGFontFaceElement::removeFromMappedElementSheet):
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::collectStyleForAttribute):
* svg/SVGStyledElement.cpp:
(WebCore::SVGStyledElement::collectStyleForAttribute):
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::collectStyleForAttribute):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108345 268f45cc-cd09-0410-ab3c-d52691b4dbfc
35 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/CSSFontFaceRule.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebCore/css/CSSStyleRule.cpp
Source/WebCore/css/StylePropertySet.cpp
Source/WebCore/css/StylePropertySet.h
Source/WebCore/css/WebKitCSSMatrix.cpp
Source/WebCore/dom/ElementAttributeData.cpp
Source/WebCore/dom/StyledElement.cpp
Source/WebCore/dom/StyledElement.h
Source/WebCore/html/HTMLBRElement.cpp
Source/WebCore/html/HTMLBodyElement.cpp
Source/WebCore/html/HTMLDivElement.cpp
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLElement.h
Source/WebCore/html/HTMLFontElement.cpp
Source/WebCore/html/HTMLHRElement.cpp
Source/WebCore/html/HTMLImageElement.cpp
Source/WebCore/html/HTMLLIElement.cpp
Source/WebCore/html/HTMLMarqueeElement.cpp
Source/WebCore/html/HTMLOListElement.cpp
Source/WebCore/html/HTMLParagraphElement.cpp
Source/WebCore/html/HTMLTableCaptionElement.cpp
Source/WebCore/html/HTMLTableCellElement.cpp
Source/WebCore/html/HTMLTableElement.cpp
Source/WebCore/html/HTMLTablePartElement.cpp
Source/WebCore/html/HTMLTextAreaElement.cpp
Source/WebCore/html/HTMLUListElement.cpp
Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
Source/WebCore/mathml/MathMLElement.cpp
Source/WebCore/svg/SVGFontFaceElement.cpp
Source/WebCore/svg/SVGImageElement.cpp
Source/WebCore/svg/SVGStyledElement.cpp
Source/WebCore/svg/SVGTextContentElement.cpp