Bug 245411 - Multiple picture sources downloading when page is served as XHTML
Summary: Multiple picture sources downloading when page is served as XHTML
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: Other
Hardware: Mac (Intel) Other
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-09-19 23:18 PDT by Robin Whittleton
Modified: 2022-09-26 23:25 PDT (History)
6 users (show)

See Also:


Attachments
XHTML variant that demonstrates the problem (209 bytes, application/xhtml+xml)
2022-09-19 23:18 PDT, Robin Whittleton
no flags Details
HTML variant that works correctly (178 bytes, text/html)
2022-09-19 23:18 PDT, Robin Whittleton
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Whittleton 2022-09-19 23:18:10 PDT
Created attachment 462466 [details]
XHTML variant that demonstrates the problem

First up, this is quite possibly a dupe of bug #159484, but as the trigger is different I’ll start with filing this issue separately.

Given a page with a picture element with a source element that references a different resource to the img element, both referenced resources will be downloaded if the page is served as an XHTML document with the appropriate xmlns.

I’ve attached a couple of test files that demonstrate the problem.

This was observed in the wild on https://standardebooks.org/ebooks, which doesn’t contain any JS (trigger from bug #159484) and is served as XHTML.
Comment 1 Robin Whittleton 2022-09-19 23:18:29 PDT
Created attachment 462467 [details]
HTML variant that works correctly
Comment 2 Ahmad Saleem 2022-09-23 13:23:32 PDT
Only difference I can find between these two test is:

<html xmlns="http://www.w3.org/1999/xhtml">

vs

<html>

and both have issues while pasting the code in W3C validator:

https://validator.w3.org/#validate_by_input

- Can you share an example with working images in it and reproducible test case in both cases, I don't get any difference. Thanks!
Comment 3 Alexey Proskuryakov 2022-09-24 16:18:39 PDT
What's important here is that the attachments are served with different content types. application/xhtml+xml means that the document is handled as XHTML.

To see the problem, one needs to check errors in Web Inspector. One subresource loading error means passing; two errors means failing. This does reproduce.
Comment 4 Ahmad Saleem 2022-09-24 16:20:10 PDT
(In reply to Alexey Proskuryakov from comment #3)
> What's important here is that the attachments are served with different
> content types. application/xhtml+xml means that the document is handled as
> XHTML.
> 
> To see the problem, one needs to check errors in Web Inspector. One
> subresource loading error means passing; two errors means failing. This does
> reproduce.

Thanks for your input.. New learning for me. Will account for in future testing. :-)
Comment 5 Radar WebKit Bug Importer 2022-09-26 23:19:18 PDT
<rdar://problem/100444926>
Comment 6 Robin Whittleton 2022-09-26 23:25:43 PDT
Note: standardebooks.org (referenced in the original comment) has now been adjusted to not serve any source elements to Safari, effectively bypassing this problem. The bug still stands with the testcases.