fast/images/text-recognition/mac/select-rotated-transparent-image-overlay.html is...
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Oct 2021 17:14:10 +0000 (17:14 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Oct 2021 17:14:10 +0000 (17:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=232008
rdar://84276269

Reviewed by Alan Bujtas.

Source/WebCore:

Other browsers and WPT tests imported/w3c/web-platform-tests/css/css-pseudo/highlight-painting-003.html
and imported/w3c/web-platform-tests/css/css-pseudo/highlight-painting-004.html agree with our new painting
behavior. Change the test instead of changing the behavior back.

Also fix the legacy line layout to have the same painting behavior.

* layout/integration/InlineIteratorLine.cpp:
(WebCore::InlineIterator::Line::blockDirectionPointInLine const):

Fix to use selectionTopForHitTesting as the point needs to be within the hittable line.

* rendering/LegacyRootInlineBox.cpp:
(WebCore::LegacyRootInlineBox::selectionTop const):

For consistency also make the legacy selection painting behavior match.

LayoutTests:

* fast/block/line-layout/selection-highlight-overlap.html:

Adopt to the updated legacy behavior.

* fast/images/text-recognition/mac/select-rotated-transparent-image-overlay.html:

Change the test so it isn't affected by the behavior change.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284542 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/block/line-layout/selection-highlight-overlap-expected.html
LayoutTests/fast/images/text-recognition/mac/select-rotated-transparent-image-overlay.html
Source/WebCore/ChangeLog
Source/WebCore/layout/integration/InlineIteratorLine.cpp
Source/WebCore/rendering/LegacyRootInlineBox.cpp

index 0bc20d19272de9cd30af09948236fd89a8c4db1a..bab0de5c3eca8ac26a188c64b73ee98884a5600e 100644 (file)
@@ -1,3 +1,19 @@
+2021-10-20  Antti Koivisto  <antti@apple.com>
+
+        fast/images/text-recognition/mac/select-rotated-transparent-image-overlay.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=232008
+        rdar://84276269
+
+        Reviewed by Alan Bujtas.
+
+        * fast/block/line-layout/selection-highlight-overlap.html:
+
+        Adopt to the updated legacy behavior.
+
+        * fast/images/text-recognition/mac/select-rotated-transparent-image-overlay.html:
+
+        Change the test so it isn't affected by the behavior change.
+
 2021-10-20  Ayumi Kojima  <ayumi_kojima@apple.com>
 
         Regression (r282211): [ macOS wk2 ] css3/filters/blur-various-radii.html is a flaky image failure.
 2021-10-20  Ayumi Kojima  <ayumi_kojima@apple.com>
 
         Regression (r282211): [ macOS wk2 ] css3/filters/blur-various-radii.html is a flaky image failure.
index b4eed8a55c4c1efdf7120385689713a89194fdae..ed34baff5a20c06bd6989f013abc2eec2ed2efa3 100644 (file)
@@ -3,8 +3,12 @@
     div { outline: 1px dashed green; }
     div > div { outline: initial; background-color: rgba(0, 0, 255, .4); }
 </style>
     div { outline: 1px dashed green; }
     div > div { outline: initial; background-color: rgba(0, 0, 255, .4); }
 </style>
+<div style="outline:none">
+    <div style="margin-top: -10px; height: 10px; margin-left: 128px"></div>
+</div>
 <div>
 <div>
-    <div style="height: 30px; margin-left: 128px;"></div>
+    <div style="height: 10px; background-color: transparent;"></div>
+    <div style="margin-top: -10px; height: 30px; margin-left: 128px;"></div>
 </div>
 <div>
     <div style="height: 17px; margin-left: 128px;"></div>
 </div>
 <div>
     <div style="height: 17px; margin-left: 128px;"></div>
index 7b677d202cfc1d8bde6baed16c17f912981912ef..2dca98b6e77fa5458a499371a4808c944d6ce6b5 100644 (file)
@@ -33,17 +33,17 @@ addEventListener("load", () => {
     let image = document.querySelector("img");
     internals.installImageOverlay(image, [
         {
     let image = document.querySelector("img");
     internals.installImageOverlay(image, [
         {
-            topLeft : new DOMPointReadOnly(0.5, 1.5),
-            topRight : new DOMPointReadOnly(1.5, 0.5),
-            bottomRight : new DOMPointReadOnly(2, 1),
-            bottomLeft : new DOMPointReadOnly(1, 2),
+            topLeft : new DOMPointReadOnly(0.55, 1.55),
+            topRight : new DOMPointReadOnly(1.55, 0.55),
+            bottomRight : new DOMPointReadOnly(2.05, 1.05),
+            bottomLeft : new DOMPointReadOnly(1.05, 2.05),
             children: [
                 {
                     text : "hello",
             children: [
                 {
                     text : "hello",
-                    topLeft : new DOMPointReadOnly(0.5, 1.5),
-                    topRight : new DOMPointReadOnly(1.5, 0.5),
-                    bottomRight : new DOMPointReadOnly(2, 1),
-                    bottomLeft : new DOMPointReadOnly(1, 2),
+                    topLeft : new DOMPointReadOnly(0.55, 1.55),
+                    topRight : new DOMPointReadOnly(1.55, 0.55),
+                    bottomRight : new DOMPointReadOnly(2.05, 1.05),
+                    bottomLeft : new DOMPointReadOnly(1.05, 2.05),
                 }
             ]
         }
                 }
             ]
         }
@@ -53,4 +53,4 @@ addEventListener("load", () => {
 });
 </script>
 </body>
 });
 </script>
 </body>
-</html>
\ No newline at end of file
+</html>
index 2ec236176890f6b668fe19ead6108ba9cf37932f..a90813dafb89d9a0cec618105f295ef0501667cc 100644 (file)
@@ -1,3 +1,27 @@
+2021-10-20  Antti Koivisto  <antti@apple.com>
+
+        fast/images/text-recognition/mac/select-rotated-transparent-image-overlay.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=232008
+        rdar://84276269
+
+        Reviewed by Alan Bujtas.
+
+        Other browsers and WPT tests imported/w3c/web-platform-tests/css/css-pseudo/highlight-painting-003.html
+        and imported/w3c/web-platform-tests/css/css-pseudo/highlight-painting-004.html agree with our new painting
+        behavior. Change the test instead of changing the behavior back.
+
+        Also fix the legacy line layout to have the same painting behavior.
+
+        * layout/integration/InlineIteratorLine.cpp:
+        (WebCore::InlineIterator::Line::blockDirectionPointInLine const):
+
+        Fix to use selectionTopForHitTesting as the point needs to be within the hittable line.
+
+        * rendering/LegacyRootInlineBox.cpp:
+        (WebCore::LegacyRootInlineBox::selectionTop const):
+
+        For consistency also make the legacy selection painting behavior match.
+
 2021-10-20  Antti Koivisto  <antti@apple.com>
 
         Don't re-evaluate viewport dependent media queries if the viewport doesn't change
 2021-10-20  Antti Koivisto  <antti@apple.com>
 
         Don't re-evaluate viewport dependent media queries if the viewport doesn't change
index 8fc6454f36120bcefbf13859338f6a9b34a6a7b0..02b9b7ab1fcdbb77a7c21290c9587d7dae0a836c 100644 (file)
@@ -159,7 +159,7 @@ LeafBoxIterator Line::closestRunForLogicalLeftPosition(int leftPosition, bool ed
 
 int Line::blockDirectionPointInLine() const
 {
 
 int Line::blockDirectionPointInLine() const
 {
-    return !containingBlock().style().isFlippedBlocksWritingMode() ? std::max(top(), selectionTop()) : std::min(bottom(), selectionBottom());
+    return !containingBlock().style().isFlippedBlocksWritingMode() ? std::max(top(), selectionTopForHitTesting()) : std::min(bottom(), selectionBottom());
 }
 
 LayoutUnit Line::selectionTopAdjustedForPrecedingBlock() const
 }
 
 LayoutUnit Line::selectionTopAdjustedForPrecedingBlock() const
index 709819304eae466bb9aff6f85ef55e3f28d8c1c3..edd2987d23d04578a22d38d4a576975ae6a16be1 100644 (file)
@@ -513,10 +513,8 @@ LayoutUnit LegacyRootInlineBox::selectionTop(ForHitTesting forHitTesting) const
     LayoutUnit prevBottom;
     if (auto* previousBox = prevRootBox())
         prevBottom = previousBox->selectionBottom();
     LayoutUnit prevBottom;
     if (auto* previousBox = prevRootBox())
         prevBottom = previousBox->selectionBottom();
-    else {
-        auto borderAndPaddingBefore = blockFlow().borderAndPaddingBefore();
-        prevBottom = forHitTesting == ForHitTesting::Yes ? borderAndPaddingBefore : std::max(borderAndPaddingBefore, selectionTop);
-    }
+    else
+        prevBottom = forHitTesting == ForHitTesting::Yes ? blockFlow().borderAndPaddingBefore() : selectionTop;
 
     if (prevBottom < selectionTop && blockFlow().containsFloats()) {
         // This line has actually been moved further down, probably from a large line-height, but possibly because the
 
     if (prevBottom < selectionTop && blockFlow().containsFloats()) {
         // This line has actually been moved further down, probably from a large line-height, but possibly because the