diff --git a/ReactCommon/fabric/components/slider/SliderShadowNode.cpp b/ReactCommon/fabric/components/slider/SliderShadowNode.cpp index 488fe566783..38929b89cfc 100644 --- a/ReactCommon/fabric/components/slider/SliderShadowNode.cpp +++ b/ReactCommon/fabric/components/slider/SliderShadowNode.cpp @@ -83,7 +83,9 @@ ImageSource SliderShadowNode::getThumbImageSource() const { #pragma mark - LayoutableShadowNode -Size SliderShadowNode::measure(LayoutConstraints layoutConstraints) const { +Size SliderShadowNode::measureContent( + LayoutContext const &layoutContext, + LayoutConstraints const &layoutConstraints) const { if (SliderMeasurementsManager::shouldMeasureSlider()) { return measurementsManager_->measure(getSurfaceId(), layoutConstraints); } diff --git a/ReactCommon/fabric/components/slider/SliderShadowNode.h b/ReactCommon/fabric/components/slider/SliderShadowNode.h index 958f3b2aafb..53ed30d82d0 100644 --- a/ReactCommon/fabric/components/slider/SliderShadowNode.h +++ b/ReactCommon/fabric/components/slider/SliderShadowNode.h @@ -55,7 +55,9 @@ class SliderShadowNode final : public ConcreteViewShadowNode< #pragma mark - LayoutableShadowNode - Size measure(LayoutConstraints layoutConstraints) const override; + Size measureContent( + LayoutContext const &layoutContext, + LayoutConstraints const &layoutConstraints) const override; void layout(LayoutContext layoutContext) override; private: diff --git a/ReactCommon/fabric/components/switch/androidswitch/AndroidSwitchShadowNode.cpp b/ReactCommon/fabric/components/switch/androidswitch/AndroidSwitchShadowNode.cpp index b717418afd6..53667c313a3 100644 --- a/ReactCommon/fabric/components/switch/androidswitch/AndroidSwitchShadowNode.cpp +++ b/ReactCommon/fabric/components/switch/androidswitch/AndroidSwitchShadowNode.cpp @@ -21,8 +21,9 @@ void AndroidSwitchShadowNode::setAndroidSwitchMeasurementsManager( #pragma mark - LayoutableShadowNode -Size AndroidSwitchShadowNode::measure( - LayoutConstraints layoutConstraints) const { +Size AndroidSwitchShadowNode::measureContent( + LayoutContext const &layoutContext, + LayoutConstraints const &layoutConstraints) const { return measurementsManager_->measure(getSurfaceId(), layoutConstraints); } diff --git a/ReactCommon/fabric/components/switch/androidswitch/AndroidSwitchShadowNode.h b/ReactCommon/fabric/components/switch/androidswitch/AndroidSwitchShadowNode.h index 66df81a2a49..e65ce7caabf 100644 --- a/ReactCommon/fabric/components/switch/androidswitch/AndroidSwitchShadowNode.h +++ b/ReactCommon/fabric/components/switch/androidswitch/AndroidSwitchShadowNode.h @@ -35,7 +35,9 @@ class AndroidSwitchShadowNode final : public ConcreteViewShadowNode< #pragma mark - LayoutableShadowNode - Size measure(LayoutConstraints layoutConstraints) const override; + Size measureContent( + LayoutContext const &layoutContext, + LayoutConstraints const &layoutConstraints) const override; private: std::shared_ptr measurementsManager_; diff --git a/ReactCommon/fabric/components/text/paragraph/ParagraphShadowNode.cpp b/ReactCommon/fabric/components/text/paragraph/ParagraphShadowNode.cpp index 3ead9c9a4bf..8319b3eb2a5 100644 --- a/ReactCommon/fabric/components/text/paragraph/ParagraphShadowNode.cpp +++ b/ReactCommon/fabric/components/text/paragraph/ParagraphShadowNode.cpp @@ -116,9 +116,11 @@ void ParagraphShadowNode::updateStateIfNeeded(Content const &content) { #pragma mark - LayoutableShadowNode -Size ParagraphShadowNode::measure(LayoutConstraints layoutConstraints) const { +Size ParagraphShadowNode::measureContent( + LayoutContext const &layoutContext, + LayoutConstraints const &layoutConstraints) const { auto content = - getContentWithMeasuredAttachments(LayoutContext{}, layoutConstraints); + getContentWithMeasuredAttachments(layoutContext, layoutConstraints); auto attributedString = content.attributedString; if (attributedString.isEmpty()) { diff --git a/ReactCommon/fabric/components/text/paragraph/ParagraphShadowNode.h b/ReactCommon/fabric/components/text/paragraph/ParagraphShadowNode.h index cd7591149d7..ac5799b3516 100644 --- a/ReactCommon/fabric/components/text/paragraph/ParagraphShadowNode.h +++ b/ReactCommon/fabric/components/text/paragraph/ParagraphShadowNode.h @@ -62,7 +62,9 @@ class ParagraphShadowNode : public ConcreteViewShadowNode< #pragma mark - LayoutableShadowNode void layout(LayoutContext layoutContext) override; - Size measure(LayoutConstraints layoutConstraints) const override; + Size measureContent( + LayoutContext const &layoutContext, + LayoutConstraints const &layoutConstraints) const override; /* * Internal representation of the nested content of the node in a format diff --git a/ReactCommon/fabric/components/textinput/androidtextinput/AndroidTextInputShadowNode.cpp b/ReactCommon/fabric/components/textinput/androidtextinput/AndroidTextInputShadowNode.cpp index 1349f3f4e88..dadeb8977b2 100644 --- a/ReactCommon/fabric/components/textinput/androidtextinput/AndroidTextInputShadowNode.cpp +++ b/ReactCommon/fabric/components/textinput/androidtextinput/AndroidTextInputShadowNode.cpp @@ -165,8 +165,9 @@ void AndroidTextInputShadowNode::updateStateIfNeeded() { #pragma mark - LayoutableShadowNode -Size AndroidTextInputShadowNode::measure( - LayoutConstraints layoutConstraints) const { +Size AndroidTextInputShadowNode::measureContent( + LayoutContext const &layoutContext, + LayoutConstraints const &layoutConstraints) const { // Layout is called right after measure. // Measure is marked as `const`, and `layout` is not; so State can be updated // during layout, but not during `measure`. If State is out-of-date in layout, diff --git a/ReactCommon/fabric/components/textinput/androidtextinput/AndroidTextInputShadowNode.h b/ReactCommon/fabric/components/textinput/androidtextinput/AndroidTextInputShadowNode.h index be480cc8a13..45714febee6 100644 --- a/ReactCommon/fabric/components/textinput/androidtextinput/AndroidTextInputShadowNode.h +++ b/ReactCommon/fabric/components/textinput/androidtextinput/AndroidTextInputShadowNode.h @@ -56,7 +56,9 @@ class AndroidTextInputShadowNode : public ConcreteViewShadowNode< #pragma mark - LayoutableShadowNode - Size measure(LayoutConstraints layoutConstraints) const override; + Size measureContent( + LayoutContext const &layoutContext, + LayoutConstraints const &layoutConstraints) const override; void layout(LayoutContext layoutContext) override; private: diff --git a/ReactCommon/fabric/components/textinput/iostextinput/TextInputShadowNode.cpp b/ReactCommon/fabric/components/textinput/iostextinput/TextInputShadowNode.cpp index fd70e306d73..a2c89d73d50 100644 --- a/ReactCommon/fabric/components/textinput/iostextinput/TextInputShadowNode.cpp +++ b/ReactCommon/fabric/components/textinput/iostextinput/TextInputShadowNode.cpp @@ -97,7 +97,9 @@ void TextInputShadowNode::updateStateIfNeeded() { #pragma mark - LayoutableShadowNode -Size TextInputShadowNode::measure(LayoutConstraints layoutConstraints) const { +Size TextInputShadowNode::measureContent( + LayoutContext const &layoutContext, + LayoutConstraints const &layoutConstraints) const { return textLayoutManager_ ->measure( attributedStringBoxToMeasure(), diff --git a/ReactCommon/fabric/components/textinput/iostextinput/TextInputShadowNode.h b/ReactCommon/fabric/components/textinput/iostextinput/TextInputShadowNode.h index cfa7849ac7b..c1368dba60e 100644 --- a/ReactCommon/fabric/components/textinput/iostextinput/TextInputShadowNode.h +++ b/ReactCommon/fabric/components/textinput/iostextinput/TextInputShadowNode.h @@ -54,7 +54,9 @@ class TextInputShadowNode : public ConcreteViewShadowNode< #pragma mark - LayoutableShadowNode - Size measure(LayoutConstraints layoutConstraints) const override; + Size measureContent( + LayoutContext const &layoutContext, + LayoutConstraints const &layoutConstraints) const override; void layout(LayoutContext layoutContext) override; private: diff --git a/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp b/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp index 1a9982b2cf5..6c36e7e096c 100644 --- a/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp +++ b/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp @@ -442,7 +442,8 @@ YGSize YogaLayoutableShadowNode::yogaNodeMeasureCallbackConnector( break; } - auto size = shadowNodeRawPtr->measure({minimumSize, maximumSize}); + auto size = shadowNodeRawPtr->measureContent( + LayoutContext{}, {minimumSize, maximumSize}); return YGSize{yogaFloatFromFloat(size.width), yogaFloatFromFloat(size.height)}; diff --git a/ReactCommon/fabric/core/layout/LayoutableShadowNode.cpp b/ReactCommon/fabric/core/layout/LayoutableShadowNode.cpp index c6f391eccef..203fe8a2bb4 100644 --- a/ReactCommon/fabric/core/layout/LayoutableShadowNode.cpp +++ b/ReactCommon/fabric/core/layout/LayoutableShadowNode.cpp @@ -168,7 +168,9 @@ LayoutableShadowNode::getLayoutableChildNodes() const { return layoutableChildren; } -Size LayoutableShadowNode::measure(LayoutConstraints layoutConstraints) const { +Size LayoutableShadowNode::measureContent( + LayoutContext const &layoutContext, + LayoutConstraints const &layoutConstraints) const { return Size(); } diff --git a/ReactCommon/fabric/core/layout/LayoutableShadowNode.h b/ReactCommon/fabric/core/layout/LayoutableShadowNode.h index d94566390c4..ed9c115dc52 100644 --- a/ReactCommon/fabric/core/layout/LayoutableShadowNode.h +++ b/ReactCommon/fabric/core/layout/LayoutableShadowNode.h @@ -76,7 +76,9 @@ class LayoutableShadowNode : public ShadowNode { * given constrains and relying on possible layout. * Default implementation returns zero size. */ - virtual Size measure(LayoutConstraints layoutConstraints) const; + virtual Size measureContent( + LayoutContext const &layoutContext, + LayoutConstraints const &layoutConstraints) const; /* * Measures the node with given `layoutContext` and `layoutConstraints`.