Bug 165507 - Web Inspector: Remove unused and mostly untested Page domain commands and events
Summary: Web Inspector: Remove unused and mostly untested Page domain commands and events
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: DoNotImportToRadar
: 110186 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-12-06 19:30 PST by Joseph Pecoraro
Modified: 2016-12-07 11:31 PST (History)
12 users (show)

See Also:


Attachments
[PATCH] For Landing (41.25 KB, patch)
2016-12-06 19:35 PST, Joseph Pecoraro
rniwa: review+
Details | Formatted Diff | Diff
[PATCH] Proposed Fix (44.40 KB, patch)
2016-12-06 19:43 PST, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2016-12-06 19:30:23 PST
* Summary:
Remove unused and mostly untested Page domain commands and events

Commands:

    Page.getScriptExecutionStatus
    Page.setScriptExecutionDisabled
    Page.handleJavaScriptDialog

Events:

    Page.javascriptDialogOpening
    Page.javascriptDialogClosed
    Page.scriptsEnabled

These were added a long time ago and have never been used in the frontend that is now in trunk. Some haven't had any port implementation (handleJavaScriptDialog).
Comment 1 Joseph Pecoraro 2016-12-06 19:30:38 PST
*** Bug 110186 has been marked as a duplicate of this bug. ***
Comment 2 Joseph Pecoraro 2016-12-06 19:35:51 PST
Created attachment 296366 [details]
[PATCH] For Landing
Comment 3 Joseph Pecoraro 2016-12-06 19:37:29 PST
Comment on attachment 296366 [details]
[PATCH] For Landing

Hmm, I can also remove Page.setDocumentContent.
Comment 4 Ryosuke Niwa 2016-12-06 19:38:48 PST
Comment on attachment 296366 [details]
[PATCH] For Landing

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

> Source/WebInspectorUI/Versions/Inspector-iOS-7.0.json:-275
> -                "name": "handleJavaScriptDialog",

Do we really want to remove from the older iOS versions’ API definitions?
Comment 5 Joseph Pecoraro 2016-12-06 19:43:03 PST
Created attachment 296368 [details]
[PATCH] Proposed Fix
Comment 6 Joseph Pecoraro 2016-12-06 19:43:59 PST
(In reply to comment #4)
> Comment on attachment 296366 [details]
> [PATCH] For Landing
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=296366&action=review
> 
> > Source/WebInspectorUI/Versions/Inspector-iOS-7.0.json:-275
> > -                "name": "handleJavaScriptDialog",
> 
> Do we really want to remove from the older iOS versions’ API definitions?

We do when they aren't really supported. It gives us (when reading it) a better idea of how that version should really be used instead of everything that it exposed which might not work correctly. We only edit in rare cases, like this, when removing something that didn't work for it.
Comment 7 BJ Burg 2016-12-06 19:58:06 PST
Comment on attachment 296368 [details]
[PATCH] Proposed Fix

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

r=me, but wait for EWS

> Source/WebCore/page/Chrome.cpp:-289
> -    InspectorInstrumentation::didRunJavaScriptDialog(cookie);

Oh gross, this would not even distinguish different kinds of alerts.
Comment 8 BJ Burg 2016-12-06 20:00:20 PST
(In reply to comment #4)
> Comment on attachment 296366 [details]
> [PATCH] For Landing
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=296366&action=review
> 
> > Source/WebInspectorUI/Versions/Inspector-iOS-7.0.json:-275
> > -                "name": "handleJavaScriptDialog",
> 
> Do we really want to remove from the older iOS versions’ API definitions?

These JSON files are ingested at runtime to build up Agent (i.e., DebuggerAgent) classes in WebInspectorUI. They aren't used for anything else, and we have already removed several other unused methods. If someone wants to know what backend commands shipped at that time, they'll need to go look at repository history.
Comment 9 Joseph Pecoraro 2016-12-07 11:08:10 PST
(In reply to comment #8)
> (In reply to comment #4)
> > Comment on attachment 296366 [details]
> > [PATCH] For Landing
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=296366&action=review
> > 
> > > Source/WebInspectorUI/Versions/Inspector-iOS-7.0.json:-275
> > > -                "name": "handleJavaScriptDialog",
> > 
> > Do we really want to remove from the older iOS versions’ API definitions?
> 
> These JSON files are ingested at runtime

Not at runtime. They compile into the UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js with Scripts/update-LegacyInspectorBackendCommands.rb, which I run manually whenever I modify the legacy iOS protocol jsons.
Comment 10 BJ Burg 2016-12-07 11:22:02 PST
(In reply to comment #9)
> (In reply to comment #8)
> > (In reply to comment #4)
> > > Comment on attachment 296366 [details]
> > > [PATCH] For Landing
> > > 
> > > View in context:
> > > https://bugs.webkit.org/attachment.cgi?id=296366&action=review
> > > 
> > > > Source/WebInspectorUI/Versions/Inspector-iOS-7.0.json:-275
> > > > -                "name": "handleJavaScriptDialog",
> > > 
> > > Do we really want to remove from the older iOS versions’ API definitions?
> > 
> > These JSON files are ingested at runtime
> 
> Not at runtime. They compile into the
> UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js with
> Scripts/update-LegacyInspectorBackendCommands.rb, which I run manually
> whenever I modify the legacy iOS protocol jsons.

Oops, yes. The *JS files* are created from the JSON files and dynamically loaded by the Web Inspector.

For WebDriver, the Automation.json file is parsed directly on the web server side, and is also used for code generation in WebKit2.
Comment 11 WebKit Commit Bot 2016-12-07 11:31:35 PST
Comment on attachment 296368 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 296368

Committed r209465: <http://trac.webkit.org/changeset/209465>
Comment 12 WebKit Commit Bot 2016-12-07 11:31:40 PST
All reviewed patches have been landed.  Closing bug.