Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(744)

Unified Diff: Source/core/css/StyleSheetContents.cpp

Issue 131403008: Revert of Use removeFontFace to avoid resetting fontSelector. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/StyleSheetContents.h ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/StyleSheetContents.cpp
diff --git a/Source/core/css/StyleSheetContents.cpp b/Source/core/css/StyleSheetContents.cpp
index 272b5ebfba0647a22a76a81d12a8a8a1b102b31e..606274d4de4c959de195d9c9c42982e124fb1946 100644
--- a/Source/core/css/StyleSheetContents.cpp
+++ b/Source/core/css/StyleSheetContents.cpp
@@ -27,7 +27,7 @@
#include "core/css/StylePropertySet.h"
#include "core/css/StyleRule.h"
#include "core/css/StyleRuleImport.h"
-#include "core/dom/Document.h"
+#include "core/css/resolver/StyleResolver.h"
#include "core/dom/Node.h"
#include "core/dom/StyleEngine.h"
#include "core/fetch/CSSStyleSheetResource.h"
@@ -245,8 +245,6 @@
return false;
childVectorIndex -= m_importRules.size();
- if (rule->isFontFaceRule())
- setHasFontFaceRule(true);
m_childRules.insert(childVectorIndex, rule);
return true;
}
@@ -266,15 +264,11 @@
}
if (childVectorIndex < m_importRules.size()) {
m_importRules[childVectorIndex]->clearParentStyleSheet();
- if (m_importRules[childVectorIndex]->isFontFaceRule())
- notifyRemoveFontFaceRule(toStyleRuleFontFace(m_importRules[childVectorIndex].get()));
m_importRules.remove(childVectorIndex);
return;
}
childVectorIndex -= m_importRules.size();
- if (m_childRules[childVectorIndex]->isFontFaceRule())
- notifyRemoveFontFaceRule(toStyleRuleFontFace(m_childRules[childVectorIndex].get()));
m_childRules.remove(childVectorIndex);
}
@@ -533,43 +527,5 @@
m_ruleSet.clear();
}
-void StyleSheetContents::notifyRemoveFontFaceRule(const StyleRuleFontFace* fontFaceRule)
-{
- StyleSheetContents* root = rootStyleSheet();
- if (root->m_clients.isEmpty())
- return;
-
- for (unsigned i = 0; i < root->m_clients.size(); ++i) {
- if (Node* ownerNode = root->m_clients[0]->ownerNode())
- ownerNode->document().styleEngine()->removeFontFaceRules(Vector<const StyleRuleFontFace*>(1, fontFaceRule));
- }
-}
-
-static void findFontFaceRulesFromRules(const Vector<RefPtr<StyleRuleBase> >& rules, Vector<const StyleRuleFontFace*>& fontFaceRules)
-{
- for (unsigned i = 0; i < rules.size(); ++i) {
- StyleRuleBase* rule = rules[i].get();
-
- if (rule->isFontFaceRule()) {
- fontFaceRules.append(toStyleRuleFontFace(rule));
- } else if (rule->isMediaRule()) {
- StyleRuleMedia* mediaRule = static_cast<StyleRuleMedia*>(rule);
- // We cannot know whether the media rule matches or not, but
- // for safety, remove @font-face in the media rule (if exists).
- findFontFaceRulesFromRules(mediaRule->childRules(), fontFaceRules);
- }
- }
-}
-
-void StyleSheetContents::findFontFaceRules(Vector<const StyleRuleFontFace*>& fontFaceRules)
-{
- for (unsigned i = 0; i < m_importRules.size(); ++i) {
- if (!m_importRules[i]->styleSheet())
- continue;
- m_importRules[i]->styleSheet()->findFontFaceRules(fontFaceRules);
- }
-
- findFontFaceRulesFromRules(childRules(), fontFaceRules);
-}
-
-}
+
+}
« no previous file with comments | « Source/core/css/StyleSheetContents.h ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698