Bug 76183

Summary: Web Inspector: make HTML editing preserve node identity when node nesting level changes.
Product: WebKit Reporter: Pavel Feldman <pfeldman>
Component: Web Inspector (Deprecated)Assignee: Pavel Feldman <pfeldman>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, ossy, pfeldman, pmuellr, rik, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch yurys: review+

Description Pavel Feldman 2012-01-12 08:51:28 PST
As of today, editing

<p>Foo</p>

to become

<div><p>Foo</p></div>

re-creates <p>Foo</p>, hence all JavaScript wrappers pointing to <p> become invalid.

It should move it into the new <div> instead, while preserving the node identity and wrapper references.
Comment 1 Pavel Feldman 2012-01-12 08:54:41 PST
Created attachment 122253 [details]
Patch
Comment 2 Yury Semikhatsky 2012-01-12 09:42:14 PST
Comment on attachment 122253 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=122253&action=review

> Source/WebCore/inspector/DOMEditor.cpp:402
> +    Deque<Digest*> queue;

Why do you prefer BFS over DFS here?
Comment 3 Pavel Feldman 2012-01-13 05:25:11 PST
Committed r104920: <http://trac.webkit.org/changeset/104920>
Comment 4 Csaba Osztrogonác 2012-01-13 05:39:31 PST
(In reply to comment #3)
> Committed r104920: <http://trac.webkit.org/changeset/104920>

Reopen, because it broke the 32 bit builds:
cc1plus: warnings being treated as errors
/ramdisk/qt-linux-32-release-webkit2/build/Source/WebCore/inspector/DOMEditor.cpp: In member function ‘void WebCore::DOMEditor::dumpMap(const WTF::String&, const WTF::Vector<std::pair<WebCore::DOMEditor::Digest*, unsigned int>, 0u>&, const WTF::Vector<WTF::OwnPtr<WebCore::DOMEditor::Digest>, 0u>&)’:
/ramdisk/qt-linux-32-release-webkit2/build/Source/WebCore/inspector/DOMEditor.cpp:430: error: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’
/ramdisk/qt-linux-32-release-webkit2/build/Source/WebCore/inspector/DOMEditor.cpp:430: error: format ‘%ld’ expects type ‘long int’, but argument 6 has type ‘unsigned int’

Could you fix it?
Comment 5 Csaba Osztrogonác 2012-01-13 06:02:58 PST
Buildfix landed in http://trac.webkit.org/changeset/104923
Comment 6 Antonio Gomes 2012-02-25 13:07:18 PST
(In reply to comment #5)
> Buildfix landed in http://trac.webkit.org/changeset/104923

can be re-closed?