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

Unified Diff: Source/core/rendering/InlineIterator.h

Issue 46393003: BidiResolver should not append an isolated run if it is in a other line. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Final patch for landing Created 7 years, 1 month 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 | « no previous file | Source/core/rendering/RenderBlockLineLayout.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/InlineIterator.h
diff --git a/Source/core/rendering/InlineIterator.h b/Source/core/rendering/InlineIterator.h
index 2aa0c6ff0f88ece779090239bdf0d25d46f324f1..d4834362c93fde29e034ebd61951b28c0fa78c9d 100644
--- a/Source/core/rendering/InlineIterator.h
+++ b/Source/core/rendering/InlineIterator.h
@@ -420,15 +420,15 @@ inline void InlineBidiResolver::increment()
}
template <>
-inline bool InlineBidiResolver::isEndOfParagraph(const InlineIterator& end)
+inline bool InlineBidiResolver::isEndOfLine(const InlineIterator& end)
{
- bool inEndOfParagraph = m_current == end || m_current.atEnd() || (inIsolate() && m_current.m_obj == end.m_obj);
- if (inIsolate() && inEndOfParagraph) {
+ bool inEndOfLine = m_current == end || m_current.atEnd() || (inIsolate() && m_current.m_obj == end.m_obj);
+ if (inIsolate() && inEndOfLine) {
m_current.moveTo(m_current.m_obj, end.m_pos, m_current.m_nextBreakablePosition);
m_last = m_current;
updateStatusLastFromCurrentDirection(WTF::Unicode::OtherNeutral);
}
- return inEndOfParagraph;
+ return inEndOfLine;
}
static inline bool isIsolatedInline(RenderObject* object)
@@ -588,7 +588,7 @@ inline void InlineBidiResolver::appendRun()
IsolateTracker isolateTracker(numberOfIsolateAncestors(m_sor));
int start = m_sor.m_pos;
RenderObject* obj = m_sor.m_obj;
- while (obj && obj != m_eor.m_obj && obj != endOfLine.m_obj) {
+ while (obj && obj != m_eor.m_obj && obj != m_endOfRunAtEndOfLine.m_obj) {
if (isolateTracker.inIsolate())
isolateTracker.addFakeRunIfNecessary(obj, start, obj->length(), *this);
else
@@ -597,11 +597,12 @@ inline void InlineBidiResolver::appendRun()
start = 0;
obj = bidiNextSkippingEmptyInlines(m_sor.root(), obj, &isolateTracker);
}
- if (obj) {
+ bool isEndOfLine = obj == m_endOfLine.m_obj && !m_endOfLine.m_pos;
+ if (obj && !isEndOfLine) {
unsigned pos = obj == m_eor.m_obj ? m_eor.m_pos : INT_MAX;
- if (obj == endOfLine.m_obj && endOfLine.m_pos <= pos) {
+ if (obj == m_endOfRunAtEndOfLine.m_obj && m_endOfRunAtEndOfLine.m_pos <= pos) {
m_reachedEndOfLine = true;
- pos = endOfLine.m_pos;
+ pos = m_endOfRunAtEndOfLine.m_pos;
}
// It's OK to add runs for zero-length RenderObjects, just don't make the run larger than it should be
int end = obj->length() ? pos + 1 : 0;
« no previous file with comments | « no previous file | Source/core/rendering/RenderBlockLineLayout.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698