summaryrefslogtreecommitdiff
path: root/Source/WebCore/css/CSSMediaRule.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-11 09:43:24 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-11 09:43:24 +0200
commit1b914638db989aaa98631a1c1e02c7b2d44805d8 (patch)
tree87f4fd2c7b38db320079a5de8877890d2ca3c485 /Source/WebCore/css/CSSMediaRule.cpp
parent2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (diff)
downloadqtwebkit-1b914638db989aaa98631a1c1e02c7b2d44805d8.tar.gz
Imported WebKit commit 9a52e27980f47e8b0d8f8b7cc0fd7b5741bceb92 (http://svn.webkit.org/repository/webkit/trunk@116736)
New snapshot to include QDeclarative* -> QQml* build fixes
Diffstat (limited to 'Source/WebCore/css/CSSMediaRule.cpp')
-rw-r--r--Source/WebCore/css/CSSMediaRule.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/Source/WebCore/css/CSSMediaRule.cpp b/Source/WebCore/css/CSSMediaRule.cpp
index a6ee351f7..e09904209 100644
--- a/Source/WebCore/css/CSSMediaRule.cpp
+++ b/Source/WebCore/css/CSSMediaRule.cpp
@@ -25,6 +25,7 @@
#include "CSSParser.h"
#include "CSSRuleList.h"
+#include "CSSStyleSheet.h"
#include "ExceptionCode.h"
#include "StyleRule.h"
#include <wtf/text/StringBuilder.h>
@@ -80,13 +81,11 @@ unsigned CSSMediaRule::insertRule(const String& ruleString, unsigned index, Exce
ec = HIERARCHY_REQUEST_ERR;
return 0;
}
+ CSSStyleSheet::RuleMutationScope mutationScope(this);
+
m_mediaRule->wrapperInsertRule(index, newRule);
m_childRuleCSSOMWrappers.insert(index, RefPtr<CSSRule>());
-
- if (CSSStyleSheet* styleSheet = parentStyleSheet())
- styleSheet->styleSheetChanged();
-
return index;
}
@@ -100,14 +99,14 @@ void CSSMediaRule::deleteRule(unsigned index, ExceptionCode& ec)
ec = INDEX_SIZE_ERR;
return;
}
+
+ CSSStyleSheet::RuleMutationScope mutationScope(this);
+
m_mediaRule->wrapperRemoveRule(index);
if (m_childRuleCSSOMWrappers[index])
m_childRuleCSSOMWrappers[index]->setParentRule(0);
m_childRuleCSSOMWrappers.remove(index);
-
- if (CSSStyleSheet* styleSheet = parentStyleSheet())
- styleSheet->styleSheetChanged();
}
String CSSMediaRule::cssText() const
@@ -163,4 +162,16 @@ CSSRuleList* CSSMediaRule::cssRules() const
return m_ruleListCSSOMWrapper.get();
}
+void CSSMediaRule::reattach(StyleRuleMedia* rule)
+{
+ ASSERT(rule);
+ m_mediaRule = rule;
+ if (m_mediaCSSOMWrapper)
+ m_mediaCSSOMWrapper->reattach(m_mediaRule->mediaQueries());
+ for (unsigned i = 0; i < m_childRuleCSSOMWrappers.size(); ++i) {
+ if (m_childRuleCSSOMWrappers[i])
+ m_childRuleCSSOMWrappers[i]->reattach(m_mediaRule->childRules()[i].get());
+ }
+}
+
} // namespace WebCore