[webkit-changes] [WebKit/WebKit] 659902: Honor “lang” attribute in no namespace only on HTM...

sideshowbarker noreply at github.com
Mon Jan 29 21:27:15 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6599021230e5957efed742285983012bd5b5703f
      https://github.com/WebKit/WebKit/commit/6599021230e5957efed742285983012bd5b5703f
  Author: Michael[tm] Smith <mike at w3.org>
  Date:   2024-01-29 (Mon, 29 Jan 2024)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/html/dom/elements/global-attributes/lang-attribute.window-expected.txt
    M Source/WebCore/dom/Element.cpp

  Log Message:
  -----------
  Honor “lang” attribute in no namespace only on HTML and SVG elements
https://bugs.webkit.org/show_bug.cgi?id=263655

Reviewed by Ryosuke Niwa.

https://github.com/whatwg/html/pull/9882/files added the phrase “or an
element in the SVG namespace” in the following HTML spec text:

> To determine the language of a node, user agents must use the first
appropriate step in the following list:
>> - If the node is an HTML element or an element in the SVG namespace,
    and it has a lang in no namespace attribute set: Use the value of
    that attribute.

And that updated spec text is now part of the HTML standard, at
https://html.spec.whatwg.org/#the-lang-and-xml:lang-attributes:svg-namespace

Gecko has already had that behavior implemented for quite a while, and
Blink was recently updated to implement it as well.

So this change fully aligns WebKit with that updated spec text, and with
the current behavior in Gecko and Blink. However, this change does that
by updating the code to *restrict* the “lang” attribute in no namespace
to *only* being honored on HTML and SVG elements.

Otherwise, without this code change, WebKit honors the “lang” attribute
in no namespace regardless of what element it’s specified on (that is,
not just for HTML elements and SVG elements) — which breaks conformance
with the spec, and breaks interoperability with Gecko and Blink.

* LayoutTests/imported/w3c/web-platform-tests/html/dom/elements/global-attributes/lang-attribute.window-expected.txt:
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::attributeChanged):

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




More information about the webkit-changes mailing list