From dd91e772430dc294e3bf478c119ef8d43c0a3358 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 12 Mar 2012 14:11:15 +0100 Subject: Imported WebKit commit 3db4eb1820ac8fb03065d7ea73a4d9db1e8fea1a (http://svn.webkit.org/repository/webkit/trunk@110422) This includes build fixes for the latest qtbase/qtdeclarative as well as the final QML2 API. --- Source/WebCore/css/CSSStyleRule.cpp | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) (limited to 'Source/WebCore/css/CSSStyleRule.cpp') diff --git a/Source/WebCore/css/CSSStyleRule.cpp b/Source/WebCore/css/CSSStyleRule.cpp index 7a1d66fca..65da867c5 100644 --- a/Source/WebCore/css/CSSStyleRule.cpp +++ b/Source/WebCore/css/CSSStyleRule.cpp @@ -22,35 +22,34 @@ #include "config.h" #include "CSSStyleRule.h" -#include "CSSPageRule.h" #include "CSSParser.h" #include "CSSSelector.h" #include "CSSStyleSheet.h" #include "Document.h" #include "StylePropertySet.h" -#include "StyledElement.h" -#include "StyleSheet.h" - +#include "StyleRule.h" #include namespace WebCore { CSSStyleRule::CSSStyleRule(CSSStyleSheet* parent, int line) : CSSRule(parent, CSSRule::STYLE_RULE) + , m_styleRule(adoptPtr(new StyleRule(line, this))) { - setSourceLine(line); - - // m_sourceLine is a bitfield, so let's catch any overflow early in debug mode. - ASSERT(sourceLine() == line); } CSSStyleRule::~CSSStyleRule() { - if (m_style) - m_style->clearParentRule(this); + if (m_styleRule->properties()) + m_styleRule->properties()->clearParentRule(this); cleanup(); } +CSSStyleDeclaration* CSSStyleRule::style() const +{ + return m_styleRule->properties()->ensureRuleCSSStyleDeclaration(this); +} + typedef HashMap SelectorTextCache; static SelectorTextCache& selectorTextCache() { @@ -69,8 +68,8 @@ inline void CSSStyleRule::cleanup() String CSSStyleRule::generateSelectorText() const { StringBuilder builder; - for (CSSSelector* s = selectorList().first(); s; s = CSSSelectorList::next(s)) { - if (s != selectorList().first()) + for (CSSSelector* s = m_styleRule->selectorList().first(); s; s = CSSSelectorList::next(s)) { + if (s != m_styleRule->selectorList().first()) builder.append(", "); builder.append(s->selectorText()); } @@ -106,7 +105,7 @@ void CSSStyleRule::setSelectorText(const String& selectorText) return; String oldSelectorText = this->selectorText(); - m_selectorList.adopt(selectorList); + m_styleRule->adoptSelectorList(selectorList); if (hasCachedSelectorText()) { ASSERT(selectorTextCache().contains(this)); @@ -124,16 +123,10 @@ String CSSStyleRule::cssText() const String result = selectorText(); result += " { "; - result += m_style->asText(); + result += m_styleRule->properties()->asText(); result += "}"; return result; } -void CSSStyleRule::addSubresourceStyleURLs(ListHashSet& urls) -{ - if (m_style) - m_style->addSubresourceStyleURLs(urls, parentStyleSheet()); -} - } // namespace WebCore -- cgit v1.2.1