Title: [273757] branches/safari-611.1.21.1-branch/Source/WebCore
Revision
273757
Author
[email protected]
Date
2021-03-02 13:13:00 -0800 (Tue, 02 Mar 2021)

Log Message

Apply patch. rdar://problem/74944301

Modified Paths


Diff

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/ChangeLog (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/ChangeLog	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/ChangeLog	2021-03-02 21:13:00 UTC (rev 273757)
@@ -1,3 +1,462 @@
+2021-03-02  Alan Coon  <[email protected]>
+
+        Apply patch. rdar://problem/74944301
+
+    2021-03-02  Ryosuke Niwa  <[email protected]>
+
+            Merge r272331. <rdar://problem/74901291>
+
+        Optimize PointerCaptureController::elementWasRemoved()
+        https://bugs.webkit.org/show_bug.cgi?id=221316
+
+        Reviewed by Ryosuke Niwa.
+
+        Speedometer profiles show HashTable iteration code under PointerCaptureController::elementWasRemoved()
+        because we always add a hash entry for the mouse pointer.
+
+        Optimize away by setting a flag that's only true if any element is referenced by pointer capture.
+
+        * page/PointerCaptureController.cpp:
+        (WebCore::PointerCaptureController::pointerCaptureElement const):
+        (WebCore::PointerCaptureController::setPointerCapture):
+        (WebCore::PointerCaptureController::releasePointerCapture):
+        (WebCore::PointerCaptureController::hasPointerCapture):
+        (WebCore::PointerCaptureController::pointerLockWasApplied):
+        (WebCore::PointerCaptureController::elementWasRemoved):
+        (WebCore::PointerCaptureController::reset):
+        (WebCore::PointerCaptureController::updateHaveAnyCapturingElement):
+        (WebCore::PointerCaptureController::touchWithIdentifierWasRemoved):
+        (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier const):
+        (WebCore::PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier const):
+        (WebCore::PointerCaptureController::pointerCaptureElement): Deleted.
+        (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier): Deleted.
+        (WebCore::PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier): Deleted.
+        * page/PointerCaptureController.h:
+
+        2021-02-03  Simon Fraser  <[email protected]>
+
+                Optimize PointerCaptureController::elementWasRemoved()
+                https://bugs.webkit.org/show_bug.cgi?id=221316
+
+                Reviewed by Ryosuke Niwa.
+
+                Speedometer profiles show HashTable iteration code under PointerCaptureController::elementWasRemoved()
+                because we always add a hash entry for the mouse pointer.
+
+                Optimize away by setting a flag that's only true if any element is referenced by pointer capture.
+
+                * page/PointerCaptureController.cpp:
+                (WebCore::PointerCaptureController::pointerCaptureElement const):
+                (WebCore::PointerCaptureController::setPointerCapture):
+                (WebCore::PointerCaptureController::releasePointerCapture):
+                (WebCore::PointerCaptureController::hasPointerCapture):
+                (WebCore::PointerCaptureController::pointerLockWasApplied):
+                (WebCore::PointerCaptureController::elementWasRemoved):
+                (WebCore::PointerCaptureController::reset):
+                (WebCore::PointerCaptureController::updateHaveAnyCapturingElement):
+                (WebCore::PointerCaptureController::touchWithIdentifierWasRemoved):
+                (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier const):
+                (WebCore::PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier const):
+                (WebCore::PointerCaptureController::pointerCaptureElement): Deleted.
+                (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier): Deleted.
+                (WebCore::PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier): Deleted.
+                * page/PointerCaptureController.h:
+
+2021-03-01  Ryosuke Niwa  <[email protected]>
+
+        Merge r272299. <rdar://problem/73917813>
+
+    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 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-03-01  Ryosuke Niwa  <[email protected]>
+
+        Merge r272298. <rdar://problem/73917640>
+
+    Avoid a virtual function call in HTMLInputElement::value()
+    https://bugs.webkit.org/show_bug.cgi?id=221318
+
+    Reviewed by Wenson Hsieh.
+
+    Only file upload controls override getTypeSpecificValue(), so to avoid a virtual
+    function call, check the type first via canHaveTypeSpecificValue().
+
+    * html/HTMLInputElement.cpp:
+    (WebCore::HTMLInputElement::value const):
+    * html/InputType.h:
+    (WebCore::InputType::canHaveTypeSpecificValue 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
+
+            Reviewed by Wenson Hsieh.
+
+            Only file upload controls override getTypeSpecificValue(), so to avoid a virtual
+            function call, check the type first via canHaveTypeSpecificValue().
+
+            * html/HTMLInputElement.cpp:
+            (WebCore::HTMLInputElement::value const):
+            * html/InputType.h:
+            (WebCore::InputType::canHaveTypeSpecificValue const):
+
+2021-03-01  Ryosuke Niwa  <[email protected]>
+
+        Merge r272180. <rdar://problem/74901291>
+
+    Devirtualize InputType::supportsValidation()
+    https://bugs.webkit.org/show_bug.cgi?id=221216
+
+    Reviewed by Yusuke Suzuki.
+
+    InputType::supportsValidation() can just check the type. Use an OptionSet<> of exclusions
+    for clarity.
+
+    * html/ButtonInputType.cpp:
+    (WebCore::ButtonInputType::supportsValidation const): Deleted.
+    * html/ButtonInputType.h:
+    * html/HiddenInputType.cpp:
+    (WebCore::HiddenInputType::supportsValidation const): Deleted.
+    * html/HiddenInputType.h:
+    * html/ImageInputType.cpp:
+    (WebCore::ImageInputType::supportsValidation const): Deleted.
+    * html/ImageInputType.h:
+    * html/InputType.cpp:
+    (WebCore::InputType::supportsValidation const): Deleted.
+    * html/InputType.h:
+    (WebCore::InputType::supportsValidation const):
+    * html/ResetInputType.cpp:
+    (WebCore::ResetInputType::supportsValidation const): Deleted.
+    * html/ResetInputType.h:
+
+    2021-02-01  Simon Fraser  <[email protected]>
+
+            Devirtualize InputType::supportsValidation()
+            https://bugs.webkit.org/show_bug.cgi?id=221216
+
+            Reviewed by Yusuke Suzuki.
+
+            InputType::supportsValidation() can just check the type. Use an OptionSet<> of exclusions
+            for clarity.
+
+            * html/ButtonInputType.cpp:
+            (WebCore::ButtonInputType::supportsValidation const): Deleted.
+            * html/ButtonInputType.h:
+            * html/HiddenInputType.cpp:
+            (WebCore::HiddenInputType::supportsValidation const): Deleted.
+            * html/HiddenInputType.h:
+            * html/ImageInputType.cpp:
+            (WebCore::ImageInputType::supportsValidation const): Deleted.
+            * html/ImageInputType.h:
+            * html/InputType.cpp:
+            (WebCore::InputType::supportsValidation const): Deleted.
+            * html/InputType.h:
+            (WebCore::InputType::supportsValidation const):
+            * html/ResetInputType.cpp:
+            (WebCore::ResetInputType::supportsValidation const): Deleted.
+            * html/ResetInputType.h:
+
+2021-03-01  Ryosuke Niwa  <[email protected]>
+
+        Merge r272097. <rdar://problem/73781798>
+
+    Devirtualize some functions on InputType
+    https://bugs.webkit.org/show_bug.cgi?id=221121
+
+    Reviewed by Yusuke Suzuki.
+
+    Virtual functions on InputType show up in Speedometer profiles. We can make
+    many of these virtual functions non-virtual by just switching on the input type.
+
+    * dom/Element.cpp:
+    * html/BaseCheckableInputType.cpp:
+    (WebCore::BaseCheckableInputType::isCheckable): Deleted.
+    * html/BaseCheckableInputType.h:
+    * html/BaseTextInputType.cpp:
+    (WebCore::BaseTextInputType::isTextType const): Deleted.
+    * html/BaseTextInputType.h:
+    * html/ButtonInputType.cpp:
+    (WebCore::ButtonInputType::isTextButton const): Deleted.
+    * html/ButtonInputType.h:
+    * html/CheckboxInputType.cpp:
+    (WebCore::CheckboxInputType::isCheckbox const): Deleted.
+    * html/CheckboxInputType.h:
+    * html/ColorInputType.cpp:
+    (WebCore::ColorInputType::isColorControl const): Deleted.
+    * html/ColorInputType.h:
+    * html/DateInputType.cpp:
+    (WebCore::DateInputType::isDateField const): Deleted.
+    * html/DateInputType.h:
+    * html/DateTimeLocalInputType.cpp:
+    (WebCore::DateTimeLocalInputType::isDateTimeLocalField const): Deleted.
+    * html/DateTimeLocalInputType.h:
+    * html/EmailInputType.cpp:
+    (WebCore::EmailInputType::isEmailField const): Deleted.
+    * html/EmailInputType.h:
+    * html/FileInputType.cpp:
+    (WebCore::FileInputType::isFileUpload const): Deleted.
+    * html/FileInputType.h:
+    * html/FormAssociatedElement.h:
+    * html/HTMLFormControlElement.h:
+    * html/HiddenInputType.cpp:
+    (WebCore::HiddenInputType::isHiddenType const): Deleted.
+    * html/HiddenInputType.h:
+    * html/ImageInputType.cpp:
+    (WebCore::ImageInputType::isImageButton const): Deleted.
+    (WebCore::ImageInputType::isEnumeratable): Deleted.
+    * html/ImageInputType.h:
+    * html/InputType.cpp:
+    (WebCore::InputType::isTextType const):
+    (WebCore::InputType::isTextField const):
+    (WebCore::InputType::isTextButton const):
+    (WebCore::InputType::isInteractiveContent const):
+    (WebCore::InputType::supportLabels const):
+    (WebCore::InputType::isEnumeratable):
+    (WebCore::InputType::isCheckable):
+    (WebCore::InputType::isRangeControl const): Deleted.
+    (WebCore::InputType::isRadioButton const): Deleted.
+    (WebCore::InputType::isSearchField const): Deleted.
+    (WebCore::InputType::isHiddenType const): Deleted.
+    (WebCore::InputType::isPasswordField const): Deleted.
+    (WebCore::InputType::isCheckbox const): Deleted.
+    (WebCore::InputType::isEmailField const): Deleted.
+    (WebCore::InputType::isFileUpload const): Deleted.
+    (WebCore::InputType::isImageButton const): Deleted.
+    (WebCore::InputType::isNumberField const): Deleted.
+    (WebCore::InputType::isSubmitButton const): Deleted.
+    (WebCore::InputType::isTelephoneField const): Deleted.
+    (WebCore::InputType::isURLField const): Deleted.
+    (WebCore::InputType::isDateField const): Deleted.
+    (WebCore::InputType::isDateTimeField const): Deleted.
+    (WebCore::InputType::isDateTimeLocalField const): Deleted.
+    (WebCore::InputType::isMonthField const): Deleted.
+    (WebCore::InputType::isTimeField const): Deleted.
+    (WebCore::InputType::isWeekField const): Deleted.
+    (WebCore::InputType::isColorControl const): Deleted.
+    * html/InputType.h:
+    (WebCore::InputType::isCheckbox const):
+    (WebCore::InputType::isColorControl const):
+    (WebCore::InputType::isDateField const):
+    (WebCore::InputType::isDateTimeField const):
+    (WebCore::InputType::isDateTimeLocalField const):
+    (WebCore::InputType::isEmailField const):
+    (WebCore::InputType::isFileUpload const):
+    (WebCore::InputType::isHiddenType const):
+    (WebCore::InputType::isImageButton const):
+    (WebCore::InputType::isMonthField const):
+    (WebCore::InputType::isNumberField const):
+    (WebCore::InputType::isPasswordField const):
+    (WebCore::InputType::isRadioButton const):
+    (WebCore::InputType::isRangeControl const):
+    (WebCore::InputType::isSearchField const):
+    (WebCore::InputType::isSubmitButton const):
+    (WebCore::InputType::isTelephoneField const):
+    (WebCore::InputType::isTimeField const):
+    (WebCore::InputType::isURLField const):
+    (WebCore::InputType::isWeekField const):
+    * html/MonthInputType.cpp:
+    (WebCore::MonthInputType::isMonthField const): Deleted.
+    * html/MonthInputType.h:
+    * html/NumberInputType.cpp:
+    (WebCore::NumberInputType::isNumberField const): Deleted.
+    * html/NumberInputType.h:
+    * html/PasswordInputType.cpp:
+    (WebCore::PasswordInputType::isPasswordField const): Deleted.
+    * html/PasswordInputType.h:
+    * html/RadioInputType.cpp:
+    (WebCore::RadioInputType::isRadioButton const): Deleted.
+    * html/RadioInputType.h:
+    * html/RangeInputType.cpp:
+    (WebCore::RangeInputType::isRangeControl const): Deleted.
+    * html/RangeInputType.h:
+    * html/ResetInputType.cpp:
+    (WebCore::ResetInputType::isTextButton const): Deleted.
+    * html/ResetInputType.h:
+    * html/SearchInputType.cpp:
+    (WebCore::SearchInputType::isSearchField const): Deleted.
+    * html/SearchInputType.h:
+    * html/SubmitInputType.cpp:
+    (WebCore::SubmitInputType::isSubmitButton const): Deleted.
+    (WebCore::SubmitInputType::isTextButton const): Deleted.
+    * html/SubmitInputType.h:
+    * html/TelephoneInputType.cpp:
+    (WebCore::TelephoneInputType::isTelephoneField const): Deleted.
+    * html/TelephoneInputType.h:
+    * html/TextFieldInputType.cpp:
+    (WebCore::TextFieldInputType::isTextField const): Deleted.
+    * html/TextFieldInputType.h:
+    * html/TimeInputType.cpp:
+    (WebCore::TimeInputType::isTimeField const): Deleted.
+    * html/TimeInputType.h:
+    * html/URLInputType.cpp:
+    (WebCore::URLInputType::isURLField const): Deleted.
+    * html/URLInputType.h:
+    * html/WeekInputType.cpp:
+    (WebCore::WeekInputType::isWeekField const): Deleted.
+    * html/WeekInputType.h:
+
+    2021-01-29  Simon Fraser  <[email protected]>
+
+            Devirtualize some functions on InputType
+            https://bugs.webkit.org/show_bug.cgi?id=221121
+
+            Reviewed by Yusuke Suzuki.
+
+            Virtual functions on InputType show up in Speedometer profiles. We can make
+            many of these virtual functions non-virtual by just switching on the input type.
+
+            * dom/Element.cpp:
+            * html/BaseCheckableInputType.cpp:
+            (WebCore::BaseCheckableInputType::isCheckable): Deleted.
+            * html/BaseCheckableInputType.h:
+            * html/BaseTextInputType.cpp:
+            (WebCore::BaseTextInputType::isTextType const): Deleted.
+            * html/BaseTextInputType.h:
+            * html/ButtonInputType.cpp:
+            (WebCore::ButtonInputType::isTextButton const): Deleted.
+            * html/ButtonInputType.h:
+            * html/CheckboxInputType.cpp:
+            (WebCore::CheckboxInputType::isCheckbox const): Deleted.
+            * html/CheckboxInputType.h:
+            * html/ColorInputType.cpp:
+            (WebCore::ColorInputType::isColorControl const): Deleted.
+            * html/ColorInputType.h:
+            * html/DateInputType.cpp:
+            (WebCore::DateInputType::isDateField const): Deleted.
+            * html/DateInputType.h:
+            * html/DateTimeLocalInputType.cpp:
+            (WebCore::DateTimeLocalInputType::isDateTimeLocalField const): Deleted.
+            * html/DateTimeLocalInputType.h:
+            * html/EmailInputType.cpp:
+            (WebCore::EmailInputType::isEmailField const): Deleted.
+            * html/EmailInputType.h:
+            * html/FileInputType.cpp:
+            (WebCore::FileInputType::isFileUpload const): Deleted.
+            * html/FileInputType.h:
+            * html/FormAssociatedElement.h:
+            * html/HTMLFormControlElement.h:
+            * html/HiddenInputType.cpp:
+            (WebCore::HiddenInputType::isHiddenType const): Deleted.
+            * html/HiddenInputType.h:
+            * html/ImageInputType.cpp:
+            (WebCore::ImageInputType::isImageButton const): Deleted.
+            (WebCore::ImageInputType::isEnumeratable): Deleted.
+            * html/ImageInputType.h:
+            * html/InputType.cpp:
+            (WebCore::InputType::isTextType const):
+            (WebCore::InputType::isTextField const):
+            (WebCore::InputType::isTextButton const):
+            (WebCore::InputType::isInteractiveContent const):
+            (WebCore::InputType::supportLabels const):
+            (WebCore::InputType::isEnumeratable):
+            (WebCore::InputType::isCheckable):
+            (WebCore::InputType::isRangeControl const): Deleted.
+            (WebCore::InputType::isRadioButton const): Deleted.
+            (WebCore::InputType::isSearchField const): Deleted.
+            (WebCore::InputType::isHiddenType const): Deleted.
+            (WebCore::InputType::isPasswordField const): Deleted.
+            (WebCore::InputType::isCheckbox const): Deleted.
+            (WebCore::InputType::isEmailField const): Deleted.
+            (WebCore::InputType::isFileUpload const): Deleted.
+            (WebCore::InputType::isImageButton const): Deleted.
+            (WebCore::InputType::isNumberField const): Deleted.
+            (WebCore::InputType::isSubmitButton const): Deleted.
+            (WebCore::InputType::isTelephoneField const): Deleted.
+            (WebCore::InputType::isURLField const): Deleted.
+            (WebCore::InputType::isDateField const): Deleted.
+            (WebCore::InputType::isDateTimeField const): Deleted.
+            (WebCore::InputType::isDateTimeLocalField const): Deleted.
+            (WebCore::InputType::isMonthField const): Deleted.
+            (WebCore::InputType::isTimeField const): Deleted.
+            (WebCore::InputType::isWeekField const): Deleted.
+            (WebCore::InputType::isColorControl const): Deleted.
+            * html/InputType.h:
+            (WebCore::InputType::isCheckbox const):
+            (WebCore::InputType::isColorControl const):
+            (WebCore::InputType::isDateField const):
+            (WebCore::InputType::isDateTimeField const):
+            (WebCore::InputType::isDateTimeLocalField const):
+            (WebCore::InputType::isEmailField const):
+            (WebCore::InputType::isFileUpload const):
+            (WebCore::InputType::isHiddenType const):
+            (WebCore::InputType::isImageButton const):
+            (WebCore::InputType::isMonthField const):
+            (WebCore::InputType::isNumberField const):
+            (WebCore::InputType::isPasswordField const):
+            (WebCore::InputType::isRadioButton const):
+            (WebCore::InputType::isRangeControl const):
+            (WebCore::InputType::isSearchField const):
+            (WebCore::InputType::isSubmitButton const):
+            (WebCore::InputType::isTelephoneField const):
+            (WebCore::InputType::isTimeField const):
+            (WebCore::InputType::isURLField const):
+            (WebCore::InputType::isWeekField const):
+            * html/MonthInputType.cpp:
+            (WebCore::MonthInputType::isMonthField const): Deleted.
+            * html/MonthInputType.h:
+            * html/NumberInputType.cpp:
+            (WebCore::NumberInputType::isNumberField const): Deleted.
+            * html/NumberInputType.h:
+            * html/PasswordInputType.cpp:
+            (WebCore::PasswordInputType::isPasswordField const): Deleted.
+            * html/PasswordInputType.h:
+            * html/RadioInputType.cpp:
+            (WebCore::RadioInputType::isRadioButton const): Deleted.
+            * html/RadioInputType.h:
+            * html/RangeInputType.cpp:
+            (WebCore::RangeInputType::isRangeControl const): Deleted.
+            * html/RangeInputType.h:
+            * html/ResetInputType.cpp:
+            (WebCore::ResetInputType::isTextButton const): Deleted.
+            * html/ResetInputType.h:
+            * html/SearchInputType.cpp:
+            (WebCore::SearchInputType::isSearchField const): Deleted.
+            * html/SearchInputType.h:
+            * html/SubmitInputType.cpp:
+            (WebCore::SubmitInputType::isSubmitButton const): Deleted.
+            (WebCore::SubmitInputType::isTextButton const): Deleted.
+            * html/SubmitInputType.h:
+            * html/TelephoneInputType.cpp:
+            (WebCore::TelephoneInputType::isTelephoneField const): Deleted.
+            * html/TelephoneInputType.h:
+            * html/TextFieldInputType.cpp:
+            (WebCore::TextFieldInputType::isTextField const): Deleted.
+            * html/TextFieldInputType.h:
+            * html/TimeInputType.cpp:
+            (WebCore::TimeInputType::isTimeField const): Deleted.
+            * html/TimeInputType.h:
+            * html/URLInputType.cpp:
+            (WebCore::URLInputType::isURLField const): Deleted.
+            * html/URLInputType.h:
+            * html/WeekInputType.cpp:
+            (WebCore::WeekInputType::isWeekField const): Deleted.
+            * html/WeekInputType.h:
+
 2021-03-01  Alan Coon  <[email protected]>
 
         Cherry-pick r273564. rdar://problem/74886917

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/dom/Element.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/dom/Element.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/dom/Element.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -3220,7 +3220,6 @@
     return { };
 }
 
-
 ExceptionOr<void> Element::setInnerHTML(const String& html)
 {
     auto fragment = createFragmentForInnerOuterHTML(*this, html, AllowScriptingContent);

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/BaseCheckableInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/BaseCheckableInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/BaseCheckableInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -114,11 +114,6 @@
     element()->setAttributeWithoutSynchronization(valueAttr, sanitizedValue);
 }
 
-bool BaseCheckableInputType::isCheckable()
-{
-    return true;
-}
-
 void BaseCheckableInputType::fireInputAndChangeEvents()
 {
     if (!element()->isConnected())

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/BaseCheckableInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/BaseCheckableInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/BaseCheckableInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -51,7 +51,6 @@
     String fallbackValue() const override;
     bool storesValueSeparateFromAttribute() override;
     void setValue(const String&, bool, TextFieldEventBehavior) override;
-    bool isCheckable() override;
 };
 
 } // namespace WebCore

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/BaseDateAndTimeInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/BaseDateAndTimeInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/BaseDateAndTimeInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -169,11 +169,6 @@
     return Decimal::fromDouble(ms + (offset * msPerMinute));
 }
 
