Closed Bug 1341389 Opened 7 years ago Closed 8 months ago

Text incorrectly extracted from image/png data URL

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: annevk, Unassigned)

References

(Blocks 1 open bug)

Details

Not sure what's going on with http://w3c-test.org/XMLHttpRequest/data-uri.htm, but it's passing in Safari TP.
baku may know what's up here.
Flags: needinfo?(amarchesini)
This is because of bug 391951. We assume that data:<image format>,... is a base64 sequence. In this case, it should not contain any space:

https://dxr.mozilla.org/mozilla-central/source/netwerk/protocol/data/nsDataHandler.cpp#93
Flags: needinfo?(amarchesini)
So the problem is that we intertwine URL parsing and data URL processing. I guess that won't be fixed until we have rust-url.
Priority: -- → P3
baku, what do you think is the way forward here?
Flags: needinfo?(amarchesini)
Let me move the NI to valentin. The issue here is described by comment 2. We fail parsing URLs such as "data:image/png,Hello, World!".
Flags: needinfo?(amarchesini) → needinfo?(valentin.gosu)
In this case we could also _not_ strip whitespace from image/* content types, if that is acceptable.
Flags: needinfo?(valentin.gosu) → needinfo?(annevk)
This is a duplicate of bug 1388594 (or rather the other way around, but that bug has more information now), but I'll let you mark it as such in case you see it differently. This would be fixed by "the new URL parser" coupled with a new data: URL processor (bug 1392241).
Flags: needinfo?(annevk)
Component: DOM → DOM: Core & HTML
Severity: normal → S3

We now pass this test and align much more closely with the current spec as of bug 1845006 landing (with further caveats being considered in bug 1845005).

Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.