OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "core/layout/MultiColumnFragmentainerGroup.h" | 7 #include "core/layout/MultiColumnFragmentainerGroup.h" |
8 | 8 |
9 #include "core/layout/LayoutMultiColumnSet.h" | 9 #include "core/layout/LayoutMultiColumnSet.h" |
10 | 10 |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 if (offsetInFlowThread < m_logicalTopInFlowThread) | 529 if (offsetInFlowThread < m_logicalTopInFlowThread) |
530 return 0; | 530 return 0; |
531 // If we're laying out right now, we cannot constrain against some logical b
ottom, since it | 531 // If we're laying out right now, we cannot constrain against some logical b
ottom, since it |
532 // isn't known yet. Otherwise, just return the last column if we're past the
logical bottom. | 532 // isn't known yet. Otherwise, just return the last column if we're past the
logical bottom. |
533 if (mode == ClampToExistingColumns) { | 533 if (mode == ClampToExistingColumns) { |
534 if (offsetInFlowThread >= m_logicalBottomInFlowThread) | 534 if (offsetInFlowThread >= m_logicalBottomInFlowThread) |
535 return actualColumnCount() - 1; | 535 return actualColumnCount() - 1; |
536 } | 536 } |
537 | 537 |
538 if (m_columnHeight) | 538 if (m_columnHeight) |
539 return (offsetInFlowThread - m_logicalTopInFlowThread).toFloat() / m_col
umnHeight.toFloat(); | 539 return ((offsetInFlowThread - m_logicalTopInFlowThread) / m_columnHeight
).floor(); |
540 return 0; | 540 return 0; |
541 } | 541 } |
542 | 542 |
543 unsigned MultiColumnFragmentainerGroup::columnIndexAtVisualPoint(const LayoutPoi
nt& visualPoint) const | 543 unsigned MultiColumnFragmentainerGroup::columnIndexAtVisualPoint(const LayoutPoi
nt& visualPoint) const |
544 { | 544 { |
545 bool isColumnProgressionInline = m_columnSet.multiColumnFlowThread()->progre
ssionIsInline(); | 545 bool isColumnProgressionInline = m_columnSet.multiColumnFlowThread()->progre
ssionIsInline(); |
546 bool isHorizontalWritingMode = m_columnSet.isHorizontalWritingMode(); | 546 bool isHorizontalWritingMode = m_columnSet.isHorizontalWritingMode(); |
547 LayoutUnit columnLengthInColumnProgressionDirection = isColumnProgressionInl
ine ? m_columnSet.pageLogicalWidth() : m_columnSet.pageLogicalHeight(); | 547 LayoutUnit columnLengthInColumnProgressionDirection = isColumnProgressionInl
ine ? m_columnSet.pageLogicalWidth() : m_columnSet.pageLogicalHeight(); |
548 LayoutUnit offsetInColumnProgressionDirection = isHorizontalWritingMode == i
sColumnProgressionInline ? visualPoint.x() : visualPoint.y(); | 548 LayoutUnit offsetInColumnProgressionDirection = isHorizontalWritingMode == i
sColumnProgressionInline ? visualPoint.x() : visualPoint.y(); |
549 if (!m_columnSet.style()->isLeftToRightDirection() && isColumnProgressionInl
ine) | 549 if (!m_columnSet.style()->isLeftToRightDirection() && isColumnProgressionInl
ine) |
(...skipping 28 matching lines...) Expand all Loading... |
578 append(MultiColumnFragmentainerGroup(m_columnSet)); | 578 append(MultiColumnFragmentainerGroup(m_columnSet)); |
579 return last(); | 579 return last(); |
580 } | 580 } |
581 | 581 |
582 void MultiColumnFragmentainerGroupList::deleteExtraGroups() | 582 void MultiColumnFragmentainerGroupList::deleteExtraGroups() |
583 { | 583 { |
584 shrink(1); | 584 shrink(1); |
585 } | 585 } |
586 | 586 |
587 } // namespace blink | 587 } // namespace blink |
OLD | NEW |