[Webkit-unassigned] [Bug 66474] Dynamically injected base tag from external script causes extra requests

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 18 20:21:46 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=66474





--- Comment #3 from Scott Jehl <scott at filamentgroup.com>  2011-08-18 20:21:45 PST ---
(In reply to comment #2)
> Pretty sure they are. This is not a reasonable thing to do. -> wontfix

I'd really appreciate if this issue could be given a little more consideration. Injecting and/or modifying and existing base element via JavaScript is useful for a number of reasons. 

For one, modifying the base href is a reliable way to ensure assets that are requested via ajax-appended markup are routed through the relative URL they come from (for example, when appended HTML contains scripts, styles, images, etc). We modify the base element constantly in the jQuery Mobile framework as new pages are brought in via Ajax. I can test to see if this change has any effect there currently, as I'm not sure if it does.

The case I was concerned with in particular was that the "Responsive Images" technique, which is one of only a few ways to currently route images appropriately based on screen resolution in responsive designs, no longer works because of this recent change. While this can be done other ways, the base tag approach can be the most useful depending on the site. (more here: http://filamentgroup.com/lab/responsive_images_experimenting_with_context_aware_image_sizing/ )


That said, I think the part that needs clarification most here is why this technique works perfectly when the script is inline in the head, but not when it's referenced externally. Shouldn't these two scenarios behave the same?

I've noticed that an externally referenced script is able to set a cookie that is subsequently carried by the image request, so the problem does not appear to be related to timing. In fact, looking at the profiler, the request to the non-base-href image src goes out AFTER the one that is routed properly. This seems to suggest a bug, rather than an optimized prefetch.

I ask that you reconsider this bug, as it doesn't appear to match expected behavior.
Thanks so much

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list