[webkit-changes] [WebKit/WebKit] 91f56d: Interaction regions for file and range inputs are ...

Tim Horton noreply at github.com
Tue Nov 8 16:31:18 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 91f56dce7de3dc8cdecbc8c8fe355c8e6a9ca347
      https://github.com/WebKit/WebKit/commit/91f56dce7de3dc8cdecbc8c8fe355c8e6a9ca347
  Author: Tim Horton <timothy_horton at apple.com>
  Date:   2022-11-08 (Tue, 08 Nov 2022)

  Changed paths:
    A LayoutTests/interaction-region/input-type-file-region-expected.txt
    A LayoutTests/interaction-region/input-type-file-region.html
    A LayoutTests/interaction-region/input-type-range-region-expected.txt
    A LayoutTests/interaction-region/input-type-range-region.html
    M Source/WebCore/dom/Node.cpp
    M Source/WebCore/page/InteractionRegion.cpp
    M Source/WebCore/rendering/RenderFileUploadControl.cpp
    M Source/WebCore/rendering/RenderFileUploadControl.h

  Log Message:
  -----------
  Interaction regions for file and range inputs are incorrect
https://bugs.webkit.org/show_bug.cgi?id=247645

Reviewed by Aditya Keerthi.

* LayoutTests/interaction-region/input-type-file-region-expected.txt: Added.
* LayoutTests/interaction-region/input-type-file-region.html: Added.
* LayoutTests/interaction-region/input-type-range-region-expected.txt: Added.
* LayoutTests/interaction-region/input-type-range-region.html: Added.

* Source/WebCore/dom/Node.cpp:
(WebCore::Node::willRespondToMouseClickEventsWithEditability const):
Responding to "DOMActivate" should count as responding to mouse-click,
like on macOS, because it is. I propagated this unnecessary behavior difference
forward in an earlier patch (251077 at main), now it's time to unify the two platforms.

* Source/WebCore/page/InteractionRegion.cpp:
(WebCore::shouldAllowElement):
(WebCore::shouldAllowNonPointerCursorForElement):
(WebCore::interactionRegionForRenderedRegion):
Disallow <input type="file"> and <input type="range"> from themselves generating
interaction regions; they defer to their inner button and thumb as the primary
interactible parts, respectively.

Ensure that the range thumb does generate a interaction region, even though
it uses the default cursor style, not a hand cursor.

* Source/WebCore/rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::paintObject):
(WebCore::RenderFileUploadControl::paintControl):
* Source/WebCore/rendering/RenderFileUploadControl.h:
RenderFileUploadControl previously did not generate *any* event regions of any
kind, because it aggressively cuts off painting if painting is disabled
(as it is for an event region painting pass). Call the parent class's implementation
of paintObject() even when painting is disabled, so it can emit event regions.

Canonical link: https://commits.webkit.org/256467@main




More information about the webkit-changes mailing list