Diff
Modified: trunk/LayoutTests/accessibility/mac/selection-boundary-userinfo.html (294609 => 294610)
--- trunk/LayoutTests/accessibility/mac/selection-boundary-userinfo.html 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/accessibility/mac/selection-boundary-userinfo.html 2022-05-21 06:09:00 UTC (rev 294610)
@@ -162,20 +162,31 @@
var addedNotification = webArea.addNotificationListener(notificationCallback);
shouldBe("addedNotification", "true");
- textbox = document.getElementById("textbox");
- textbox.focus();
+ function waitForAnimationFrame() {
+ return new Promise(function(resolve, reject) {
+ requestAnimationFrame(resolve);
+ });
+ }
- move(true);
+ function focusElement(elementId) {
+ element = document.getElementById(elementId);
+ element.focus();
+ return waitForAnimationFrame();
+ }
- textbox = document.getElementById("input");
- textbox.focus();
+ function moveAsync(isVertical) {
+ move(isVertical);
+ return waitForAnimationFrame();
+ }
- move(false);
-
- textbox = document.getElementById("textarea");
- textbox.focus();
-
- move(true);
+ (async function () {
+ await focusElement("textbox");
+ await moveAsync(true);
+ await focusElement("input");
+ await moveAsync(false);
+ await focusElement("textarea");
+ await moveAsync(true);
+ })();
}
</script>
Modified: trunk/LayoutTests/accessibility/mac/selection-change-userinfo.html (294609 => 294610)
--- trunk/LayoutTests/accessibility/mac/selection-change-userinfo.html 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/accessibility/mac/selection-change-userinfo.html 2022-05-21 06:09:00 UTC (rev 294610)
@@ -195,19 +195,87 @@
shouldBe("addedNotification", "true");
textbox = document.getElementById("textbox");
- textbox.focus();
// Trigger selection changes.
var s = window.getSelection();
- s.setPosition(textbox, 0);
- for (var i in gran) {
- s.modify("move", "forward", gran[i]);
- s.modify("move", "backward", gran[i]);
+
+ function focusTextBox() {
+ return new Promise(function(resolve, reject) {
+ setTimeout(() => {
+ textbox.focus();
+ resolve();
+ }, 0);
+ });
}
- for (var i in gran) {
- s.setPosition(textbox, 0);
- s.modify("extend", "forward", gran[i]);
+
+ function moveSelection(direction, granularity) {
+ return new Promise(function(resolve, reject) {
+ setTimeout(function() {
+ s.modify("move", direction, granularity);
+ resolve();
+ }, 0);
+ });
}
+
+ function extendSelection(granularity) {
+ return new Promise(function(resolve, reject) {
+ setTimeout(function() {
+ s.modify("extend", "forward", granularity);
+ resolve();
+ }, 0);
+ });
+ }
+
+ function resetPosition() {
+ return new Promise(function(resolve, reject) {
+ setTimeout(function() {
+ s = window.getSelection();
+ s.setPosition(textbox, 0);
+ resolve();
+ }, 0);
+ });
+ }
+
+ (async function() {
+ await focusTextBox();
+ await resetPosition();
+ await moveSelection("forward", gran[0]);
+ await moveSelection("backward", gran[0]);
+ await moveSelection("forward", gran[1]);
+ await moveSelection("backward", gran[1]);
+ await moveSelection("forward", gran[2]);
+ await moveSelection("backward", gran[2]);
+ await moveSelection("forward", gran[3]);
+ await moveSelection("backward", gran[3]);
+ await moveSelection("forward", gran[4]);
+ await moveSelection("backward", gran[4]);
+ await moveSelection("forward", gran[5]);
+ await moveSelection("backward", gran[5]);
+ await moveSelection("forward", gran[6]);
+ await moveSelection("backward", gran[6]);
+ await moveSelection("forward", gran[7]);
+ await moveSelection("backward", gran[7]);
+ await moveSelection("forward", gran[8]);
+ await moveSelection("backward", gran[8]);
+ await resetPosition();
+ await extendSelection(gran[0]);
+ await resetPosition();
+ await extendSelection(gran[1]);
+ await resetPosition();
+ await extendSelection(gran[2]);
+ await resetPosition();
+ await extendSelection(gran[3]);
+ await resetPosition();
+ await extendSelection(gran[4]);
+ await resetPosition();
+ await extendSelection(gran[5]);
+ await resetPosition();
+ await extendSelection(gran[6]);
+ await resetPosition();
+ await extendSelection(gran[7]);
+ await resetPosition();
+ await extendSelection(gran[8]);
+ })();
}
</script>
Modified: trunk/LayoutTests/accessibility/mac/selection-value-changes-for-aria-textbox.html (294609 => 294610)
--- trunk/LayoutTests/accessibility/mac/selection-value-changes-for-aria-textbox.html 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/accessibility/mac/selection-value-changes-for-aria-textbox.html 2022-05-21 06:09:00 UTC (rev 294610)
@@ -43,12 +43,17 @@
// Trigger selection changes.
var s = window.getSelection();
s.setPosition(textbox, 0);
- for (var k = 0; k < 3; k++) {
+ requestAnimationFrame(() => {
s.modify("move", "forward", "character");
- }
-
- // Trigger value change.
- document.execCommand("InsertText", false, "hello ");
+ requestAnimationFrame(() => {
+ s.modify("move", "forward", "character");
+ requestAnimationFrame(() => {
+ s.modify("move", "forward", "character");
+ // Trigger value change.
+ document.execCommand("InsertText", false, "hello ");
+ });
+ });
+ });
}
</script>
Modified: trunk/LayoutTests/editing/selection-with-absolute-positioned-empty-content.html (294609 => 294610)
--- trunk/LayoutTests/editing/selection-with-absolute-positioned-empty-content.html 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/editing/selection-with-absolute-positioned-empty-content.html 2022-05-21 06:09:00 UTC (rev 294610)
@@ -12,15 +12,26 @@
<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();
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
-window.getSelection().selectAllChildren(foobar);
+function timerAfterRAF(callback) {
+ return requestAnimationFrame(() => setTimeout(callback, 0));
+}
-if (window.internals) {
- result.innerText = internals.repaintRectsAsText();
- internals.stopTrackingRepaints();
-}
-</script>
\ No newline at end of file
+timerAfterRAF(() => {
+ if (window.internals)
+ internals.startTrackingRepaints();
+ window.getSelection().selectAllChildren(foobar);
+ timerAfterRAF(() => {
+ if (window.internals) {
+ result.innerText = internals.repaintRectsAsText();
+ internals.stopTrackingRepaints();
+ }
+ if (window.testRunner)
+ testRunner.notifyDone();
+ });
+});
+</script>
Modified: trunk/LayoutTests/fast/forms/textarea-scrolled-endline-caret.html (294609 => 294610)
--- trunk/LayoutTests/fast/forms/textarea-scrolled-endline-caret.html 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/fast/forms/textarea-scrolled-endline-caret.html 2022-05-21 06:09:00 UTC (rev 294610)
@@ -15,13 +15,17 @@
ta.focus();
// click
if (window.eventSender) {
- eventSender.mouseMoveTo(90, 20);
- eventSender.mouseDown();
- eventSender.mouseUp();
- if (ta.selectionEnd == 17)
- res.innerHTML = "Test Succeeded";
- else
- res.innerHTML = "Test Failed: caret is at " + ta.selectionEnd;
+ testRunner.waitUntilDone();
+ requestAnimationFrame(() => {
+ eventSender.mouseMoveTo(90, 20);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ if (ta.selectionEnd == 17)
+ res.innerHTML = "Test Succeeded";
+ else
+ res.innerHTML = "Test Failed: caret is at " + ta.selectionEnd;
+ testRunner.notifyDone();
+ });
} else {
res.innerHTML = "Test can't run without event sender (part of DumpRenderTree). "
+ "To test manually, click at the middle of the line marked 9 and check that the caret appears after the 9.";
Modified: trunk/LayoutTests/fast/repaint/selection-gap-absolute-child-expected.txt (294609 => 294610)
--- trunk/LayoutTests/fast/repaint/selection-gap-absolute-child-expected.txt 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/fast/repaint/selection-gap-absolute-child-expected.txt 2022-05-21 06:09:00 UTC (rev 294610)
@@ -2,7 +2,4 @@
This tests that absolute elements are invalidated correctly. The box will be competely green if the selected area was invalidated correctly.
-(repaint rects
- (rect 0 0 100 100)
-)
-
+(repaint rects (rect 0 0 100 100) )
Modified: trunk/LayoutTests/fast/repaint/selection-gap-absolute-child.html (294609 => 294610)
--- trunk/LayoutTests/fast/repaint/selection-gap-absolute-child.html 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/fast/repaint/selection-gap-absolute-child.html 2022-05-21 06:09:00 UTC (rev 294610)
@@ -1,11 +1,27 @@
<!doctype html>
<head>
- <script src=""
<script>
- function repaintTest()
+ if (window.testRunner) {
+ testRunner.dumpAsText(false);
+ testRunner.waitUntilDone();
+ }
+ function runRepaintTest()
{
+ if (window.internals)
+ internals.startTrackingRepaints();
+
var target = document.getElementById("target");
getSelection().setBaseAndExtent(target, 0, target.nextSibling, 0);
+
+ setTimeout(function() {
+ if (window.internals) {
+ document.querySelector('#repaints').innerHTML = window.internals.repaintRectsAsText();
+ internals.stopTrackingRepaints();
+ }
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, 0);
}
</script>
<style>
@@ -21,4 +37,5 @@
<div>
<div id="target" style="background-color: red; width: 100px; height: 100px; position: absolute;"><br/></div><br/>
</div>
+ <div id="repaints"></div>
</body>
Modified: trunk/LayoutTests/fast/repaint/selection-gap-fixed-child-expected.txt (294609 => 294610)
--- trunk/LayoutTests/fast/repaint/selection-gap-fixed-child-expected.txt 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/fast/repaint/selection-gap-fixed-child-expected.txt 2022-05-21 06:09:00 UTC (rev 294610)
@@ -2,7 +2,4 @@
This tests that fixed elements are invalidated correctly. The box will be competely green if the selected area was invalidated correctly.
-(repaint rects
- (rect 0 0 100 100)
-)
-
+(repaint rects (rect 0 0 100 100) )
Modified: trunk/LayoutTests/fast/repaint/selection-gap-fixed-child.html (294609 => 294610)
--- trunk/LayoutTests/fast/repaint/selection-gap-fixed-child.html 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/fast/repaint/selection-gap-fixed-child.html 2022-05-21 06:09:00 UTC (rev 294610)
@@ -1,11 +1,26 @@
<!doctype html>
<head>
- <script src=""
<script>
- function repaintTest()
+ if (window.testRunner) {
+ testRunner.dumpAsText(false);
+ testRunner.waitUntilDone();
+ }
+ function runRepaintTest()
{
+ if (window.internals)
+ internals.startTrackingRepaints();
+
var target = document.getElementById("target");
getSelection().setBaseAndExtent(target, 0, target.nextSibling, 0);
+
+ setTimeout(function() {
+ if (window.internals) {
+ document.querySelector('#repaints').innerHTML = window.internals.repaintRectsAsText();
+ internals.stopTrackingRepaints();
+ }
+ if (window.testRunner)
+ testRunner.notifyDone();
+ });
}
</script>
<style>
@@ -21,4 +36,5 @@
<div>
<div id="target" style="background-color: red; width: 100px; height: 100px; position: fixed;"><br/></div><br/>
</div>
+ <div id="repaints"></div>
</body>
Modified: trunk/LayoutTests/fast/repaint/selection-gap-flipped-absolute-child-expected.txt (294609 => 294610)
--- trunk/LayoutTests/fast/repaint/selection-gap-flipped-absolute-child-expected.txt 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/fast/repaint/selection-gap-flipped-absolute-child-expected.txt 2022-05-21 06:09:00 UTC (rev 294610)
@@ -2,7 +2,4 @@
This tests that absolute elements that get flipped are invalidated correctly. The box will be competely green if the selected area was invalidated correctly.
-(repaint rects
- (rect 0 0 100 100)
-)
-
+(repaint rects (rect 0 0 100 100) )
Modified: trunk/LayoutTests/fast/repaint/selection-gap-flipped-absolute-child.html (294609 => 294610)
--- trunk/LayoutTests/fast/repaint/selection-gap-flipped-absolute-child.html 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/fast/repaint/selection-gap-flipped-absolute-child.html 2022-05-21 06:09:00 UTC (rev 294610)
@@ -1,11 +1,27 @@
<!doctype html>
<head>
- <script src=""
<script>
- function repaintTest()
+ if (window.testRunner) {
+ testRunner.dumpAsText(false);
+ testRunner.waitUntilDone();
+ }
+ function runRepaintTest()
{
+ if (window.internals)
+ internals.startTrackingRepaints();
+
var target = document.getElementById("target");
getSelection().setBaseAndExtent(target, 0, target.nextSibling, 0);
+
+ setTimeout(function() {
+ if (window.internals) {
+ document.querySelector('#repaints').innerHTML = window.internals.repaintRectsAsText();
+ internals.stopTrackingRepaints();
+ }
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, 0);
}
</script>
<style>
@@ -21,4 +37,5 @@
<div style="-webkit-writing-mode: vertical-rl">
<div id="target" style="background-color: red; width: 100px; height: 100px; position: absolute;"><br/></div><br/>
</div>
+ <div id="repaints"></div>
</body>
Modified: trunk/LayoutTests/fast/repaint/selection-gap-transformed-absolute-child-expected.txt (294609 => 294610)
--- trunk/LayoutTests/fast/repaint/selection-gap-transformed-absolute-child-expected.txt 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/fast/repaint/selection-gap-transformed-absolute-child-expected.txt 2022-05-21 06:09:00 UTC (rev 294610)
@@ -2,7 +2,4 @@
This tests that absolute elements that get transformed are invalidated correctly. The box will be completely green if the selected area was invalidated correctly.
-(repaint rects
- (rect 50 50 100 100)
-)
-
+(repaint rects (rect 50 50 100 100) )
Modified: trunk/LayoutTests/fast/repaint/selection-gap-transformed-absolute-child.html (294609 => 294610)
--- trunk/LayoutTests/fast/repaint/selection-gap-transformed-absolute-child.html 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/fast/repaint/selection-gap-transformed-absolute-child.html 2022-05-21 06:09:00 UTC (rev 294610)
@@ -1,11 +1,27 @@
<!doctype html>
<head>
- <script src=""
<script>
- function repaintTest()
+ if (window.testRunner) {
+ testRunner.dumpAsText(false);
+ testRunner.waitUntilDone();
+ }
+ function runRepaintTest()
{
+ if (window.internals)
+ internals.startTrackingRepaints();
+
var target = document.getElementById("target");
getSelection().setBaseAndExtent(target, 0, target.nextSibling, 0);
+
+ setTimeout(function() {
+ if (window.internals) {
+ document.querySelector('#repaints').innerHTML = window.internals.repaintRectsAsText();
+ internals.stopTrackingRepaints();
+ }
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, 0);
}
</script>
<style>
@@ -21,4 +37,5 @@
<div style="-webkit-transform: translate(50px, 50px);">
<div id="target" style="background-color: red; width: 100px; height: 100px; position: absolute;"><br/></div><br/>
</div>
+ <div id="repaints"></div>
</body>
Modified: trunk/LayoutTests/fast/repaint/selection-gap-transformed-fixed-child-expected.txt (294609 => 294610)
--- trunk/LayoutTests/fast/repaint/selection-gap-transformed-fixed-child-expected.txt 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/fast/repaint/selection-gap-transformed-fixed-child-expected.txt 2022-05-21 06:09:00 UTC (rev 294610)
@@ -2,7 +2,4 @@
This tests that fixed elements that get transformed are invalidated correctly. The box will be competely green if the selected area was invalidated correctly.
-(repaint rects
- (rect 50 50 100 100)
-)
-
+(repaint rects (rect 50 50 100 100) )
Modified: trunk/LayoutTests/fast/repaint/selection-gap-transformed-fixed-child.html (294609 => 294610)
--- trunk/LayoutTests/fast/repaint/selection-gap-transformed-fixed-child.html 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/fast/repaint/selection-gap-transformed-fixed-child.html 2022-05-21 06:09:00 UTC (rev 294610)
@@ -1,11 +1,27 @@
<!doctype html>
<head>
- <script src=""
<script>
- function repaintTest()
+ if (window.testRunner) {
+ testRunner.dumpAsText(false);
+ testRunner.waitUntilDone();
+ }
+ function runRepaintTest()
{
+ if (window.internals)
+ internals.startTrackingRepaints();
+
var target = document.getElementById("target");
getSelection().setBaseAndExtent(target, 0, target.nextSibling, 0);
+
+ setTimeout(function() {
+ if (window.internals) {
+ document.querySelector('#repaints').innerHTML = window.internals.repaintRectsAsText();
+ internals.stopTrackingRepaints();
+ }
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, 0);
}
</script>
<style>
@@ -21,4 +37,5 @@
<div style="-webkit-transform: translate(50px, 50px);">
<div id="target" style="background-color: red; width: 100px; height: 100px; position: fixed;"><br/></div><br/>
</div>
+ <div id="repaints"></div>
</body>
Modified: trunk/LayoutTests/fast/repaint/selection-paint-invalidation-expected.txt (294609 => 294610)
--- trunk/LayoutTests/fast/repaint/selection-paint-invalidation-expected.txt 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/fast/repaint/selection-paint-invalidation-expected.txt 2022-05-21 06:09:00 UTC (rev 294610)
@@ -2,6 +2,5 @@
A
(repaint rects
(rect 8 68 20 100)
- (rect 8 68 20 100)
)
Modified: trunk/LayoutTests/fast/repaint/selection-ruby-rl-expected.txt (294609 => 294610)
--- trunk/LayoutTests/fast/repaint/selection-ruby-rl-expected.txt 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/fast/repaint/selection-ruby-rl-expected.txt 2022-05-21 06:09:00 UTC (rev 294610)
@@ -8,7 +8,4 @@
Testing both hit testing and painting of selection.
Testing both hit testing and painting of selection.
Testing both hit testing and painting of selection.
-(repaint rects
- (rect 774 38 18 79)
-)
-
+(repaint rects (rect 774 38 18 79) )
Modified: trunk/LayoutTests/fast/repaint/selection-ruby-rl.html (294609 => 294610)
--- trunk/LayoutTests/fast/repaint/selection-ruby-rl.html 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/fast/repaint/selection-ruby-rl.html 2022-05-21 06:09:00 UTC (rev 294610)
@@ -3,7 +3,15 @@
<head>
<script src=""
<script>
-function repaintTest() {
+if (window.testRunner) {
+ testRunner.dumpAsText(false);
+ testRunner.waitUntilDone();
+}
+
+function runRepaintTest() {
+ if (window.internals)
+ internals.startTrackingRepaints();
+
if (eventSender) {
eventSender.mouseMoveTo(790, 40);
eventSender.mouseDown();
@@ -11,6 +19,16 @@
eventSender.mouseMoveTo(790, 120);
eventSender.mouseUp();
}
+
+ setTimeout(function() {
+ if (window.internals) {
+ document.querySelector('#repaints').innerHTML = window.internals.repaintRectsAsText();
+ internals.stopTrackingRepaints();
+ }
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, 0);
}
</script>
@@ -26,4 +44,5 @@
Testing both hit testing and painting of selection.<br>
Testing both hit testing and painting of selection.<br>
Testing both hit testing and painting of selection.<br>
+<div id="repaints"></div>
</body>
Modified: trunk/LayoutTests/fast/repaint/text-selection-overflow-hidden-expected.txt (294609 => 294610)
--- trunk/LayoutTests/fast/repaint/text-selection-overflow-hidden-expected.txt 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/fast/repaint/text-selection-overflow-hidden-expected.txt 2022-05-21 06:09:00 UTC (rev 294610)
@@ -1,6 +1,3 @@
Should have green background
-(repaint rects
- (rect 8 16 199 18)
-)
-
+(repaint rects (rect 8 16 199 18) )
Modified: trunk/LayoutTests/fast/repaint/text-selection-overflow-hidden.html (294609 => 294610)
--- trunk/LayoutTests/fast/repaint/text-selection-overflow-hidden.html 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/fast/repaint/text-selection-overflow-hidden.html 2022-05-21 06:09:00 UTC (rev 294610)
@@ -1,5 +1,4 @@
<!DOCTYPE html>
-<script src="" type="text/_javascript_"></script>
<style>
#test {
background-color: red;
@@ -12,11 +11,30 @@
}
</style>
<script>
- function repaintTest() {
+ if (window.testRunner) {
+ testRunner.dumpAsText(false);
+ testRunner.waitUntilDone();
+ }
+
+ function runRepaintTest() {
+ if (window.internals)
+ internals.startTrackingRepaints();
+
getSelection().setBaseAndExtent(test, 0, test, 1);
+
+ setTimeout(function() {
+ if (window.internals) {
+ document.querySelector('#repaints').innerHTML = window.internals.repaintRectsAsText();
+ internals.stopTrackingRepaints();
+ }
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, 0);
};
</script>
<body _onload_="runRepaintTest()">
<p id="test">Should have green background</p>
+ <div id="repaints"></div>
</body>
Modified: trunk/LayoutTests/fast/text/incorrect-deselection-across-multiple-elements.html (294609 => 294610)
--- trunk/LayoutTests/fast/text/incorrect-deselection-across-multiple-elements.html 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/fast/text/incorrect-deselection-across-multiple-elements.html 2022-05-21 06:09:00 UTC (rev 294610)
@@ -20,11 +20,13 @@
if (window.internals)
internals.startTrackingRepaints();
window.getSelection().selectAllChildren(second);
- if (window.internals) {
- result.innerText = internals.repaintRectsAsText().indexOf("784 70") == -1 ? "FAIL" : "PASS";
- internals.stopTrackingRepaints();
- }
- if (window.testRunner)
- testRunner.notifyDone();
+ setTimeout(function() {
+ if (window.internals) {
+ result.innerText = internals.repaintRectsAsText().indexOf("784 70") == -1 ? "FAIL" : "PASS";
+ internals.stopTrackingRepaints();
+ }
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, 0);
}, 0);
</script>
\ No newline at end of file
Modified: trunk/LayoutTests/platform/gtk/TestExpectations (294609 => 294610)
--- trunk/LayoutTests/platform/gtk/TestExpectations 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/platform/gtk/TestExpectations 2022-05-21 06:09:00 UTC (rev 294610)
@@ -1531,8 +1531,6 @@
# Incomplete implementation of eventSender causes this test to fail
webkit.org/b/42194 fast/scrolling/scroll-select-list.html [ ImageOnlyFailure ]
-webkit.org/b/139354 fast/repaint/selection-ruby-rl.html [ Failure ]
-
# Missing glyph symbol is not rendered properly.
webkit.org/b/140252 fast/css/line-height-determined-by-primary-font.html [ Failure ]
webkit.org/b/140252 fast/text/decorations-with-text-combine.html [ Failure ]
Copied: trunk/LayoutTests/platform/gtk/fast/repaint/selection-ruby-rl-expected.txt (from rev 294609, trunk/LayoutTests/fast/repaint/selection-ruby-rl-expected.txt) (0 => 294610)
--- trunk/LayoutTests/platform/gtk/fast/repaint/selection-ruby-rl-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/gtk/fast/repaint/selection-ruby-rl-expected.txt 2022-05-21 06:09:00 UTC (rev 294610)
@@ -0,0 +1,11 @@
+Testing both hit testing and painting of selection.
+Testing both hit testing and painting of selection.
+Testing both hit testing and painting of selection.Some ruby
+Testing both hit testing and painting of selection.
+Testing both hit testing and painting of selection.
+Testing both hit testing and painting of selection.
+Testing both hit testing and painting of selection.
+Testing both hit testing and painting of selection.
+Testing both hit testing and painting of selection.
+Testing both hit testing and painting of selection.
+(repaint rects (rect 775 37 17 84) )
Modified: trunk/LayoutTests/platform/gtk/fast/repaint/text-selection-overflow-hidden-expected.txt (294609 => 294610)
--- trunk/LayoutTests/platform/gtk/fast/repaint/text-selection-overflow-hidden-expected.txt 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/platform/gtk/fast/repaint/text-selection-overflow-hidden-expected.txt 2022-05-21 06:09:00 UTC (rev 294610)
@@ -1,6 +1,3 @@
Should have green background
-(repaint rects
- (rect 8 16 197 17)
-)
-
+(repaint rects (rect 8 16 197 17) )
Modified: trunk/LayoutTests/platform/mac/TestExpectations (294609 => 294610)
--- trunk/LayoutTests/platform/mac/TestExpectations 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/platform/mac/TestExpectations 2022-05-21 06:09:00 UTC (rev 294610)
@@ -2305,3 +2305,4 @@
webkit.org/b/240074 imported/w3c/web-platform-tests/service-workers/service-worker/registration-updateviacache.https.html [ Pass Failure ]
+webkit.org/b/231298 accessibility/mac/selection-sync.html [ Skip ] # Timeout
Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (294609 => 294610)
--- trunk/LayoutTests/platform/mac-wk1/TestExpectations 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations 2022-05-21 06:09:00 UTC (rev 294610)
@@ -1841,3 +1841,6 @@
# rdar://82399990 ([ Catalina EWS ] webgl/2.0.0/* tests are flaky crashing ASSERTION FAILED: !needsLayout() (229580)) Disable webgl tests for mac-wk1
webgl [ Skip ]
+
+webkit.org/b/231298 accessibility/mac/selection-boundary-userinfo.html [ Failure ]
+webkit.org/b/232630 fast/forms/autofocus-opera-003.html [ Failure ]
Added: trunk/LayoutTests/platform/mac-wk1/accessibility/mac/focus-setting-selection-syncronizing-not-clearing-expected.txt (0 => 294610)
--- trunk/LayoutTests/platform/mac-wk1/accessibility/mac/focus-setting-selection-syncronizing-not-clearing-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/accessibility/mac/focus-setting-selection-syncronizing-not-clearing-expected.txt 2022-05-21 06:09:00 UTC (rev 294610)
@@ -0,0 +1,17 @@
+
+ 1
+ 2
+This tests that calling focus on a render object when it doesn't result in a selection change won't leave isSynchronizingSelection set to true.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS addedNotification is true
+PASS accessibilityController.focusedElement.isEqual(accessibilityController.accessibleElementById("1")) is true
+PASS axTextStateSyncOne is undefined
+PASS accessibilityController.accessibleElementById("1").isFocusable is true
+PASS axTextStateSyncTwo is undefined
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/platform/mac-wk1/fast/repaint/4776765-expected.txt (0 => 294610)
--- trunk/LayoutTests/platform/mac-wk1/fast/repaint/4776765-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/fast/repaint/4776765-expected.txt 2022-05-21 06:09:00 UTC (rev 294610)
@@ -0,0 +1,14 @@
+
+
+
+(repaint rects
+ (rect 1 19 15 32)
+ (rect 8 26 1 18)
+ (rect 1 19 15 32)
+ (rect 8 26 1 18)
+ (rect 1 37 798 32)
+ (rect 8 44 784 18)
+ (rect 1 51 798 18)
+ (rect 1 44 798 7)
+)
+
Modified: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/css/css-scroll-snap/scroll-target-margin-005-expected.txt (294609 => 294610)
--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/css/css-scroll-snap/scroll-target-margin-005-expected.txt 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/css/css-scroll-snap/scroll-target-margin-005-expected.txt 2022-05-21 06:09:00 UTC (rev 294610)
@@ -1,4 +1,4 @@
-FAIL scroll-margin on input widget assert_between_exclusive: Should honor date input scroll-margin expected a number greater than 4750 and less than 4850 but got 4720
+FAIL scroll-margin on input widget assert_between_exclusive: Should honor date input scroll-margin expected a number greater than 4750 and less than 4850 but got 9439
Added: trunk/LayoutTests/platform/win/fast/repaint/4776765-expected.txt (0 => 294610)
--- trunk/LayoutTests/platform/win/fast/repaint/4776765-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/win/fast/repaint/4776765-expected.txt 2022-05-21 06:09:00 UTC (rev 294610)
@@ -0,0 +1,10 @@
+
+
+
+(repaint rects
+ (rect 1 37 798 32)
+ (rect 8 44 784 18)
+ (rect 1 51 798 18)
+ (rect 1 44 798 7)
+)
+
Modified: trunk/LayoutTests/platform/win/fast/repaint/selection-gap-fixed-child-expected.txt (294609 => 294610)
--- trunk/LayoutTests/platform/win/fast/repaint/selection-gap-fixed-child-expected.txt 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/platform/win/fast/repaint/selection-gap-fixed-child-expected.txt 2022-05-21 06:09:00 UTC (rev 294610)
@@ -2,7 +2,4 @@
This tests that fixed elements are invalidated correctly. The box will be competely green if the selected area was invalidated correctly.
-(repaint rects
- (rect 0 0 100 100)
-)
-
+(repaint rects (rect 0 0 100 100) )
Modified: trunk/LayoutTests/platform/win/fast/repaint/selection-ruby-rl-expected.txt (294609 => 294610)
--- trunk/LayoutTests/platform/win/fast/repaint/selection-ruby-rl-expected.txt 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/platform/win/fast/repaint/selection-ruby-rl-expected.txt 2022-05-21 06:09:00 UTC (rev 294610)
@@ -8,7 +8,4 @@
Testing both hit testing and painting of selection.
Testing both hit testing and painting of selection.
Testing both hit testing and painting of selection.
-(repaint rects
- (rect 774 39 18 83)
-)
-
+(repaint rects (rect 774 39 18 83) )
Modified: trunk/LayoutTests/platform/win/fast/repaint/text-selection-overflow-hidden-expected.txt (294609 => 294610)
--- trunk/LayoutTests/platform/win/fast/repaint/text-selection-overflow-hidden-expected.txt 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/LayoutTests/platform/win/fast/repaint/text-selection-overflow-hidden-expected.txt 2022-05-21 06:09:00 UTC (rev 294610)
@@ -1,6 +1,3 @@
Should have green background
-(repaint rects
- (rect 8 16 197 18)
-)
-
+(repaint rects (rect 8 16 197 18) )
Modified: trunk/Source/WebCore/Modules/highlight/AppHighlightStorage.cpp (294609 => 294610)
--- trunk/Source/WebCore/Modules/highlight/AppHighlightStorage.cpp 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/Source/WebCore/Modules/highlight/AppHighlightStorage.cpp 2022-05-21 06:09:00 UTC (rev 294610)
@@ -271,7 +271,7 @@
if (textIndicator)
m_document->page()->chrome().client().setTextIndicator(textIndicator->data());
- TemporarySelectionChange selectionChange(*strongDocument, { range.value() }, { TemporarySelectionOption::DelegateMainFrameScroll, TemporarySelectionOption::SmoothScroll, TemporarySelectionOption::RevealSelectionBounds });
+ TemporarySelectionChange selectionChange(*strongDocument, { *range }, { TemporarySelectionOption::DelegateMainFrameScroll, TemporarySelectionOption::SmoothScroll, TemporarySelectionOption::RevealSelectionBounds, TemporarySelectionOption::UserTriggered });
}
return true;
Modified: trunk/Source/WebCore/editing/Editor.cpp (294609 => 294610)
--- trunk/Source/WebCore/editing/Editor.cpp 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/Source/WebCore/editing/Editor.cpp 2022-05-21 06:09:00 UTC (rev 294610)
@@ -264,7 +264,7 @@
void TemporarySelectionChange::setSelection(const VisibleSelection& selection, IsTemporarySelection isTemporarySelection)
{
- auto options = FrameSelection::defaultSetSelectionOptions();
+ auto options = FrameSelection::defaultSetSelectionOptions(m_options.contains(TemporarySelectionOption::UserTriggered) ? UserTriggered : NotUserTriggered);
if (m_options & TemporarySelectionOption::DoNotSetFocus)
options.add(FrameSelection::DoNotSetFocus);
Modified: trunk/Source/WebCore/editing/Editor.h (294609 => 294610)
--- trunk/Source/WebCore/editing/Editor.h 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/Source/WebCore/editing/Editor.h 2022-05-21 06:09:00 UTC (rev 294610)
@@ -126,6 +126,8 @@
DelegateMainFrameScroll = 1 << 5,
RevealSelectionBounds = 1 << 6,
+
+ UserTriggered = 1 << 7,
};
class TemporarySelectionChange {
Modified: trunk/Source/WebCore/editing/FrameSelection.cpp (294609 => 294610)
--- trunk/Source/WebCore/editing/FrameSelection.cpp 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/Source/WebCore/editing/FrameSelection.cpp 2022-05-21 06:09:00 UTC (rev 294610)
@@ -454,6 +454,11 @@
if (frameView && frameView->layoutContext().isLayoutPending())
return;
+ if (!(options & IsUserTriggered)) {
+ scheduleAppearanceUpdateAfterStyleChange();
+ return;
+ }
+
updateAndRevealSelection(intent, options.contains(SmoothScroll) ? ScrollBehavior::Smooth : ScrollBehavior::Instant, options.contains(RevealSelectionBounds) ? RevealExtentOption::DoNotRevealExtent : RevealExtentOption::RevealExtent);
if (options & IsUserTriggered) {
@@ -462,13 +467,19 @@
}
}
-static void updateSelectionByUpdatingLayoutOrStyle(Document& document)
+void FrameSelection::updateSelectionAppearanceNow()
{
+ if (!m_document || !m_document->hasLivingRenderTree())
+ return;
+
+ Ref document = *m_document;
#if ENABLE(TEXT_CARET)
- document.updateLayoutIgnorePendingStylesheets();
+ document->updateLayoutIgnorePendingStylesheets();
#else
- document.updateStyleIfNeeded();
+ document->updateStyleIfNeeded();
#endif
+ if (m_pendingSelectionUpdate)
+ updateAppearance();
}
void FrameSelection::setNeedsSelectionUpdate(RevealSelectionAfterUpdate revealMode)
@@ -1700,7 +1711,7 @@
{
if (!m_document)
return IntRect();
- updateSelectionByUpdatingLayoutOrStyle(*m_document);
+ updateSelectionAppearanceNow();
recomputeCaretRect();
if (insideFixed)
*insideFixed = m_caretInsidePositionFixed;
@@ -2258,7 +2269,7 @@
// FIXME: We shouldn't trigger a synchronous layout here.
if (doAppearanceUpdate == ShouldUpdateAppearance::Yes && m_document)
- updateSelectionByUpdatingLayoutOrStyle(*m_document);
+ updateSelectionAppearanceNow();
#if ENABLE(TEXT_CARET)
if (m_caretPaint) {
@@ -2361,12 +2372,12 @@
return m_document->editor().client()->shouldDeleteRange(selection.toNormalizedRange());
}
-FloatRect FrameSelection::selectionBounds(ClipToVisibleContent clipToVisibleContent) const
+FloatRect FrameSelection::selectionBounds(ClipToVisibleContent clipToVisibleContent)
{
if (!m_document)
return LayoutRect();
- updateSelectionByUpdatingLayoutOrStyle(*m_document);
+ updateSelectionAppearanceNow();
auto* renderView = m_document->renderView();
if (!renderView)
return LayoutRect();
@@ -2462,6 +2473,8 @@
if (isNone())
return;
+ updateSelectionAppearanceNow();
+
LayoutRect rect;
bool insideFixed = false;
if (isCaret())
Modified: trunk/Source/WebCore/editing/FrameSelection.h (294609 => 294610)
--- trunk/Source/WebCore/editing/FrameSelection.h 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/Source/WebCore/editing/FrameSelection.h 2022-05-21 06:09:00 UTC (rev 294610)
@@ -245,7 +245,7 @@
void clearTypingStyle();
enum class ClipToVisibleContent : uint8_t { No, Yes };
- WEBCORE_EXPORT FloatRect selectionBounds(ClipToVisibleContent = ClipToVisibleContent::Yes) const;
+ WEBCORE_EXPORT FloatRect selectionBounds(ClipToVisibleContent = ClipToVisibleContent::Yes);
enum class TextRectangleHeight { TextHeight, SelectionHeight };
WEBCORE_EXPORT void getClippedVisibleTextRectangles(Vector<FloatRect>&, TextRectangleHeight = TextRectangleHeight::SelectionHeight) const;
@@ -267,6 +267,7 @@
void updateFromAssociatedLiveRange();
private:
+ void updateSelectionAppearanceNow();
void updateAndRevealSelection(const AXTextStateChangeIntent&, ScrollBehavior = ScrollBehavior::Instant, RevealExtentOption = RevealExtentOption::RevealExtent);
void updateDataDetectorsForSelection();
Modified: trunk/Source/WebCore/page/EventHandler.cpp (294609 => 294610)
--- trunk/Source/WebCore/page/EventHandler.cpp 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/Source/WebCore/page/EventHandler.cpp 2022-05-21 06:09:00 UTC (rev 294610)
@@ -444,7 +444,7 @@
static void setSelectionIfNeeded(FrameSelection& selection, const VisibleSelection& newSelection)
{
if (selection.selection() != newSelection && selection.shouldChangeSelection(newSelection))
- selection.setSelection(newSelection);
+ selection.setSelection(newSelection, FrameSelection::defaultSetSelectionOptions(UserTriggered));
}
static inline bool dispatchSelectStart(Node* node)
Modified: trunk/Source/WebCore/page/Page.cpp (294609 => 294610)
--- trunk/Source/WebCore/page/Page.cpp 2022-05-21 05:39:52 UTC (rev 294609)
+++ trunk/Source/WebCore/page/Page.cpp 2022-05-21 06:09:00 UTC (rev 294610)
@@ -1742,6 +1742,10 @@
});
forEachDocument([] (Document& document) {
+ document.selection().updateAppearanceAfterLayout();
+ });
+
+ forEachDocument([] (Document& document) {
document.updateHighlightPositions();
});
#if ENABLE(APP_HIGHLIGHTS)