Bug 209970 - Image `referrerpolicy` mutations should be considered "relevant mutations"
Summary: Image `referrerpolicy` mutations should be considered "relevant mutations"
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Safari 13
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rob Buis
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-04-03 09:29 PDT by Dominic Farolino
Modified: 2020-06-18 00:56 PDT (History)
10 users (show)

See Also:


Attachments
Patch (28.27 KB, patch)
2020-06-16 09:36 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (41.12 KB, patch)
2020-06-16 10:58 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (43.09 KB, patch)
2020-06-16 11:35 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (42.54 KB, patch)
2020-06-17 10:07 PDT, Rob Buis
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dominic Farolino 2020-04-03 09:29:12 PDT
This is a pretty simple addition. Please see https://github.com/whatwg/html/issues/5244 and https://github.com/whatwg/html/pull/5434.
Comment 1 Rob Buis 2020-06-16 09:36:45 PDT
Created attachment 402014 [details]
Patch
Comment 2 EWS Watchlist 2020-06-16 09:37:16 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 3 Rob Buis 2020-06-16 10:58:36 PDT
Created attachment 402023 [details]
Patch
Comment 4 Rob Buis 2020-06-16 11:35:54 PDT
Created attachment 402028 [details]
Patch
Comment 5 youenn fablet 2020-06-17 02:57:08 PDT
Comment on attachment 402028 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=402028&action=review

> LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/relevant-mutations-expected.txt:17
> +PASS crossorigin anonymous to absent, src absent 

I do not see the code used to reload in case cross origin is changed.
Do you know how it works?
It seems this should be roughly the same code path as for referrer policy.
Comment 6 Rob Buis 2020-06-17 03:22:25 PDT
Comment on attachment 402028 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=402028&action=review

>> LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/relevant-mutations-expected.txt:17
>> +PASS crossorigin anonymous to absent, src absent 
> 
> I do not see the code used to reload in case cross origin is changed.
> Do you know how it works?
> It seems this should be roughly the same code path as for referrer policy.

I was halfway implementing that but there are two problems:
1. it does not fit the Bug title
2. it is tricky. I don't think we have code to compute cross origin attribute state (like for referrer policy). Also it seems we use omit rather than anonymous?
Given that, I thought it is better to not tackle it here, but I can make a follow up bug of course. The other FAILs are not high prio for me (seem picture related).
Comment 7 Dominic Farolino 2020-06-17 07:01:01 PDT
Just a drive-by. If there are any questions about or bugs in the test(s) let me know. Happy to help
Comment 8 Rob Buis 2020-06-17 07:46:53 PDT
(In reply to Dominic Farolino from comment #7)
> Just a drive-by. If there are any questions about or bugs in the test(s) let
> me know. Happy to help

Thnx Dominic, my current status is described in Comment 6. What do you think about the crossorigin attribute part, makes sense to be its own bug? And would the other FAILs be one bug (picture related) or more?
Comment 9 Dominic Farolino 2020-06-17 07:52:56 PDT
You're asking if making Safari "consider crossorigin attribute changes == relevant mutations should be a separate issue from here?

Yeah that sounds fine, as long as it is tracked somewhere. I assume that means you'll be failing some of the `crossorigin` relevant mutations tests until that is fixed then?
Comment 10 Rob Buis 2020-06-17 08:12:39 PDT
(In reply to Dominic Farolino from comment #9)
> You're asking if making Safari "consider crossorigin attribute changes ==
> relevant mutations should be a separate issue from here?

Exactly.

> Yeah that sounds fine, as long as it is tracked somewhere. I assume that
> means you'll be failing some of the `crossorigin` relevant mutations tests
> until that is fixed then?

Unfortunately that would be the case :) For the reasons stated in comment 6 that seems to be the best path forward to me. I can work on fixing crossorigin and other FAILs but they are lower prio for me currently, so I will get to them a bit later, but with bug reports there at least I will not forget.
Comment 11 youenn fablet 2020-06-17 09:03:51 PDT
Oh, I misread the output of the relevant mutation tests, the crossOrigin ones are failing when there is a src.
Sounds good then.
Comment 12 youenn fablet 2020-06-17 09:05:50 PDT
Comment on attachment 402028 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=402028&action=review

> Source/WebCore/html/HTMLImageElement.cpp:252
> +    HTMLElement::attributeChanged(name, oldValue, newValue, reason);

We should probably call this method even for referrerpolicyAttr
Comment 13 Rob Buis 2020-06-17 10:07:11 PDT
Created attachment 402121 [details]
Patch
Comment 14 Rob Buis 2020-06-17 10:49:56 PDT
Comment on attachment 402028 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=402028&action=review

>> Source/WebCore/html/HTMLImageElement.cpp:252
>> +    HTMLElement::attributeChanged(name, oldValue, newValue, reason);
> 
> We should probably call this method even for referrerpolicyAttr

Done.
Comment 15 EWS 2020-06-17 10:56:52 PDT
Committed r263167: <https://trac.webkit.org/changeset/263167>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 402121 [details].
Comment 16 Radar WebKit Bug Importer 2020-06-17 10:57:20 PDT
<rdar://problem/64454781>
Comment 17 Rob Buis 2020-06-18 00:56:14 PDT
(In reply to Dominic Farolino from comment #9)
> You're asking if making Safari "consider crossorigin attribute changes ==
> relevant mutations should be a separate issue from here?
> 
> Yeah that sounds fine, as long as it is tracked somewhere. I assume that
> means you'll be failing some of the `crossorigin` relevant mutations tests
> until that is fixed then?

I have opened https://bugs.webkit.org/show_bug.cgi?id=213335 to track this.