[Webkit-unassigned] [Bug 64479] RenderObject::containingBlock is a const method but it returns a non-const object

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun May 7 04:06:53 PDT 2023


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

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

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

--- Comment #1 from Ahmad Saleem <ahmad.saleem792 at gmail.com> ---
https://searchfox.org/wubkat/source/Source/WebCore/rendering/RenderObject.cpp#727

^ Anything else needed here?


RenderBlock* RenderObject::containingBlock() const
{
    if (is<RenderText>(*this))
        return containingBlockForPositionType(PositionType::Static, *this);

    auto containingBlockForRenderer = [](const auto& renderer) -> RenderBlock* {
        if (isInTopLayerOrBackdrop(renderer.style(), renderer.element()))
            return &renderer.view();
        return containingBlockForPositionType(renderer.style().position(), renderer);
    };

    if (!parent() && is<RenderScrollbarPart>(*this)) {
        if (auto* scrollbarPart = downcast<RenderScrollbarPart>(*this).rendererOwningScrollbar())
            return containingBlockForRenderer(*scrollbarPart);
        return nullptr;
    }
    return containingBlockForRenderer(downcast<RenderElement>(*this));
}

-- 
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/20230507/58e5b601/attachment-0001.htm>


More information about the webkit-unassigned mailing list