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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc

Issue 2616613003: Fix calculation of abspos style properties: left/padding/width/height... (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc b/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc
index ec503ba1aac09d3ee709fe80fd0bf0eacffdcb5e..818f7a353d24fe403b7ca733b8b0fdd1f1efa74b 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc
@@ -9,6 +9,7 @@
#include "core/layout/ng/ng_constraint_space_builder.h"
#include "core/layout/ng/ng_fragment_base.h"
#include "core/layout/ng/ng_length_utils.h"
+#include "core/layout/ng/ng_physical_fragment.h"
#include "core/style/ComputedStyle.h"
namespace blink {
@@ -34,6 +35,7 @@ NGOutOfFlowLayoutPart::NGOutOfFlowLayoutPart(
NGConstraintSpaceBuilder space_builder(
FromPlatformWritingMode(container_style->getWritingMode()));
space_builder.SetAvailableSize(space_size);
+ space_builder.SetPercentageResolutionSize(space_size);
space_builder.SetIsNewFormattingContext(true);
space_builder.SetTextDirection(container_style->direction());
parent_space_ = space_builder.ToConstraintSpace();
@@ -107,8 +109,7 @@ bool NGOutOfFlowLayoutPart::ComputeInlineSizeEstimate() {
if (AbsoluteNeedsChildInlineSize(*node_->Style())) {
MinAndMaxContentSizes size;
if (node_->ComputeMinAndMaxContentSizes(&size)) {
- inline_estimate_ =
- size.ShrinkToFit(parent_space_->AvailableSize().inline_size);
+ inline_estimate_ = size;
return true;
}
return false;
@@ -145,7 +146,7 @@ bool NGOutOfFlowLayoutPart::ComputeNodeFragment() {
if (block_estimate_)
available_size.block_size = *block_estimate_;
builder.SetAvailableSize(available_size);
- builder.SetPercentageResolutionSize(available_size);
+ builder.SetPercentageResolutionSize(parent_space_->AvailableSize());
if (block_estimate_)
builder.SetIsFixedSizeBlock(true);
builder.SetIsFixedSizeInline(true);

Powered by Google App Engine
This is Rietveld 408576698