Bug 12801

Summary: Assertion failure in createMarkup() (root) when doing Select All, Copy in an SVG document
Product: WebKit Reporter: mitz
Component: HTML EditingAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal CC: justin.garcia
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
Test case (will assert when instructions are followed)
none
Non-SVG test case (ditto)
none
Look for <body> (and assert if not found) only in HTML documents
ap: review-
remove the assertion mjs: review+

Description mitz 2007-02-17 23:07:28 PST
To reproduce: open the attachment w/ a debug build of TOT WebKit, choose Edit > Select All and the Edit > Copy.

Actual result:
ASSERTION FAILED: root
(WebCore/editing/markup.cpp:397 WebCore::DeprecatedString WebCore::createMarkup(const WebCore::Range*, WTF::Vector<WebCore::Node*, 0ul>*, WebCore::EAnnotateForInterchange))
Comment 1 mitz 2007-02-17 23:17:04 PST
Created attachment 13218 [details]
Test case (will assert when instructions are followed)
Comment 2 mitz 2007-02-17 23:22:34 PST
Created attachment 13219 [details]
Non-SVG test case (ditto)
Comment 3 mitz 2007-02-18 06:45:39 PST
Created attachment 13225 [details]
Look for <body> (and assert if not found) only in HTML documents
Comment 4 mitz 2007-02-18 09:51:49 PST
Comment on attachment 13225 [details]
Look for <body> (and assert if not found) only in HTML documents

Based on Alexey's comments, I am going to leave this to other people who know what they're doing.
Comment 5 Alexey Proskuryakov 2007-02-18 09:53:31 PST
Comment on attachment 13225 [details]
Look for <body> (and assert if not found) only in HTML documents

I think it is wrong to introduce different behavior for HTML and XHTML here (since isHTMLDocument() returns false for XHML).

I am not quite sure about the correct solution, but maybe one can just traverse up the hierarchy until seeing either a node that's not an HTML element, or a body.
Comment 6 Alexey Proskuryakov 2007-02-28 11:01:36 PST
Created attachment 13427 [details]
remove the assertion

Not that I know what I'm doing... :-)
Comment 7 Maciej Stachowiak 2007-02-28 19:42:15 PST
Comment on attachment 13427 [details]
remove the assertion

I think removing the assertion is probably right. r=me
Comment 8 Alexey Proskuryakov 2007-03-01 09:21:24 PST
Committed revision 19926.