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

Unified Diff: Source/core/dom/Document.cpp

Issue 42543007: StyleResolver should update RuleSets lazily. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Filter @viewport and @font-face in lazyAppend Created 7 years, 1 month 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
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index f7dc5c041d91a896b180cbc31c47a3c389e76f2e..6b121e34a32c67f3b954f11cc21a2b440edff51c 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -615,6 +615,7 @@ MediaQueryMatcher& Document::mediaQueryMatcher()
{
if (!m_mediaQueryMatcher)
m_mediaQueryMatcher = MediaQueryMatcher::create(this);
+ appendPendingStyleSheetsIfNeeded(m_styleResolver.get());
return *m_mediaQueryMatcher;
}
@@ -1683,6 +1684,8 @@ void Document::recalcStyle(StyleRecalcChange change)
if (m_elemSheet && m_elemSheet->contents()->usesRemUnits())
m_styleEngine->setUsesRemUnit(true);
+ appendPendingStyleSheetsIfNeeded(m_styleResolver.get());
+
{
PostAttachCallbacks::SuspendScope suspendPostAttachCallbacks;
RenderWidget::UpdateSuspendScope suspendWidgetHierarchyUpdates;
@@ -1870,12 +1873,16 @@ PassRefPtr<RenderStyle> Document::styleForElementIgnoringPendingStylesheets(Elem
{
ASSERT_ARG(element, element->document() == this);
TemporaryChange<bool> ignoreStyleSheets(m_ignorePendingStylesheets, true);
- return styleResolver()->styleForElement(element, element->parentNode() ? element->parentNode()->computedStyle() : 0);
+ StyleResolver* resolver = styleResolver();
+ appendPendingStyleSheetsIfNeeded(resolver);
+ return resolver->styleForElement(element, element->parentNode() ? element->parentNode()->computedStyle() : 0);
}
PassRefPtr<RenderStyle> Document::styleForPage(int pageIndex)
{
- return styleResolver()->styleForPage(pageIndex);
+ StyleResolver* resolver = styleResolver();
+ appendPendingStyleSheetsIfNeeded(resolver);
+ return resolver->styleForPage(pageIndex);
}
bool Document::isPageBoxVisible(int pageIndex)

Powered by Google App Engine
This is Rietveld 408576698