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 17 matching lines...) Expand all Loading... |
28 | 28 |
29 #include "core/editing/PositionWithAffinity.h" | 29 #include "core/editing/PositionWithAffinity.h" |
30 #include "core/layout/LayoutMultiColumnFlowThread.h" | 30 #include "core/layout/LayoutMultiColumnFlowThread.h" |
31 #include "core/layout/MultiColumnFragmentainerGroup.h" | 31 #include "core/layout/MultiColumnFragmentainerGroup.h" |
32 #include "core/paint/MultiColumnSetPainter.h" | 32 #include "core/paint/MultiColumnSetPainter.h" |
33 #include "platform/RuntimeEnabledFeatures.h" | 33 #include "platform/RuntimeEnabledFeatures.h" |
34 | 34 |
35 namespace blink { | 35 namespace blink { |
36 | 36 |
37 LayoutMultiColumnSet::LayoutMultiColumnSet(LayoutFlowThread* flowThread) | 37 LayoutMultiColumnSet::LayoutMultiColumnSet(LayoutFlowThread* flowThread) |
38 : LayoutBlockFlow(0) | 38 : LayoutBlockFlow(nullptr) |
39 , m_fragmentainerGroups(*this) | 39 , m_fragmentainerGroups(*this) |
40 , m_flowThread(flowThread) | 40 , m_flowThread(flowThread) |
41 { | 41 { |
42 } | 42 } |
43 | 43 |
44 LayoutMultiColumnSet* LayoutMultiColumnSet::createAnonymous(LayoutFlowThread& fl
owThread, const ComputedStyle& parentStyle) | 44 LayoutMultiColumnSet* LayoutMultiColumnSet::createAnonymous(LayoutFlowThread& fl
owThread, const ComputedStyle& parentStyle) |
45 { | 45 { |
46 Document& document = flowThread.document(); | 46 Document& document = flowThread.document(); |
47 LayoutMultiColumnSet* layoutObject = new LayoutMultiColumnSet(&flowThread); | 47 LayoutMultiColumnSet* layoutObject = new LayoutMultiColumnSet(&flowThread); |
48 layoutObject->setDocumentForAnonymous(&document); | 48 layoutObject->setDocumentForAnonymous(&document); |
(...skipping 25 matching lines...) Expand all Loading... |
74 // locate the right row. | 74 // locate the right row. |
75 return firstFragmentainerGroup().logicalHeight(); | 75 return firstFragmentainerGroup().logicalHeight(); |
76 } | 76 } |
77 | 77 |
78 LayoutMultiColumnSet* LayoutMultiColumnSet::nextSiblingMultiColumnSet() const | 78 LayoutMultiColumnSet* LayoutMultiColumnSet::nextSiblingMultiColumnSet() const |
79 { | 79 { |
80 for (LayoutObject* sibling = nextSibling(); sibling; sibling = sibling->next
Sibling()) { | 80 for (LayoutObject* sibling = nextSibling(); sibling; sibling = sibling->next
Sibling()) { |
81 if (sibling->isLayoutMultiColumnSet()) | 81 if (sibling->isLayoutMultiColumnSet()) |
82 return toLayoutMultiColumnSet(sibling); | 82 return toLayoutMultiColumnSet(sibling); |
83 } | 83 } |
84 return 0; | 84 return nullptr; |
85 } | 85 } |
86 | 86 |
87 LayoutMultiColumnSet* LayoutMultiColumnSet::previousSiblingMultiColumnSet() cons
t | 87 LayoutMultiColumnSet* LayoutMultiColumnSet::previousSiblingMultiColumnSet() cons
t |
88 { | 88 { |
89 for (LayoutObject* sibling = previousSibling(); sibling; sibling = sibling->
previousSibling()) { | 89 for (LayoutObject* sibling = previousSibling(); sibling; sibling = sibling->
previousSibling()) { |
90 if (sibling->isLayoutMultiColumnSet()) | 90 if (sibling->isLayoutMultiColumnSet()) |
91 return toLayoutMultiColumnSet(sibling); | 91 return toLayoutMultiColumnSet(sibling); |
92 } | 92 } |
93 return 0; | 93 return nullptr; |
94 } | 94 } |
95 | 95 |
96 LayoutUnit LayoutMultiColumnSet::logicalTopInFlowThread() const | 96 LayoutUnit LayoutMultiColumnSet::logicalTopInFlowThread() const |
97 { | 97 { |
98 return firstFragmentainerGroup().logicalTopInFlowThread(); | 98 return firstFragmentainerGroup().logicalTopInFlowThread(); |
99 } | 99 } |
100 | 100 |
101 LayoutUnit LayoutMultiColumnSet::logicalBottomInFlowThread() const | 101 LayoutUnit LayoutMultiColumnSet::logicalBottomInFlowThread() const |
102 { | 102 { |
103 return lastFragmentainerGroup().logicalBottomInFlowThread(); | 103 return lastFragmentainerGroup().logicalBottomInFlowThread(); |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 | 326 |
327 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const | 327 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const |
328 { | 328 { |
329 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi
dth(), logicalHeightInFlowThread()); | 329 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi
dth(), logicalHeightInFlowThread()); |
330 if (!isHorizontalWritingMode()) | 330 if (!isHorizontalWritingMode()) |
331 return portionRect.transposedRect(); | 331 return portionRect.transposedRect(); |
332 return portionRect; | 332 return portionRect; |
333 } | 333 } |
334 | 334 |
335 } | 335 } |
OLD | NEW |