| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 ToNGPhysicalBoxFragment(positioned_float.fragment.Get()); | 71 ToNGPhysicalBoxFragment(positioned_float.fragment.Get()); |
| 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(positioned_float.left_offset); | 81 floating_object->SetX(positioned_float.paint_offset.left); |
| 82 floating_object->SetY(box_fragment->TopOffset()); | 82 floating_object->SetY(positioned_float.paint_offset.top); |
| 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 | 371 |
| 372 // Save static position for legacy AbsPos layout. | 372 // Save static position for legacy AbsPos layout. |
| 373 void NGBlockNode::SaveStaticOffsetForLegacy(const NGLogicalOffset& offset) { | 373 void NGBlockNode::SaveStaticOffsetForLegacy(const NGLogicalOffset& offset) { |
| 374 DCHECK(layout_box_->IsOutOfFlowPositioned()); | 374 DCHECK(layout_box_->IsOutOfFlowPositioned()); |
| 375 DCHECK(layout_box_->Layer()); | 375 DCHECK(layout_box_->Layer()); |
| 376 layout_box_->Layer()->SetStaticBlockPosition(offset.block_offset); | 376 layout_box_->Layer()->SetStaticBlockPosition(offset.block_offset); |
| 377 layout_box_->Layer()->SetStaticInlinePosition(offset.inline_offset); | 377 layout_box_->Layer()->SetStaticInlinePosition(offset.inline_offset); |
| 378 } | 378 } |
| 379 | 379 |
| 380 } // namespace blink | 380 } // namespace blink |
| OLD | NEW |