Changeset 223590 in webkit


Ignore:
Timestamp:
Oct 17, 2017 6:42:26 PM (7 years ago)
Author:
Alan Bujtas
Message:

[FrameView::layout cleanup] Remove redundant body->renderer()->setChildNeedsLayout() call
https://bugs.webkit.org/show_bug.cgi?id=178414
<rdar://problem/35040876>

Reviewed by Simon Fraser.

Since m_size always equals to layoutSize() at this point, we never call setChildNeedsLayout() on the body's renderer.
However a few lines below, when we adjust the frame size and check if oldSize != m_size, we actually
dirty the body's renderer.

Covered by existing tests.

  • page/FrameView.cpp:

(WebCore::FrameView::layout):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r223589 r223590  
     12017-10-17  Zalan Bujtas  <zalan@apple.com>
     2
     3        [FrameView::layout cleanup] Remove redundant body->renderer()->setChildNeedsLayout() call
     4        https://bugs.webkit.org/show_bug.cgi?id=178414
     5        <rdar://problem/35040876>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Since m_size always equals to layoutSize() at this point, we never call setChildNeedsLayout() on the body's renderer.
     10        However a few lines below, when we adjust the frame size and check if oldSize != m_size, we actually
     11        dirty the body's renderer.
     12
     13        Covered by existing tests.
     14
     15        * page/FrameView.cpp:
     16        (WebCore::FrameView::layout):
     17
    1182017-10-17  Myles C. Maxfield  <mmaxfield@apple.com>
    219
  • trunk/Source/WebCore/page/FrameView.cpp

    r223569 r223590  
    14341434            return;
    14351435        isSubtreeLayout = m_subtreeLayoutRoot;
     1436        m_needsFullRepaint = !isSubtreeLayout && (m_firstLayout || downcast<RenderView>(*layoutRoot).printing());
    14361437
    14371438        if (!isSubtreeLayout) {
    1438             auto* body = document.bodyOrFrameset();
    1439             if (body && body->renderer()) {
    1440                 if (is<HTMLFrameSetElement>(*body) && !frameFlatteningEnabled()) {
     1439            if (auto* body = document.bodyOrFrameset()) {
     1440                if (is<HTMLFrameSetElement>(*body) && !frameFlatteningEnabled() && body->renderer())
    14411441                    body->renderer()->setChildNeedsLayout();
    1442                 } else if (is<HTMLBodyElement>(*body)) {
    1443                     if (!m_firstLayout && m_size.height() != layoutHeight() && body->renderer()->enclosingBox().stretchesToViewport())
    1444                         body->renderer()->setChildNeedsLayout();
    1445                 }
    14461442            }
    1447 
    14481443#if !LOG_DISABLED
    14491444            if (m_firstLayout && !frame().ownerElement())
    14501445                LOG(Layout, "FrameView %p elapsed time before first layout: %.3fs\n", this, document.timeSinceDocumentCreation().value());
    14511446#endif
    1452         }
    1453 
    1454         m_needsFullRepaint = !isSubtreeLayout && (m_firstLayout || downcast<RenderView>(*layoutRoot).printing());
    1455 
    1456         if (!isSubtreeLayout) {
    14571447            ScrollbarMode hMode;
    14581448            ScrollbarMode vMode;   
Note: See TracChangeset for help on using the changeset viewer.