RESOLVED FIXED 173528
Class matching fails after moving an element from a quirks-mode document to a standard-mode document
https://bugs.webkit.org/show_bug.cgi?id=173528
Summary Class matching fails after moving an element from a quirks-mode document to a...
Kent Tamura
Reported 2017-06-18 16:19:08 PDT
crbug.com/733682 With the following page, "Second query result should not be null:" should not be null, but Safari TP 30 says "null". <!-- quirks mode --> <body> <dialog> <button class="nextButton"></button> <button class="nextButton"></button> </dialog> <template><div></div></template> <pre></pre> <script> function log(str) { document.querySelector('pre').textContent += str + '\n'; } log('Main document\'s mode: ' + document.compatMode); var dialog = document.querySelector('dialog'); var button = dialog.querySelector('.nextButton'); var tc = document.querySelector('template').content; log('Template document\'s mode: ' + tc.ownerDocument.compatMode); tc.ownerDocument.adoptNode(button); log('Second query result should not be null: ' + dialog.querySelector('.nextButton')); log('Content of context element: ' + dialog.innerHTML); </script> </body> Firefox: not-null Chrome 61 canary: not-null Edge: not-null
Attachments
Kent Tamura
Comment 1 2017-06-18 16:33:07 PDT
The root issue is a single ShareableElementData is unexpectedly shared in a quirks-mode document and a standard-mode document.
Kent Tamura
Comment 2 2017-06-25 17:06:00 PDT
Ahmad Saleem
Comment 3 2022-08-16 16:50:20 PDT
Safari is only browser failing this test case as of STP 151: https://wpt.fyi/results/quirks/classname-query-after-sibling-adoption.html?label=experimental&label=master&aligned Just wanted to share updated status. Thanks!
Ryosuke Niwa
Comment 5 2022-08-17 00:42:22 PDT
The bug is still there, and we can fix it by merging the Blink change.
Radar WebKit Bug Importer
Comment 6 2022-08-17 09:35:36 PDT
Ryan Reno
Comment 7 2022-08-17 10:27:59 PDT
The Blink change fixes this on my Mac. Will need to import the WPT quirks suite as we're missing this and many other tests in our tree. Once that lands, we can get this landed as well.
Ryan Reno
Comment 8 2022-08-17 11:20:13 PDT
EWS
Comment 9 2022-08-31 00:59:45 PDT
Committed 253975@main (2837601ea97b): <https://commits.webkit.org/253975@main> Reviewed commits have been landed. Closing PR #3413 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.