| 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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 | 480 |
| 481 if (m_columnHeight) | 481 if (m_columnHeight) |
| 482 return ((offsetInFlowThread - m_logicalTopInFlowThread) / m_columnHeight
).floor(); | 482 return ((offsetInFlowThread - m_logicalTopInFlowThread) / m_columnHeight
).floor(); |
| 483 return 0; | 483 return 0; |
| 484 } | 484 } |
| 485 | 485 |
| 486 unsigned MultiColumnFragmentainerGroup::columnIndexAtVisualPoint(const LayoutPoi
nt& visualPoint) const | 486 unsigned MultiColumnFragmentainerGroup::columnIndexAtVisualPoint(const LayoutPoi
nt& visualPoint) const |
| 487 { | 487 { |
| 488 bool isColumnProgressionInline = m_columnSet.multiColumnFlowThread()->progre
ssionIsInline(); | 488 bool isColumnProgressionInline = m_columnSet.multiColumnFlowThread()->progre
ssionIsInline(); |
| 489 bool isHorizontalWritingMode = m_columnSet.isHorizontalWritingMode(); | 489 bool isHorizontalWritingMode = m_columnSet.isHorizontalWritingMode(); |
| 490 LayoutUnit columnLengthInColumnProgressionDirection = isColumnProgressionInl
ine ? m_columnSet.pageLogicalWidth() : m_columnSet.pageLogicalHeight(); | 490 LayoutUnit columnLengthInColumnProgressionDirection = isColumnProgressionInl
ine ? m_columnSet.pageLogicalWidth() : logicalHeight(); |
| 491 LayoutUnit offsetInColumnProgressionDirection = isHorizontalWritingMode == i
sColumnProgressionInline ? visualPoint.x() : visualPoint.y(); | 491 LayoutUnit offsetInColumnProgressionDirection = isHorizontalWritingMode == i
sColumnProgressionInline ? visualPoint.x() : visualPoint.y(); |
| 492 if (!m_columnSet.style()->isLeftToRightDirection() && isColumnProgressionInl
ine) | 492 if (!m_columnSet.style()->isLeftToRightDirection() && isColumnProgressionInl
ine) |
| 493 offsetInColumnProgressionDirection = m_columnSet.logicalWidth() - offset
InColumnProgressionDirection; | 493 offsetInColumnProgressionDirection = m_columnSet.logicalWidth() - offset
InColumnProgressionDirection; |
| 494 LayoutUnit columnGap = m_columnSet.columnGap(); | 494 LayoutUnit columnGap = m_columnSet.columnGap(); |
| 495 if (columnLengthInColumnProgressionDirection + columnGap <= 0) | 495 if (columnLengthInColumnProgressionDirection + columnGap <= 0) |
| 496 return 0; | 496 return 0; |
| 497 // Column boundaries are in the middle of the column gap. | 497 // Column boundaries are in the middle of the column gap. |
| 498 int index = (offsetInColumnProgressionDirection + columnGap / 2) / (columnLe
ngthInColumnProgressionDirection + columnGap); | 498 int index = (offsetInColumnProgressionDirection + columnGap / 2) / (columnLe
ngthInColumnProgressionDirection + columnGap); |
| 499 if (index < 0) | 499 if (index < 0) |
| 500 return 0; | 500 return 0; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 append(MultiColumnFragmentainerGroup(m_columnSet)); | 555 append(MultiColumnFragmentainerGroup(m_columnSet)); |
| 556 return last(); | 556 return last(); |
| 557 } | 557 } |
| 558 | 558 |
| 559 void MultiColumnFragmentainerGroupList::deleteExtraGroups() | 559 void MultiColumnFragmentainerGroupList::deleteExtraGroups() |
| 560 { | 560 { |
| 561 shrink(1); | 561 shrink(1); |
| 562 } | 562 } |
| 563 | 563 |
| 564 } // namespace blink | 564 } // namespace blink |
| OLD | NEW |