| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2010 Google 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 | 259 |
| 260 HTMLInputElement* SliderThumbElement::hostInput() const | 260 HTMLInputElement* SliderThumbElement::hostInput() const |
| 261 { | 261 { |
| 262 // Only HTMLInputElement creates SliderThumbElement instances as its shadow
nodes. | 262 // Only HTMLInputElement creates SliderThumbElement instances as its shadow
nodes. |
| 263 // So, shadowHost() must be an HTMLInputElement. | 263 // So, shadowHost() must be an HTMLInputElement. |
| 264 return toHTMLInputElement(shadowHost()); | 264 return toHTMLInputElement(shadowHost()); |
| 265 } | 265 } |
| 266 | 266 |
| 267 static const AtomicString& sliderThumbShadowPartId() | 267 static const AtomicString& sliderThumbShadowPartId() |
| 268 { | 268 { |
| 269 DEFINE_STATIC_LOCAL(const AtomicString, sliderThumb, ("-webkit-slider-thumb"
, AtomicString::ConstructFromLiteral)); | 269 DEFINE_STATIC_LOCAL(const AtomicString, sliderThumb, ("-webkit-slider-thumb"
)); |
| 270 return sliderThumb; | 270 return sliderThumb; |
| 271 } | 271 } |
| 272 | 272 |
| 273 static const AtomicString& mediaSliderThumbShadowPartId() | 273 static const AtomicString& mediaSliderThumbShadowPartId() |
| 274 { | 274 { |
| 275 DEFINE_STATIC_LOCAL(const AtomicString, mediaSliderThumb, ("-webkit-media-sl
ider-thumb", AtomicString::ConstructFromLiteral)); | 275 DEFINE_STATIC_LOCAL(const AtomicString, mediaSliderThumb, ("-webkit-media-sl
ider-thumb")); |
| 276 return mediaSliderThumb; | 276 return mediaSliderThumb; |
| 277 } | 277 } |
| 278 | 278 |
| 279 const AtomicString& SliderThumbElement::shadowPseudoId() const | 279 const AtomicString& SliderThumbElement::shadowPseudoId() const |
| 280 { | 280 { |
| 281 HTMLInputElement* input = hostInput(); | 281 HTMLInputElement* input = hostInput(); |
| 282 if (!input || !input->layoutObject()) | 282 if (!input || !input->layoutObject()) |
| 283 return sliderThumbShadowPartId(); | 283 return sliderThumbShadowPartId(); |
| 284 | 284 |
| 285 const ComputedStyle& sliderStyle = input->layoutObject()->styleRef(); | 285 const ComputedStyle& sliderStyle = input->layoutObject()->styleRef(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 305 | 305 |
| 306 DEFINE_NODE_FACTORY(SliderContainerElement) | 306 DEFINE_NODE_FACTORY(SliderContainerElement) |
| 307 | 307 |
| 308 LayoutObject* SliderContainerElement::createLayoutObject(const ComputedStyle&) | 308 LayoutObject* SliderContainerElement::createLayoutObject(const ComputedStyle&) |
| 309 { | 309 { |
| 310 return new LayoutSliderContainer(this); | 310 return new LayoutSliderContainer(this); |
| 311 } | 311 } |
| 312 | 312 |
| 313 const AtomicString& SliderContainerElement::shadowPseudoId() const | 313 const AtomicString& SliderContainerElement::shadowPseudoId() const |
| 314 { | 314 { |
| 315 DEFINE_STATIC_LOCAL(const AtomicString, mediaSliderContainer, ("-webkit-medi
a-slider-container", AtomicString::ConstructFromLiteral)); | 315 DEFINE_STATIC_LOCAL(const AtomicString, mediaSliderContainer, ("-webkit-medi
a-slider-container")); |
| 316 DEFINE_STATIC_LOCAL(const AtomicString, sliderContainer, ("-webkit-slider-co
ntainer", AtomicString::ConstructFromLiteral)); | 316 DEFINE_STATIC_LOCAL(const AtomicString, sliderContainer, ("-webkit-slider-co
ntainer")); |
| 317 | 317 |
| 318 if (!shadowHost() || !shadowHost()->layoutObject()) | 318 if (!shadowHost() || !shadowHost()->layoutObject()) |
| 319 return sliderContainer; | 319 return sliderContainer; |
| 320 | 320 |
| 321 const ComputedStyle& sliderStyle = shadowHost()->layoutObject()->styleRef(); | 321 const ComputedStyle& sliderStyle = shadowHost()->layoutObject()->styleRef(); |
| 322 switch (sliderStyle.appearance()) { | 322 switch (sliderStyle.appearance()) { |
| 323 case MediaSliderPart: | 323 case MediaSliderPart: |
| 324 case MediaSliderThumbPart: | 324 case MediaSliderThumbPart: |
| 325 case MediaVolumeSliderPart: | 325 case MediaVolumeSliderPart: |
| 326 case MediaVolumeSliderThumbPart: | 326 case MediaVolumeSliderThumbPart: |
| 327 case MediaFullScreenVolumeSliderPart: | 327 case MediaFullScreenVolumeSliderPart: |
| 328 case MediaFullScreenVolumeSliderThumbPart: | 328 case MediaFullScreenVolumeSliderThumbPart: |
| 329 return mediaSliderContainer; | 329 return mediaSliderContainer; |
| 330 default: | 330 default: |
| 331 return sliderContainer; | 331 return sliderContainer; |
| 332 } | 332 } |
| 333 } | 333 } |
| 334 | 334 |
| 335 } // namespace blink | 335 } // namespace blink |
| OLD | NEW |