Skip to content

Commit

Permalink
Make language of a node consider lang attribute on SVG elements.
Browse files Browse the repository at this point in the history
The rules for finding the language of a node were made somewhat more
formal in 11dc4c7 (PR whatwg#9796,
fixing whatwg#3699).  Both before and after that change they considered the
lang attribute in the XML namespace, and the lang attribute in no
namespace on HTML elements.  However, the SVG spec at
https://www.w3.org/TR/2018/CR-SVG2-20181004/struct.html#LangSpaceAttrs
has very similar wording to the HTML spec prior to that edit, and also
defined a lang attribute on SVG elements.

This updates the language of a node algorithm in HTML to consider SVG
elements as well, since implementing it as written (without this change)
breaks the lang attribute in SVG.
  • Loading branch information
dbaron committed Oct 25, 2023
1 parent 2e54ab5 commit a81dec0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -13326,8 +13326,9 @@ Transport Protocol">HTTP&lt;/abbr> today.&lt;/p></code></pre> <!-- DO NOT REWRAP
attribute in the <span>XML namespace</span></span> set</dt>
<dd><p>Use the value of that attribute.</p></dd>

<dt>If the node is an <span data-x="HTML elements">HTML element</span> and has a <code
data-x="attr-lang">lang</code> in no namespace attribute set.</dt>
<dt>If the node is an <span data-x="HTML elements">HTML element</span> or an element in the
<span>SVG namespace</span>, and it has a <code data-x="attr-lang">lang</code> in no namespace
attribute set.</dt>
<dd><p>Use the value of that attribute.</p></dd>

<dt>If the node's parent is a <span>shadow root</span></dt>
Expand Down

0 comments on commit a81dec0

Please sign in to comment.