-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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 <[email protected]> Reviewed-by: Lingqi Chi <[email protected]> Commit-Queue: Koji Ishii <[email protected]> Commit-Queue: Lingqi Chi <[email protected]> Cr-Commit-Position: refs/heads/main@{#1191984}
- Loading branch information
1 parent
e83b508
commit 2612a05
Showing
5 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
css/css-text/text-autospace/text-autospace-dynamic-text-001-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<!DOCTYPE html> | ||
<div id="target">国国AA国国AA国々</div> |
11 changes: 11 additions & 0 deletions
11
css/css-text/text-autospace/text-autospace-dynamic-text-001.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
9 changes: 9 additions & 0 deletions
9
css/css-text/text-autospace/text-autospace-dynamic-text-002.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
9 changes: 9 additions & 0 deletions
9
css/css-text/text-autospace/text-autospace-dynamic-text-003.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
11 changes: 11 additions & 0 deletions
11
css/css-text/text-autospace/text-autospace-dynamic-text-004.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |