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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp

Issue 1919453002: Support for mapping from outer/visual to flowthread coord space in nested multicol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add assert. Created 4 years, 8 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
OLDNEW
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 return 0; 57 return 0;
58 // TODO(mstensho): Introduce an interval tree or similar to speed up this. 58 // TODO(mstensho): Introduce an interval tree or similar to speed up this.
59 for (unsigned index = 0; index < m_fragmentainerGroups.size(); index++) { 59 for (unsigned index = 0; index < m_fragmentainerGroups.size(); index++) {
60 const auto& row = m_fragmentainerGroups[index]; 60 const auto& row = m_fragmentainerGroups[index];
61 if (row.logicalTopInFlowThread() <= flowThreadOffset && row.logicalBotto mInFlowThread() > flowThreadOffset) 61 if (row.logicalTopInFlowThread() <= flowThreadOffset && row.logicalBotto mInFlowThread() > flowThreadOffset)
62 return index; 62 return index;
63 } 63 }
64 return m_fragmentainerGroups.size() - 1; 64 return m_fragmentainerGroups.size() - 1;
65 } 65 }
66 66
67 const MultiColumnFragmentainerGroup& LayoutMultiColumnSet::fragmentainerGroupAtV isualPoint(const LayoutPoint&) const 67 const MultiColumnFragmentainerGroup& LayoutMultiColumnSet::fragmentainerGroupAtV isualPoint(const LayoutPoint& visualPoint) const
68 { 68 {
69 // FIXME: implement this, once we have support for multiple rows. 69 ASSERT(m_fragmentainerGroups.size() > 0);
70 return m_fragmentainerGroups.first(); 70 LayoutUnit blockOffset = isHorizontalWritingMode() ? visualPoint.y() : visua lPoint.x();
71 for (unsigned index = 0; index < m_fragmentainerGroups.size(); index++) {
72 const auto& row = m_fragmentainerGroups[index];
73 if (row.logicalTop() + row.logicalHeight() > blockOffset)
74 return row;
75 }
76 return m_fragmentainerGroups.last();
71 } 77 }
72 78
73 LayoutUnit LayoutMultiColumnSet::pageLogicalHeightForOffset(LayoutUnit offsetInF lowThread) const 79 LayoutUnit LayoutMultiColumnSet::pageLogicalHeightForOffset(LayoutUnit offsetInF lowThread) const
74 { 80 {
75 const MultiColumnFragmentainerGroup &lastRow = lastFragmentainerGroup(); 81 const MultiColumnFragmentainerGroup &lastRow = lastFragmentainerGroup();
76 if (!lastRow.logicalHeight()) { 82 if (!lastRow.logicalHeight()) {
77 // In the first layout pass of an auto-height multicol container, height isn't set. No need 83 // In the first layout pass of an auto-height multicol container, height isn't set. No need
78 // to perform the series of complicated dance steps below to figure out that we should 84 // to perform the series of complicated dance steps below to figure out that we should
79 // simply return 0. Bail now. 85 // simply return 0. Bail now.
80 ASSERT(m_fragmentainerGroups.size() == 1); 86 ASSERT(m_fragmentainerGroups.size() == 1);
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 473
468 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const 474 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const
469 { 475 {
470 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi dth(), logicalHeightInFlowThread()); 476 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi dth(), logicalHeightInFlowThread());
471 if (!isHorizontalWritingMode()) 477 if (!isHorizontalWritingMode())
472 return portionRect.transposedRect(); 478 return portionRect.transposedRect();
473 return portionRect; 479 return portionRect;
474 } 480 }
475 481
476 } // namespace blink 482 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698