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

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: rename browser zoom to page zoom Created 6 years, 12 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/dom/TreeScope.h ('k') | Source/core/dom/ViewportDescription.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/TreeScope.cpp
diff --git a/Source/core/dom/TreeScope.cpp b/Source/core/dom/TreeScope.cpp
index 594a6f147fe4be0d6076cda189c09021b89fb6eb..3e5beecf0cd84a70ffbcd597fe50e7ded02db9c8 100644
--- a/Source/core/dom/TreeScope.cpp
+++ b/Source/core/dom/TreeScope.cpp
@@ -33,6 +33,7 @@
#include "core/dom/Element.h"
#include "core/dom/ElementTraversal.h"
#include "core/dom/IdTargetObserverRegistry.h"
+#include "core/dom/NodeRenderStyle.h"
#include "core/dom/TreeScopeAdopter.h"
#include "core/dom/shadow/ElementShadow.h"
#include "core/dom/shadow/ShadowRoot.h"
@@ -507,4 +508,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
« no previous file with comments | « Source/core/dom/TreeScope.h ('k') | Source/core/dom/ViewportDescription.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698