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

Unified Diff: Source/core/rendering/svg/SVGRootInlineBox.cpp

Issue 177263003: Only swap positions if both characters actually are absolute positioned (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 | « LayoutTests/svg/text/bidi-dir-rtl-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/SVGRootInlineBox.cpp
diff --git a/Source/core/rendering/svg/SVGRootInlineBox.cpp b/Source/core/rendering/svg/SVGRootInlineBox.cpp
index 04284b6a870ed890217efb2b8b4045f2aa1d2bf2..6fe6f19b66470d69685e7ce5703f48f07311f1e0 100644
--- a/Source/core/rendering/svg/SVGRootInlineBox.cpp
+++ b/Source/core/rendering/svg/SVGRootInlineBox.cpp
@@ -217,21 +217,11 @@ static inline void swapItemsInLayoutAttributes(SVGTextLayoutAttributes* firstAtt
SVGCharacterDataMap::iterator itLast = lastAttributes->characterDataMap().find(lastPosition + 1);
bool firstPresent = itFirst != firstAttributes->characterDataMap().end();
bool lastPresent = itLast != lastAttributes->characterDataMap().end();
- if (!firstPresent && !lastPresent)
+ // We only want to perform the swap if both inline boxes are absolutely
+ // positioned.
+ if (!firstPresent || !lastPresent)
return;
-
- if (firstPresent && lastPresent) {
- std::swap(itFirst->value, itLast->value);
- return;
- }
-
- if (firstPresent && !lastPresent) {
- lastAttributes->characterDataMap().set(lastPosition + 1, itFirst->value);
- return;
- }
-
- // !firstPresent && lastPresent
- firstAttributes->characterDataMap().set(firstPosition + 1, itLast->value);
+ std::swap(itFirst->value, itLast->value);
}
static inline void findFirstAndLastAttributesInVector(Vector<SVGTextLayoutAttributes*>& attributes, RenderSVGInlineText* firstContext, RenderSVGInlineText* lastContext,
« no previous file with comments | « LayoutTests/svg/text/bidi-dir-rtl-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698