WebKit Bugzilla
Attachment 357770 Details for
Bug 192910
: ITMLKit Inspector: Elements tab does not show DOM Tree
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
[PATCH] Proposed Fix
itml-1.patch (text/plain), 9.58 KB, created by
Joseph Pecoraro
on 2018-12-19 19:17:07 PST
(
hide
)
Description:
[PATCH] Proposed Fix
Filename:
MIME Type:
Creator:
Joseph Pecoraro
Created:
2018-12-19 19:17:07 PST
Size:
9.58 KB
patch
obsolete
>diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index a6446e9d112..d80147902fc 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,21 @@ >+2018-12-19 Joseph Pecoraro <pecoraro@apple.com> >+ >+ ITMLKit Inspector: Elements tab does not show DOM Tree >+ https://bugs.webkit.org/show_bug.cgi?id=192910 >+ <rdar://problem/46680585> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * inspector/agents/InspectorAgent.h: >+ * inspector/agents/InspectorAgent.cpp: >+ (Inspector::InspectorAgent::enable): >+ (Inspector::InspectorAgent::activateExtraDomain): >+ (Inspector::InspectorAgent::activateExtraDomains): >+ Send extra domains immediately instead of waiting until >+ the Inspector domain is enabled. This will ensure the frontend >+ hears about extra augmented domains before augmenting agents >+ get a chance to send any messages. >+ > 2018-12-18 Saam Barati <sbarati@apple.com> > > Unreviewed. Appease a build error where we weren't using a variable defined in an "if" >diff --git a/Source/JavaScriptCore/inspector/agents/InspectorAgent.cpp b/Source/JavaScriptCore/inspector/agents/InspectorAgent.cpp >index f0a0f836b81..c770e6d18d0 100644 >--- a/Source/JavaScriptCore/inspector/agents/InspectorAgent.cpp >+++ b/Source/JavaScriptCore/inspector/agents/InspectorAgent.cpp >@@ -68,11 +68,6 @@ void InspectorAgent::enable(ErrorString&) > if (m_pendingInspectData.first) > inspect(m_pendingInspectData.first.copyRef(), m_pendingInspectData.second.copyRef()); > >-#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) >- if (m_pendingExtraDomainsData) >- m_frontendDispatcher->activateExtraDomains(m_pendingExtraDomainsData); >-#endif >- > for (auto& testCommand : m_pendingEvaluateTestCommands) > m_frontendDispatcher->evaluateForTestInFrontend(testCommand); > >@@ -113,12 +108,8 @@ void InspectorAgent::evaluateForTestInFrontend(const String& script) > #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) > void InspectorAgent::activateExtraDomain(const String& domainName) > { >- if (!m_enabled) { >- if (!m_pendingExtraDomainsData) >- m_pendingExtraDomainsData = JSON::ArrayOf<String>::create(); >- m_pendingExtraDomainsData->addItem(domainName); >+ if (!m_enabled) > return; >- } > > auto domainNames = JSON::ArrayOf<String>::create(); > domainNames->addItem(domainName); >@@ -134,10 +125,7 @@ void InspectorAgent::activateExtraDomains(const Vector<String>& extraDomains) > for (auto domainName : extraDomains) > domainNames->addItem(domainName); > >- if (!m_enabled) >- m_pendingExtraDomainsData = WTFMove(domainNames); >- else >- m_frontendDispatcher->activateExtraDomains(WTFMove(domainNames)); >+ m_frontendDispatcher->activateExtraDomains(WTFMove(domainNames)); > } > #endif > >diff --git a/Source/JavaScriptCore/inspector/agents/InspectorAgent.h b/Source/JavaScriptCore/inspector/agents/InspectorAgent.h >index d2a6d5baf56..26119c02f29 100644 >--- a/Source/JavaScriptCore/inspector/agents/InspectorAgent.h >+++ b/Source/JavaScriptCore/inspector/agents/InspectorAgent.h >@@ -71,9 +71,6 @@ private: > > Vector<String> m_pendingEvaluateTestCommands; > std::pair<RefPtr<Protocol::Runtime::RemoteObject>, RefPtr<JSON::Object>> m_pendingInspectData; >-#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) >- RefPtr<JSON::ArrayOf<String>> m_pendingExtraDomainsData; >-#endif > bool m_enabled { false }; > }; > >diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 7d0af5a0c82..8fc25fd2242 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,27 @@ >+2018-12-19 Joseph Pecoraro <pecoraro@apple.com> >+ >+ ITMLKit Inspector: Elements tab does not show DOM Tree >+ https://bugs.webkit.org/show_bug.cgi?id=192910 >+ <rdar://problem/46680585> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UserInterface/Protocol/Connection.js: >+ (InspectorBackend.Connection.prototype._dispatchEvent): >+ Better logging for errors. >+ >+ * UserInterface/Base/Main.js: >+ * UserInterface/Controllers/AppController.js: >+ (WI.AppController.prototype.activateExtraDomains): >+ Let Targets get a chance to activate extra domains. >+ Perform a little more work in these cases. >+ >+ * UserInterface/Protocol/Target.js: >+ (WI.Target): >+ (WI.Target.prototype.activateExtraDomain): >+ Expose agents for domains that are active. >+ Expose agents for extra domains when they are activated. >+ > 2018-12-18 Joseph Pecoraro <pecoraro@apple.com> > > Web Inspector: m3u8 content not shown, it should be text >diff --git a/Source/WebInspectorUI/UserInterface/Base/Main.js b/Source/WebInspectorUI/UserInterface/Base/Main.js >index b10fc910470..251cef7c434 100644 >--- a/Source/WebInspectorUI/UserInterface/Base/Main.js >+++ b/Source/WebInspectorUI/UserInterface/Base/Main.js >@@ -754,8 +754,19 @@ WI.activateExtraDomains = function(domains) > { > this.notifications.dispatchEventToListeners(WI.Notification.ExtraDomainsActivated, {domains}); > >- if (WI.mainTarget && WI.mainTarget.CSSAgent) >- WI.CSSCompletions.initializeCSSCompletions(WI.assumingMainTarget()); >+ if (WI.mainTarget) { >+ if (!WI.pageTarget && WI.mainTarget.DOMAgent) >+ WI.pageTarget = WI.mainTarget; >+ >+ if (WI.mainTarget.CSSAgent) >+ WI.CSSCompletions.initializeCSSCompletions(WI.assumingMainTarget()); >+ >+ if (WI.mainTarget.DOMAgent) >+ WI.domManager.ensureDocument(); >+ >+ if (WI.mainTarget.PageAgent) >+ WI.networkManager.initializeTarget(WI.mainTarget); >+ } > > this._updateReloadToolbarButton(); > this._updateDownloadToolbarButton(); >diff --git a/Source/WebInspectorUI/UserInterface/Controllers/AppController.js b/Source/WebInspectorUI/UserInterface/Controllers/AppController.js >index b9396230ce4..32469af480f 100644 >--- a/Source/WebInspectorUI/UserInterface/Controllers/AppController.js >+++ b/Source/WebInspectorUI/UserInterface/Controllers/AppController.js >@@ -65,10 +65,17 @@ WI.AppController = class AppController extends WI.AppControllerBase > > this._hasExtraDomains = true; > >+ console.assert(WI.mainTarget instanceof WI.DirectBackendTarget); >+ console.assert(WI.mainTarget.type === WI.Target.Type.JSContext); >+ console.assert(WI.sharedApp.debuggableType === WI.DebuggableType.JavaScript); >+ console.assert(WI.targets.length === 1); >+ > for (let domain of domains) { > let agent = InspectorBackend.activateDomain(domain); > if (agent.enable) > agent.enable(); >+ for (let target of WI.targets) >+ target.activateExtraDomain(domain); > } > > // FIXME: all code within WI.activateExtraDomains should be distributed elsewhere. >diff --git a/Source/WebInspectorUI/UserInterface/Protocol/Connection.js b/Source/WebInspectorUI/UserInterface/Protocol/Connection.js >index 4e2e4031fe3..d137f884ed0 100644 >--- a/Source/WebInspectorUI/UserInterface/Protocol/Connection.js >+++ b/Source/WebInspectorUI/UserInterface/Protocol/Connection.js >@@ -165,19 +165,19 @@ InspectorBackend.Connection = class InspectorBackendConnection > let qualifiedName = messageObject["method"]; > let [domainName, eventName] = qualifiedName.split("."); > if (!(domainName in this._agents)) { >- console.error("Protocol Error: Attempted to dispatch method '" + eventName + "' for non-existing domain '" + domainName + "'"); >+ console.error("Protocol Error: Attempted to dispatch method '" + eventName + "' for non-existing domain '" + domainName + "'", messageObject); > return; > } > > let agent = this._agents[domainName]; > if (!agent.active) { >- console.error("Protocol Error: Attempted to dispatch method for domain '" + domainName + "' which exists but is not active."); >+ console.error("Protocol Error: Attempted to dispatch method for domain '" + domainName + "' which exists but is not active.", messageObject); > return; > } > > let event = agent.getEvent(eventName); > if (!event) { >- console.error("Protocol Error: Attempted to dispatch an unspecified method '" + qualifiedName + "'"); >+ console.error("Protocol Error: Attempted to dispatch an unspecified method '" + qualifiedName + "'", messageObject); > return; > } > >diff --git a/Source/WebInspectorUI/UserInterface/Protocol/Target.js b/Source/WebInspectorUI/UserInterface/Protocol/Target.js >index 3382c63b5bb..dc799526762 100644 >--- a/Source/WebInspectorUI/UserInterface/Protocol/Target.js >+++ b/Source/WebInspectorUI/UserInterface/Protocol/Target.js >@@ -43,8 +43,11 @@ WI.Target = class Target extends WI.Object > // supported by the target. > this._agents = {}; > const supportedDomains = this._supportedDomainsForTargetType(this._type); >- for (let domain of supportedDomains) >- this._agents[domain] = this._connection._agents[domain]; >+ for (let domain of supportedDomains) { >+ let agent = this._connection._agents[domain]; >+ if (agent && agent.active) >+ this._agents[domain] = agent; >+ } > > this._connection.target = this; > >@@ -97,6 +100,13 @@ WI.Target = class Target extends WI.Object > }); > } > >+ activateExtraDomain(domain) >+ { >+ let agent = this._connection._agents[domain]; >+ if (agent && agent.active) >+ this._agents[domain] = agent; >+ } >+ > // Agents > > get ApplicationCacheAgent() { return this._agents.ApplicationCache; }
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 192910
: 357770