Add a RemoteLayerTreeHost object in the UI process
https://bugs.webkit.org/show_bug.cgi?id=101999

Reviewed by Tim Horton.

Add a (mostly empty) RemoteLayerTreeHost class that will live in the UI process and host the layer tree.

* DerivedSources.make:
Add RemoteLayerTreeHost.messages.in.

* Platform/CoreIPC/MessageID.h:
Add a RemoteLayerTreeHost message class.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::addMessageReceiver):
(WebKit::WebProcessProxy::removeMessageReceiver):
(WebKit::WebProcessProxy::didReceiveMessage):
(WebKit::WebProcessProxy::didReceiveSyncMessage):
* UIProcess/WebProcessProxy.h:
Add a message receiver map to the web process proxy.

* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
Add a RemoteLayerTreeHost member variable.

* UIProcess/mac/RemoteLayerTreeHost.h:
Add new class.

* UIProcess/mac/RemoteLayerTreeHost.messages.in:
Add new messages file with a single Commit message.

* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::RemoteLayerTreeHost):
Add the layer tree host as a message receiver.

(WebKit::RemoteLayerTreeHost::~RemoteLayerTreeHost):
Remote the layer tree host as a message receiver.

(WebKit::RemoteLayerTreeHost::didReceiveMessage):
Call the generated member function.

(WebKit::RemoteLayerTreeHost::commit):
Add an empty stub for now.

* WebKit2.xcodeproj/project.pbxproj:
Add new files.

* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::flushLayers):
Send a commit message to the remote layer tree host.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134324 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] WebKit1 gardening.

Mark fast/repaint/block-selection-gap-stale-cache.html and
fast/repaint/block-selection-gap-stale-cache-2.html as image failures.

* platform/efl-wk1/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PDFPlugin should use PDFKit's context menu instead of the default WebKit one
https://bugs.webkit.org/show_bug.cgi?id=101896
<rdar://problem/12555173>

Reviewed by Anders Carlsson.

Show the context menu that PDFKit vends us instead of the default WebKit one
when PDFPlugin is told to show a context menu.

Also, react to the didChangeContentScaleFactor callback, so that when the context
menu (or HUD) is used to change the scale factor, we can inform PluginView.

* WebProcess/Plugins/PDF/PDFLayerControllerDetails.h:
Add pdfLayerController:didChangeContentScaleFactor: delegate callback.
Rename tileScaleFactor to contentScaleFactor.
Add rightMouseDown: and menuForEvent: on PDFLayerController.
* WebProcess/Plugins/PDF/PDFPlugin.h:
(PDFPlugin):
Add notifyContentScaleFactorChanged, handleContextMenuEvent, and nsEventForWebMouseEvent.
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(-[WKPDFLayerControllerDelegate pdfLayerController:didChangeContentScaleFactor:]): Forward content scale factor changes to PDFPlugin.
(WebKit::PDFPlugin::pdfDocumentDidLoad): Rename tileScaleFactor to contentScaleFactor.
(WebKit::PDFPlugin::geometryDidChange): Rename tileScaleFactor to contentScaleFactor.
(WebKit::eventTypeFromWebEvent): It turns out we can infer whether the mouse is being dragged during a MouseMove event
by whether it has a mouse button associated with it or not, so we don't need to track this state manually.
(WebKit::PDFPlugin::nsEventForWebMouseEvent): Factor the part of handleMouseEvent that creates NSEvents* out into its own function.
(WebKit::PDFPlugin::handleMouseEvent):
Don't track mouseButtonIsDown manually, make use of the new nsEventForWebMouseEvent.
Hand rightMouseDown: to PDFLayerController instead of mouseDown: if necessary.
(WebKit::PDFPlugin::handleContextMenuEvent): Grab the relevant NSMenu from PDFKit and display it.
(WebKit::PDFPlugin::handleKeyboardEvent): Don't pass a bogus mouseButtonIsDown to eventTypeFromWebEvent.
(WebKit::PDFPlugin::notifyContentScaleFactorChanged): Update PluginView and co.'s notion of page scale when
PDFKit changes it (generally from the context menu/HUD). Also update page size and scrollbar size/position.
(WebKit::PDFPlugin::setScrollOffset): Don't call SimplePDFPlugin's implementation, as PDFKit handles invalidation itself.
* WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
(WebKit::PDFPluginChoiceAnnotation::updateGeometry): Rename tileScaleFactor to contentScaleFactor.
* WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
(WebKit::PDFPluginTextAnnotation::updateGeometry): Rename tileScaleFactor to contentScaleFactor.
* WebProcess/Plugins/PDF/SimplePDFPlugin.h: Make m_scrollOffset protected.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134326 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Fix docking behavior on Windows.
https://bugs.webkit.org/show_bug.cgi?id=101978