-bool BaseDateAndTimeInputType::isSteppableSlow() const
-{
-    return true;
-}
-
 Decimal BaseDateAndTimeInputType::parseToNumber(const String& source, const Decimal& defaultValue) const
 {
     auto date = parseToDateComponents(source);

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/BaseDateAndTimeInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/BaseDateAndTimeInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/BaseDateAndTimeInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -102,7 +102,6 @@
     double valueAsDouble() const final;
     ExceptionOr<void> setValueAsDecimal(const Decimal&, TextFieldEventBehavior) const final;
     Decimal defaultValueForStepUp() const override;
-    bool isSteppableSlow() const final;
     String localizeValue(const String&) const final;
     bool supportsReadOnly() const final;
     bool shouldRespectListAttribute() final;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/BaseTextInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/BaseTextInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/BaseTextInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -33,11 +33,6 @@
 
 using namespace HTMLNames;
 
-bool BaseTextInputType::isTextType() const
-{
-    return true;
-}
-
 bool BaseTextInputType::patternMismatch(const String& value) const
 {
     ASSERT(element());

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/BaseTextInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/BaseTextInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/BaseTextInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -40,7 +40,6 @@
 protected:
     explicit BaseTextInputType(Type type, HTMLInputElement& element) : TextFieldInputType(type, element) { }
 
-    bool isTextType() const override;
     bool patternMismatch(const String&) const override;
     bool supportsPlaceholder() const override;
     bool supportsSelectionAPI() const override;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/ButtonInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/ButtonInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/ButtonInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -40,14 +40,4 @@
     return InputTypeNames::button();
 }
 
-bool ButtonInputType::supportsValidation() const
-{
-    return false;
-}
-
-bool ButtonInputType::isTextButton() const
-{
-    return true;
-}
-
 } // namespace WebCore

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/ButtonInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/ButtonInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/ButtonInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -41,8 +41,6 @@
 
 private:
     const AtomString& formControlType() const override;
