⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 273756 in webkit


Ignore:
Timestamp:
Mar 2, 2021, 1:12:48 PM (6 years ago)
Author:
Russell Epstein
Message:

Apply patch. rdar://problem/74944257

Location:
branches/safari-611.1.21.0-branch/Source/WebCore
Files:
59 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-611.1.21.0-branch/Source/WebCore/ChangeLog

    r273738 r273756  
     12021-03-02  Russell Epstein  <repstein@apple.com>
     2
     3        Apply patch. rdar://problem/74944257
     4
     5    2021-03-02  Ryosuke Niwa  <rniwa@webkit.org>
     6
     7            Merge r272331. <rdar://problem/74901291>
     8
     9        Optimize PointerCaptureController::elementWasRemoved()
     10        https://bugs.webkit.org/show_bug.cgi?id=221316
     11
     12        Reviewed by Ryosuke Niwa.
     13
     14        Speedometer profiles show HashTable iteration code under PointerCaptureController::elementWasRemoved()
     15        because we always add a hash entry for the mouse pointer.
     16
     17        Optimize away by setting a flag that's only true if any element is referenced by pointer capture.
     18
     19        * page/PointerCaptureController.cpp:
     20        (WebCore::PointerCaptureController::pointerCaptureElement const):
     21        (WebCore::PointerCaptureController::setPointerCapture):
     22        (WebCore::PointerCaptureController::releasePointerCapture):
     23        (WebCore::PointerCaptureController::hasPointerCapture):
     24        (WebCore::PointerCaptureController::pointerLockWasApplied):
     25        (WebCore::PointerCaptureController::elementWasRemoved):
     26        (WebCore::PointerCaptureController::reset):
     27        (WebCore::PointerCaptureController::updateHaveAnyCapturingElement):
     28        (WebCore::PointerCaptureController::touchWithIdentifierWasRemoved):
     29        (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier const):
     30        (WebCore::PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier const):
     31        (WebCore::PointerCaptureController::pointerCaptureElement): Deleted.
     32        (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier): Deleted.
     33        (WebCore::PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier): Deleted.
     34        * page/PointerCaptureController.h:
     35
     36        2021-02-03  Simon Fraser  <simon.fraser@apple.com>
     37
     38                Optimize PointerCaptureController::elementWasRemoved()
     39                https://bugs.webkit.org/show_bug.cgi?id=221316
     40
     41                Reviewed by Ryosuke Niwa.
     42
     43                Speedometer profiles show HashTable iteration code under PointerCaptureController::elementWasRemoved()
     44                because we always add a hash entry for the mouse pointer.
     45
     46                Optimize away by setting a flag that's only true if any element is referenced by pointer capture.
     47
     48                * page/PointerCaptureController.cpp:
     49                (WebCore::PointerCaptureController::pointerCaptureElement const):
     50                (WebCore::PointerCaptureController::setPointerCapture):
     51                (WebCore::PointerCaptureController::releasePointerCapture):
     52                (WebCore::PointerCaptureController::hasPointerCapture):
     53                (WebCore::PointerCaptureController::pointerLockWasApplied):
     54                (WebCore::PointerCaptureController::elementWasRemoved):
     55                (WebCore::PointerCaptureController::reset):
     56                (WebCore::PointerCaptureController::updateHaveAnyCapturingElement):
     57                (WebCore::PointerCaptureController::touchWithIdentifierWasRemoved):
     58                (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier const):
     59                (WebCore::PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier const):
     60                (WebCore::PointerCaptureController::pointerCaptureElement): Deleted.
     61                (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier): Deleted.
     62                (WebCore::PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier): Deleted.
     63                * page/PointerCaptureController.h:
     64
     652021-03-01  Ryosuke Niwa  <rniwa@webkit.org>
     66
     67        Merge r272299. <rdar://problem/73917813>
     68
     69    Avoid a virtual function call in HTMLFormControlElement::isDisabledOrReadOnly()
     70    https://bugs.webkit.org/show_bug.cgi?id=221319
     71
     72    Reviewed by Wenson Hsieh.
     73
     74    Avoid calling isDisabledFormControl() which is a virtual function on Element.
     75    HTMLFormControlElement is the only class in its hierarchy that implements this,
     76    so we can just copy its implementation.
     77
     78    * html/HTMLFormControlElement.h:
     79    (WebCore::HTMLFormControlElement::isDisabledOrReadOnly const):
     80
     81
     82    2021-02-02  Simon Fraser  <simon.fraser@apple.com>
     83
     84            Avoid a virtual function call in HTMLFormControlElement::isDisabledOrReadOnly()
     85            https://bugs.webkit.org/show_bug.cgi?id=221319
     86
     87            Reviewed by Wenson Hsieh.
     88
     89            Avoid calling isDisabledFormControl() which is a virtual function on Element.
     90            HTMLFormControlElement is the only class in its hierarchy that implements this,
     91            so we can just copy its implementation.
     92
     93            * html/HTMLFormControlElement.h:
     94            (WebCore::HTMLFormControlElement::isDisabledOrReadOnly const):
     95
     962021-03-01  Ryosuke Niwa  <rniwa@webkit.org>
     97
     98        Merge r272298. <rdar://problem/73917640>
     99
     100    Avoid a virtual function call in HTMLInputElement::value()
     101    https://bugs.webkit.org/show_bug.cgi?id=221318
     102
     103    Reviewed by Wenson Hsieh.
     104
     105    Only file upload controls override getTypeSpecificValue(), so to avoid a virtual
     106    function call, check the type first via canHaveTypeSpecificValue().
     107
     108    * html/HTMLInputElement.cpp:
     109    (WebCore::HTMLInputElement::value const):
     110    * html/InputType.h:
     111    (WebCore::InputType::canHaveTypeSpecificValue const):
     112
     113    2021-02-02  Simon Fraser  <simon.fraser@apple.com>
     114
     115            Avoid a virtual function call in HTMLInputElement::value()
     116            https://bugs.webkit.org/show_bug.cgi?id=221318
     117
     118            Reviewed by Wenson Hsieh.
     119
     120            Only file upload controls override getTypeSpecificValue(), so to avoid a virtual
     121            function call, check the type first via canHaveTypeSpecificValue().
     122
     123            * html/HTMLInputElement.cpp:
     124            (WebCore::HTMLInputElement::value const):
     125            * html/InputType.h:
     126            (WebCore::InputType::canHaveTypeSpecificValue const):
     127
     1282021-03-01  Ryosuke Niwa  <rniwa@webkit.org>
     129
     130        Merge r272180. <rdar://problem/74901291>
     131
     132    Devirtualize InputType::supportsValidation()
     133    https://bugs.webkit.org/show_bug.cgi?id=221216
     134
     135    Reviewed by Yusuke Suzuki.
     136
     137    InputType::supportsValidation() can just check the type. Use an OptionSet<> of exclusions
     138    for clarity.
     139
     140    * html/ButtonInputType.cpp:
     141    (WebCore::ButtonInputType::supportsValidation const): Deleted.
     142    * html/ButtonInputType.h:
     143    * html/HiddenInputType.cpp:
     144    (WebCore::HiddenInputType::supportsValidation const): Deleted.
     145    * html/HiddenInputType.h:
     146    * html/ImageInputType.cpp:
     147    (WebCore::ImageInputType::supportsValidation const): Deleted.
     148    * html/ImageInputType.h:
     149    * html/InputType.cpp:
     150    (WebCore::InputType::supportsValidation const): Deleted.
     151    * html/InputType.h:
     152    (WebCore::InputType::supportsValidation const):
     153    * html/ResetInputType.cpp:
     154    (WebCore::ResetInputType::supportsValidation const): Deleted.
     155    * html/ResetInputType.h:
     156
     157    2021-02-01  Simon Fraser  <simon.fraser@apple.com>
     158
     159            Devirtualize InputType::supportsValidation()
     160            https://bugs.webkit.org/show_bug.cgi?id=221216
     161
     162            Reviewed by Yusuke Suzuki.
     163
     164            InputType::supportsValidation() can just check the type. Use an OptionSet<> of exclusions
     165            for clarity.
     166
     167            * html/ButtonInputType.cpp:
     168            (WebCore::ButtonInputType::supportsValidation const): Deleted.
     169            * html/ButtonInputType.h:
     170            * html/HiddenInputType.cpp:
     171            (WebCore::HiddenInputType::supportsValidation const): Deleted.
     172            * html/HiddenInputType.h:
     173            * html/ImageInputType.cpp:
     174            (WebCore::ImageInputType::supportsValidation const): Deleted.
     175            * html/ImageInputType.h:
     176            * html/InputType.cpp:
     177            (WebCore::InputType::supportsValidation const): Deleted.
     178            * html/InputType.h:
     179            (WebCore::InputType::supportsValidation const):
     180            * html/ResetInputType.cpp:
     181            (WebCore::ResetInputType::supportsValidation const): Deleted.
     182            * html/ResetInputType.h:
     183
     1842021-03-01  Ryosuke Niwa  <rniwa@webkit.org>
     185
     186        Merge r272097. <rdar://problem/73781798>
     187
     188    Devirtualize some functions on InputType
     189    https://bugs.webkit.org/show_bug.cgi?id=221121
     190
     191    Reviewed by Yusuke Suzuki.
     192
     193    Virtual functions on InputType show up in Speedometer profiles. We can make
     194    many of these virtual functions non-virtual by just switching on the input type.
     195
     196    * dom/Element.cpp:
     197    * html/BaseCheckableInputType.cpp:
     198    (WebCore::BaseCheckableInputType::isCheckable): Deleted.
     199    * html/BaseCheckableInputType.h:
     200    * html/BaseTextInputType.cpp:
     201    (WebCore::BaseTextInputType::isTextType const): Deleted.
     202    * html/BaseTextInputType.h:
     203    * html/ButtonInputType.cpp:
     204    (WebCore::ButtonInputType::isTextButton const): Deleted.
     205    * html/ButtonInputType.h:
     206    * html/CheckboxInputType.cpp:
     207    (WebCore::CheckboxInputType::isCheckbox const): Deleted.
     208    * html/CheckboxInputType.h:
     209    * html/ColorInputType.cpp:
     210    (WebCore::ColorInputType::isColorControl const): Deleted.
     211    * html/ColorInputType.h:
     212    * html/DateInputType.cpp:
     213    (WebCore::DateInputType::isDateField const): Deleted.
     214    * html/DateInputType.h:
     215    * html/DateTimeLocalInputType.cpp:
     216    (WebCore::DateTimeLocalInputType::isDateTimeLocalField const): Deleted.
     217    * html/DateTimeLocalInputType.h:
     218    * html/EmailInputType.cpp:
     219    (WebCore::EmailInputType::isEmailField const): Deleted.
     220    * html/EmailInputType.h:
     221    * html/FileInputType.cpp:
     222    (WebCore::FileInputType::isFileUpload const): Deleted.
     223    * html/FileInputType.h:
     224    * html/FormAssociatedElement.h:
     225    * html/HTMLFormControlElement.h:
     226    * html/HiddenInputType.cpp:
     227    (WebCore::HiddenInputType::isHiddenType const): Deleted.
     228    * html/HiddenInputType.h:
     229    * html/ImageInputType.cpp:
     230    (WebCore::ImageInputType::isImageButton const): Deleted.
     231    (WebCore::ImageInputType::isEnumeratable): Deleted.
     232    * html/ImageInputType.h:
     233    * html/InputType.cpp:
     234    (WebCore::InputType::isTextType const):
     235    (WebCore::InputType::isTextField const):
     236    (WebCore::InputType::isTextButton const):
     237    (WebCore::InputType::isInteractiveContent const):
     238    (WebCore::InputType::supportLabels const):
     239    (WebCore::InputType::isEnumeratable):
     240    (WebCore::InputType::isCheckable):
     241    (WebCore::InputType::isRangeControl const): Deleted.
     242    (WebCore::InputType::isRadioButton const): Deleted.
     243    (WebCore::InputType::isSearchField const): Deleted.
     244    (WebCore::InputType::isHiddenType const): Deleted.
     245    (WebCore::InputType::isPasswordField const): Deleted.
     246    (WebCore::InputType::isCheckbox const): Deleted.
     247    (WebCore::InputType::isEmailField const): Deleted.
     248    (WebCore::InputType::isFileUpload const): Deleted.
     249    (WebCore::InputType::isImageButton const): Deleted.
     250    (WebCore::InputType::isNumberField const): Deleted.
     251    (WebCore::InputType::isSubmitButton const): Deleted.
     252    (WebCore::InputType::isTelephoneField const): Deleted.
     253    (WebCore::InputType::isURLField const): Deleted.
     254    (WebCore::InputType::isDateField const): Deleted.
     255    (WebCore::InputType::isDateTimeField const): Deleted.
     256    (WebCore::InputType::isDateTimeLocalField const): Deleted.
     257    (WebCore::InputType::isMonthField const): Deleted.
     258    (WebCore::InputType::isTimeField const): Deleted.
     259    (WebCore::InputType::isWeekField const): Deleted.
     260    (WebCore::InputType::isColorControl const): Deleted.
     261    * html/InputType.h:
     262    (WebCore::InputType::isCheckbox const):
     263    (WebCore::InputType::isColorControl const):
     264    (WebCore::InputType::isDateField const):
     265    (WebCore::InputType::isDateTimeField const):
     266    (WebCore::InputType::isDateTimeLocalField const):
     267    (WebCore::InputType::isEmailField const):
     268    (WebCore::InputType::isFileUpload const):
     269    (WebCore::InputType::isHiddenType const):
     270    (WebCore::InputType::isImageButton const):
     271    (WebCore::InputType::isMonthField const):
     272    (WebCore::InputType::isNumberField const):
     273    (WebCore::InputType::isPasswordField const):
     274    (WebCore::InputType::isRadioButton const):
     275    (WebCore::InputType::isRangeControl const):
     276    (WebCore::InputType::isSearchField const):
     277    (WebCore::InputType::isSubmitButton const):
     278    (WebCore::InputType::isTelephoneField const):
     279    (WebCore::InputType::isTimeField const):
     280    (WebCore::InputType::isURLField const):
     281    (WebCore::InputType::isWeekField const):
     282    * html/MonthInputType.cpp:
     283    (WebCore::MonthInputType::isMonthField const): Deleted.
     284    * html/MonthInputType.h:
     285    * html/NumberInputType.cpp:
     286    (WebCore::NumberInputType::isNumberField const): Deleted.
     287    * html/NumberInputType.h:
     288    * html/PasswordInputType.cpp:
     289    (WebCore::PasswordInputType::isPasswordField const): Deleted.
     290    * html/PasswordInputType.h:
     291    * html/RadioInputType.cpp:
     292    (WebCore::RadioInputType::isRadioButton const): Deleted.
     293    * html/RadioInputType.h:
     294    * html/RangeInputType.cpp:
     295    (WebCore::RangeInputType::isRangeControl const): Deleted.
     296    * html/RangeInputType.h:
     297    * html/ResetInputType.cpp:
     298    (WebCore::ResetInputType::isTextButton const): Deleted.
     299    * html/ResetInputType.h:
     300    * html/SearchInputType.cpp:
     301    (WebCore::SearchInputType::isSearchField const): Deleted.
     302    * html/SearchInputType.h:
     303    * html/SubmitInputType.cpp:
     304    (WebCore::SubmitInputType::isSubmitButton const): Deleted.
     305    (WebCore::SubmitInputType::isTextButton const): Deleted.
     306    * html/SubmitInputType.h:
     307    * html/TelephoneInputType.cpp:
     308    (WebCore::TelephoneInputType::isTelephoneField const): Deleted.
     309    * html/TelephoneInputType.h:
     310    * html/TextFieldInputType.cpp:
     311    (WebCore::TextFieldInputType::isTextField const): Deleted.
     312    * html/TextFieldInputType.h:
     313    * html/TimeInputType.cpp:
     314    (WebCore::TimeInputType::isTimeField const): Deleted.
     315    * html/TimeInputType.h:
     316    * html/URLInputType.cpp:
     317    (WebCore::URLInputType::isURLField const): Deleted.
     318    * html/URLInputType.h:
     319    * html/WeekInputType.cpp:
     320    (WebCore::WeekInputType::isWeekField const): Deleted.
     321    * html/WeekInputType.h:
     322
     323    2021-01-29  Simon Fraser  <simon.fraser@apple.com>
     324
     325            Devirtualize some functions on InputType
     326            https://bugs.webkit.org/show_bug.cgi?id=221121
     327
     328            Reviewed by Yusuke Suzuki.
     329
     330            Virtual functions on InputType show up in Speedometer profiles. We can make
     331            many of these virtual functions non-virtual by just switching on the input type.
     332
     333            * dom/Element.cpp:
     334            * html/BaseCheckableInputType.cpp:
     335            (WebCore::BaseCheckableInputType::isCheckable): Deleted.
     336            * html/BaseCheckableInputType.h:
     337            * html/BaseTextInputType.cpp:
     338            (WebCore::BaseTextInputType::isTextType const): Deleted.
     339            * html/BaseTextInputType.h:
     340            * html/ButtonInputType.cpp:
     341            (WebCore::ButtonInputType::isTextButton const): Deleted.
     342            * html/ButtonInputType.h:
     343            * html/CheckboxInputType.cpp:
     344            (WebCore::CheckboxInputType::isCheckbox const): Deleted.
     345            * html/CheckboxInputType.h:
     346            * html/ColorInputType.cpp:
     347            (WebCore::ColorInputType::isColorControl const): Deleted.
     348            * html/ColorInputType.h:
     349            * html/DateInputType.cpp:
     350            (WebCore::DateInputType::isDateField const): Deleted.
     351            * html/DateInputType.h:
     352            * html/DateTimeLocalInputType.cpp:
     353            (WebCore::DateTimeLocalInputType::isDateTimeLocalField const): Deleted.
     354            * html/DateTimeLocalInputType.h:
     355            * html/EmailInputType.cpp:
     356            (WebCore::EmailInputType::isEmailField const): Deleted.
     357            * html/EmailInputType.h:
     358            * html/FileInputType.cpp:
     359            (WebCore::FileInputType::isFileUpload const): Deleted.
     360            * html/FileInputType.h:
     361            * html/FormAssociatedElement.h:
     362            * html/HTMLFormControlElement.h:
     363            * html/HiddenInputType.cpp:
     364            (WebCore::HiddenInputType::isHiddenType const): Deleted.
     365            * html/HiddenInputType.h:
     366            * html/ImageInputType.cpp:
     367            (WebCore::ImageInputType::isImageButton const): Deleted.
     368            (WebCore::ImageInputType::isEnumeratable): Deleted.
     369            * html/ImageInputType.h:
     370            * html/InputType.cpp:
     371            (WebCore::InputType::isTextType const):
     372            (WebCore::InputType::isTextField const):
     373            (WebCore::InputType::isTextButton const):
     374            (WebCore::InputType::isInteractiveContent const):
     375            (WebCore::InputType::supportLabels const):
     376            (WebCore::InputType::isEnumeratable):
     377            (WebCore::InputType::isCheckable):
     378            (WebCore::InputType::isRangeControl const): Deleted.
     379            (WebCore::InputType::isRadioButton const): Deleted.
     380            (WebCore::InputType::isSearchField const): Deleted.
     381            (WebCore::InputType::isHiddenType const): Deleted.
     382            (WebCore::InputType::isPasswordField const): Deleted.
     383            (WebCore::InputType::isCheckbox const): Deleted.
     384            (WebCore::InputType::isEmailField const): Deleted.
     385            (WebCore::InputType::isFileUpload const): Deleted.
     386            (WebCore::InputType::isImageButton const): Deleted.
     387            (WebCore::InputType::isNumberField const): Deleted.
     388            (WebCore::InputType::isSubmitButton const): Deleted.
     389            (WebCore::InputType::isTelephoneField const): Deleted.
     390            (WebCore::InputType::isURLField const): Deleted.
     391            (WebCore::InputType::isDateField const): Deleted.
     392            (WebCore::InputType::isDateTimeField const): Deleted.
     393            (WebCore::InputType::isDateTimeLocalField const): Deleted.
     394            (WebCore::InputType::isMonthField const): Deleted.
     395            (WebCore::InputType::isTimeField const): Deleted.
     396            (WebCore::InputType::isWeekField const): Deleted.
     397            (WebCore::InputType::isColorControl const): Deleted.
     398            * html/InputType.h:
     399            (WebCore::InputType::isCheckbox const):
     400            (WebCore::InputType::isColorControl const):
     401            (WebCore::InputType::isDateField const):
     402            (WebCore::InputType::isDateTimeField const):
     403            (WebCore::InputType::isDateTimeLocalField const):
     404            (WebCore::InputType::isEmailField const):
     405            (WebCore::InputType::isFileUpload const):
     406            (WebCore::InputType::isHiddenType const):
     407            (WebCore::InputType::isImageButton const):
     408            (WebCore::InputType::isMonthField const):
     409            (WebCore::InputType::isNumberField const):
     410            (WebCore::InputType::isPasswordField const):
     411            (WebCore::InputType::isRadioButton const):
     412            (WebCore::InputType::isRangeControl const):
     413            (WebCore::InputType::isSearchField const):
     414            (WebCore::InputType::isSubmitButton const):
     415            (WebCore::InputType::isTelephoneField const):
     416            (WebCore::InputType::isTimeField const):
     417            (WebCore::InputType::isURLField const):
     418            (WebCore::InputType::isWeekField const):
     419            * html/MonthInputType.cpp:
     420            (WebCore::MonthInputType::isMonthField const): Deleted.
     421            * html/MonthInputType.h:
     422            * html/NumberInputType.cpp:
     423            (WebCore::NumberInputType::isNumberField const): Deleted.
     424            * html/NumberInputType.h:
     425            * html/PasswordInputType.cpp:
     426            (WebCore::PasswordInputType::isPasswordField const): Deleted.
     427            * html/PasswordInputType.h:
     428            * html/RadioInputType.cpp:
     429            (WebCore::RadioInputType::isRadioButton const): Deleted.
     430            * html/RadioInputType.h:
     431            * html/RangeInputType.cpp:
     432            (WebCore::RangeInputType::isRangeControl const): Deleted.
     433            * html/RangeInputType.h:
     434            * html/ResetInputType.cpp:
     435            (WebCore::ResetInputType::isTextButton const): Deleted.
     436            * html/ResetInputType.h:
     437            * html/SearchInputType.cpp:
     438            (WebCore::SearchInputType::isSearchField const): Deleted.
     439            * html/SearchInputType.h:
     440            * html/SubmitInputType.cpp:
     441            (WebCore::SubmitInputType::isSubmitButton const): Deleted.
     442            (WebCore::SubmitInputType::isTextButton const): Deleted.
     443            * html/SubmitInputType.h:
     444            * html/TelephoneInputType.cpp:
     445            (WebCore::TelephoneInputType::isTelephoneField const): Deleted.
     446            * html/TelephoneInputType.h:
     447            * html/TextFieldInputType.cpp:
     448            (WebCore::TextFieldInputType::isTextField const): Deleted.
     449            * html/TextFieldInputType.h:
     450            * html/TimeInputType.cpp:
     451            (WebCore::TimeInputType::isTimeField const): Deleted.
     452            * html/TimeInputType.h:
     453            * html/URLInputType.cpp:
     454            (WebCore::URLInputType::isURLField const): Deleted.
     455            * html/URLInputType.h:
     456            * html/WeekInputType.cpp:
     457            (WebCore::WeekInputType::isWeekField const): Deleted.
     458            * html/WeekInputType.h:
     459
    14602021-03-02  Alan Coon  <alancoon@apple.com>
    2461
  • branches/safari-611.1.21.0-branch/Source/WebCore/dom/Element.cpp

    r273531 r273756  
    32213221}
    32223222
    3223 
    32243223ExceptionOr<void> Element::setInnerHTML(const String& html)
    32253224{
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/BaseCheckableInputType.cpp

    r261013 r273756  
    115115}
    116116
    117 bool BaseCheckableInputType::isCheckable()
    118 {
    119     return true;
    120 }
    121 
    122117void BaseCheckableInputType::fireInputAndChangeEvents()
    123118{
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/BaseCheckableInputType.h

    r272512 r273756  
    5252    bool storesValueSeparateFromAttribute() override;
    5353    void setValue(const String&, bool, TextFieldEventBehavior) override;
    54     bool isCheckable() override;
    5554};
    5655
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/BaseDateAndTimeInputType.cpp

    r272952 r273756  
    170170}
    171171
    172 bool BaseDateAndTimeInputType::isSteppableSlow() const
    173 {
    174     return true;
    175 }
    176 
    177172Decimal BaseDateAndTimeInputType::parseToNumber(const String& source, const Decimal& defaultValue) const
    178173{
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/BaseDateAndTimeInputType.h

    r272535 r273756  
    103103    ExceptionOr<void> setValueAsDecimal(const Decimal&, TextFieldEventBehavior) const final;
    104104    Decimal defaultValueForStepUp() const override;
    105     bool isSteppableSlow() const final;
    106105    String localizeValue(const String&) const final;
    107106    bool supportsReadOnly() const final;
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/BaseTextInputType.cpp

    r246490 r273756  
    3434using namespace HTMLNames;
    3535
    36 bool BaseTextInputType::isTextType() const
    37 {
    38     return true;
    39 }
    40 
    4136bool BaseTextInputType::patternMismatch(const String& value) const
    4237{
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/BaseTextInputType.h

    r272512 r273756  
    4141    explicit BaseTextInputType(Type type, HTMLInputElement& element) : TextFieldInputType(type, element) { }
    4242
    43     bool isTextType() const override;
    4443    bool patternMismatch(const String&) const override;
    4544    bool supportsPlaceholder() const override;
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/ButtonInputType.cpp

    r246490 r273756  
    4141}
    4242
    43 bool ButtonInputType::supportsValidation() const
    44 {
    45     return false;
    46 }
    47 
    48 bool ButtonInputType::isTextButton() const
    49 {
    50     return true;
    51 }
    52 
    5343} // namespace WebCore
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/ButtonInputType.h

    r272512 r273756  
    4242private:
    4343    const AtomString& formControlType() const override;
    44     bool supportsValidation() const override;
    45     bool isTextButton() const override;
    4644};
    4745
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/CheckboxInputType.cpp

    r246490 r273756  
    9393}
    9494
    95 bool CheckboxInputType::isCheckbox() const
    96 {
    97     return true;
    98 }
    99 
    10095bool CheckboxInputType::matchesIndeterminatePseudoClass() const
    10196{
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/CheckboxInputType.h

    r272512 r273756  
    4747    void willDispatchClick(InputElementClickState&) final;
    4848    void didDispatchClick(Event&, const InputElementClickState&) final;
    49     bool isCheckbox() const final;
    5049    bool matchesIndeterminatePseudoClass() const final;
    5150    bool shouldAppearIndeterminate() const final;
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/ColorInputType.cpp

    r272513 r273756  
    101101}
    102102
    103 bool ColorInputType::isColorControl() const
    104 {
    105     return true;
    106 }
    107 
    108103bool ColorInputType::isPresentingAttachedView() const
    109104{
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/ColorInputType.h

    r272512 r273756  
    5353    bool isMouseFocusable() const final;
    5454    bool isKeyboardFocusable(KeyboardEvent*) const final;
    55     bool isColorControl() const final;
    5655    bool isPresentingAttachedView() const final;
    5756    const AtomString& formControlType() const final;
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/DateInputType.cpp

    r272512 r273756  
    8585}
    8686
    87 bool DateInputType::isDateField() const
    88 {
    89     return true;
    90 }
    91 
    9287bool DateInputType::isValidFormat(OptionSet<DateTimeFormatValidationResults> results) const
    9388{
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/DateInputType.h

    r272512 r273756  
    4848    Optional<DateComponents> parseToDateComponents(const StringView&) const override;
    4949    Optional<DateComponents> setMillisecondToDateComponents(double) const override;
    50     bool isDateField() const override;
    5150
    5251    bool isValidFormat(OptionSet<DateTimeFormatValidationResults>) const final;
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/DateTimeLocalInputType.cpp

    r267003 r273756  
    9494}
    9595
    96 bool DateTimeLocalInputType::isDateTimeLocalField() const
    97 {
    98     return true;
    99 }
    100 
    10196bool DateTimeLocalInputType::isValidFormat(OptionSet<DateTimeFormatValidationResults> results) const
    10297{
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/DateTimeLocalInputType.h

    r272512 r273756  
    5353    Optional<DateComponents> parseToDateComponents(const StringView&) const final;
    5454    Optional<DateComponents> setMillisecondToDateComponents(double) const final;
    55     bool isDateTimeLocalField() const final;
    5655
    5756    bool isValidFormat(OptionSet<DateTimeFormatValidationResults>) const final;
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/EmailInputType.cpp

    r246490 r273756  
    8484}
    8585
    86 bool EmailInputType::isEmailField() const
    87 {
    88     return true;
    89 }
    90 
    9186bool EmailInputType::supportsSelectionAPI() const
    9287{
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/EmailInputType.h

    r272512 r273756  
    4545    bool typeMismatch() const override;
    4646    String typeMismatchText() const override;
    47     bool isEmailField() const override;
    4847    bool supportsSelectionAPI() const override;
    4948    String sanitizeValue(const String&) const override;
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/FileInputType.cpp

    r272513 r273756  
    274274}
    275275
    276 bool FileInputType::isFileUpload() const
    277 {
    278     return true;
    279 }
    280 
    281276void FileInputType::createShadowSubtreeAndUpdateInnerTextElementEditability(ContainerNode::ChildChange::Source source, bool)
    282277{
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/FileInputType.h

    r272512 r273756  
    7878
    7979    Icon* icon() const final;
    80     bool isFileUpload() const final;
    8180    void createShadowSubtreeAndUpdateInnerTextElementEditability(ContainerNode::ChildChange::Source, bool) final;
    8281    void disabledStateChanged() final;
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/FormAssociatedElement.h

    r259393 r273756  
    111111
    112112private:
     113    // "willValidate" means "is a candidate for constraint validation".
    113114    virtual bool willValidate() const = 0;
    114115    virtual void refFormAssociatedElement() = 0;
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/HTMLFormControlElement.h

    r273388 r273756  
    101101#endif
    102102
     103    // "willValidate" means "is a candidate for constraint validation".
    103104    WEBCORE_EXPORT bool willValidate() const final;
    104105    void updateVisibleValidationMessage();
    … …  
    114115
    115116    bool isReadOnly() const { return m_isReadOnly; }
    116     bool isDisabledOrReadOnly() const { return isDisabledFormControl() || m_isReadOnly; }
     117    bool isDisabledOrReadOnly() const { return m_disabled || m_disabledByAncestorFieldset || m_isReadOnly; }
    117118
    118119    bool hasAutofocused() { return m_hasAutofocused; }
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/HTMLInputElement.cpp

    r273388 r273756  
    10191019{
    10201020    String value;
    1021     if (m_inputType->getTypeSpecificValue(value))
     1021    if (m_inputType->canHaveTypeSpecificValue() && m_inputType->getTypeSpecificValue(value))
    10221022        return value;
    10231023
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/HiddenInputType.cpp

    r259687 r273756  
    6363}
    6464
    65 bool HiddenInputType::supportsValidation() const
    66 {
    67     return false;
    68 }
    69 
    7065RenderPtr<RenderElement> HiddenInputType::createInputRenderer(RenderStyle&&)
    7166{
    … …  
    9590}
    9691
    97 bool HiddenInputType::isHiddenType() const
    98 {
    99     return true;
    100 }
    101 
    10292bool HiddenInputType::appendFormData(DOMFormData& formData, bool isMultipartForm) const
    10393{
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/HiddenInputType.h

    r272512 r273756  
    4444    FormControlState saveFormControlState() const override;
    4545    void restoreFormControlState(const FormControlState&) override;
    46     bool supportsValidation() const override;
    4746    RenderPtr<RenderElement> createInputRenderer(RenderStyle&&) override;
    4847    bool accessKeyAction(bool sendMouseEvents) override;
    4948    bool rendererIsNeeded() override;
    5049    bool storesValueSeparateFromAttribute() override;
    51     bool isHiddenType() const override;
    52     bool supportLabels() const override { return false; }
    53     bool isInteractiveContent() const final { return false; }
    5450    bool shouldRespectHeightAndWidthAttributes() override;
    5551    void setValue(const String&, bool, TextFieldEventBehavior) override;
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/ImageInputType.cpp

    r272512 r273756  
    7676
    7777    return true;
    78 }
    79 
    80 bool ImageInputType::supportsValidation() const
    81 {
    82     return false;
    8378}
    8479
    … …  
    172167}
    173168
    174 bool ImageInputType::isImageButton() const
    175 {
    176     return true;
    177 }
    178 
    179 bool ImageInputType::isEnumeratable()
    180 {
    181     return false;
    182 }
    183 
    184169bool ImageInputType::shouldRespectHeightAndWidthAttributes()
    185170{
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/ImageInputType.h

    r272512 r273756  
    4747    bool isFormDataAppendable() const final;
    4848    bool appendFormData(DOMFormData&, bool) const final;
    49     bool supportsValidation() const final;
    5049    RenderPtr<RenderElement> createInputRenderer(RenderStyle&&) final;
    5150    void handleDOMActivateEvent(Event&) final;
    … …  
    5453    bool shouldRespectAlignAttribute() final;
    5554    bool canBeSuccessfulSubmitButton() final;
    56     bool isImageButton() const final;
    57     bool isEnumeratable() final;
    5855    bool shouldRespectHeightAndWidthAttributes() final;
    5956    unsigned height() const final;
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/InputType.cpp

    r272512 r273756  
    167167}
    168168
    169 bool InputType::isTextField() const
    170 {
    171     return false;
    172 }
    173 
    174 bool InputType::isTextType() const
    175 {
    176     return false;
    177 }
    178 
    179 bool InputType::isRangeControl() const
    180 {
    181     return false;
    182 }
    183 
    184169bool InputType::shouldSaveAndRestoreFormControlState() const
    185170{
    … …  
    240225{
    241226    return Exception { InvalidStateError };
    242 }
    243 
    244 bool InputType::supportsValidation() const
    245 {
    246     return true;
    247227}
    248228
    … …  
    817797}
    818798
    819 bool InputType::isTextButton() const
    820 {
    821     return false;
    822 }
    823 
    824 bool InputType::isRadioButton() const
    825 {
    826     return false;
    827 }
    828 
    829 bool InputType::isSearchField() const
    830 {
    831     return false;
    832 }
    833 
    834 bool InputType::isHiddenType() const
    835 {
    836     return false;
    837 }
    838 
    839 bool InputType::isPasswordField() const
    840 {
    841     return false;
    842 }
    843 
    844 bool InputType::isCheckbox() const
    845 {
    846     return false;
    847 }
    848 
    849 bool InputType::isEmailField() const
    850 {
    851     return false;
    852 }
    853 
    854 bool InputType::isFileUpload() const
    855 {
    856     return false;
    857 }
    858 
    859 bool InputType::isImageButton() const
    860 {
    861     return false;
    862 }
    863 
    864799bool InputType::isInteractiveContent() const
    865800{
    866     return true;
     801    return m_type != Type::Hidden;
    867802}
    868803
    869804bool InputType::supportLabels() const
    870805{
    871     return true;
    872 }
    873 
    874 bool InputType::isNumberField() const
    875 {
    876     return false;
    877 }
    878 
    879 bool InputType::isSubmitButton() const
    880 {
    881     return false;
    882 }
    883 
    884 bool InputType::isTelephoneField() const
    885 {
    886     return false;
    887 }
    888 
    889 bool InputType::isURLField() const
    890 {
    891     return false;
    892 }
    893 
    894 bool InputType::isDateField() const
    895 {
    896     return false;
    897 }
    898 
    899 bool InputType::isDateTimeField() const
    900 {
    901     return false;
    902 }
    903 
    904 bool InputType::isDateTimeLocalField() const
    905 {
    906     return false;
    907 }
    908 
    909 bool InputType::isMonthField() const
    910 {
    911     return false;
    912 }
    913 
    914 bool InputType::isTimeField() const
    915 {
    916     return false;
    917 }
    918 
    919 bool InputType::isWeekField() const
    920 {
    921     return false;
    922 }
    923 
    924 bool InputType::isEnumeratable()
    925 {
    926     return true;
    927 }
    928 
    929 bool InputType::isCheckable()
    930 {
    931     return false;
    932 }
    933 
    934 // Do not use virtual function for performance reason.
    935 bool InputType::isSteppable() const
    936 {
    937     switch (m_type) {
    938     case Type::Date:
    939     case Type::DateTimeLocal:
    940     case Type::Month:
    941     case Type::Time:
    942     case Type::Week:
    943     case Type::Number:
    944     case Type::Range:
    945         ASSERT(isSteppableSlow());
    946         return true;
    947     default:
    948         ASSERT(!isSteppableSlow());
    949         return false;
    950     }
    951 }
    952 
    953 bool InputType::isColorControl() const
    954 {
    955     return false;
     806    return m_type != Type::Hidden;
     807}
     808
     809bool InputType::isEnumeratable() const
     810{
     811    return m_type != Type::Image;
    956812}
    957813
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/InputType.h

    r272512 r273756  
    3838#include <wtf/FastMalloc.h>
    3939#include <wtf/Forward.h>
     40#include <wtf/OptionSet.h>
    4041#include <wtf/RefCounted.h>
    4142#include <wtf/RefPtr.h>
    … …  
    7273    WTF_MAKE_FAST_ALLOCATED;
    7374public:
    74     enum class Type : uint8_t {
    75         Button,
    76         Checkbox,
    77         Color,
    78         Date,
    79         DateTimeLocal,
    80         Email,
    81         File,
    82         Hidden,
    83         Image,
    84         Month,
    85         Number,
    86         Password,
    87         Radio,
    88         Range,
    89         Reset,
    90         Search,
    91         Submit,
    92         Telephone,
    93         Time,
    94         URL,
    95         Week,
    96         Text,
     75    enum class Type : uint32_t {
     76        Button          = 1 << 0,
     77        Checkbox        = 1 << 1,
     78        Color           = 1 << 2,
     79        Date            = 1 << 3,
     80        DateTimeLocal   = 1 << 4,
     81        Email           = 1 << 5,
     82        File            = 1 << 6,
     83        Hidden          = 1 << 7,
     84        Image           = 1 << 8,
     85        Month           = 1 << 9,
     86        Number          = 1 << 10,
     87        Password        = 1 << 11,
     88        Radio           = 1 << 12,
     89        Range           = 1 << 13,
     90        Reset           = 1 << 14,
     91        Search          = 1 << 15,
     92        Submit          = 1 << 16,
     93        Telephone       = 1 << 17,
     94        Time            = 1 << 18,
     95        URL             = 1 << 19,
     96        Week            = 1 << 20,
     97        Text            = 1 << 21,
     98    };
     99   
     100    static constexpr OptionSet<Type> textTypes = {
     101        Type::Email,
     102        Type::Password,
     103        Type::Search,
     104        Type::Telephone,
     105        Type::Text,
     106        Type::URL,
     107    };
     108
     109    static constexpr OptionSet<Type> textFieldTypes = {
     110        Type::Email,
     111        Type::Number,
     112        Type::Password,
     113        Type::Search,
     114        Type::Telephone,
     115        Type::Text,
     116        Type::URL,
     117    };
     118
     119    static constexpr OptionSet<Type> textButtonTypes = {
     120        Type::Button,
     121        Type::Reset,
     122        Type::Submit,
     123    };
     124
     125    static constexpr OptionSet<Type> checkableTypes = {
     126        Type::Checkbox,
     127        Type::Radio,
     128    };
     129
     130    static constexpr OptionSet<Type> steppableTypes = {
     131        Type::Date,
     132        Type::DateTimeLocal,
     133        Type::Month,
     134        Type::Time,
     135        Type::Week,
     136        Type::Number,
     137        Type::Range,
     138    };
     139
     140    static constexpr OptionSet<Type> nonValidatingTypes = {
     141        Type::Button,
     142        Type::Hidden,
     143        Type::Image,
     144        Type::Reset,
    97145    };
    98146
    … …  
    116164    // scattered code with special cases for various types.
    117165
    118     virtual bool isCheckbox() const;
    119     virtual bool isColorControl() const;
    120     virtual bool isDateField() const;
    121     virtual bool isDateTimeField() const;
    122     virtual bool isDateTimeLocalField() const;
    123     virtual bool isEmailField() const;
    124     virtual bool isFileUpload() const;
    125     virtual bool isHiddenType() const;
    126     virtual bool isImageButton() const;
    127     virtual bool isInteractiveContent() const;
    128     virtual bool supportLabels() const;
    129     virtual bool isMonthField() const;
    130     virtual bool isNumberField() const;
    131     virtual bool isPasswordField() const;
    132     virtual bool isRadioButton() const;
    133     virtual bool isRangeControl() const;
    134     virtual bool isSearchField() const;
    135     virtual bool isSubmitButton() const;
    136     virtual bool isTelephoneField() const;
    137     virtual bool isTextButton() const;
    138     virtual bool isTextField() const;
    139     virtual bool isTextType() const;
    140     virtual bool isTimeField() const;
    141     virtual bool isURLField() const;
    142     virtual bool isWeekField() const;
    143 
     166    bool isCheckbox() const { return m_type == Type::Checkbox; }
     167    bool isColorControl() const { return m_type == Type::Color; }
     168    bool isDateField() const { return m_type == Type::Date; }
     169    bool isDateTimeLocalField() const { return m_type == Type::DateTimeLocal; }
     170    bool isEmailField() const { return m_type == Type::Email; }
     171    bool isFileUpload() const { return m_type == Type::File; }
     172    bool isHiddenType() const { return m_type == Type::Hidden; }
     173    bool isImageButton() const { return m_type == Type::Image; }
     174    bool isMonthField() const { return m_type == Type::Month; }
     175    bool isNumberField() const { return m_type == Type::Number; }
     176    bool isPasswordField() const { return m_type == Type::Password; }
     177    bool isRadioButton() const { return m_type == Type::Radio; }
     178    bool isRangeControl() const { return m_type == Type::Range; }
     179    bool isSearchField() const { return m_type == Type::Search; }
     180    bool isSubmitButton() const { return m_type == Type::Submit; }
     181    bool isTelephoneField() const { return m_type == Type::Telephone; }
     182    bool isTimeField() const { return m_type == Type::Time; }
     183    bool isURLField() const { return m_type == Type::URL; }
     184    bool isWeekField() const { return m_type == Type::Week; }
     185
     186    bool isTextButton() const { return textButtonTypes.contains(m_type); }
     187    bool isTextField() const { return textFieldTypes.contains(m_type); }
     188    bool isTextType() const { return textTypes.contains(m_type); }
     189
     190    bool isCheckable() const { return checkableTypes.contains(m_type); }
     191    bool isSteppable() const { return steppableTypes.contains(m_type); }
     192
     193    bool isInteractiveContent() const;
     194    bool supportLabels() const;
     195    bool isEnumeratable() const;
     196
     197    bool supportsValidation() const { return !nonValidatingTypes.contains(m_type); }
    144198    // Form value functions.
    145199
    … …  
    164218
    165219    virtual String validationMessage() const;
    166     virtual bool supportsValidation() const;
    167220    virtual bool typeMismatchFor(const String&) const;
    168221    virtual bool supportsRequired() const;
    … …  
    184237    virtual ExceptionOr<void> stepUp(int);
    185238    virtual void stepUpFromRenderer(int);
     239    bool canHaveTypeSpecificValue() const { return isFileUpload(); }
    186240    virtual String badInputText() const;
    187241    virtual String typeMismatchText() const;
    … …  
    277331    virtual bool shouldResetOnDocumentActivation();
    278332    virtual bool shouldRespectListAttribute();
    279     virtual bool isEnumeratable();
    280     virtual bool isCheckable();
    281333    virtual bool shouldRespectHeightAndWidthAttributes();
    282334    virtual bool supportsPlaceholder() const;
    … …  
    299351    virtual Vector<Color> suggestedColors() const;
    300352
    301     bool isSteppable() const;
    302 
    303353    // Parses the specified string for the type, and return
    304354    // the Decimal value for the parsing result if the parsing
    … …  
    341391    Chrome* chrome() const;
    342392    Decimal parseToNumberOrNaN(const String&) const;
    343     virtual bool isSteppableSlow() const { return false; }
    344393
    345394private:
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/MonthInputType.cpp

    r268276 r273756  
    128128}
    129129
    130 bool MonthInputType::isMonthField() const
    131 {
    132     return true;
    133 }
    134 
    135130void MonthInputType::handleDOMActivateEvent(Event&)
    136131{
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/MonthInputType.h

    r272512 r273756  
    5555    Optional<DateComponents> parseToDateComponents(const StringView&) const override;
    5656    Optional<DateComponents> setMillisecondToDateComponents(double) const override;
    57     bool isMonthField() const override;
    5857    void handleDOMActivateEvent(Event&) override;
    5958
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/NumberInputType.cpp

    r272512 r273756  
    211211}
    212212
    213 bool NumberInputType::isSteppableSlow() const
    214 {
    215     return true;
    216 }
    217 
    218213auto NumberInputType::handleKeydownEvent(KeyboardEvent& event) -> ShouldCallBaseEventHandler
    219214{
    … …  
    289284
    290285bool NumberInputType::supportsPlaceholder() const
    291 {
    292     return true;
    293 }
    294 
    295 bool NumberInputType::isNumberField() const
    296286{
    297287    return true;
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/NumberInputType.h

    r272512 r273756  
    5151    bool sizeShouldIncludeDecoration(int defaultSize, int& preferredSize) const final;
    5252    float decorationWidth() const final;
    53     bool isSteppableSlow() const final;
    5453    StepRange createStepRange(AnyStepHandling) const final;
    5554    ShouldCallBaseEventHandler handleKeydownEvent(KeyboardEvent&) final;
    … …  
    6362    String badInputText() const final;
    6463    bool supportsPlaceholder() const final;
    65     bool isNumberField() const final;
    6664    void attributeChanged(const QualifiedName&) final;
    6765};
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/PasswordInputType.cpp

    r254675 r273756  
    8787}
    8888
    89 bool PasswordInputType::isPasswordField() const
    90 {
    91     return true;
    92 }
    93 
    9489} // namespace WebCore
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/PasswordInputType.h

    r272512 r273756  
    4848    bool shouldResetOnDocumentActivation() override;
    4949    bool shouldRespectListAttribute() override;
    50     bool isPasswordField() const override;
    5150};
    5251
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/RadioInputType.cpp

    r269452 r273756  
    181181}
    182182
    183 bool RadioInputType::isRadioButton() const
    184 {
    185     return true;
    186 }
    187 
    188183bool RadioInputType::matchesIndeterminatePseudoClass() const
    189184{
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/RadioInputType.h

    r272512 r273756  
    5252    void willDispatchClick(InputElementClickState&) final;
    5353    void didDispatchClick(Event&, const InputElementClickState&) final;
    54     bool isRadioButton() const final;
    5554    bool matchesIndeterminatePseudoClass() const final;
    5655};
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/RangeInputType.cpp

    r272513 r273756  
    8585}
    8686
    87 bool RangeInputType::isRangeControl() const
    88 {
    89     return true;
    90 }
    91 
    9287const AtomString& RangeInputType::formControlType() const
    9388{
    … …  
    132127    const Decimal step = StepRange::parseStep(anyStepHandling, rangeStepDescription, element()->attributeWithoutSynchronization(stepAttr));
    133128    return StepRange(minimum, RangeLimitations::Valid, minimum, maximum, step, rangeStepDescription);
    134 }
    135 
    136 bool RangeInputType::isSteppableSlow() const
    137 {
    138     return true;
    139129}
    140130
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/RangeInputType.h

    r272512 r273756  
    4444
    4545private:
    46     bool isRangeControl() const final;
    4746    const AtomString& formControlType() const final;
    4847    double valueAsDouble() const final;
    … …  
    5150    bool supportsRequired() const final;
    5251    StepRange createStepRange(AnyStepHandling) const final;
    53     bool isSteppableSlow() const final;
    5452    void handleMouseDownEvent(MouseEvent&) final;
    5553    ShouldCallBaseEventHandler handleKeydownEvent(KeyboardEvent&) final;
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/ResetInputType.cpp

    r246490 r273756  
    4646}
    4747
    48 bool ResetInputType::supportsValidation() const
    49 {
    50     return false;
    51 }
    52 
    5348void ResetInputType::handleDOMActivateEvent(Event& event)
    5449{
    … …  
    6560}
    6661
    67 bool ResetInputType::isTextButton() const
    68 {
    69     return true;
    70 }
    71 
    7262} // namespace WebCore
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/ResetInputType.h

    r272512 r273756  
    4242private:
    4343    const AtomString& formControlType() const override;
    44     bool supportsValidation() const override;
    4544    void handleDOMActivateEvent(Event&) override;
    4645    String defaultValue() const override;
    47     bool isTextButton() const override;
    4846};
    4947
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/SearchInputType.cpp

    r272512 r273756  
    9898}
    9999
    100 bool SearchInputType::isSearchField() const
    101 {
    102     return true;
    103 }
    104 
    105100bool SearchInputType::needsContainer() const
    106101{
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/SearchInputType.h

    r272512 r273756  
    5151    RenderPtr<RenderElement> createInputRenderer(RenderStyle&&) final;
    5252    const AtomString& formControlType() const final;
    53     bool isSearchField() const final;
    5453    bool needsContainer() const final;
    5554    void createShadowSubtreeAndUpdateInnerTextElementEditability(ContainerNode::ChildChange::Source, bool) final;
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/SubmitInputType.cpp

    r246490 r273756  
    9191}
    9292
    93 bool SubmitInputType::isSubmitButton() const
    94 {
    95     return true;
    96 }
    97 
    98 bool SubmitInputType::isTextButton() const
    99 {
    100     return true;
    101 }
    102 
    10393} // namespace WebCore
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/SubmitInputType.h

    r272512 r273756  
    4747    bool canBeSuccessfulSubmitButton() override;
    4848    String defaultValue() const override;
    49     bool isSubmitButton() const override;
    50     bool isTextButton() const override;
    5149};
    5250
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/TelephoneInputType.cpp

    r246490 r273756  
    4242}
    4343
    44 bool TelephoneInputType::isTelephoneField() const
    45 {
    46     return true;
    47 }
    48 
    4944} // namespace WebCore
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/TelephoneInputType.h

    r272512 r273756  
    4242private:
    4343    const AtomString& formControlType() const override;
    44     bool isTelephoneField() const override;
    4544};
    4645
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/TextFieldInputType.cpp

    r272513 r273756  
    101101}
    102102
    103 bool TextFieldInputType::isTextField() const
    104 {
    105     return true;
    106 }
    107 
    108103bool TextFieldInputType::isEmptyValue() const
    109104{
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/TextFieldInputType.h

    r272512 r273756  
    9090    bool isKeyboardFocusable(KeyboardEvent*) const final;
    9191    bool isMouseFocusable() const final;
    92     bool isTextField() const final;
    9392    bool isEmptyValue() const final;
    9493    void handleBeforeTextInsertedEvent(BeforeTextInsertedEvent&) final;
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/TimeInputType.cpp

    r272512 r273756  
    103103}
    104104
    105 bool TimeInputType::isTimeField() const
    106 {
    107     return true;
    108 }
    109 
    110105void TimeInputType::handleDOMActivateEvent(Event&)
    111106{
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/TimeInputType.h

    r272512 r273756  
    4949    Optional<DateComponents> parseToDateComponents(const StringView&) const override;
    5050    Optional<DateComponents> setMillisecondToDateComponents(double) const override;
    51     bool isTimeField() const override;
    5251    void handleDOMActivateEvent(Event&) override;
    5352
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/URLInputType.cpp

    r246490 r273756  
    6262}
    6363
    64 bool URLInputType::isURLField() const
    65 {
    66     return true;
    67 }
    68 
    6964String URLInputType::sanitizeValue(const String& proposedValue) const
    7065{
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/URLInputType.h

    r272512 r273756  
    4545    bool typeMismatch() const override;
    4646    String typeMismatchText() const override;
    47     bool isURLField() const override;
    4847    String sanitizeValue(const String&) const override;
    4948};
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/WeekInputType.cpp

    r266779 r273756  
    7979}
    8080
    81 bool WeekInputType::isWeekField() const
    82 {
    83     return true;
    84 }
    85 
    8681void WeekInputType::handleDOMActivateEvent(Event&)
    8782{
  • branches/safari-611.1.21.0-branch/Source/WebCore/html/WeekInputType.h

    r272512 r273756  
    5151    Optional<DateComponents> parseToDateComponents(const StringView&) const override;
    5252    Optional<DateComponents> setMillisecondToDateComponents(double) const override;
    53     bool isWeekField() const override;
    5453    void handleDOMActivateEvent(Event&) override;
    5554
  • branches/safari-611.1.21.0-branch/Source/WebCore/page/PointerCaptureController.cpp

    r271216 r273756  
    4848}
    4949
    50 Element* PointerCaptureController::pointerCaptureElement(Document* document, PointerID pointerId)
     50Element* PointerCaptureController::pointerCaptureElement(Document* document, PointerID pointerId) const
    5151{
    5252    auto iterator = m_activePointerIdsToCapturingData.find(pointerId);
    … …  
    8686        capturingData.pendingTargetOverride = capturingTarget;
    8787
     88    updateHaveAnyCapturingElement();
    8889    return { };
    8990}
    … …  
    108109    // 3. For the specified pointerId, clear the pending pointer capture target override, if set.
    109110    iterator->value.pendingTargetOverride = nullptr;
    110 
     111   
     112    // FIXME: This leaves value.targetOverride set: webkit.org/b/221342.
     113
     114    updateHaveAnyCapturingElement();
    111115    return { };
    112116}
    … …  
    119123    // In particular, returns true if the pending pointer capture target override for pointerId is set to the element on which this method is
    120124    // invoked, and false otherwise.
     125
     126    if (!m_haveAnyCapturingElement)
     127        return false;
    121128
    122129    auto iterator = m_activePointerIdsToCapturingData.find(pointerId);
    … …  
    134141        capturingData.targetOverride = nullptr;
    135142    }
     143
     144    updateHaveAnyCapturingElement();
    136145}
    137146
    138147void PointerCaptureController::elementWasRemoved(Element& element)
    139148{
     149    if (!m_haveAnyCapturingElement)
     150        return;
     151
    140152    for (auto& keyAndValue : m_activePointerIdsToCapturingData) {
    141153        auto& capturingData = keyAndValue.value;
    … …  
    159171{
    160172    m_activePointerIdsToCapturingData.clear();
     173    m_haveAnyCapturingElement = false;
    161174
    162175    CapturingData capturingData;
    … …  
    165178}
    166179
     180void PointerCaptureController::updateHaveAnyCapturingElement()
     181{
     182    m_haveAnyCapturingElement = WTF::anyOf(m_activePointerIdsToCapturingData.values(), [&](auto& capturingData) {
     183        return capturingData.hasAnyElement();
     184    });
     185}
     186
    167187void PointerCaptureController::touchWithIdentifierWasRemoved(PointerID pointerId)
    168188{
    169189    m_activePointerIdsToCapturingData.remove(pointerId);
    170 }
    171 
    172 bool PointerCaptureController::hasCancelledPointerEventForIdentifier(PointerID pointerId)
     190    updateHaveAnyCapturingElement();
     191}
     192
     193bool PointerCaptureController::hasCancelledPointerEventForIdentifier(PointerID pointerId) const
    173194{
    174195    auto iterator = m_activePointerIdsToCapturingData.find(pointerId);
    … …  
    176197}
    177198
    178 bool PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier(PointerID pointerId)
     199bool PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier(PointerID pointerId) const
    179200{
    180201    auto iterator = m_activePointerIdsToCapturingData.find(pointerId);
  • branches/safari-611.1.21.0-branch/Source/WebCore/page/PointerCaptureController.h

    r270582 r273756  
    4747    explicit PointerCaptureController(Page&);
    4848
    49     Element* pointerCaptureElement(Document*, PointerID);
     49    Element* pointerCaptureElement(Document*, PointerID) const;
    5050    ExceptionOr<void> setPointerCapture(Element*, PointerID);
    5151    ExceptionOr<void> releasePointerCapture(Element*, PointerID);
    … …  
    6363
    6464    WEBCORE_EXPORT void touchWithIdentifierWasRemoved(PointerID);
    65     bool hasCancelledPointerEventForIdentifier(PointerID);
    66     bool preventsCompatibilityMouseEventsForIdentifier(PointerID);
     65    bool hasCancelledPointerEventForIdentifier(PointerID) const;
     66    bool preventsCompatibilityMouseEventsForIdentifier(PointerID) const;
    6767    void dispatchEvent(PointerEvent&, EventTarget*);
    6868    WEBCORE_EXPORT void cancelPointer(PointerID, const IntPoint&);
    … …  
    7676        RefPtr<Element> previousTarget;
    7777#endif
     78        bool hasAnyElement() const {
     79            return pendingTargetOverride || targetOverride
     80#if ENABLE(TOUCH_EVENTS) && PLATFORM(IOS_FAMILY)
     81                || previousTarget
     82#endif
     83                ;
     84        }
    7885        String pointerType;
    7986        bool cancelled { false };
    … …  
    8794    void pointerEventWillBeDispatched(const PointerEvent&, EventTarget*);
    8895    void pointerEventWasDispatched(const PointerEvent&);
     96   
     97    void updateHaveAnyCapturingElement();
    8998
    9099    Page& m_page;
    … …  
    94103    PointerIdToCapturingDataMap m_activePointerIdsToCapturingData;
    95104    bool m_processingPendingPointerCapture { false };
     105    bool m_haveAnyCapturingElement { false };
    96106};
    97107
Note: See TracChangeset for help on using the changeset viewer.