Support list of tracks in caption media controls
https://bugs.webkit.org/show_bug.cgi?id=101669

Reviewed by Eric Carlson.

Attempt four of commit. The first two times caused build failures on Chromium. The third time
crashed the Windows test bot. It's also been rebased since r134488.

Add some new elements to the media control shadow DOM that display the list of available
tracks on an audio/video element. The UI is hidden by default everywhere but on Mac,
where it is given a very basic design. At the moment only the list of available tracks
are displayed; The followup bug will make the UI active: https://bugs.webkit.org/show_bug.cgi?id=101670

No new tests - this doesn't expose any testable surface.

* css/mediaControls.css: Added default rules that hide the new elements.
* css/mediaControlsQuickTime.css: Specific rules that give a basic rendering of the new track list.
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlElement::isShowing): Tests for the visibility of a control.
(WebCore::MediaControlClosedCaptionsContainerElement::MediaControlClosedCaptionsContainerElement):
(WebCore::MediaControlClosedCaptionsContainerElement::create):
(WebCore::MediaControlClosedCaptionsContainerElement::shadowPseudoId):
(WebCore::MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement):
(WebCore::MediaControlToggleClosedCaptionsButtonElement::create): Now takes a reference to the media controls as a parameter.
(WebCore::MediaControlToggleClosedCaptionsButtonElement::updateDisplayType):
(WebCore::MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler):
(WebCore::MediaControlToggleClosedCaptionsButtonElement::shadowPseudoId):
(WebCore::MediaControlClosedCaptionsTrackListElement::MediaControlClosedCaptionsTrackListElement): New element for holding a list of tracks to display.
* html/shadow/MediaControlElements.h:
(MediaControlElement):
(MediaControlToggleClosedCaptionsButtonElement):
(MediaControlClosedCaptionsContainerElement):
(MediaControlClosedCaptionsTrackListElement): Examines the media element to build a shadow DOM that lists all the tracks available.
* html/shadow/MediaControlsApple.cpp:
(WebCore::MediaControlsApple::MediaControlsApple):
(WebCore::MediaControlsApple::create): New track container and list elements created.
(WebCore::MediaControlsApple::setMediaController): Hook up the new elements to the controller..
(WebCore::MediaControlsApple::hide):
(WebCore::MediaControlsApple::makeTransparent):
(WebCore::MediaControlsApple::reset):
(WebCore::MediaControlsApple::reportedError):
(WebCore::MediaControlsApple::toggleClosedCaptionTrackList): Shows or hides the popup with the list of tracks.
(WebCore):
* html/shadow/MediaControlsApple.h:
(MediaControlsApple):
* html/shadow/MediaControlsChromium.cpp:
(WebCore::MediaControlsChromium::initializeControls): Pass in the controls as a parameter.
* html/shadow/MediaControls.h:
(MediaControls):
* platform/Language.cpp:
(WebCore::displayNameForLanguageLocale): New function to return a human-readable name for a locale, given the identifier input.
* platform/Language.h:
(WebCore):
* rendering/RenderMediaControls.cpp:
(WebCore::RenderMediaControls::paintMediaControlsPart): New enum values into switch.
* rendering/RenderMediaControlsChromium.cpp:
(WebCore::RenderMediaControlsChromium::paintMediaControlsPart): New enum values into switch.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134507 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make an assertion in JSEventListener::jsFunction() more useful.
https://bugs.webkit.org/show_bug.cgi?id=101985.

Reviewed by Geoffrey Garen.

The assertion was weakened in r134495. This strengthens it again.

No new tests.

* bindings/js/JSEventListener.h:
(WebCore::JSEventListener::jsFunction):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134508 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Factor the code to enter accelerated compositing given a layer out into a separate method
https://bugs.webkit.org/show_bug.cgi?id=102155

Reviewed by Andreas Kling.

