OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/layout/ng/ng_block_node.h" | 5 #include "core/layout/ng/ng_block_node.h" |
6 | 6 |
7 #include "core/layout/LayoutBlock.h" | 7 #include "core/layout/LayoutBlock.h" |
8 #include "core/layout/LayoutBlockFlow.h" | 8 #include "core/layout/LayoutBlockFlow.h" |
9 #include "core/layout/LayoutMultiColumnFlowThread.h" | 9 #include "core/layout/LayoutMultiColumnFlowThread.h" |
10 #include "core/layout/LayoutMultiColumnSet.h" | 10 #include "core/layout/LayoutMultiColumnSet.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 return nullptr; | 221 return nullptr; |
222 } | 222 } |
223 | 223 |
224 bool NGBlockNode::CanUseNewLayout() const { | 224 bool NGBlockNode::CanUseNewLayout() const { |
225 // [Multicol]: for the 1st phase of LayoutNG's multicol implementation we want | 225 // [Multicol]: for the 1st phase of LayoutNG's multicol implementation we want |
226 // to utilize the existing ColumnBalancer class. That's why a multicol block | 226 // to utilize the existing ColumnBalancer class. That's why a multicol block |
227 // should be processed by Legacy Layout engine. | 227 // should be processed by Legacy Layout engine. |
228 if (Style().SpecifiesColumns()) | 228 if (Style().SpecifiesColumns()) |
229 return false; | 229 return false; |
230 | 230 |
231 if (!box_->IsLayoutBlockFlow()) | 231 if (!box_->IsLayoutNGBlockFlow()) |
232 return false; | 232 return false; |
233 | |
233 return RuntimeEnabledFeatures::LayoutNGEnabled(); | 234 return RuntimeEnabledFeatures::LayoutNGEnabled(); |
cbiesinger
2017/06/15 17:37:57
Do we need this or can it be return true;?
ikilpatrick
2017/06/15 18:05:33
It can be true at the moment, but want to leave th
| |
234 } | 235 } |
235 | 236 |
236 String NGBlockNode::ToString() const { | 237 String NGBlockNode::ToString() const { |
237 return String::Format("NGBlockNode: '%s'", | 238 return String::Format("NGBlockNode: '%s'", |
238 GetLayoutObject()->DebugName().Ascii().data()); | 239 GetLayoutObject()->DebugName().Ascii().data()); |
239 } | 240 } |
240 | 241 |
241 void NGBlockNode::CopyFragmentDataToLayoutBox( | 242 void NGBlockNode::CopyFragmentDataToLayoutBox( |
242 const NGConstraintSpace& constraint_space, | 243 const NGConstraintSpace& constraint_space, |
243 NGLayoutResult* layout_result) { | 244 NGLayoutResult* layout_result) { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
356 | 357 |
357 // Save static position for legacy AbsPos layout. | 358 // Save static position for legacy AbsPos layout. |
358 void NGBlockNode::SaveStaticOffsetForLegacy(const NGLogicalOffset& offset) { | 359 void NGBlockNode::SaveStaticOffsetForLegacy(const NGLogicalOffset& offset) { |
359 DCHECK(box_->IsOutOfFlowPositioned()); | 360 DCHECK(box_->IsOutOfFlowPositioned()); |
360 DCHECK(box_->Layer()); | 361 DCHECK(box_->Layer()); |
361 box_->Layer()->SetStaticBlockPosition(offset.block_offset); | 362 box_->Layer()->SetStaticBlockPosition(offset.block_offset); |
362 box_->Layer()->SetStaticInlinePosition(offset.inline_offset); | 363 box_->Layer()->SetStaticInlinePosition(offset.inline_offset); |
363 } | 364 } |
364 | 365 |
365 } // namespace blink | 366 } // namespace blink |
OLD | NEW |