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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 return NoMove; | 377 return NoMove; |
378 } | 378 } |
379 if ((point1.x() - point2.x()).abs() >= (point1.y() - point2.y()).abs()) { | 379 if ((point1.x() - point2.x()).abs() >= (point1.y() - point2.y()).abs()) { |
380 return Horizontal; | 380 return Horizontal; |
381 } | 381 } |
382 return Vertical; | 382 return Vertical; |
383 } | 383 } |
384 | 384 |
385 bool SliderContainerElement::canSlide() | 385 bool SliderContainerElement::canSlide() |
386 { | 386 { |
387 DCHECK(hostInput()->layoutObject()); | 387 if (!hostInput() || !hostInput()->layoutObject() || !hostInput()->layoutObje
ct()->style()) { |
388 const ComputedStyle& sliderStyle = hostInput()->layoutObject()->styleRef(); | 388 return false; |
389 const TransformOperations& transforms = sliderStyle.transform(); | 389 } |
| 390 const ComputedStyle* sliderStyle = hostInput()->layoutObject()->style(); |
| 391 const TransformOperations& transforms = sliderStyle->transform(); |
390 int transformSize = transforms.size(); | 392 int transformSize = transforms.size(); |
391 if (transformSize > 0) { | 393 if (transformSize > 0) { |
392 for (int i = 0; i < transformSize; ++i) { | 394 for (int i = 0; i < transformSize; ++i) { |
393 if (transforms.at(i)->type() == TransformOperation::Rotate) { | 395 if (transforms.at(i)->type() == TransformOperation::Rotate) { |
394 return true; | 396 return true; |
395 } | 397 } |
396 } | 398 } |
397 } | 399 } |
398 if ((m_slidingDirection == Vertical && sliderStyle.appearance() == SliderHor
izontalPart) || (m_slidingDirection == Horizontal && sliderStyle.appearance() ==
SliderVerticalPart)) { | 400 if ((m_slidingDirection == Vertical && sliderStyle->appearance() == SliderHo
rizontalPart) || (m_slidingDirection == Horizontal && sliderStyle->appearance()
== SliderVerticalPart)) { |
399 return false; | 401 return false; |
400 } | 402 } |
401 return true; | 403 return true; |
402 } | 404 } |
403 | 405 |
404 const AtomicString& SliderContainerElement::shadowPseudoId() const | 406 const AtomicString& SliderContainerElement::shadowPseudoId() const |
405 { | 407 { |
406 DEFINE_STATIC_LOCAL(const AtomicString, mediaSliderContainer, ("-webkit-medi
a-slider-container")); | 408 DEFINE_STATIC_LOCAL(const AtomicString, mediaSliderContainer, ("-webkit-medi
a-slider-container")); |
407 DEFINE_STATIC_LOCAL(const AtomicString, sliderContainer, ("-webkit-slider-co
ntainer")); | 409 DEFINE_STATIC_LOCAL(const AtomicString, sliderContainer, ("-webkit-slider-co
ntainer")); |
408 | 410 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 HTMLElement::didMoveToNewDocument(oldDocument); | 443 HTMLElement::didMoveToNewDocument(oldDocument); |
442 } | 444 } |
443 | 445 |
444 void SliderContainerElement::removeAllEventListeners() | 446 void SliderContainerElement::removeAllEventListeners() |
445 { | 447 { |
446 Node::removeAllEventListeners(); | 448 Node::removeAllEventListeners(); |
447 m_hasTouchEventHandler = false; | 449 m_hasTouchEventHandler = false; |
448 } | 450 } |
449 | 451 |
450 } // namespace blink | 452 } // namespace blink |
OLD | NEW |