-    bool supportsValidation() const override;
-    bool isTextButton() const override;
 };
 
 } // namespace WebCore

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/CheckboxInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/CheckboxInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/CheckboxInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -92,11 +92,6 @@
     event.setDefaultHandled();
 }
 
-bool CheckboxInputType::isCheckbox() const
-{
-    return true;
-}
-
 bool CheckboxInputType::matchesIndeterminatePseudoClass() const
 {
     return shouldAppearIndeterminate();

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/CheckboxInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/CheckboxInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/CheckboxInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -46,7 +46,6 @@
     void handleKeyupEvent(KeyboardEvent&) final;
     void willDispatchClick(InputElementClickState&) final;
     void didDispatchClick(Event&, const InputElementClickState&) final;
-    bool isCheckbox() const final;
     bool matchesIndeterminatePseudoClass() const final;
     bool shouldAppearIndeterminate() const final;
 };

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/ColorInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/ColorInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/ColorInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -100,11 +100,6 @@
 #endif
 }
 
-bool ColorInputType::isColorControl() const
-{
-    return true;
-}
-
 bool ColorInputType::isPresentingAttachedView() const
 {
     return !!m_chooser;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/ColorInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/ColorInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/ColorInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -52,7 +52,6 @@
     Vector<Color> suggestedColors() const final;
     bool isMouseFocusable() const final;
     bool isKeyboardFocusable(KeyboardEvent*) const final;
-    bool isColorControl() const final;
     bool isPresentingAttachedView() const final;
     const AtomString& formControlType() const final;
     bool supportsRequired() const final;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/DateInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/DateInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/DateInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -84,11 +84,6 @@
     return DateComponents::fromMillisecondsSinceEpochForDate(value);
 }
 
