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

Unified Diff: Source/core/rendering/line/BreakingContextInlineHeaders.h

Issue 890853002: Revert of text-combine should scale rather than fall back to none when wide (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 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/rendering/RenderCombineText.cpp ('k') | Source/core/rendering/line/LineBreaker.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/line/BreakingContextInlineHeaders.h
diff --git a/Source/core/rendering/line/BreakingContextInlineHeaders.h b/Source/core/rendering/line/BreakingContextInlineHeaders.h
index b77b866ce0bcab35d9251efd4ee222002e2462c3..324b8bc9f6b70c82df1f06e03f35b3ae46558216 100644
--- a/Source/core/rendering/line/BreakingContextInlineHeaders.h
+++ b/Source/core/rendering/line/BreakingContextInlineHeaders.h
@@ -480,6 +480,11 @@ inline void BreakingContext::handleReplaced()
m_renderTextInfo.m_lineBreakIterator.updatePriorContext(replacementCharacter);
}
+inline bool iteratorIsBeyondEndOfRenderCombineText(const InlineIterator& iter, RenderCombineText* renderer)
+{
+ return iter.object() == renderer && iter.offset() >= renderer->textLength();
+}
+
inline void nextCharacter(UChar& currentCharacter, UChar& lastCharacter, UChar& secondToLastCharacter)
{
secondToLastCharacter = lastCharacter;
@@ -537,6 +542,17 @@ inline bool BreakingContext::handleText(WordMeasurements& wordMeasurements, bool
m_lineBreak.moveToStartOf(m_current.object());
}
+ if (renderText->style()->hasTextCombine() && m_current.object()->isCombineText() && !toRenderCombineText(m_current.object())->isCombined()) {
+ RenderCombineText* combineRenderer = toRenderCombineText(m_current.object());
+ combineRenderer->combineText();
+ // The length of the renderer's text may have changed. Increment stale iterator positions
+ if (iteratorIsBeyondEndOfRenderCombineText(m_lineBreak, combineRenderer)) {
+ ASSERT(iteratorIsBeyondEndOfRenderCombineText(m_resolver.position(), combineRenderer));
+ m_lineBreak.increment();
+ m_resolver.position().increment(&m_resolver);
+ }
+ }
+
RenderStyle* style = renderText->style(m_lineInfo.isFirstLine());
const Font& font = style->font();
bool isFixedPitch = font.isFixedPitch();
« no previous file with comments | « Source/core/rendering/RenderCombineText.cpp ('k') | Source/core/rendering/line/LineBreaker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698