Layout should force a StyleResolver rebuild if there isn't one at all.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Aug 2013 19:19:42 +0000 (19:19 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Aug 2013 19:19:42 +0000 (19:19 +0000)
<http://webkit.org/b/119378>

Reviewed by Antti Koivisto.

We can't tell if viewport-dependent media queries have been invalidated at layout,
unless we have a StyleResolver to ask about this.
In case there isn't one, take the same path as we would with an invalidated query
instead of relying on ensureStyleResolver() to build it.

* page/FrameView.cpp:
(WebCore::FrameView::layout):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153595 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp

index 43d2e55..ff764ab 100644 (file)
@@ -1,3 +1,18 @@
+2013-08-01  Andreas Kling  <akling@apple.com>
+
+        Layout should force a StyleResolver rebuild if there isn't one at all.
+        <http://webkit.org/b/119378>
+
+        Reviewed by Antti Koivisto.
+
+        We can't tell if viewport-dependent media queries have been invalidated at layout,
+        unless we have a StyleResolver to ask about this.
+        In case there isn't one, take the same path as we would with an invalidated query
+        instead of relying on ensureStyleResolver() to build it.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::layout):
+
 2013-08-01  Jacky Jiang  <zhajiang@blackberry.com>
 
         [BlackBerry] Crash at absoluteClippedOverflowRect() in PluginView::calculateClipRect()
index c3d2fa5..88d44f7 100644 (file)
@@ -1191,8 +1191,10 @@ void FrameView::layout(bool allowSubtree)
         }
 
         // Viewport-dependent media queries may cause us to need completely different style information.
-        if (document->ensureStyleResolver()->affectedByViewportChange()) {
+        if (!document->styleResolverIfExists() || document->styleResolverIfExists()->affectedByViewportChange()) {
             document->styleResolverChanged(DeferRecalcStyle);
+            // FIXME: This instrumentation event is not strictly accurate since cached media query results
+            //        do not persist across StyleResolver rebuilds.
             InspectorInstrumentation::mediaQueryResultChanged(document);
         } else
             document->evaluateMediaQueryList();