-bool DateInputType::isDateField() const
-{
-    return true;
-}
-
 bool DateInputType::isValidFormat(OptionSet<DateTimeFormatValidationResults> results) const
 {
     return results.containsAll({ DateTimeFormatValidationResults::HasYear, DateTimeFormatValidationResults::HasMonth, DateTimeFormatValidationResults::HasDay });

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/DateInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/DateInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/DateInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -47,7 +47,6 @@
     StepRange createStepRange(AnyStepHandling) const override;
     Optional<DateComponents> parseToDateComponents(const StringView&) const override;
     Optional<DateComponents> setMillisecondToDateComponents(double) const override;
-    bool isDateField() const override;
 
     bool isValidFormat(OptionSet<DateTimeFormatValidationResults>) const final;
     String formatDateTimeFieldsState(const DateTimeFieldsState&) const final;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/DateTimeLocalInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/DateTimeLocalInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/DateTimeLocalInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -93,11 +93,6 @@
     return DateComponents::fromMillisecondsSinceEpochForDateTimeLocal(value);
 }
 
-bool DateTimeLocalInputType::isDateTimeLocalField() const
-{
-    return true;
-}
-
 bool DateTimeLocalInputType::isValidFormat(OptionSet<DateTimeFormatValidationResults> results) const
 {
     return results.containsAll({ DateTimeFormatValidationResults::HasYear, DateTimeFormatValidationResults::HasMonth, DateTimeFormatValidationResults::HasDay, DateTimeFormatValidationResults::HasHour, DateTimeFormatValidationResults::HasMinute, DateTimeFormatValidationResults::HasMeridiem });

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/DateTimeLocalInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/DateTimeLocalInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/DateTimeLocalInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -52,7 +52,6 @@
     StepRange createStepRange(AnyStepHandling) const final;
     Optional<DateComponents> parseToDateComponents(const StringView&) const final;
     Optional<DateComponents> setMillisecondToDateComponents(double) const final;
-    bool isDateTimeLocalField() const final;
 
     bool isValidFormat(OptionSet<DateTimeFormatValidationResults>) const final;
     String formatDateTimeFieldsState(const DateTimeFieldsState&) const final;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/EmailInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/EmailInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/EmailInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -83,11 +83,6 @@
     return element()->multiple() ? validationMessageTypeMismatchForMultipleEmailText() : validationMessageTypeMismatchForEmailText();
 }
 
-bool EmailInputType::isEmailField() const
-{
-    return true;
-}
-
 bool EmailInputType::supportsSelectionAPI() const
 {
     return false;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/EmailInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/EmailInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/EmailInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -44,7 +44,6 @@
     bool typeMismatchFor(const String&) const override;
     bool typeMismatch() const override;
     String typeMismatchText() const override;
-    bool isEmailField() const override;
     bool supportsSelectionAPI() const override;
     String sanitizeValue(const String&) const override;
 };

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/FileInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/FileInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/FileInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -273,11 +273,6 @@
     element()->invalidateStyleForSubtree();
 }
 
-bool FileInputType::isFileUpload() const
-{
-    return true;
-}
-
 void FileInputType::createShadowSubtreeAndUpdateInnerTextElementEditability(ContainerNode::ChildChange::Source source, bool)
 {
     ASSERT(element());

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/FileInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/FileInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/FileInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -77,7 +77,6 @@
 #endif
 
     Icon* icon() const final;
-    bool isFileUpload() const final;
     void createShadowSubtreeAndUpdateInnerTextElementEditability(ContainerNode::ChildChange::Source, bool) final;
     void disabledStateChanged() final;
     void attributeChanged(const QualifiedName&) final;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/FormAssociatedElement.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/FormAssociatedElement.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/FormAssociatedElement.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -110,6 +110,7 @@
     String customValidationMessage() const;
 
 private:
+    // "willValidate" means "is a candidate for constraint validation".
     virtual bool willValidate() const = 0;
     virtual void refFormAssociatedElement() = 0;
     virtual void derefFormAssociatedElement() = 0;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/HTMLFormControlElement.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/HTMLFormControlElement.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/HTMLFormControlElement.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -100,6 +100,7 @@
     WEBCORE_EXPORT AutocapitalizeType autocapitalizeType() const final;
 #endif
 
+    // "willValidate" means "is a candidate for constraint validation".
     WEBCORE_EXPORT bool willValidate() const final;
     void updateVisibleValidationMessage();
     void hideVisibleValidationMessage();
@@ -113,7 +114,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; }

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/HTMLInputElement.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/HTMLInputElement.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/HTMLInputElement.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -1018,7 +1018,7 @@
 String HTMLInputElement::value() const
 {
     String value;
-    if (m_inputType->getTypeSpecificValue(value))
+    if (m_inputType->canHaveTypeSpecificValue() && m_inputType->getTypeSpecificValue(value))
         return value;
 
     value = m_valueIfDirty;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/HiddenInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/HiddenInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/HiddenInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -62,11 +62,6 @@
     element()->setAttributeWithoutSynchronization(valueAttr, state[0]);
 }
 
