[iOS] video is sometimes allowed to play from the background
https://bugs.webkit.org/show_bug.cgi?id=138522

Reviewed by Jer Noble.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::displayType): New.
* html/HTMLMediaElement.h:

* platform/audio/MediaSession.cpp:
(WebCore::MediaSession::isHidden): New, client passthrough.
(WebCore::MediaSession::displayType): Ditto.
* platform/audio/MediaSession.h:
(WebCore::MediaSessionClient::displayType):

* platform/audio/MediaSessionManager.cpp:
(WebCore::MediaSessionManager::sessionCanLoadMedia): New, default implementation returns
    true if client is visible or playing.
* platform/audio/MediaSessionManager.h:

* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::sessionCanLoadMedia): iOS override, also allows buffering
    when displaying optimized fullscreen.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175777 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Speed up HTMLInputElement::isEmptyValue()
https://bugs.webkit.org/show_bug.cgi?id=138515

Reviewed by Geoffrey Garen.

HTMLInputElement::isEmptyValue() was calling
HTMLTextFormControlElement::innerTextValue() which causes a full
subtree traversal to construct a string representation of that subtree
using a StringBuilder. In the case of HTMLInputElement::isEmptyValue(),
we don't have to do all this: We don't need to construct a String
and we can return false as soon as we find a non-empty descendant.

No new tests, no behavior change.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isEmptyValue):
* html/HTMLInputElement.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175778 268f45cc-cd09-0410-ab3c-d52691b4dbfc