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

Side by Side Diff: third_party/WebKit/Source/platform/Length.h

Issue 2312293003: [CSSTypedOM] Computed StylePropertyMap use ComputedStyle for Lengths (Closed)
Patch Set: remove unneeded braces Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 3 Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
4 Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com) 4 Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com)
5 Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 5 Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 bool isNegative() const 245 bool isNegative() const
246 { 246 {
247 if (isMaxSizeNone() || isCalculated()) 247 if (isMaxSizeNone() || isCalculated())
248 return false; 248 return false;
249 249
250 return getFloatValue() < 0; 250 return getFloatValue() < 0;
251 } 251 }
252 252
253 bool isAuto() const { return type() == Auto; } 253 bool isAuto() const { return type() == Auto; }
254 bool isFixed() const { return type() == Fixed; } 254 bool isFixed() const { return type() == Fixed; }
255 bool isPercent() const { return type() == Percent; }
255 bool isIntrinsicOrAuto() const { return type() == Auto || isIntrinsic(); } 256 bool isIntrinsicOrAuto() const { return type() == Auto || isIntrinsic(); }
256 bool isIntrinsic() const { return type() == MinContent || type() == MaxConte nt || type() == FillAvailable || type() == FitContent; } 257 bool isIntrinsic() const { return type() == MinContent || type() == MaxConte nt || type() == FillAvailable || type() == FitContent; }
257 bool isSpecified() const { return type() == Fixed || type() == Percent || ty pe() == Calculated; } 258 bool isSpecified() const { return type() == Fixed || type() == Percent || ty pe() == Calculated; }
258 bool isSpecifiedOrIntrinsic() const { return isSpecified() || isIntrinsic(); } 259 bool isSpecifiedOrIntrinsic() const { return isSpecified() || isIntrinsic(); }
259 bool isCalculated() const { return type() == Calculated; } 260 bool isCalculated() const { return type() == Calculated; }
260 bool isCalculatedEqual(const Length&) const; 261 bool isCalculatedEqual(const Length&) const;
261 bool isMinContent() const { return type() == MinContent; } 262 bool isMinContent() const { return type() == MinContent; }
262 bool isMaxContent() const { return type() == MaxContent; } 263 bool isMaxContent() const { return type() == MaxContent; }
263 bool isFillAvailable() const { return type() == FillAvailable; } 264 bool isFillAvailable() const { return type() == FillAvailable; }
264 bool isFitContent() const { return type() == FitContent; } 265 bool isFitContent() const { return type() == FitContent; }
265 bool isPercent() const { return type() == Percent; }
266 bool isPercentOrCalc() const { return type() == Percent || type() == Calcula ted; } 266 bool isPercentOrCalc() const { return type() == Percent || type() == Calcula ted; }
267 267
268 Length blend(const Length& from, double progress, ValueRange range) const 268 Length blend(const Length& from, double progress, ValueRange range) const
269 { 269 {
270 ASSERT(isSpecified() && from.isSpecified()); 270 ASSERT(isSpecified() && from.isSpecified());
271 271
272 if (progress == 0.0) 272 if (progress == 0.0)
273 return from; 273 return from;
274 274
275 if (progress == 1.0) 275 if (progress == 1.0)
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 float m_floatValue; 327 float m_floatValue;
328 }; 328 };
329 bool m_quirk; 329 bool m_quirk;
330 unsigned char m_type; 330 unsigned char m_type;
331 bool m_isFloat; 331 bool m_isFloat;
332 }; 332 };
333 333
334 } // namespace blink 334 } // namespace blink
335 335
336 #endif // Length_h 336 #endif // Length_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698