[webkit-changes] [WebKit/WebKit] 58de43: Address several HTMLAreaElement issues

Anne van Kesteren noreply at github.com
Mon Dec 18 08:30:27 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 58de43fa036103b85219dd3bea560d1708ffdbb4
      https://github.com/WebKit/WebKit/commit/58de43fa036103b85219dd3bea560d1708ffdbb4
  Author: Anne van Kesteren <annevk at annevk.nl>
  Date:   2023-12-18 (Mon, 18 Dec 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-area-element/area-processing-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-area-element/support/hit-test.js
    M Source/WebCore/html/HTMLAreaElement.cpp
    M Source/WebCore/html/HTMLAreaElement.h

  Log Message:
  -----------
  Address several HTMLAreaElement issues
https://bugs.webkit.org/show_bug.cgi?id=257229
rdar://110028213

Reviewed by Chris Dumez.

web-platform-tests did not have adequate coverage for the shape
attribute being missing due to a typo. Despite that, WebKit was alone
in inferring the shape from the coords attribute. So remove that logic
and firmly establish Shape::Rect as the default. (This also matches the
HTML Standard.)

Then, WebKit failed a test for not using the even-odd winding rule for
hit testing. The HTML Standard requires that with this sentence:

> The shape is a polygon whose vertices are given by the coordinates,
> and whose interior is established using the even-odd rule.

And then finally, we clean up the code by turning m_shape into an enum
class and generally tidying up.

* LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-area-element/area-processing-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-area-element/support/hit-test.js:
(onload):
* Source/WebCore/html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::HTMLAreaElement):
(WebCore::HTMLAreaElement::attributeChanged):
(WebCore::HTMLAreaElement::mapMouseEvent):
(WebCore::HTMLAreaElement::computePath const):
(WebCore::HTMLAreaElement::computePathForFocusRing const):
(WebCore::HTMLAreaElement::getRegion const):
* Source/WebCore/html/HTMLAreaElement.h:

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




More information about the webkit-changes mailing list