[Mac] .webkitClosedCaptionsVisible doesn't work with "Automatic" caption mode
https://bugs.webkit.org/show_bug.cgi?id=118319

Reviewed by Jer Noble.

Source/WebCore: 

Track when captions are enabled with the old 'webkitClosedCaptionsVisible' attribute and
consider that when determining which track should be enabled.

Test: media/track/track-legacyapi-with-automatic-mode.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_webkitLegacyClosedCaptionOverride.
(WebCore::HTMLMediaElement::setWebkitClosedCaptionsVisible): Set m_webkitLegacyClosedCaptionOverride.
(WebCore::HTMLMediaElement::webkitClosedCaptionsVisible): Return m_webkitLegacyClosedCaptionOverride.
* html/HTMLMediaElement.h:

* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::textTrackSelectionScore): Don't apply "automatic"
    logic when captions were enabled with .webkitClosedCaptionsVisible.

LayoutTests: 

* media/track/track-legacyapi-with-automatic-mode-expected.txt: Added.
* media/track/track-legacyapi-with-automatic-mode.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152422 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Add myself as a committer.

* Scripts/webkitpy/common/config/contributors.json:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152423 268f45cc-cd09-0410-ab3c-d52691b4dbfc
iframe constrained by max-width in full screen
https://bugs.webkit.org/show_bug.cgi?id=118250

Patch by Zalan Bujtas <zalan@apple.com> on 2013-07-05
Reviewed by Antti Koivisto.

Ensure that contents inside iframe can go full screen properly.

Set max-width and max-height values to the default 'none', so that iframes are not
constrained when entering full screen.

Source/WebCore:

Test: fullscreen/full-screen-iframe-with-max-width-height.html

* css/fullscreen.css:
(iframe:-webkit-full-screen):

LayoutTests:

* fullscreen/full-screen-iframe-with-max-width-height-expected.txt: Added.
* fullscreen/full-screen-iframe-with-max-width-height.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[wk2] Add API to lock the scroll position at the top or bottom of the page
https://bugs.webkit.org/show_bug.cgi?id=118429
<rdar://problem/14120323>

Reviewed by Anders Carlsson.

Test (API): WebKit2.ScrollPinningBehaviors

* WebCore.exp.in:
Expose FrameView::setScrollPinningBehavior.

* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
Our pinning behavior should be DoNotPin by default.

* page/FrameView.cpp:
(WebCore::FrameView::minimumScrollPosition):
(WebCore::FrameView::maximumScrollPosition):
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::ScrollingTreeScrollingNodeMac::minimumScrollPosition):
(WebCore::ScrollingTreeScrollingNodeMac::maximumScrollPosition):
Fix the minimum scroll position's vertical location to the maximum if
we're pinned to the bottom, and vice-versa if we're pinned to the top.

(WebCore::FrameView::setScrollPinningBehavior): Added.
If scroll pinning behavior has changed, inform ScrollingCoordinator
and update scrollbars (which will also re-pin the scroll position).

* page/FrameView.h:
Override minimumScrollPosition, add setScrollPinningBehavior,
and storage for m_scrollPinningBehavior.

* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::setScrollPinningBehavior): Added.

* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::ScrollingTree):
Our pinning behavior should be DoNotPin by default.

(WebCore::ScrollingTree::setScrollPinningBehavior):
(WebCore::ScrollingTree::scrollPinningBehavior):
Getter/setter for m_scrollPinningBehavior, scrolling-thread-safe.

* page/scrolling/ScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::setScrollPinningBehavior):
Inform ScrollingTree of the scroll pinning behavior change.

* platform/ScrollTypes.h:
Add ScrollPinningBehavior enum.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/ScrollPinningBehaviors.cpp: Added.
(TestWebKitAPI::didFinishDocumentLoadForFrame):
(TestWebKitAPI::TEST):
Add a test that ensures that the three pinning modes (DoNotPin, PinToTop, PinToBottom)
all work correctly in the face of resizing the view and scrolling from JS.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
Pass the current ScrollPinningBehavior across to the WebPage upon creation.

* UIProcess/API/C/WKPage.cpp:
(WKPageGetScrollPinningBehavior):
(WKPageSetScrollPinningBehavior):
* UIProcess/API/C/WKPagePrivate.h:
SPI to get/set the WebPageProxy's current ScrollPinningBehavior.
Convert between WK API type and WebCore enum.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::creationParameters):
Send ScrollPinningBehavior when creating a WebPage.

(WebKit::WebPageProxy::setScrollPinningBehavior):
Pass ScrollPinningBehavior changes across to the WebProcess (and save it
in WebPageProxy so it can be sent back across if the WebProcess crashes).

* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::scrollPinningBehavior):
Getter/setter and storage for m_scrollPinningBehavior.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
Inform new FrameViews of the current ScrollPinningBehavior.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
Set our ScrollPinningBehavior based on our creation parameters.

(WebKit::WebPage::setScrollPinningBehavior):
Inform the FrameView of ScrollPinningBehavior changes.

* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::scrollPinningBehavior): Added.
(WebKit::WebPage::setScrollPinningBehavior): Added.
Add storage for m_scrollPinningBehavior.

