| Index: third_party/WebKit/Source/core/editing/serializers/MarkupAccumulator.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/serializers/MarkupAccumulator.cpp b/third_party/WebKit/Source/core/editing/serializers/MarkupAccumulator.cpp
|
| index 1ea9422463f41e1809ef593f360467c697c67f07..bb9b4a5b791d1ac82a53363ce9d1ac4d5b3e6e7e 100644
|
| --- a/third_party/WebKit/Source/core/editing/serializers/MarkupAccumulator.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/serializers/MarkupAccumulator.cpp
|
| @@ -27,7 +27,6 @@
|
|
|
| #include "core/editing/serializers/MarkupAccumulator.h"
|
|
|
| -#include "core/HTMLNames.h"
|
| #include "core/XLinkNames.h"
|
| #include "core/XMLNSNames.h"
|
| #include "core/XMLNames.h"
|
| @@ -46,8 +45,6 @@
|
|
|
| namespace blink {
|
|
|
| -using namespace HTMLNames;
|
| -
|
| MarkupAccumulator::MarkupAccumulator(EAbsoluteURLs resolveUrlsMethod,
|
| SerializationType serializationType)
|
| : m_formatter(resolveUrlsMethod, serializationType) {}
|
| @@ -91,11 +88,7 @@ static bool elementCannotHaveEndTag(const Node& node) {
|
| if (!node.isHTMLElement())
|
| return false;
|
|
|
| - // FIXME: ieForbidsInsertHTML may not be the right function to call here
|
| - // ieForbidsInsertHTML is used to disallow setting innerHTML/outerHTML
|
| - // or createContextualFragment. It does not necessarily align with
|
| - // which elements should be serialized w/o end tags.
|
| - return toHTMLElement(node).ieForbidsInsertHTML();
|
| + return !toHTMLElement(node).shouldSerializeEndTag();
|
| }
|
|
|
| void MarkupAccumulator::appendEndMarkup(StringBuilder& result,
|
| @@ -192,7 +185,9 @@ static void serializeNodesWithNamespaces(MarkupAccumulator& accumulator,
|
| &namespaceHash);
|
| }
|
|
|
| - if (!childrenOnly && targetNode.isElementNode())
|
| + if ((!childrenOnly && targetNode.isElementNode()) &&
|
| + !(accumulator.serializeAsHTMLDocument(targetNode) &&
|
| + elementCannotHaveEndTag(targetNode)))
|
| accumulator.appendEndTag(toElement(targetNode));
|
| }
|
|
|
|
|