RESOLVED FIXED 169086
Web Inspector: Should be able to push nodes in an iframe subtree to the frontend
https://bugs.webkit.org/show_bug.cgi?id=169086
Summary Web Inspector: Should be able to push nodes in an iframe subtree to the frontend
Matt Baker
Reported 2017-03-02 11:17:11 PST
Summary: Should be able to push nodes in an iframe subtree to the frontend. Steps to Reproduce: 1. Inspect theverge.com > goto Elements tab 2. Locate an iframe element (Cmd+F helps) 3. Expand the iframe's #document node, select the <html> element 4. Reload page => Expected: iframe's <html> element selected after DOM tree refresh => Actual: the default element (main frame <body>) is selected Note: It looks like InspectorDOMAgent::nodeForPath is halting when it encounters the iframe element, because InspectorDOMAgent::innerChildNodeCount returns 0.
Attachments
[WebArchive] Test page for iframes/frameset (1.18 KB, application/x-webarchive)
2017-03-02 13:38 PST, Matt Baker
no flags
Patch (9.26 KB, patch)
2017-03-02 20:48 PST, Matt Baker
no flags
[Video] Restoring selection from iframe DOM node (312.51 KB, video/mp4)
2017-03-02 20:57 PST, Matt Baker
no flags
Patch for landing (9.71 KB, patch)
2017-03-02 21:11 PST, Matt Baker
no flags
Matt Baker
Comment 1 2017-03-02 11:57:14 PST
(In reply to comment #0) > Note: > It looks like InspectorDOMAgent::nodeForPath is halting when it encounters > the iframe element, because InspectorDOMAgent::innerChildNodeCount returns 0. Due to the check for matching URLs on DOMTreeContentView.js:365, elements in an iframe's subtree are never requested via InspectorDOMAgent::pushNodeByPathToFrontend. Commenting out the check results in the protocol method being called, but the agent still fails to push the node for the reason above.
Matt Baker
Comment 2 2017-03-02 13:38:34 PST
Created attachment 303230 [details] [WebArchive] Test page for iframes/frameset Test page includes: -iframe with src="about:blank" -iframe with <frameset> source* -iframe with srcdoc content *Although <frameset> is deprecated in HTML5, the fix for this bug should just work for all nodes derived from WebCore::HTMLFrameElementBase.
Matt Baker
Comment 3 2017-03-02 20:48:55 PST
Matt Baker
Comment 4 2017-03-02 20:57:54 PST
Created attachment 303297 [details] [Video] Restoring selection from iframe DOM node
Joseph Pecoraro
Comment 5 2017-03-02 20:59:38 PST
Comment on attachment 303296 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=303296&action=review Neat! r=me > Source/WebCore/inspector/InspectorDOMAgent.cpp:2170 > + return 0; Style: You may want to change all of these `return 0` to `return nullptr`. I thought we had already updated our code to use nullptr, but clearly not. > LayoutTests/inspector/dom/push-node-by-path-to-frontend.html:13 > + name, > + description, Style: I normally do `name, description` on one line since multiline these don't add much.
Matt Baker
Comment 6 2017-03-02 21:11:31 PST
Created attachment 303299 [details] Patch for landing
WebKit Commit Bot
Comment 7 2017-03-02 21:52:30 PST
Comment on attachment 303299 [details] Patch for landing Clearing flags on attachment: 303299 Committed r213353: <http://trac.webkit.org/changeset/213353>
WebKit Commit Bot
Comment 8 2017-03-02 21:52:35 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.