OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 // additional rows in ancestral multicol containers before doing it in | 666 // additional rows in ancestral multicol containers before doing it in |
667 // the descendants, in order to get the height constraints right down | 667 // the descendants, in order to get the height constraints right down |
668 // there. | 668 // there. |
669 const MultiColumnFragmentainerGroup& last_row = | 669 const MultiColumnFragmentainerGroup& last_row = |
670 column_set->LastFragmentainerGroup(); | 670 column_set->LastFragmentainerGroup(); |
671 // The top offset where where the new fragmentainer group will start in | 671 // The top offset where where the new fragmentainer group will start in |
672 // this column set, converted to the coordinate space of the enclosing | 672 // this column set, converted to the coordinate space of the enclosing |
673 // multicol container. | 673 // multicol container. |
674 LayoutUnit logical_offset_in_outer = | 674 LayoutUnit logical_offset_in_outer = |
675 last_row.BlockOffsetInEnclosingFragmentationContext() + | 675 last_row.BlockOffsetInEnclosingFragmentationContext() + |
676 last_row.LogicalHeight(); | 676 last_row.GroupLogicalHeight(); |
677 enclosing_flow_thread->AppendNewFragmentainerGroupIfNeeded( | 677 enclosing_flow_thread->AppendNewFragmentainerGroupIfNeeded( |
678 logical_offset_in_outer, kAssociateWithLatterPage); | 678 logical_offset_in_outer, kAssociateWithLatterPage); |
679 } | 679 } |
680 | 680 |
681 const MultiColumnFragmentainerGroup& new_row = | 681 const MultiColumnFragmentainerGroup& new_row = |
682 column_set->AppendNewFragmentainerGroup(); | 682 column_set->AppendNewFragmentainerGroup(); |
683 // Zero-height rows should really not occur here, but if it does anyway, | 683 // Zero-height rows should really not occur here, but if it does anyway, |
684 // break, so that we don't get stuck in an infinite loop. | 684 // break, so that we don't get stuck in an infinite loop. |
685 DCHECK_GT(new_row.LogicalHeight(), 0); | 685 DCHECK_GT(new_row.ColumnLogicalHeight(), 0); |
686 if (new_row.LogicalHeight() <= 0) | 686 if (new_row.ColumnLogicalHeight() <= 0) |
687 break; | 687 break; |
688 } while (column_set->NeedsNewFragmentainerGroupAt(offset_in_flow_thread, | 688 } while (column_set->NeedsNewFragmentainerGroupAt(offset_in_flow_thread, |
689 page_boundary_rule)); | 689 page_boundary_rule)); |
690 } | 690 } |
691 } | 691 } |
692 | 692 |
693 bool LayoutMultiColumnFlowThread::IsFragmentainerLogicalHeightKnown() { | 693 bool LayoutMultiColumnFlowThread::IsFragmentainerLogicalHeightKnown() { |
694 return IsPageLogicalHeightKnown(); | 694 return IsPageLogicalHeightKnown(); |
695 } | 695 } |
696 | 696 |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1411 const { | 1411 const { |
1412 return MultiColumnLayoutState(last_set_worked_on_); | 1412 return MultiColumnLayoutState(last_set_worked_on_); |
1413 } | 1413 } |
1414 | 1414 |
1415 void LayoutMultiColumnFlowThread::RestoreMultiColumnLayoutState( | 1415 void LayoutMultiColumnFlowThread::RestoreMultiColumnLayoutState( |
1416 const MultiColumnLayoutState& state) { | 1416 const MultiColumnLayoutState& state) { |
1417 last_set_worked_on_ = state.ColumnSet(); | 1417 last_set_worked_on_ = state.ColumnSet(); |
1418 } | 1418 } |
1419 | 1419 |
1420 } // namespace blink | 1420 } // namespace blink |
OLD | NEW |