Bug 199632 - Remove support for beforeload on link=prefetch
Summary: Remove support for beforeload on link=prefetch
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rob Buis
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-07-09 12:13 PDT by Rob Buis
Modified: 2019-12-22 13:16 PST (History)
12 users (show)

See Also:


Attachments
Patch (4.69 KB, patch)
2019-07-09 12:16 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (5.40 KB, patch)
2019-07-09 12:55 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews103 for mac-highsierra (3.32 MB, application/zip)
2019-07-09 13:43 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews114 for mac-highsierra (3.14 MB, application/zip)
2019-07-09 14:34 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews213 for win-future (13.39 MB, application/zip)
2019-07-09 14:35 PDT, EWS Watchlist
no flags Details
Patch (8.70 KB, patch)
2019-07-11 00:22 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-highsierra (3.20 MB, application/zip)
2019-07-11 01:30 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews114 for mac-highsierra (3.08 MB, application/zip)
2019-07-11 02:09 PDT, EWS Watchlist
no flags Details
Patch (9.53 KB, patch)
2019-07-11 02:12 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (13.46 KB, patch)
2019-07-12 07:44 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (11.58 KB, patch)
2019-07-16 00:55 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 Rob Buis 2019-07-09 12:13:46 PDT
Remove support for beforeload on link=prefetch.
Comment 1 Rob Buis 2019-07-09 12:16:48 PDT
Created attachment 373742 [details]
Patch
Comment 2 Rob Buis 2019-07-09 12:55:19 PDT
Created attachment 373746 [details]
Patch
Comment 3 EWS Watchlist 2019-07-09 13:43:32 PDT
Comment on attachment 373746 [details]
Patch

Attachment 373746 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/12700667

New failing tests:
fast/dom/HTMLLinkElement/prefetch-beforeload.html
Comment 4 EWS Watchlist 2019-07-09 13:43:34 PDT
Created attachment 373753 [details]
Archive of layout-test-results from ews103 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 5 EWS Watchlist 2019-07-09 14:34:20 PDT
Comment on attachment 373746 [details]
Patch

Attachment 373746 [details] did not pass mac-debug-ews (mac):
Output: https://webkit-queues.webkit.org/results/12700823

New failing tests:
fast/dom/HTMLLinkElement/prefetch-beforeload.html
Comment 6 EWS Watchlist 2019-07-09 14:34:21 PDT
Created attachment 373768 [details]
Archive of layout-test-results from ews114 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 7 EWS Watchlist 2019-07-09 14:35:13 PDT
Comment on attachment 373746 [details]
Patch

Attachment 373746 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/12700922

