-
enrica@apple.com authored
<rdar://problem/7666670> https://bugs.webkit.org/show_bug.cgi?id=35305 Reviewed by Darin Adler. createFragmentFromMarkup did not handle correctly the case where documentElement is not an HTMLElement. The static cast to HTMLElement was causing createContextualFragment to crash. Test: editing/execCommand/insert-list-xml.xhtml * dom/Element.cpp: (WebCore::Element::createContextualFragment): Added. * dom/Element.h: Added createContextualFragment virtual function. * editing/markup.cpp: (WebCore::createFragmentFromMarkup): Removed static cast to HTMLElement. * html/HTMLElement.cpp: (WebCore::HTMLElement::createContextualFragment): Modified to perform only checks that are specific for an HTMLElement object. The rest of the logic has been moved to the corresponding method in the Element class. LayoutTests: Crash in createContextualFragment when inserting a list in a non HTML document. <rdar://problem/7666670> https://bugs.webkit.org/show_bug.cgi?id=35305 Reviewed by Darin Adler. * editing/execCommand/insert-list-xml-expected.txt: Added. * editing/execCommand/insert-list-xml.xhtml: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55167 268f45cc-cd09-0410-ab3c-d52691b4dbfc
46e6d6a8