Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Unified Diff: Source/WebCore/platform/Length.h

Issue 10447005: Merge 116914 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/platform/CalculationValue.h ('k') | Source/WebCore/platform/Length.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/Length.h
===================================================================
--- Source/WebCore/platform/Length.h (revision 118280)
+++ Source/WebCore/platform/Length.h (working copy)
@@ -49,21 +49,25 @@
Length(LengthType t)
: m_intValue(0), m_quirk(false), m_type(t), m_isFloat(false)
{
+ ASSERT(t != Calculated);
}
Length(int v, LengthType t, bool q = false)
: m_intValue(v), m_quirk(q), m_type(t), m_isFloat(false)
{
+ ASSERT(t != Calculated);
}
Length(FractionalLayoutUnit v, LengthType t, bool q = false)
: m_floatValue(v.toFloat()), m_quirk(q), m_type(t), m_isFloat(true)
{
+ ASSERT(t != Calculated);
}
Length(float v, LengthType t, bool q = false)
- : m_floatValue(v), m_quirk(q), m_type(t), m_isFloat(true)
+ : m_floatValue(v), m_quirk(q), m_type(t), m_isFloat(true)
{
+ ASSERT(t != Calculated);
}
Length(double v, LengthType t, bool q = false)
@@ -91,7 +95,7 @@
decrementCalculatedRef();
}
- bool operator==(const Length& o) const { return (m_type == o.m_type) && (m_quirk == o.m_quirk) && (isUndefined() || (getFloatValue() == o.getFloatValue())); }
+ 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 !(*this == o); }
const Length& operator*=(float v)
@@ -212,6 +216,7 @@
bool isIntrinsicOrAuto() const { return type() == Auto || type() == MinIntrinsic || type() == Intrinsic; }
bool isSpecified() const { return type() == Fixed || type() == Percent || type() == Calculated || isViewportPercentage(); }
bool isCalculated() const { return type() == Calculated; }
+ bool isCalculatedEqual(const Length&) const;
Length blend(const Length& from, double progress) const
{
@@ -221,6 +226,10 @@
if (from.isZero() && isZero())
return *this;
+
+ // FIXME http://webkit.org/b/86160 - Blending doesn't work with calculated expressions
+ if (type() == Calculated)
+ return *this;
LengthType resultType = type();
if (isZero())
« no previous file with comments | « Source/WebCore/platform/CalculationValue.h ('k') | Source/WebCore/platform/Length.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698