* WebProcess/WebPage/WebPage.messages.in:
Add SetScrollPinningBehavior message.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152425 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Identify OS-level at build-time.
https://bugs.webkit.org/show_bug.cgi?id=118428

Reviewed by Anders Carlsson.

../WebCore: 

* DerivedSources.make: Activate legible output features if present.
* WebCorePrefix.h: Activate MSVC 2010 workarounds for CGFloat if
building with VS2010.
* config.h: Activate legible output features if present.

../WTF: 

* WTF.vcxproj/WTFGenerated.make: Check for Legible Output featurs
and set build environment as appropriate.
* wtf/Platform.h: Activate Legible Output features if present.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152426 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Unreviewed build correction.

* WTF.vcxproj/WTFGenerated.make: Use space (rather than double
quotes) when handling the no-Legible-Output case.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152427 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Nix upstreaming - Adding Nix render theme files
https://bugs.webkit.org/show_bug.cgi?id=118368

Patch by Tullio Lucena <tullio.lucena@openbossa.org> on 2013-07-05
Reviewed by Benjamin Poulain.

All files related to render theme stuff.

No new tests. They will be uploaded on another patch during the upstreaming process.

* platform/nix/RenderThemeNix.cpp: Added.
* platform/nix/RenderThemeNix.h: Added.
* platform/nix/ScrollbarThemeNix.cpp: Added.
* platform/nix/ScrollbarThemeNix.h: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Unreviewed build correction.

* WTF.vcxproj/WTFGenerated.make: Avoid syntax error in generated
file in cases where Legible Output support is not present.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152429 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WKPageFindStringMatches with kWKFindOptionsBackwards still doesn't work
<rdar://problem/13881024>
https://bugs.webkit.org/show_bug.cgi?id=118436

Reviewed by Tim Horton.

* page/Page.cpp:
(WebCore::Page::findStringMatchingRanges):
- When searching backwards, use END_TO_START rather than START_TO_END.
- If there is no selection and we are searching backwards, we now select the last item,
  not the first.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152430 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix r152265: FrameView's pagination mode is only one of two, and the logic was totally wrong
https://bugs.webkit.org/show_bug.cgi?id=118439
<rdar://problem/14366120>

Reviewed by Anders Carlsson.

* page/FrameView.cpp:
(WebCore::FrameView::maximumScrollPosition):
- Test both Page and FrameView's pagination modes.
- *Don't* clamp negatives to zero if we are paginated with scroll offset set,
    like the original changelog claimed, but the code did the opposite.
- Don't clamp in *all* pagination modes; with 'direction: RTL' it's still possible
    to have a negative maximum position in LTR/TB pagination modes.

* TestWebKitAPI/Tests/WebKit2/ResizeReversePaginatedWebView.cpp:
(TestWebKitAPI::didLayout):
(TestWebKitAPI::TEST):
- Make use of EXPECT_JS_EQ instead of manually doing JavaScript stuff.
- Assert that we got the right number of pages for sanity.
- Reduce the page gap size so that DrawingAreaImpl doesn't try to allocate
    so much memory that SharedMemory asserts and makes the test time out.
- Use didFirstLayoutAfterSuppressedIncrementalRendering instead of Paint
    because paint doesn't fire if the window is offscreen.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152433 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tons of crashes on bots after r152425
https://bugs.webkit.org/show_bug.cgi?id=118440
<rdar://problem/14366772>

Reviewed by Sam Weinig.

Null-check the frame's page and early return. It's OK to do this
because it only happens when we're being torn down.

* page/FrameView.cpp:
(WebCore::FrameView::minimumScrollPosition):
(WebCore::FrameView::maximumScrollPosition):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152434 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Stop hardcoding interfaces that have indexed getters returning strings
https://bugs.webkit.org/show_bug.cgi?id=118414

Reviewed by Kentaro Hara.

Stop hardcoding the names of interfaces that have indexed getters returning
strings in the bindings generator. Now that we use the latest Web IDL indexed
getter, more information is provided in the IDL files and the generator is
able to figure out if the indexed getter is returning a DOMString on its own.

No new tests, no behavior change.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateGetOwnPropertySlotBody):
(GenerateImplementation):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152435 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update list of EFL WK2 API tests
https://bugs.webkit.org/show_bug.cgi?id=118443

Patch by Sergio Correia <sergio.correia@openbossa.org> on 2013-07-06
Reviewed by Christophe Dumez.

The following tests were included:

Passing:
- CloseThenTerminate
- DidAssociateFormControls
- PageVisibilityState
- ResponsivenessTimerDoesntFireEarly
- TerminateTwice
- WillLoad

Failing:
- ResizeReversePaginatedWebView
- ScrollPinningBehaviors

This patch also modified ``test_webkit2_api_BINARIES'' list so that it is in
alphabetical order.

* TestWebKitAPI/CMakeLists.txt: Added Bundles for included tests.
* TestWebKitAPI/PlatformEfl.cmake: Added a few tests.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152436 268f45cc-cd09-0410-ab3c-d52691b4dbfc
createElement("image") creates an HTMLImageElement, although this hack should exist in parser only
https://bugs.webkit.org/show_bug.cgi?id=88360

