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

Unified Diff: Source/core/rendering/RenderBlockLineLayout.cpp

Issue 24998005: unicode-bidi: plaintext does not work properly when a line wraps (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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/fast/text/international/unicode-bidi-plaintext-line-wrap-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/RenderBlockLineLayout.cpp
diff --git a/Source/core/rendering/RenderBlockLineLayout.cpp b/Source/core/rendering/RenderBlockLineLayout.cpp
index 70bdd9a1af09743930887808004715a1011476b5..896dc3a8cd1babc8a20da5a1a1feca529095747e 100644
--- a/Source/core/rendering/RenderBlockLineLayout.cpp
+++ b/Source/core/rendering/RenderBlockLineLayout.cpp
@@ -1125,7 +1125,7 @@ static inline void setupResolverToResumeInIsolate(InlineBidiResolver& resolver,
}
// FIXME: BidiResolver should have this logic.
-static inline void constructBidiRunsForSegment(InlineBidiResolver& topResolver, BidiRunList<BidiRun>& bidiRuns, const InlineIterator& endOfRuns, VisualDirectionOverride override, bool previousLineBrokeCleanly)
+static inline void constructBidiRunsForSegment(InlineBidiResolver& topResolver, BidiRunList<BidiRun>& bidiRuns, const InlineIterator& endOfRuns, VisualDirectionOverride override, bool previousLineBrokeCleanly, bool isNewUBAParagraph)
{
// FIXME: We should pass a BidiRunList into createBidiRunsForLine instead
// of the resolver owning the runs.
@@ -1152,9 +1152,12 @@ static inline void constructBidiRunsForSegment(InlineBidiResolver& topResolver,
InlineBidiResolver isolatedResolver;
EUnicodeBidi unicodeBidi = isolatedInline->style()->unicodeBidi();
TextDirection direction = isolatedInline->style()->direction();
- if (unicodeBidi == Plaintext)
- direction = determinePlaintextDirectionality(isolatedInline, startObj);
- else {
+ if (unicodeBidi == Plaintext) {
+ if (isNewUBAParagraph)
+ direction = determinePlaintextDirectionality(isolatedInline, startObj);
+ else
+ direction = determinePlaintextDirectionality(isolatedInline);
+ } else {
ASSERT(unicodeBidi == Isolate || unicodeBidi == IsolateOverride);
direction = isolatedInline->style()->direction();
}
@@ -1194,11 +1197,11 @@ static inline bool segmentIsEmpty(const InlineIterator& segmentStart, const Inli
return segmentStart == segmentEnd;
}
-static inline void constructBidiRunsForLine(const RenderBlock* block, InlineBidiResolver& topResolver, BidiRunList<BidiRun>& bidiRuns, const InlineIterator& endOfLine, VisualDirectionOverride override, bool previousLineBrokeCleanly)
+static inline void constructBidiRunsForLine(const RenderBlock* block, InlineBidiResolver& topResolver, BidiRunList<BidiRun>& bidiRuns, const InlineIterator& endOfLine, VisualDirectionOverride override, bool previousLineBrokeCleanly, bool isNewUBAParagraph)
{
ShapeInsideInfo* shapeInsideInfo = block->layoutShapeInsideInfo();
if (!shapeInsideInfo || !shapeInsideInfo->hasSegments()) {
- constructBidiRunsForSegment(topResolver, bidiRuns, endOfLine, override, previousLineBrokeCleanly);
+ constructBidiRunsForSegment(topResolver, bidiRuns, endOfLine, override, previousLineBrokeCleanly, isNewUBAParagraph);
return;
}
@@ -1220,7 +1223,7 @@ static inline void constructBidiRunsForLine(const RenderBlock* block, InlineBidi
}
if (!segmentIsEmpty(segmentStart, segmentEnd)) {
topResolver.setPosition(segmentStart, numberOfIsolateAncestors(segmentStart));
- constructBidiRunsForSegment(topResolver, bidiRuns, segmentEnd, override, previousLineBrokeCleanly);
+ constructBidiRunsForSegment(topResolver, bidiRuns, segmentEnd, override, previousLineBrokeCleanly, isNewUBAParagraph);
}
}
}
@@ -1687,7 +1690,7 @@ void RenderBlock::layoutRunsAndFloatsInRange(LineLayoutState& layoutState, Inlin
}
// FIXME: This ownership is reversed. We should own the BidiRunList and pass it to createBidiRunsForLine.
BidiRunList<BidiRun>& bidiRuns = resolver.runs();
- constructBidiRunsForLine(this, resolver, bidiRuns, end, override, layoutState.lineInfo().previousLineBrokeCleanly());
+ constructBidiRunsForLine(this, resolver, bidiRuns, end, override, layoutState.lineInfo().previousLineBrokeCleanly(), isNewUBAParagraph);
ASSERT(resolver.position() == end);
BidiRun* trailingSpaceRun = !layoutState.lineInfo().previousLineBrokeCleanly() ? handleTrailingSpaces(bidiRuns, resolver.context()) : 0;
« no previous file with comments | « LayoutTests/fast/text/international/unicode-bidi-plaintext-line-wrap-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698