-bool HiddenInputType::supportsValidation() const
-{
-    return false;
-}
-
 RenderPtr<RenderElement> HiddenInputType::createInputRenderer(RenderStyle&&)
 {
     ASSERT_NOT_REACHED();
@@ -94,11 +89,6 @@
     element()->setAttributeWithoutSynchronization(valueAttr, sanitizedValue);
 }
 
-bool HiddenInputType::isHiddenType() const
-{
-    return true;
-}
-
 bool HiddenInputType::appendFormData(DOMFormData& formData, bool isMultipartForm) const
 {
     ASSERT(element());

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/HiddenInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/HiddenInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/HiddenInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -43,14 +43,10 @@
     const AtomString& formControlType() const override;
     FormControlState saveFormControlState() const override;
     void restoreFormControlState(const FormControlState&) override;
-    bool supportsValidation() const override;
     RenderPtr<RenderElement> createInputRenderer(RenderStyle&&) override;
     bool accessKeyAction(bool sendMouseEvents) override;
     bool rendererIsNeeded() override;
     bool storesValueSeparateFromAttribute() override;
-    bool isHiddenType() const override;
-    bool supportLabels() const override { return false; }
-    bool isInteractiveContent() const final { return false; }
     bool shouldRespectHeightAndWidthAttributes() override;
     void setValue(const String&, bool, TextFieldEventBehavior) override;
     bool appendFormData(DOMFormData&, bool) const override;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/ImageInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/ImageInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/ImageInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -77,11 +77,6 @@
     return true;
 }
 
-bool ImageInputType::supportsValidation() const
-{
-    return false;
-}
-
 void ImageInputType::handleDOMActivateEvent(Event& event)
 {
     ASSERT(element());
@@ -171,16 +166,6 @@
     return true;
 }
 
-bool ImageInputType::isImageButton() const
-{
-    return true;
-}
-
-bool ImageInputType::isEnumeratable()
-{
-    return false;
-}
-
 bool ImageInputType::shouldRespectHeightAndWidthAttributes()
 {
     return true;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/ImageInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/ImageInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/ImageInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -46,7 +46,6 @@
     const AtomString& formControlType() const final;
     bool isFormDataAppendable() const final;
     bool appendFormData(DOMFormData&, bool) const final;
-    bool supportsValidation() const final;
     RenderPtr<RenderElement> createInputRenderer(RenderStyle&&) final;
     void handleDOMActivateEvent(Event&) final;
     void attributeChanged(const QualifiedName&) final;
@@ -53,8 +52,6 @@
     void attach() final;
     bool shouldRespectAlignAttribute() final;
     bool canBeSuccessfulSubmitButton() final;
-    bool isImageButton() const final;
-    bool isEnumeratable() final;
     bool shouldRespectHeightAndWidthAttributes() final;
     unsigned height() const final;
     unsigned width() const final;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/InputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/InputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/InputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -166,21 +166,6 @@
     return RenderTheme::singleton().supportsDataListUI(type->formControlType());
 }
 
-bool InputType::isTextField() const
-{
-    return false;
-}
-
-bool InputType::isTextType() const
-{
-    return false;
-}
-
-bool InputType::isRangeControl() const
-{
-    return false;
-}
-
 bool InputType::shouldSaveAndRestoreFormControlState() const
 {
     return true;
@@ -241,11 +226,6 @@
     return Exception { InvalidStateError };
 }
 
-bool InputType::supportsValidation() const
-{
-    return true;
-}
-
 bool InputType::typeMismatchFor(const String&) const
 {
     return false;
@@ -816,145 +796,21 @@
     return false;
 }
 
-bool InputType::isTextButton() const
-{
-    return false;
-}
-
-bool InputType::isRadioButton() const
-{
-    return false;
-}
-
-bool InputType::isSearchField() const
-{
-    return false;
-}
-
-bool InputType::isHiddenType() const
-{
-    return false;
-}
-
-bool InputType::isPasswordField() const
-{
-    return false;
-}
-
-bool InputType::isCheckbox() const
-{
-    return false;
-}
-
-bool InputType::isEmailField() const
-{
-    return false;
-}
-
-bool InputType::isFileUpload() const
-{
-    return false;
-}
-
-bool InputType::isImageButton() const
-{
-    return false;
-}
-
 bool InputType::isInteractiveContent() const
 {
-    return true;
+    return m_type != Type::Hidden;
 }
 
 bool InputType::supportLabels() const
 {
-    return true;
+    return m_type != Type::Hidden;
 }
 
-bool InputType::isNumberField() const
+bool InputType::isEnumeratable() const
 {
-    return false;
+    return m_type != Type::Image;
 }
 
