Bug 57829

Summary: Web Inspector: Range insertNode function does not update content in the inspector
Product: WebKit Reporter: Alexander Pavlov (apavlov) <apavlov>
Component: Web Inspector (Deprecated)Assignee: Alexander Pavlov (apavlov) <apavlov>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Suggested fix
none
[PATCH] Added a test case to an existing test instead of a new one
none
[PATCH] Simplified patch, as suggested by pfeldman
pfeldman: review-
[PATCH] Comment addressed pfeldman: review+

Alexander Pavlov (apavlov)
Reported 2011-04-05 05:08:03 PDT
What steps will reproduce the problem? At a web page like "http://news.ycombinator.com/item?id=1968304" I modified a <p> element, and added the attribute id='p12345' i then typed in the following code into the console: range = document.createRange(); referenceNode = document.getElementById('p12345').firstChild; range.selectNode(referenceNode); range.setStart(referenceNode, 89 ); range.setEnd(referenceNode, 89 + 5 ); range.deleteContents(); span = range.startContainer.ownerDocument.createElement('span'); span.innerHTML = 'test'; range.insertNode(span); after running the above code, the html view updates, but the inspector does not. it truncates after the insertion point. What is the expected result? the html in the inspector should properly update. What happens instead? after running the above code, the html view updates, but the inspector does not. it truncates after the insertion point. Upstreaming http://code.google.com/p/chromium/issues/detail?id=65424 with the code snippet fixed.
Attachments
[PATCH] Suggested fix (8.07 KB, patch)
2011-04-05 07:38 PDT, Alexander Pavlov (apavlov)
no flags
[PATCH] Added a test case to an existing test instead of a new one (8.51 KB, patch)
2011-04-05 07:52 PDT, Alexander Pavlov (apavlov)
no flags
[PATCH] Simplified patch, as suggested by pfeldman (5.77 KB, patch)
2011-04-05 09:27 PDT, Alexander Pavlov (apavlov)
pfeldman: review-
[PATCH] Comment addressed (6.16 KB, patch)
2011-04-05 10:19 PDT, Alexander Pavlov (apavlov)
pfeldman: review+
Alexander Pavlov (apavlov)
Comment 1 2011-04-05 07:38:29 PDT
Created attachment 88227 [details] [PATCH] Suggested fix
Alexander Pavlov (apavlov)
Comment 2 2011-04-05 07:52:49 PDT
Created attachment 88234 [details] [PATCH] Added a test case to an existing test instead of a new one
Alexander Pavlov (apavlov)
Comment 3 2011-04-05 09:27:05 PDT
Created attachment 88252 [details] [PATCH] Simplified patch, as suggested by pfeldman
Pavel Feldman
Comment 4 2011-04-05 10:02:03 PDT
Comment on attachment 88252 [details] [PATCH] Simplified patch, as suggested by pfeldman View in context: https://bugs.webkit.org/attachment.cgi?id=88252&action=review > Source/WebCore/inspector/InspectorDOMAgent.cpp:1100 > + m_childrenRequested.add(bind(container, nodesMap)); Please remove all the other calls to m_childredRequested.add
Alexander Pavlov (apavlov)
Comment 5 2011-04-05 10:19:48 PDT
Created attachment 88267 [details] [PATCH] Comment addressed
Yury Semikhatsky
Comment 6 2011-04-06 01:36:28 PDT
Comment on attachment 88267 [details] [PATCH] Comment addressed View in context: https://bugs.webkit.org/attachment.cgi?id=88267&action=review > Source/WebCore/inspector/InspectorDOMAgent.cpp:1094 > + return buildArrayForContainerChildren(container, 1, nodesMap); Can you rewrite this if block to avoid the recursive call here?
Alexander Pavlov (apavlov)
Comment 7 2011-04-06 03:01:30 PDT
Note You need to log in before you can comment on or make changes to this bug.