[Webkit-unassigned] [Bug 21402] Add a clip in RenderView::layout to avoid doing offscreen paint

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 8 10:26:31 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=21402

Ahmad Saleem <ahmad.saleem792 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ahmad.saleem792 at gmail.com,
                   |                            |koivisto at iki.fi,
                   |                            |simon.fraser at apple.com,
                   |                            |zalan at apple.com

--- Comment #4 from Ahmad Saleem <ahmad.saleem792 at gmail.com> ---
I checked and we don't have FIXME in Webkit Source, which this patch was trying to modify and also this is current source:

https://searchfox.org/wubkat/source/Source/WebCore/rendering/RenderView.cpp#183


void RenderView::layout()
{
    StackStats::LayoutCheckPoint layoutCheckPoint;
    if (!document().paginated())
        m_pageLogicalSize = { };

    if (shouldUsePrintingLayout()) {
        if (!m_pageLogicalSize)
            m_pageLogicalSize = LayoutSize(logicalWidth(), 0_lu);
        m_minPreferredLogicalWidth = m_pageLogicalSize->width();
        m_maxPreferredLogicalWidth = m_minPreferredLogicalWidth;
    }

    // Use calcWidth/Height to get the new width/height, since this will take the full page zoom factor into account.
    bool relayoutChildren = !shouldUsePrintingLayout() && (width() != viewWidth() || height() != viewHeight());
    if (relayoutChildren) {
        setChildNeedsLayout(MarkOnlyThis);

        for (auto& box : childrenOfType<RenderBox>(*this)) {
            if (box.hasRelativeLogicalHeight()
                || box.style().logicalHeight().isPercentOrCalculated()
                || box.style().logicalMinHeight().isPercentOrCalculated()
                || box.style().logicalMaxHeight().isPercentOrCalculated()
                || box.isSVGRootOrLegacySVGRoot()
                )
                box.setChildNeedsLayout(MarkOnlyThis);
        }
    }

    ASSERT(!frameView().layoutContext().layoutState());
    if (!needsLayout())
        return;

    ensureLayoutState().setViewportSize(frameView().size());

    LayoutStateMaintainer statePusher(*this, { }, false, valueOrDefault(m_pageLogicalSize).height(), m_pageLogicalHeightChanged);

    m_pageLogicalHeightChanged = false;

    RenderBlockFlow::layout();

#ifndef NDEBUG
    frameView().layoutContext().checkLayoutState();
#endif
    clearNeedsLayout();
}

________

Do we need anything else? Or we can close now?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230508/52633999/attachment.htm>


More information about the webkit-unassigned mailing list