-bool InputType::isSubmitButton() const
-{
-    return false;
-}
-
-bool InputType::isTelephoneField() const
-{
-    return false;
-}
-
-bool InputType::isURLField() const
-{
-    return false;
-}
-
-bool InputType::isDateField() const
-{
-    return false;
-}
-
-bool InputType::isDateTimeField() const
-{
-    return false;
-}
-
-bool InputType::isDateTimeLocalField() const
-{
-    return false;
-}
-
-bool InputType::isMonthField() const
-{
-    return false;
-}
-
-bool InputType::isTimeField() const
-{
-    return false;
-}
-
-bool InputType::isWeekField() const
-{
-    return false;
-}
-
-bool InputType::isEnumeratable()
-{
-    return true;
-}
-
-bool InputType::isCheckable()
-{
-    return false;
-}
-
-// Do not use virtual function for performance reason.
-bool InputType::isSteppable() const
-{
-    switch (m_type) {
-    case Type::Date:
-    case Type::DateTimeLocal:
-    case Type::Month:
-    case Type::Time:
-    case Type::Week:
-    case Type::Number:
-    case Type::Range:
-        ASSERT(isSteppableSlow());
-        return true;
-    default:
-        ASSERT(!isSteppableSlow());
-        return false;
-    }
-}
-
-bool InputType::isColorControl() const
-{
-    return false;
-}
-
 bool InputType::shouldRespectHeightAndWidthAttributes()
 {
     return false;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/InputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/InputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/InputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -37,6 +37,7 @@
 #include "RenderPtr.h"
 #include <wtf/FastMalloc.h>
 #include <wtf/Forward.h>
+#include <wtf/OptionSet.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 
@@ -71,31 +72,78 @@
 class InputType : public RefCounted<InputType> {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    enum class Type : uint8_t {
-        Button,
-        Checkbox,
-        Color,
-        Date,
-        DateTimeLocal,
-        Email,
-        File,
-        Hidden,
-        Image,
-        Month,
-        Number,
-        Password,
-        Radio,
-        Range,
-        Reset,
-        Search,
-        Submit,
-        Telephone,
-        Time,
-        URL,
-        Week,
-        Text,
+    enum class Type : uint32_t {
+        Button          = 1 << 0,
+        Checkbox        = 1 << 1,
+        Color           = 1 << 2,
+        Date            = 1 << 3,
+        DateTimeLocal   = 1 << 4,
+        Email           = 1 << 5,
+        File            = 1 << 6,
+        Hidden          = 1 << 7,
+        Image           = 1 << 8,
+        Month           = 1 << 9,
+        Number          = 1 << 10,
+        Password        = 1 << 11,
+        Radio           = 1 << 12,
+        Range           = 1 << 13,
+        Reset           = 1 << 14,
+        Search          = 1 << 15,
+        Submit          = 1 << 16,
+        Telephone       = 1 << 17,
+        Time            = 1 << 18,
+        URL             = 1 << 19,
+        Week            = 1 << 20,
+        Text            = 1 << 21,
     };
+    
+    static constexpr OptionSet<Type> textTypes = {
+        Type::Email,
+        Type::Password,
+        Type::Search,
+        Type::Telephone,
+        Type::Text,
+        Type::URL,
+    };
 
+    static constexpr OptionSet<Type> textFieldTypes = {
+        Type::Email,
+        Type::Number,
+        Type::Password,
+        Type::Search,
+        Type::Telephone,
+        Type::Text,
+        Type::URL,
+    };
+
+    static constexpr OptionSet<Type> textButtonTypes = {
+        Type::Button,
+        Type::Reset,
+        Type::Submit,
+    };
+
+    static constexpr OptionSet<Type> checkableTypes = {
+        Type::Checkbox,
+        Type::Radio,
+    };
+
+    static constexpr OptionSet<Type> steppableTypes = {
+        Type::Date,
+        Type::DateTimeLocal,
+        Type::Month,
+        Type::Time,
+        Type::Week,
+        Type::Number,
+        Type::Range,
+    };
+
+    static constexpr OptionSet<Type> nonValidatingTypes = {
+        Type::Button,
+        Type::Hidden,
+        Type::Image,
+        Type::Reset,
+    };
+
     static Ref<InputType> create(HTMLInputElement&, const AtomString&);
     static Ref<InputType> createText(HTMLInputElement&);
     virtual ~InputType();
@@ -115,32 +163,38 @@
     // inflexible because it's harder to add new input types if there is
     // scattered code with special cases for various types.
 
-    virtual bool isCheckbox() const;
-    virtual bool isColorControl() const;
-    virtual bool isDateField() const;
-    virtual bool isDateTimeField() const;
-    virtual bool isDateTimeLocalField() const;
-    virtual bool isEmailField() const;
-    virtual bool isFileUpload() const;
-    virtual bool isHiddenType() const;
-    virtual bool isImageButton() const;
-    virtual bool isInteractiveContent() const;
-    virtual bool supportLabels() const;
-    virtual bool isMonthField() const;
-    virtual bool isNumberField() const;
-    virtual bool isPasswordField() const;
-    virtual bool isRadioButton() const;
-    virtual bool isRangeControl() const;
-    virtual bool isSearchField() const;
-    virtual bool isSubmitButton() const;
-    virtual bool isTelephoneField() const;
-    virtual bool isTextButton() const;
-    virtual bool isTextField() const;
-    virtual bool isTextType() const;
-    virtual bool isTimeField() const;
-    virtual bool isURLField() const;
-    virtual bool isWeekField() const;
+    bool isCheckbox() const { return m_type == Type::Checkbox; }
+    bool isColorControl() const { return m_type == Type::Color; }
+    bool isDateField() const { return m_type == Type::Date; }
+    bool isDateTimeLocalField() const { return m_type == Type::DateTimeLocal; }
+    bool isEmailField() const { return m_type == Type::Email; }
+    bool isFileUpload() const { return m_type == Type::File; }
+    bool isHiddenType() const { return m_type == Type::Hidden; }
+    bool isImageButton() const { return m_type == Type::Image; }
+    bool isMonthField() const { return m_type == Type::Month; }
+    bool isNumberField() const { return m_type == Type::Number; }
+    bool isPasswordField() const { return m_type == Type::Password; }
+    bool isRadioButton() const { return m_type == Type::Radio; }
+    bool isRangeControl() const { return m_type == Type::Range; }
+    bool isSearchField() const { return m_type == Type::Search; }
+    bool isSubmitButton() const { return m_type == Type::Submit; }
+    bool isTelephoneField() const { return m_type == Type::Telephone; }
+    bool isTimeField() const { return m_type == Type::Time; }
+    bool isURLField() const { return m_type == Type::URL; }
+    bool isWeekField() const { return m_type == Type::Week; }
 
+    bool isTextButton() const { return textButtonTypes.contains(m_type); }
+    bool isTextField() const { return textFieldTypes.contains(m_type); }
+    bool isTextType() const { return textTypes.contains(m_type); }
+
+    bool isCheckable() const { return checkableTypes.contains(m_type); }
+    bool isSteppable() const { return steppableTypes.contains(m_type); }
+
+    bool isInteractiveContent() const;
+    bool supportLabels() const;
+    bool isEnumeratable() const;
+
+    bool supportsValidation() const { return !nonValidatingTypes.contains(m_type); }
     // Form value functions.
 
     virtual bool shouldSaveAndRestoreFormControlState() const;
@@ -163,7 +217,6 @@
     // Validation functions.
 
     virtual String validationMessage() const;
-    virtual bool supportsValidation() const;
     virtual bool typeMismatchFor(const String&) const;
     virtual bool supportsRequired() const;
     virtual bool valueMissing(const String&) const;
@@ -183,6 +236,7 @@
     virtual StepRange createStepRange(AnyStepHandling) const;
     virtual ExceptionOr<void> stepUp(int);
     virtual void stepUpFromRenderer(int);
+    bool canHaveTypeSpecificValue() const { return isFileUpload(); }
     virtual String badInputText() const;
     virtual String typeMismatchText() const;
     virtual String valueMissingText() const;
@@ -276,8 +330,6 @@
     virtual void setValue(const String&, bool valueChanged, TextFieldEventBehavior);
     virtual bool shouldResetOnDocumentActivation();
     virtual bool shouldRespectListAttribute();
-    virtual bool isEnumeratable();
-    virtual bool isCheckable();
     virtual bool shouldRespectHeightAndWidthAttributes();
     virtual bool supportsPlaceholder() const;
     virtual bool supportsReadOnly() const;
@@ -298,8 +350,6 @@
     virtual void selectColor(StringView);
     virtual Vector<Color> suggestedColors() const;
 
-    bool isSteppable() const;
-
     // Parses the specified string for the type, and return
     // the Decimal value for the parsing result if the parsing
     // succeeds; Returns defaultValue otherwise. This function can
@@ -340,7 +390,6 @@
     HTMLInputElement* element() const { return m_element.get(); }
     Chrome* chrome() const;
     Decimal parseToNumberOrNaN(const String&) const;
-    virtual bool isSteppableSlow() const { return false; }
 
 private:
     // Helper for stepUp()/stepDown(). Adds step value * count to the current value.

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/MonthInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/MonthInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/MonthInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -127,11 +127,6 @@
     return DateComponents::fromMonthsSinceEpoch(value);
 }
 
-bool MonthInputType::isMonthField() const
-{
-    return true;
-}
-
 void MonthInputType::handleDOMActivateEvent(Event&)
 {
 }

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/MonthInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/MonthInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/MonthInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -54,7 +54,6 @@
     StepRange createStepRange(AnyStepHandling) const override;
     Optional<DateComponents> parseToDateComponents(const StringView&) const override;
     Optional<DateComponents> setMillisecondToDateComponents(double) const override;
-    bool isMonthField() const override;
     void handleDOMActivateEvent(Event&) override;
 
     bool isValidFormat(OptionSet<DateTimeFormatValidationResults>) const final;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/NumberInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/NumberInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/NumberInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -210,11 +210,6 @@
     return width;
 }
 
-bool NumberInputType::isSteppableSlow() const
-{
-    return true;
-}
-
 auto NumberInputType::handleKeydownEvent(KeyboardEvent& event) -> ShouldCallBaseEventHandler
 {
     handleKeydownEventForSpinButton(event);
@@ -292,11 +287,6 @@
     return true;
 }
 
-bool NumberInputType::isNumberField() const
-{
-    return true;
-}
-
 void NumberInputType::attributeChanged(const QualifiedName& name)
 {
     ASSERT(element());

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/NumberInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/NumberInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/NumberInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -50,7 +50,6 @@
     bool typeMismatch() const final;
     bool sizeShouldIncludeDecoration(int defaultSize, int& preferredSize) const final;
     float decorationWidth() const final;
-    bool isSteppableSlow() const final;
     StepRange createStepRange(AnyStepHandling) const final;
     ShouldCallBaseEventHandler handleKeydownEvent(KeyboardEvent&) final;
     Decimal parseToNumber(const String&, const Decimal&) const final;
@@ -62,7 +61,6 @@
     bool hasBadInput() const final;
     String badInputText() const final;
     bool supportsPlaceholder() const final;
-    bool isNumberField() const final;
     void attributeChanged(const QualifiedName&) final;
 };
 

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/PasswordInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/PasswordInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/PasswordInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -86,9 +86,4 @@
     return false;
 }
 
