Title: [151715] trunk/Source/WebCore
Revision
151715
Author
[email protected]
Date
2013-06-18 18:51:44 -0700 (Tue, 18 Jun 2013)

Log Message

Improve style of null checks in FrameView::setFrameRect
https://bugs.webkit.org/show_bug.cgi?id=117681

Reviewed by Sam Weinig.

* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect): Used nested if statements and local variables
to tighten this code up a little.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (151714 => 151715)


--- trunk/Source/WebCore/ChangeLog	2013-06-19 01:45:39 UTC (rev 151714)
+++ trunk/Source/WebCore/ChangeLog	2013-06-19 01:51:44 UTC (rev 151715)
@@ -1,3 +1,14 @@
+2013-06-18  Darin Adler  <[email protected]>
+
+        Improve style of null checks in FrameView::setFrameRect
+        https://bugs.webkit.org/show_bug.cgi?id=117681
+
+        Reviewed by Sam Weinig.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::setFrameRect): Used nested if statements and local variables
+        to tighten this code up a little.
+
 2013-06-18  Christophe Dumez  <[email protected]>
 
         Move IDL extended attributes to their correct location

Modified: trunk/Source/WebCore/page/FrameView.cpp (151714 => 151715)


--- trunk/Source/WebCore/page/FrameView.cpp	2013-06-19 01:45:39 UTC (rev 151714)
+++ trunk/Source/WebCore/page/FrameView.cpp	2013-06-19 01:51:44 UTC (rev 151715)
@@ -475,12 +475,16 @@
     }
 #endif
 
-    Document* document = m_frame ? m_frame->document() : 0;
-
     // Viewport-dependent media queries may cause us to need completely different style information.
-    if (document && document->styleResolverIfExists() && document->styleResolverIfExists()->affectedByViewportChange()) {
-        document->styleResolverChanged(DeferRecalcStyle);
-        InspectorInstrumentation::mediaQueryResultChanged(document);
+    if (m_frame) {
+        if (Document* document = m_frame->document()) {
+            if (StyleResolver* resolver = document->styleResolverIfExists()) {
+                if (resolver->affectedByViewportChange()) {
+                    document->styleResolverChanged(DeferRecalcStyle);
+                    InspectorInstrumentation::mediaQueryResultChanged(document);
+                }
+            }
+        }
     }
 
     sendResizeEventIfNeeded();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to