Changeset 273756 in webkit
- Timestamp:
- Mar 2, 2021, 1:12:48 PM (6 years ago)
- Location:
- branches/safari-611.1.21.0-branch/Source/WebCore
- Files:
-
- 59 edited
-
ChangeLog (modified) (1 diff)
-
dom/Element.cpp (modified) (1 diff)
-
html/BaseCheckableInputType.cpp (modified) (1 diff)
-
html/BaseCheckableInputType.h (modified) (1 diff)
-
html/BaseDateAndTimeInputType.cpp (modified) (1 diff)
-
html/BaseDateAndTimeInputType.h (modified) (1 diff)
-
html/BaseTextInputType.cpp (modified) (1 diff)
-
html/BaseTextInputType.h (modified) (1 diff)
-
html/ButtonInputType.cpp (modified) (1 diff)
-
html/ButtonInputType.h (modified) (1 diff)
-
html/CheckboxInputType.cpp (modified) (1 diff)
-
html/CheckboxInputType.h (modified) (1 diff)
-
html/ColorInputType.cpp (modified) (1 diff)
-
html/ColorInputType.h (modified) (1 diff)
-
html/DateInputType.cpp (modified) (1 diff)
-
html/DateInputType.h (modified) (1 diff)
-
html/DateTimeLocalInputType.cpp (modified) (1 diff)
-
html/DateTimeLocalInputType.h (modified) (1 diff)
-
html/EmailInputType.cpp (modified) (1 diff)
-
html/EmailInputType.h (modified) (1 diff)
-
html/FileInputType.cpp (modified) (1 diff)
-
html/FileInputType.h (modified) (1 diff)
-
html/FormAssociatedElement.h (modified) (1 diff)
-
html/HTMLFormControlElement.h (modified) (2 diffs)
-
html/HTMLInputElement.cpp (modified) (1 diff)
-
html/HiddenInputType.cpp (modified) (2 diffs)
-
html/HiddenInputType.h (modified) (1 diff)
-
html/ImageInputType.cpp (modified) (2 diffs)
-
html/ImageInputType.h (modified) (2 diffs)
-
html/InputType.cpp (modified) (3 diffs)
-
html/InputType.h (modified) (8 diffs)
-
html/MonthInputType.cpp (modified) (1 diff)
-
html/MonthInputType.h (modified) (1 diff)
-
html/NumberInputType.cpp (modified) (2 diffs)
-
html/NumberInputType.h (modified) (2 diffs)
-
html/PasswordInputType.cpp (modified) (1 diff)
-
html/PasswordInputType.h (modified) (1 diff)
-
html/RadioInputType.cpp (modified) (1 diff)
-
html/RadioInputType.h (modified) (1 diff)
-
html/RangeInputType.cpp (modified) (2 diffs)
-
html/RangeInputType.h (modified) (2 diffs)
-
html/ResetInputType.cpp (modified) (2 diffs)
-
html/ResetInputType.h (modified) (1 diff)
-
html/SearchInputType.cpp (modified) (1 diff)
-
html/SearchInputType.h (modified) (1 diff)
-
html/SubmitInputType.cpp (modified) (1 diff)
-
html/SubmitInputType.h (modified) (1 diff)
-
html/TelephoneInputType.cpp (modified) (1 diff)
-
html/TelephoneInputType.h (modified) (1 diff)
-
html/TextFieldInputType.cpp (modified) (1 diff)
-
html/TextFieldInputType.h (modified) (1 diff)
-
html/TimeInputType.cpp (modified) (1 diff)
-
html/TimeInputType.h (modified) (1 diff)
-
html/URLInputType.cpp (modified) (1 diff)
-
html/URLInputType.h (modified) (1 diff)
-
html/WeekInputType.cpp (modified) (1 diff)
-
html/WeekInputType.h (modified) (1 diff)
-
page/PointerCaptureController.cpp (modified) (8 diffs)
-
page/PointerCaptureController.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-611.1.21.0-branch/Source/WebCore/ChangeLog
r273738 r273756 1 2021-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 65 2021-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 96 2021-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 128 2021-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 184 2021-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 1 460 2021-03-02 Alan Coon <alancoon@apple.com> 2 461 -
branches/safari-611.1.21.0-branch/Source/WebCore/dom/Element.cpp
r273531 r273756 3221 3221 } 3222 3222 3223 3224 3223 ExceptionOr<void> Element::setInnerHTML(const String& html) 3225 3224 { -
branches/safari-611.1.21.0-branch/Source/WebCore/html/BaseCheckableInputType.cpp
r261013 r273756 115 115 } 116 116 117 bool BaseCheckableInputType::isCheckable()118 {119 return true;120 }121 122 117 void BaseCheckableInputType::fireInputAndChangeEvents() 123 118 { -
branches/safari-611.1.21.0-branch/Source/WebCore/html/BaseCheckableInputType.h
r272512 r273756 52 52 bool storesValueSeparateFromAttribute() override; 53 53 void setValue(const String&, bool, TextFieldEventBehavior) override; 54 bool isCheckable() override;55 54 }; 56 55 -
branches/safari-611.1.21.0-branch/Source/WebCore/html/BaseDateAndTimeInputType.cpp
r272952 r273756 170 170 } 171 171 172 bool BaseDateAndTimeInputType::isSteppableSlow() const173 {174 return true;175 }176 177 172 Decimal BaseDateAndTimeInputType::parseToNumber(const String& source, const Decimal& defaultValue) const 178 173 { -
branches/safari-611.1.21.0-branch/Source/WebCore/html/BaseDateAndTimeInputType.h
r272535 r273756 103 103 ExceptionOr<void> setValueAsDecimal(const Decimal&, TextFieldEventBehavior) const final; 104 104 Decimal defaultValueForStepUp() const override; 105 bool isSteppableSlow() const final;106 105 String localizeValue(const String&) const final; 107 106 bool supportsReadOnly() const final; -
branches/safari-611.1.21.0-branch/Source/WebCore/html/BaseTextInputType.cpp
r246490 r273756 34 34 using namespace HTMLNames; 35 35 36 bool BaseTextInputType::isTextType() const37 {38 return true;39 }40 41 36 bool BaseTextInputType::patternMismatch(const String& value) const 42 37 { -
branches/safari-611.1.21.0-branch/Source/WebCore/html/BaseTextInputType.h
r272512 r273756 41 41 explicit BaseTextInputType(Type type, HTMLInputElement& element) : TextFieldInputType(type, element) { } 42 42 43 bool isTextType() const override;44 43 bool patternMismatch(const String&) const override; 45 44 bool supportsPlaceholder() const override; -
branches/safari-611.1.21.0-branch/Source/WebCore/html/ButtonInputType.cpp
r246490 r273756 41 41 } 42 42 43 bool ButtonInputType::supportsValidation() const44 {45 return false;46 }47 48 bool ButtonInputType::isTextButton() const49 {50 return true;51 }52 53 43 } // namespace WebCore -
branches/safari-611.1.21.0-branch/Source/WebCore/html/ButtonInputType.h
r272512 r273756 42 42 private: 43 43 const AtomString& formControlType() const override; 44 bool supportsValidation() const override;45 bool isTextButton() const override;46 44 }; 47 45 -
branches/safari-611.1.21.0-branch/Source/WebCore/html/CheckboxInputType.cpp
r246490 r273756 93 93 } 94 94 95 bool CheckboxInputType::isCheckbox() const96 {97 return true;98 }99 100 95 bool CheckboxInputType::matchesIndeterminatePseudoClass() const 101 96 { -
branches/safari-611.1.21.0-branch/Source/WebCore/html/CheckboxInputType.h
r272512 r273756 47 47 void willDispatchClick(InputElementClickState&) final; 48 48 void didDispatchClick(Event&, const InputElementClickState&) final; 49 bool isCheckbox() const final;50 49 bool matchesIndeterminatePseudoClass() const final; 51 50 bool shouldAppearIndeterminate() const final; -
branches/safari-611.1.21.0-branch/Source/WebCore/html/ColorInputType.cpp
r272513 r273756 101 101 } 102 102 103 bool ColorInputType::isColorControl() const104 {105 return true;106 }107 108 103 bool ColorInputType::isPresentingAttachedView() const 109 104 { -
branches/safari-611.1.21.0-branch/Source/WebCore/html/ColorInputType.h
r272512 r273756 53 53 bool isMouseFocusable() const final; 54 54 bool isKeyboardFocusable(KeyboardEvent*) const final; 55 bool isColorControl() const final;56 55 bool isPresentingAttachedView() const final; 57 56 const AtomString& formControlType() const final; -
branches/safari-611.1.21.0-branch/Source/WebCore/html/DateInputType.cpp
r272512 r273756 85 85 } 86 86 87 bool DateInputType::isDateField() const88 {89 return true;90 }91 92 87 bool DateInputType::isValidFormat(OptionSet<DateTimeFormatValidationResults> results) const 93 88 { -
branches/safari-611.1.21.0-branch/Source/WebCore/html/DateInputType.h
r272512 r273756 48 48 Optional<DateComponents> parseToDateComponents(const StringView&) const override; 49 49 Optional<DateComponents> setMillisecondToDateComponents(double) const override; 50 bool isDateField() const override;51 50 52 51 bool isValidFormat(OptionSet<DateTimeFormatValidationResults>) const final; -
branches/safari-611.1.21.0-branch/Source/WebCore/html/DateTimeLocalInputType.cpp
r267003 r273756 94 94 } 95 95 96 bool DateTimeLocalInputType::isDateTimeLocalField() const97 {98 return true;99 }100 101 96 bool DateTimeLocalInputType::isValidFormat(OptionSet<DateTimeFormatValidationResults> results) const 102 97 { -
branches/safari-611.1.21.0-branch/Source/WebCore/html/DateTimeLocalInputType.h
r272512 r273756 53 53 Optional<DateComponents> parseToDateComponents(const StringView&) const final; 54 54 Optional<DateComponents> setMillisecondToDateComponents(double) const final; 55 bool isDateTimeLocalField() const final;56 55 57 56 bool isValidFormat(OptionSet<DateTimeFormatValidationResults>) const final; -
branches/safari-611.1.21.0-branch/Source/WebCore/html/EmailInputType.cpp
r246490 r273756 84 84 } 85 85 86 bool EmailInputType::isEmailField() const87 {88 return true;89 }90 91 86 bool EmailInputType::supportsSelectionAPI() const 92 87 { -
branches/safari-611.1.21.0-branch/Source/WebCore/html/EmailInputType.h
r272512 r273756 45 45 bool typeMismatch() const override; 46 46 String typeMismatchText() const override; 47 bool isEmailField() const override;48 47 bool supportsSelectionAPI() const override; 49 48 String sanitizeValue(const String&) const override; -
branches/safari-611.1.21.0-branch/Source/WebCore/html/FileInputType.cpp
r272513 r273756 274 274 } 275 275 276 bool FileInputType::isFileUpload() const277 {278 return true;279 }280 281 276 void FileInputType::createShadowSubtreeAndUpdateInnerTextElementEditability(ContainerNode::ChildChange::Source source, bool) 282 277 { -
branches/safari-611.1.21.0-branch/Source/WebCore/html/FileInputType.h
r272512 r273756 78 78 79 79 Icon* icon() const final; 80 bool isFileUpload() const final;81 80 void createShadowSubtreeAndUpdateInnerTextElementEditability(ContainerNode::ChildChange::Source, bool) final; 82 81 void disabledStateChanged() final; -
branches/safari-611.1.21.0-branch/Source/WebCore/html/FormAssociatedElement.h
r259393 r273756 111 111 112 112 private: 113 // "willValidate" means "is a candidate for constraint validation". 113 114 virtual bool willValidate() const = 0; 114 115 virtual void refFormAssociatedElement() = 0; -
branches/safari-611.1.21.0-branch/Source/WebCore/html/HTMLFormControlElement.h
r273388 r273756 101 101 #endif 102 102 103 // "willValidate" means "is a candidate for constraint validation". 103 104 WEBCORE_EXPORT bool willValidate() const final; 104 105 void updateVisibleValidationMessage(); … … 114 115 115 116 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; } 117 118 118 119 bool hasAutofocused() { return m_hasAutofocused; } -
branches/safari-611.1.21.0-branch/Source/WebCore/html/HTMLInputElement.cpp
r273388 r273756 1019 1019 { 1020 1020 String value; 1021 if (m_inputType-> getTypeSpecificValue(value))1021 if (m_inputType->canHaveTypeSpecificValue() && m_inputType->getTypeSpecificValue(value)) 1022 1022 return value; 1023 1023 -
branches/safari-611.1.21.0-branch/Source/WebCore/html/HiddenInputType.cpp
r259687 r273756 63 63 } 64 64 65 bool HiddenInputType::supportsValidation() const66 {67 return false;68 }69 70 65 RenderPtr<RenderElement> HiddenInputType::createInputRenderer(RenderStyle&&) 71 66 { … … 95 90 } 96 91 97 bool HiddenInputType::isHiddenType() const98 {99 return true;100 }101 102 92 bool HiddenInputType::appendFormData(DOMFormData& formData, bool isMultipartForm) const 103 93 { -
branches/safari-611.1.21.0-branch/Source/WebCore/html/HiddenInputType.h
r272512 r273756 44 44 FormControlState saveFormControlState() const override; 45 45 void restoreFormControlState(const FormControlState&) override; 46 bool supportsValidation() const override;47 46 RenderPtr<RenderElement> createInputRenderer(RenderStyle&&) override; 48 47 bool accessKeyAction(bool sendMouseEvents) override; 49 48 bool rendererIsNeeded() override; 50 49 bool storesValueSeparateFromAttribute() override; 51 bool isHiddenType() const override;52 bool supportLabels() const override { return false; }53 bool isInteractiveContent() const final { return false; }54 50 bool shouldRespectHeightAndWidthAttributes() override; 55 51 void setValue(const String&, bool, TextFieldEventBehavior) override; -
branches/safari-611.1.21.0-branch/Source/WebCore/html/ImageInputType.cpp
r272512 r273756 76 76 77 77 return true; 78 }79 80 bool ImageInputType::supportsValidation() const81 {82 return false;83 78 } 84 79 … … 172 167 } 173 168 174 bool ImageInputType::isImageButton() const175 {176 return true;177 }178 179 bool ImageInputType::isEnumeratable()180 {181 return false;182 }183 184 169 bool ImageInputType::shouldRespectHeightAndWidthAttributes() 185 170 { -
branches/safari-611.1.21.0-branch/Source/WebCore/html/ImageInputType.h
r272512 r273756 47 47 bool isFormDataAppendable() const final; 48 48 bool appendFormData(DOMFormData&, bool) const final; 49 bool supportsValidation() const final;50 49 RenderPtr<RenderElement> createInputRenderer(RenderStyle&&) final; 51 50 void handleDOMActivateEvent(Event&) final; … … 54 53 bool shouldRespectAlignAttribute() final; 55 54 bool canBeSuccessfulSubmitButton() final; 56 bool isImageButton() const final;57 bool isEnumeratable() final;58 55 bool shouldRespectHeightAndWidthAttributes() final; 59 56 unsigned height() const final; -
branches/safari-611.1.21.0-branch/Source/WebCore/html/InputType.cpp
r272512 r273756 167 167 } 168 168 169 bool InputType::isTextField() const170 {171 return false;172 }173 174 bool InputType::isTextType() const175 {176 return false;177 }178 179 bool InputType::isRangeControl() const180 {181 return false;182 }183 184 169 bool InputType::shouldSaveAndRestoreFormControlState() const 185 170 { … … 240 225 { 241 226 return Exception { InvalidStateError }; 242 }243 244 bool InputType::supportsValidation() const245 {246 return true;247 227 } 248 228 … … 817 797 } 818 798 819 bool InputType::isTextButton() const820 {821 return false;822 }823 824 bool InputType::isRadioButton() const825 {826 return false;827 }828 829 bool InputType::isSearchField() const830 {831 return false;832 }833 834 bool InputType::isHiddenType() const835 {836 return false;837 }838 839 bool InputType::isPasswordField() const840 {841 return false;842 }843 844 bool InputType::isCheckbox() const845 {846 return false;847 }848 849 bool InputType::isEmailField() const850 {851 return false;852 }853 854 bool InputType::isFileUpload() const855 {856 return false;857 }858 859 bool InputType::isImageButton() const860 {861 return false;862 }863 864 799 bool InputType::isInteractiveContent() const 865 800 { 866 return true;801 return m_type != Type::Hidden; 867 802 } 868 803 869 804 bool InputType::supportLabels() const 870 805 { 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 809 bool InputType::isEnumeratable() const 810 { 811 return m_type != Type::Image; 956 812 } 957 813 -
branches/safari-611.1.21.0-branch/Source/WebCore/html/InputType.h
r272512 r273756 38 38 #include <wtf/FastMalloc.h> 39 39 #include <wtf/Forward.h> 40 #include <wtf/OptionSet.h> 40 41 #include <wtf/RefCounted.h> 41 42 #include <wtf/RefPtr.h> … … 72 73 WTF_MAKE_FAST_ALLOCATED; 73 74 public: 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, 97 145 }; 98 146 … … 116 164 // scattered code with special cases for various types. 117 165 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); } 144 198 // Form value functions. 145 199 … … 164 218 165 219 virtual String validationMessage() const; 166 virtual bool supportsValidation() const;167 220 virtual bool typeMismatchFor(const String&) const; 168 221 virtual bool supportsRequired() const; … … 184 237 virtual ExceptionOr<void> stepUp(int); 185 238 virtual void stepUpFromRenderer(int); 239 bool canHaveTypeSpecificValue() const { return isFileUpload(); } 186 240 virtual String badInputText() const; 187 241 virtual String typeMismatchText() const; … … 277 331 virtual bool shouldResetOnDocumentActivation(); 278 332 virtual bool shouldRespectListAttribute(); 279 virtual bool isEnumeratable();280 virtual bool isCheckable();281 333 virtual bool shouldRespectHeightAndWidthAttributes(); 282 334 virtual bool supportsPlaceholder() const; … … 299 351 virtual Vector<Color> suggestedColors() const; 300 352 301 bool isSteppable() const;302 303 353 // Parses the specified string for the type, and return 304 354 // the Decimal value for the parsing result if the parsing … … 341 391 Chrome* chrome() const; 342 392 Decimal parseToNumberOrNaN(const String&) const; 343 virtual bool isSteppableSlow() const { return false; }344 393 345 394 private: -
branches/safari-611.1.21.0-branch/Source/WebCore/html/MonthInputType.cpp
r268276 r273756 128 128 } 129 129 130 bool MonthInputType::isMonthField() const131 {132 return true;133 }134 135 130 void MonthInputType::handleDOMActivateEvent(Event&) 136 131 { -
branches/safari-611.1.21.0-branch/Source/WebCore/html/MonthInputType.h
r272512 r273756 55 55 Optional<DateComponents> parseToDateComponents(const StringView&) const override; 56 56 Optional<DateComponents> setMillisecondToDateComponents(double) const override; 57 bool isMonthField() const override;58 57 void handleDOMActivateEvent(Event&) override; 59 58 -
branches/safari-611.1.21.0-branch/Source/WebCore/html/NumberInputType.cpp
r272512 r273756 211 211 } 212 212 213 bool NumberInputType::isSteppableSlow() const214 {215 return true;216 }217 218 213 auto NumberInputType::handleKeydownEvent(KeyboardEvent& event) -> ShouldCallBaseEventHandler 219 214 { … … 289 284 290 285 bool NumberInputType::supportsPlaceholder() const 291 {292 return true;293 }294 295 bool NumberInputType::isNumberField() const296 286 { 297 287 return true; -
branches/safari-611.1.21.0-branch/Source/WebCore/html/NumberInputType.h
r272512 r273756 51 51 bool sizeShouldIncludeDecoration(int defaultSize, int& preferredSize) const final; 52 52 float decorationWidth() const final; 53 bool isSteppableSlow() const final;54 53 StepRange createStepRange(AnyStepHandling) const final; 55 54 ShouldCallBaseEventHandler handleKeydownEvent(KeyboardEvent&) final; … … 63 62 String badInputText() const final; 64 63 bool supportsPlaceholder() const final; 65 bool isNumberField() const final;66 64 void attributeChanged(const QualifiedName&) final; 67 65 }; -
branches/safari-611.1.21.0-branch/Source/WebCore/html/PasswordInputType.cpp
r254675 r273756 87 87 } 88 88 89 bool PasswordInputType::isPasswordField() const90 {91 return true;92 }93 94 89 } // namespace WebCore -
branches/safari-611.1.21.0-branch/Source/WebCore/html/PasswordInputType.h
r272512 r273756 48 48 bool shouldResetOnDocumentActivation() override; 49 49 bool shouldRespectListAttribute() override; 50 bool isPasswordField() const override;51 50 }; 52 51 -
branches/safari-611.1.21.0-branch/Source/WebCore/html/RadioInputType.cpp
r269452 r273756 181 181 } 182 182 183 bool RadioInputType::isRadioButton() const184 {185 return true;186 }187 188 183 bool RadioInputType::matchesIndeterminatePseudoClass() const 189 184 { -
branches/safari-611.1.21.0-branch/Source/WebCore/html/RadioInputType.h
r272512 r273756 52 52 void willDispatchClick(InputElementClickState&) final; 53 53 void didDispatchClick(Event&, const InputElementClickState&) final; 54 bool isRadioButton() const final;55 54 bool matchesIndeterminatePseudoClass() const final; 56 55 }; -
branches/safari-611.1.21.0-branch/Source/WebCore/html/RangeInputType.cpp
r272513 r273756 85 85 } 86 86 87 bool RangeInputType::isRangeControl() const88 {89 return true;90 }91 92 87 const AtomString& RangeInputType::formControlType() const 93 88 { … … 132 127 const Decimal step = StepRange::parseStep(anyStepHandling, rangeStepDescription, element()->attributeWithoutSynchronization(stepAttr)); 133 128 return StepRange(minimum, RangeLimitations::Valid, minimum, maximum, step, rangeStepDescription); 134 }135 136 bool RangeInputType::isSteppableSlow() const137 {138 return true;139 129 } 140 130 -
branches/safari-611.1.21.0-branch/Source/WebCore/html/RangeInputType.h
r272512 r273756 44 44 45 45 private: 46 bool isRangeControl() const final;47 46 const AtomString& formControlType() const final; 48 47 double valueAsDouble() const final; … … 51 50 bool supportsRequired() const final; 52 51 StepRange createStepRange(AnyStepHandling) const final; 53 bool isSteppableSlow() const final;54 52 void handleMouseDownEvent(MouseEvent&) final; 55 53 ShouldCallBaseEventHandler handleKeydownEvent(KeyboardEvent&) final; -
branches/safari-611.1.21.0-branch/Source/WebCore/html/ResetInputType.cpp
r246490 r273756 46 46 } 47 47 48 bool ResetInputType::supportsValidation() const49 {50 return false;51 }52 53 48 void ResetInputType::handleDOMActivateEvent(Event& event) 54 49 { … … 65 60 } 66 61 67 bool ResetInputType::isTextButton() const68 {69 return true;70 }71 72 62 } // namespace WebCore -
branches/safari-611.1.21.0-branch/Source/WebCore/html/ResetInputType.h
r272512 r273756 42 42 private: 43 43 const AtomString& formControlType() const override; 44 bool supportsValidation() const override;45 44 void handleDOMActivateEvent(Event&) override; 46 45 String defaultValue() const override; 47 bool isTextButton() const override;48 46 }; 49 47 -
branches/safari-611.1.21.0-branch/Source/WebCore/html/SearchInputType.cpp
r272512 r273756 98 98 } 99 99 100 bool SearchInputType::isSearchField() const101 {102 return true;103 }104 105 100 bool SearchInputType::needsContainer() const 106 101 { -
branches/safari-611.1.21.0-branch/Source/WebCore/html/SearchInputType.h
r272512 r273756 51 51 RenderPtr<RenderElement> createInputRenderer(RenderStyle&&) final; 52 52 const AtomString& formControlType() const final; 53 bool isSearchField() const final;54 53 bool needsContainer() const final; 55 54 void createShadowSubtreeAndUpdateInnerTextElementEditability(ContainerNode::ChildChange::Source, bool) final; -
branches/safari-611.1.21.0-branch/Source/WebCore/html/SubmitInputType.cpp
r246490 r273756 91 91 } 92 92 93 bool SubmitInputType::isSubmitButton() const94 {95 return true;96 }97 98 bool SubmitInputType::isTextButton() const99 {100 return true;101 }102 103 93 } // namespace WebCore -
branches/safari-611.1.21.0-branch/Source/WebCore/html/SubmitInputType.h
r272512 r273756 47 47 bool canBeSuccessfulSubmitButton() override; 48 48 String defaultValue() const override; 49 bool isSubmitButton() const override;50 bool isTextButton() const override;51 49 }; 52 50 -
branches/safari-611.1.21.0-branch/Source/WebCore/html/TelephoneInputType.cpp
r246490 r273756 42 42 } 43 43 44 bool TelephoneInputType::isTelephoneField() const45 {46 return true;47 }48 49 44 } // namespace WebCore -
branches/safari-611.1.21.0-branch/Source/WebCore/html/TelephoneInputType.h
r272512 r273756 42 42 private: 43 43 const AtomString& formControlType() const override; 44 bool isTelephoneField() const override;45 44 }; 46 45 -
branches/safari-611.1.21.0-branch/Source/WebCore/html/TextFieldInputType.cpp
r272513 r273756 101 101 } 102 102 103 bool TextFieldInputType::isTextField() const104 {105 return true;106 }107 108 103 bool TextFieldInputType::isEmptyValue() const 109 104 { -
branches/safari-611.1.21.0-branch/Source/WebCore/html/TextFieldInputType.h
r272512 r273756 90 90 bool isKeyboardFocusable(KeyboardEvent*) const final; 91 91 bool isMouseFocusable() const final; 92 bool isTextField() const final;93 92 bool isEmptyValue() const final; 94 93 void handleBeforeTextInsertedEvent(BeforeTextInsertedEvent&) final; -
branches/safari-611.1.21.0-branch/Source/WebCore/html/TimeInputType.cpp
r272512 r273756 103 103 } 104 104 105 bool TimeInputType::isTimeField() const106 {107 return true;108 }109 110 105 void TimeInputType::handleDOMActivateEvent(Event&) 111 106 { -
branches/safari-611.1.21.0-branch/Source/WebCore/html/TimeInputType.h
r272512 r273756 49 49 Optional<DateComponents> parseToDateComponents(const StringView&) const override; 50 50 Optional<DateComponents> setMillisecondToDateComponents(double) const override; 51 bool isTimeField() const override;52 51 void handleDOMActivateEvent(Event&) override; 53 52 -
branches/safari-611.1.21.0-branch/Source/WebCore/html/URLInputType.cpp
r246490 r273756 62 62 } 63 63 64 bool URLInputType::isURLField() const65 {66 return true;67 }68 69 64 String URLInputType::sanitizeValue(const String& proposedValue) const 70 65 { -
branches/safari-611.1.21.0-branch/Source/WebCore/html/URLInputType.h
r272512 r273756 45 45 bool typeMismatch() const override; 46 46 String typeMismatchText() const override; 47 bool isURLField() const override;48 47 String sanitizeValue(const String&) const override; 49 48 }; -
branches/safari-611.1.21.0-branch/Source/WebCore/html/WeekInputType.cpp
r266779 r273756 79 79 } 80 80 81 bool WeekInputType::isWeekField() const82 {83 return true;84 }85 86 81 void WeekInputType::handleDOMActivateEvent(Event&) 87 82 { -
branches/safari-611.1.21.0-branch/Source/WebCore/html/WeekInputType.h
r272512 r273756 51 51 Optional<DateComponents> parseToDateComponents(const StringView&) const override; 52 52 Optional<DateComponents> setMillisecondToDateComponents(double) const override; 53 bool isWeekField() const override;54 53 void handleDOMActivateEvent(Event&) override; 55 54 -
branches/safari-611.1.21.0-branch/Source/WebCore/page/PointerCaptureController.cpp
r271216 r273756 48 48 } 49 49 50 Element* PointerCaptureController::pointerCaptureElement(Document* document, PointerID pointerId) 50 Element* PointerCaptureController::pointerCaptureElement(Document* document, PointerID pointerId) const 51 51 { 52 52 auto iterator = m_activePointerIdsToCapturingData.find(pointerId); … … 86 86 capturingData.pendingTargetOverride = capturingTarget; 87 87 88 updateHaveAnyCapturingElement(); 88 89 return { }; 89 90 } … … 108 109 // 3. For the specified pointerId, clear the pending pointer capture target override, if set. 109 110 iterator->value.pendingTargetOverride = nullptr; 110 111 112 // FIXME: This leaves value.targetOverride set: webkit.org/b/221342. 113 114 updateHaveAnyCapturingElement(); 111 115 return { }; 112 116 } … … 119 123 // In particular, returns true if the pending pointer capture target override for pointerId is set to the element on which this method is 120 124 // invoked, and false otherwise. 125 126 if (!m_haveAnyCapturingElement) 127 return false; 121 128 122 129 auto iterator = m_activePointerIdsToCapturingData.find(pointerId); … … 134 141 capturingData.targetOverride = nullptr; 135 142 } 143 144 updateHaveAnyCapturingElement(); 136 145 } 137 146 138 147 void PointerCaptureController::elementWasRemoved(Element& element) 139 148 { 149 if (!m_haveAnyCapturingElement) 150 return; 151 140 152 for (auto& keyAndValue : m_activePointerIdsToCapturingData) { 141 153 auto& capturingData = keyAndValue.value; … … 159 171 { 160 172 m_activePointerIdsToCapturingData.clear(); 173 m_haveAnyCapturingElement = false; 161 174 162 175 CapturingData capturingData; … … 165 178 } 166 179 180 void PointerCaptureController::updateHaveAnyCapturingElement() 181 { 182 m_haveAnyCapturingElement = WTF::anyOf(m_activePointerIdsToCapturingData.values(), [&](auto& capturingData) { 183 return capturingData.hasAnyElement(); 184 }); 185 } 186 167 187 void PointerCaptureController::touchWithIdentifierWasRemoved(PointerID pointerId) 168 188 { 169 189 m_activePointerIdsToCapturingData.remove(pointerId); 170 } 171 172 bool PointerCaptureController::hasCancelledPointerEventForIdentifier(PointerID pointerId) 190 updateHaveAnyCapturingElement(); 191 } 192 193 bool PointerCaptureController::hasCancelledPointerEventForIdentifier(PointerID pointerId) const 173 194 { 174 195 auto iterator = m_activePointerIdsToCapturingData.find(pointerId); … … 176 197 } 177 198 178 bool PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier(PointerID pointerId) 199 bool PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier(PointerID pointerId) const 179 200 { 180 201 auto iterator = m_activePointerIdsToCapturingData.find(pointerId); -
branches/safari-611.1.21.0-branch/Source/WebCore/page/PointerCaptureController.h
r270582 r273756 47 47 explicit PointerCaptureController(Page&); 48 48 49 Element* pointerCaptureElement(Document*, PointerID) ;49 Element* pointerCaptureElement(Document*, PointerID) const; 50 50 ExceptionOr<void> setPointerCapture(Element*, PointerID); 51 51 ExceptionOr<void> releasePointerCapture(Element*, PointerID); … … 63 63 64 64 WEBCORE_EXPORT void touchWithIdentifierWasRemoved(PointerID); 65 bool hasCancelledPointerEventForIdentifier(PointerID) ;66 bool preventsCompatibilityMouseEventsForIdentifier(PointerID) ;65 bool hasCancelledPointerEventForIdentifier(PointerID) const; 66 bool preventsCompatibilityMouseEventsForIdentifier(PointerID) const; 67 67 void dispatchEvent(PointerEvent&, EventTarget*); 68 68 WEBCORE_EXPORT void cancelPointer(PointerID, const IntPoint&); … … 76 76 RefPtr<Element> previousTarget; 77 77 #endif 78 bool hasAnyElement() const { 79 return pendingTargetOverride || targetOverride 80 #if ENABLE(TOUCH_EVENTS) && PLATFORM(IOS_FAMILY) 81 || previousTarget 82 #endif 83 ; 84 } 78 85 String pointerType; 79 86 bool cancelled { false }; … … 87 94 void pointerEventWillBeDispatched(const PointerEvent&, EventTarget*); 88 95 void pointerEventWasDispatched(const PointerEvent&); 96 97 void updateHaveAnyCapturingElement(); 89 98 90 99 Page& m_page; … … 94 103 PointerIdToCapturingDataMap m_activePointerIdsToCapturingData; 95 104 bool m_processingPendingPointerCapture { false }; 105 bool m_haveAnyCapturingElement { false }; 96 106 }; 97 107
Note:
See TracChangeset
for help on using the changeset viewer.