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

Unified Diff: Source/core/dom/Element.cpp

Issue 67773002: Revert "Move innerHTML and outerHTML to Element" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/Element.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index fada22350b82d124f5457664c7f10fb4f8c0dca5..263424227455f4e0779f5849a154518120fd99e7 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -71,7 +71,6 @@
#include "core/editing/FrameSelection.h"
#include "core/editing/TextIterator.h"
#include "core/editing/htmlediting.h"
-#include "core/editing/markup.h"
#include "core/events/EventDispatcher.h"
#include "core/events/FocusEvent.h"
#include "core/frame/ContentSecurityPolicy.h"
@@ -86,7 +85,6 @@
#include "core/html/HTMLLabelElement.h"
#include "core/html/HTMLOptionsCollection.h"
#include "core/html/HTMLTableRowsCollection.h"
-#include "core/html/HTMLTemplateElement.h"
#include "core/html/parser/HTMLParserIdioms.h"
#include "core/page/FocusController.h"
#include "core/page/Page.h"
@@ -2212,50 +2210,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& es)
-{
- if (RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(html, this, AllowScriptingContent, "innerHTML", es)) {
- ContainerNode* container = this;
- if (hasTagName(templateTag))
- container = toHTMLTemplateElement(this)->content();
- replaceChildrenWithFragment(container, fragment.release(), es);
- }
-}
-
-void Element::setOuterHTML(const String& html, ExceptionState& es)
-{
- Node* p = parentNode();
- if (!p || !p->isElementNode()) {
- es.throwUninformativeAndGenericDOMException(NoModificationAllowedError);
- return;
- }
- RefPtr<Element> parent = toElement(p);
- RefPtr<Node> prev = previousSibling();
- RefPtr<Node> next = nextSibling();
-
- RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(html, parent.get(), AllowScriptingContent, "outerHTML", es);
- if (es.hadException())
- return;
-
- parent->replaceChild(fragment.release(), this, es);
- RefPtr<Node> node = next ? next->previousSibling() : 0;
- if (!es.hadException() && node && node->isTextNode())
- mergeWithNextTextNode(node.release(), es);
-
- if (!es.hadException() && prev && prev->isTextNode())
- mergeWithNextTextNode(prev.release(), es);
-}
-
String Element::innerText()
{
// We need to update layout, since plainText uses line boxes in the render tree.
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/Element.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698