summaryrefslogtreecommitdiffstats
path: root/WebCore/html
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/html')
-rw-r--r--WebCore/html/HTMLInputElement.cpp10
-rw-r--r--WebCore/html/HTMLMediaElement.cpp11
-rw-r--r--WebCore/html/HTMLMediaElement.h3
3 files changed, 17 insertions, 7 deletions
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index 88e14fd..59e4e2f 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -1113,16 +1113,12 @@ void HTMLInputElement::setValue(const String& value)
if (isTextField()) {
unsigned max = m_data.value().length();
- if (document()->focusedNode() == this)
#ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
- {
- // Make sure our UI side textfield changes to match the RenderTextControl
- android::WebViewCore::getWebViewCore(document()->view())->updateTextfield(this, false, value);
+ // Make sure our UI side textfield changes to match the RenderTextControl
+ android::WebViewCore::getWebViewCore(document()->view())->updateTextfield(this, false, value);
#endif
+ if (document()->focusedNode() == this)
InputElement::updateSelectionRange(this, this, max, max);
-#ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
- }
-#endif
else
cacheSelection(max, max);
}
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index 17a3110..f98200d 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -1446,6 +1446,13 @@ bool HTMLMediaElement::potentiallyPlaying() const
return !paused() && m_readyState >= HAVE_FUTURE_DATA && !endedPlayback() && !stoppedDueToErrors() && !pausedForUserInteraction();
}
+#if PLATFORM(ANDROID)
+bool HTMLMediaElement::couldPlayIfEnoughData() const
+{
+ return !paused() && !endedPlayback() && !stoppedDueToErrors() && !pausedForUserInteraction();
+}
+#endif
+
bool HTMLMediaElement::endedPlayback() const
{
if (!m_player || m_readyState < HAVE_METADATA)
@@ -1527,6 +1534,10 @@ void HTMLMediaElement::updatePlayState()
float time = currentTime();
if (m_lastSeekTime < time)
m_playedTimeRanges->add(m_lastSeekTime, time);
+#if PLATFORM(ANDROID)
+ } else if (couldPlayIfEnoughData() && playerPaused) {
+ m_player->prepareToPlay();
+#endif
}
if (renderer())
diff --git a/WebCore/html/HTMLMediaElement.h b/WebCore/html/HTMLMediaElement.h
index 27b48ea..70b686e 100644
--- a/WebCore/html/HTMLMediaElement.h
+++ b/WebCore/html/HTMLMediaElement.h
@@ -227,6 +227,9 @@ private:
bool endedPlayback() const;
bool stoppedDueToErrors() const;
bool pausedForUserInteraction() const;
+#if PLATFORM(ANDROID)
+ bool couldPlayIfEnoughData() const;
+#endif
float minTimeSeekable() const;
float maxTimeSeekable() const;