OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // In case of "123.456" | 89 // In case of "123.456" |
90 return RealNumberRenderSize(sizeOfSign + sizeBeforeDecimalPoint, sizeOfD
igits - sizeBeforeDecimalPoint); | 90 return RealNumberRenderSize(sizeOfSign + sizeBeforeDecimalPoint, sizeOfD
igits - sizeBeforeDecimalPoint); |
91 } | 91 } |
92 | 92 |
93 // In case of "0.00012345" | 93 // In case of "0.00012345" |
94 const unsigned sizeOfZero = 1; | 94 const unsigned sizeOfZero = 1; |
95 const unsigned numberOfZeroAfterDecimalPoint = -sizeBeforeDecimalPoint; | 95 const unsigned numberOfZeroAfterDecimalPoint = -sizeBeforeDecimalPoint; |
96 return RealNumberRenderSize(sizeOfSign + sizeOfZero , numberOfZeroAfterDecim
alPoint + sizeOfDigits); | 96 return RealNumberRenderSize(sizeOfSign + sizeOfZero , numberOfZeroAfterDecim
alPoint + sizeOfDigits); |
97 } | 97 } |
98 | 98 |
99 PassOwnPtr<InputType> NumberInputType::create(HTMLInputElement* element) | 99 PassOwnPtr<InputType> NumberInputType::create(Handle<HTMLInputElement> element) |
100 { | 100 { |
101 return adoptPtr(new NumberInputType(element)); | 101 return adoptPtr(new NumberInputType(element)); |
102 } | 102 } |
103 | 103 |
104 void NumberInputType::attach() | 104 void NumberInputType::attach() |
105 { | 105 { |
106 TextFieldInputType::attach(); | 106 TextFieldInputType::attach(); |
107 observeFeatureIfVisible(UseCounter::InputTypeNumber); | 107 observeFeatureIfVisible(UseCounter::InputTypeNumber); |
108 } | 108 } |
109 | 109 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 | 300 |
301 void NumberInputType::stepAttributeChanged() | 301 void NumberInputType::stepAttributeChanged() |
302 { | 302 { |
303 InputType::stepAttributeChanged(); | 303 InputType::stepAttributeChanged(); |
304 | 304 |
305 if (element()->renderer()) | 305 if (element()->renderer()) |
306 element()->renderer()->setNeedsLayoutAndPrefWidthsRecalc(); | 306 element()->renderer()->setNeedsLayoutAndPrefWidthsRecalc(); |
307 } | 307 } |
308 | 308 |
309 } // namespace WebCore | 309 } // namespace WebCore |
OLD | NEW |