WebKit Bugzilla
Attachment 373674 Details for
Bug 199555
: Web Inspector: Layers: Uncaught Exception: Request with id = 2 failed. {"code":-32601,"message":"'Page' domain was not found","data":[{"code":-32601,"message":"'Page' domain was not found"}]}
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199555-20190708153151.patch (text/plain), 11.46 KB, created by
Devin Rousso
on 2019-07-08 15:31:52 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2019-07-08 15:31:52 PDT
Size:
11.46 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 1df39540308c474a657fd4d918c8968189b1f1c8..91493f2c908fa606e8f335abfa53095af13e348a 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,28 @@ >+2019-07-06 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: Layers: Uncaught Exception: Request with id = 2 failed. {"code":-32601,"message":"'Page' domain was not found","data":[{"code":-32601,"message":"'Page' domain was not found"}]} >+ https://bugs.webkit.org/show_bug.cgi?id=199555 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Use modern inspected target support checking, and defer agent commands until a target is >+ available. >+ >+ * UserInterface/Views/Layers3DContentView.js: >+ (WI.Layers3DContentView): >+ (WI.Layers3DContentView.prototype._showPaintRectsSettingChanged): >+ (WI.Layers3DContentView.prototype._updateCompositingBordersButtonState): >+ (WI.Layers3DContentView.prototype._toggleCompositingBorders): >+ >+ * UserInterface/Views/DOMTreeContentView.js: >+ (WI.DOMTreeContentView): >+ (WI.DOMTreeContentView.prototype._toggleCompositingBorders): >+ (WI.DOMTreeContentView.prototype._updateCompositingBordersButtonToMatchPageSettings): >+ (WI.DOMTreeContentView.prototype._showPaintRectsSettingChanged): >+ (WI.DOMTreeContentView.prototype._showPrintStylesChanged): >+ (WI.DOMTreeContentView.prototype._showRulersChanged): >+ Drive-by: apply the same changes to the Elements tab for when the Layers tab isn't enabled. >+ > 2019-07-06 Nikita Vasilyev <nvasilyev@apple.com> > > Web Inspector: Styles: unbalanced quotes and parenthesis aren't displayed as property closed after editing values >diff --git a/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js b/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js >index 5db19b81fcab70137b4fa6559daddb002695f58c..307b63e289b90f38b945fad3214051ef6d248edc 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js >+++ b/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js >@@ -34,7 +34,7 @@ WI.DOMTreeContentView = class DOMTreeContentView extends WI.ContentView > if (InspectorBackend.domains.Page) { > this._compositingBordersButtonNavigationItem = new WI.ActivateButtonNavigationItem("layer-borders", WI.UIString("Show compositing borders"), WI.UIString("Hide compositing borders"), "Images/LayerBorders.svg", 13, 13); > this._compositingBordersButtonNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._toggleCompositingBorders, this); >- this._compositingBordersButtonNavigationItem.enabled = !!PageAgent.getCompositingBordersVisible; >+ this._compositingBordersButtonNavigationItem.enabled = !!InspectorBackend.domains.Page.getCompositingBordersVisible; > this._compositingBordersButtonNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low; > } > >@@ -42,8 +42,8 @@ WI.DOMTreeContentView = class DOMTreeContentView extends WI.ContentView > WI.settings.showPaintRects.addEventListener(WI.Setting.Event.Changed, this._showPaintRectsSettingChanged, this); > this._paintFlashingButtonNavigationItem = new WI.ActivateButtonNavigationItem("paint-flashing", WI.UIString("Enable paint flashing"), WI.UIString("Disable paint flashing"), "Images/Paint.svg", 16, 16); > this._paintFlashingButtonNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._togglePaintFlashing, this); >- this._paintFlashingButtonNavigationItem.enabled = !!PageAgent.setShowPaintRects; >- this._paintFlashingButtonNavigationItem.activated = PageAgent.setShowPaintRects && WI.settings.showPaintRects.value; >+ this._paintFlashingButtonNavigationItem.enabled = !!InspectorBackend.domains.Page.setShowPaintRects; >+ this._paintFlashingButtonNavigationItem.activated = InspectorBackend.domains.Page.setShowPaintRects && WI.settings.showPaintRects.value; > this._paintFlashingButtonNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low; > } > >@@ -592,11 +592,12 @@ WI.DOMTreeContentView = class DOMTreeContentView extends WI.ContentView > > _toggleCompositingBorders(event) > { >- console.assert(PageAgent.setCompositingBordersVisible); >- > var activated = !this._compositingBordersButtonNavigationItem.activated; > this._compositingBordersButtonNavigationItem.activated = activated; >- PageAgent.setCompositingBordersVisible(activated); >+ for (let target of WI.targets) { >+ if (target.PageAgent) >+ target.PageAgent.setCompositingBordersVisible(activated); >+ } > } > > _togglePaintFlashing(event) >@@ -609,6 +610,16 @@ WI.DOMTreeContentView = class DOMTreeContentView extends WI.ContentView > if (WI.settings.experimentalEnableLayersTab.value) > return; > >+ if (!WI.targetsAvailable()) { >+ WI.whenTargetsAvailable().then(() => { >+ this._updateCompositingBordersButtonToMatchPageSettings(); >+ }); >+ return; >+ } >+ >+ if (!window.PageAgent) >+ return; >+ > var button = this._compositingBordersButtonNavigationItem; > > // We need to sync with the page settings since these can be controlled >@@ -621,11 +632,12 @@ WI.DOMTreeContentView = class DOMTreeContentView extends WI.ContentView > > _showPaintRectsSettingChanged(event) > { >- console.assert(PageAgent.setShowPaintRects); >- >- this._paintFlashingButtonNavigationItem.activated = WI.settings.showPaintRects.value; >- >- PageAgent.setShowPaintRects(this._paintFlashingButtonNavigationItem.activated); >+ let activated = WI.settings.showPaintRects.value; >+ this._paintFlashingButtonNavigationItem.activated = activated; >+ for (let target of WI.targets) { >+ if (target.PageAgent && target.PageAgent.setShowPaintRects) >+ target.PageAgent.setShowPaintRects(activated); >+ } > } > > _showShadowDOMSettingChanged(event) >@@ -643,7 +655,10 @@ WI.DOMTreeContentView = class DOMTreeContentView extends WI.ContentView > this._showPrintStylesButtonNavigationItem.activated = WI.printStylesEnabled; > > let mediaType = WI.printStylesEnabled ? "print" : ""; >- PageAgent.setEmulatedMedia(mediaType); >+ for (let target of WI.targets) { >+ if (target.PageAgent) >+ target.PageAgent.setEmulatedMedia(mediaType); >+ } > > WI.cssManager.mediaTypeChanged(); > } >@@ -721,11 +736,12 @@ WI.DOMTreeContentView = class DOMTreeContentView extends WI.ContentView > > _showRulersChanged() > { >- console.assert(PageAgent.setShowRulers); >- >- this._showRulersButtonNavigationItem.activated = WI.settings.showRulers.value; >- >- PageAgent.setShowRulers(this._showRulersButtonNavigationItem.activated); >+ let activated = WI.settings.showRulers.value; >+ this._showRulersButtonNavigationItem.activated = activated; >+ for (let target of WI.targets) { >+ if (target.PageAgent && target.PageAgent.setShowRulers) >+ target.PageAgent.setShowRulers(activated); >+ } > } > > _toggleShowRulers(event) >diff --git a/Source/WebInspectorUI/UserInterface/Views/Layers3DContentView.js b/Source/WebInspectorUI/UserInterface/Views/Layers3DContentView.js >index a53667ac7f4379f90221b1aa631f8a498b6cc5af..7d686c4c6e765c4aa824177cf349d8d5078ba1e4 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/Layers3DContentView.js >+++ b/Source/WebInspectorUI/UserInterface/Views/Layers3DContentView.js >@@ -33,13 +33,14 @@ WI.Layers3DContentView = class Layers3DContentView extends WI.ContentView > > this._compositingBordersButtonNavigationItem = new WI.ActivateButtonNavigationItem("layer-borders", WI.UIString("Show compositing borders"), WI.UIString("Hide compositing borders"), "Images/LayerBorders.svg", 13, 13); > this._compositingBordersButtonNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._toggleCompositingBorders, this); >+ this._compositingBordersButtonNavigationItem.enabled = !!InspectorBackend.domains.Page; > this._compositingBordersButtonNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low; > > WI.settings.showPaintRects.addEventListener(WI.Setting.Event.Changed, this._showPaintRectsSettingChanged, this); > this._paintFlashingButtonNavigationItem = new WI.ActivateButtonNavigationItem("paint-flashing", WI.UIString("Enable paint flashing"), WI.UIString("Disable paint flashing"), "Images/Paint.svg", 16, 16); > this._paintFlashingButtonNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._togglePaintFlashing, this); >- this._paintFlashingButtonNavigationItem.enabled = !!PageAgent.setShowPaintRects; >- this._paintFlashingButtonNavigationItem.activated = PageAgent.setShowPaintRects && WI.settings.showPaintRects.value; >+ this._paintFlashingButtonNavigationItem.enabled = InspectorBackend.domains.Page && !!InspectorBackend.domains.Page.setShowPaintRects; >+ this._paintFlashingButtonNavigationItem.activated = InspectorBackend.domains.Page.setShowPaintRects && WI.settings.showPaintRects.value; > this._paintFlashingButtonNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low; > > this._layers = []; >@@ -392,10 +393,12 @@ WI.Layers3DContentView = class Layers3DContentView extends WI.ContentView > > _showPaintRectsSettingChanged(event) > { >- console.assert(PageAgent.setShowPaintRects); >- >- this._paintFlashingButtonNavigationItem.activated = WI.settings.showPaintRects.value; >- PageAgent.setShowPaintRects(this._paintFlashingButtonNavigationItem.activated); >+ let activated = WI.settings.showPaintRects.value; >+ this._paintFlashingButtonNavigationItem.activated = activated; >+ for (let target of WI.targets) { >+ if (target.PageAgent && target.PageAgent.setShowPaintRects) >+ target.PageAgent.setShowPaintRects(activated); >+ } > } > > _togglePaintFlashing(event) >@@ -405,6 +408,16 @@ WI.Layers3DContentView = class Layers3DContentView extends WI.ContentView > > _updateCompositingBordersButtonState() > { >+ if (!WI.targetsAvailable()) { >+ WI.whenTargetsAvailable().then(() => { >+ this._updateCompositingBordersButtonState(); >+ }); >+ return; >+ } >+ >+ if (!window.PageAgent) >+ return; >+ > // This value can be changed outside of Web Inspector. > // FIXME: Have PageAgent dispatch a change event instead? > PageAgent.getCompositingBordersVisible((error, compositingBordersVisible) => { >@@ -415,8 +428,12 @@ WI.Layers3DContentView = class Layers3DContentView extends WI.ContentView > > _toggleCompositingBorders(event) > { >- this._compositingBordersButtonNavigationItem.activated = !this._compositingBordersButtonNavigationItem.activated; >- PageAgent.setCompositingBordersVisible(this._compositingBordersButtonNavigationItem.activated); >+ let activated = !this._compositingBordersButtonNavigationItem.activated; >+ this._compositingBordersButtonNavigationItem.activated = activated; >+ for (let target of WI.targets) { >+ if (target.PageAgent) >+ target.PageAgent.setCompositingBordersVisible(activated); >+ } > } > > _buildLayerInfoElement()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199555
:
373579
|
373674
|
373930