Reviewed by Brian Weinstein.

There are a number of problems with docking behaviour on Windows.
For starters, it does not ever constrain the inspector's size properly while docked.
It also does not properly set the whether or not the inspector can be docked/undocked.
This patch fixes both issues.

* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::frontendLoaded):
Switch order of calling bringToFront and setDockingUnavailable.
* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorFrontendClient::frontendLoaded): 
(WebInspectorFrontendClient::attachWindow):
Call restoreAttachedWindowHeight so that when first loading or reattaching the inspector,
we resize the inspector window properly.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134327 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Get rid of the CrossOriginRedirectReceived message to the NetworkProcess.
https://bugs.webkit.org/show_bug.cgi?id=102010

Reviewed by Alexey Proskuryakov.

This message was a stop-gap measure for when the NetworkProcess did scheduling but not loading.
Now that the NetworkProcess does loading it doesn't need to be told when redirect is received.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in: Get rid of the message to the NetworkProcess.

* NetworkProcess/NetworkRequest.cpp:
(WebKit::NetworkRequest::willSendRequest): After willSendRequest is dispatched to the WebProcess, directly call
  "receivedRedirect" on the NetworkResourceLoadScheduler.

* NetworkProcess/NetworkResourceLoadScheduler.cpp:
(WebKit::NetworkResourceLoadScheduler::receivedRedirect): Renamed from crossOriginRedirectReceived, as the
  function already checks to see if the redirect was actually cross-origin.
* NetworkProcess/NetworkResourceLoadScheduler.h:

* WebProcess/Network/WebResourceLoadScheduler.cpp:
(WebKit::WebResourceLoadScheduler::crossOriginRedirectReceived): A no-op so the WebProcess doesn't
  do any host record accounting of its own.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134328 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] V8Event::valueAccessorGetter() in custom binding is not used
https://bugs.webkit.org/show_bug.cgi?id=101893

Reviewed by Adam Barth.

No tests. No change in behavior.

* bindings/v8/custom/V8EventCustom.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134329 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix filter dirty rect regression from r134311
https://bugs.webkit.org/show_bug.cgi?id=102002

Reviewed by Beth Dakin.

When rendering with filters, the code can inflate the root-relative
paintDirtyRect in RenderLayer::paintLayerContents(), and my cleanup
broke this behavior.

Fix by making a local copy of LayerPaintingInfo, updating its paintDirtyRect,
and using it for the rest of the function.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134330 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Send along the current remote layer tree transaction with the commit message
https://bugs.webkit.org/show_bug.cgi?id=102014

Reviewed by Tim Horton.

Add encode and decode member functions to RemoteLayerTreeTransaction and RemoteLayerTreeTransaction::LayerProperties.

* Shared/mac/RemoteLayerTreeTransaction.h:
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
(WebKit::RemoteLayerTreeTransaction::encode):
(WebKit::RemoteLayerTreeTransaction::decode):
* UIProcess/mac/RemoteLayerTreeHost.h:
* UIProcess/mac/RemoteLayerTreeHost.messages.in:
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::commit):
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::flushLayers):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134331 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Patching of jumps to stubs should use jump replacement rather than branch destination overwrite
https://bugs.webkit.org/show_bug.cgi?id=101909

Reviewed by Geoffrey Garen.

This saves a few instructions in inline cases, on those architectures where it is
easy to figure out where to put the jump replacement. Sub-1% speed-up across the
board.

