RESOLVED FIXED 165670
Add a warning for unused link preloads.
https://bugs.webkit.org/show_bug.cgi?id=165670
Summary Add a warning for unused link preloads.
Yoav Weiss
Reported 2016-12-09 12:03:51 PST
Add a warning for unused link preloads.
Attachments
Patch (19.43 KB, patch)
2016-12-09 12:35 PST, Yoav Weiss
no flags
Archive of layout-test-results from ews115 for mac-yosemite (1.29 MB, application/zip)
2016-12-09 13:28 PST, Build Bot
no flags
Archive of layout-test-results from ews103 for mac-yosemite (842.58 KB, application/zip)
2016-12-09 13:44 PST, Build Bot
no flags
Archive of layout-test-results from ews121 for ios-simulator-wk2 (10.14 MB, application/zip)
2016-12-09 13:58 PST, Build Bot
no flags
Archive of layout-test-results from ews106 for mac-yosemite-wk2 (1.70 MB, application/zip)
2016-12-09 14:03 PST, Build Bot
no flags
Patch (25.63 KB, patch)
2016-12-10 20:19 PST, Yoav Weiss
no flags
Patch (25.67 KB, patch)
2016-12-10 20:35 PST, Yoav Weiss
no flags
Archive of layout-test-results from ews116 for mac-yosemite (434.77 KB, application/zip)
2016-12-10 21:30 PST, Build Bot
no flags
Archive of layout-test-results from ews100 for mac-yosemite (1.17 MB, application/zip)
2016-12-10 21:42 PST, Build Bot
no flags
Archive of layout-test-results from ews107 for mac-yosemite-wk2 (1.25 MB, application/zip)
2016-12-10 21:48 PST, Build Bot
no flags
Archive of layout-test-results from ews123 for ios-simulator-wk2 (12.47 MB, application/zip)
2016-12-10 21:59 PST, Build Bot
no flags
Patch (19.82 KB, patch)
2017-03-15 05:36 PDT, Yoav Weiss
no flags
Patch (20.40 KB, patch)
2017-03-15 05:53 PDT, Yoav Weiss
no flags
Patch (11.80 KB, patch)
2017-03-15 14:07 PDT, Yoav Weiss
buildbot: commit-queue-
Archive of layout-test-results from ews116 for mac-elcapitan (1.68 MB, application/zip)
2017-03-15 15:19 PDT, Build Bot
no flags
Patch (21.66 KB, patch)
2017-03-23 23:26 PDT, Yoav Weiss
no flags
Archive of layout-test-results from ews102 for mac-elcapitan (925.48 KB, application/zip)
2017-03-24 01:12 PDT, Build Bot
no flags
Archive of layout-test-results from ews125 for ios-simulator-wk2 (deleted)
2017-03-24 01:18 PDT, Build Bot
no flags
Patch (26.79 KB, patch)
2017-03-24 02:48 PDT, Yoav Weiss
no flags
Patch (24.98 KB, patch)
2017-03-24 09:16 PDT, Yoav Weiss
no flags
Archive of layout-test-results from ews114 for mac-elcapitan (1.67 MB, application/zip)
2017-03-24 10:35 PDT, Build Bot
no flags
Patch (31.45 KB, patch)
2017-03-27 12:07 PDT, Yoav Weiss
no flags
Patch (31.51 KB, patch)
2017-03-28 02:28 PDT, Yoav Weiss
no flags
Yoav Weiss
Comment 1 2016-12-09 12:35:25 PST
Build Bot
Comment 2 2016-12-09 13:28:50 PST
Comment on attachment 296673 [details] Patch Attachment 296673 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/2680659 Number of test failures exceeded the failure limit.
Build Bot
Comment 3 2016-12-09 13:28:54 PST
Created attachment 296686 [details] Archive of layout-test-results from ews115 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews115 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 4 2016-12-09 13:44:01 PST
Comment on attachment 296673 [details] Patch Attachment 296673 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/2680872 New failing tests: http/tests/misc/video-poster-image-load-outlives-gc-without-crashing.html
Build Bot
Comment 5 2016-12-09 13:44:05 PST
Created attachment 296690 [details] Archive of layout-test-results from ews103 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews103 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 6 2016-12-09 13:58:51 PST
Comment on attachment 296673 [details] Patch Attachment 296673 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/2680914 New failing tests: http/tests/preload/unused_preload_warning.html
Build Bot
Comment 7 2016-12-09 13:58:55 PST
Created attachment 296694 [details] Archive of layout-test-results from ews121 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews121 Port: ios-simulator-wk2 Platform: Mac OS X 10.11.6
Build Bot
Comment 8 2016-12-09 14:03:48 PST
Comment on attachment 296673 [details] Patch Attachment 296673 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/2681096 New failing tests: http/tests/misc/video-poster-image-load-outlives-gc-without-crashing.html inspector/debugger/breakpoints/resolved-dump-all-pause-locations.html
Build Bot
Comment 9 2016-12-09 14:03:52 PST
Created attachment 296696 [details] Archive of layout-test-results from ews106 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Yoav Weiss
Comment 10 2016-12-10 20:19:41 PST
WebKit Commit Bot
Comment 11 2016-12-10 20:22:20 PST
Attachment 296844 [details] did not pass style-queue: ERROR: LayoutTests/ChangeLog:8: Line contains tab character. [whitespace/tab] [5] ERROR: LayoutTests/ChangeLog:9: Line contains tab character. [whitespace/tab] [5] ERROR: LayoutTests/ChangeLog:11: Line contains tab character. [whitespace/tab] [5] ERROR: LayoutTests/ChangeLog:12: Line contains tab character. [whitespace/tab] [5] ERROR: LayoutTests/ChangeLog:13: Line contains tab character. [whitespace/tab] [5] ERROR: LayoutTests/ChangeLog:14: Line contains tab character. [whitespace/tab] [5] ERROR: LayoutTests/ChangeLog:15: Line contains tab character. [whitespace/tab] [5] Total errors found: 7 in 21 files If any of these errors are false positives, please file a bug against check-webkit-style.
Yoav Weiss
Comment 12 2016-12-10 20:35:49 PST
Build Bot
Comment 13 2016-12-10 21:30:25 PST
Comment on attachment 296846 [details] Patch Attachment 296846 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/2693610 Number of test failures exceeded the failure limit.
Build Bot
Comment 14 2016-12-10 21:30:29 PST
Created attachment 296849 [details] Archive of layout-test-results from ews116 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews116 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 15 2016-12-10 21:42:15 PST
Comment on attachment 296846 [details] Patch Attachment 296846 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/2693651 New failing tests: http/tests/misc/video-poster-image-load-outlives-gc-without-crashing.html http/tests/preload/onerror_event.html http/tests/loading/sizes/preload-image-sizes.html
Build Bot
Comment 16 2016-12-10 21:42:19 PST
Created attachment 296850 [details] Archive of layout-test-results from ews100 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 17 2016-12-10 21:48:29 PST
Comment on attachment 296846 [details] Patch Attachment 296846 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/2693679 New failing tests: http/tests/preload/download_resources.html
Build Bot
Comment 18 2016-12-10 21:48:33 PST
Created attachment 296851 [details] Archive of layout-test-results from ews107 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Build Bot
Comment 19 2016-12-10 21:59:35 PST
Comment on attachment 296846 [details] Patch Attachment 296846 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/2693683 New failing tests: http/tests/preload/download_resources.html http/tests/local/script-crossorigin-loads-file-scheme.html
Build Bot
Comment 20 2016-12-10 21:59:39 PST
Created attachment 296852 [details] Archive of layout-test-results from ews123 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews123 Port: ios-simulator-wk2 Platform: Mac OS X 10.11.6
Yoav Weiss
Comment 21 2017-03-15 05:36:02 PDT
Yoav Weiss
Comment 22 2017-03-15 05:53:19 PDT
Alex Christensen
Comment 23 2017-03-15 09:23:37 PDT
Comment on attachment 304495 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=304495&action=review > Source/WebCore/loader/cache/CachedResourceClient.h:48 > + virtual bool markAsReferenced() const { return true; } I'm not sure this is named correctly. shouldMarkAsReferenced? Isn't there already a way to tell if a load is a preload? > LayoutTests/TestExpectations:1260 > +http/tests/preload/single_download_preload.html [ DumpJSConsoleLogInStdErr ] Does this make these tests not accidentally print out a warning message? Is there no way to do this from within the test?
Yoav Weiss
Comment 24 2017-03-15 10:29:30 PDT
(In reply to comment #23) > Comment on attachment 304495 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=304495&action=review > > > Source/WebCore/loader/cache/CachedResourceClient.h:48 > > + virtual bool markAsReferenced() const { return true; } > > I'm not sure this is named correctly. shouldMarkAsReferenced? Yeah, I'll rename > Isn't there already a way to tell if a load is a preload? There is already a way to tell if a certain request is a preload request or a preloaded resource. However, a preloaded resource can be referenced (e.g. `<link rel=preload href=foo as=script><script src=foo>`). Current tracking if a resource is referenced is based on the addition of CachedResourceClients to it. So I figured it'd be cleanest to add that "is this referencing" info to the resource client. > > > LayoutTests/TestExpectations:1260 > > +http/tests/preload/single_download_preload.html [ DumpJSConsoleLogInStdErr ] > > Does this make these tests not accidentally print out a warning message? Yeah > Is there no way to do this from within the test? Don't know. If there is, I'd be happy to switch to that method
Yoav Weiss
Comment 25 2017-03-15 14:07:47 PDT
Build Bot
Comment 26 2017-03-15 15:19:47 PDT
Comment on attachment 304543 [details] Patch Attachment 304543 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/3332854 New failing tests: http/tests/preload/single_download_preload_headers.php
Build Bot
Comment 27 2017-03-15 15:19:51 PDT
Created attachment 304559 [details] Archive of layout-test-results from ews116 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews116 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Yoav Weiss
Comment 28 2017-03-20 06:49:33 PDT
(In reply to comment #24) > (In reply to comment #23) > > Comment on attachment 304495 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=304495&action=review > > > > > Source/WebCore/loader/cache/CachedResourceClient.h:48 > > > + virtual bool markAsReferenced() const { return true; } > > > > I'm not sure this is named correctly. shouldMarkAsReferenced? > > Yeah, I'll rename > > > Isn't there already a way to tell if a load is a preload? > > There is already a way to tell if a certain request is a preload request or > a preloaded resource. > However, a preloaded resource can be referenced (e.g. `<link rel=preload > href=foo as=script><script src=foo>`). > Current tracking if a resource is referenced is based on the addition of > CachedResourceClients to it. So I figured it'd be cleanest to add that "is > this referencing" info to the resource client. > > > > > > LayoutTests/TestExpectations:1260 > > > +http/tests/preload/single_download_preload.html [ DumpJSConsoleLogInStdErr ] > > > > Does this make these tests not accidentally print out a warning message? > > Yeah > > > Is there no way to do this from within the test? > > Don't know. If there is, I'd be happy to switch to that method Hmm, the debug bot failure seems to indicate that it's not taking this directive into account. Is that a known issue? Is there a way to get around that?
Alex Christensen
Comment 29 2017-03-22 11:39:26 PDT
I don't know much about DumpJSConsoleLogInStdErr, but I think it would be cleaner to add something to TestRunner.idl or Internals.idl to disable the logs from within the test rather than having to know about this magic value in TestExpectations to figure out what is going on.
youenn fablet
Comment 30 2017-03-22 11:53:21 PDT
(In reply to Alex Christensen from comment #29) > I don't know much about DumpJSConsoleLogInStdErr, but I think it would be > cleaner to add something to TestRunner.idl or Internals.idl to disable the > logs from within the test rather than having to know about this magic value > in TestExpectations to figure out what is going on. DumpJSConsoleLogInStdErr is mostly for imported W3C tests. In most cases, if you can tweak the test, you can fix the flakiness issues, which makes TestRunner method not necessary, although we can add it for convenience. If we were able to inject WebKit specific scripts on imported W3C tests without modifying them (like testXX.webkit.js file next to textXX.js), we could probably get rid of DumpJSConsoleLogInStdErr and use TestRunner.
youenn fablet
Comment 31 2017-03-22 11:55:51 PDT
> Hmm, the debug bot failure seems to indicate that it's not taking this > directive into account. Is that a known issue? Is there a way to get around > that? It is not known, can you reproduce it locally?
youenn fablet
Comment 32 2017-03-22 11:57:27 PDT
(In reply to youenn fablet from comment #31) > > Hmm, the debug bot failure seems to indicate that it's not taking this > > directive into account. Is that a known issue? Is there a way to get around > > that? > > It is not known, can you reproduce it locally? I am not seeing DumpJSConsoleLogInStdErr in the patch or in TestExpectations though.
Yoav Weiss
Comment 33 2017-03-23 16:27:39 PDT
I removed DumpJSConsoleLogInStdErr and modified the tests to be more resilient, as well as stopped the timer when the document is detached. Unfortunately, I'm currently failing to upload a patch... I'll try to upload it again tomorrow.
Yoav Weiss
Comment 34 2017-03-23 23:26:35 PDT
Yoav Weiss
Comment 35 2017-03-23 23:28:44 PDT
Uploaded the patch. PTAL?
Build Bot
Comment 36 2017-03-24 01:12:24 PDT
Comment on attachment 305269 [details] Patch Attachment 305269 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/3402615 New failing tests: http/tests/preload/download_resources.html
Build Bot
Comment 37 2017-03-24 01:12:27 PDT
Created attachment 305271 [details] Archive of layout-test-results from ews102 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 38 2017-03-24 01:18:22 PDT
Comment on attachment 305269 [details] Patch Attachment 305269 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/3402527 New failing tests: http/tests/preload/download_resources.html
Build Bot
Comment 39 2017-03-24 01:18:25 PDT
Created attachment 305272 [details] Archive of layout-test-results from ews125 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews125 Port: ios-simulator-wk2 Platform: Mac OS X 10.11.6
Yoav Weiss
Comment 40 2017-03-24 02:48:42 PDT
youenn fablet
Comment 41 2017-03-24 08:27:32 PDT
Comment on attachment 305273 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=305273&action=review > Source/WebCore/page/DOMWindow.h:390 > + Timer m_unusedPreloadsTimer; Why not having this timer in CachedResourceLoader and letting DOMWindow/Document notify the cached resource loader when to start/stop its timer? (I still think the preload management logic should be somehow isolated to ease understanding and future evolution of this mechanism)
Yoav Weiss
Comment 42 2017-03-24 08:33:54 PDT
(In reply to youenn fablet from comment #41) > Comment on attachment 305273 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=305273&action=review > > > Source/WebCore/page/DOMWindow.h:390 > > + Timer m_unusedPreloadsTimer; > > Why not having this timer in CachedResourceLoader and letting > DOMWindow/Document notify the cached resource loader when to start/stop its > timer? I'll move it if you think it's cleaner.
youenn fablet
Comment 43 2017-03-24 08:36:12 PDT
Comment on attachment 305273 [details] Patch r=me, provided the timer is moved to CachedResourceLoader.
youenn fablet
Comment 44 2017-03-24 08:37:40 PDT
(In reply to Yoav Weiss from comment #42) > (In reply to youenn fablet from comment #41) > > Comment on attachment 305273 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=305273&action=review > > > > > Source/WebCore/page/DOMWindow.h:390 > > > + Timer m_unusedPreloadsTimer; > > > > Why not having this timer in CachedResourceLoader and letting > > DOMWindow/Document notify the cached resource loader when to start/stop its > > timer? > > I'll move it if you think it's cleaner. I think it will avoid leaking some CachedResourceLoader logic in DOMWindow. Please let me know if there is something worse when moving the logic.
Yoav Weiss
Comment 45 2017-03-24 09:16:14 PDT
Yoav Weiss
Comment 46 2017-03-24 09:18:31 PDT
Comment on attachment 305286 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=305286&action=review > Source/WebCore/dom/Document.cpp:2263 > + m_cachedResourceLoader->stopUnusedPreloadsTimer(); Youenn - can you just confirm that I can assume m_cachedResourceLoader here can never be nullptr? I'm almost sure that's the case...
Yoav Weiss
Comment 47 2017-03-24 09:20:19 PDT
(In reply to youenn fablet from comment #44) > (In reply to Yoav Weiss from comment #42) > > (In reply to youenn fablet from comment #41) > > > Comment on attachment 305273 [details] > > > Patch > > > > > > View in context: > > > https://bugs.webkit.org/attachment.cgi?id=305273&action=review > > > > > > > Source/WebCore/page/DOMWindow.h:390 > > > > + Timer m_unusedPreloadsTimer; > > > > > > Why not having this timer in CachedResourceLoader and letting > > > DOMWindow/Document notify the cached resource loader when to start/stop its > > > timer? > > > > I'll move it if you think it's cleaner. > > I think it will avoid leaking some CachedResourceLoader logic in DOMWindow. > Please let me know if there is something worse when moving the logic. Much cleaner now with the timer moved. Good call! :)
youenn fablet
Comment 48 2017-03-24 09:24:13 PDT
Comment on attachment 305286 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=305286&action=review >> Source/WebCore/dom/Document.cpp:2263 >> + m_cachedResourceLoader->stopUnusedPreloadsTimer(); > > Youenn - can you just confirm that I can assume m_cachedResourceLoader here can never be nullptr? I'm almost sure that's the case... This is fine.
Build Bot
Comment 49 2017-03-24 10:35:31 PDT
Comment on attachment 305286 [details] Patch Attachment 305286 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/3404464 New failing tests: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-styles.html
Build Bot
Comment 50 2017-03-24 10:35:34 PDT
Created attachment 305295 [details] Archive of layout-test-results from ews114 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews114 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Yoav Weiss
Comment 51 2017-03-24 11:11:58 PDT
Comment on attachment 305286 [details] Patch The failing test doesn't seem related so I'm retrying the CQ. Thanks for reviewing! :)
WebKit Commit Bot
Comment 52 2017-03-24 11:41:45 PDT
Comment on attachment 305286 [details] Patch Clearing flags on attachment: 305286 Committed r214361: <http://trac.webkit.org/changeset/214361>
WebKit Commit Bot
Comment 53 2017-03-24 11:41:52 PDT
All reviewed patches have been landed. Closing bug.
Ryan Haddad
Comment 54 2017-03-24 17:07:21 PDT
(In reply to WebKit Commit Bot from comment #52) > Comment on attachment 305286 [details] > Patch > > Clearing flags on attachment: 305286 > > Committed r214361: <http://trac.webkit.org/changeset/214361> This change appears to have caused flakiness in these tests: http/tests/preload/onload_event.html http/tests/preload/single_download_preload.html http/tests/preload/single_download_preload_headers.php https://build.webkit.org/results/Apple%20Sierra%20Release%20WK2%20(Tests)/r214378%20(189)/results.html
Ryan Haddad
Comment 55 2017-03-24 17:10:12 PDT
Reverted r214361 for reason: This change caused flakiness in http/tests/preload tests. Committed r214388: <http://trac.webkit.org/changeset/214388>
Yoav Weiss
Comment 56 2017-03-27 12:07:24 PDT
Yoav Weiss
Comment 57 2017-03-27 17:46:55 PDT
Uploaded a new version of the patch with improved tests, and which is also clearing the ResourceTiming buffer when the document is detached in order to reduce test flakiness. PTAL?
Yoav Weiss
Comment 58 2017-03-28 01:32:07 PDT
Comment on attachment 305493 [details] Patch Thanks! :)
WebKit Commit Bot
Comment 59 2017-03-28 02:02:18 PDT
Comment on attachment 305493 [details] Patch Rejecting attachment 305493 [details] from commit-queue. Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'land-attachment', '--force-clean', '--non-interactive', '--parent-command=commit-queue', 305493, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit Last 500 characters of output: 21bf338bedb2f38ccec2141744769e2e7b 8d9ae72ccc5ab5bf039c78da119722bab7f1ddb0 M Source Current branch master is up to date. ERROR: Not all changes have been committed into SVN, however the committed ones (if any) seem to be successfully integrated into the working tree. Please see the above messages for details. Failed to run "['git', 'svn', 'dcommit', '--rmdir']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit Updating OpenSource Current branch master is up to date. Total errors found: 0 in 1 files Full output: http://webkit-queues.webkit.org/results/3425805
Yoav Weiss
Comment 60 2017-03-28 02:28:02 PDT
WebKit Commit Bot
Comment 61 2017-03-28 04:56:56 PDT
Comment on attachment 305579 [details] Patch Clearing flags on attachment: 305579 Committed r214472: <http://trac.webkit.org/changeset/214472>
WebKit Commit Bot
Comment 62 2017-03-28 04:57:01 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.