Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information