RESOLVED FIXED 185187
Web Inspector: simplify the WI.Collection interface
https://bugs.webkit.org/show_bug.cgi?id=185187
Summary Web Inspector: simplify the WI.Collection interface
Devin Rousso
Reported 2018-05-01 22:32:55 PDT
Instead of using `toArray`, we should make use of `Symbol.iterator` and other such things for a cleaner API.
Attachments
Patch (51.98 KB, patch)
2018-05-01 22:36 PDT, Devin Rousso
no flags
Archive of layout-test-results from ews104 for mac-sierra-wk2 (3.21 MB, application/zip)
2018-05-01 23:28 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews102 for mac-sierra (2.25 MB, application/zip)
2018-05-01 23:39 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews114 for mac-sierra (3.13 MB, application/zip)
2018-05-02 01:00 PDT, EWS Watchlist
no flags
Patch (54.29 KB, patch)
2018-05-02 01:29 PDT, Devin Rousso
no flags
Archive of layout-test-results from ews104 for mac-sierra-wk2 (2.71 MB, application/zip)
2018-05-02 02:38 PDT, EWS Watchlist
no flags
Patch (57.43 KB, patch)
2018-05-04 11:40 PDT, Devin Rousso
no flags
Devin Rousso
Comment 1 2018-05-01 22:36:18 PDT
EWS Watchlist
Comment 2 2018-05-01 23:28:15 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 3 2018-05-01 23:28:16 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 4 2018-05-01 23:39:52 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 5 2018-05-01 23:39:54 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 6 2018-05-02 01:00:41 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 7 2018-05-02 01:00:42 PDT Comment hidden (obsolete)
Devin Rousso
Comment 8 2018-05-02 01:29:17 PDT
EWS Watchlist
Comment 9 2018-05-02 02:38:34 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 10 2018-05-02 02:38:35 PDT Comment hidden (obsolete)
Blaze Burg
Comment 11 2018-05-03 09:36:40 PDT
Comment on attachment 339290 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=339290&action=review r=me, nice cleanup > Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js:289 > + for (let resource of currentFrame.resourceCollection) Maybe a dumb question, but why isn't the main resource in the resource collection? > LayoutTests/http/tests/inspector/network/har/har-page.html:77 > + for (let resource of WI.frameResourceManager.mainFrame.resourceCollection) You should just push with destructuring, the loop isn't needed here. And somehow this test is failing on EWS?
Devin Rousso
Comment 12 2018-05-03 16:23:20 PDT
Comment on attachment 339290 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=339290&action=review >> Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js:289 >> + for (let resource of currentFrame.resourceCollection) > > Maybe a dumb question, but why isn't the main resource in the resource collection? I'm not sure actually 😅. I will check to see if the `mainResource` is part of the `resourceCollection.` If I had to guess as to why not (if that's the case), I think it might be that `resourceCollection` holds all the resources associated with the `mainResource` (e.g. CSS and JS files loaded by the main HTML). >> LayoutTests/http/tests/inspector/network/har/har-page.html:77 >> + for (let resource of WI.frameResourceManager.mainFrame.resourceCollection) > > You should just push with destructuring, the loop isn't needed here. And somehow this test is failing on EWS? Ah I missed this one. Not really sure why the test is failing 🤔. The diff suggest that the size of the resulting HAR is different, so maybe my changes affected that?
Blaze Burg
Comment 13 2018-05-03 16:51:31 PDT
(In reply to Devin Rousso from comment #12) > Comment on attachment 339290 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=339290&action=review > > >> Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js:289 > >> + for (let resource of currentFrame.resourceCollection) > > > > Maybe a dumb question, but why isn't the main resource in the resource collection? > > I'm not sure actually 😅. I will check to see if the `mainResource` is part > of the `resourceCollection.` If I had to guess as to why not (if that's the > case), I think it might be that `resourceCollection` holds all the resources > associated with the `mainResource` (e.g. CSS and JS files loaded by the main > HTML). > > >> LayoutTests/http/tests/inspector/network/har/har-page.html:77 > >> + for (let resource of WI.frameResourceManager.mainFrame.resourceCollection) > > > > You should just push with destructuring, the loop isn't needed here. And somehow this test is failing on EWS? > > Ah I missed this one. Not really sure why the test is failing 🤔. The diff > suggest that the size of the resulting HAR is different, so maybe my changes > affected that? Ah yeah, that is dumb. We should be filtering that out, but feel free to take the easy way out this time.
Devin Rousso
Comment 14 2018-05-04 11:40:39 PDT
WebKit Commit Bot
Comment 15 2018-05-04 16:56:16 PDT
Comment on attachment 339575 [details] Patch Clearing flags on attachment: 339575 Committed r231391: <https://trac.webkit.org/changeset/231391>
WebKit Commit Bot
Comment 16 2018-05-04 16:56:17 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 17 2018-05-04 16:57:34 PDT
Note You need to log in before you can comment on or make changes to this bug.