Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 120 return static_cast<float>(element()->maximum()); | 120 return static_cast<float>(element()->maximum()); |
| 121 } | 121 } |
| 122 | 122 |
| 123 float AccessibilitySlider::minValueForRange() const | 123 float AccessibilitySlider::minValueForRange() const |
| 124 { | 124 { |
| 125 return static_cast<float>(element()->minimum()); | 125 return static_cast<float>(element()->minimum()); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void AccessibilitySlider::setValue(const String& value) | 128 void AccessibilitySlider::setValue(const String& value) |
| 129 { | 129 { |
| 130 HTMLInputElement* input = element(); | 130 Handle<HTMLInputElement> input = element(); |
| 131 | 131 |
| 132 if (input->value() == value) | 132 if (input->value() == value) |
| 133 return; | 133 return; |
| 134 | 134 |
| 135 input->setValue(value); | 135 input->setValue(value); |
| 136 | 136 |
| 137 // Fire change event manually, as RenderSlider::setValueForPosition does. | 137 // Fire change event manually, as RenderSlider::setValueForPosition does. |
| 138 input->dispatchFormControlChangeEvent(); | 138 input->dispatchFormControlChangeEvent(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 HTMLInputElement* AccessibilitySlider::element() const | 141 Result<HTMLInputElement> AccessibilitySlider::element() const |
| 142 { | 142 { |
| 143 return static_cast<HTMLInputElement*>(m_renderer->node()); | 143 return Handle<HTMLInputElement>(static_cast<HTMLInputElement*>(m_renderer->n ode())); |
|
haraken
2013/07/17 14:10:23
I didn't add a FIXME for Handle<X>(static_cast<X*>
Vyacheslav Egorov (Google)
2013/07/18 16:50:08
I would use adoptRawResult instead of Handle<>() f
haraken
2013/07/19 02:57:09
Done.
| |
| 144 } | 144 } |
| 145 | 145 |
| 146 | 146 |
| 147 AccessibilitySliderThumb::AccessibilitySliderThumb() | 147 AccessibilitySliderThumb::AccessibilitySliderThumb() |
| 148 { | 148 { |
| 149 } | 149 } |
| 150 | 150 |
| 151 PassRefPtr<AccessibilitySliderThumb> AccessibilitySliderThumb::create() | 151 PassRefPtr<AccessibilitySliderThumb> AccessibilitySliderThumb::create() |
| 152 { | 152 { |
| 153 return adoptRef(new AccessibilitySliderThumb()); | 153 return adoptRef(new AccessibilitySliderThumb()); |
| 154 } | 154 } |
| 155 | 155 |
| 156 LayoutRect AccessibilitySliderThumb::elementRect() const | 156 LayoutRect AccessibilitySliderThumb::elementRect() const |
| 157 { | 157 { |
| 158 if (!m_parent) | 158 if (!m_parent) |
| 159 return LayoutRect(); | 159 return LayoutRect(); |
| 160 | 160 |
| 161 RenderObject* sliderRenderer = m_parent->renderer(); | 161 RenderObject* sliderRenderer = m_parent->renderer(); |
| 162 if (!sliderRenderer || !sliderRenderer->isSlider()) | 162 if (!sliderRenderer || !sliderRenderer->isSlider()) |
| 163 return LayoutRect(); | 163 return LayoutRect(); |
| 164 return sliderThumbElementOf(sliderRenderer->node())->boundingBox(); | 164 return sliderThumbElementOf(sliderRenderer->node())->boundingBox(); |
| 165 } | 165 } |
| 166 | 166 |
| 167 bool AccessibilitySliderThumb::computeAccessibilityIsIgnored() const | 167 bool AccessibilitySliderThumb::computeAccessibilityIsIgnored() const |
| 168 { | 168 { |
| 169 return accessibilityIsIgnoredByDefault(); | 169 return accessibilityIsIgnoredByDefault(); |
| 170 } | 170 } |
| 171 | 171 |
| 172 } // namespace WebCore | 172 } // namespace WebCore |
| OLD | NEW |