This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 16155 - Specify behavior for embedded content elements that have no browsing context
Summary: Specify behavior for embedded content elements that have no browsing context
Status: RESOLVED WORKSFORME
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 15653
  Show dependency treegraph
 
Reported: 2012-02-28 23:28 UTC by Dimitri Glazkov
Modified: 2013-02-18 12:07 UTC (History)
8 users (show)

See Also:


Attachments

Description Dimitri Glazkov 2012-02-28 23:28:38 UTC
Gecko, WebKit, and IE all implement the same behavior for IMG, AUDIO, and VIDEO elements that have no associated browsing context: they don't fetch resources, since there is not document URL to resolve against.

We should add this to the spec. Perhaps a step in http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#resolve-a-url?
Comment 1 Boris Zbarsky 2012-03-01 15:10:11 UTC
There is absolutely a document url; I don't see how there could not be.  There is always a document url.

I believe we should simply define all of these elements to not do any fetches while their ownerDocument has no defaultView.
Comment 2 Dimitri Glazkov 2012-03-01 17:23:18 UTC
(In reply to comment #1)
> There is absolutely a document url; I don't see how there could not be.  There
> is always a document url.

Maybe this just need to be fleshed out in the DOM4 spec, but as of now, the URL is not set for document when creating it using DOMImplementation.createHTMLDocument:

http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-domimplementation-createhtmldocument

WebKit in this case provides an empty URL (which seems in line with the spec):

http://jsfiddle.net/dglazkov/9pESJ/1/

Gecko returns "about:blank".

IE9 returns the main document URL.

> 
> I believe we should simply define all of these elements to not do any fetches
> while their ownerDocument has no defaultView.

Sure, that sounds good too.
Comment 3 Boris Zbarsky 2012-03-01 17:40:12 UTC
> as of now, the URL is not set for document when creating it using
> DOMImplementation.createHTMLDocument:

There is an existing open bug on that, last I checked.
Comment 4 Dimitri Glazkov 2012-03-01 18:27:52 UTC
(In reply to comment #3)
> > as of now, the URL is not set for document when creating it using
> > DOMImplementation.createHTMLDocument:
> 
> There is an existing open bug on that, last I checked.

Nifty. I can't seem to find it :( Maybe it doesn't have an URL? ;)
Comment 5 Boris Zbarsky 2012-03-01 18:37:33 UTC
Looks like it's not longer open.  https://www.w3.org/Bugs/Public/show_bug.cgi?id=13045

And DOMCore clearly says:

  Unless explicitly given when a document is created its encoding is utf-8, its
  content type is "application/xml", and its URL is "about:blank". 

right at http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-document-url
Comment 6 Dimitri Glazkov 2012-03-01 18:46:45 UTC
(In reply to comment #5)
> Looks like it's not longer open. 
> https://www.w3.org/Bugs/Public/show_bug.cgi?id=13045
> 
> And DOMCore clearly says:
> 
>   Unless explicitly given when a document is created its encoding is utf-8, its
>   content type is "application/xml", and its URL is "about:blank". 
> 
> right at
> http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-document-url

Great. So the task as you formulated it is:

Update the spec to define that elements do not do any fetches
while their ownerDocument has no associated browsing context (that's the equivalent of defaultView being null, right?)
Comment 7 Boris Zbarsky 2012-03-01 18:56:49 UTC
It's not, actually.  

And neither one is equivalent to the document being the current document of the associated browsing context (if any), as far as I can tell.

Which one we want depends on the behavior we want for things like prerendered documents, unloaded documents, etc.
Comment 8 Dimitri Glazkov 2012-03-01 19:08:37 UTC
(In reply to comment #7)
> It's not, actually.  
> 
> And neither one is equivalent to the document being the current document of the
> associated browsing context (if any), as far as I can tell.
> 
> Which one we want depends on the behavior we want for things like prerendered
> documents, unloaded documents, etc.

Interesting. You're drawing a distinction between whether the browsing context simply isn't associated with a given document (like when it's created using DOMImplementation), or the user agent decides to not to create browsing contexts (when prerendering, data mining, etc.) for a document.

Is this distinction anywhere in the spec?
Comment 9 Boris Zbarsky 2012-03-01 19:20:33 UTC
No, I'm making a distinction between documents which have no associated browsing context and documents which do have one but are not the current document in that browsing context.  That distinction is most certainly in the spec.
Comment 10 contributor 2012-07-18 06:57:39 UTC
This bug was cloned to create bug 17828 as part of operation convergence.
Comment 11 Robin Berjon 2013-02-18 12:07:16 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are
satisfied with this response, please change the state of this bug to CLOSED. If
you have additional information and would like the Editor to reconsider, please
reopen this bug. If you would like to escalate the issue to the full HTML
Working Group, please add the TrackerRequest keyword to this bug, and suggest
title and text for the Tracker Issue; or you may create a Tracker Issue
yourself, if you are able to do so. For more details, see this document:

   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: none
Rationale: See https://www.w3.org/Bugs/Public/show_bug.cgi?id=17828