AX: Initial text selection point should respect element focus.
https://bugs.webkit.org/show_bug.cgi?id=131402

Reviewed by Chris Fleizach.

Source/WebCore:

No new tests, updated existing selection-initial to test this functionality.

Support the case where we want to set the initial selection and there's already a focused element.

* page/EventHandler.cpp:
(WebCore::setKeyboardSelection):
(WebCore::handleKeyboardSelectionMovement):

LayoutTests:

Updating test to make sure initial selection respects the focused element when necessary. Now, if a VoiceOver user attempts to use
arrow keys to read text and selection isn't set, we will set initial selection before/after the focused element if one is present.

* platform/mac/accessibility/selection-initial-expected.txt:
* platform/mac/accessibility/selection-initial.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167033 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Don't offer "contact" actions in telephone number menus
<rdar://problem/16556907> and https://bugs.webkit.org/show_bug.cgi?id=131451

Reviewed by Tim Horton.

* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::showTelephoneNumberMenu): Skip actions that have to do with contacts,
  and skip separators too!

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167034 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-04-09  Geoffrey Garen  <ggaren@apple.com>

        Rolled back out r166972.

        The production buildbots are still broken because the build-root script
        doesn't build bmalloc.

        * WTF.xcodeproj/project.pbxproj:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167035 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Get rid of JITOperationWrappers.h header file.
https://bugs.webkit.org/show_bug.cgi?id=131450

Patch by Julien Brianceau <jbriance@cisco.com> on 2014-04-09
Reviewed by Michael Saboff.

JITOperationWrappers header file contains architecture specific code that is
not needed anymore, so get rid of it.

* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGOperations.cpp:
* jit/JITOperationWrappers.h: Removed.
* jit/JITOperations.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed.  Updated ChangeLog comment for r167031: <http://trac.webkit.org/r167031>.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167037 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WK2: Dictated words disappear after being inserted.
https://bugs.webkit.org/show_bug.cgi?id=131458
<rdar://problem/16395011>

Reviewed by Benjamin Poulain.

The dictation engine treats selected text as text to be
removed. We need to ensure that the range selected to insert the
new text isn't reflected in the UI process until we are done
inserting the text.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::replaceDictatedText):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167038 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update SPI for managing tabs
https://bugs.webkit.org/show_bug.cgi?id=131453

Reviewed by Alexey Proskuryakov.

* Configurations/WebKit2.xcconfig:
    - added AssertionServices
* UIProcess/WebProcessProxy.h:
    - added m_assertion, m_assertionState.
* UIProcess/ios/WebProcessProxyIOS.mm:
(WebKit::WebProcessProxy::updateProcessState):
    - create BKSProcessAssertion to take an assertion.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167039 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename some dragging functions
https://bugs.webkit.org/show_bug.cgi?id=131460

Reviewed by Tim Horton.

Source/WebCore: 

Renamed performDrag to performDragOperation. This function is responsible for
accepting a drop, not for the whole drag.

The new name is not perfect either, but I think that it's better, and at least
it matches AppKit, like the other dragging destination functions already do.

* WebCore.exp.in:
* page/DragController.cpp:
(WebCore::DragController::performDragOperation):
(WebCore::DragController::performDrag): Deleted.
* page/DragController.h:

Source/WebKit/mac: 

Renamed performDrag to performDragOperation.

* WebView/WebView.mm: (-[WebView performDragOperation:]):

Source/WebKit/win: 

Renamed performDrag to performDragOperation.

* WebView.cpp: (WebView::Drop):

Source/WebKit2: 

Renamed performDrag to performDragOperation.

Also renamed resetDragOperation to resetDragSession, because it's m_dragSession
that it resets.

* Shared/DragControllerAction.h:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseDragDrop):
* UIProcess/API/mac/WKView.mm:
(-[WKView draggingEntered:]):
(-[WKView draggingExited:]):
(-[WKView performDragOperation:]):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::performDragOperation):
(WebKit::WebPageProxy::performDrag): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::resetDragSession):
(WebKit::WebPageProxy::resetDragOperation): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::performDragControllerAction):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167040 268f45cc-cd09-0410-ab3c-d52691b4dbfc
TileGrid should be PlatformCALayerClient instead of TileController
https://bugs.webkit.org/show_bug.cgi?id=131456

Reviewed by Tim Horton.

The client interface is for the tiles in the grid.

