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

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/ng_block_node.cc

Issue 2880993004: [LayoutNG] Fixes small crash inside preferred widths. (Closed)
Patch Set: ng-bot2 Created 3 years, 6 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
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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();
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,
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698