#include "wtf/Vector.h"
#include <cstring>
-namespace WebCore {
+namespace blink {
// FIXME: This enum makes it hard to tell in general what values may be
// appropriate for any given Length.
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;
if (isZero())
resultType = from.type();
- float blendedValue = WebCore::blend(from.value(), value(), progress);
+ float blendedValue = blink::blend(from.value(), value(), progress);
if (range == ValueRangeNonNegative)
blendedValue = clampTo<float>(blendedValue, 0);
return Length(blendedValue, resultType);
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;
}
PLATFORM_EXPORT Vector<Length> parseHTMLAreaElementCoords(const String&);
-} // namespace WebCore
+} // namespace blink
#endif // Length_h