OLD | NEW |
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. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
4 * All right reserved. | 4 * All right reserved. |
5 * Copyright (C) 2010 Google Inc. All rights reserved. | 5 * Copyright (C) 2010 Google Inc. All rights reserved. |
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 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1111 LayoutTextInfo layout_text_info; | 1111 LayoutTextInfo layout_text_info; |
1112 VerticalPositionCache vertical_position_cache; | 1112 VerticalPositionCache vertical_position_cache; |
1113 | 1113 |
1114 // Pagination may require us to delete and re-create a line due to floats. | 1114 // Pagination may require us to delete and re-create a line due to floats. |
1115 // When this happens, | 1115 // When this happens, |
1116 // we need to store the pagination strut in the meantime. | 1116 // we need to store the pagination strut in the meantime. |
1117 LayoutUnit pagination_strut_from_deleted_line; | 1117 LayoutUnit pagination_strut_from_deleted_line; |
1118 | 1118 |
1119 LineBreaker line_breaker(LineLayoutBlockFlow(this)); | 1119 LineBreaker line_breaker(LineLayoutBlockFlow(this)); |
1120 | 1120 |
1121 // We avoid inline capacity to save the stack space. | |
1122 WordMeasurements word_measurements; | |
1123 word_measurements.ReserveInitialCapacity(64); | |
1124 | 1121 |
1125 while (!end_of_line.AtEnd()) { | 1122 while (!end_of_line.AtEnd()) { |
1126 // The runs from the previous line should have been cleaned up. | 1123 // The runs from the previous line should have been cleaned up. |
1127 DCHECK(!resolver.Runs().RunCount()); | 1124 DCHECK(!resolver.Runs().RunCount()); |
1128 | 1125 |
1129 // FIXME: Is this check necessary before the first iteration or can it be | 1126 // FIXME: Is this check necessary before the first iteration or can it be |
1130 // moved to the end? | 1127 // moved to the end? |
1131 if (layout_state.EndLine()) { | 1128 if (layout_state.EndLine()) { |
1132 layout_state.SetEndLineMatched(layout_state.EndLineMatched() || | 1129 layout_state.SetEndLineMatched(layout_state.EndLineMatched() || |
1133 MatchedEndLine(layout_state, resolver, | 1130 MatchedEndLine(layout_state, resolver, |
(...skipping 10 matching lines...) Expand all Loading... |
1144 | 1141 |
1145 layout_state.GetLineInfo().SetEmpty(true); | 1142 layout_state.GetLineInfo().SetEmpty(true); |
1146 layout_state.GetLineInfo().ResetRunsFromLeadingWhitespace(); | 1143 layout_state.GetLineInfo().ResetRunsFromLeadingWhitespace(); |
1147 | 1144 |
1148 const InlineIterator previous_endof_line = end_of_line; | 1145 const InlineIterator previous_endof_line = end_of_line; |
1149 bool is_new_uba_paragraph = | 1146 bool is_new_uba_paragraph = |
1150 layout_state.GetLineInfo().PreviousLineBrokeCleanly(); | 1147 layout_state.GetLineInfo().PreviousLineBrokeCleanly(); |
1151 FloatingObject* last_float_from_previous_line = | 1148 FloatingObject* last_float_from_previous_line = |
1152 (ContainsFloats()) ? floating_objects_->Set().back().get() : 0; | 1149 (ContainsFloats()) ? floating_objects_->Set().back().get() : 0; |
1153 | 1150 |
1154 word_measurements.Clear(); | 1151 WordMeasurements word_measurements; |
1155 end_of_line = | 1152 end_of_line = |
1156 line_breaker.NextLineBreak(resolver, layout_state.GetLineInfo(), | 1153 line_breaker.NextLineBreak(resolver, layout_state.GetLineInfo(), |
1157 layout_text_info, word_measurements); | 1154 layout_text_info, word_measurements); |
1158 layout_text_info.line_break_iterator_.ResetPriorContext(); | 1155 layout_text_info.line_break_iterator_.ResetPriorContext(); |
1159 if (resolver.GetPosition().AtEnd()) { | 1156 if (resolver.GetPosition().AtEnd()) { |
1160 // FIXME: We shouldn't be creating any runs in nextLineBreak to begin | 1157 // FIXME: We shouldn't be creating any runs in nextLineBreak to begin |
1161 // with! Once BidiRunList is separated from BidiResolver this will not be | 1158 // with! Once BidiRunList is separated from BidiResolver this will not be |
1162 // needed. | 1159 // needed. |
1163 resolver.Runs().DeleteRuns(); | 1160 resolver.Runs().DeleteRuns(); |
1164 resolver.MarkCurrentRunEmpty(); // FIXME: This can probably be replaced | 1161 resolver.MarkCurrentRunEmpty(); // FIXME: This can probably be replaced |
(...skipping 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2654 | 2651 |
2655 bool LayoutBlockFlow::PaintedOutputOfObjectHasNoEffectRegardlessOfSize() const { | 2652 bool LayoutBlockFlow::PaintedOutputOfObjectHasNoEffectRegardlessOfSize() const { |
2656 // LayoutBlockFlow is in charge of paint invalidation of the first line. | 2653 // LayoutBlockFlow is in charge of paint invalidation of the first line. |
2657 if (FirstLineBox()) | 2654 if (FirstLineBox()) |
2658 return false; | 2655 return false; |
2659 | 2656 |
2660 return LayoutBlock::PaintedOutputOfObjectHasNoEffectRegardlessOfSize(); | 2657 return LayoutBlock::PaintedOutputOfObjectHasNoEffectRegardlessOfSize(); |
2661 } | 2658 } |
2662 | 2659 |
2663 } // namespace blink | 2660 } // namespace blink |
OLD | NEW |