Unify and factor out page overlay implementations
https://bugs.webkit.org/show_bug.cgi?id=131353

Reviewed by Anders Carlsson.

Bring all of the PageOverlay code together in a single cross-platform
PageOverlayController, including hit-testing code from WebPage and painting
and layer-tree manipulation code from the DrawingArea.

This also makes all PageOverlays a single GraphicsLayer tree which can be
flushed and plugged into any DrawingArea in a straightforward manner.
We no longer have to watch for individual layers flipping into/out of tiling,
because they're hidden underneath the root PageOverlay GraphicsLayer.
Additionally, because GraphicsLayer is cross-platform, we can share
all of the fairly trivial but oft-repeated overlay management code.

* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/PageOverlayController.cpp: Added.
* WebProcess/WebPage/PageOverlayController.h: Added.
(WebKit::PageOverlayController::rootLayer):
Add PageOverlayController.

* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
Remove PageOverlay-related code from the DrawingAreas.

* WebProcess/WebPage/PageOverlay.cpp:
(WebKit::PageOverlay::setNeedsDisplay):
(WebKit::PageOverlay::fadeAnimationTimerFired):
(WebKit::PageOverlay::clear):
* WebProcess/WebPage/PageOverlay.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::didChangeScrollOffset):
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Use PageOverlayController instead of the DrawingArea/WebPage to manipulate page overlays.

* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::pageOverlayController):
Remove PageOverlay-related code from WebPage.

* WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::outOfTreeLayerWasAdded): Deleted.
(WebKit::RemoteLayerTreeContext::outOfTreeLayerWillBeRemoved): Deleted.
(WebKit::RemoteLayerTreeContext::flushOutOfTreeLayers): Deleted.
Remove the no-longer-necessary out-of-tree layer code.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::highlight):
(WebKit::WebInspectorClient::hideHighlight):
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindUIAfterPageScroll):
(WebKit::FindController::hideFindUI):
* WebProcess/WebPage/TelephoneNumberOverlayController.cpp:
(WebKit::TelephoneNumberOverlayController::createOverlayIfNeeded):
(WebKit::TelephoneNumberOverlayController::destroyOverlay):
Make use of the FadeMode enum.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a WKNavigationAction property indicating whether it resulted from processing a user gesture
https://bugs.webkit.org/show_bug.cgi?id=131405
<rdar://problem/16535453>

Reviewed by Tim Horton.

* Shared/NavigationActionData.cpp:
(WebKit::NavigationActionData::NavigationActionData):
(WebKit::NavigationActionData::encode):
(WebKit::NavigationActionData::decode):
* Shared/NavigationActionData.h:
* UIProcess/API/Cocoa/WKNavigationActionInternal.h:
* UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::createNewPage):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createWindow):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Remove WebKit1 unit tests
https://bugs.webkit.org/show_bug.cgi?id=131359

Reviewed by Anders Carlsson.

Remove all WebKit1 GTK+ unit tests, in preparation for removing the WebKit1 port
entirely. We also remove the list of skipped WebKi1 tests from run-gtk-tests, as
they were inadvertently left in http://trac.webkit.org/changeset/166504.

* CMakeLists.txt: No longer load the WebKit1 unit test CMakeLists.txt file.
* Scripts/run-gtk-tests: Remove skipped WebKit1 unit tests.
* TestWebKitAPI/Tests/WebKitGtk/CMakeLists.txt: Removed.
* TestWebKitAPI/Tests/WebKitGtk/resources/blank.ico: Removed.
* TestWebKitAPI/Tests/WebKitGtk/resources/test.html: Removed.
* TestWebKitAPI/Tests/WebKitGtk/resources/test.ogg: Removed.
* TestWebKitAPI/Tests/WebKitGtk/resources/test.pdf: Removed.
* TestWebKitAPI/Tests/WebKitGtk/resources/test.txt: Removed.
* TestWebKitAPI/Tests/WebKitGtk/test_utils.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/test_utils.h: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testapplicationcache.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testatk.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testatkroles.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testcontextmenu.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testcopyandpaste.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testdomdocument.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testdomdomwindow.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testdomnode.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testdownload.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testfavicondatabase.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testglobals.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testhittestresult.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testhttpbackend.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testkeyevents.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testloading.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testmimehandling.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testnetworkrequest.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testnetworkresponse.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testwebbackforwardlist.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testwebdatasource.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testwebframe.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testwebhistoryitem.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testwebinspector.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testwebplugindatabase.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testwebresource.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testwebsettings.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testwebview.c: Removed.
* TestWebKitAPI/Tests/WebKitGtk/testwindow.c: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166977 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unify and factor out page overlay implementations
https://bugs.webkit.org/show_bug.cgi?id=131353

Reviewed by Anders Carlsson.

* WebProcess/WebPage/PageOverlayController.cpp:
(WebKit::PageOverlayController::uninstallPageOverlay):
Don't turn fast scrolling back off unless the last overlay is removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166978 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Remove the WebKitGTK+ WebKit 1 code
https://bugs.webkit.org/show_bug.cgi?id=131399

Reviewed by Anders Carlsson.

.:

* Source/PlatformGTK.cmake: Remove WebKit1 dependency from dist target.
* Source/cmake/OptionsGTK.cmake: Remove option to compile with GTK+2 or with WebKit2 disabled.

Source/WebCore/platform/gtk/po:

* POTFILES.in: Remove references to WebKit1 source files from the list of
files with translatable strings.

Source/WebKit:

* PlatformGTK.cmake: Removed.
* gtk: Remove this entire directory.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166979 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed CMake build fix after r166965.

