<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>245411</bug_id>
          
          <creation_ts>2022-09-19 23:18:10 -0700</creation_ts>
          <short_desc>Multiple picture sources downloading when page is served as XHTML</short_desc>
          <delta_ts>2022-09-26 23:25:43 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Images</component>
          <version>Other</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>Other</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=159484</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robin Whittleton">robin</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>cdumez</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1899725</commentid>
    <comment_count>0</comment_count>
      <attachid>462466</attachid>
    <who name="Robin Whittleton">robin</who>
    <bug_when>2022-09-19 23:18:10 -0700</bug_when>
    <thetext>Created attachment 462466
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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1899726</commentid>
    <comment_count>1</comment_count>
      <attachid>462467</attachid>
    <who name="Robin Whittleton">robin</who>
    <bug_when>2022-09-19 23:18:29 -0700</bug_when>
    <thetext>Created attachment 462467
HTML variant that works correctly</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1900752</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-09-23 13:23:32 -0700</bug_when>
    <thetext>Only difference I can find between these two test is:

&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;

vs

&lt;html&gt;

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&apos;t get any difference. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1900940</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2022-09-24 16:18:39 -0700</bug_when>
    <thetext>What&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1900941</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-09-24 16:20:10 -0700</bug_when>
    <thetext>(In reply to Alexey Proskuryakov from comment #3)
&gt; What&apos;s important here is that the attachments are served with different
&gt; content types. application/xhtml+xml means that the document is handled as
&gt; XHTML.
&gt; 
&gt; To see the problem, one needs to check errors in Web Inspector. One
&gt; subresource loading error means passing; two errors means failing. This does
&gt; reproduce.

Thanks for your input.. New learning for me. Will account for in future testing. :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1901416</commentid>
    <comment_count>5</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-09-26 23:19:18 -0700</bug_when>
    <thetext>&lt;rdar://problem/100444926&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1901417</commentid>
    <comment_count>6</comment_count>
    <who name="Robin Whittleton">robin</who>
    <bug_when>2022-09-26 23:25:43 -0700</bug_when>
    <thetext>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.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>462466</attachid>
            <date>2022-09-19 23:18:10 -0700</date>
            <delta_ts>2022-09-19 23:18:10 -0700</delta_ts>
            <desc>XHTML variant that demonstrates the problem</desc>
            <filename>se-avif-test.xhtml</filename>
            <type>application/xhtml+xml</type>
            <size>209</size>
            <attacher name="Robin Whittleton">robin</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hodG1s
Ij4KPGhlYWQvPgo8Ym9keT4KPHBpY3R1cmU+Cgk8c291cmNlIHNyY3NldD0iaHR0cDovL2V4YW1w
bGUuY29tL2V4YW1wbGUyLmpwZyIvPgoJPGltZyBzcmM9Imh0dHA6Ly9leGFtcGxlLmNvbS9leGFt
cGxlLmpwZyIvPgo8L3BpY3R1cmU+CjwvYm9keT4KPC9odG1sPgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>462467</attachid>
            <date>2022-09-19 23:18:29 -0700</date>
            <delta_ts>2022-09-19 23:18:29 -0700</delta_ts>
            <desc>HTML variant that works correctly</desc>
            <filename>se-avif-test.html</filename>
            <type>text/html</type>
            <size>178</size>
            <attacher name="Robin Whittleton">robin</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZC8+Cjxib2R5Pgo8cGljdHVyZT4KICAgIDxzb3Vy
Y2Ugc3Jjc2V0PSJodHRwOi8vZXhhbXBsZS5jb20vZXhhbXBsZTIuanBnIi8+CiAgICA8aW1nIHNy
Yz0iaHR0cDovL2V4YW1wbGUuY29tL2V4YW1wbGUuanBnIi8+CjwvcGljdHVyZT4KPC9ib2R5Pgo8
L2h0bWw+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>