Closed Bug 243917 Opened 21 years ago Closed 21 years ago

Fragment identifiers in data: URLs are not supported

Categories

(Core :: Networking, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 308590

People

(Reporter: martijn.martijn, Assigned: hyatt)

References

Details

(Keywords: qawanted)

Attachments

(2 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a) Gecko/20040512 Firefox/0.8.0+ Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a) Gecko/20040512 Firefox/0.8.0+ See upcoming testcase. I have an html/xbl testcase which works on itself, but it doesn't work when I embed the xbl in the html file with an data url scheme. I think this type of thing should work, because it works (well, also a bit buggy I gues) with a 'regular' html testcase. I will attach that testcase also. Reproducible: Always Steps to Reproduce: 1. Load the html/xbl testcase 2. 3. Actual Results: You'll see nothing, because the binding fails. Expected Results: You should see Some text -- extra text in the window
This is the source of the regular html testcase: <html> <head> <style> #tt:target{ background-color:green; } </style> </head> <body> <p id="tt">test</p> </body> </html> Placing the #tt hash after the data url scheme does work, although an extra '#tt' is added into the source, which is incorrect I think.
Comment on attachment 148736 [details] Testcase of not working data url schemed xbl file >div { -moz-binding: url(data:text/html;charset=utf-8... Could you add a test case with the correct content-type for XBL?
Attachment #148736 - Attachment is obsolete: true
Attached file Updated first testcase
Yes, I just discovered the error. The first testcase had the wrong content-type. It has now text/xml. Directly loading the data url schemed xbl-file, with the #xbltest hash in it, results in an xml parsing error, because the '#xbltest' gets also added in the document (just like I described above).
So the actual problem is here whether '#something' should be added in the source code or not. Ian?
Component: XBL → Networking
Keywords: qawanted
OS: Windows 2000 → All
Hardware: PC → All
A data: URI that contains a "#" character is invalid. (Fragment identifiers are not defined for data: URIs.) We have two options. We can either say: * Omit the fragment identifier and then it will work (which it should) ...or: * We will support fragment identifiers on data: URIs. I have no preference. (Opera does the latter, for what it's worth, but that's technically wrong since the specs don't say that it is allowed.) In any case, if you do indeed omit the fragment identifier it should just work (by default XBL uses the first binding).
Is the specification likely to change when browser vendors support '#'? Because now, we support it a bit, but actually don't, somewere in between as you can see in attachment 148737 [details].
I doubt the specs for this will ever change.
(btw, there are bugs filed on the '#' issues.)
Marking invalid. data: is not an nsIURL in Mozilla, so has no fragment identifier.
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
This annoys me, because when I create XBL bindings dynamically, I have to bounce them off an echo script on a web server. If we can't make #anchor supported for data: URLs (and it's not clear to me why we can't), how about making it possible for XBL to work with data: URLs by automatically taking the first binding or something like that?
Summary: Not possible to use data url scheme to embed xbl file into html → Not possible to use data: URL scheme to embed XBL file into html
(In reply to comment #11) > how about making it possible for XBL to work with data: URLs by automatically > taking the first binding or something like that? I filed bug 366770 on making that work.
Re-summarizing slightly to ensure this doesn't mislead anyone into thinking that it isn't possible to use data: URIs for binding references (it is possible now that bug 366770 is fixed).
Summary: Not possible to use data: URL scheme to embed XBL file into html → can't use a fragment identifier in a data: URL to embed XBL file into html
(Morphing this bug to be about fragment in data: URLs in general so that other bugs could be duped here.)
Summary: can't use a fragment identifier in a data: URL to embed XBL file into html → Fragment identifiers in data: URLs are not supported
Per RFC 3986, Fragment ID should work regardless of the scheme. http://tools.ietf.org/html/rfc3986#section-3.5 > Fragment identifier semantics are independent of the > URI scheme and thus cannot be redefined by scheme specifications. See also: http://www.ietf.org/mail-archive/web/uri-review/current/msg00931.html
So this is not invalid?
Resolution: INVALID → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: