Title: [291028] trunk/Source/WebCore
Revision
291028
Author
[email protected]
Date
2022-03-08 18:58:53 -0800 (Tue, 08 Mar 2022)

Log Message

Skip scheduling lazy UA shadow tree creation if already created or not needed
https://bugs.webkit.org/show_bug.cgi?id=237546
<rdar://problem/89922896>

Reviewed by Aditya Keerthi.

Bug 236747 made <input> element UA shadow trees get created lazily.
HTMLInputElement::insertedIntoAncestor now schedules the UA shadow tree
to be created the next time style is flushed. We currently do this every
time an <input> element is inserted into the document, but there's only
a need to do this if the particular input type needs a shadow tree and
we haven't already created it.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::insertedIntoAncestor):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (291027 => 291028)


--- trunk/Source/WebCore/ChangeLog	2022-03-09 02:56:37 UTC (rev 291027)
+++ trunk/Source/WebCore/ChangeLog	2022-03-09 02:58:53 UTC (rev 291028)
@@ -1,3 +1,21 @@
+2022-03-08  Cameron McCormack  <[email protected]>
+
+        Skip scheduling lazy UA shadow tree creation if already created or not needed
+        https://bugs.webkit.org/show_bug.cgi?id=237546
+        <rdar://problem/89922896>
+
+        Reviewed by Aditya Keerthi.
+
+        Bug 236747 made <input> element UA shadow trees get created lazily.
+        HTMLInputElement::insertedIntoAncestor now schedules the UA shadow tree
+        to be created the next time style is flushed. We currently do this every
+        time an <input> element is inserted into the document, but there's only
+        a need to do this if the particular input type needs a shadow tree and
+        we haven't already created it.
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::insertedIntoAncestor):
+
 2022-03-08  Jean-Yves Avenard  <[email protected]>
 
         Split SourceBufferParserWebM and have platform agnostic WebMParser

Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (291027 => 291028)


--- trunk/Source/WebCore/html/HTMLInputElement.cpp	2022-03-09 02:56:37 UTC (rev 291027)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp	2022-03-09 02:58:53 UTC (rev 291028)
@@ -1574,7 +1574,7 @@
 #endif
     if (isRadioButton())
         updateValidity();
-    if (insertionType.connectedToDocument && !m_hasPendingUserAgentShadowTreeUpdate) {
+    if (insertionType.connectedToDocument && m_inputType->needsShadowSubtree() && !m_inputType->hasCreatedShadowSubtree() && !m_hasPendingUserAgentShadowTreeUpdate) {
         document().addElementWithPendingUserAgentShadowTreeUpdate(*this);
         m_hasPendingUserAgentShadowTreeUpdate = true;
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to