Changeset 113730 in webkit
- Timestamp:
- Apr 10, 2012 10:11:10 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r113728 r113730 1 2012-04-10 Emil A Eklund <eae@chromium.org> 2 3 Add missing methods and operators to FractionalLayoutUnit 4 https://bugs.webkit.org/show_bug.cgi?id=82403 5 6 Reviewed by Eric Seidel. 7 8 Add missing methods and operators and from branch version of 9 FractionalLayoutUnit. Also fix overflow assertion and add const keyword 10 to a couple of methods. 11 12 No new tests. 13 14 * platform/FractionalLayoutUnit.h: 15 (WebCore::FractionalLayoutUnit::abs): 16 (FractionalLayoutUnit): 17 (WebCore::FractionalLayoutUnit::ceil): 18 (WebCore::FractionalLayoutUnit::round): 19 (WebCore::FractionalLayoutUnit::floor): 20 (WebCore::FractionalLayoutUnit::isInBounds): 21 (WebCore::operator<): 22 (WebCore): 23 (WebCore::operator-): 24 1 25 2011-12-14 Jer Noble <jer.noble@apple.com> 2 26 -
trunk/Source/WebCore/platform/FractionalLayoutUnit.h
r111362 r113730 72 72 } 73 73 74 inline FractionalLayoutUnit abs() 74 inline FractionalLayoutUnit abs() const 75 75 { 76 76 FractionalLayoutUnit returnValue; … … 79 79 } 80 80 #if OS(DARWIN) 81 inline int wtf_ceil() 81 inline int wtf_ceil() const 82 82 #else 83 inline int ceil() 83 inline int ceil() const 84 84 #endif 85 85 { … … 88 88 return (m_value - kFixedPointDenominator + 1) / kFixedPointDenominator; 89 89 } 90 inline int round() 90 inline int round() const 91 91 { 92 92 if (m_value > 0) … … 95 95 } 96 96 97 inline int floor() 97 inline int floor() const 98 98 { 99 99 return toInt(); … … 117 117 inline bool isInBounds(int value) 118 118 { 119 return ::abs(value) < std::numeric_limits<int>::max() / kFixedPointDenominator;119 return ::abs(value) <= std::numeric_limits<int>::max() / kFixedPointDenominator; 120 120 } 121 121 inline bool isInBounds(unsigned value) 122 122 { 123 return value < static_cast<unsigned>(std::numeric_limits<int>::max()) / kFixedPointDenominator;123 return value <= static_cast<unsigned>(std::numeric_limits<int>::max()) / kFixedPointDenominator; 124 124 } 125 125 inline bool isInBounds(double value) 126 126 { 127 return :: fabs(value) <std::numeric_limits<int>::max() / kFixedPointDenominator;127 return ::abs(value) <= std::numeric_limits<int>::max() / kFixedPointDenominator; 128 128 } 129 129 … … 194 194 { 195 195 return a.toFloat() < b; 196 } 197 198 inline bool operator<(const FractionalLayoutUnit& a, double b) 199 { 200 return a.toDouble() < b; 196 201 } 197 202 … … 434 439 } 435 440 441 inline FractionalLayoutUnit operator-(const FractionalLayoutUnit& a, unsigned b) 442 { 443 return a - FractionalLayoutUnit(b); 444 } 445 436 446 inline float operator-(const FractionalLayoutUnit& a, float b) 437 447 {
Note: See TracChangeset
for help on using the changeset viewer.