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

Unified Diff: Source/WebCore/dom/DocumentStyleSheetCollection.cpp

Issue 13771002: Recalc styles on resize if we have viewport units. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 years, 8 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
Index: Source/WebCore/dom/DocumentStyleSheetCollection.cpp
diff --git a/Source/WebCore/dom/DocumentStyleSheetCollection.cpp b/Source/WebCore/dom/DocumentStyleSheetCollection.cpp
index 232b5e2d634c2d794610a658ccf5ffd84cfaf741..31458f8982cd489f45d52d10ec9b90bfc4e3726c 100644
--- a/Source/WebCore/dom/DocumentStyleSheetCollection.cpp
+++ b/Source/WebCore/dom/DocumentStyleSheetCollection.cpp
@@ -68,6 +68,7 @@ DocumentStyleSheetCollection::DocumentStyleSheetCollection(Document* document)
, m_usesBeforeAfterRules(false)
, m_usesBeforeAfterRulesOverride(false)
, m_usesRemUnits(false)
+ , m_usesViewportUnits(false)
{
}
@@ -427,6 +428,15 @@ static bool styleSheetsUseRemUnits(const Vector<RefPtr<CSSStyleSheet> >& sheets)
return false;
}
+static bool styleSheetsUseViewportUnits(const Vector<RefPtr<CSSStyleSheet> >& sheets)
+{
+ for (unsigned i = 0; i < sheets.size(); ++i) {
+ if (sheets[i]->contents()->usesViewportUnits())
+ return true;
+ }
+ return false;
+}
+
static void filterEnabledCSSStyleSheets(Vector<RefPtr<CSSStyleSheet> >& result, const Vector<RefPtr<StyleSheet> >& sheets)
{
for (unsigned i = 0; i < sheets.size(); ++i) {
@@ -490,6 +500,7 @@ bool DocumentStyleSheetCollection::updateActiveStyleSheets(UpdateFlag updateFlag
m_styleSheetsForStyleSheetList.swap(activeStyleSheets);
m_usesRemUnits = styleSheetsUseRemUnits(m_activeAuthorStyleSheets);
+ m_usesViewportUnits = styleSheetsUseViewportUnits(m_activeAuthorStyleSheets);
m_needsUpdateActiveStylesheetsOnStyleRecalc = false;
m_document->notifySeamlessChildDocumentsOfStylesheetUpdate();

Powered by Google App Engine
This is Rietveld 408576698