Skip to content

Commit

Permalink
Bug 1851420 [wpt PR 41792] - [text-autospace] Add tests for modifying…
Browse files Browse the repository at this point in the history
… `TextNode`, a=testonly

Automatic update from web-platform-tests
[text-autospace] Add tests for modifying `TextNode`

Following up crrev.com/c/4835563, this patch adds tests for
modifying `TextNode`. In Blink, this goes to the optimized
code path to `NGInlineNode::SetTextWithOffset`.

Note these tests pass when the `text-autospace` is not
supported.

Bug: 1463890
Change-Id: I5b1c346a7671d9cfd7efcd5064376a391c6ad598
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4835849
Auto-Submit: Koji Ishii <kojii@chromium.org>
Reviewed-by: Lingqi Chi <lingqi@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Commit-Queue: Lingqi Chi <lingqi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1191984}

--

wpt-commits: 2612a05519ac888b9b00af02b4bed3aac150587c
wpt-pr: 41792
  • Loading branch information
kojiishi authored and moz-wptsync-bot committed Sep 13, 2023
1 parent f47d11f commit c48ac1e
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!DOCTYPE html>
<div id="target">国国AA国国AA国々</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-autospace-property">
<link rel="help" href="text-autospace-dynamic-text-001-ref.html">
<div id="target">国国</div>
<script>
const target_text = document.getElementById('target').firstChild;
for (const ch of 'AA国国AA国国') {
document.body.offsetTop; // Force layout.
target_text.appendData(ch);
}
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-autospace-property">
<link rel="help" href="text-autospace-dynamic-text-001-ref.html">
<div id="target">国国国国</div>
<script>
const target_text = document.getElementById('target').firstChild;
document.body.offsetTop; // Force layout.
target_text.insertData(2, 'AA国国AA');
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-autospace-property">
<link rel="help" href="text-autospace-dynamic-text-001-ref.html">
<div id="target">国国国国国</div>
<script>
const target_text = document.getElementById('target').firstChild;
document.body.offsetTop; // Force layout.
target_text.replaceData(2, 1, 'AA国国AA');
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-autospace-property">
<link rel="help" href="text-autospace-dynamic-text-001-ref.html">
<div id="target">国国AAAA国国AAAA国国</div>
<script>
const target_text = document.getElementById('target').firstChild;
document.body.offsetTop; // Force layout.
target_text.deleteData(2, 2);
document.body.offsetTop; // Force layout.
target_text.deleteData(6, 2);
</script>

0 comments on commit c48ac1e

Please sign in to comment.