Automatic update from web-platform-tests [Editing] Remove VisiblePosition from Inserttext EditingUseDomPositionApi-gated VP removal in InsertTextCommand, RebalanceWhitespaceOnTextSubstring, and PASEB. Flag-on path reads EndingDomSelection() (added in crrev.com/c/7866547) instead of the VP-canonicalized ending selection. Refinements: targeted <wbr> reanchor in InsertText only; drop the ReanchorIntoSiblingText hop over <br>; keep VP for PASEB structural equality; bounce caret out of fully-collapsed source-formatting whitespace before insert. Includes baseline updates for editing-empty-divs, 5510537, return-with-object-element, 4840662, insertparagraph_3001-4000, and splits the flaky padding subtest of empty-elements-insertion.html. Bug: 40547104 Change-Id: I736c63ccc7ccfefbc84f38ab16063a022535e5e4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7866236 Reviewed-by: Kent Tamura <tkent@chromium.org> Commit-Queue: Shweta Bindal <shwetabindal@microsoft.com> Cr-Commit-Position: refs/heads/main@{#1651514} -- wpt-commits: ef7b47fa94264ec6567d66769c1ab3298f6e8127 wpt-pr: 60851
35 lines
1.3 KiB
HTML
35 lines
1.3 KiB
HTML
<!DOCTYPE HTML>
|
|
<meta charset=utf-8>
|
|
<title>Placing selection and typing inside an empty element styled with padding</title>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/resources/testdriver.js"></script>
|
|
<script src="/resources/testdriver-vendor.js"></script>
|
|
<script src="/resources/testdriver-actions.js"></script>
|
|
<script src="../include/editor-test-utils.js"></script>
|
|
<style>
|
|
#padding {
|
|
display: inline-block;
|
|
padding: 1em;
|
|
}
|
|
</style>
|
|
<div contenteditable></div>
|
|
|
|
<script>
|
|
const utils = new EditorTestUtils( document.querySelector( 'div[contenteditable]' ) );
|
|
|
|
promise_test( async () => {
|
|
utils.setupEditingHost( `<p><strong id="padding"></strong></p>` );
|
|
|
|
const target = document.querySelector( '#padding' );
|
|
const actions = new test_driver.Actions();
|
|
await actions
|
|
.pointerMove( 0, 0, { origin: target } )
|
|
.pointerDown( { button: actions.ButtonType.LEFT } )
|
|
.pointerUp( { button: actions.ButtonType.LEFT } )
|
|
.send();
|
|
document.execCommand( 'insertText', false, 'a' );
|
|
assert_greater_than( target.innerHTML.length, 0, 'The text should be inserted into the styled <strong> element' );
|
|
}, 'Insert text into the inline element styled with padding' );
|
|
</script>
|