Title: [289267] branches/safari-613-branch
- Revision
- 289267
- Author
- [email protected]
- Date
- 2022-02-07 18:52:48 -0800 (Mon, 07 Feb 2022)
Log Message
Cherry-pick r287981. rdar://problem/84069534
REGRESSION (r278561): Right clicking a link selects the full line with unrelated text
https://bugs.webkit.org/show_bug.cgi?id=235172
<rdar://84069534>
Reviewed by Dean Jackson.
Source/WebCore:
r278561 slightly change highlightStateForTextBox's behavior which now (correctly) returns HighlightState::None when the
RenderText content is not part of the current selection. Prior to r278561, it returned the RenderText's original selection state
which in this case was HighlightState::End.
<div><span>A<br>B<span style="position: absolute"></span></span>C</div>
In this specific case when we select the outer <span>, we end up with the following selection states for the generated line boxes:
(B) -> "Inside"
(C) -> "None"
while previously (C) came back as "End" (note that the absolute positioned element does not generate line boxes).
Now as Line::selectionState traverses through the line boxes, it comes across an unexpected "Inside -> None" transition at the selection end boundary (B -> C)
which incorrectly leaves the line state in "Inside" and we paint the selection all the way to the end of the block.
Test: fast/editing/selection-with-absolute-positioned-empty-content.html
* layout/integration/InlineIteratorLine.cpp:
(WebCore::InlineIterator::Line::selectionState const):
LayoutTests:
* fast/editing/selection-with-absolute-positioned-empty-content-expected.txt: Added.
* fast/editing/selection-with-absolute-positioned-empty-content.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Added Paths
Diff
Modified: branches/safari-613-branch/LayoutTests/ChangeLog (289266 => 289267)
--- branches/safari-613-branch/LayoutTests/ChangeLog 2022-02-08 02:52:44 UTC (rev 289266)
+++ branches/safari-613-branch/LayoutTests/ChangeLog 2022-02-08 02:52:48 UTC (rev 289267)
@@ -1,5 +1,55 @@
2022-02-07 Russell Epstein <[email protected]>
+ Cherry-pick r287981. rdar://problem/84069534
+
+ REGRESSION (r278561): Right clicking a link selects the full line with unrelated text
+ https://bugs.webkit.org/show_bug.cgi?id=235172
+ <rdar://84069534>
+
+ Reviewed by Dean Jackson.
+
+ Source/WebCore:
+
+ r278561 slightly change highlightStateForTextBox's behavior which now (correctly) returns HighlightState::None when the
+ RenderText content is not part of the current selection. Prior to r278561, it returned the RenderText's original selection state
+ which in this case was HighlightState::End.
+
+ <div><span>A<br>B<span style="position: absolute"></span></span>C</div>
+
+ In this specific case when we select the outer <span>, we end up with the following selection states for the generated line boxes:
+ (B) -> "Inside"
+ (C) -> "None"
+ while previously (C) came back as "End" (note that the absolute positioned element does not generate line boxes).
+
+ Now as Line::selectionState traverses through the line boxes, it comes across an unexpected "Inside -> None" transition at the selection end boundary (B -> C)
+ which incorrectly leaves the line state in "Inside" and we paint the selection all the way to the end of the block.
+
+ Test: fast/editing/selection-with-absolute-positioned-empty-content.html
+
+ * layout/integration/InlineIteratorLine.cpp:
+ (WebCore::InlineIterator::Line::selectionState const):
+
+ LayoutTests:
+
+ * fast/editing/selection-with-absolute-positioned-empty-content-expected.txt: Added.
+ * fast/editing/selection-with-absolute-positioned-empty-content.html: Added.
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2022-01-13 Alan Bujtas <[email protected]>
+
+ REGRESSION (r278561): Right clicking a link selects the full line with unrelated text
+ https://bugs.webkit.org/show_bug.cgi?id=235172
+ <rdar://84069534>
+
+ Reviewed by Dean Jackson.
+
+ * fast/editing/selection-with-absolute-positioned-empty-content-expected.txt: Added.
+ * fast/editing/selection-with-absolute-positioned-empty-content.html: Added.
+
+2022-02-07 Russell Epstein <[email protected]>
+
Cherry-pick r287970. rdar://problem/87423294
PCM: Same-site triggering events should support ephemeral measurement
Added: branches/safari-613-branch/LayoutTests/editing/selection-with-absolute-positioned-empty-content-expected.txt (0 => 289267)
--- branches/safari-613-branch/LayoutTests/editing/selection-with-absolute-positioned-empty-content-expected.txt (rev 0)
+++ branches/safari-613-branch/LayoutTests/editing/selection-with-absolute-positioned-empty-content-expected.txt 2022-02-08 02:52:48 UTC (rev 289267)
@@ -0,0 +1,6 @@
+select this text but not this
+(repaint rects
+ (rect 8 8 220 40)
+ (rect 228 8 564 20)
+)
+
Added: branches/safari-613-branch/LayoutTests/editing/selection-with-absolute-positioned-empty-content.html (0 => 289267)
--- branches/safari-613-branch/LayoutTests/editing/selection-with-absolute-positioned-empty-content.html (rev 0)
+++ branches/safari-613-branch/LayoutTests/editing/selection-with-absolute-positioned-empty-content.html 2022-02-08 02:52:48 UTC (rev 289267)
@@ -0,0 +1,26 @@
+<style>
+div {
+ font-family: Ahem;
+ font-size: 20px;
+ width: 220px;
+}
+
+span {
+ position: absolute;
+}
+</style>
+<div><a id=foobar style="color: black" href="" this text<span></span></a> but not this</div>
+<pre id=result></pre>
+<script>
+if (window.internals)
+ internals.startTrackingRepaints();
+if (window.testRunner)
+ testRunner.dumpAsText();
+
+window.getSelection().selectAllChildren(foobar);
+
+if (window.internals) {
+ result.innerText = internals.repaintRectsAsText();
+ internals.stopTrackingRepaints();
+}
+</script>
\ No newline at end of file
Modified: branches/safari-613-branch/LayoutTests/platform/ios/TestExpectations (289266 => 289267)
--- branches/safari-613-branch/LayoutTests/platform/ios/TestExpectations 2022-02-08 02:52:44 UTC (rev 289266)
+++ branches/safari-613-branch/LayoutTests/platform/ios/TestExpectations 2022-02-08 02:52:48 UTC (rev 289267)
@@ -421,6 +421,7 @@
editing/selection/selecting-content-by-overshooting-the-flex-container.html [ Skip ]
editing/selection/selecting-content-by-overshooting-the-deprecated-flex-container.html [ Skip ]
editing/selection/selecting-content-by-overshooting-the-grid-container.html [ Skip ]
+editing/selection-with-absolute-positioned-empty-content.html [ Skip ]
editing/spelling/context-menu-suggestions-multiword-selection.html [ Skip ]
editing/spelling/context-menu-suggestions-subword-selection.html [ Skip ]
editing/spelling/context-menu-suggestions.html [ Skip ]
Modified: branches/safari-613-branch/Source/WebCore/ChangeLog (289266 => 289267)
--- branches/safari-613-branch/Source/WebCore/ChangeLog 2022-02-08 02:52:44 UTC (rev 289266)
+++ branches/safari-613-branch/Source/WebCore/ChangeLog 2022-02-08 02:52:48 UTC (rev 289267)
@@ -1,5 +1,71 @@
2022-02-07 Russell Epstein <[email protected]>
+ Cherry-pick r287981. rdar://problem/84069534
+
+ REGRESSION (r278561): Right clicking a link selects the full line with unrelated text
+ https://bugs.webkit.org/show_bug.cgi?id=235172
+ <rdar://84069534>
+
+ Reviewed by Dean Jackson.
+
+ Source/WebCore:
+
+ r278561 slightly change highlightStateForTextBox's behavior which now (correctly) returns HighlightState::None when the
+ RenderText content is not part of the current selection. Prior to r278561, it returned the RenderText's original selection state
+ which in this case was HighlightState::End.
+
+ <div><span>A<br>B<span style="position: absolute"></span></span>C</div>
+
+ In this specific case when we select the outer <span>, we end up with the following selection states for the generated line boxes:
+ (B) -> "Inside"
+ (C) -> "None"
+ while previously (C) came back as "End" (note that the absolute positioned element does not generate line boxes).
+
+ Now as Line::selectionState traverses through the line boxes, it comes across an unexpected "Inside -> None" transition at the selection end boundary (B -> C)
+ which incorrectly leaves the line state in "Inside" and we paint the selection all the way to the end of the block.
+
+ Test: fast/editing/selection-with-absolute-positioned-empty-content.html
+
+ * layout/integration/InlineIteratorLine.cpp:
+ (WebCore::InlineIterator::Line::selectionState const):
+
+ LayoutTests:
+
+ * fast/editing/selection-with-absolute-positioned-empty-content-expected.txt: Added.
+ * fast/editing/selection-with-absolute-positioned-empty-content.html: Added.
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2022-01-13 Alan Bujtas <[email protected]>
+
+ REGRESSION (r278561): Right clicking a link selects the full line with unrelated text
+ https://bugs.webkit.org/show_bug.cgi?id=235172
+ <rdar://84069534>
+
+ Reviewed by Dean Jackson.
+
+ r278561 slightly change highlightStateForTextBox's behavior which now (correctly) returns HighlightState::None when the
+ RenderText content is not part of the current selection. Prior to r278561, it returned the RenderText's original selection state
+ which in this case was HighlightState::End.
+
+ <div><span>A<br>B<span style="position: absolute"></span></span>C</div>
+
+ In this specific case when we select the outer <span>, we end up with the following selection states for the generated line boxes:
+ (B) -> "Inside"
+ (C) -> "None"
+ while previously (C) came back as "End" (note that the absolute positioned element does not generate line boxes).
+
+ Now as Line::selectionState traverses through the line boxes, it comes across an unexpected "Inside -> None" transition at the selection end boundary (B -> C)
+ which incorrectly leaves the line state in "Inside" and we paint the selection all the way to the end of the block.
+
+ Test: fast/editing/selection-with-absolute-positioned-empty-content.html
+
+ * layout/integration/InlineIteratorLine.cpp:
+ (WebCore::InlineIterator::Line::selectionState const):
+
+2022-02-07 Russell Epstein <[email protected]>
+
Cherry-pick r287970. rdar://problem/87423294
PCM: Same-site triggering events should support ephemeral measurement
Modified: branches/safari-613-branch/Source/WebCore/layout/integration/InlineIteratorLine.cpp (289266 => 289267)
--- branches/safari-613-branch/Source/WebCore/layout/integration/InlineIteratorLine.cpp 2022-02-08 02:52:44 UTC (rev 289266)
+++ branches/safari-613-branch/Source/WebCore/layout/integration/InlineIteratorLine.cpp 2022-02-08 02:52:48 UTC (rev 289267)
@@ -190,7 +190,9 @@
else if (boxState == RenderObject::HighlightState::None && state == RenderObject::HighlightState::Start) {
// We are past the end of the selection.
state = RenderObject::HighlightState::Both;
- }
+ } else if (boxState == RenderObject::HighlightState::None && state == RenderObject::HighlightState::Inside)
+ state = RenderObject::HighlightState::End;
+
if (state == RenderObject::HighlightState::Both)
break;
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes