Conversation
…n iframes Fixes 7 css/css-images/image-orientation WPT tests (14/34 -> 21/34).
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small changes in
blitz-dom/src/net.rsthat takecss/css-images/image-orientationWPT from 14/34 to 21/34 passing.EXIF orientation (
image-orientation: from-image, the initial value).ImageHandler::parsepreviously usedImageReader::decode(), which discards the decoder's orientation metadata, so JPEGs/PNGs with EXIF rotation/flip rendered un-rotated. Now:The transform is baked in at decode time (width/height in
Resource::Imageare post-rotation), so everything downstream (<img>,background-image,border-image,list-style-image,mask-image,content:) picks it up for free.Image documents in
<iframe>.DocumentSrcHandlertreated every response as HTML, so an iframe whosesrcis a JPEG rendered the raw bytes as text. Ifimage::guess_formatrecognises the bytes, we now synthesise a minimal<img src="{url}">document instead (the image is then fetched via the normal image path, so it gets EXIF handling too).Remaining failures (13) — not addressed here
image-orientation: none:background-image,none,none-content-images,*-dynamic2,*-computed-style,none-cross-origin*. Stylo declaresimage-orientationwithengine = "gecko"inproperties/longhands.toml, so the property isn't generated for the Servo build and can't be parsed by Blitz at all. Supporting it needs an upstream Stylo change plus keeping the un-oriented pixels around (or applying the orientation as a paint-time transform instead of at decode). Thecross-originvariants additionally need multi-origin serving and<canvas>.exif-png.html: EXIF stored in a legacy compressedzTXt"Raw profile type exif" chunk. No browser passes this on wpt.fyi either.background-properties(-border-radius): renders visually identical, but JPEG decode noise between the EXIF file and the pre-rotated reference file gives 406 differing pixels (max diff 2) vs the fuzzy budget of 313/331. Chrome/Edge also fail one or both of these.Side finding:
new URL(img.src)throws "relative URL without a base" in the cross-origin tests — theHTMLImageElement.srcgetter returns the raw attribute rather than the resolved absolute URL.Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/67f3ef53d8b744548190d4a3dfa8f9dc
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/67f3ef53d8b744548190d4a3dfa8f9dc?variant=devin-insiders
Requested by: @nicoburns
WPT results
11 newly passing, 4 newly failing (net +7).
Full diff (15 changed tests)
Generated by the WPT workflow.