[WK2] Don't support dynamically enabling the RemoteLayerTree debug indicator
https://bugs.webkit.org/show_bug.cgi?id=134644

Reviewed by Darin Adler.

* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::preferencesDidChange):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::initializeDebugIndicator):
(WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
The indicator depends on the live layer tree commits coming in, including layer creation,
so it can't be turned on after the root layer is created. Even a refresh is insufficient
to get it working; the debug indicator really needs to exist from the first commit.
So, don't even attempt to dynamically enable the indicator; create it at
RemoteLayerTreeDrawingAreaProxy construction time if the pref is enabled.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170838 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[ARMv7] Use 16 bits instructions for push/pop when possible
https://bugs.webkit.org/show_bug.cgi?id=134656

Reviewed by Andreas Kling.

* assembler/ARMv7Assembler.h:
(JSC::ARMv7Assembler::pop):
(JSC::ARMv7Assembler::push):
(JSC::ARMv7Assembler::ARMInstructionFormatter::oneWordOp7Imm9):
Add the 16 bits version of push and pop.

* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::pop):
(JSC::MacroAssemblerARMv7::push):
Use the new push/pop instead of a regular load/store.

* disassembler/ARMv7/ARMv7DOpcode.cpp:
(JSC::ARMv7Disassembler::ARMv7DOpcode::appendRegisterList):
* disassembler/ARMv7/ARMv7DOpcode.h:
(JSC::ARMv7Disassembler::ARMv7DOpcodeMiscPushPop::registerMask):
Fix the disassembler for push/pop:
-The register mask was on 7 bits for some reason.
-The code printing the registers was comparing a register ID with a register
 mask.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170839 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][WK2] The tap highlight ID is not invalidated when a long press ends
https://bugs.webkit.org/show_bug.cgi?id=134660

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-07-06
Reviewed by Darin Adler.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _cancelInteraction]):
(-[WKContentView _finishInteraction]):
(cancelPotentialTapIfNecessary):
I messed that up in r170600. I only accounted for the web process being too fast.

If the web process is too slow, _cancelInteraction or _finishInteraction happen before
_didGetTapHighlightForRequest:, and we also need to nuke the tap highlight.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170840 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Blending]The background images set on the root element will blend on an initial white backdrop.
https://bugs.webkit.org/show_bug.cgi?id=134342

Reviewed by Dean Jackson.

Source/WebCore:
Tests: css3/blending/background-blend-mode-body-image.html
       css3/blending/background-blend-mode-body-transparent-color-and-image.html
       css3/blending/background-blend-mode-body-transparent-image.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintFillLayers):
If the background layers have blend modes, we paint the base background color first,
before starting a new transparency layer. After creating the transparency layer,
the base background will be skipped, and the background layers will blend on top of
a transparent backdrop.
(WebCore::RenderBox::paintFillLayer):
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
This method is able to paint only the base background color (BaseBackgroundColorOnly),
skipping the background-color and background-images. This option is available only
on bottom layer of the root renderer and only if the background color is not opaque,
otherwise the method will return early.
Another option is to paint the root background without using the base background color
(BaseBackgroundColorSkip).
* rendering/RenderBoxModelObject.h:
Adding the BaseBackgroundColorUsage enum.

LayoutTests:
* css3/blending/background-blend-mode-body-image-expected.html: Added.
* css3/blending/background-blend-mode-body-image.html: Added.
* css3/blending/background-blend-mode-body-transparent-color-and-image-expected.html: Added.
* css3/blending/background-blend-mode-body-transparent-color-and-image.html: Added.
* css3/blending/background-blend-mode-body-transparent-image-expected.html: Added.
* css3/blending/background-blend-mode-body-transparent-image.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170841 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Unreviewed GTK gardening.

Remove failure expectations for tests that have been passing after r168046, r168350, r168400,
r168479, r169309, r169620, r169689 and r169799.

Patch by Lorenzo Tilve <ltilve@igalia.com> on 2014-07-07

