Back out "Modify private apis to set, store, and get intrinsic sizing keywords" (#1750)
Summary: X-link: https://github.com/facebook/react-native/pull/47895 Pull Request resolved: https://github.com/facebook/yoga/pull/1750 These APIs were only added so that we could do TDD as we work on intrinsic sizing functionality. As of right now they do nothing. We are aiming on publishing a new version of Yoga soon so for the time being we are going to back these out so as not to confuse anyone with this new functionality. Ideally we get to a point where we have some temporary experimental header to stage these in but this is a bit time sensitive so just backing out for now Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D66332307 fbshipit-source-id: 1d596964e0c893091c541988506e8b80fa6d1957
This commit is contained in:
committed by
Facebook GitHub Bot
parent
0c995496c8
commit
be00354b71
@@ -19,11 +19,13 @@ namespace facebook::yoga {
|
||||
* 3. A CSS <length-percentage> value:
|
||||
* a. <length> value (e.g. 10px)
|
||||
* b. <percentage> value of a reference <length>
|
||||
* 4. (soon) A math function which returns a <length-percentage> value
|
||||
*
|
||||
* References:
|
||||
* 1. https://www.w3.org/TR/css-values-4/#lengths
|
||||
* 2. https://www.w3.org/TR/css-values-4/#percentage-value
|
||||
* 3. https://www.w3.org/TR/css-values-4/#mixed-percentages
|
||||
* 4. https://www.w3.org/TR/css-values-4/#math
|
||||
*/
|
||||
class StyleLength {
|
||||
public:
|
||||
@@ -57,14 +59,6 @@ class StyleLength {
|
||||
return unit_ == Unit::Undefined;
|
||||
}
|
||||
|
||||
constexpr bool isPoints() const {
|
||||
return unit_ == Unit::Point;
|
||||
}
|
||||
|
||||
constexpr bool isPercent() const {
|
||||
return unit_ == Unit::Percent;
|
||||
}
|
||||
|
||||
constexpr bool isDefined() const {
|
||||
return !isUndefined();
|
||||
}
|
||||
@@ -73,6 +67,10 @@ class StyleLength {
|
||||
return value_;
|
||||
}
|
||||
|
||||
constexpr Unit unit() const {
|
||||
return unit_;
|
||||
}
|
||||
|
||||
constexpr FloatOptional resolve(float referenceLength) {
|
||||
switch (unit_) {
|
||||
case Unit::Point:
|
||||
@@ -92,11 +90,6 @@ class StyleLength {
|
||||
return value_ == rhs.value_ && unit_ == rhs.unit_;
|
||||
}
|
||||
|
||||
constexpr bool inexactEquals(const StyleLength& other) const {
|
||||
return unit_ == other.unit_ &&
|
||||
facebook::yoga::inexactEquals(value_, other.value_);
|
||||
}
|
||||
|
||||
private:
|
||||
// We intentionally do not allow direct construction using value and unit, to
|
||||
// avoid invalid, or redundant combinations.
|
||||
@@ -108,7 +101,7 @@ class StyleLength {
|
||||
};
|
||||
|
||||
inline bool inexactEquals(const StyleLength& a, const StyleLength& b) {
|
||||
return a.inexactEquals(b);
|
||||
return a.unit() == b.unit() && inexactEquals(a.value(), b.value());
|
||||
}
|
||||
|
||||
} // namespace facebook::yoga
|
||||
|
Reference in New Issue
Block a user