-bool PasswordInputType::isPasswordField() const
-{
-    return true;
-}
-
 } // namespace WebCore

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/PasswordInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/PasswordInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/PasswordInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -47,7 +47,6 @@
     bool shouldUseInputMethod() const override;
     bool shouldResetOnDocumentActivation() override;
     bool shouldRespectListAttribute() override;
-    bool isPasswordField() const override;
 };
 
 } // namespace WebCore

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/RadioInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/RadioInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/RadioInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -180,11 +180,6 @@
     event.setDefaultHandled();
 }
 
-bool RadioInputType::isRadioButton() const
-{
-    return true;
-}
-
 bool RadioInputType::matchesIndeterminatePseudoClass() const
 {
     ASSERT(element());

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/RadioInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/RadioInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/RadioInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -51,7 +51,6 @@
     bool shouldSendChangeEventAfterCheckedChanged() final;
     void willDispatchClick(InputElementClickState&) final;
     void didDispatchClick(Event&, const InputElementClickState&) final;
-    bool isRadioButton() const final;
     bool matchesIndeterminatePseudoClass() const final;
 };
 

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/RangeInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/RangeInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/RangeInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -84,11 +84,6 @@
 {
 }
 
-bool RangeInputType::isRangeControl() const
-{
-    return true;
-}
-
 const AtomString& RangeInputType::formControlType() const
 {
     return InputTypeNames::range();
@@ -133,11 +128,6 @@
     return StepRange(minimum, RangeLimitations::Valid, minimum, maximum, step, rangeStepDescription);
 }
 
-bool RangeInputType::isSteppableSlow() const
-{
-    return true;
-}
-
 void RangeInputType::handleMouseDownEvent(MouseEvent& event)
 {
     ASSERT(element());

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/RangeInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/RangeInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/RangeInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -43,7 +43,6 @@
     explicit RangeInputType(HTMLInputElement&);
 
 private:
-    bool isRangeControl() const final;
     const AtomString& formControlType() const final;
     double valueAsDouble() const final;
     ExceptionOr<void> setValueAsDecimal(const Decimal&, TextFieldEventBehavior) const final;
@@ -50,7 +49,6 @@
     bool typeMismatchFor(const String&) const final;
     bool supportsRequired() const final;
     StepRange createStepRange(AnyStepHandling) const final;
-    bool isSteppableSlow() const final;
     void handleMouseDownEvent(MouseEvent&) final;
     ShouldCallBaseEventHandler handleKeydownEvent(KeyboardEvent&) final;
     RenderPtr<RenderElement> createInputRenderer(RenderStyle&&) final;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/ResetInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/ResetInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/ResetInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -45,11 +45,6 @@
     return InputTypeNames::reset();
 }
 
-bool ResetInputType::supportsValidation() const
-{
-    return false;
-}
-
 void ResetInputType::handleDOMActivateEvent(Event& event)
 {
     ASSERT(element());
@@ -64,9 +59,4 @@
     return resetButtonDefaultLabel();
 }
 
-bool ResetInputType::isTextButton() const
-{
-    return true;
-}
-
 } // namespace WebCore

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/ResetInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/ResetInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/ResetInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -41,10 +41,8 @@
 
 private:
     const AtomString& formControlType() const override;
-    bool supportsValidation() const override;
     void handleDOMActivateEvent(Event&) override;
     String defaultValue() const override;
-    bool isTextButton() const override;
 };
 
 } // namespace WebCore

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/SearchInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/SearchInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/SearchInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -97,11 +97,6 @@
     return InputTypeNames::search();
 }
 
-bool SearchInputType::isSearchField() const
-{
-    return true;
-}
-
 bool SearchInputType::needsContainer() const
 {
     return true;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/SearchInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/SearchInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/SearchInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -50,7 +50,6 @@
     void attributeChanged(const QualifiedName&) final;
     RenderPtr<RenderElement> createInputRenderer(RenderStyle&&) final;
     const AtomString& formControlType() const final;
-    bool isSearchField() const final;
     bool needsContainer() const final;
     void createShadowSubtreeAndUpdateInnerTextElementEditability(ContainerNode::ChildChange::Source, bool) final;
     void destroyShadowSubtree() final;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/SubmitInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/SubmitInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/SubmitInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -90,14 +90,4 @@
     return submitButtonDefaultLabel();
 }
 
-bool SubmitInputType::isSubmitButton() const
-{
-    return true;
-}
-
-bool SubmitInputType::isTextButton() const
-{
-    return true;
-}
-
 } // namespace WebCore

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/SubmitInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/SubmitInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/SubmitInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -46,8 +46,6 @@
     void handleDOMActivateEvent(Event&) override;
     bool canBeSuccessfulSubmitButton() override;
     String defaultValue() const override;
-    bool isSubmitButton() const override;
-    bool isTextButton() const override;
 };
 
 } // namespace WebCore

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/TelephoneInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/TelephoneInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/TelephoneInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -41,9 +41,4 @@
     return InputTypeNames::telephone();
 }
 
-bool TelephoneInputType::isTelephoneField() const
-{
-    return true;
-}
-
 } // namespace WebCore

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/TelephoneInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/TelephoneInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/TelephoneInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -41,7 +41,6 @@
 
 private:
     const AtomString& formControlType() const override;
-    bool isTelephoneField() const override;
 };
 
 } // namespace WebCore

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/TextFieldInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/TextFieldInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/TextFieldInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -100,11 +100,6 @@
     return element()->isTextFormControlFocusable();
 }
 
-bool TextFieldInputType::isTextField() const
-{
-    return true;
-}
-
 bool TextFieldInputType::isEmptyValue() const
 {
     auto innerText = innerTextElement();

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/TextFieldInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/TextFieldInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/TextFieldInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -89,7 +89,6 @@
 private:
     bool isKeyboardFocusable(KeyboardEvent*) const final;
     bool isMouseFocusable() const final;
-    bool isTextField() const final;
     bool isEmptyValue() const final;
     void handleBeforeTextInsertedEvent(BeforeTextInsertedEvent&) final;
     void forwardEvent(Event&) final;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/TimeInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/TimeInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/TimeInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -102,11 +102,6 @@
     return DateComponents::fromMillisecondsSinceMidnight(value);
 }
 
-bool TimeInputType::isTimeField() const
-{
-    return true;
-}
-
 void TimeInputType::handleDOMActivateEvent(Event&)
 {
 }

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/TimeInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/TimeInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/TimeInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -48,7 +48,6 @@
     StepRange createStepRange(AnyStepHandling) const override;
     Optional<DateComponents> parseToDateComponents(const StringView&) const override;
     Optional<DateComponents> setMillisecondToDateComponents(double) const override;
-    bool isTimeField() const override;
     void handleDOMActivateEvent(Event&) override;
 
     bool isValidFormat(OptionSet<DateTimeFormatValidationResults>) const final;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/URLInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/URLInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/URLInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -61,11 +61,6 @@
     return validationMessageTypeMismatchForURLText();
 }
 
