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

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

Issue 2462413002: Reland of Use NGLogicalRect instead of NGExclusion for exclusions. (Closed)
Patch Set: Created 4 years, 1 month 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
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_constraint_space.h" 5 #include "core/layout/ng/ng_constraint_space.h"
6 6
7 #include "core/layout/LayoutBlock.h" 7 #include "core/layout/LayoutBlock.h"
8 #include "core/layout/LayoutView.h" 8 #include "core/layout/LayoutView.h"
9 #include "core/layout/ng/ng_constraint_space.h" 9 #include "core/layout/ng/ng_constraint_space.h"
10 #include "core/layout/ng/ng_constraint_space_builder.h" 10 #include "core/layout/ng/ng_constraint_space_builder.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 .SetIsFixedSizeInline(fixed_inline) 63 .SetIsFixedSizeInline(fixed_inline)
64 .SetIsFixedSizeBlock(fixed_block) 64 .SetIsFixedSizeBlock(fixed_block)
65 .SetIsNewFormattingContext(is_new_fc); 65 .SetIsNewFormattingContext(is_new_fc);
66 66
67 return new NGConstraintSpace( 67 return new NGConstraintSpace(
68 FromPlatformWritingMode(box.styleRef().getWritingMode()), 68 FromPlatformWritingMode(box.styleRef().getWritingMode()),
69 FromPlatformDirection(box.styleRef().direction()), 69 FromPlatformDirection(box.styleRef().direction()),
70 builder.ToConstraintSpace()); 70 builder.ToConstraintSpace());
71 } 71 }
72 72
73 void NGConstraintSpace::AddExclusion(const NGExclusion* exclusion) const { 73 void NGConstraintSpace::AddExclusion(const NGLogicalRect& exclusion) const {
74 WRITING_MODE_IGNORED(
75 "Exclusions are stored directly in physical constraint space.");
74 MutablePhysicalSpace()->AddExclusion(exclusion); 76 MutablePhysicalSpace()->AddExclusion(exclusion);
75 } 77 }
76 78
77 NGLogicalSize NGConstraintSpace::ContainerSize() const { 79 NGLogicalSize NGConstraintSpace::ContainerSize() const {
78 return physical_space_->container_size_.ConvertToLogical( 80 return physical_space_->container_size_.ConvertToLogical(
79 static_cast<NGWritingMode>(writing_mode_)); 81 static_cast<NGWritingMode>(writing_mode_));
80 } 82 }
81 83
82 void NGConstraintSpace::SetSize(NGLogicalSize size) { 84 void NGConstraintSpace::SetSize(NGLogicalSize size) {
83 size_ = size; 85 size_ = size;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 170
169 String NGConstraintSpace::ToString() const { 171 String NGConstraintSpace::ToString() const {
170 return String::format("%s,%s %sx%s", 172 return String::format("%s,%s %sx%s",
171 offset_.inline_offset.toString().ascii().data(), 173 offset_.inline_offset.toString().ascii().data(),
172 offset_.block_offset.toString().ascii().data(), 174 offset_.block_offset.toString().ascii().data(),
173 size_.inline_size.toString().ascii().data(), 175 size_.inline_size.toString().ascii().data(),
174 size_.block_size.toString().ascii().data()); 176 size_.block_size.toString().ascii().data());
175 } 177 }
176 178
177 } // namespace blink 179 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698