Title: [272299] trunk/Source/WebCore
Revision
272299
Author
[email protected]
Date
2021-02-02 23:14:23 -0800 (Tue, 02 Feb 2021)

Log Message

Avoid a virtual function call in HTMLFormControlElement::isDisabledOrReadOnly()
https://bugs.webkit.org/show_bug.cgi?id=221319

Reviewed by Wenson Hsieh.

Avoid calling isDisabledFormControl() which is a virtual function on Element.
HTMLFormControlElement is the only class in its hierarchy that implements this,
so we can just copy its implementation.

* html/HTMLFormControlElement.h:
(WebCore::HTMLFormControlElement::isDisabledOrReadOnly const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (272298 => 272299)


--- trunk/Source/WebCore/ChangeLog	2021-02-03 07:08:44 UTC (rev 272298)
+++ trunk/Source/WebCore/ChangeLog	2021-02-03 07:14:23 UTC (rev 272299)
@@ -1,5 +1,19 @@
 2021-02-02  Simon Fraser  <[email protected]>
 
+        Avoid a virtual function call in HTMLFormControlElement::isDisabledOrReadOnly()
+        https://bugs.webkit.org/show_bug.cgi?id=221319
+
+        Reviewed by Wenson Hsieh.
+
+        Avoid calling isDisabledFormControl() which is a virtual function on Element.
+        HTMLFormControlElement is the only class in its hierarchy that implements this,
+        so we can just copy its implementation.
+
+        * html/HTMLFormControlElement.h:
+        (WebCore::HTMLFormControlElement::isDisabledOrReadOnly const):
+
+2021-02-02  Simon Fraser  <[email protected]>
+
         Avoid a virtual function call in HTMLInputElement::value()
         https://bugs.webkit.org/show_bug.cgi?id=221318
 

Modified: trunk/Source/WebCore/html/HTMLFormControlElement.h (272298 => 272299)


--- trunk/Source/WebCore/html/HTMLFormControlElement.h	2021-02-03 07:08:44 UTC (rev 272298)
+++ trunk/Source/WebCore/html/HTMLFormControlElement.h	2021-02-03 07:14:23 UTC (rev 272299)
@@ -113,7 +113,7 @@
     void setCustomValidity(const String&) override;
 
     bool isReadOnly() const { return m_isReadOnly; }
-    bool isDisabledOrReadOnly() const { return isDisabledFormControl() || m_isReadOnly; }
+    bool isDisabledOrReadOnly() const { return m_disabled || m_disabledByAncestorFieldset || m_isReadOnly; }
 
     bool hasAutofocused() { return m_hasAutofocused; }
     void setAutofocused() { m_hasAutofocused = true; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to