Skip to content

Commit

Permalink
Treat a null elementNs in getPropertyType/geAtributeType as the HTML …
Browse files Browse the repository at this point in the history
…namespace (#557)

This is the behavior that Chromium and WebKit currently implement, see
https://phabricator.services.mozilla.com/D226547

Currently, it seems that the "interface for localName and elementNs"
would fallback to `Element`, similarly to what happens with
`document.createElementNS(null, "div")` for example.

Note that a null attrNs is already handled by the spec.

See also #553 for details.
  • Loading branch information
fred-wang authored Oct 28, 2024
1 parent e5717b9 commit 3f3a848
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ Its value is initially « ».
This function returns the result of the following algorithm:

1. Set |localName| to |tagName| in [=ASCII lowercase=].
1. If |elementNs| is an empty string, set |elementNs| to [=HTML namespace=].
1. If |elementNs| is null or an empty string, set |elementNs| to [=HTML namespace=].
1. Let |interface| be the [=element interface=] for |localName| and |elementNs|.
1. Let |expectedType| be null.
1. Find the row in the following table, where the first column is "*" or |interface|'s name, and |property| is in the second column.
Expand Down Expand Up @@ -714,7 +714,7 @@ Its value is initially « ».

1. Set |localName| to |tagName| in [=ASCII lowercase=].
1. Set |attribute| to |attribute| in [=ASCII lowercase=].
1. If |elementNs| is an empty string, set |elementNs| to [=HTML namespace=].
1. If |elementNs| is null or an empty string, set |elementNs| to [=HTML namespace=].
1. If |attrNs| is an empty string, set |attrNs| to null.
1. Let |interface| be the [=element interface=] for |localName| and |elementNs|.
1. Let |expectedType| be null.
Expand Down

0 comments on commit 3f3a848

Please sign in to comment.