Chromium Code Reviews| Index: Source/core/editing/markup.cpp |
| diff --git a/Source/core/editing/markup.cpp b/Source/core/editing/markup.cpp |
| index 2ea076869acc2465946b2c0dd052084f46f536dc..4967b1385e2d2b73f21713ec995abc6f6b578fc1 100644 |
| --- a/Source/core/editing/markup.cpp |
| +++ b/Source/core/editing/markup.cpp |
| @@ -136,7 +136,7 @@ private: |
| enum NodeTraversalMode { EmitString, DoNotEmitString }; |
| Node* traverseNodesForSerialization(Node* startNode, Node* pastEnd, NodeTraversalMode); |
| - bool shouldAnnotate() { return m_shouldAnnotate == AnnotateForInterchange; } |
| + bool shouldAnnotate() const { return m_shouldAnnotate == AnnotateForInterchange || m_shouldAnnotate == AnnotateForNavigationTransition; } |
| bool shouldApplyWrappingStyle(const Node& node) const |
| { |
| return m_highestNodeToBeSerialized && m_highestNodeToBeSerialized->parentNode() == node.parentNode() |
| @@ -305,6 +305,9 @@ void StyledMarkupAccumulator::appendElement(StringBuilder& out, Element& element |
| if (shouldAnnotate()) |
| newInlineStyle->mergeStyleFromRulesForSerialization(&toHTMLElement(element)); |
| + if (&element == m_highestNodeToBeSerialized && m_shouldAnnotate == AnnotateForNavigationTransition) |
|
yosin_UTC9
2014/05/29 03:58:52
nit: You don't need |&| for |element|. |Node| has
oystein (OOO til 10th of July)
2014/05/29 18:26:49
Done.
|
| + newInlineStyle->addAbsolutePositioningFromElement(&element); |
| + |
| if (addDisplayInline) |
| newInlineStyle->forceInline(); |
| @@ -331,8 +334,12 @@ Node* StyledMarkupAccumulator::serializeNodes(Node* startNode, Node* pastEnd) |
| m_highestNodeToBeSerialized = lastClosed; |
| } |
| - if (m_highestNodeToBeSerialized && m_highestNodeToBeSerialized->parentNode()) |
| + if (m_highestNodeToBeSerialized && m_highestNodeToBeSerialized->parentNode()) { |
| m_wrappingStyle = EditingStyle::wrappingStyleForSerialization(m_highestNodeToBeSerialized->parentNode(), shouldAnnotate()); |
| + if (m_shouldAnnotate == AnnotateForNavigationTransition) |
| + m_wrappingStyle->style()->removeProperty(CSSPropertyBackground); |
|
esprehn
2014/05/22 18:29:06
Huh?
|
| + } |
| + |
| return traverseNodesForSerialization(startNode, pastEnd, EmitString); |
| } |
| @@ -1071,4 +1078,12 @@ void mergeWithNextTextNode(PassRefPtr<Node> node, ExceptionState& exceptionState |
| textNext->remove(exceptionState); |
| } |
| +String createStyledMarkupForNavigationTransition(Node* node) |
| +{ |
| + StyledMarkupAccumulator accumulator(0, ResolveAllURLs, AnnotateForNavigationTransition, 0, 0); |
| + accumulator.serializeNodes(node, NodeTraversal::nextSkippingChildren(*node)); |
|
esprehn
2014/05/22 18:29:06
This code doesn't make sense, why are you going to
|
| + |
| + return accumulator.takeResults(); |
| +} |
| + |
| } |