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/LayoutBlockFlow.h" | 7 #include "core/layout/LayoutBlockFlow.h" |
8 #include "core/layout/LayoutMultiColumnFlowThread.h" | 8 #include "core/layout/LayoutMultiColumnFlowThread.h" |
9 #include "core/layout/LayoutMultiColumnSet.h" | 9 #include "core/layout/LayoutMultiColumnSet.h" |
10 #include "core/layout/api/LineLayoutAPIShim.h" | 10 #include "core/layout/api/LineLayoutAPIShim.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 FragmentPositionUpdated(*box_fragment); | 72 FragmentPositionUpdated(*box_fragment); |
73 | 73 |
74 LayoutBox* layout_box = ToLayoutBox(box_fragment->GetLayoutObject()); | 74 LayoutBox* layout_box = ToLayoutBox(box_fragment->GetLayoutObject()); |
75 DCHECK(layout_box->IsFloating()); | 75 DCHECK(layout_box->IsFloating()); |
76 | 76 |
77 if (parent && parent->IsLayoutBlockFlow()) { | 77 if (parent && parent->IsLayoutBlockFlow()) { |
78 FloatingObject* floating_object = | 78 FloatingObject* floating_object = |
79 ToLayoutBlockFlow(parent)->InsertFloatingObject(*layout_box); | 79 ToLayoutBlockFlow(parent)->InsertFloatingObject(*layout_box); |
80 floating_object->SetIsInPlacedTree(false); | 80 floating_object->SetIsInPlacedTree(false); |
81 floating_object->SetX(ng_floating_object->left_offset); | 81 floating_object->SetX(ng_floating_object->left_offset); |
82 floating_object->SetY(box_fragment->TopOffset()); | 82 floating_object->SetY(ng_floating_object->top_offset); |
83 floating_object->SetIsPlaced(true); | 83 floating_object->SetIsPlaced(true); |
84 floating_object->SetIsInPlacedTree(true); | 84 floating_object->SetIsInPlacedTree(true); |
85 } | 85 } |
86 } | 86 } |
87 | 87 |
88 void UpdateLegacyMultiColumnFlowThread(LayoutBox* layout_box, | 88 void UpdateLegacyMultiColumnFlowThread(LayoutBox* layout_box, |
89 const NGPhysicalBoxFragment* fragment) { | 89 const NGPhysicalBoxFragment* fragment) { |
90 LayoutBlockFlow* multicol = ToLayoutBlockFlow(layout_box); | 90 LayoutBlockFlow* multicol = ToLayoutBlockFlow(layout_box); |
91 LayoutMultiColumnFlowThread* flow_thread = multicol->MultiColumnFlowThread(); | 91 LayoutMultiColumnFlowThread* flow_thread = multicol->MultiColumnFlowThread(); |
92 if (!flow_thread) | 92 if (!flow_thread) |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 | 387 |
388 // Save static position for legacy AbsPos layout. | 388 // Save static position for legacy AbsPos layout. |
389 void NGBlockNode::SaveStaticOffsetForLegacy(const NGLogicalOffset& offset) { | 389 void NGBlockNode::SaveStaticOffsetForLegacy(const NGLogicalOffset& offset) { |
390 DCHECK(layout_box_->IsOutOfFlowPositioned()); | 390 DCHECK(layout_box_->IsOutOfFlowPositioned()); |
391 DCHECK(layout_box_->Layer()); | 391 DCHECK(layout_box_->Layer()); |
392 layout_box_->Layer()->SetStaticBlockPosition(offset.block_offset); | 392 layout_box_->Layer()->SetStaticBlockPosition(offset.block_offset); |
393 layout_box_->Layer()->SetStaticInlinePosition(offset.inline_offset); | 393 layout_box_->Layer()->SetStaticInlinePosition(offset.inline_offset); |
394 } | 394 } |
395 | 395 |
396 } // namespace blink | 396 } // namespace blink |
OLD | NEW |