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

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

Issue 2286543002: Add Length::isPercent and use it in tables. (Closed)
Patch Set: rebase Created 4 years, 3 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 bool isIntrinsicOrAuto() const { return type() == Auto || isIntrinsic(); } 255 bool isIntrinsicOrAuto() const { return type() == Auto || isIntrinsic(); }
256 bool isIntrinsic() const { return type() == MinContent || type() == MaxConte nt || type() == FillAvailable || type() == FitContent; } 256 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; } 257 bool isSpecified() const { return type() == Fixed || type() == Percent || ty pe() == Calculated; }
258 bool isSpecifiedOrIntrinsic() const { return isSpecified() || isIntrinsic(); } 258 bool isSpecifiedOrIntrinsic() const { return isSpecified() || isIntrinsic(); }
259 bool isCalculated() const { return type() == Calculated; } 259 bool isCalculated() const { return type() == Calculated; }
260 bool isCalculatedEqual(const Length&) const; 260 bool isCalculatedEqual(const Length&) const;
261 bool isMinContent() const { return type() == MinContent; } 261 bool isMinContent() const { return type() == MinContent; }
262 bool isMaxContent() const { return type() == MaxContent; } 262 bool isMaxContent() const { return type() == MaxContent; }
263 bool isFillAvailable() const { return type() == FillAvailable; } 263 bool isFillAvailable() const { return type() == FillAvailable; }
264 bool isFitContent() const { return type() == FitContent; } 264 bool isFitContent() const { return type() == FitContent; }
265 bool hasPercent() const { return type() == Percent || type() == Calculated; } 265 bool isPercent() const { return type() == Percent; }
266 bool isPercentOrCalc() const { return type() == Percent || type() == Calcula ted; }
266 267
267 Length blend(const Length& from, double progress, ValueRange range) const 268 Length blend(const Length& from, double progress, ValueRange range) const
268 { 269 {
269 ASSERT(isSpecified() && from.isSpecified()); 270 ASSERT(isSpecified() && from.isSpecified());
270 271
271 if (progress == 0.0) 272 if (progress == 0.0)
272 return from; 273 return from;
273 274
274 if (progress == 1.0) 275 if (progress == 1.0)
275 return *this; 276 return *this;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 float m_floatValue; 327 float m_floatValue;
327 }; 328 };
328 bool m_quirk; 329 bool m_quirk;
329 unsigned char m_type; 330 unsigned char m_type;
330 bool m_isFloat; 331 bool m_isFloat;
331 }; 332 };
332 333
333 } // namespace blink 334 } // namespace blink
334 335
335 #endif // Length_h 336 #endif // Length_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698