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

Side by Side Diff: Source/core/layout/MultiColumnFragmentainerGroup.cpp

Issue 1282353002: Prepare height calculation methods in LayoutFlowThread for nested multicol. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutPagedFlowThread.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutPagedFlowThread.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698