Skip to content

Commit

Permalink
Reland "Make input element UA shadow tree creation lazy"
Browse files Browse the repository at this point in the history
This is a reland of commit 259286fb5706438088c858361ff942239598ea3b

Diff:
third_party/blink/renderer/core/html/forms/text_field_input_type.cc::UpdatePlaceholderText
If the placeholder is not null, we should ensure the shadow subtree has been constructed and update the placeholder text instead of just return here if the shadow subtree is not built.

Original change's description:
> Make input element UA shadow tree creation lazy
>
> This CL comes from WebCore https://trac.webkit.org/changeset/290639/webkit,
> it claims 0.5% progression on Speedometer2, the chromium pinpoint result
> shows a 0.6% progression on Speedometer2.
>
> This CL lazy create shadow subtree until one of the following happens:
> 1. the element is inserted into the document
> 2. the type="" or value="" attributes are changed before the element is inserted into the document
> 3. any DOM methods that need access to the InnerEditorElement() are called on the element before the element is inserted into the document
>
>
> Change-Id: I5fd6743182d65be7e00fcb59480a5b28af289b76
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4111088
> Commit-Queue: Xiaocheng Hu <[email protected]>
> Reviewed-by: Xiaocheng Hu <[email protected]>
> Cr-Commit-Position: refs/heads/main@{#1110526}

Change-Id: Ie6657cce1e1edc381b494709af25f2a2243b9714
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4330348
Reviewed-by: Xiaocheng Hu <[email protected]>
Commit-Queue: Xiaocheng Hu <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1117160}
  • Loading branch information
Bin Liao authored and chromium-wpt-export-bot committed Mar 14, 2023
1 parent 444a206 commit 597c968
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!DOCTYPE html>
<input value="content">
14 changes: 14 additions & 0 deletions html/semantics/forms/the-input-element/placeholder-update.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<link rel="match" href="placeholder-update-ref.html">
<body>
<div id="app"></div>
<script>
const rootElement = document.getElementById("app");
const input = document.createElement("input");
input.placeholder = "placeholder";
input.value = "content";
rootElement.appendChild(input);
</script>
</body>
</html>

0 comments on commit 597c968

Please sign in to comment.