WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
151969
SVGDocument getElementById returns null when svg element is disconnected from documents
https://bugs.webkit.org/show_bug.cgi?id=151969
Summary
SVGDocument getElementById returns null when svg element is disconnected from...
Jérémy Lal
Reported
2015-12-07 15:45:32 PST
When testing this snippet with chromium 47 / firefox 38, both logged statements are true. However with epiphany 3.18 / webkitgtk 2.10.4 second statement is false. <!DOCTYPE html> <html> <body> <svg xmlns="
http://www.w3.org/2000/svg
"> <g id="test"></g> </svg> <script type="text/javascript"> var svg = document.querySelector('svg'); console.log("is root#test found when root is in document ?", svg.getElementById('test') != null); svg.remove(); console.log("is root#test found when root is not in document ?", svg.getElementById('test') != null); </script> </body> </html>
Attachments
Example
(410 bytes, text/html)
2016-10-12 06:37 PDT
,
Dirk Schulze
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Dirk Schulze
Comment 1
2016-10-12 06:37:21 PDT
Created
attachment 291353
[details]
Example
Ahmad Saleem
Comment 2
2022-07-14 09:43:09 PDT
I am able to reproduce this bug in Safari 15.5 on macOS 12.4 using attached "Example" test case and the output across all browsers are as follow: *** Safari 15.5 on macOS 12.4 *** is root#test found when root is in document ? – true is root#test found when root is not in document ? – false *** Firefox Nightly 104 *** is root#test found when root is in document ? – true is root#test found when root is not in document ? – true *** Chrome Canary 105 *** is root#test found when root is in document ? – true is root#test found when root is not in document ? – true
Ryosuke Niwa
Comment 3
2022-07-14 13:53:29 PDT
See
https://www.w3.org/TR/SVG2/struct.html#__svg__SVGSVGElement__getElementById
Ryosuke Niwa
Comment 4
2022-07-14 14:40:57 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/2427
EWS
Comment 5
2022-07-14 16:19:26 PDT
Committed
252478@main
(71e97d661b45): <
https://commits.webkit.org/252478@main
> Reviewed commits have been landed. Closing PR #2427 and removing active labels.
Radar WebKit Bug Importer
Comment 6
2022-07-14 16:20:20 PDT
<
rdar://problem/97041517
>
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