* UIProcess/API/mac/WKView.mm:
(-[WKView _enterAcceleratedCompositingMode:]):
(-[WKView _enterAcceleratedCompositingModeWithRootLayer:]):
* UIProcess/API/mac/WKViewInternal.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134509 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make HTMLLegendElement.form behave according to specification
https://bugs.webkit.org/show_bug.cgi?id=101044

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-11-13
Reviewed by Kent Tamura.

Source/WebCore:

According to the HTML5 specification (http://dev.w3.org/html5/spec/single-page.html#dom-legend-form),
The form IDL attribute's behavior depends on whether the legend element is in a fieldset element or
not. If the legend has a fieldset element as its parent, then the form IDL attribute must return the
same value as the form IDL attribute on that fieldset element. Otherwise, it must return null.

This patch makes WebKit behaves according to specification (and Firefox). Previously, legend.form was
not returning null if the element was not inside a fieldset. Also, legend.form did not necessarily
return the same value as the parent fieldset's form attribute.

Test: fast/forms/legend/legend-form.html

* html/HTMLLegendElement.cpp:
(WebCore):
(WebCore::HTMLLegendElement::virtualForm):
* html/HTMLLegendElement.h:
(HTMLLegendElement):

LayoutTests:

A new fast/forms/legend/legend-form.html test to check that
the legend element's form attribute behaves according to
specification.

* fast/forms/legend/legend-form-expected.txt: Added.
* fast/forms/legend/legend-form.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134510 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reduce snapshot waiting time
https://bugs.webkit.org/show_bug.cgi?id=102147
<rdar://problem/12695539>

Reviewed by Brian Weinstein.

* WebProcess/Plugins/PluginView.cpp: Reduce to 1 second. Improves impressions of responsiveness.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134511 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make InspectorFrontendHost.moveWindowBy work in WebKit2 for Mac.

https://bugs.webkit.org/show_bug.cgi?id=102154

Reviewed by Joseph Pecoraro.

* UIProcess/WebInspectorProxy.h:
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::getWindowFrame): Added. Call setInspectorWindowFrame.
(WebKit::setWindowFrame): Added. Call inspectorWindowFrame.
(WebKit::WebInspectorProxy::setInspectorWindowFrame): Added.
(WebKit::WebInspectorProxy::inspectorWindowFrame): Added.
(WebKit::WebInspectorProxy::platformCreateInspectorPage): Create and set the WKPageUIClient
with getWindowFrame and setWindowFrame.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134513 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use prefix form of increment / decrement operators in WTF String classes when possible
https://bugs.webkit.org/show_bug.cgi?id=101859

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-11-13
Reviewed by Benjamin Poulain.

Use prefix form of increment / decrement operators whenever possible in
WTF String classes as this seems to be the convention in WebKit.

* wtf/text/ASCIIFastPath.h:
(WTF::copyLCharsFromUCharSource):
* wtf/text/AtomicString.cpp:
(WTF::AtomicString::add):
* wtf/text/Base64.cpp:
(WTF::base64Encode):
(WTF::base64DecodeInternal):
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::allocateBufferUpConvert):
* wtf/text/StringConcatenate.h:
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::getData16SlowCase):
(WTF::StringImpl::upconvertCharacters):
(WTF::StringImpl::containsOnlyWhitespace):
(WTF::StringImpl::lower):
(WTF::StringImpl::upper):
(WTF::StringImpl::foldCase):
(WTF::StringImpl::stripMatchedCharacters):
(WTF::StringImpl::removeCharacters):
(WTF::StringImpl::simplifyMatchedCharactersToSpace):
(WTF::reverseFindInner):
(WTF::reverseFindIgnoringCaseInner):
(WTF::StringImpl::replace):
(WTF::StringImpl::createWithTerminatingNullCharacter):
* wtf/text/StringImpl.h:
(WTF::codePointCompare):
* wtf/text/WTFString.cpp:
(WTF::String::String):
(WTF::toIntegralType):

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