* UseJSC.cmake: Rename JSClipboardCustom.cpp to JSDataTransferCustom.cpp.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166980 268f45cc-cd09-0410-ab3c-d52691b4dbfc
HTMLConverter::aggregatedAttributesForAncestors should cache intermediate results
https://bugs.webkit.org/show_bug.cgi?id=131400

Reviewed by Sam Weinig.

Instead of accumulating attributes from a character node to the highest ancestor,
recursively call aggregatedAttributesForElementAndItsAncestors so that aggregated
attributes are cached on each ancestor to eliminate the old O(n^2) behavior.

* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::aggregatedAttributesForAncestors):
(HTMLConverter::aggregatedAttributesForElementAndItsAncestors): Extracted from aggregatedAttributesForAncestors.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Prevent deadlocks receiving WIRPermissionDenied message
https://bugs.webkit.org/show_bug.cgi?id=131406

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-04-08
Reviewed by Timothy Hatcher.

* inspector/remote/RemoteInspector.h:
* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::stop):
(Inspector::RemoteInspector::stopInternal):
(Inspector::RemoteInspector::xpcConnectionReceivedMessage):
Provide a way to stop externally and a path to stop when in
the middle of handling a message already with the locked mutex.

* inspector/remote/RemoteInspectorXPCConnection.h:
* inspector/remote/RemoteInspectorXPCConnection.mm:
(Inspector::RemoteInspectorXPCConnection::close):
(Inspector::RemoteInspectorXPCConnection::closeFromMessage):
Provide a way to close externally and a path to close when in
the middle of handling a message already with a mutex.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166982 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=131408
Scrollbars layers don't dynamically update when device scale factor changes
-and corresponding-
<rdar://problem/16503875>

Reviewed by Tim Horton.

The scrollbar layers are not children of the RenderView's layer, so they were 
completely skipped over by this function before. We need to start this higher up 
the tree in the rootGraphicsLayer(), which will typically return the 
m_overflowControlsHostLayer.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::deviceOrPageScaleFactorChanged):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166983 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Replay: memoize nondeterministic attributes of the Screen interface
https://bugs.webkit.org/show_bug.cgi?id=131339

Reviewed by Timothy Hatcher.

.:

* ManualTests/inspector/replay-window-screen.html: Added.

Source/WebCore:

The values from the screen interface are nondeterministic. Since we can't
change the physical screen dimensions, instead memoize values of attributes.

Test: ManualTests/inspector/replay-window-screen.html

* page/Screen.idl: Add Nondeterministic attribute.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166984 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r 166890): Crash inside WebKit::WebEditorClient::textFieldDidEndEditing
https://bugs.webkit.org/show_bug.cgi?id=131409

Reviewed by Anders Carlsson.

Create an empty API::InjectedBundle::FormClient to avoid crashing inside
m_mainFrame->coreFrame()->loader().detachFromParent().

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166985 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the typo in the previous commit.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166986 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the build-jsc build
https://bugs.webkit.org/show_bug.cgi?id=131410

Reviewed by Michael Saboff.

* Scripts/build-jsc: Make sure to build bmalloc before WTF, since
WTF depends on it.


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

        Stop linking WTF against bmalloc.

        Reviewed by Enrica Casucci.

        This seems to have broken an iOS buildbot script. Disable it for now
        until we can fix the script.

        * WTF.xcodeproj/project.pbxproj:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166988 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Don't call CGPathAddPath with invalid CGAffineTransform objects
https://bugs.webkit.org/show_bug.cgi?id=131413
<rdar://problem/16399645>

Reviewed by Darin Adler.

Covered by existing tests.

* platform/graphics/cg/PathCG.cpp:
(WebCore::Path::addPath):
Don't try to add the path if the affine transform isn't invertible.

* platform/graphics/transforms/AffineTransform.cpp:
(WebCore::AffineTransform::isInvertible):
Handle infinite and NaN determinants.

(WebCore::AffineTransform::inverse):
Handle infinite and NaN determinants.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166989 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: REGRESSION (r155998): Elements render at very low resolution with some 3d transforms
https://bugs.webkit.org/show_bug.cgi?id=131412
<rdar://problem/16525044>

Reviewed by Tim Horton.

In r155998 we started to compute a root-relative transform in order to choose
a good contentsScale to avoid blurring on scaling.

However, the code failed to update this transform when passing over
GraphicsLayerCAs with no uncommitted changes, which caused us to choose
an incorrect contentsScale sometimes, resulting in blurriness.

Fix by updating the root-relative transform on layers with no uncommitted
changes.

Test: compositing/contents-scale/incremental-change.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):

LayoutTests: REGRESSION (r155998): Elements render at very low resolution with some 3d transforms
https://bugs.webkit.org/show_bug.cgi?id=131412

Reviewed by Tim Horton.

Test that makes an incremental change to a layer property in a tree with
interesting 3d transforms.

* compositing/contents-scale/incremental-change-expected.html: Added.
* compositing/contents-scale/incremental-change.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166990 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed EFL build fix attempt since r166956

Source/WebCore:

* page/efl/DragControllerEfl.cpp: Rename Clipboard to DataTransfer.
(WebCore::DragController::declareAndWriteDragImage):

Source/WebKit/efl:

* WebCoreSupport/DragClientEfl.cpp: Rename Clipboard to DataTransfer.
(WebCore::DragClientEfl::willPerformDragSourceAction):
(WebCore::DragClientEfl::startDrag): Ditto.
* WebCoreSupport/DragClientEfl.h:

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