[Bug 20976] Define Node.baseURI properly

https://www.w3.org/Bugs/Public/show_bug.cgi?id=20976

--- Comment #23 from Adam Klein <adamk@chromium.org> ---
Reviving this thread as I've been working on implementing this in Blink.

(In reply to Elliott Sprehn from comment #20)
> root.baseURI = "http://foo/"
> img1.src = "a.png";
> root.appendChild(img1);
> root.baseURI = "http://bar/"
> img2.src = "b.png";
> root.appendChild(img2);
> 
> img1.src == "http://foo/a.png"
> img2.src == "http://bar/b.png"

I'm not sure this example works correctly. Let's say that root, img1, and img2
all share an ownerDocument whose baseURI is "http://baz.com/". Resource loads
for http://baz.com/a.png and http://baz.com/b.png will be initiated, since at
the point when img1 and img2 have their src property set they are not
descendants of root, and thus they get their baseURI from their ownerDocument.

Moreover, to get the "right" images to load, we'll need more dynamism in the
system, so that becoming a descendant of a ShadowRoot causes a base URL change.

(Note that the HTML spec (which I can't get to at the moment) says that <img>
elements don't reload their resources when switching Documents, but WebKit,
Blink, and Gecko all seem to do a reload (haven't tried IE). It would be nice
to fix that alongside getting ShadowRoot.baseURI's dynamism specified.)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 16 January 2014 00:40:40 UTC