[iOS WebKit2] Can't activate text fields on Facebook
https://bugs.webkit.org/show_bug.cgi?id=132682

Reviewed by Enrica Casucci.


Source/WebCore: 
* page/DOMTimer.cpp:
(WebCore::DOMTimer::fired):
        
    The isDocument() test here had reversed in the merge breaking content change observer callback.

Source/WebKit2: 
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
(WebKit::WebChromeClient::observedContentChange):
        
    Implement content change observer callback.

* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
        
    If the event gets canceled by a potential change (a started short-duration timer)
    save the position and node so we can continue later.

(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
        
    If it turns out the observed timer changed nothing continue the click event.

(WebKit::WebPage::completeSyntheticClick):
        
    Factored click event dispatch part of handleSyntheticClick here.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168473 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] webkitdom script assumes mkdir only fails because the directory already exists
https://bugs.webkit.org/show_bug.cgi?id=132674

Reviewed by Philippe Normand.

Only ignore mkdir failure when exception is raised because the
file already exists and it's a directory.

* gtk/webkitdom.py:
(write_doc_files):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168474 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r168471): Duplicate builddirs broke the build master.
https://bugs.webkit.org/show_bug.cgi?id=132688

Patch by Carlos Alberto Lopez Perez <clopez@igalia.com> on 2014-05-08
Reviewed by Carlos Garcia Campos.

Rename the builddirs of the new GTK bots introduced on r168471 to
be unique. Otherwise the master will break.

* BuildSlaveSupport/build.webkit.org-config/config.json:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168475 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add support for drawFocusIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=132584

Reviewed by Dirk Schulze.

Source/WebCore:
The drawFocusIfNeeded API will draw a focus ring if the element that is passed
in is focused and a child element of the canvas.

Test: fast/canvas/draw-focus-if-needed.html

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawFocusIfNeeded):
* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/CanvasRenderingContext2D.idl:

LayoutTests:
* fast/canvas/draw-focus-if-needed-expected.txt: Added.
* fast/canvas/draw-focus-if-needed.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168476 268f45cc-cd09-0410-ab3c-d52691b4dbfc
"shouldKeepCurrentBackForwardListItemInList" API should pass clientInfo to the callback
<rdar://problem/16855357> and https://bugs.webkit.org/show_bug.cgi?id=132692

Reviewed by Tim Horton.

Source/WebKit2:
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageLoaderClient):
* UIProcess/API/C/WKPageLoaderClient.h:

Tools:
* TestWebKitAPI/Tests/WebKit2/ShouldKeepCurrentBackForwardListItemInList.cpp:
(TestWebKitAPI::shouldKeepCurrentBackForwardListItemInList):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168477 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make BlobDataFileReference manage its sandbox extension
https://bugs.webkit.org/show_bug.cgi?id=132689

Reviewed by Anders Carlsson.


Source/WebCore: 
* WebCore.exp.in: Export symbols that are now needed in WebKit2 to subclass BlobDataFileReference.

* fileapi/ThreadableBlobRegistry.cpp: (WebCore::ThreadableBlobRegistry::registerFileBlobURL):
* platform/network/BlobData.cpp: (WebCore::BlobData::appendFile):
* platform/network/BlobData.h: (WebCore::BlobDataItem::BlobDataItem):
* platform/network/BlobRegistry.h:
* platform/network/BlobRegistryImpl.cpp: (WebCore::BlobRegistryImpl::registerFileBlobURL):
* platform/network/BlobRegistryImpl.h:
BlobRegistry now takes a BlobDataFileReference and not a path, so that WebKit2
could pass objects that include sandbox extensions.

* platform/network/BlobDataFileReference.h:
* platform/network/BlobDataFileReference.cpp:
(WebCore::BlobDataFileReference::~BlobDataFileReference): Added a virtual destructor.
(WebCore::BlobDataFileReference::size): We now record the size and modification time right away, no need to lazily calculate them.
(WebCore::BlobDataFileReference::expectedModificationTime): Ditto.
(WebCore::BlobDataFileReference::startTrackingModifications): Record time and size
(since it's a single call). However, size calculation will become complicated again soon.
(WebCore::BlobDataFileReference::prepareForFileAccess): A hook for subclasses.
(WebCore::BlobDataFileReference::revokeFileAccess): Ditto.
(WebCore::BlobDataFileReference::computeFileSystemData): Deleted.

Source/WebKit2: 
* CMakeLists.txt:
* PlatformGTK.cmake:
* WebKit2.xcodeproj/project.pbxproj:
Added BlobDataFileReferenceWithSandboxExtension.

* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerFileBlobURL):
(WebKit::NetworkBlobRegistry::registerBlobURL):
(WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
(WebKit::NetworkBlobRegistry::unregisterBlobURL):
(WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
(WebKit::NetworkBlobRegistry::filesInBlob):
(WebKit::NetworkBlobRegistry::sandboxExtensions): Deleted.
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
We no longer track sandbox extensions here. Instead, provide a way to get files
for a blob, which contain extensions and can allow access to themselves.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::NetworkResourceLoader):
(WebKit::NetworkResourceLoader::consumeSandboxExtensions):
(WebKit::NetworkResourceLoader::invalidateSandboxExtensions):
* NetworkProcess/NetworkResourceLoader.h:
Allow/revoke access to files in blob, just like we do for explicitly passed extensions.

* Shared/BlobDataFileReferenceWithSandboxExtension.cpp: Added.
(WebKit::BlobDataFileReferenceWithSandboxExtension::BlobDataFileReferenceWithSandboxExtension):
(WebKit::BlobDataFileReferenceWithSandboxExtension::~BlobDataFileReferenceWithSandboxExtension):
(WebKit::BlobDataFileReferenceWithSandboxExtension::prepareForFileAccess):
(WebKit::BlobDataFileReferenceWithSandboxExtension::revokeFileAccess):
* Shared/BlobDataFileReferenceWithSandboxExtension.h: Added.
(WebKit::BlobDataFileReferenceWithSandboxExtension::create):
A subclass of BlobDataFileReference that also contains a sandbox extension. NetworkProcess
always uses it in BlobRegistryImpl.

* WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerFileBlobURL):
* WebProcess/FileAPI/BlobRegistryProxy.h:
Updated for BlobRegistry interface changes. BlobRegistryProxy doesn't really need
a BlobDataFileReference here, as it only uses a path, but it needs to implement the same interface
as BlobRegistryImpl.



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