WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
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
Add attachment
proposed patch, testcase, etc.
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
Now WPT has a test.
http://w3c-test.org/quirks-mode/classname-query-after-sibling-adoption.html
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!
Ahmad Saleem
Comment 4
2022-08-16 16:55:43 PDT
Chrome Commit modifying "Element.cpp":
https://chromium.googlesource.com/chromium/src.git/+/3d8dd287aeb97d6dbb658da989ac4a4c95853dc7
Webkit Github source:
https://github.com/WebKit/WebKit/blob/8afe31a018b11741abdf9b4d5bb973d7c1d9ff05/Source/WebCore/dom/Element.cpp#L2112
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
<
rdar://problem/98786212
>
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
Pull request:
https://github.com/WebKit/WebKit/pull/3413
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.
Top of Page
Format For Printing
XML
Clone This Bug