提交 dea3b116 编写于 作者: E Elliott Sprehn

Remove dead markup serialization code.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/771933002
上级 f1a6cd97
......@@ -624,10 +624,6 @@ sky_core_files = [
"editing/InsertParagraphSeparatorCommand.h",
"editing/InsertTextCommand.cpp",
"editing/InsertTextCommand.h",
"editing/markup.cpp",
"editing/markup.h",
"editing/MarkupAccumulator.cpp",
"editing/MarkupAccumulator.h",
"editing/MoveSelectionCommand.cpp",
"editing/MoveSelectionCommand.h",
"editing/PlainTextRange.cpp",
......
......@@ -80,7 +80,6 @@
#include "sky/engine/core/dom/shadow/ShadowRoot.h"
#include "sky/engine/core/editing/FrameSelection.h"
#include "sky/engine/core/editing/SpellChecker.h"
#include "sky/engine/core/editing/markup.h"
#include "sky/engine/core/events/Event.h"
#include "sky/engine/core/events/EventFactory.h"
#include "sky/engine/core/events/EventListener.h"
......
......@@ -62,7 +62,6 @@
#include "sky/engine/core/editing/FrameSelection.h"
#include "sky/engine/core/editing/TextIterator.h"
#include "sky/engine/core/editing/htmlediting.h"
#include "sky/engine/core/editing/markup.h"
#include "sky/engine/core/events/EventDispatcher.h"
#include "sky/engine/core/events/FocusEvent.h"
#include "sky/engine/core/frame/FrameView.h"
......
......@@ -55,7 +55,6 @@
#include "sky/engine/core/dom/shadow/InsertionPoint.h"
#include "sky/engine/core/dom/shadow/ShadowRoot.h"
#include "sky/engine/core/editing/htmlediting.h"
#include "sky/engine/core/editing/markup.h"
#include "sky/engine/core/events/Event.h"
#include "sky/engine/core/events/EventDispatchMediator.h"
#include "sky/engine/core/events/EventDispatcher.h"
......
......@@ -34,7 +34,6 @@
#include "sky/engine/core/dom/NodeTraversal.h"
#include "sky/engine/core/dom/NodeWithIndex.h"
#include "sky/engine/core/dom/Text.h"
#include "sky/engine/core/editing/markup.h"
#include "sky/engine/core/editing/TextIterator.h"
#include "sky/engine/core/editing/VisiblePosition.h"
#include "sky/engine/core/editing/VisibleUnits.h"
......@@ -908,11 +907,6 @@ String Range::toString() const
return builder.toString();
}
String Range::toHTML() const
{
return createMarkup(this);
}
String Range::text() const
{
return plainText(this, TextIteratorEmitsObjectReplacementCharacter);
......
......@@ -84,7 +84,6 @@ public:
void insertNode(PassRefPtr<Node>, ExceptionState&);
String toString() const;
String toHTML() const;
String text() const;
void detach();
......
......@@ -36,7 +36,6 @@
#include "sky/engine/core/dom/shadow/ElementShadow.h"
#include "sky/engine/core/dom/shadow/InsertionPoint.h"
#include "sky/engine/core/dom/shadow/ShadowRootRareData.h"
#include "sky/engine/core/editing/markup.h"
#include "sky/engine/public/platform/Platform.h"
namespace blink {
......
......@@ -53,7 +53,6 @@
#include "sky/engine/core/editing/TextIterator.h"
#include "sky/engine/core/editing/VisibleUnits.h"
#include "sky/engine/core/editing/htmlediting.h"
#include "sky/engine/core/editing/markup.h"
#include "sky/engine/core/events/ScopedEventQueue.h"
#include "sky/engine/core/frame/LocalFrame.h"
#include "sky/engine/core/html/HTMLElement.h"
......
......@@ -45,7 +45,6 @@
#include "sky/engine/core/editing/UndoStack.h"
#include "sky/engine/core/editing/VisibleUnits.h"
#include "sky/engine/core/editing/htmlediting.h"
#include "sky/engine/core/editing/markup.h"
#include "sky/engine/core/events/KeyboardEvent.h"
#include "sky/engine/core/events/ScopedEventQueue.h"
#include "sky/engine/core/events/TextEvent.h"
......
......@@ -40,7 +40,6 @@
#include "sky/engine/core/editing/SpellChecker.h"
#include "sky/engine/core/editing/TypingCommand.h"
#include "sky/engine/core/editing/htmlediting.h"
#include "sky/engine/core/editing/markup.h"
#include "sky/engine/core/events/Event.h"
#include "sky/engine/core/frame/FrameHost.h"
#include "sky/engine/core/frame/FrameView.h"
......
/*
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserved.
* Copyright (C) 2009, 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "sky/engine/config.h"
#include "sky/engine/core/editing/MarkupAccumulator.h"
#include "gen/sky/core/HTMLNames.h"
#include "sky/engine/core/dom/Document.h"
#include "sky/engine/core/dom/DocumentFragment.h"
#include "sky/engine/core/dom/Text.h"
#include "sky/engine/core/editing/Editor.h"
#include "sky/engine/core/html/HTMLElement.h"
#include "sky/engine/core/html/HTMLTemplateElement.h"
#include "sky/engine/platform/weborigin/KURL.h"
#include "sky/engine/wtf/unicode/CharacterNames.h"
namespace blink {
struct EntityDescription {
UChar entity;
const CString& reference;
EntityMask mask;
};
template <typename CharType>
static inline void appendCharactersReplacingEntitiesInternal(StringBuilder& result, CharType* text, unsigned length, const EntityDescription entityMaps[], unsigned entityMapsCount, EntityMask entityMask)
{
unsigned positionAfterLastEntity = 0;
for (unsigned i = 0; i < length; ++i) {
for (unsigned entityIndex = 0; entityIndex < entityMapsCount; ++entityIndex) {
if (text[i] == entityMaps[entityIndex].entity && entityMaps[entityIndex].mask & entityMask) {
result.append(text + positionAfterLastEntity, i - positionAfterLastEntity);
const CString& replacement = entityMaps[entityIndex].reference;
result.append(replacement.data(), replacement.length());
positionAfterLastEntity = i + 1;
break;
}
}
}
result.append(text + positionAfterLastEntity, length - positionAfterLastEntity);
}
void MarkupAccumulator::appendCharactersReplacingEntities(StringBuilder& result, const String& source, unsigned offset, unsigned length, EntityMask entityMask)
{
DEFINE_STATIC_LOCAL(const CString, ampReference, ("&amp;"));
DEFINE_STATIC_LOCAL(const CString, ltReference, ("&lt;"));
DEFINE_STATIC_LOCAL(const CString, gtReference, ("&gt;"));
DEFINE_STATIC_LOCAL(const CString, quotReference, ("&quot;"));
DEFINE_STATIC_LOCAL(const CString, nbspReference, ("&nbsp;"));
static const EntityDescription entityMaps[] = {
{ '&', ampReference, EntityAmp },
{ '<', ltReference, EntityLt },
{ '>', gtReference, EntityGt },
{ '"', quotReference, EntityQuot },
{ noBreakSpace, nbspReference, EntityNbsp },
};
if (!(offset + length))
return;
ASSERT(offset + length <= source.length());
if (source.is8Bit())
appendCharactersReplacingEntitiesInternal(result, source.characters8() + offset, length, entityMaps, WTF_ARRAY_LENGTH(entityMaps), entityMask);
else
appendCharactersReplacingEntitiesInternal(result, source.characters16() + offset, length, entityMaps, WTF_ARRAY_LENGTH(entityMaps), entityMask);
}
MarkupAccumulator::MarkupAccumulator(Vector<RawPtr<Node> >* nodes, EAbsoluteURLs resolveUrlsMethod, const Range* range)
: m_nodes(nodes)
, m_range(range)
, m_resolveURLsMethod(resolveUrlsMethod)
{
}
MarkupAccumulator::~MarkupAccumulator()
{
}
String MarkupAccumulator::serializeNodes(Node& targetNode, EChildrenOnly childrenOnly, Vector<QualifiedName>* tagNamesToSkip)
{
Namespaces* namespaces = 0;
Namespaces namespaceHash;
serializeNodesWithNamespaces(targetNode, childrenOnly, namespaces, tagNamesToSkip);
return m_markup.toString();
}
void MarkupAccumulator::serializeNodesWithNamespaces(Node& targetNode, EChildrenOnly childrenOnly, const Namespaces* namespaces, Vector<QualifiedName>* tagNamesToSkip)
{
if (tagNamesToSkip && targetNode.isElementNode()) {
for (size_t i = 0; i < tagNamesToSkip->size(); ++i) {
if (toElement(targetNode).hasTagName(tagNamesToSkip->at(i)))
return;
}
}
Namespaces namespaceHash;
if (namespaces)
namespaceHash = *namespaces;
if (!childrenOnly)
appendStartTag(targetNode, &namespaceHash);
Node* current = isHTMLTemplateElement(targetNode) ? toHTMLTemplateElement(targetNode).content()->firstChild() : targetNode.firstChild();
for ( ; current; current = current->nextSibling())
serializeNodesWithNamespaces(*current, IncludeNode, &namespaceHash, tagNamesToSkip);
if (!childrenOnly && targetNode.isElementNode())
appendEndTag(toElement(targetNode));
}
String MarkupAccumulator::resolveURLIfNeeded(const Element& element, const String& urlString) const
{
switch (m_resolveURLsMethod) {
case ResolveAllURLs:
return element.document().completeURL(urlString).string();
case ResolveNonLocalURLs:
if (!element.document().url().isLocalFile())
return element.document().completeURL(urlString).string();
break;
case DoNotResolveURLs:
break;
}
return urlString;
}
void MarkupAccumulator::appendString(const String& string)
{
m_markup.append(string);
}
void MarkupAccumulator::appendStartTag(Node& node, Namespaces* namespaces)
{
appendStartMarkup(m_markup, node, namespaces);
if (m_nodes)
m_nodes->append(&node);
}
void MarkupAccumulator::appendEndTag(const Element& element)
{
appendEndMarkup(m_markup, element);
}
size_t MarkupAccumulator::totalLength(const Vector<String>& strings)
{
size_t length = 0;
for (size_t i = 0; i < strings.size(); ++i)
length += strings[i].length();
return length;
}
void MarkupAccumulator::concatenateMarkup(StringBuilder& result)
{
result.append(m_markup);
}
void MarkupAccumulator::appendAttributeValue(StringBuilder& result, const String& attribute, bool documentIsHTML)
{
appendCharactersReplacingEntities(result, attribute, 0, attribute.length(),
documentIsHTML ? EntityMaskInHTMLAttributeValue : EntityMaskInAttributeValue);
}
void MarkupAccumulator::appendCustomAttributes(StringBuilder&, const Element&, Namespaces*)
{
}
void MarkupAccumulator::appendQuotedURLAttributeValue(StringBuilder& result, const Element& element, const Attribute& attribute)
{
ASSERT(element.isURLAttribute(attribute));
const String resolvedURLString = resolveURLIfNeeded(element, attribute.value());
UChar quoteChar = '"';
String strippedURLString = resolvedURLString.stripWhiteSpace();
if (protocolIsJavaScript(strippedURLString)) {
// minimal escaping for javascript urls
if (strippedURLString.contains('"')) {
if (strippedURLString.contains('\''))
strippedURLString.replaceWithLiteral('"', "&quot;");
else
quoteChar = '\'';
}
result.append(quoteChar);
result.append(strippedURLString);
result.append(quoteChar);
return;
}
// FIXME: This does not fully match other browsers. Firefox percent-escapes non-ASCII characters for innerHTML.
result.append(quoteChar);
appendAttributeValue(result, resolvedURLString, false);
result.append(quoteChar);
}
EntityMask MarkupAccumulator::entityMaskForText(const Text& text) const
{
const QualifiedName* parentName = 0;
if (text.parentElement())
parentName = &(text.parentElement())->tagQName();
if (parentName && (*parentName == HTMLNames::scriptTag || *parentName == HTMLNames::styleTag))
return EntityMaskInCDATA;
return EntityMaskInHTMLPCDATA;
}
void MarkupAccumulator::appendText(StringBuilder& result, Text& text)
{
const String& str = text.data();
unsigned length = str.length();
unsigned start = 0;
if (m_range) {
if (text == m_range->endContainer())
length = m_range->endOffset();
if (text == m_range->startContainer()) {
start = m_range->startOffset();
length -= start;
}
}
appendCharactersReplacingEntities(result, str, start, length, entityMaskForText(text));
}
void MarkupAccumulator::appendElement(StringBuilder& result, Element& element, Namespaces* namespaces)
{
appendOpenTag(result, element, namespaces);
AttributeCollection attributes = element.attributes();
AttributeCollection::iterator end = attributes.end();
for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it)
appendAttribute(result, element, *it, namespaces);
// Give an opportunity to subclasses to add their own attributes.
appendCustomAttributes(result, element, namespaces);
appendCloseTag(result, element);
}
void MarkupAccumulator::appendOpenTag(StringBuilder& result, const Element& element, Namespaces* namespaces)
{
result.append('<');
result.append(element.tagQName().localName());
}
void MarkupAccumulator::appendCloseTag(StringBuilder& result, const Element& element)
{
result.append('>');
}
void MarkupAccumulator::appendAttribute(StringBuilder& result, const Element& element, const Attribute& attribute, Namespaces* namespaces)
{
QualifiedName prefixedName = attribute.name();
result.append(' ');
result.append(attribute.name().localName());
result.append('=');
if (element.isURLAttribute(attribute)) {
appendQuotedURLAttributeValue(result, element, attribute);
} else {
result.append('"');
bool documentIsHTML = true;
appendAttributeValue(result, attribute.value(), documentIsHTML);
result.append('"');
}
}
void MarkupAccumulator::appendStartMarkup(StringBuilder& result, Node& node, Namespaces* namespaces)
{
switch (node.nodeType()) {
case Node::TEXT_NODE:
appendText(result, toText(node));
break;
case Node::DOCUMENT_NODE:
break;
case Node::DOCUMENT_FRAGMENT_NODE:
// Not implemented.
break;
case Node::ELEMENT_NODE:
appendElement(result, toElement(node), namespaces);
break;
}
}
void MarkupAccumulator::appendEndMarkup(StringBuilder& result, const Element& element)
{
result.appendLiteral("</");
result.append(element.tagQName().localName());
result.append('>');
}
}
/*
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SKY_ENGINE_CORE_EDITING_MARKUPACCUMULATOR_H_
#define SKY_ENGINE_CORE_EDITING_MARKUPACCUMULATOR_H_
#include "sky/engine/core/editing/markup.h"
#include "sky/engine/wtf/HashMap.h"
#include "sky/engine/wtf/Vector.h"
#include "sky/engine/wtf/text/StringBuilder.h"
namespace blink {
class Attribute;
class DocumentType;
class Element;
class Node;
class Range;
typedef HashMap<AtomicString, AtomicString> Namespaces;
enum EntityMask {
EntityAmp = 0x0001,
EntityLt = 0x0002,
EntityGt = 0x0004,
EntityQuot = 0x0008,
EntityNbsp = 0x0010,
// Non-breaking space needs to be escaped in innerHTML for compatibility reason. See http://trac.webkit.org/changeset/32879
// However, we cannot do this in a XML document because it does not have the entity reference defined (See the bug 19215).
EntityMaskInCDATA = 0,
EntityMaskInPCDATA = EntityAmp | EntityLt | EntityGt,
EntityMaskInHTMLPCDATA = EntityMaskInPCDATA | EntityNbsp,
EntityMaskInAttributeValue = EntityAmp | EntityQuot | EntityLt | EntityGt,
EntityMaskInHTMLAttributeValue = EntityAmp | EntityQuot | EntityNbsp,
};
class MarkupAccumulator {
WTF_MAKE_NONCOPYABLE(MarkupAccumulator);
STACK_ALLOCATED();
public:
MarkupAccumulator(Vector<RawPtr<Node> >*, EAbsoluteURLs, const Range* = 0);
virtual ~MarkupAccumulator();
String serializeNodes(Node& targetNode, EChildrenOnly, Vector<QualifiedName>* tagNamesToSkip = 0);
static void appendComment(StringBuilder&, const String&);
static void appendCharactersReplacingEntities(StringBuilder&, const String&, unsigned, unsigned, EntityMask);
protected:
void appendString(const String&);
void appendStartTag(Node&, Namespaces* = 0);
virtual void appendEndTag(const Element&);
static size_t totalLength(const Vector<String>&);
size_t length() const { return m_markup.length(); }
void concatenateMarkup(StringBuilder&);
void appendAttributeValue(StringBuilder&, const String&, bool);
virtual void appendCustomAttributes(StringBuilder&, const Element&, Namespaces*);
EntityMask entityMaskForText(const Text&) const;
virtual void appendText(StringBuilder&, Text&);
virtual void appendElement(StringBuilder&, Element&, Namespaces*);
void appendOpenTag(StringBuilder&, const Element&, Namespaces*);
void appendCloseTag(StringBuilder&, const Element&);
void appendAttribute(StringBuilder&, const Element&, const Attribute&, Namespaces*);
void appendStartMarkup(StringBuilder&, Node&, Namespaces*);
void appendEndMarkup(StringBuilder&, const Element&);
RawPtr<Vector<RawPtr<Node> > > const m_nodes;
RawPtr<const Range> const m_range;
private:
String resolveURLIfNeeded(const Element&, const String&) const;
void appendQuotedURLAttributeValue(StringBuilder&, const Element&, const Attribute&);
void serializeNodesWithNamespaces(Node& targetNode, EChildrenOnly, const Namespaces*, Vector<QualifiedName>* tagNamesToSkip);
StringBuilder m_markup;
const EAbsoluteURLs m_resolveURLsMethod;
};
}
#endif // SKY_ENGINE_CORE_EDITING_MARKUPACCUMULATOR_H_
......@@ -42,7 +42,6 @@
#include "sky/engine/core/editing/TextIterator.h"
#include "sky/engine/core/editing/VisibleUnits.h"
#include "sky/engine/core/editing/htmlediting.h"
#include "sky/engine/core/editing/markup.h"
#include "sky/engine/core/events/BeforeTextInsertedEvent.h"
#include "sky/engine/core/frame/LocalFrame.h"
#include "sky/engine/core/frame/UseCounter.h"
......
此差异已折叠。
/*
* Copyright (C) 2004 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SKY_ENGINE_CORE_EDITING_MARKUP_H_
#define SKY_ENGINE_CORE_EDITING_MARKUP_H_
#include "sky/engine/core/editing/HTMLInterchange.h"
#include "sky/engine/platform/heap/Handle.h"
#include "sky/engine/wtf/Forward.h"
#include "sky/engine/wtf/Vector.h"
namespace blink {
class ContainerNode;
class Document;
class DocumentFragment;
class Element;
class ExceptionState;
class KURL;
class Node;
class QualifiedName;
class Range;
enum EChildrenOnly { IncludeNode, ChildrenOnly };
enum EAbsoluteURLs { DoNotResolveURLs, ResolveAllURLs, ResolveNonLocalURLs };
// These methods are used by HTMLElement & ShadowRoot to replace the
// children with respected fragment/text.
void replaceChildrenWithFragment(ContainerNode*, PassRefPtr<DocumentFragment>, ExceptionState&);
String createMarkup(const Range*, Vector<RawPtr<Node> >* = 0, EAnnotateForInterchange = DoNotAnnotateForInterchange, bool convertBlocksToInlines = false, EAbsoluteURLs = DoNotResolveURLs, Node* constrainingAncestor = 0);
String createMarkup(const Node*, EChildrenOnly = IncludeNode, Vector<RawPtr<Node> >* = 0, EAbsoluteURLs = DoNotResolveURLs, Vector<QualifiedName>* tagNamesToSkip = 0);
void mergeWithNextTextNode(Text*, ExceptionState&);
}
#endif // SKY_ENGINE_CORE_EDITING_MARKUP_H_
......@@ -37,7 +37,6 @@
#include "sky/engine/core/editing/InputMethodController.h"
#include "sky/engine/core/editing/SpellChecker.h"
#include "sky/engine/core/editing/htmlediting.h"
#include "sky/engine/core/editing/markup.h"
#include "sky/engine/core/events/Event.h"
#include "sky/engine/core/fetch/ResourceFetcher.h"
#include "sky/engine/core/frame/FrameConsole.h"
......
......@@ -242,7 +242,6 @@ public:
virtual WebRange selectionRange() const = 0;
virtual WebString selectionAsText() const = 0;
virtual WebString selectionAsMarkup() const = 0;
// Expands the selection to a word around the caret and returns
// true. Does nothing and returns false if there is no caret or
......
......@@ -94,7 +94,6 @@ public:
BLINK_EXPORT WebNode previousSibling() const;
BLINK_EXPORT WebNode nextSibling() const;
BLINK_EXPORT bool hasChildNodes() const;
BLINK_EXPORT WebString createMarkup() const;
BLINK_EXPORT bool isLink() const;
BLINK_EXPORT bool isTextNode() const;
BLINK_EXPORT bool isFocusable() const;
......
......@@ -65,7 +65,6 @@ public:
BLINK_EXPORT WebNode startContainer(int& exceptionCode) const;
BLINK_EXPORT WebNode endContainer(int& exceptionCode) const;
BLINK_EXPORT WebString toHTMLText() const;
BLINK_EXPORT WebString toPlainText() const;
BLINK_EXPORT WebRange expandedToParagraph() const;
......
......@@ -94,7 +94,6 @@
#include "sky/engine/core/editing/TextAffinity.h"
#include "sky/engine/core/editing/TextIterator.h"
#include "sky/engine/core/editing/htmlediting.h"
#include "sky/engine/core/editing/markup.h"
#include "sky/engine/core/frame/Console.h"
#include "sky/engine/core/frame/FrameHost.h"
#include "sky/engine/core/frame/FrameView.h"
......@@ -541,15 +540,6 @@ WebString WebLocalFrameImpl::selectionAsText() const
return text;
}
WebString WebLocalFrameImpl::selectionAsMarkup() const
{
RefPtr<Range> range = frame()->selection().toNormalizedRange();
if (!range)
return WebString();
return createMarkup(range.get(), 0, AnnotateForInterchange, false, ResolveNonLocalURLs);
}
void WebLocalFrameImpl::selectWordAroundPosition(LocalFrame* frame, VisiblePosition position)
{
VisibleSelection selection(position);
......
......@@ -109,7 +109,6 @@ public:
virtual bool hasSelection() const override;
virtual WebRange selectionRange() const override;
virtual WebString selectionAsText() const override;
virtual WebString selectionAsMarkup() const override;
virtual bool selectWordAroundCaret() override;
virtual void selectRange(const WebPoint& base, const WebPoint& extent) override;
virtual void selectRange(const WebRange&) override;
......
......@@ -36,7 +36,6 @@
#include "sky/engine/core/dom/Element.h"
#include "sky/engine/core/dom/Node.h"
#include "sky/engine/core/dom/NodeList.h"
#include "sky/engine/core/editing/markup.h"
#include "sky/engine/core/events/Event.h"
#include "sky/engine/core/html/HTMLElement.h"
#include "sky/engine/core/rendering/RenderObject.h"
......@@ -115,11 +114,6 @@ bool WebNode::hasChildNodes() const
return m_private->hasChildren();
}
WebString WebNode::createMarkup() const
{
return blink::createMarkup(m_private.get());
}
bool WebNode::isLink() const
{
return m_private->isLink();
......
......@@ -85,11 +85,6 @@ WebNode WebRange::endContainer(WebExceptionCode& exceptionCode) const
return node.release();
}
WebString WebRange::toHTMLText() const
{
return m_private->toHTML();
}
WebString WebRange::toPlainText() const
{
return m_private->text();
......
......@@ -43,7 +43,6 @@
#include "sky/engine/core/editing/HTMLInterchange.h"
#include "sky/engine/core/editing/InputMethodController.h"
#include "sky/engine/core/editing/TextIterator.h"
#include "sky/engine/core/editing/markup.h"
#include "sky/engine/core/events/KeyboardEvent.h"
#include "sky/engine/core/events/WheelEvent.h"
#include "sky/engine/core/frame/FrameHost.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册