* platform/gtk/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170842 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Enable ARMv7 disassembler for the GTK port
https://bugs.webkit.org/show_bug.cgi?id=134676

Reviewed by Benjamin Poulain.


Source/JavaScriptCore: 
* CMakeLists.txt: Add ARMv7DOpcode.cpp file to the build.
* disassembler/ARMv7/ARMv7DOpcode.cpp: Include the string.h header for strlen().

Source/WTF: 
* wtf/Platform.h: Enable the ARMv7 disassembler for the GTK port when
targeting the ARMv7 architecture.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170843 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Fix cursor artifacts on naver map site.
https://bugs.webkit.org/show_bug.cgi?id=134649

Patch by KwangHyuk Kim <hyuki.kim@samsung.com> on 2014-07-07
Reviewed by Gyuyoung Kim.

Old evas cursor and ecore x cursor are reset before new cursor is applied.

* UIProcess/API/efl/EwkView.cpp:
(EwkView::updateCursor):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170844 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] Assertion failure in NavigationState::LoaderClient::didStartProvisionalLoadForFrame (navigationID) when navigating through the page cache
https://bugs.webkit.org/show_bug.cgi?id=134682

Reviewed by Tim Horton.

* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::LoaderClient::didStartProvisionalLoadForFrame): Replaced the
assertion with a FIXME.
(WebKit::NavigationState::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
Ditto.
(WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): Ditto.
(WebKit::NavigationState::LoaderClient::didCommitLoadForFrame): Ditto.
(WebKit::NavigationState::LoaderClient::didFinishDocumentLoadForFrame): Ditto.
(WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Ditto.
(WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame): Ditto.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170845 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed Mac gardening after r170817.

* platform/mac-wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170846 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add test to ensure that SVGDocumentExtensions::rebuildElements() doesn't rebuild invalid elements
https://bugs.webkit.org/show_bug.cgi?id=134417
<rdar://problem/17479854>

Reviewed by David Kilzer.

Add a test that implicitly checks that the list of SVG elements to be rebuilt doesn't contain
removed elements. Run this test in DRT with Guard Malloc/MallocScribble (or the platform-
specific equivalent) enabled.

* svg/custom/overwrite-page-that-has-use-elements-expected.txt: Added.
* svg/custom/overwrite-page-that-has-use-elements.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170847 268f45cc-cd09-0410-ab3c-d52691b4dbfc
update-webkitgtk-libs script fails by unsatisfied dependencies
https://bugs.webkit.org/show_bug.cgi?id=134547

Reviewed by Martin Robinson.

Install libxcb-xfixes0-dev, needed to build Mesa.

* gtk/install-dependencies:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170848 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS WebGL] Fix crash with too many nested glsl functions.
https://bugs.webkit.org/show_bug.cgi?id=134683
<rdar://problem/17541529>

Patch by Alex Christensen <achristensen@webkit.org> on 2014-07-07
Reviewed by Geoffrey Garen.

This fixes the Khronos WebGL 1.0.3 test nested-functions-should-not-crash.html.

* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE):
Add SH_LIMIT_CALL_STACK_DEPTH to extraCompileOptions.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170849 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add missing ENABLE(FTL_JIT) guards
https://bugs.webkit.org/show_bug.cgi?id=134680

Patch by Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com> on 2014-07-07
Reviewed by Darin Adler.

* ftl/FTLDWARFDebugLineInfo.cpp:
* ftl/FTLDWARFDebugLineInfo.h:
* ftl/FTLGeneratedFunction.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170851 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ServicesOverlayController menus show up in the wrong place.
<rdar://problem/17130576> and https://bugs.webkit.org/show_bug.cgi?id=134684

Reviewed by Tim Horton.

* WebProcess/WebPage/mac/ServicesOverlayController.mm:
(WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged): Handle cases where
  the telephone number is in a subframe.
(WebKit::ServicesOverlayController::handleClick): The click point is always in main frame document
  coordinates, so convert it to window coordinates using the main frame’s FrameView.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170852 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Some of the WKPreferences (API) property getters read like questions
