summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h')
-rw-r--r--chromium/third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h42
1 files changed, 25 insertions, 17 deletions
diff --git a/chromium/third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h b/chromium/third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h
index c77e16c4310..45acfcb0f7c 100644
--- a/chromium/third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h
+++ b/chromium/third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h
@@ -11,7 +11,7 @@
#include "third_party/blink/renderer/core/layout/geometry/logical_size.h"
#include "third_party/blink/renderer/core/layout/layout_box.h"
#include "third_party/blink/renderer/core/layout/ng/layout_box_utils.h"
-#include "third_party/blink/renderer/core/layout/ng/list/layout_ng_list_marker.h"
+#include "third_party/blink/renderer/core/layout/ng/list/layout_ng_outside_list_marker.h"
#include "third_party/blink/renderer/platform/geometry/layout_unit.h"
#include "third_party/blink/renderer/platform/text/writing_mode.h"
@@ -24,16 +24,13 @@ class LayoutObject;
class LayoutBox;
class NGConstraintSpace;
class NGPaintFragment;
-struct MinMaxSize;
-struct LogicalSize;
+struct MinMaxSizes;
struct PhysicalSize;
-enum class NGMinMaxSizeType { kContentBoxSize, kBorderBoxSize };
-
// Input to the min/max inline size calculation algorithm for child nodes. Child
// nodes within the same formatting context need to know which floats are beside
// them.
-struct MinMaxSizeInput {
+struct MinMaxSizesInput {
// The min-max size calculation (un-intuitively) requires a percentage
// resolution size!
// This occurs when a replaced element has an intrinsic size. E.g.
@@ -44,14 +41,11 @@ struct MinMaxSizeInput {
//
// As we don't perform any tree walking, we need to pass the percentage
// resolution block-size for min/max down the min/max size calculation.
- explicit MinMaxSizeInput(LayoutUnit percentage_resolution_block_size)
+ explicit MinMaxSizesInput(LayoutUnit percentage_resolution_block_size)
: percentage_resolution_block_size(percentage_resolution_block_size) {}
LayoutUnit float_left_inline_size;
LayoutUnit float_right_inline_size;
LayoutUnit percentage_resolution_block_size;
-
- // Whether to return the size as a content-box size or border-box size.
- NGMinMaxSizeType size_type = NGMinMaxSizeType::kBorderBoxSize;
};
// Represents the input to a layout algorithm for a given node. The layout
@@ -108,11 +102,11 @@ class CORE_EXPORT NGLayoutInputNode {
}
bool IsListItem() const { return IsBlock() && box_->IsLayoutNGListItem(); }
bool IsListMarker() const {
- return IsBlock() && box_->IsLayoutNGListMarker();
+ return IsBlock() && box_->IsLayoutNGOutsideListMarker();
}
bool ListMarkerOccupiesWholeLine() const {
DCHECK(IsListMarker());
- return ToLayoutNGListMarker(box_)->NeedsOccupyWholeLine();
+ return ToLayoutNGOutsideListMarker(box_)->NeedsOccupyWholeLine();
}
bool IsFieldsetContainer() const {
return IsBlock() && box_->IsLayoutNGFieldset();
@@ -123,6 +117,9 @@ class CORE_EXPORT NGLayoutInputNode {
bool IsRenderedLegend() const {
return IsBlock() && box_->IsRenderedLegend();
}
+ bool IsTable() const { return IsBlock() && box_->IsTable(); }
+
+ bool IsMathRoot() const { return box_->IsMathMLRoot(); }
bool IsAnonymousBlock() const { return box_->IsAnonymousBlock(); }
@@ -159,16 +156,16 @@ class CORE_EXPORT NGLayoutInputNode {
}
// Returns border box.
- MinMaxSize ComputeMinMaxSize(WritingMode,
- const MinMaxSizeInput&,
- const NGConstraintSpace* = nullptr);
+ MinMaxSizes ComputeMinMaxSizes(WritingMode,
+ const MinMaxSizesInput&,
+ const NGConstraintSpace* = nullptr);
// Returns intrinsic sizing information for replaced elements.
// ComputeReplacedSize can use it to compute actual replaced size.
// Corresponds to Legacy's LayoutReplaced::IntrinsicSizingInfo.
+ // Use NGBlockNode::GetAspectRatio to get the aspect ratio.
void IntrinsicSize(base::Optional<LayoutUnit>* computed_inline_size,
- base::Optional<LayoutUnit>* computed_block_size,
- LogicalSize* aspect_ratio) const;
+ base::Optional<LayoutUnit>* computed_block_size) const;
// Returns the next sibling.
NGLayoutInputNode NextSibling();
@@ -201,6 +198,13 @@ class CORE_EXPORT NGLayoutInputNode {
return kIndefiniteSize;
}
+ LayoutUnit DefaultIntrinsicContentInlineSize() const {
+ return box_->DefaultIntrinsicContentInlineSize();
+ }
+ LayoutUnit DefaultIntrinsicContentBlockSize() const {
+ return box_->DefaultIntrinsicContentBlockSize();
+ }
+
// Display locking functionality.
const DisplayLockContext& GetDisplayLockContext() const {
DCHECK(box_->GetDisplayLockContext());
@@ -240,6 +244,10 @@ class CORE_EXPORT NGLayoutInputNode {
NGLayoutInputNode(LayoutBox* box, NGLayoutInputNodeType type)
: box_(box), type_(type) {}
+ void GetOverrideIntrinsicSize(
+ base::Optional<LayoutUnit>* computed_inline_size,
+ base::Optional<LayoutUnit>* computed_block_size) const;
+
LayoutBox* box_;
unsigned type_ : 1; // NGLayoutInputNodeType