Chromium Code Reviews| Index: Source/core/editing/StyledMarkupSerializer.cpp |
| diff --git a/Source/core/editing/StyledMarkupSerializer.cpp b/Source/core/editing/StyledMarkupSerializer.cpp |
| index 4b10abcb39f8d0ee3cb0fed86f596222c00ed9ad..6b1b0536494bde1b1695c8ffe4cfba0755e08a37 100644 |
| --- a/Source/core/editing/StyledMarkupSerializer.cpp |
| +++ b/Source/core/editing/StyledMarkupSerializer.cpp |
| @@ -241,7 +241,7 @@ Node* StyledMarkupSerializer<Strategy>::traverseNodesForSerialization(Node* star |
| } else { |
| // Add the node to the markup if we're not skipping the descendants |
| if (markupAccumulator) |
| - markupAccumulator->appendStartTag(*n); |
| + appendStartMarkup(*markupAccumulator, *n); |
| // If node has no children, close the tag now. |
| if (Strategy::hasChildren(*n)) { |
| @@ -337,6 +337,26 @@ RefPtrWillBeRawPtr<EditingStyle> StyledMarkupSerializer<Strategy>::createInlineS |
| return inlineStyle; |
| } |
| +template<typename Strategy> |
| +void StyledMarkupSerializer<Strategy>::appendStartMarkup(StyledMarkupAccumulator& accumulator, Node& node) |
| +{ |
| + switch (node.nodeType()) { |
| + case Node::TEXT_NODE: { |
| + Text& text = toText(node); |
| + ContainerNode* parent = Strategy::parent(text); |
|
yosin_UTC9
2015/06/12 12:09:55
For checking text in TEXTAREA, we should take pare
hajimehoshi
2015/06/16 08:15:18
Done.
|
| + if (parent && parent->isElementNode() && toElement(parent)->tagQName() == textareaTag) { |
| + accumulator.appendText(text); |
| + return; |
| + } |
| + accumulator.appendTextWithWrappingStyle(text); |
|
yosin_UTC9
2015/06/12 12:09:55
I think we may want to calculate inline style here
hajimehoshi
2015/06/16 08:15:18
Done.
|
| + break; |
| + } |
| + default: |
| + accumulator.appendStartMarkup(node); |
| + break; |
| + } |
| +} |
| + |
| template class StyledMarkupSerializer<EditingStrategy>; |
| } // namespace blink |