Reviewed by Sam Weinig.

Source/WebCore:

Create a HTMLElement when using createElement('image'), but keep the HTML5 parser constructing HTMLImageelement for it.

* html/HTMLTagNames.in:

LayoutTests:

Update tests to reflect new behavior. This matches FireFox and Opera 12.

* fast/canvas/webgl/context-lost.html:
* fast/dom/prefixed-image-tag-expected.txt:
* fast/dom/prefixed-image-tag.xhtml:
* fast/dom/wrapper-classes-expected.txt:
* fast/dom/wrapper-classes.html:
* platform/mac/fast/dom/wrapper-classes-objc-expected.txt:
* platform/mac/fast/dom/wrapper-classes-objc.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152437 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the performance regressions introduced by r152418
https://bugs.webkit.org/show_bug.cgi?id=118438

Reviewed by Sam Weinig.

* wtf/text/StringImpl.h:
(WTF::equal):
Looping between two arbitrary pointers prevents important loop
optimizations.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Adopt is/toHTMLTableElement for code cleanup
https://bugs.webkit.org/show_bug.cgi?id=118393

Reviewed by Andreas Kling.

To enhance readability, this patch adopts is/toHTMLTableElement.
This also helps out to reduce duplicated use of static_cast.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::isDataTable):
(WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
(WebCore::AccessibilityTable::title):
* accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
(webkitAccessibleTableGetCaption):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetDescription):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
* dom/Position.cpp:
(WebCore::endsOfNodeAreVisuallyDistinctPositions):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::handleGeneralDelete):
* editing/InsertLineBreakCommand.cpp:
(WebCore::InsertLineBreakCommand::doApply):
* editing/htmlediting.cpp:
(WebCore::isNonTableCellHTMLBlockElement):
* editing/markup.cpp:
(WebCore::ancestorToRetainStructureAndAppearanceForBlock):
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
(WebCore::FTPDirectoryDocumentParser::createBasicDocument):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::rendererIsNeeded):
* html/HTMLTableElement.h:
(WebCore::isHTMLTableElement):
(WebCore::toHTMLTableElement):
* html/HTMLTablePartElement.cpp:
(WebCore::HTMLTablePartElement::findParentTable):
* html/HTMLTableRowElement.cpp:
(WebCore::HTMLTableRowElement::rowIndex):
* html/HTMLTableRowsCollection.cpp:
(WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection):
(WebCore::HTMLTableRowsCollection::virtualItemAfter):
* html/parser/HTMLElementStack.cpp:
(WebCore::HTMLNames::isScopeMarker):
(WebCore::HTMLNames::isTableScopeMarker):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately):
(WebCore::HTMLTreeBuilder::processCharacterBuffer):
* platform/mac/HTMLConverter.mm:
(-[WebHTMLConverter _computedStringForNode:property:]):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::offsetParent):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
(WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152440 268f45cc-cd09-0410-ab3c-d52691b4dbfc
vibrate function have to return boolean value.
https://bugs.webkit.org/show_bug.cgi?id=118288

Reviewed by Gyuyoung Kim.

Source/WebCore:

According to latest Vibration API which is LC, vibrate() needs to return boolean value
and exception code is removed also. In addition, remove condition for canceling vibration
can be called when visibility state is hidden.
http://www.w3.org/TR/vibration/

No new tests. vibration/navigator-vibration.html is changed.

* Modules/vibration/NavigatorVibration.cpp:
(WebCore::NavigatorVibration::vibrate):
* Modules/vibration/NavigatorVibration.h:
* Modules/vibration/NavigatorVibration.idl:
* Modules/vibration/Vibration.cpp:
(WebCore::Vibration::vibrate):
* Modules/vibration/Vibration.h:

LayoutTests:

Update navigator-vibration.html to adjust latest spec.
Add vibration/cancelVibration-during-pattern-vibrating.html to TestExpactations
until Vibration API support visibilitychane event.

* platform/efl/TestExpectations:
* vibration/navigator-vibration-expected.txt:
* vibration/navigator-vibration.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152441 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Runtime critical warning when unloading a module that failed to load
https://bugs.webkit.org/show_bug.cgi?id=118425

Reviewed by Martin Robinson.

* Platform/gtk/ModuleGtk.cpp:
(WebKit::Module::load): Show an error message when the module
fails to load.
(WebKit::Module::unload): Check module pointer before calling
unload method.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152442 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed EFL gardening.
https://bugs.webkit.org/show_bug.cgi?id=118453

Added new baseline for EFL after r151841

Patch by Krzysztof Czech <k.czech@ymail.com> on 2013-07-08

* platform/efl/accessibility/aria-tab-role-on-buttons-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152443 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Leak: GFile* leaking in beginDragWithFilesCallback
https://bugs.webkit.org/show_bug.cgi?id=118412

Patch by Brian Holt <brian.holt@samsung.com> on 2013-07-08
Reviewed by Martin Robinson.

An adoptRef is required to balance ref and deref calls.

* DumpRenderTree/gtk/EventSender.cpp:
(beginDragWithFilesCallback):

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