Changeset 146897 in webkit
- Timestamp:
- Mar 26, 2013 9:45:15 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r146896 r146897 1 2013-03-26 Alexander Pavlov <apavlov@chromium.org> 2 3 Web Inspector: [Elements] Unable to "Edit as HTML" XHTML/SVG documents. 4 https://bugs.webkit.org/show_bug.cgi?id=113290 5 6 Reviewed by Pavel Feldman. 7 8 * inspector/elements/set-outer-html-for-xhtml-expected.txt: Added. 9 * inspector/elements/set-outer-html-for-xhtml.xhtml: Added. 10 1 11 2013-03-26 Hajime Morrita <morrita@google.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r146896 r146897 1 2013-03-26 Alexander Pavlov <apavlov@chromium.org> 2 3 Web Inspector: [Elements] Unable to "Edit as HTML" XHTML/SVG documents. 4 https://bugs.webkit.org/show_bug.cgi?id=113290 5 6 Reviewed by Pavel Feldman. 7 8 DOMPatchSupport has been slightly augmented to handle XML (XHTML and SVG) documents. 9 10 Test: inspector/elements/set-outer-html-for-xhtml.xhtml 11 12 * inspector/DOMPatchSupport.cpp: 13 (WebCore::DOMPatchSupport::patchDocument): 14 (WebCore::DOMPatchSupport::patchNode): 15 * inspector/InspectorDOMAgent.cpp: 16 (WebCore::InspectorDOMAgent::setOuterHTML): Let HTML, XHTML, and SVG documents through. 17 1 18 2013-03-26 Hajime Morrita <morrita@google.com> 2 19 -
trunk/Source/WebCore/inspector/DOMPatchSupport.cpp
r145818 r146897 47 47 #include "InspectorHistory.h" 48 48 #include "Node.h" 49 #include "XMLDocumentParser.h" 49 50 50 51 #include <wtf/Deque.h> … … 90 91 void DOMPatchSupport::patchDocument(const String& markup) 91 92 { 92 RefPtr<HTMLDocument> newDocument = HTMLDocument::create(0, KURL()); 93 RefPtr<Document> newDocument; 94 if (m_document->isHTMLDocument()) 95 newDocument = HTMLDocument::create(0, KURL()); 96 else if (m_document->isXHTMLDocument()) 97 newDocument = HTMLDocument::createXHTML(0, KURL()); 98 #if ENABLE(SVG) 99 else if (m_document->isSVGDocument()) 100 newDocument = Document::create(0, KURL()); 101 #endif 102 103 ASSERT(newDocument); 93 104 newDocument->setContextFeatures(m_document->contextFeatures()); 94 RefPtr<DocumentParser> parser = HTMLDocumentParser::create(newDocument.get(), false); 105 RefPtr<DocumentParser> parser; 106 if (m_document->isHTMLDocument()) 107 parser = HTMLDocumentParser::create(static_cast<HTMLDocument*>(newDocument.get()), false); 108 else 109 parser = XMLDocumentParser::create(newDocument.get(), 0); 95 110 parser->insert(markup); // Use insert() so that the parser will not yield. 96 111 parser->finish(); … … 118 133 // FIXME: This code should use one of createFragment* in markup.h 119 134 RefPtr<DocumentFragment> fragment = DocumentFragment::create(m_document); 120 fragment->parseHTML(markup, node->parentElement() ? node->parentElement() : m_document->documentElement()); 135 if (m_document->isHTMLDocument()) 136 fragment->parseHTML(markup, node->parentElement() ? node->parentElement() : m_document->documentElement()); 137 else 138 fragment->parseXML(markup, node->parentElement() ? node->parentElement() : m_document->documentElement()); 121 139 122 140 // Compose the old list. -
trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp
r145818 r146897 735 735 736 736 Document* document = node->isDocumentNode() ? toDocument(node) : node->ownerDocument(); 737 if (!document || !document->isHTMLDocument()) { 738 *errorString = "Not an HTML document"; 737 if (!document || (!document->isHTMLDocument() && !document->isXHTMLDocument() 738 #if ENABLE(SVG) 739 && !document->isSVGDocument() 740 #endif 741 )) { 742 *errorString = "Not an HTML/XML document"; 739 743 return; 740 744 }
Note: See TracChangeset
for help on using the changeset viewer.