diff options
| author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-25 15:09:11 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-25 15:09:11 +0200 |
| commit | a89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd (patch) | |
| tree | b7abd9f49ae1d4d2e426a5883bfccd42b8e2ee12 /Source/WebCore/html/HTMLElement.cpp | |
| parent | 8d473cf9743f1d30a16a27114e93bd5af5648d23 (diff) | |
| download | qtwebkit-a89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd.tar.gz | |
Imported WebKit commit eb5c1b8fe4d4b1b90b5137433fc58a91da0e6878 (http://svn.webkit.org/repository/webkit/trunk@118516)
Diffstat (limited to 'Source/WebCore/html/HTMLElement.cpp')
| -rw-r--r-- | Source/WebCore/html/HTMLElement.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/Source/WebCore/html/HTMLElement.cpp b/Source/WebCore/html/HTMLElement.cpp index 1fa249601..b420c342b 100644 --- a/Source/WebCore/html/HTMLElement.cpp +++ b/Source/WebCore/html/HTMLElement.cpp @@ -342,8 +342,7 @@ String HTMLElement::outerHTML() const void HTMLElement::setInnerHTML(const String& html, ExceptionCode& ec) { - RefPtr<DocumentFragment> fragment = createFragmentFromSource(html, this, ec); - if (fragment) + if (RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(html, this, ec)) replaceChildrenWithFragment(this, fragment.release(), ec); } @@ -374,7 +373,7 @@ void HTMLElement::setOuterHTML(const String& html, ExceptionCode& ec) RefPtr<Node> prev = previousSibling(); RefPtr<Node> next = nextSibling(); - RefPtr<DocumentFragment> fragment = createFragmentFromSource(html, parent.get(), ec); + RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(html, parent.get(), ec); if (ec) return; @@ -576,19 +575,13 @@ static Element* contextElementForInsertion(const String& where, Element* element void HTMLElement::insertAdjacentHTML(const String& where, const String& markup, ExceptionCode& ec) { - RefPtr<DocumentFragment> fragment = document()->createDocumentFragment(); Element* contextElement = contextElementForInsertion(where, this, ec); if (!contextElement) return; - - if (document()->isHTMLDocument()) - fragment->parseHTML(markup, contextElement); - else { - if (!fragment->parseXML(markup, contextElement)) - // FIXME: We should propagate a syntax error exception out here. - return; - } - + ExceptionCode ignoredEc = 0; // FIXME: We should propagate a syntax error exception out here. + RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(markup, this, ignoredEc); + if (ignoredEc) + return; insertAdjacent(where, fragment.get(), ec); } |
