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

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

Issue 1304993003: Fix Japanese line breaking rule before and after ruby (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: mac_chromium_rel_ng bot is stuck, re-upload to see if it fixes 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/layout/LayoutRubyRun.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/line/BreakingContextInlineHeaders.h
diff --git a/Source/core/layout/line/BreakingContextInlineHeaders.h b/Source/core/layout/line/BreakingContextInlineHeaders.h
index 7742d322d83ef721d8ad6a639980eb645917707c..e4ca168c84a3618331fb58da2675fa323a0e212a 100644
--- a/Source/core/layout/line/BreakingContextInlineHeaders.h
+++ b/Source/core/layout/line/BreakingContextInlineHeaders.h
@@ -457,8 +457,10 @@ inline void BreakingContext::handleReplaced()
if (m_atStart)
m_width.updateAvailableWidth(replacedBox.logicalHeight());
- // Break on replaced elements if either has normal white-space.
- if ((m_autoWrap || ComputedStyle::autoWrap(m_lastWS)) && (!m_current.object().isImage() || m_allowImagesToBreak)) {
+ // Break on replaced elements if either has normal white-space,
+ // or if the replaced element is ruby that can break before.
+ if ((m_autoWrap || ComputedStyle::autoWrap(m_lastWS)) && (!m_current.object().isImage() || m_allowImagesToBreak)
+ && (!m_current.object().isRubyRun() || toLayoutRubyRun(m_current.object())->canBreakBefore(m_layoutTextInfo.m_lineBreakIterator))) {
m_width.commit();
m_lineBreak.moveToStartOf(m_current.object());
}
@@ -892,7 +894,8 @@ inline void BreakingContext::commitAndUpdateLineBreakIfNeeded()
if (!m_current.object().isFloatingOrOutOfFlowPositioned()) {
m_lastObject = m_current.object();
- if (m_lastObject.isReplaced() && m_autoWrap && (!m_lastObject.isImage() || m_allowImagesToBreak) && (!m_lastObject.isListMarker() || LineLayoutListMarker(m_lastObject).isInside())) {
+ if (m_lastObject.isReplaced() && m_autoWrap && (!m_lastObject.isImage() || m_allowImagesToBreak) && (!m_lastObject.isListMarker() || LineLayoutListMarker(m_lastObject).isInside())
+ && !m_lastObject.isRubyRun()) {
m_width.commit();
m_lineBreak.moveToStartOf(m_nextObject);
}
« no previous file with comments | « Source/core/layout/LayoutRubyRun.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698