Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1198)

Unified Diff: sky/engine/core/dom/Element.cpp

Issue 665613003: Remove the ability to parse HTML fragments (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sky/engine/core/dom/Element.cpp
diff --git a/sky/engine/core/dom/Element.cpp b/sky/engine/core/dom/Element.cpp
index 1123628b223ae793d5e33a59ea2c13a86f24a09e..e2b45d437138f616b91e361fff749a9b4cbb5aaf 100644
--- a/sky/engine/core/dom/Element.cpp
+++ b/sky/engine/core/dom/Element.cpp
@@ -1541,55 +1541,6 @@ void Element::dispatchFocusOutEvent(const AtomicString& eventType, Element* newF
dispatchScopedEventDispatchMediator(FocusOutEventDispatchMediator::create(FocusEvent::create(eventType, true, false, document().domWindow(), 0, newFocusedElement)));
}
-String Element::innerHTML() const
-{
- return createMarkup(this, ChildrenOnly);
-}
-
-String Element::outerHTML() const
-{
- return createMarkup(this);
-}
-
-void Element::setInnerHTML(const String& html, ExceptionState& exceptionState)
-{
- if (RefPtrWillBeRawPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(html, this, "innerHTML", exceptionState)) {
- ContainerNode* container = this;
- if (isHTMLTemplateElement(*this))
- container = toHTMLTemplateElement(this)->content();
- replaceChildrenWithFragment(container, fragment.release(), exceptionState);
- }
-}
-
-void Element::setOuterHTML(const String& html, ExceptionState& exceptionState)
-{
- Node* p = parentNode();
- if (!p) {
- exceptionState.throwDOMException(NoModificationAllowedError, "This element has no parent node.");
- return;
- }
- if (!p->isElementNode()) {
- exceptionState.throwDOMException(NoModificationAllowedError, "This element's parent is of type '" + p->nodeName() + "', which is not an element node.");
- return;
- }
-
- RefPtrWillBeRawPtr<Element> parent = toElement(p);
- RefPtrWillBeRawPtr<Node> prev = previousSibling();
- RefPtrWillBeRawPtr<Node> next = nextSibling();
-
- RefPtrWillBeRawPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(html, parent.get(), "outerHTML", exceptionState);
- if (exceptionState.hadException())
- return;
-
- parent->replaceChild(fragment.release(), this, exceptionState);
- RefPtrWillBeRawPtr<Node> node = next ? next->previousSibling() : 0;
- if (!exceptionState.hadException() && node && node->isTextNode())
- mergeWithNextTextNode(toText(node.get()), exceptionState);
-
- if (!exceptionState.hadException() && prev && prev->isTextNode())
- mergeWithNextTextNode(toText(prev.get()), exceptionState);
-}
-
String Element::innerText()
{
// We need to update layout, since plainText uses line boxes in the render tree.

Powered by Google App Engine
This is Rietveld 408576698