-bool URLInputType::isURLField() const
-{
-    return true;
-}
-
 String URLInputType::sanitizeValue(const String& proposedValue) const
 {
     return stripLeadingAndTrailingHTMLSpaces(BaseTextInputType::sanitizeValue(proposedValue));

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/URLInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/URLInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/URLInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -44,7 +44,6 @@
     bool typeMismatchFor(const String&) const override;
     bool typeMismatch() const override;
     String typeMismatchText() const override;
-    bool isURLField() const override;
     String sanitizeValue(const String&) const override;
 };
 

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/WeekInputType.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/WeekInputType.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/WeekInputType.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -78,11 +78,6 @@
     return DateComponents::fromMillisecondsSinceEpochForWeek(value);
 }
 
-bool WeekInputType::isWeekField() const
-{
-    return true;
-}
-
 void WeekInputType::handleDOMActivateEvent(Event&)
 {
 }

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/html/WeekInputType.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/html/WeekInputType.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/html/WeekInputType.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -50,7 +50,6 @@
     StepRange createStepRange(AnyStepHandling) const override;
     Optional<DateComponents> parseToDateComponents(const StringView&) const override;
     Optional<DateComponents> setMillisecondToDateComponents(double) const override;
-    bool isWeekField() const override;
     void handleDOMActivateEvent(Event&) override;
 
     bool isValidFormat(OptionSet<DateTimeFormatValidationResults>) const final;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/page/PointerCaptureController.cpp (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/page/PointerCaptureController.cpp	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/page/PointerCaptureController.cpp	2021-03-02 21:13:00 UTC (rev 273757)
@@ -47,7 +47,7 @@
     reset();
 }
 
-Element* PointerCaptureController::pointerCaptureElement(Document* document, PointerID pointerId)
+Element* PointerCaptureController::pointerCaptureElement(Document* document, PointerID pointerId) const
 {
     auto iterator = m_activePointerIdsToCapturingData.find(pointerId);
     if (iterator != m_activePointerIdsToCapturingData.end()) {
@@ -85,6 +85,7 @@
     if (capturingData.pointerIsPressed)
         capturingData.pendingTargetOverride = capturingTarget;
 
+    updateHaveAnyCapturingElement();
     return { };
 }
 
@@ -107,7 +108,10 @@
 
     // 3. For the specified pointerId, clear the pending pointer capture target override, if set.
     iterator->value.pendingTargetOverride = nullptr;
+    
+    // FIXME: This leaves value.targetOverride set: webkit.org/b/221342.
 
+    updateHaveAnyCapturingElement();
     return { };
 }
 
@@ -119,6 +123,9 @@
     // In particular, returns true if the pending pointer capture target override for pointerId is set to the element on which this method is
     // invoked, and false otherwise.
 
+    if (!m_haveAnyCapturingElement)
+        return false;
+
     auto iterator = m_activePointerIdsToCapturingData.find(pointerId);
     return iterator != m_activePointerIdsToCapturingData.end() && iterator->value.pendingTargetOverride == capturingTarget;
 }
@@ -133,10 +140,15 @@
         capturingData.pendingTargetOverride = nullptr;
         capturingData.targetOverride = nullptr;
     }
+
+    updateHaveAnyCapturingElement();
 }
 
 void PointerCaptureController::elementWasRemoved(Element& element)
 {
+    if (!m_haveAnyCapturingElement)
+        return;
+
     for (auto& keyAndValue : m_activePointerIdsToCapturingData) {
         auto& capturingData = keyAndValue.value;
         if (capturingData.pendingTargetOverride == &element || capturingData.targetOverride == &element) {
@@ -158,6 +170,7 @@
 void PointerCaptureController::reset()
 {
     m_activePointerIdsToCapturingData.clear();
+    m_haveAnyCapturingElement = false;
 
     CapturingData capturingData;
     capturingData.pointerType = PointerEvent::mousePointerType();
@@ -164,18 +177,26 @@
     m_activePointerIdsToCapturingData.add(mousePointerID, capturingData);
 }
 
+void PointerCaptureController::updateHaveAnyCapturingElement()
+{
+    m_haveAnyCapturingElement = WTF::anyOf(m_activePointerIdsToCapturingData.values(), [&](auto& capturingData) {
+        return capturingData.hasAnyElement();
+    });
+}
+
 void PointerCaptureController::touchWithIdentifierWasRemoved(PointerID pointerId)
 {
     m_activePointerIdsToCapturingData.remove(pointerId);
+    updateHaveAnyCapturingElement();
 }
 
-bool PointerCaptureController::hasCancelledPointerEventForIdentifier(PointerID pointerId)
+bool PointerCaptureController::hasCancelledPointerEventForIdentifier(PointerID pointerId) const
 {
     auto iterator = m_activePointerIdsToCapturingData.find(pointerId);
     return iterator != m_activePointerIdsToCapturingData.end() && iterator->value.cancelled;
 }
 
-bool PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier(PointerID pointerId)
+bool PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier(PointerID pointerId) const
 {
     auto iterator = m_activePointerIdsToCapturingData.find(pointerId);
     return iterator != m_activePointerIdsToCapturingData.end() && iterator->value.preventsCompatibilityMouseEvents;

Modified: branches/safari-611.1.21.1-branch/Source/WebCore/page/PointerCaptureController.h (273756 => 273757)


--- branches/safari-611.1.21.1-branch/Source/WebCore/page/PointerCaptureController.h	2021-03-02 21:12:48 UTC (rev 273756)
+++ branches/safari-611.1.21.1-branch/Source/WebCore/page/PointerCaptureController.h	2021-03-02 21:13:00 UTC (rev 273757)
@@ -46,7 +46,7 @@
 public:
     explicit PointerCaptureController(Page&);
 
-    Element* pointerCaptureElement(Document*, PointerID);
+    Element* pointerCaptureElement(Document*, PointerID) const;
     ExceptionOr<void> setPointerCapture(Element*, PointerID);
     ExceptionOr<void> releasePointerCapture(Element*, PointerID);
     bool hasPointerCapture(Element*, PointerID);
@@ -62,8 +62,8 @@
 #endif
 
     WEBCORE_EXPORT void touchWithIdentifierWasRemoved(PointerID);
-    bool hasCancelledPointerEventForIdentifier(PointerID);
-    bool preventsCompatibilityMouseEventsForIdentifier(PointerID);
+    bool hasCancelledPointerEventForIdentifier(PointerID) const;
+    bool preventsCompatibilityMouseEventsForIdentifier(PointerID) const;
     void dispatchEvent(PointerEvent&, EventTarget*);
     WEBCORE_EXPORT void cancelPointer(PointerID, const IntPoint&);
     void processPendingPointerCapture(PointerID);
@@ -75,6 +75,13 @@
 #if ENABLE(TOUCH_EVENTS) && PLATFORM(IOS_FAMILY)
         RefPtr<Element> previousTarget;
 #endif
+        bool hasAnyElement() const {
+            return pendingTargetOverride || targetOverride
+#if ENABLE(TOUCH_EVENTS) && PLATFORM(IOS_FAMILY)
+                || previousTarget
+#endif
+                ;
+        }
         String pointerType;
         bool cancelled { false };
         bool isPrimary { false };
@@ -86,6 +93,8 @@
     CapturingData& ensureCapturingDataForPointerEvent(const PointerEvent&);
     void pointerEventWillBeDispatched(const PointerEvent&, EventTarget*);
     void pointerEventWasDispatched(const PointerEvent&);
+    
+    void updateHaveAnyCapturingElement();
 
     Page& m_page;
     // While PointerID is defined as int32_t, we use int64_t here so that we may use a value outside of the int32_t range to have safe
@@ -93,6 +102,7 @@
     using PointerIdToCapturingDataMap = HashMap<int64_t, CapturingData, WTF::IntHash<int64_t>, WTF::SignedWithZeroKeyHashTraits<int64_t>>;
     PointerIdToCapturingDataMap m_activePointerIdsToCapturingData;
     bool m_processingPendingPointerCapture { false };
+    bool m_haveAnyCapturingElement { false };
 };
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to