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

Side by Side 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: Add NeedsRebaseline 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ight reserved. 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ight reserved.
4 * Copyright (C) 2010 Google Inc. All rights reserved. 4 * Copyright (C) 2010 Google Inc. All rights reserved.
5 * Copyright (C) 2013 Adobe Systems Incorporated. 5 * Copyright (C) 2013 Adobe Systems Incorporated.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 m_width.addUncommittedWidth((inlineLogicalWidth(m_current.object()) + border PaddingMarginStart(flowBox) + borderPaddingMarginEnd(flowBox)).toFloat()); 450 m_width.addUncommittedWidth((inlineLogicalWidth(m_current.object()) + border PaddingMarginStart(flowBox) + borderPaddingMarginEnd(flowBox)).toFloat());
451 } 451 }
452 452
453 inline void BreakingContext::handleReplaced() 453 inline void BreakingContext::handleReplaced()
454 { 454 {
455 LineLayoutBox replacedBox(m_current.object()); 455 LineLayoutBox replacedBox(m_current.object());
456 456
457 if (m_atStart) 457 if (m_atStart)
458 m_width.updateAvailableWidth(replacedBox.logicalHeight()); 458 m_width.updateAvailableWidth(replacedBox.logicalHeight());
459 459
460 // Break on replaced elements if either has normal white-space. 460 // Break on replaced elements if either has normal white-space.
leviw_travelin_and_unemployed 2015/08/21 18:42:50 This comment seems to need an update.
kojii 2015/08/22 03:49:34 Done.
461 if ((m_autoWrap || ComputedStyle::autoWrap(m_lastWS)) && (!m_current.object( ).isImage() || m_allowImagesToBreak)) { 461 if ((m_autoWrap || ComputedStyle::autoWrap(m_lastWS)) && (!m_current.object( ).isImage() || m_allowImagesToBreak)
462 && (!m_current.object().isRubyRun() || toLayoutRubyRun(m_current.object( ))->canBreakBefore(m_layoutTextInfo.m_lineBreakIterator))) {
462 m_width.commit(); 463 m_width.commit();
463 m_lineBreak.moveToStartOf(m_current.object()); 464 m_lineBreak.moveToStartOf(m_current.object());
464 } 465 }
465 466
466 if (m_ignoringSpaces) 467 if (m_ignoringSpaces)
467 m_lineMidpointState.stopIgnoringSpaces(InlineIterator(0, m_current.objec t(), 0)); 468 m_lineMidpointState.stopIgnoringSpaces(InlineIterator(0, m_current.objec t(), 0));
468 469
469 m_lineInfo.setEmpty(false, m_block, &m_width); 470 m_lineInfo.setEmpty(false, m_block, &m_width);
470 m_ignoringSpaces = false; 471 m_ignoringSpaces = false;
471 m_currentCharacterShouldCollapseIfPreWap = m_currentCharacterIsSpace = false ; 472 m_currentCharacterShouldCollapseIfPreWap = m_currentCharacterIsSpace = false ;
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 return; 886 return;
886 } 887 }
887 } else if (m_blockStyle->autoWrap() && !m_width.fitsOnLine() && !m_width.com mittedWidth()) { 888 } else if (m_blockStyle->autoWrap() && !m_width.fitsOnLine() && !m_width.com mittedWidth()) {
888 // If the container autowraps but the current child does not then we sti ll need to ensure that it 889 // If the container autowraps but the current child does not then we sti ll need to ensure that it
889 // wraps and moves below any floats. 890 // wraps and moves below any floats.
890 m_width.fitBelowFloats(m_lineInfo.isFirstLine()); 891 m_width.fitBelowFloats(m_lineInfo.isFirstLine());
891 } 892 }
892 893
893 if (!m_current.object().isFloatingOrOutOfFlowPositioned()) { 894 if (!m_current.object().isFloatingOrOutOfFlowPositioned()) {
894 m_lastObject = m_current.object(); 895 m_lastObject = m_current.object();
895 if (m_lastObject.isReplaced() && m_autoWrap && (!m_lastObject.isImage() || m_allowImagesToBreak) && (!m_lastObject.isListMarker() || LineLayoutListMarke r(m_lastObject).isInside())) { 896 if (m_lastObject.isReplaced() && m_autoWrap && (!m_lastObject.isImage() || m_allowImagesToBreak) && (!m_lastObject.isListMarker() || LineLayoutListMarke r(m_lastObject).isInside())
897 && !m_lastObject.isRubyRun()) {
896 m_width.commit(); 898 m_width.commit();
897 m_lineBreak.moveToStartOf(m_nextObject); 899 m_lineBreak.moveToStartOf(m_nextObject);
898 } 900 }
899 } 901 }
900 } 902 }
901 903
902 inline IndentTextOrNot requiresIndent(bool isFirstLine, bool isAfterHardLineBrea k, const ComputedStyle& style) 904 inline IndentTextOrNot requiresIndent(bool isFirstLine, bool isAfterHardLineBrea k, const ComputedStyle& style)
903 { 905 {
904 IndentTextOrNot shouldIndentText = DoNotIndentText; 906 IndentTextOrNot shouldIndentText = DoNotIndentText;
905 if (isFirstLine || (isAfterHardLineBreak && style.textIndentLine()) == TextI ndentEachLine) 907 if (isFirstLine || (isAfterHardLineBreak && style.textIndentLine()) == TextI ndentEachLine)
906 shouldIndentText = IndentText; 908 shouldIndentText = IndentText;
907 909
908 if (style.textIndentType() == TextIndentHanging) 910 if (style.textIndentType() == TextIndentHanging)
909 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In dentText; 911 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In dentText;
910 912
911 return shouldIndentText; 913 return shouldIndentText;
912 } 914 }
913 915
914 } 916 }
915 917
916 #endif // BreakingContextInlineHeaders_h 918 #endif // BreakingContextInlineHeaders_h
OLDNEW
« Source/core/layout/LayoutRubyRun.cpp ('K') | « Source/core/layout/LayoutRubyRun.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698