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(); |