DOM.requestNode always returns {nodeId: 0} unless DOM.getDocument is called first
Reported by
j...@ulos.org,
Oct 12 2017
|
|||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Safari/604.1.38 Steps to reproduce the problem: 1. Launch chrome, navigate to https://www.wikipedia.org/ with the viewport large enough so that the desktop version of the site is shown. 2. Launch the chrome-remote-interface [1] with the interactive inspector. 3. Run the following DevTools commands interactively (shown at the >>> prompt) ##### chrome-remote-interface session begin ##### >>> DOM.enable() ... {} >>> Runtime.evaluate({expression: 'document.elementsFromPoint(100,50)[0]'}) ... { result: { type: 'object', subtype: 'node', className: 'HTMLHeadingElement', description: 'h1.central-textlogo', objectId: '{"injectedScriptId":1,"id":1}' } } >>> DOM.requestNode({objectId: '{"injectedScriptId":1,"id":1}'}) ... { nodeId: 0 } >>> DOM.getDocument() ... { root: { nodeId: 2, backendNodeId: 2, nodeType: 9, nodeName: '#document', localName: '', nodeValue: '', childNodeCount: 2, children: [ { nodeId: 3, parentId: 2, backendNodeId: 3, nodeType: 10, nodeName: 'html', localName: '', nodeValue: '', publicId: '', systemId: '' }, { nodeId: 4, parentId: 2, backendNodeId: 4, nodeType: 1, nodeName: 'HTML', localName: 'html', nodeValue: '', childNodeCount: 2, children: [ { nodeId: 5, parentId: 4, backendNodeId: 5, nodeType: 1, nodeName: 'HEAD', localName: 'head', nodeValue: '', childNodeCount: 15, attributes: [] }, { nodeId: 6, parentId: 4, backendNodeId: 6, nodeType: 1, nodeName: 'BODY', localName: 'body', nodeValue: '', childNodeCount: 22, attributes: [ 'id', 'www-wikipedia-org', 'class', ' jsl10n-visible' ] } ], attributes: [ 'lang', 'mul', 'class', 'js-enabled' ], frameId: '64600.1' } ], documentURL: 'https://www.wikipedia.org/', baseURL: 'https://www.wikipedia.org/', xmlVersion: '' } } >>> DOM.requestNode({objectId: '{"injectedScriptId":1,"id":1}'}) ... { nodeId: 7 } >>> DOM.getOuterHTML({nodeId: 7}) ... { outerHTML: '<h1 class="central-textlogo" style="font-variant: small-caps" alt="WikipediA" title="Wikipedia">\n<img src="portal/wikipedia.org/assets/img/Wikipedia_wordmark.png" srcset="portal/wikipedia.org/assets/img/Wikipedia_wordmark@1.5x.png 1.5x, portal/wikipedia.org/assets/img/Wikipedia_wordmark@2x.png 2x" width="174" height="30" alt="WikipediA" title="Wikipedia">\n<strong class="jsl10n localized-slogan" data-jsl10n="slogan">The Free Encyclopedia</strong>\n</h1>' } >>> ##### chrome-remote-interface session end ##### [1] https://github.com/cyrus-and/chrome-remote-interface What is the expected behavior? 1. DOM.requestNode should return the non-zero nodeId on the first invocation. 2. Only after DOM.getDocument is executed does DOM.requestNode return the correct result. What went wrong? DOM.requestNode returns zero universally, unless DOM.getDocument is first executed. It could be that DOM.requestNode is not pushing nodes from the backend to the frontend, which is what DOM.getDocument is doing? Did this work before? No Chrome version: 61.0.3163.100 Channel: n/a OS Version: OS X 10.13 Flash Version: Shockwave Flash 27.0 r0 I first noticed this in Chrome 59. It looks like the `web_view_impl.cc` test case passes because it just checks for any integer (e.g. 0), not the right non-zero integer.
,
Oct 16 2017
I was able to reproduce it on M63 as well.
,
Dec 7
DOM.getDocument call is required to use all other DOM Apis. |
|||
►
Sign in to add a comment |
|||
Comment 1 by manoranj...@chromium.org
, Oct 12 2017