Changeset 247356 in webkit
- Timestamp:
- Jul 11, 2019 11:36:57 AM (5 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r247278 r247356 1 2019-07-11 Devin Rousso <drousso@apple.com> 2 3 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"}]} 4 https://bugs.webkit.org/show_bug.cgi?id=199555 5 6 Reviewed by Joseph Pecoraro. 7 8 Use modern inspected target support checking, and defer agent commands until a target is 9 available. 10 11 * UserInterface/Views/Layers3DContentView.js: 12 (WI.Layers3DContentView): 13 (WI.Layers3DContentView.prototype._showPaintRectsSettingChanged): 14 (WI.Layers3DContentView.prototype._updateCompositingBordersButtonState): 15 (WI.Layers3DContentView.prototype._toggleCompositingBorders): 16 17 * UserInterface/Views/DOMTreeContentView.js: 18 (WI.DOMTreeContentView): 19 (WI.DOMTreeContentView.prototype._toggleCompositingBorders): 20 (WI.DOMTreeContentView.prototype._updateCompositingBordersButtonToMatchPageSettings): 21 (WI.DOMTreeContentView.prototype._showPaintRectsSettingChanged): 22 (WI.DOMTreeContentView.prototype._showPrintStylesChanged): 23 (WI.DOMTreeContentView.prototype._showRulersChanged): 24 Drive-by: apply the same changes to the Elements tab for when the Layers tab isn't enabled. 25 1 26 2019-07-09 Devin Rousso <drousso@apple.com> 2 27 -
trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js
r247248 r247356 35 35 this._compositingBordersButtonNavigationItem = new WI.ActivateButtonNavigationItem("layer-borders", WI.UIString("Show compositing borders"), WI.UIString("Hide compositing borders"), "Images/LayerBorders.svg", 13, 13); 36 36 this._compositingBordersButtonNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._toggleCompositingBorders, this); 37 this._compositingBordersButtonNavigationItem.enabled = !! PageAgent.getCompositingBordersVisible;37 this._compositingBordersButtonNavigationItem.enabled = !!InspectorBackend.domains.Page.getCompositingBordersVisible; 38 38 this._compositingBordersButtonNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low; 39 39 } … … 43 43 this._paintFlashingButtonNavigationItem = new WI.ActivateButtonNavigationItem("paint-flashing", WI.UIString("Enable paint flashing"), WI.UIString("Disable paint flashing"), "Images/Paint.svg", 16, 16); 44 44 this._paintFlashingButtonNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._togglePaintFlashing, this); 45 this._paintFlashingButtonNavigationItem.enabled = !! PageAgent.setShowPaintRects;46 this._paintFlashingButtonNavigationItem.activated = PageAgent.setShowPaintRects && WI.settings.showPaintRects.value;45 this._paintFlashingButtonNavigationItem.enabled = !!InspectorBackend.domains.Page.setShowPaintRects; 46 this._paintFlashingButtonNavigationItem.activated = InspectorBackend.domains.Page.setShowPaintRects && WI.settings.showPaintRects.value; 47 47 this._paintFlashingButtonNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low; 48 48 } … … 591 591 _toggleCompositingBorders(event) 592 592 { 593 console.assert(PageAgent.setCompositingBordersVisible);594 595 593 var activated = !this._compositingBordersButtonNavigationItem.activated; 596 594 this._compositingBordersButtonNavigationItem.activated = activated; 597 PageAgent.setCompositingBordersVisible(activated); 595 596 for (let target of WI.targets) { 597 if (target.PageAgent) 598 target.PageAgent.setCompositingBordersVisible(activated); 599 } 598 600 } 599 601 … … 605 607 _updateCompositingBordersButtonToMatchPageSettings() 606 608 { 609 if (!WI.targetsAvailable()) { 610 WI.whenTargetsAvailable().then(() => { 611 this._updateCompositingBordersButtonToMatchPageSettings(); 612 }); 613 return; 614 } 615 616 if (!window.PageAgent) 617 return; 618 607 619 var button = this._compositingBordersButtonNavigationItem; 608 620 … … 617 629 _showPaintRectsSettingChanged(event) 618 630 { 619 console.assert(PageAgent.setShowPaintRects); 620 621 this._paintFlashingButtonNavigationItem.activated = WI.settings.showPaintRects.value; 622 623 PageAgent.setShowPaintRects(this._paintFlashingButtonNavigationItem.activated); 631 let activated = WI.settings.showPaintRects.value; 632 this._paintFlashingButtonNavigationItem.activated = activated; 633 634 for (let target of WI.targets) { 635 if (target.PageAgent && target.PageAgent.setShowPaintRects) 636 target.PageAgent.setShowPaintRects(activated); 637 } 624 638 } 625 639 … … 639 653 640 654 let mediaType = WI.printStylesEnabled ? "print" : ""; 641 PageAgent.setEmulatedMedia(mediaType); 655 for (let target of WI.targets) { 656 if (target.PageAgent) 657 target.PageAgent.setEmulatedMedia(mediaType); 658 } 642 659 643 660 WI.cssManager.mediaTypeChanged(); … … 717 734 _showRulersChanged() 718 735 { 719 console.assert(PageAgent.setShowRulers); 720 721 this._showRulersButtonNavigationItem.activated = WI.settings.showRulers.value; 722 723 PageAgent.setShowRulers(this._showRulersButtonNavigationItem.activated); 736 let activated = WI.settings.showRulers.value; 737 this._showRulersButtonNavigationItem.activated = activated; 738 739 for (let target of WI.targets) { 740 if (target.PageAgent && target.PageAgent.setShowRulers) 741 target.PageAgent.setShowRulers(activated); 742 } 724 743 } 725 744 -
trunk/Source/WebInspectorUI/UserInterface/Views/Layers3DContentView.js
r238743 r247356 34 34 this._compositingBordersButtonNavigationItem = new WI.ActivateButtonNavigationItem("layer-borders", WI.UIString("Show compositing borders"), WI.UIString("Hide compositing borders"), "Images/LayerBorders.svg", 13, 13); 35 35 this._compositingBordersButtonNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._toggleCompositingBorders, this); 36 this._compositingBordersButtonNavigationItem.enabled = !!InspectorBackend.domains.Page; 36 37 this._compositingBordersButtonNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low; 37 38 … … 39 40 this._paintFlashingButtonNavigationItem = new WI.ActivateButtonNavigationItem("paint-flashing", WI.UIString("Enable paint flashing"), WI.UIString("Disable paint flashing"), "Images/Paint.svg", 16, 16); 40 41 this._paintFlashingButtonNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._togglePaintFlashing, this); 41 this._paintFlashingButtonNavigationItem.enabled = !!PageAgent.setShowPaintRects;42 this._paintFlashingButtonNavigationItem.activated = PageAgent.setShowPaintRects && WI.settings.showPaintRects.value;42 this._paintFlashingButtonNavigationItem.enabled = InspectorBackend.domains.Page && !!InspectorBackend.domains.Page.setShowPaintRects; 43 this._paintFlashingButtonNavigationItem.activated = InspectorBackend.domains.Page.setShowPaintRects && WI.settings.showPaintRects.value; 43 44 this._paintFlashingButtonNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low; 44 45 … … 393 394 _showPaintRectsSettingChanged(event) 394 395 { 395 console.assert(PageAgent.setShowPaintRects); 396 397 this._paintFlashingButtonNavigationItem.activated = WI.settings.showPaintRects.value; 398 PageAgent.setShowPaintRects(this._paintFlashingButtonNavigationItem.activated); 396 let activated = WI.settings.showPaintRects.value; 397 this._paintFlashingButtonNavigationItem.activated = activated; 398 399 for (let target of WI.targets) { 400 if (target.PageAgent && target.PageAgent.setShowPaintRects) 401 target.PageAgent.setShowPaintRects(activated); 402 } 399 403 } 400 404 … … 406 410 _updateCompositingBordersButtonState() 407 411 { 412 if (!WI.targetsAvailable()) { 413 WI.whenTargetsAvailable().then(() => { 414 this._updateCompositingBordersButtonState(); 415 }); 416 return; 417 } 418 419 if (!window.PageAgent) 420 return; 421 408 422 // This value can be changed outside of Web Inspector. 409 423 // FIXME: Have PageAgent dispatch a change event instead? … … 416 430 _toggleCompositingBorders(event) 417 431 { 418 this._compositingBordersButtonNavigationItem.activated = !this._compositingBordersButtonNavigationItem.activated; 419 PageAgent.setCompositingBordersVisible(this._compositingBordersButtonNavigationItem.activated); 432 let activated = !this._compositingBordersButtonNavigationItem.activated; 433 this._compositingBordersButtonNavigationItem.activated = activated; 434 435 for (let target of WI.targets) { 436 if (target.PageAgent) 437 target.PageAgent.setCompositingBordersVisible(activated); 438 } 420 439 } 421 440
Note: See TracChangeset
for help on using the changeset viewer.