New failing tests:
fast/dom/HTMLLinkElement/prefetch-beforeload.html
Comment 8 EWS Watchlist 2019-07-09 14:35:15 PDT
Created attachment 373769 [details]
Archive of layout-test-results from ews213 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews213  Port: win-future  Platform: CYGWIN_NT-10.0-17763-3.0.5-338.x86_64-x86_64-64bit
Comment 9 Ryosuke Niwa 2019-07-10 13:57:01 PDT
Per recent discussion, I don't think we want to support either load, beforeload, or error event handlers on prefetch link element. That would create arbitrary length tracking vector.
Comment 10 Rob Buis 2019-07-10 22:31:04 PDT
(In reply to Ryosuke Niwa from comment #9)
> Per recent discussion, I don't think we want to support either load,
> beforeload, or error event handlers on prefetch link element. That would
> create arbitrary length tracking vector.

Right, so this bug seems aligned with that, removing support for beforeload events on link prefetch. I just have a hard time testing beforeload does not send an event, especially if load/error events are not supported either, i.e. what is the stop condition and/or how long do we wait?
Comment 11 Rob Buis 2019-07-11 00:22:51 PDT
Reopening to attach new patch.
Comment 12 Rob Buis 2019-07-11 00:22:54 PDT
Created attachment 373907 [details]
Patch
Comment 13 EWS Watchlist 2019-07-11 01:30:18 PDT
Comment on attachment 373907 [details]
Patch

Attachment 373907 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/12714121

New failing tests:
http/wpt/prefetch/beforeload-dynamic.html
Comment 14 EWS Watchlist 2019-07-11 01:30:20 PDT
Created attachment 373909 [details]
Archive of layout-test-results from ews101 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 15 EWS Watchlist 2019-07-11 02:09:07 PDT
Comment on attachment 373907 [details]
Patch

Attachment 373907 [details] did not pass mac-debug-ews (mac):
Output: https://webkit-queues.webkit.org/results/12714134

New failing tests:
http/wpt/prefetch/beforeload-dynamic.html
Comment 16 EWS Watchlist 2019-07-11 02:09:09 PDT
Created attachment 373910 [details]
Archive of layout-test-results from ews114 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 17 Rob Buis 2019-07-11 02:12:09 PDT
Created attachment 373911 [details]
Patch
Comment 18 youenn fablet 2019-07-11 14:25:02 PDT
Comment on attachment 373911 [details]
Patch

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

> Source/WebCore/ChangeLog:13
> +        (WebCore::LinkLoader::loadLink):

It is not clear these changes remove support for beforeload for prefetch.
I understand it that we remove the call to shouldLoadLink for prefetch which thus removes the call to before load.
Can you give some more description in the change log?

> Source/WebCore/loader/LinkLoader.cpp:286
> +    if (!params.href.isValid() || !document.frame())

It is initially intriguing to not call shouldLoadLink for prefetch.
It might be clearer to call m_client.shouldLoadLink() in every case in LinkLoader::loadLink and return true early if the link is prefetch.

> Source/WebCore/loader/LinkLoader.cpp:332
> +        return true;

It seems loadLink is always returning true.
Maybe loadLink should be void.

> LayoutTests/http/wpt/prefetch/beforeload-dynamic.html:6
> +</script>

Can we create it in the script element below?

> LayoutTests/http/wpt/prefetch/beforeload.html:5
> +    var t = async_test('Makes sure that prefetch does not call beforeload.');

Ditto.
Comment 19 Rob Buis 2019-07-12 07:44:20 PDT
Created attachment 374008 [details]
Patch
Comment 20 Rob Buis 2019-07-12 08:45:53 PDT
Comment on attachment 373911 [details]
Patch

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

>> Source/WebCore/ChangeLog:13
>> +        (WebCore::LinkLoader::loadLink):
> 
> It is not clear these changes remove support for beforeload for prefetch.
> I understand it that we remove the call to shouldLoadLink for prefetch which thus removes the call to before load.
> Can you give some more description in the change log?

Sure! Done.

>> Source/WebCore/loader/LinkLoader.cpp:286
>> +    if (!params.href.isValid() || !document.frame())
> 
> It is initially intriguing to not call shouldLoadLink for prefetch.
> It might be clearer to call m_client.shouldLoadLink() in every case in LinkLoader::loadLink and return true early if the link is prefetch.

Done.

>> Source/WebCore/loader/LinkLoader.cpp:332
>> +        return true;
> 
> It seems loadLink is always returning true.
> Maybe loadLink should be void.

Well spotted, done.

>> LayoutTests/http/wpt/prefetch/beforeload-dynamic.html:6
>> +</script>
> 
> Can we create it in the script element below?

Done.

>> LayoutTests/http/wpt/prefetch/beforeload.html:5
>> +    var t = async_test('Makes sure that prefetch does not call beforeload.');
> 
> Ditto.

Done.
Comment 21 youenn fablet 2019-07-15 09:11:10 PDT
Comment on attachment 374008 [details]
Patch

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

> Source/WebCore/html/HTMLLinkElement.cpp:208
> +bool HTMLLinkElement::shouldLoadLink(const LinkLoadParameters& params)

Sorry for my suggestion on the previous patch to do that.
Your initial version seems better.
r=me with shouldLoadLink not taking params.
Comment 22 Rob Buis 2019-07-16 00:55:34 PDT
Created attachment 374199 [details]
Patch
Comment 23 Rob Buis 2019-07-16 08:17:48 PDT
(In reply to youenn fablet from comment #21)
> Comment on attachment 374008 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=374008&action=review
> 
> > Source/WebCore/html/HTMLLinkElement.cpp:208
> > +bool HTMLLinkElement::shouldLoadLink(const LinkLoadParameters& params)
> 
> Sorry for my suggestion on the previous patch to do that.
> Your initial version seems better.
> r=me with shouldLoadLink not taking params.

No problem, done.
Comment 24 WebKit Commit Bot 2019-07-16 08:55:11 PDT
Comment on attachment 374199 [details]
Patch

Clearing flags on attachment: 374199

Committed r247481: <https://trac.webkit.org/changeset/247481>
Comment 25 WebKit Commit Bot 2019-07-16 08:55:13 PDT
All reviewed patches have been landed.  Closing bug.
Comment 26 Radar WebKit Bug Importer 2019-07-16 08:56:27 PDT
<rdar://problem/53154857>