* platform/graphics/ca/mac/TileController.h:
* platform/graphics/ca/mac/TileController.mm:
(WebCore::TileController::setContentsScale):
(WebCore::TileController::createTileLayer):
(WebCore::TileController::platformCALayerPaintContents): Deleted.
(WebCore::TileController::platformCALayerDeviceScaleFactor): Deleted.
(WebCore::TileController::platformCALayerShowDebugBorders): Deleted.
(WebCore::TileController::platformCALayerShowRepaintCounter): Deleted.
(WebCore::TileController::platformCALayerIncrementRepaintCount): Deleted.
* platform/graphics/ca/mac/TileGrid.h:
        
    Move repaint counter to TileGrid too.

* platform/graphics/ca/mac/TileGrid.mm:
(WebCore::TileGrid::removeTiles):
(WebCore::TileGrid::removeAllSecondaryTiles):
(WebCore::TileGrid::removeTilesInCohort):
        
   Cleaned up tile removal.

(WebCore::TileGrid::revalidateTiles):
(WebCore::TileGrid::ensureTilesForRect):
(WebCore::TileGrid::platformCALayerPaintContents):
(WebCore::TileGrid::platformCALayerDeviceScaleFactor):
(WebCore::TileGrid::platformCALayerShowDebugBorders):
(WebCore::TileGrid::platformCALayerShowRepaintCounter):
(WebCore::TileGrid::platformCALayerContentsOpaque):
(WebCore::TileGrid::platformCALayerIncrementRepaintCount):
(WebCore::queueTileForRemoval): Deleted.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167041 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] Add no shapes version of RegionsShapes performance test
https://bugs.webkit.org/show_bug.cgi?id=131455

Reviewed by Ryosuke Niwa.

This is a no shapes version of the RegionsShapes performance test. All the content
will wrap around the floating containers. This way we can compare the runtime/memory
usage of the RegionsShapes test with/without shapes. The test is skipped by default.

* Layout/Shapes/RegionsShapesNoShapes.html: Added.
* Layout/Shapes/resources/RegionsShapesContentNoShapes.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167042 268f45cc-cd09-0410-ab3c-d52691b4dbfc
systemHiddenFontFamilySet in DRT is unnecessary
https://bugs.webkit.org/show_bug.cgi?id=131414

Reviewed by Tim Horton.

It doesn't seem to affect test results on my machine.

* DumpRenderTree/mac/DumpRenderTree.mm:
(drt_NSFontManager_availableFonts):
(systemHiddenFontFamilySet): Deleted.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167043 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Enable fullscreen captions selection
https://bugs.webkit.org/show_bug.cgi?id=131069

Patch by Jeremy Jones <jeremyj@apple.com> on 2014-04-09
Reviewed by Eric Carlson.

Source/WebCore:

Enable media selection options from fullscreen. i.e. captions.

* WebCore.exp.in:
Add exports for
setAudioMediaSelectionOptions
setLegibleMediaSelectionOptions
selectAudioMediaOption
selectLegibleMediaOption

* platform/ios/WebVideoFullscreenInterface.h:
Add setAudioMediaSelectionOptions/setLegibleMediaSelectionOptions

* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
Add setAudioMediaSelectionOptions/setLegibleMediaSelectionOptions

* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
Add setAudioMediaSelectionOptions/setLegibleMediaSelectionOptions

(-[WebAVPlayerController dealloc]):
(-[WebAVPlayerController hasMediaSelectionOptions]):
(+[WebAVPlayerController keyPathsForValuesAffectingHasMediaSelectionOptions]):
(-[WebAVPlayerController hasAudioMediaSelectionOptions]):
(+[WebAVPlayerController keyPathsForValuesAffectingHasAudioMediaSelectionOptions]):
(-[WebAVPlayerController hasLegibleMediaSelectionOptions]):
(+[WebAVPlayerController keyPathsForValuesAffectingHasLegibleMediaSelectionOptions]):
(-[WebAVPlayerController currentAudioMediaSelectionOption]):
(-[WebAVPlayerController setCurrentAudioMediaSelectionOption:]):
(-[WebAVPlayerController currentLegibleMediaSelectionOption]):
(-[WebAVPlayerController setCurrentLegibleMediaSelectionOption:]):
(WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions):
(WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions):
* platform/ios/WebVideoFullscreenModel.h:
Add selectAudioMediaOption/selectLegibleMediaOption

* platform/ios/WebVideoFullscreenModelMediaElement.h:
Add selectAudioMediaOption/selectLegibleMediaOption

* platform/ios/WebVideoFullscreenModelMediaElement.mm:
Add selectAudioMediaOption/selectLegibleMediaOption

(WebVideoFullscreenModelMediaElement::setMediaElement):
Send initial media selection options.

