RESOLVED CONFIGURATION CHANGED144652
baseURI getter returns bogus values in some cases
https://bugs.webkit.org/show_bug.cgi?id=144652
Summary baseURI getter returns bogus values in some cases
Boris Zbarsky
Reported 2015-05-05 18:34:24 PDT
Consider this web page: <iframe></iframe> <script> onload = function() { var doc = frames[0].document; doc.body.innerHTML = '<a href=""></a>' alert("Document base URI: " + doc.baseURI); alert("Anchor base URI: " + doc.querySelector('a').baseURI); alert("Anchor href: " + doc.querySelector('a').href); } </script> This should alert the URI of the web page three times. In Safari it instead alerts "about:blank", "null", and the URI of the web page, respectively.
Attachments
Boris Zbarsky
Comment 1 2015-05-05 18:34:54 PDT
A live demo of this is available at http://jsfiddle.net/n0gdh5y4/5/
Ahmad Saleem
Comment 2 2022-07-30 07:16:54 PDT
Here are updated test results across all browsers (using test case from Comment 01): *** Safari 15.6 on macOS 12.5 *** JSFiddle changed to "show": Document base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/light/ Anchor base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/light/ Anchor href: https://fiddle.jshell.net/n0gdh5y4/5/show/light/ JSFiddle with "show" in URL (not Standalone but Editor mode): Document base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/?editor_console= Anchor base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/?editor_console= Anchor href: https://fiddle.jshell.net/n0gdh5y4/5/show/?editor_console= *** Chrome Canary 106 *** Document base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/light/ Anchor base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/light/ Anchor href: https://fiddle.jshell.net/n0gdh5y4/5/show/light/ Document base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/?editor_console= Anchor base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/?editor_console= Anchor href: https://fiddle.jshell.net/n0gdh5y4/5/show/?editor_console= *** Firefox Nightly 105 *** Document base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/light/ Anchor base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/light/ Anchor href: https://fiddle.jshell.net/n0gdh5y4/5/show/light/ Document base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/?editor_console= Anchor base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/?editor_console= Anchor href: https://fiddle.jshell.net/n0gdh5y4/5/show/?editor_console= _______________ I think it was fixed along the way since, I don't see any "about:blank", "null" etc. as mentioned from Comment 0. I think this can be marked as "RESOLVED CONFIGURATION CHANGED". Thanks!
Ryosuke Niwa
Comment 3 2022-07-30 13:24:10 PDT
Nice. Thanks for testing!
Note You need to log in before you can comment on or make changes to this bug.