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

Unified Diff: Source/core/editing/serializers/StyledMarkupSerializer.cpp

Issue 1302353002: Get rid of redundant member function PositionAlgorithm<Strategy>::{upstream,downstream} (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-22T04:51:20 Rebase Created 5 years, 4 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/commands/TypingCommand.cpp ('k') | Source/core/layout/HitTestResult.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/serializers/StyledMarkupSerializer.cpp
diff --git a/Source/core/editing/serializers/StyledMarkupSerializer.cpp b/Source/core/editing/serializers/StyledMarkupSerializer.cpp
index c7b24b6bf09d5987151eaed0d5aae1cb34eae562..5d1c0a8e35946213b783f7ead7a14d342b28a4fc 100644
--- a/Source/core/editing/serializers/StyledMarkupSerializer.cpp
+++ b/Source/core/editing/serializers/StyledMarkupSerializer.cpp
@@ -137,8 +137,8 @@ StyledMarkupSerializer<Strategy>::StyledMarkupSerializer(EAbsoluteURLs shouldRes
static bool needInterchangeNewlineAfter(const VisiblePosition& v)
{
VisiblePosition next = v.next();
- Node* upstreamNode = next.deepEquivalent().upstream().anchorNode();
- Node* downstreamNode = v.deepEquivalent().downstream().anchorNode();
+ Node* upstreamNode = mostBackwardCaretPosition(next.deepEquivalent()).anchorNode();
+ Node* downstreamNode = mostForwardCaretPosition(v.deepEquivalent()).anchorNode();
// Add an interchange newline if a paragraph break is selected and a br won't already be added to the markup to represent it.
return isEndOfParagraph(v) && isStartOfParagraph(next) && !(isHTMLBRElement(*upstreamNode) && upstreamNode == downstreamNode);
}
« no previous file with comments | « Source/core/editing/commands/TypingCommand.cpp ('k') | Source/core/layout/HitTestResult.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698