* assembler/MacroAssemblerARMv7.h:
(MacroAssemblerARMv7):
(JSC::MacroAssemblerARMv7::canJumpReplacePatchableBranchPtrWithPatch):
(JSC::MacroAssemblerARMv7::startOfPatchableBranchPtrWithPatch):
(JSC::MacroAssemblerARMv7::revertJumpReplacementToPatchableBranchPtrWithPatch):
* assembler/MacroAssemblerX86.h:
(JSC::MacroAssemblerX86::canJumpReplacePatchableBranchPtrWithPatch):
(MacroAssemblerX86):
(JSC::MacroAssemblerX86::startOfPatchableBranchPtrWithPatch):
(JSC::MacroAssemblerX86::revertJumpReplacementToPatchableBranchPtrWithPatch):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::canJumpReplacePatchableBranchPtrWithPatch):
(MacroAssemblerX86_64):
(JSC::MacroAssemblerX86_64::startOfPatchableBranchPtrWithPatch):
(JSC::MacroAssemblerX86_64::revertJumpReplacementToPatchableBranchPtrWithPatch):
* assembler/RepatchBuffer.h:
(JSC::RepatchBuffer::startOfPatchableBranchPtrWithPatch):
(RepatchBuffer):
(JSC::RepatchBuffer::replaceWithJump):
(JSC::RepatchBuffer::revertJumpReplacementToPatchableBranchPtrWithPatch):
* assembler/X86Assembler.h:
(X86Assembler):
(JSC::X86Assembler::revertJumpTo_movq_i64r):
(JSC::X86Assembler::revertJumpTo_cmpl_im_force32):
(X86InstructionFormatter):
* bytecode/StructureStubInfo.h:
* dfg/DFGRepatch.cpp:
(JSC::DFG::replaceWithJump):
(DFG):
(JSC::DFG::tryCacheGetByID):
(JSC::DFG::tryBuildGetByIDList):
(JSC::DFG::tryBuildGetByIDProtoList):
(JSC::DFG::tryCachePutByID):
(JSC::DFG::dfgResetGetByID):
(JSC::DFG::dfgResetPutByID):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134332 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Ensure we only receive one KeyUp per key event
https://bugs.webkit.org/show_bug.cgi?id=101967

Patch by Nima Ghanavatian <nghanavatian@rim.com> on 2012-11-12
Reviewed by Rob Buis.

We are creating synthetic KeyUps too often, and get into trouble since IMF will send up a KeyUp on all key events.
Furthermore, these KeyUps can arrive both when we are composing and not. To bypass this check, we are storing the KeyDown
character and comparing against it on KeyUp.

Internally reviewed by Mike Fenton.

* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::InputHandler):
(BlackBerry::WebKit::InputHandler::handleKeyboardInput):
(BlackBerry::WebKit::InputHandler::insertText):
(BlackBerry::WebKit::InputHandler::setText):
* WebKitSupport/InputHandler.h:
(InputHandler):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134333 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix windowRect calculation for webplugin due to page scale factors
https://bugs.webkit.org/show_bug.cgi?id=100182

Patch by Min Qin <qinmin@chromium.org> on 2012-11-12
Reviewed by Adam Barth.

The current calculaton of windowRect in WebPluginContainerImpl is wrong. Even after some of our latest changes.
The problem is caused by page scale factor.
For example, windowToContents(IntPoint) will return an unscaled offset for an iframe, but will return a scaled offset for the main frame. So in order to obtain the correct window coordinate, we need to use contentsToWindow().
Since webview_plugin.cc is expecting window coordinates, we need to use contentsToWindow(IntRect) to calculate the windowRect so that the rect size can get correctly scaled.
It is difficult to write a test for this because it's pixel-based, and plugin placeholder is managed on the Chromium side (webview_plugin.cc).

* src/WebPluginContainerImpl.cpp:
(WebKit::WebPluginContainerImpl::paint):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134334 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Convert some non-simple tests from setVersion to upgradeneeded
https://bugs.webkit.org/show_bug.cgi?id=101959

Reviewed by Tony Chang.

Ongoing work to remove calls to setVersion from our tests before
removing it from the IndexedDB API.

* storage/indexeddb/create-and-remove-object-store-expected.txt:
* storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-expected.txt:
* storage/indexeddb/duplicates-expected.txt:
* storage/indexeddb/resources/create-and-remove-object-store.js:
  Create and delete were running between open and setVersion, which no
  longer makes sense.

* storage/indexeddb/resources/database-deletepending-flag.js:
  Use optional object parameter instead of optional version parameter.

* storage/indexeddb/resources/deletedatabase-delayed-by-open-and-versionchange.js:
  This used to call delete just after issuing setVersion but before
  receiving the corresponding success event.  Now it calls delete while
  in the upgradeneeded transaction, still causing the delete to be
  delayed by an in flight versionchange transaction.

* storage/indexeddb/resources/duplicates.js:
  Call indexedDBTest twice to rerun the tests with a different
  database.

* storage/indexeddb/resources/shared.js:
  Added a suffix option to support duplicates.js, switched to an
  optional object parameter.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134335 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Include child layers in the remote layer tree transaction
https://bugs.webkit.org/show_bug.cgi?id=102026

Reviewed by Andreas Kling.

* Shared/mac/RemoteLayerTreeTransaction.h:
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
Encode and decode child layer IDs.

