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

Setting outerHTML on child of DocumentFragment should not throw error #15575

Conversation

Ahmad-S792
Copy link
Contributor

@Ahmad-S792 Ahmad-S792 commented Jul 5, 2023

b41af45

Setting outerHTML on child of DocumentFragment should not throw error

https://bugs.webkit.org/show_bug.cgi?id=249737
rdar://problem/103746193

Reviewed by Chris Dumez.

This patch aligns WebKit with Gecko / Firefox and Web-Spec [1].

In 238774@main, WebKit aligned with behavior for better compatibility but
it was not correct and clarified later to not throw error [2]. This PR is
essentially revert part of 238774@main with update to align by not throwing error.

[1] https://w3c.github.io/DOM-Parsing/#dom-element-outerhtml
[2] whatwg/html#8657

* Source/WebCore/dom/Element.cpp:
(Element::setOuterHTML): Update to not throw error
* LayoutTests/fast/dynamic/outerHTML-no-element.html: Rebaselined
* LayoutTests/fast/dynamic/outerHTML-no-element-expected.txt: Rebaselined
* LayoutTests/fast/dom/set-outer-html-special-cases.html: Rebaselined
* LayoutTests/fast/dom/set-outer-html-special-cases-expected.txt: Rebaselined

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

cdf5c2e

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@Ahmad-S792 Ahmad-S792 added the DOM For bugs specific to XML/HTML DOM elements (including parsing). label Jul 5, 2023
@Ahmad-S792 Ahmad-S792 self-assigned this Jul 5, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jul 5, 2023
@Ahmad-S792
Copy link
Contributor Author

@cdumez - We have genuine WPT test failure (domparsing/outerhtml-01.html), we pass, if we return error. Although Firefox passes WPT test plus also don't throw error.

@Ahmad-S792
Copy link
Contributor Author

@cdumez - We have genuine WPT test failure (domparsing/outerhtml-01.html), we pass, if we return error. Although Firefox passes WPT test plus also don't throw error.

Figured out locally on how to fix it. We don't need to revert completely but just change 'return' for one specific type of case. Will do updated push tomorrow (late here - 12 AM).

@Ahmad-S792 Ahmad-S792 force-pushed the fix249737-outerHTML-on-child-of-DocumentFragment-throw-error branch from ea6917e to ca7fb05 Compare July 15, 2023 13:32
@Ahmad-S792 Ahmad-S792 force-pushed the fix249737-outerHTML-on-child-of-DocumentFragment-throw-error branch from ca7fb05 to cdf5c2e Compare July 15, 2023 18:40
@Ahmad-S792 Ahmad-S792 removed the merging-blocked Applied to prevent a change from being merged label Jul 15, 2023
@Ahmad-S792
Copy link
Contributor Author

@cdumez - Ready for your review now. :-) We are now matching Firefox.

Copy link
Contributor

@cdumez cdumez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cdumez cdumez added the merge-queue Applied to send a pull request to merge-queue label Jul 15, 2023
https://bugs.webkit.org/show_bug.cgi?id=249737
rdar://problem/103746193

Reviewed by Chris Dumez.

This patch aligns WebKit with Gecko / Firefox and Web-Spec [1].

In 238774@main, WebKit aligned with behavior for better compatibility but
it was not correct and clarified later to not throw error [2]. This PR is
essentially revert part of 238774@main with update to align by not throwing error.

[1] https://w3c.github.io/DOM-Parsing/#dom-element-outerhtml
[2] whatwg/html#8657

* Source/WebCore/dom/Element.cpp:
(Element::setOuterHTML): Update to not throw error
* LayoutTests/fast/dynamic/outerHTML-no-element.html: Rebaselined
* LayoutTests/fast/dynamic/outerHTML-no-element-expected.txt: Rebaselined
* LayoutTests/fast/dom/set-outer-html-special-cases.html: Rebaselined
* LayoutTests/fast/dom/set-outer-html-special-cases-expected.txt: Rebaselined

Canonical link: https://commits.webkit.org/266086@main
@webkit-commit-queue webkit-commit-queue force-pushed the fix249737-outerHTML-on-child-of-DocumentFragment-throw-error branch from cdf5c2e to b41af45 Compare July 15, 2023 22:06
@webkit-commit-queue
Copy link
Collaborator

Committed 266086@main (b41af45): https://commits.webkit.org/266086@main

Reviewed commits have been landed. Closing PR #15575 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit b41af45 into WebKit:main Jul 15, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jul 15, 2023
@Ahmad-S792 Ahmad-S792 deleted the fix249737-outerHTML-on-child-of-DocumentFragment-throw-error branch July 15, 2023 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DOM For bugs specific to XML/HTML DOM elements (including parsing).
Projects
None yet
5 participants