Chromium Code Reviews| Index: Source/core/editing/StyledMarkupAccumulator.cpp |
| diff --git a/Source/core/editing/StyledMarkupAccumulator.cpp b/Source/core/editing/StyledMarkupAccumulator.cpp |
| index 8c60ccd5ab364da60616857101911d0eaab1038b..ebeefb28cc2ffc1ba74d91eb0db2ae03597df16e 100644 |
| --- a/Source/core/editing/StyledMarkupAccumulator.cpp |
| +++ b/Source/core/editing/StyledMarkupAccumulator.cpp |
| @@ -39,13 +39,6 @@ namespace blink { |
| namespace { |
|
tkent
2015/06/08 07:49:56
Remove this namespace block.
hajimehoshi
2015/06/08 07:56:55
Done.
|
| -const String& styleNodeCloseTag(bool isBlock) |
| -{ |
| - DEFINE_STATIC_LOCAL(const String, divClose, ("</div>")); |
| - DEFINE_STATIC_LOCAL(const String, styleSpanClose, ("</span>")); |
| - return isBlock ? divClose : styleSpanClose; |
| -} |
| - |
| } // namespace |
| using namespace HTMLNames; |
| @@ -108,7 +101,9 @@ void StyledMarkupAccumulator::appendText(StringBuilder& out, Text& text) |
| // FIXME: Should this be included in forceInline? |
| wrappingStyle->style()->setProperty(CSSPropertyFloat, CSSValueNone); |
| - appendStyleNodeOpenTag(out, wrappingStyle->style()); |
| + out.appendLiteral("<span style=\""); |
| + MarkupFormatter::appendAttributeValue(out, wrappingStyle->style()->asText(), m_document->isHTMLDocument()); |
| + out.appendLiteral("\">"); |
| } |
| if (!shouldAnnotate() || parentIsTextarea) { |
| @@ -135,7 +130,7 @@ void StyledMarkupAccumulator::appendText(StringBuilder& out, Text& text) |
| } |
| if (wrappingSpan) |
| - out.append(styleNodeCloseTag(false)); |
| + out.append("</span>"); |
| } |
| void StyledMarkupAccumulator::appendElement(StringBuilder& out, Element& element) |
| @@ -196,19 +191,6 @@ void StyledMarkupAccumulator::appendElement(StringBuilder& out, Element& element |
| m_formatter.appendCloseTag(out, element); |
| } |
| -void StyledMarkupAccumulator::appendStyleNodeOpenTag(StringBuilder& out, StylePropertySet* style, bool isBlock) |
| -{ |
| - // wrappingStyleForSerialization should have removed -webkit-text-decorations-in-effect |
| - ASSERT(propertyMissingOrEqualToNone(style, CSSPropertyWebkitTextDecorationsInEffect)); |
|
tkent
2015/06/08 07:49:56
The assertion is removed. Is it intentional?
hajimehoshi
2015/06/08 07:56:55
Oh, I forgot that. Copied.
|
| - if (isBlock) |
| - out.appendLiteral("<div style=\""); |
| - else |
| - out.appendLiteral("<span style=\""); |
| - ASSERT(m_document); |
|
tkent
2015/06/08 07:49:56
Ditto.
hajimehoshi
2015/06/08 07:56:55
Done.
|
| - MarkupFormatter::appendAttributeValue(out, style->asText(), m_document->isHTMLDocument()); |
| - out.appendLiteral("\">"); |
| -} |
| - |
| void StyledMarkupAccumulator::wrapWithNode(ContainerNode& node, RangeFullySelectsNode rangeFullySelectsNode) |
| { |
| StringBuilder markup; |
| @@ -221,12 +203,15 @@ void StyledMarkupAccumulator::wrapWithNode(ContainerNode& node, RangeFullySelect |
| appendEndTag(toElement(node)); |
| } |
| -void StyledMarkupAccumulator::wrapWithStyleNode(StylePropertySet* style, bool isBlock) |
| +void StyledMarkupAccumulator::wrapWithStyleNode(StylePropertySet* style) |
| { |
| StringBuilder openTag; |
| - appendStyleNodeOpenTag(openTag, style, isBlock); |
| + openTag.appendLiteral("<div style=\""); |
| + MarkupFormatter::appendAttributeValue(openTag, style->asText(), m_document->isHTMLDocument()); |
| + openTag.appendLiteral("\">"); |
| m_reversedPrecedingMarkup.append(openTag.toString()); |
| - appendString(styleNodeCloseTag(isBlock)); |
| + |
| + appendString("</div>"); |
| } |
| String StyledMarkupAccumulator::takeResults() |