Changeset 273219 in webkit


Ignore:
Timestamp:
Feb 21, 2021 9:20:47 AM (3 years ago)
Author:
commit-queue@webkit.org
Message:

Small improvements to r273073
https://bugs.webkit.org/show_bug.cgi?id=222179

Patch by Martin Robinson <mrobinson@igalia.com> on 2021-02-21
Reviewed by Darin Adler.

No new tests, because this should not change behavior.

  • rendering/RenderObject.cpp:

(WebCore::RenderObject::enclosingScrollableContainerForSnapping const): Replace
a while loop with a for loop and prefer downcast<> to static_cast<>.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r273214 r273219  
     12021-02-21  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Small improvements to r273073
     4        https://bugs.webkit.org/show_bug.cgi?id=222179
     5
     6        Reviewed by Darin Adler.
     7
     8        No new tests, because this should not change behavior.
     9
     10        * rendering/RenderObject.cpp:
     11        (WebCore::RenderObject::enclosingScrollableContainerForSnapping const): Replace
     12        a while loop with a for loop and prefer downcast<> to static_cast<>.
     13
    1142021-02-20  Chris Fleizach  <cfleizach@apple.com>
    215
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r273073 r273219  
    460460    // the containing block chain for positioned elements. This is important because
    461461    // scrollable overflow does not establish a new containing block for children.
    462     auto* candidate = container();
    463     while (candidate) {
     462    for (auto* candidate = container(); candidate; candidate = candidate->container()) {
    464463        // Currently the RenderView can look like it has scrollable overflow, but we never
    465464        // want to return this as our container. Instead we should use the root element.
     
    467466            break;
    468467        if (candidate->hasOverflowClip())
    469             return static_cast<RenderBox*>(candidate);
    470         candidate = candidate->container();
     468            return downcast<RenderBox>(candidate);
    471469    }
    472470
Note: See TracChangeset for help on using the changeset viewer.