Changeset 271090 in webkit
- Timestamp:
- Dec 26, 2020 10:28:39 AM (19 months ago)
- Location:
- trunk
- Files:
-
- 4 added
- 6 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/scrolling/mac/overflow-hidden-on-one-axis-async-overflow-expected.txt (added)
-
LayoutTests/fast/scrolling/mac/overflow-hidden-on-one-axis-async-overflow.html (added)
-
LayoutTests/fast/scrolling/mac/overflow-hidden-on-one-axis-expected.txt (added)
-
LayoutTests/fast/scrolling/mac/overflow-hidden-on-one-axis.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/mac/EventHandlerMac.mm (modified) (1 diff)
-
Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp (modified) (1 diff)
-
Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm (modified) (2 diffs)
-
Source/WebCore/platform/ScrollableArea.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r271077 r271090 1 2020-12-26 Simon Fraser <simon.fraser@apple.com> 2 3 Fix scrolling issues when scrolling on only one axis is enabled 4 https://bugs.webkit.org/show_bug.cgi?id=220134 5 6 Reviewed by Sam Weinig. 7 8 * fast/scrolling/mac/overflow-hidden-on-one-axis-async-overflow-expected.txt: Added. 9 * fast/scrolling/mac/overflow-hidden-on-one-axis-async-overflow.html: Added. 10 * fast/scrolling/mac/overflow-hidden-on-one-axis-expected.txt: Added. 11 * fast/scrolling/mac/overflow-hidden-on-one-axis.html: Added. 12 1 13 2020-12-23 Ryan Haddad <ryanhaddad@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r271089 r271090 1 2020-12-26 Simon Fraser <simon.fraser@apple.com> 2 3 Fix scrolling issues when scrolling on only one axis is enabled 4 https://bugs.webkit.org/show_bug.cgi?id=220134 5 6 Reviewed by Sam Weinig. 7 8 If an overflow:scroll has overflow on an axis, but overflow:hidden on that 9 axis, then there are various issues with finding the correct scroller and 10 latching. 11 12 This affects nested scrollers where inner and outer and scrollable on different 13 axes, and the inner scroller has overflow, but overflow:hidden on the cross axis. 14 15 The fix involves adding checks for scrolling being allowed in code that fetches 16 pinned state, and code that looks for scrollable areas for a given event delta. 17 18 Tests: fast/scrolling/mac/overflow-hidden-on-one-axis-async-overflow.html 19 fast/scrolling/mac/overflow-hidden-on-one-axis.html 20 21 * page/mac/EventHandlerMac.mm: 22 (WebCore::findEnclosingScrollableContainer): 23 * page/scrolling/ScrollingTreeScrollingNode.cpp: 24 (WebCore::ScrollingTreeScrollingNode::edgePinnedState const): 25 * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: 26 (WebCore::ScrollingTreeScrollingNodeDelegateMac::isPinnedForScrollDeltaOnAxis const): 27 * platform/ScrollableArea.cpp: 28 (WebCore::ScrollableArea::isPinnedForScrollDeltaOnAxis const): 29 (WebCore::ScrollableArea::isPinnedForScrollDelta const): Check for non-zero deltas. 30 isPinnedForScrollDeltaOnAxis() returns false if a delta is zero, so we don't want to say 31 we're not pinned if a delta is zero. The logic of this code really needs to be inverted 32 to talk about scrollability, not pinning. 33 (WebCore::ScrollableArea::edgePinnedState const): 34 1 35 2020-12-26 Sam Weinig <weinig@apple.com> 2 36 -
trunk/Source/WebCore/page/mac/EventHandlerMac.mm
r270425 r271090 820 820 return candidate; 821 821 822 if ((biasedDelta.height() > 0 && !scrollableArea->scrolledToTop()) || (biasedDelta.height() < 0 && !scrollableArea->scrolledToBottom()) 823 || (biasedDelta.width() > 0 && !scrollableArea->scrolledToLeft()) || (biasedDelta.width() < 0 && !scrollableArea->scrolledToRight())) 822 if (biasedDelta.height() && !scrollableArea->isPinnedForScrollDeltaOnAxis(-biasedDelta.height(), ScrollEventAxis::Vertical)) 823 return candidate; 824 825 if (biasedDelta.width() && !scrollableArea->isPinnedForScrollDeltaOnAxis(-biasedDelta.width(), ScrollEventAxis::Horizontal)) 824 826 return candidate; 825 827 } -
trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp
r271070 r271090 199 199 auto maxScrollPosition = maximumScrollPosition(); 200 200 201 bool horizontallyUnscrollable = !allowsHorizontalScrolling(); 202 bool verticallyUnscrollable = !allowsVerticalScrolling(); 203 201 204 // Top, right, bottom, left. 202 205 return { 203 scrollPosition.y() <= minScrollPosition.y(),204 scrollPosition.x() >= maxScrollPosition.x(),205 scrollPosition.y() >= maxScrollPosition.y(),206 scrollPosition.x() <= minScrollPosition.x()206 verticallyUnscrollable || scrollPosition.y() <= minScrollPosition.y(), 207 horizontallyUnscrollable || scrollPosition.x() >= maxScrollPosition.x(), 208 verticallyUnscrollable || scrollPosition.y() >= maxScrollPosition.y(), 209 horizontallyUnscrollable || scrollPosition.x() <= minScrollPosition.x() 207 210 }; 208 211 } -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm
r271081 r271090 221 221 switch (axis) { 222 222 case ScrollEventAxis::Vertical: 223 if (!allowsVerticalScrolling()) 224 return true; 225 223 226 if (scrollDelta < 0) { 224 227 auto topOffset = scrollPosition.y() - minimumScrollPosition().y(); … … 232 235 break; 233 236 case ScrollEventAxis::Horizontal: 237 if (!allowsHorizontalScrolling()) 238 return true; 239 234 240 if (scrollDelta < 0) { 235 241 auto leftOffset = scrollPosition.x() - minimumScrollPosition().x(); -
trunk/Source/WebCore/platform/ScrollableArea.cpp
r271081 r271090 635 635 switch (axis) { 636 636 case ScrollEventAxis::Vertical: 637 if (!allowsVerticalScrolling()) 638 return true; 639 637 640 if (scrollDelta < 0) // top 638 641 return scrollPosition.y() <= minimumScrollPosition().y(); … … 643 646 break; 644 647 case ScrollEventAxis::Horizontal: 648 if (!allowsHorizontalScrolling()) 649 return true; 650 645 651 if (scrollDelta < 0) // left 646 652 return scrollPosition.x() <= minimumScrollPosition().x(); … … 657 663 bool ScrollableArea::isPinnedForScrollDelta(const FloatSize& scrollDelta) const 658 664 { 659 return isPinnedForScrollDeltaOnAxis(scrollDelta.width(), ScrollEventAxis::Horizontal) && isPinnedForScrollDeltaOnAxis(scrollDelta.height(), ScrollEventAxis::Vertical); 665 return (!scrollDelta.width() || isPinnedForScrollDeltaOnAxis(scrollDelta.width(), ScrollEventAxis::Horizontal)) 666 && (!scrollDelta.height() || isPinnedForScrollDeltaOnAxis(scrollDelta.height(), ScrollEventAxis::Vertical)); 660 667 } 661 668 … … 666 673 auto maxScrollPosition = maximumScrollPosition(); 667 674 675 bool horizontallyUnscrollable = !allowsHorizontalScrolling(); 676 bool verticallyUnscrollable = !allowsVerticalScrolling(); 677 668 678 // Top, right, bottom, left. 669 679 return { 670 scrollPosition.y() <= minScrollPosition.y(),671 scrollPosition.x() >= maxScrollPosition.x(),672 scrollPosition.y() >= maxScrollPosition.y(),673 scrollPosition.x() <= minScrollPosition.x()680 verticallyUnscrollable || scrollPosition.y() <= minScrollPosition.y(), 681 horizontallyUnscrollable || scrollPosition.x() >= maxScrollPosition.x(), 682 verticallyUnscrollable || scrollPosition.y() >= maxScrollPosition.y(), 683 horizontallyUnscrollable || scrollPosition.x() <= minScrollPosition.x() 674 684 }; 675 685 }
Note: See TracChangeset
for help on using the changeset viewer.