(WebVideoFullscreenModelMediaElement::selectAudioMediaOption):
Will be implemented when audio track slection is implemented.

(WebVideoFullscreenModelMediaElement::selectLegibleMediaOption):
Select corresponding text track on HTMLMediaElement.

Source/WebKit2:

Enable media selection in fullscreen.
setLegibleMediaSelectionOptions/setAudioMediaSelectionOptions provide a list of options.
selectAudioMediaOption/selectLegibleMediaOption change the selected option.

* UIProcess/ios/WebVideoFullscreenManagerProxy.h:
Add selectAudioMediaOption/selectLegibleMediaOption

* UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
Add selectAudioMediaOption/selectLegibleMediaOption

* UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::selectAudioMediaOption):
Add selectAudioMediaOption

(WebKit::WebVideoFullscreenManagerProxy::selectLegibleMediaOption):
Add selectLegibleMediaOption

* WebProcess/ios/WebVideoFullscreenManager.h:
Add setAudioMediaSelectionOptions/setLegibleMediaSelectionOptions

* WebProcess/ios/WebVideoFullscreenManager.messages.in:
Add setAudioMediaSelectionOptions/setLegibleMediaSelectionOptions

* WebProcess/ios/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::setAudioMediaSelectionOptions):
Add setAudioMediaSelectionOptions

(WebKit::WebVideoFullscreenManager::setLegibleMediaSelectionOptions):
Add setLegibleMediaSelectionOptions

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167044 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fullscreen does two view controller changes at once
https://bugs.webkit.org/show_bug.cgi?id=131432

Patch by Jeremy Jones <jeremyj@apple.com> on 2014-04-09
Reviewed by Eric Carlson.

* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::enterFullscreen):
delay -presentViewController on the main run loop to allow
previous view controller change to complete.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167045 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove "System Font" from whitelisted DRT fonts and char width calculations
https://bugs.webkit.org/show_bug.cgi?id=131411

Reviewed by Tim Horton.

Covered by existing tests.

Source/WebCore:

* platform/graphics/Font.cpp:
(WebCore::Font::hasValidAverageCharWidth):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(allowedFontFamilySet):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167046 268f45cc-cd09-0410-ab3c-d52691b4dbfc
TileGrid should be PlatformCALayerClient instead of TileController
https://bugs.webkit.org/show_bug.cgi?id=131456
        
Switch one more place to use removeTiles.

* platform/graphics/ca/mac/TileGrid.mm:
(WebCore::TileGrid::revalidateTiles):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167047 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Put bmalloc headers in the right place
https://bugs.webkit.org/show_bug.cgi?id=131464

Reviewed by Mark Rowe.

../bmalloc: 

* Configurations/bmalloc.xcconfig: Set PRIVATE_HEADERS_FOLDER_PATH to
specify that we don't just want to dump all of our generically-named
headers into /usr/local/include.

../WTF: 

* wtf/FastMalloc.cpp: Use "<bmalloc/...>" syntax so we can find our
headers in <header-root>/usr/local/include/bmalloc/.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167048 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rolled back in r166972.

This time, we conditionally exclude linking against bmalloc in Production
builds. Production builds will not be able to link against bmalloc
until the Production build system has been updated to build bmalloc.

    WTF should link against bmalloc
    https://bugs.webkit.org/show_bug.cgi?id=131403

    Reviewed by Mark Rowe.

    * Configurations/WTF.xcconfig:
    * WTF.xcodeproj/project.pbxproj:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167049 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline some tests for GTK+

* platform/gtk/editing/input/scroll-viewport-page-up-down-expected.txt:
* platform/gtk/fast/text/international/cjk-segmentation-expected.txt: Added.
* platform/gtk/http/tests/xmlhttprequest/cache-override-expected.txt: Added.
* platform/gtk/inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt: Added.
* platform/gtk/js/dom/dom-static-property-for-in-iteration-expected.txt:
* platform/gtk/plugins/nested-plugin-objects-expected.txt: Added.
* platform/gtk/plugins/netscape-destroy-plugin-script-objects-expected.txt: Added.
* platform/gtk/sputnik/Unicode/Unicode_320/S7.6_A2.2_T2-expected.txt: Added.
* platform/gtk/sputnik/Unicode/Unicode_320/S7.6_A5.2_T8-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/filters-image-03-f-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/filters-image-05-f-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/filters-composite-02-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/filters-displace-01-f-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/filters-image-01-b-expected.txt: Added.
* platform/gtk/svg/custom/object-no-size-attributes-expected.txt:
* platform/gtk/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt: Added.

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