Modified: trunk/LayoutTests/imported/w3c/ChangeLog (290769 => 290770)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2022-03-03 07:08:00 UTC (rev 290769)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2022-03-03 07:31:13 UTC (rev 290770)
@@ -1,3 +1,12 @@
+2022-03-02 Rob Buis <[email protected]>
+
+ Treat empty intersection correctly in RenderLayer::getRectToExpose
+ https://bugs.webkit.org/show_bug.cgi?id=237189
+
+ Reviewed by Simon Fraser.
+
+ * web-platform-tests/css/css-contain/content-visibility/content-visibility-050-expected.txt:
+
2022-03-02 Sihui Liu <[email protected]>
Throw proper exception on failed removeEntry() calls
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-050-expected.txt (290769 => 290770)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-050-expected.txt 2022-03-03 07:08:00 UTC (rev 290769)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-050-expected.txt 2022-03-03 07:31:13 UTC (rev 290770)
@@ -1,3 +1,3 @@
-FAIL Using tabindex to focus an newly constructed element in an auto subtree focuses element assert_greater_than: expected a number greater than 500 but got 0
+PASS Using tabindex to focus an newly constructed element in an auto subtree focuses element
Modified: trunk/Source/WebCore/ChangeLog (290769 => 290770)
--- trunk/Source/WebCore/ChangeLog 2022-03-03 07:08:00 UTC (rev 290769)
+++ trunk/Source/WebCore/ChangeLog 2022-03-03 07:31:13 UTC (rev 290770)
@@ -1,3 +1,18 @@
+2022-03-02 Rob Buis <[email protected]>
+
+ Treat empty intersection correctly in RenderLayer::getRectToExpose
+ https://bugs.webkit.org/show_bug.cgi?id=237189
+
+ Reviewed by Simon Fraser.
+
+ The case where the target rect to reveal had zero height and was outside of the visible rect, the
+ classification was wrongly that the target was visible, fix this to classify as hidden instead.
+
+ Test: imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-050.html
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::getRectToExpose const):
+
2022-03-02 Andres Gonzalez <[email protected]>
ITM: Checkbox state change is not updated in isolated tree
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (290769 => 290770)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2022-03-03 07:08:00 UTC (rev 290769)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2022-03-03 07:31:13 UTC (rev 290770)
@@ -2666,24 +2666,26 @@
}
// Determine the appropriate X behavior.
- ScrollAlignment::Behavior scrollX;
+ ScrollAlignment::Behavior scrollX = alignX.getHiddenBehavior();
LayoutRect exposeRectX(exposeRect.x(), visibleRect.y(), exposeRect.width(), visibleRect.height());
- LayoutUnit intersectWidth = intersection(visibleRect, exposeRectX).width();
- if (intersectWidth == exposeRect.width() || (alignX.legacyHorizontalVisibilityThresholdEnabled() && intersectWidth >= MIN_INTERSECT_FOR_REVEAL)) {
- // If the rectangle is fully visible, use the specified visible behavior.
- // If the rectangle is partially visible, but over a certain threshold,
- // then treat it as fully visible to avoid unnecessary horizontal scrolling
- scrollX = alignX.getVisibleBehavior();
- } else if (intersectWidth == visibleRect.width()) {
- // If the rect is bigger than the visible area, don't bother trying to center. Other alignments will work.
- scrollX = alignX.getVisibleBehavior();
- if (scrollX == ScrollAlignment::Behavior::AlignCenter)
- scrollX = ScrollAlignment::Behavior::NoScroll;
- } else if (intersectWidth > 0)
- // If the rectangle is partially visible, but not above the minimum threshold, use the specified partial behavior
- scrollX = alignX.getPartialBehavior();
- else
- scrollX = alignX.getHiddenBehavior();
+ LayoutRect intersectRect = intersection(visibleRect, exposeRectX);
+ if (!intersectRect.isEmpty()) {
+ LayoutUnit intersectWidth = intersectRect.width();
+ if (intersectWidth == exposeRect.width() || (alignX.legacyHorizontalVisibilityThresholdEnabled() && intersectWidth >= MIN_INTERSECT_FOR_REVEAL)) {
+ // If the rectangle is fully visible, use the specified visible behavior.
+ // If the rectangle is partially visible, but over a certain threshold,
+ // then treat it as fully visible to avoid unnecessary horizontal scrolling
+ scrollX = alignX.getVisibleBehavior();
+ } else if (intersectWidth == visibleRect.width()) {
+ // If the rect is bigger than the visible area, don't bother trying to center. Other alignments will work.
+ scrollX = alignX.getVisibleBehavior();
+ if (scrollX == ScrollAlignment::Behavior::AlignCenter)
+ scrollX = ScrollAlignment::Behavior::NoScroll;
+ } else if (intersectWidth > 0) {
+ // If the rectangle is partially visible, but not above the minimum threshold, use the specified partial behavior
+ scrollX = alignX.getPartialBehavior();
+ }
+ }
// If we're trying to align to the closest edge, and the exposeRect is further right
// than the visibleRect, and not bigger than the visible area, then align with the right.
if (scrollX == ScrollAlignment::Behavior::AlignToClosestEdge && exposeRect.maxX() > visibleRect.maxX() && exposeRect.width() < visibleRect.width())
@@ -2701,22 +2703,24 @@
x = exposeRect.x();
// Determine the appropriate Y behavior.
- ScrollAlignment::Behavior scrollY;
+ ScrollAlignment::Behavior scrollY = alignY.getHiddenBehavior();
LayoutRect exposeRectY(visibleRect.x(), exposeRect.y(), visibleRect.width(), exposeRect.height());
- LayoutUnit intersectHeight = intersection(visibleRect, exposeRectY).height();
- if (intersectHeight == exposeRect.height())
- // If the rectangle is fully visible, use the specified visible behavior.
- scrollY = alignY.getVisibleBehavior();
- else if (intersectHeight == visibleRect.height()) {
- // If the rect is bigger than the visible area, don't bother trying to center. Other alignments will work.
- scrollY = alignY.getVisibleBehavior();
- if (scrollY == ScrollAlignment::Behavior::AlignCenter)
- scrollY = ScrollAlignment::Behavior::NoScroll;
- } else if (intersectHeight > 0)
- // If the rectangle is partially visible, use the specified partial behavior
- scrollY = alignY.getPartialBehavior();
- else
- scrollY = alignY.getHiddenBehavior();
+ intersectRect = intersection(visibleRect, exposeRectY);
+ if (!intersectRect.isEmpty()) {
+ LayoutUnit intersectHeight = intersectRect.height();
+ if (intersectHeight == exposeRect.height()) {
+ // If the rectangle is fully visible, use the specified visible behavior.
+ scrollY = alignY.getVisibleBehavior();
+ } else if (intersectHeight == visibleRect.height()) {
+ // If the rect is bigger than the visible area, don't bother trying to center. Other alignments will work.
+ scrollY = alignY.getVisibleBehavior();
+ if (scrollY == ScrollAlignment::Behavior::AlignCenter)
+ scrollY = ScrollAlignment::Behavior::NoScroll;
+ } else if (intersectHeight > 0) {
+ // If the rectangle is partially visible, use the specified partial behavior
+ scrollY = alignY.getPartialBehavior();
+ }
+ }
// If we're trying to align to the closest edge, and the exposeRect is further down
// than the visibleRect, and not bigger than the visible area, then align with the bottom.
if (scrollY == ScrollAlignment::Behavior::AlignToClosestEdge && exposeRect.maxY() > visibleRect.maxY() && exposeRect.height() < visibleRect.height())