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

Unified Diff: Source/core/editing/StyledMarkupAccumulator.cpp

Issue 1181703003: Refactoring: Move StyledMarkupAccumulator::createInlineStyle to the serializer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: bug fix: rebasing failed Created 5 years, 6 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
« no previous file with comments | « Source/core/editing/StyledMarkupAccumulator.h ('k') | Source/core/editing/StyledMarkupSerializer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/StyledMarkupAccumulator.cpp
diff --git a/Source/core/editing/StyledMarkupAccumulator.cpp b/Source/core/editing/StyledMarkupAccumulator.cpp
index 4bfd3d3df37a3dd4c3875091925d9de861ae01a8..46a6ba8538d1e691ea89eb9f0c6b5a9a809674d7 100644
--- a/Source/core/editing/StyledMarkupAccumulator.cpp
+++ b/Source/core/editing/StyledMarkupAccumulator.cpp
@@ -61,11 +61,6 @@ StyledMarkupAccumulator::StyledMarkupAccumulator(EAbsoluteURLs shouldResolveURLs
{
}
-void StyledMarkupAccumulator::appendStartTag(Node& node)
-{
- appendStartMarkup(node);
-}
-
void StyledMarkupAccumulator::appendEndTag(const Element& element)
{
appendEndMarkup(m_result, element);
@@ -73,26 +68,7 @@ void StyledMarkupAccumulator::appendEndTag(const Element& element)
void StyledMarkupAccumulator::appendStartMarkup(Node& node)
{
- switch (node.nodeType()) {
- case Node::TEXT_NODE: {
- Text& text = toText(node);
- if (text.parentElement() && text.parentElement()->tagQName() == textareaTag) {
- appendText(text);
- break;
- }
- appendTextWithInlineStyle(text);
- break;
- }
- case Node::ELEMENT_NODE: {
- Element& element = toElement(node);
- RefPtrWillBeRawPtr<EditingStyle> style = createInlineStyle(element);
- appendElement(element, style);
- break;
- }
- default:
- m_formatter.appendStartMarkup(m_result, node, nullptr);
- break;
- }
+ m_formatter.appendStartMarkup(m_result, node, nullptr);
}
void StyledMarkupAccumulator::appendEndMarkup(StringBuilder& result, const Element& element)
@@ -161,27 +137,6 @@ void StyledMarkupAccumulator::appendElement(const Element& element, PassRefPtrWi
appendElement(m_result, element);
}
-RefPtrWillBeRawPtr<EditingStyle> StyledMarkupAccumulator::createInlineStyle(Element& element)
-{
- RefPtrWillBeRawPtr<EditingStyle> inlineStyle = nullptr;
-
- if (shouldApplyWrappingStyle(element)) {
- inlineStyle = m_wrappingStyle->copy();
- inlineStyle->removePropertiesInElementDefaultStyle(&element);
- inlineStyle->removeStyleConflictingWithStyleOfElement(&element);
- } else {
- inlineStyle = EditingStyle::create();
- }
-
- if (element.isStyledElement() && element.inlineStyle())
- inlineStyle->overrideWithStyle(element.inlineStyle());
-
- if (element.isHTMLElement() && shouldAnnotate())
- inlineStyle->mergeStyleFromRulesForSerialization(&toHTMLElement(element));
-
- return inlineStyle;
-}
-
void StyledMarkupAccumulator::appendElementWithInlineStyle(StringBuilder& out, const Element& element, PassRefPtrWillBeRawPtr<EditingStyle> style)
{
const bool documentIsHTML = element.document().isHTMLDocument();
« no previous file with comments | « Source/core/editing/StyledMarkupAccumulator.h ('k') | Source/core/editing/StyledMarkupSerializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698