Title: [143990] trunk/Source/WebCore
Revision
143990
Author
simon.fra...@apple.com
Date
2013-02-25 17:22:33 -0800 (Mon, 25 Feb 2013)

Log Message

Lots of unnecessary DidLayout notifications when scrolling zoomed page with iframes
https://bugs.webkit.org/show_bug.cgi?id=110824

Reviewed by Tim Horton.

RenderWidget::setWidgetGeometry() compares the old and new frame rects to decide
if the geometry changed. However, it use implicit IntRect->LayoutRect promotion in
the comparison, and then roundedIntRect() in setting. Thus the code would think
that the geometry changed, even when the final assigned frame did not.

Fix by computing the new frame using roundedIntRect(), and using that to determine
whether the geometry changed.

No way to test DidLayout notifications in DRT/WTR.

* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::setWidgetGeometry):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (143989 => 143990)


--- trunk/Source/WebCore/ChangeLog	2013-02-26 01:13:40 UTC (rev 143989)
+++ trunk/Source/WebCore/ChangeLog	2013-02-26 01:22:33 UTC (rev 143990)
@@ -1,3 +1,23 @@
+2013-02-25  Simon Fraser  <simon.fra...@apple.com>
+
+        Lots of unnecessary DidLayout notifications when scrolling zoomed page with iframes
+        https://bugs.webkit.org/show_bug.cgi?id=110824
+
+        Reviewed by Tim Horton.
+        
+        RenderWidget::setWidgetGeometry() compares the old and new frame rects to decide
+        if the geometry changed. However, it use implicit IntRect->LayoutRect promotion in
+        the comparison, and then roundedIntRect() in setting. Thus the code would think
+        that the geometry changed, even when the final assigned frame did not.
+        
+        Fix by computing the new frame using roundedIntRect(), and using that to determine
+        whether the geometry changed.
+
+        No way to test DidLayout notifications in DRT/WTR.
+
+        * rendering/RenderWidget.cpp:
+        (WebCore::RenderWidget::setWidgetGeometry):
+
 2013-02-21  Jeffrey Pfau  <jp...@apple.com>
 
         Optionally partition cache to prevent using cache for tracking

Modified: trunk/Source/WebCore/rendering/RenderWidget.cpp (143989 => 143990)


--- trunk/Source/WebCore/rendering/RenderWidget.cpp	2013-02-26 01:13:40 UTC (rev 143989)
+++ trunk/Source/WebCore/rendering/RenderWidget.cpp	2013-02-26 01:22:33 UTC (rev 143990)
@@ -143,8 +143,9 @@
         return false;
 
     IntRect clipRect = roundedIntRect(enclosingLayer()->childrenClipRect());
+    IntRect newFrame = roundedIntRect(frame);
     bool clipChanged = m_clipRect != clipRect;
-    bool boundsChanged = m_widget->frameRect() != frame;
+    bool boundsChanged = m_widget->frameRect() != newFrame;
 
     if (!boundsChanged && !clipChanged)
         return false;
@@ -153,7 +154,7 @@
 
     RenderWidgetProtector protector(this);
     RefPtr<Node> protectedNode(node());
-    m_widget->setFrameRect(roundedIntRect(frame));
+    m_widget->setFrameRect(newFrame);
     
 #if USE(ACCELERATED_COMPOSITING)
     if (hasLayer() && layer()->isComposited())
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to