Skip to content
Permalink
Browse files
Revert "Release assert in Document::updateLayout() via HTMLTextAreaEl…
…ement::childrenChanged"

This reverts commit 0a91c41.

Unreviewed revert

Canonical link: https://commits.webkit.org/250803@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294550 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
karlrackler committed May 20, 2022
1 parent 5afc763 commit a1547da365912f473b751c780001482a9d531b12
Showing 40 changed files with 119 additions and 381 deletions.
@@ -162,31 +162,20 @@
var addedNotification = webArea.addNotificationListener(notificationCallback);
shouldBe("addedNotification", "true");

function waitForAnimationFrame() {
return new Promise(function(resolve, reject) {
requestAnimationFrame(resolve);
});
}
textbox = document.getElementById("textbox");
textbox.focus();

function focusElement(elementId) {
element = document.getElementById(elementId);
element.focus();
return waitForAnimationFrame();
}
move(true);

function moveAsync(isVertical) {
move(isVertical);
return waitForAnimationFrame();
}
textbox = document.getElementById("input");
textbox.focus();

move(false);

textbox = document.getElementById("textarea");
textbox.focus();

(async function () {
await focusElement("textbox");
await moveAsync(true);
await focusElement("input");
await moveAsync(false);
await focusElement("textarea");
await moveAsync(true);
})();
move(true);
}

</script>
@@ -195,87 +195,19 @@
shouldBe("addedNotification", "true");

textbox = document.getElementById("textbox");
textbox.focus();

// Trigger selection changes.
var s = window.getSelection();

function focusTextBox() {
return new Promise(function(resolve, reject) {
setTimeout(() => {
textbox.focus();
resolve();
}, 0);
});
}

function moveSelection(direction, granularity) {
return new Promise(function(resolve, reject) {
setTimeout(function() {
s.modify("move", direction, granularity);
resolve();
}, 0);
});
s.setPosition(textbox, 0);
for (var i in gran) {
s.modify("move", "forward", gran[i]);
s.modify("move", "backward", gran[i]);
}

function extendSelection(granularity) {
return new Promise(function(resolve, reject) {
setTimeout(function() {
s.modify("extend", "forward", granularity);
resolve();
}, 0);
});
for (var i in gran) {
s.setPosition(textbox, 0);
s.modify("extend", "forward", gran[i]);
}

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>
@@ -43,17 +43,12 @@
// Trigger selection changes.
var s = window.getSelection();
s.setPosition(textbox, 0);
requestAnimationFrame(() => {
for (var k = 0; k < 3; k++) {
s.modify("move", "forward", "character");
requestAnimationFrame(() => {
s.modify("move", "forward", "character");
requestAnimationFrame(() => {
s.modify("move", "forward", "character");
// Trigger value change.
document.execCommand("InsertText", false, "hello ");
});
});
});
}

// Trigger value change.
document.execCommand("InsertText", false, "hello ");
}

</script>
@@ -12,26 +12,15 @@
<div><a id=foobar style="color: black" href="">select this text<span></span></a> but not this</div>
<pre id=result></pre>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
if (window.internals)
internals.startTrackingRepaints();
if (window.testRunner)
testRunner.dumpAsText();

function timerAfterRAF(callback) {
return requestAnimationFrame(() => setTimeout(callback, 0));
}
window.getSelection().selectAllChildren(foobar);

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>
if (window.internals) {
result.innerText = internals.repaintRectsAsText();
internals.stopTrackingRepaints();
}
</script>
@@ -15,17 +15,13 @@
ta.focus();
// click
if (window.eventSender) {
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();
});
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;
} 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.";
@@ -2,4 +2,7 @@ Bug 111000: Selection gaps don't repaint correctly with transforms
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)
)

@@ -1,27 +1,11 @@
<!doctype html>
<head>
<script src="resources/text-based-repaint.js"></script>
<script>
if (window.testRunner) {
testRunner.dumpAsText(false);
testRunner.waitUntilDone();
}
function runRepaintTest()
function repaintTest()
{
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>
@@ -37,5 +21,4 @@
<div>
<div id="target" style="background-color: red; width: 100px; height: 100px; position: absolute;"><br/></div><br/>
</div>
<div id="repaints"></div>
</body>
@@ -2,4 +2,7 @@ Bug 111000: Selection gaps don't repaint correctly with transforms
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)
)

@@ -1,26 +1,11 @@
<!doctype html>
<head>
<script src="resources/text-based-repaint.js"></script>
<script>
if (window.testRunner) {
testRunner.dumpAsText(false);
testRunner.waitUntilDone();
}
function runRepaintTest()
function repaintTest()
{
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>
@@ -36,5 +21,4 @@
<div>
<div id="target" style="background-color: red; width: 100px; height: 100px; position: fixed;"><br/></div><br/>
</div>
<div id="repaints"></div>
</body>
@@ -2,4 +2,7 @@ Bug 111000: Selection gaps don't repaint correctly with transforms
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)
)

@@ -1,27 +1,11 @@
<!doctype html>
<head>
<script src="resources/text-based-repaint.js"></script>
<script>
if (window.testRunner) {
testRunner.dumpAsText(false);
testRunner.waitUntilDone();
}
function runRepaintTest()
function repaintTest()
{
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>
@@ -37,5 +21,4 @@
<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>
@@ -2,4 +2,7 @@ Bug 111000: Selection gaps don't repaint correctly with transforms
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)
)

0 comments on commit a1547da

Please sign in to comment.