https://bugs.webkit.org/show_bug.cgi?id=134678
<rdar://problem/17576847>

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences javaScriptIsEnabled]):
(-[WKPreferences javaIsEnabled]):
(-[WKPreferences plugInsAreEnabled]):
(-[WKPreferences isJavaScriptEnabled]): Deleted.
(-[WKPreferences isJavaEnabled]): Deleted.
(-[WKPreferences arePlugInsEnabled]): Deleted.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170853 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a stubbed out _WKSessionState class
https://bugs.webkit.org/show_bug.cgi?id=134690

Reviewed by Geoffrey Garen.

* UIProcess/API/Cocoa/_WKSessionState.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
* UIProcess/API/Cocoa/_WKSessionState.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
(-[_WKSessionState initWithData:]):
(-[_WKSessionState data]):
* UIProcess/API/Cocoa/_WKSessionStateInternal.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
* UIProcess/Cocoa/SessionStateCoding.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
* UIProcess/Cocoa/SessionStateCoding.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
(WebKit::encodeSessionState):
(WebKit::decodeSessionState):
* UIProcess/LegacySessionStateCoding.h:
* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170854 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add SPI for saving and restoring a WKWebView's _WKSessionState
https://bugs.webkit.org/show_bug.cgi?id=134693

Reviewed by Dan Bernstein.

* UIProcess/API/C/WKPage.cpp:
(WKPageRestoreFromSessionState):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _sessionState]):
(-[WKWebView _restoreFromSessionStateData:]):
(-[WKWebView _restoreFromSessionState:]):
(-[WKWebView _restoreSessionState:andNavigate:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKSessionState.mm:
(-[_WKSessionState _initWithSessionState:]):
* UIProcess/API/Cocoa/_WKSessionStateInternal.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::restoreFromSessionState):
* UIProcess/WebPageProxy.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170856 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fast path for jsStringWithCache() when asked for the same string repeatedly.
<https://webkit.org/b/134635>

Reviewed by Darin Adler.

Follow-up to r170818 addressing a review comment by Geoff Garen.

* runtime/JSString.cpp:
(JSC::jsStringWithCacheSlowCase):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170857 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(iOS WK2): arrow keys movements don't work.
https://bugs.webkit.org/show_bug.cgi?id=134561
<rdar://problem/16827629>

Reviewed by Benjamin Poulain.

This change add the implementations for cursor movement selectors.
It also provides a mechanism to ensure that every selection
change in WebKit is reflected in UIKit so that it can update the 
autocorrection data. This way we ensure that the autocorraction state
is consistent even when selection changes are originated by JavaScript.
WebPageProxy::editorStateChanged now notifies the page client when the
selection is about to change as well as when it actually changed.
        
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::editorStateChanged):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::selectionWillChange):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cut:]): Removed incorrect calls to textWillChange and
textDidChange.
(-[WKContentView paste:]):
(-[WKContentView _moveUp:withHistory:]):
(-[WKContentView _moveDown:withHistory:]):
(-[WKContentView _moveLeft:withHistory:]):
(-[WKContentView _moveRight:withHistory:]):
(-[WKContentView _moveToStartOfWord:withHistory:]):
(-[WKContentView _moveToStartOfParagraph:withHistory:]):
(-[WKContentView _moveToStartOfLine:withHistory:]):
(-[WKContentView _moveToStartOfDocument:withHistory:]):
(-[WKContentView _moveToEndOfWord:withHistory:]):
(-[WKContentView _moveToEndOfParagraph:withHistory:]):
(-[WKContentView _moveToEndOfLine:withHistory:]):
(-[WKContentView _moveToEndOfDocument:withHistory:]):
(-[WKContentView _selectionWillChange]):
(-[WKContentView _selectionChanged]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::notifySelectionWillChange):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170858 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Nearly everything in the UIProcess "leaks" when WKWebView is torn down
https://bugs.webkit.org/show_bug.cgi?id=134699
<rdar://problem/17581777>

Reviewed by Simon Fraser.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
Adoption is important!


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