Changeset 295556 in webkit


Ignore:
Timestamp:
Jun 15, 2022 6:43:53 AM (2 years ago)
Author:
Alan Bujtas
Message:

REGRESSION (r289443): Page contents disappear after entering a letter in the username field of bmoharris.com
https://bugs.webkit.org/show_bug.cgi?id=241625
<rdar://93516876>

Reviewed by Simon Fraser.

overflow: clip forbids scrolling entirely, through any mechanism (https://drafts.csswg.org/css-overflow/#propdef-overflow)

  • LayoutTests/fast/scrolling/scrollIntoView-with-overflow-clip-expected.html: Added.
  • LayoutTests/fast/scrolling/scrollIntoView-with-overflow-clip.html: Added.
  • LayoutTests/fast/scrolling/selection-reveal-with-overflow-clip-expected.html: Added.
  • LayoutTests/fast/scrolling/selection-reveal-with-overflow-clip.html: Added.
  • Source/WebCore/rendering/RenderLayer.cpp:

(WebCore::RenderLayer::allowsCurrentScroll const): Make sure the content is not scrollable when overflow: clip is set on the renderer.

Canonical link: https://commits.webkit.org/251561@main

Location:
trunk
Files:
4 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r295532 r295556  
    25162516        return false;
    25172517
    2518     RenderBox* box = renderBox();
    2519     ASSERT(box); // Only boxes can have overflowClip set.
    2520 
    2521     if (renderer().frame().eventHandler().autoscrollInProgress()) {
     2518    // Only boxes can have overflowClip set.
     2519    auto& box = *renderBox();
     2520
     2521    if (box.frame().eventHandler().autoscrollInProgress()) {
    25222522        // The "programmatically" here is misleading; this asks whether the box has scrollable overflow,
    25232523        // or is a special case like a form control.
    2524         return box->canBeProgramaticallyScrolled();
    2525     }
    2526 
    2527     // Programmatic scrolls can scroll overflow:hidden.
    2528     return box->hasHorizontalOverflow() || box->hasVerticalOverflow();
     2524        return box.canBeProgramaticallyScrolled();
     2525    }
     2526
     2527    // Programmatic scrolls can scroll overflow: hidden but not overflow: clip.
     2528    return box.hasPotentiallyScrollableOverflow() && (box.hasHorizontalOverflow() || box.hasVerticalOverflow());
    25292529}
    25302530
Note: See TracChangeset for help on using the changeset viewer.