| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights |
| 3 * reserved. | 3 * 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 | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 | 541 |
| 542 // If no controls specified, we should still be able to focus the element if | 542 // If no controls specified, we should still be able to focus the element if |
| 543 // it has tabIndex. | 543 // it has tabIndex. |
| 544 return shouldShowControls() || HTMLElement::supportsFocus(); | 544 return shouldShowControls() || HTMLElement::supportsFocus(); |
| 545 } | 545 } |
| 546 | 546 |
| 547 bool HTMLMediaElement::isMouseFocusable() const { | 547 bool HTMLMediaElement::isMouseFocusable() const { |
| 548 return false; | 548 return false; |
| 549 } | 549 } |
| 550 | 550 |
| 551 void HTMLMediaElement::parseAttribute(const QualifiedName& name, | 551 void HTMLMediaElement::parseAttribute( |
| 552 const AtomicString& oldValue, | 552 const AttributeModificationParams& params) { |
| 553 const AtomicString& value) { | 553 const QualifiedName& name = params.name; |
| 554 if (name == srcAttr) { | 554 if (name == srcAttr) { |
| 555 BLINK_MEDIA_LOG << "parseAttribute(" << (void*)this | 555 BLINK_MEDIA_LOG << "parseAttribute(" << (void*)this |
| 556 << ", srcAttr, old=" << oldValue << ", new=" << value | 556 << ", srcAttr, old=" << params.oldValue |
| 557 << ")"; | 557 << ", new=" << params.newValue << ")"; |
| 558 // Trigger a reload, as long as the 'src' attribute is present. | 558 // Trigger a reload, as long as the 'src' attribute is present. |
| 559 if (!value.isNull()) { | 559 if (!params.newValue.isNull()) { |
| 560 m_ignorePreloadNone = false; | 560 m_ignorePreloadNone = false; |
| 561 invokeLoadAlgorithm(); | 561 invokeLoadAlgorithm(); |
| 562 } | 562 } |
| 563 } else if (name == controlsAttr) { | 563 } else if (name == controlsAttr) { |
| 564 UseCounter::count(document(), | 564 UseCounter::count(document(), |
| 565 UseCounter::HTMLMediaElementControlsAttribute); | 565 UseCounter::HTMLMediaElementControlsAttribute); |
| 566 updateControlsVisibility(); | 566 updateControlsVisibility(); |
| 567 } else if (name == preloadAttr) { | 567 } else if (name == preloadAttr) { |
| 568 setPlayerPreload(); | 568 setPlayerPreload(); |
| 569 } else if (name == disableremoteplaybackAttr) { | 569 } else if (name == disableremoteplaybackAttr) { |
| 570 // This attribute is an extension described in the Remote Playback API spec. | 570 // This attribute is an extension described in the Remote Playback API spec. |
| 571 // Please see: https://w3c.github.io/remote-playback | 571 // Please see: https://w3c.github.io/remote-playback |
| 572 UseCounter::count(document(), UseCounter::DisableRemotePlaybackAttribute); | 572 UseCounter::count(document(), UseCounter::DisableRemotePlaybackAttribute); |
| 573 if (oldValue != value) { | 573 if (params.oldValue != params.newValue) { |
| 574 if (m_webMediaPlayer) | 574 if (m_webMediaPlayer) { |
| 575 m_webMediaPlayer->requestRemotePlaybackDisabled(!value.isNull()); | 575 m_webMediaPlayer->requestRemotePlaybackDisabled( |
| 576 !params.newValue.isNull()); |
| 577 } |
| 576 // TODO(mlamouri): there is no direct API to expose if | 578 // TODO(mlamouri): there is no direct API to expose if |
| 577 // disableRemotePLayback attribute has changed. It will require a direct | 579 // disableRemotePLayback attribute has changed. It will require a direct |
| 578 // access to MediaControls for the moment. | 580 // access to MediaControls for the moment. |
| 579 if (mediaControls()) | 581 if (mediaControls()) |
| 580 mediaControls()->onDisableRemotePlaybackAttributeChanged(); | 582 mediaControls()->onDisableRemotePlaybackAttributeChanged(); |
| 581 } | 583 } |
| 582 } else { | 584 } else { |
| 583 HTMLElement::parseAttribute(name, oldValue, value); | 585 HTMLElement::parseAttribute(params); |
| 584 } | 586 } |
| 585 } | 587 } |
| 586 | 588 |
| 587 void HTMLMediaElement::finishParsingChildren() { | 589 void HTMLMediaElement::finishParsingChildren() { |
| 588 HTMLElement::finishParsingChildren(); | 590 HTMLElement::finishParsingChildren(); |
| 589 | 591 |
| 590 if (Traversal<HTMLTrackElement>::firstChild(*this)) | 592 if (Traversal<HTMLTrackElement>::firstChild(*this)) |
| 591 scheduleTextTrackResourceLoad(); | 593 scheduleTextTrackResourceLoad(); |
| 592 } | 594 } |
| 593 | 595 |
| (...skipping 3537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4131 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); | 4133 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); |
| 4132 } | 4134 } |
| 4133 | 4135 |
| 4134 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { | 4136 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { |
| 4135 m_mostlyFillingViewport = true; | 4137 m_mostlyFillingViewport = true; |
| 4136 if (m_webMediaPlayer) | 4138 if (m_webMediaPlayer) |
| 4137 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); | 4139 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); |
| 4138 } | 4140 } |
| 4139 | 4141 |
| 4140 } // namespace blink | 4142 } // namespace blink |
| OLD | NEW |