MinContent, MaxContent, FillAvailable, FitContent,
Calculated,
ExtendToZoom, DeviceWidth, DeviceHeight,
- Undefined
+ MaxSizeNone
};
enum ValueRange {
decrementCalculatedRef();
}
- bool operator==(const Length& o) const { return (m_type == o.m_type) && (m_quirk == o.m_quirk) && (isUndefined() || (getFloatValue() == o.getFloatValue()) || isCalculatedEqual(o)); }
+ bool operator==(const Length& o) const { return (m_type == o.m_type) && (m_quirk == o.m_quirk) && (isMaxSizeNone() || (getFloatValue() == o.getFloatValue()) || isCalculatedEqual(o)); }
bool operator!=(const Length& o) const { return !(*this == o); }
const Length& operator*=(float v)
*this = Length(value, Fixed);
}
- bool isUndefined() const { return type() == Undefined; }
+ bool isMaxSizeNone() const { return type() == MaxSizeNone; }
// FIXME calc: https://bugs.webkit.org/show_bug.cgi?id=80357. A calculated Length
// always contains a percentage, and without a maxValue passed to these functions
// are positive and non-zero for now.
bool isZero() const
{
- ASSERT(!isUndefined());
+ ASSERT(!isMaxSizeNone());
if (isCalculated())
return false;
}
bool isPositive() const
{
- if (isUndefined())
+ if (isMaxSizeNone())
return false;
if (isCalculated())
return true;
}
bool isNegative() const
{
- if (isUndefined() || isCalculated())
+ if (isMaxSizeNone() || isCalculated())
return false;
return getFloatValue() < 0;
float getFloatValue() const
{
- ASSERT(!isUndefined());
+ ASSERT(!isMaxSizeNone());
return m_isFloat ? m_floatValue : m_intValue;
}
float nonNanCalculatedValue(int maxValue) const;
private:
int getIntValue() const
{
- ASSERT(!isUndefined());
+ ASSERT(!isMaxSizeNone());
return m_isFloat ? static_cast<int>(m_floatValue) : m_intValue;
}