Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element.outerHTML setter specification doesn't match majority of browsers #70

Open
cdumez opened this issue Jun 13, 2021 · 2 comments
Open

Comments

@cdumez
Copy link

cdumez commented Jun 13, 2021

While working on trying to align WebKit's Element.outerHTML setter with other browsers, I noticed a few issues:

  1. WebKit & Blink have logic in the setter to merge with the previous & next Text nodes after inserting the fragment. This is not present in the specification and Gecko doesn't seem to implement it.
  2. WebKit & Blink throw a NoModificationAllowedError if the parent is not an Element while the specification allows setting outerHTML when the parent is a DocumentFragment. Gecko doesn't throw so they may be matching the spec here, not sure.
  3. The specification says that we should early return without throwing if the parent is null. Per point 2, WebKit & Blink throw a NoModificationAllowedError instead. It seems Gecko matches the spec.
@cdumez
Copy link
Author

cdumez commented Jun 13, 2021

Looks like the Text node merging logic was added to WebKit by a Chromium engineer via https://bugs.webkit.org/show_bug.cgi?id=52686, and the following spec bug was filed at the time: https://www.w3.org/Bugs/Public/show_bug.cgi?id=12584.

@annevk
Copy link
Member

annevk commented Jun 14, 2021

Aligning Gecko is tracked in https://bugzilla.mozilla.org/show_bug.cgi?id=1713492.

The Text node merging logic should probably be shared with outerText (though I haven't investigated deeply).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants