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

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

Issue 82083002: Move viewport unit resolution to style recalc time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: actually fix zoom handling Created 7 years 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/TreeScope.cpp
diff --git a/Source/core/dom/TreeScope.cpp b/Source/core/dom/TreeScope.cpp
index 56ad63782b7cde9c1b9c3cb2ee5ed8b560e3f81c..36ca717bbb67358fcd137caef7b732e93a671940 100644
--- a/Source/core/dom/TreeScope.cpp
+++ b/Source/core/dom/TreeScope.cpp
@@ -497,4 +497,15 @@ Element* TreeScope::getElementByAccessKey(const String& key) const
return result;
}
+void TreeScope::setNeedsStyleRecalcForViewportUnits()
+{
+ for (Element* element = ElementTraversal::firstWithin(*rootNode()); element; element = ElementTraversal::nextIncludingPseudo(*element)) {
+ for (ShadowRoot* root = element->youngestShadowRoot(); root; root = root->olderShadowRoot())
+ root->setNeedsStyleRecalcForViewportUnits();
+ RenderStyle* style = element->renderStyle();
+ if (style && style->hasViewportUnits())
+ element->setNeedsStyleRecalc(LocalStyleChange);
+ }
+}
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698