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

Unified Diff: Source/WebCore/page/FrameView.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
« no previous file with comments | « Source/WebCore/dom/DocumentStyleSheetCollection.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/page/FrameView.cpp
diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp
index 3fe41c9ffec46ee4cabe8e6434496e3fc28d83cb..d9f10b718ed40649f1d8deef663c567bb8ff84b8 100644
--- a/Source/WebCore/page/FrameView.cpp
+++ b/Source/WebCore/page/FrameView.cpp
@@ -1108,15 +1108,21 @@ void FrameView::layout(bool allowSubtree)
if (document->styleResolver()->affectedByViewportChange()) {
document->styleResolverChanged(RecalcStyleImmediately);
InspectorInstrumentation::mediaQueryResultChanged(document);
- } else
+ } else {
document->evaluateMediaQueryList();
+ if (document->styleSheetCollection()->usesViewportUnits()) {
+ document->styleResolver()->invalidateMatchedPropertiesCache();
+ document->scheduleForcedStyleRecalc();
esprehn 2013/04/09 08:20:27 This is a big hammer. It's going to mean pretty cr
+ }
+ }
// If there is any pagination to apply, it will affect the RenderView's style, so we should
// take care of that now.
applyPaginationToViewport();
// Always ensure our style info is up-to-date. This can happen in situations where
- // the layout beats any sort of style recalc update that needs to occur.
+ // the layout beats any sort of style recalc update that needs to occur, and if we
esprehn 2013/04/09 08:20:27 "or if" is probably more clear. I had to read this
+ // have to recalc due to the presence of viewport units.
TemporaryChange<bool> changeDoingPreLayoutStyleUpdate(m_doingPreLayoutStyleUpdate, true);
document->updateStyleIfNeeded();
« no previous file with comments | « Source/WebCore/dom/DocumentStyleSheetCollection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698