(WebKit::RemoteLayerTreeTransaction::layerPropertiesChanged):
Grab all child layer IDs and stick them in a vector.

(WebKit::dumpChangedLayers):
Dump child layer IDs as well.

* WebProcess/WebPage/mac/RemoteGraphicsLayer.h:
* WebProcess/WebPage/mac/RemoteGraphicsLayer.mm:
(WebKit::RemoteGraphicsLayer::setChildren):
(WebKit::RemoteGraphicsLayer::addChild):
(WebKit::RemoteGraphicsLayer::addChildAtIndex):
(WebKit::RemoteGraphicsLayer::addChildAbove):
(WebKit::RemoteGraphicsLayer::addChildBelow):
(WebKit::RemoteGraphicsLayer::replaceChild):
Call noteSublayersChanged.

(WebKit::RemoteGraphicsLayer::noteSublayersChanged):
Note that the Children property changed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134336 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Update BB10 form theme.
https://bugs.webkit.org/show_bug.cgi?id=100760

Patch by Tiancheng Jiang <tijiang@rim.com> on 2012-11-12
Reviewed by Rob Buis.

RIM PR 237003
Internally Reviewed by Eli Fidler.
Since we nolonger use small font for form controls, adjust paddingDivisor
ratio to decrease the padding value.

* platform/blackberry/RenderThemeBlackBerry.cpp:
(WebCore):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134338 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add WebCore::Setting to block displaying and/or running insecure content on secure pages
https://bugs.webkit.org/show_bug.cgi?id=58378

Patch by Josh Rickmar <jrick@devio.us> on 2012-11-12
Reviewed by Martin Robinson.

* webkit/webkitwebsettings.cpp:
(webkit_web_settings_class_init):
(webkit_web_settings_set_property):
(webkit_web_settings_get_property):
(webkit_web_settings_copy):
* webkit/webkitwebview.cpp:
(webkit_web_view_update_settings):
(webkit_web_view_settings_notify):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134339 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove Leopard only gradient code
https://bugs.webkit.org/show_bug.cgi?id=102033

Reviewed by Dan Bernstein.

USE_CG_SHADING was only ever true on Leopard, so we can remove it now.

* platform/graphics/Gradient.h:
* platform/graphics/cg/GradientCG.cpp:
(WebCore::Gradient::platformDestroy):
(WebCore::Gradient::platformGradient):
(WebCore::Gradient::paint):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, gardening.

Rebase after r134287.

* platform/chromium-mac/platform/chromium/virtual/softwarecompositing/repaint/invalidations-on-composited-layers-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134341 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Use sequence<> instead of DOMString[] in IDL
https://bugs.webkit.org/show_bug.cgi?id=100539

Reviewed by Adam Barth.

In the binding layer, DOMString[] is implemented as an alias for DOMStringList.
WebIDL usage is tending towards sequence<DOMString> anyway for inputs, so switch
to that. Note webkit.org/b/100537 which requires sequence<String> instead.

Covered by storage/indexeddb/transaction-basics.html and objectstore-basics.html

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::transaction): DOMStringList -> Vector<String>
* Modules/indexeddb/IDBDatabase.h:
(WebCore::IDBDatabase::transaction):
(IDBDatabase):
* Modules/indexeddb/IDBDatabase.idl: DOMString[] -> sequence<String>
* Modules/indexeddb/IDBObjectStore.cpp: Move trivial impls to header.
* Modules/indexeddb/IDBObjectStore.h:
(WebCore::IDBObjectStore::createIndex):
* Modules/indexeddb/IDBObjectStore.idl: DOMString[] -> sequence<String>


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134342 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: storage/indexeddb/cursor-prev-no-duplicate.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=101990

Reviewed by Tony Chang.

Race condition in test leads to flaky behavior. Refactor test to remove flake
and clean up output.

* storage/indexeddb/cursor-prev-no-duplicate-expected.txt:
* storage/indexeddb/resources/cursor-prev-no-duplicate.js:
(testFarRangeCursor_closed):
(.trans.oncomplete):
(.storeReq.onsuccess):
(runTest):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134343 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Perl errors from Tools/Scripts/copy-webkitlibraries-to-product-directory
https://bugs.webkit.org/show_bug.cgi?id=101980

Reviewed by Mark Rowe.

Remove library libWebKitSystemInterfaceLeopard.a and libWebKitSystemInterfaceSnowLeopard.a
from the list of libraries to copy to the specified built products directory
as these libraries were removed from the repository in <http://trac.webkit.org/changeset/133670>.

* Scripts/copy-webkitlibraries-to-product-directory:


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