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 27161 - [editorial] make data URL in iframe conform to requirements in URL spec
Summary: [editorial] make data URL in iframe conform to requirements in URL spec
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: PC All
: P2 minor
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: https://html.spec.whatwg.org/multipag...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-24 18:14 UTC by Michael[tm] Smith
Modified: 2014-11-27 09:17 UTC (History)
3 users (show)

See Also:


Attachments

Description Michael[tm] Smith 2014-10-24 18:14:53 UTC
In https://html.spec.whatwg.org/multipage/embedded-content.html#best-practices-for-metadata-text-tracks the data URL for the document provide in the iframe src attribute there there does not conform to the requirements in the URL spec.

The URL appears like this:

<iframe src="data:text/html;charset=utf-8,<!DOCTYPE%20html>%0A<style>%0A%20body%2C%20html%20%7B%20ma…<span>Qual%20Match%2037<%2Fspan>%20<span>Friday%2014%3A21<%2Fspan>%0A<%2Fdiv>" width=600 height=400></iframe>

...but the characters "<" and ">" are not "URL code points" as defined in the URL spec, so they should instead be percent-encoded in that src value.
Comment 1 Ian 'Hixie' Hickson 2014-10-24 22:45:57 UTC
It's tempting to suggest to Anne that we just allow < and > in URLs, thought I imagine people who want to write <URL:http://foo> wouldn't like that...
Comment 2 Michael[tm] Smith 2014-10-25 01:48:47 UTC
(In reply to Ian 'Hixie' Hickson from comment #1)
> It's tempting to suggest to Anne that we just allow < and > in URLs, thought
> I imagine people who want to write <URL:http://foo> wouldn't like that...

Anne says, "we could have a distinct conformance class for URLs in HTML attribute values but I don't really want to get into that before we actually have conforming URL parsers"

(By the way, I notice The data: URI kitchen also doesn't percent-encode < and > in its output.)
Comment 3 Ian 'Hixie' Hickson 2014-10-27 20:38:24 UTC
Yeah that's why they didn't get encoded here, that's what I used. :-)
Comment 4 Ian 'Hixie' Hickson 2014-11-26 22:46:20 UTC
Turns out the data: URL kitchen uses URI::Escape, and it does crazy eval() stuff when you try to pass it a pattern, which doesn't seem to work right, so I'm not fixing the kitchen...
Comment 5 contributor 2014-11-26 22:46:35 UTC
Checked in as WHATWG revision r8862.
Check-in comment: escape more characters in example data: url (text track section)
https://html5.org/tools/web-apps-tracker?from=8861&to=8862