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

Side by Side Diff: Source/platform/LengthOrNumber.h

Issue 55813002: Convert animation and renderer code to know about BorderImageLength (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@length-relative-die-step-1-4
Patch Set: Created 7 years, 1 month 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) 2013, Opera Software ASA. All rights reserved. 2 Copyright (c) 2013, Opera Software ASA. All rights reserved.
3 3
4 This library is free software; you can redistribute it and/or 4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public 5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either 6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version. 7 version 2 of the License, or (at your option) any later version.
8 8
9 This library is distributed in the hope that it will be useful, 9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 42
43 bool isNumber() const { return m_length.isRelative(); } 43 bool isNumber() const { return m_length.isRelative(); }
44 bool isLength() const { return !isNumber(); } 44 bool isLength() const { return !isNumber(); }
45 45
46 const Length& length() const { ASSERT(isLength()); return m_length; } 46 const Length& length() const { ASSERT(isLength()); return m_length; }
47 Length& length() { ASSERT(isLength()); return m_length; } 47 Length& length() { ASSERT(isLength()); return m_length; }
48 48
49 double number() const { ASSERT(isNumber()); return m_length.value(); } 49 double number() const { ASSERT(isNumber()); return m_length.value(); }
50 50
51 Length unifiedLength() const { return m_length; }
52
53 bool operator==(const LengthOrNumber& o) const 51 bool operator==(const LengthOrNumber& o) const
54 { 52 {
55 return m_length == o.m_length; 53 return m_length == o.m_length;
56 } 54 }
57 55
58 bool isZero() const 56 bool isZero() const
59 { 57 {
60 return m_length.isZero(); 58 return m_length.isZero();
61 } 59 }
62 60
63 private: 61 private:
64 Length m_length; 62 Length m_length;
65 }; 63 };
66 64
67 } // namespace WebCore 65 } // namespace WebCore
68 66
69 #endif // LengthOrNumber_h 67 #endif // LengthOrNumber_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698