Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp

Issue 1377353002: Update poster code as per https://html.spec.whatwg.org/#show-poster-flag Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
index 614c6ce029563ab390b6395af1f1e283eed2f81d..87c76cf8609768b18e4eaad62d9e4bce6b024d37 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -314,7 +314,6 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum
, m_deferredLoadState(NotDeferred)
, m_deferredLoadTimer(this, &HTMLMediaElement::deferredLoadTimerFired)
, m_webLayer(nullptr)
- , m_displayMode(Unknown)
, m_cachedTime(std::numeric_limits<double>::quiet_NaN())
, m_fragmentEndTime(std::numeric_limits<double>::quiet_NaN())
, m_pendingActionFlags(0)
@@ -737,7 +736,7 @@ void HTMLMediaElement::prepareForLoad()
m_haveFiredLoadedData = false;
m_completelyLoaded = false;
m_havePreparedToPlay = false;
- m_displayMode = Unknown;
+ setShowPoster(true);
// 1 - Abort any already-running instance of the resource selection algorithm for this element.
m_loadState = WaitingForSource;
@@ -863,7 +862,7 @@ void HTMLMediaElement::selectMediaResource()
m_loadState = WaitingForSource;
setShouldDelayLoadEvent(false);
m_networkState = NETWORK_EMPTY;
- updateDisplayState();
+ updateDisplayState(false);
WTF_LOG(Media, "HTMLMediaElement::selectMediaResource(%p), nothing to load", this);
return;
@@ -954,8 +953,7 @@ void HTMLMediaElement::loadResource(const KURL& url, ContentType& contentType, c
startProgressEventTimer();
- // Reset display mode to force a recalculation of what to show because we are resetting the player.
- setDisplayMode(Unknown);
+ setShowPoster(true);
setPlayerPreload();
@@ -999,7 +997,7 @@ void HTMLMediaElement::loadResource(const KURL& url, ContentType& contentType, c
// If there is no poster to display, allow the media engine to render video frames as soon as
// they are available.
- updateDisplayState();
+ updateDisplayState(false);
if (layoutObject())
layoutObject()->updateFromElement();
@@ -1251,7 +1249,7 @@ void HTMLMediaElement::waitForSourceChange()
// 6.18 - Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
setShouldDelayLoadEvent(false);
- updateDisplayState();
+ updateDisplayState(false);
if (layoutObject())
layoutObject()->updateFromElement();
@@ -1290,7 +1288,7 @@ void HTMLMediaElement::noneSupported()
// 9 - Abort these steps. Until the load() method is invoked or the src attribute is changed,
// the element won't attempt to load another resource.
- updateDisplayState();
+ updateDisplayState(false);
if (layoutObject())
layoutObject()->updateFromElement();
@@ -1376,7 +1374,7 @@ void HTMLMediaElement::mediaLoadingFailed(WebMediaPlayer::NetworkState error)
&& m_loadState == LoadingFromSrcAttr)
noneSupported();
- updateDisplayState();
+ updateDisplayState(false);
if (mediaControls())
mediaControls()->reset();
}
@@ -1580,7 +1578,7 @@ void HTMLMediaElement::setReadyState(ReadyState state)
}
if (shouldUpdateDisplayState) {
- updateDisplayState();
+ updateDisplayState(false);
if (mediaControls())
mediaControls()->refreshClosedCaptionsButtonVisibility();
}
@@ -1722,7 +1720,7 @@ void HTMLMediaElement::finishSeek()
// 17 - Queue a task to fire a simple event named seeked at the element.
scheduleEvent(EventTypeNames::seeked);
- setDisplayMode(Video);
+ setShowPoster(false);
}
HTMLMediaElement::ReadyState HTMLMediaElement::readyState() const
@@ -2875,7 +2873,7 @@ void HTMLMediaElement::repaint()
if (m_webLayer)
m_webLayer->invalidate();
- updateDisplayState();
+ updateDisplayState(false);
if (layoutObject())
layoutObject()->setShouldDoFullPaintInvalidation();
}
@@ -2988,7 +2986,7 @@ void HTMLMediaElement::updatePlayState()
this, boolString(shouldBePlaying), boolString(isPlaying));
if (shouldBePlaying) {
- setDisplayMode(Video);
+ setShowPoster(false);
invalidateCachedTime();
if (!isPlaying) {

Powered by Google App Engine
This is Rietveld 408576698