Changeset 143990 in webkit


Ignore:
Timestamp:
Feb 25, 2013, 5:22:33 PM (13 years ago)
Author:
Simon Fraser
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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r143986 r143990  
     12013-02-25  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Lots of unnecessary DidLayout notifications when scrolling zoomed page with iframes
     4        https://bugs.webkit.org/show_bug.cgi?id=110824
     5
     6        Reviewed by Tim Horton.
     7       
     8        RenderWidget::setWidgetGeometry() compares the old and new frame rects to decide
     9        if the geometry changed. However, it use implicit IntRect->LayoutRect promotion in
     10        the comparison, and then roundedIntRect() in setting. Thus the code would think
     11        that the geometry changed, even when the final assigned frame did not.
     12       
     13        Fix by computing the new frame using roundedIntRect(), and using that to determine
     14        whether the geometry changed.
     15
     16        No way to test DidLayout notifications in DRT/WTR.
     17
     18        * rendering/RenderWidget.cpp:
     19        (WebCore::RenderWidget::setWidgetGeometry):
     20
    1212013-02-21  Jeffrey Pfau  <jpfau@apple.com>
    222
  • trunk/Source/WebCore/rendering/RenderWidget.cpp

    r142788 r143990  
    144144
    145145    IntRect clipRect = roundedIntRect(enclosingLayer()->childrenClipRect());
     146    IntRect newFrame = roundedIntRect(frame);
    146147    bool clipChanged = m_clipRect != clipRect;
    147     bool boundsChanged = m_widget->frameRect() != frame;
     148    bool boundsChanged = m_widget->frameRect() != newFrame;
    148149
    149150    if (!boundsChanged && !clipChanged)
     
    154155    RenderWidgetProtector protector(this);
    155156    RefPtr<Node> protectedNode(node());
    156     m_widget->setFrameRect(roundedIntRect(frame));
     157    m_widget->setFrameRect(newFrame);
    157158   
    158159#if USE(ACCELERATED_COMPOSITING)
Note: See TracChangeset for help on using the changeset viewer.