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
+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.
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 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>
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",
- 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),
}
]
}
});
</script>
</body>
-</html>
\ No newline at end of file
+</html>
+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
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 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