Unreviewed, rolling out r171704.
https://bugs.webkit.org/show_bug.cgi?id=135389

Broke two IndexedDB tests (Requested by ap on #webkit).

Reverted changeset:

"IDB transactions never reset if the Web Process ends before
cleaning up"
https://bugs.webkit.org/show_bug.cgi?id=135218
http://trac.webkit.org/changeset/171704

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171748 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make WKOriginDataManager actually operate on IndexedDatabases.
https://bugs.webkit.org/show_bug.cgi?id=135346

Reviewed by Sam Weinig (and David Kilzer and Alex Christensen)

Source/WebCore:
* WebCore.exp.in:

Source/WebKit2:
* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::DatabaseProcess):
(WebKit::DatabaseProcess::getIndexedDatabaseOrigins):
(WebKit::DatabaseProcess::doGetIndexedDatabaseOrigins):
(WebKit::removeAllDatabasesForOriginPath): Utility to delete all database files for the given origin path
    that have been modified between the given dates.
(WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin):
(WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesForOrigin):
(WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedBetweenDates):
(WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesModifiedBetweenDates):
(WebKit::DatabaseProcess::deleteAllIndexedDatabaseEntries):
(WebKit::DatabaseProcess::doDeleteAllIndexedDatabaseEntries):
* DatabaseProcess/DatabaseProcess.h:

* Shared/WebCrossThreadCopier.cpp:
(WebCore::SecurityOriginData>::copy):
* Shared/WebCrossThreadCopier.h:

* UIProcess/WebOriginDataManagerProxy.cpp:
(WebKit::WebOriginDataManagerProxy::getOrigins):
(WebKit::WebOriginDataManagerProxy::didGetOrigins):
(WebKit::WebOriginDataManagerProxy::deleteEntriesForOrigin):
(WebKit::WebOriginDataManagerProxy::deleteEntriesModifiedBetweenDates):
(WebKit::WebOriginDataManagerProxy::deleteAllEntries):

* WebProcess/OriginData/WebOriginDataManager.cpp:
(WebKit::WebOriginDataManager::getOrigins): Pipe IDB requests through to the DatabaseProcess.
(WebKit::WebOriginDataManager::deleteEntriesForOrigin): Ditto.
(WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates): Ditto.
(WebKit::WebOriginDataManager::deleteAllEntries): Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171749 268f45cc-cd09-0410-ab3c-d52691b4dbfc
VisitedLinkState::determineLinkState should take a reference
https://bugs.webkit.org/show_bug.cgi?id=135375

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-07-29
Reviewed by Sam Weinig.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::State::initElement):
* dom/VisitedLinkState.h:
(WebCore::VisitedLinkState::determineLinkState):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171752 268f45cc-cd09-0410-ab3c-d52691b4dbfc
URTBF for !ENABLE(DATABASE_PROCESS) platforms.

* WebProcess/OriginData/WebOriginDataManager.cpp:
(WebKit::WebOriginDataManager::getOrigins):
(WebKit::WebOriginDataManager::deleteEntriesForOrigin):
(WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates):
(WebKit::WebOriginDataManager::deleteAllEntries):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171753 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PPT: run-webkit-tests doesn't upload crash logs to bots
https://bugs.webkit.org/show_bug.cgi?id=135391

Reviewed by Joseph Pecoraro.

* WebKitTestRunner/TestController.cpp: (WTR::TestController::processDidCrash):
Not a fix to be proud of, but better than not having it work at all.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171756 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] REGRESSION(r171526): PDF documents fail to load in WebKit1 with disk image caching enabled
https://bugs.webkit.org/show_bug.cgi?id=135359
<rdar://problem/17824645>

Reviewed by Darin Adler.

r171526 broke the case where we have a memory mapped file from the DiskImageCache in the
SharedBuffer. In such a case, m_buffer is empty and createCFData() returned an
WebCoreSharedBufferData with an empty buffer.

Fix this by taking the easy route of bringing back the old code for the disk image cache
file backed case. In the long run we probably want to remove the iOS specific disk image
cache anyway.

Review also uncovered another bug in r171526 where we were balancing an Objective-C alloc
with a CFRelease which is incorrect when running under GC. Fix that by using adoptNS along
with adoptCF which is what the code did before.

No new tests because the bug only occurs on device and we can't run tests on device yet.

* platform/mac/SharedBufferMac.mm:
(-[WebCoreSharedBufferData initWithDiskImageSharedBuffer:]):
(-[WebCoreSharedBufferData length]):
(-[WebCoreSharedBufferData bytes]):
(WebCore::SharedBuffer::createCFData):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171766 268f45cc-cd09-0410-ab3c-d52691b4dbfc
fast/borders/border-radius-on-subpixel-position-non-hidpi.html fails on Retina machines
https://bugs.webkit.org/show_bug.cgi?id=135398

Reviewed by Zalan Bujtas.


Tools: 
* WebKitTestRunner/TestController.cpp: (WTR::TestController::updateWindowScaleForTest):
"hidpi-" should be at the start. This allows "hidpi-" in both file and directory names.

* DumpRenderTree/mac/DumpRenderTree.mm: (changeWindowScaleIfNeeded): Same fix.
For some reason, I wasn't seeing this test fail on WK1 even without the fix, not
sure why.

LayoutTests: 
* platform/mac-wk2/TestExpectations: Let's try to unskip the test, maybe this was
the actual reason for it to appear failing?



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WKPDFView paints rotated pages squished
https://bugs.webkit.org/show_bug.cgi?id=135401
<rdar://problem/17173916>

Reviewed by Simon Fraser.

* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView _computePageAndDocumentFrames]):
[page size] returns the crop box's size, ignoring rotation.
[page cropBoxAccountForRotation] respects rotation, but otherwise returns the same size.
UIPDFPageView will respect rotation when painting, so we
should make sure that it is given an aspect ratio that also
respects rotation, so that the page isn't squished.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171775 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION [WebKit2 iOS]: Cannot add shortcut to user dictionary from non editable content.
https://bugs.webkit.org/show_bug.cgi?id=135392
<rdar://problem/17760073>

Reviewed by Benjamin Poulain.

Adding a shortcut to the user dictionary needs to be available in non editable content too.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _addShortcut:]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171782 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Eliminate more forced layouts during timeline recordings
https://bugs.webkit.org/show_bug.cgi?id=135397

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

Instead of computing the secondsPerPixel in each overview graph,
we can ask the overview view itself which has a cached value.
The computation used to force a layout, now it doesn't need to.

* UserInterface/Views/LayoutTimelineOverviewGraph.js:
* UserInterface/Views/NetworkTimelineOverviewGraph.js:
* UserInterface/Views/ScriptTimelineOverviewGraph.js:
* UserInterface/Views/TimelineOverview.js:
(WebInspector.TimelineOverview):
* UserInterface/Views/TimelineOverviewGraph.js:
(WebInspector.TimelineOverviewGraph):
(WebInspector.TimelineOverviewGraph.prototype.get timelineOverview):
(WebInspector.TimelineOverviewGraph.prototype.set timelineOverview):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: breakpoints are always speculatively resolved when restored from local storage
https://bugs.webkit.org/show_bug.cgi?id=135396

Reviewed by Timothy Hatcher.

A longstanding quirk/optimization in the frontend is that we immediately set a breakpoint
as resolved if the breakpoint was successfully set in the backend. This ensures that clicking in
the gutter immediately produces a resolved breakpoint with only one round-trip.

However, not all breakpoints should be speculatively resolved, because the corresponding resource
may not be loaded yet. This situation causes problems for code that assumes a resolved breakpoint
also has a valid sourceCodeLocation.sourceCode.

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.restoreBreakpointsSoon): Don't leak the variable to global scope.
(WebInspector.DebuggerManager):
(WebInspector.DebuggerManager.prototype.speculativelyResolveBreakpoint):
(WebInspector.DebuggerManager.prototype.addBreakpoint): Speculatively resolve here if requested
using the success callback passed to _setBreakpoint.

(WebInspector.DebuggerManager.prototype.didSetBreakpoint): Emit simulated
Debugger.breakpointResolved events since they are only sent by the backend when a script is parsed.

(WebInspector.DebuggerManager.prototype._setBreakpoint):
* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype.textEditorBreakpointAdded): Request speculative resolve.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171784 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash when using 'em' units to specify font-size inside animation keyframe.
<https://webkit.org/b/135395>
<rdar://problem/17851910>

Source/WebCore:
We'd forgotten to initialize the "parent style" when resolving keyframe
styles, and this led to a crash in length conversion where the code
assumes a parent style will be present.

To keep this fix minimal, simply make the "parent style" a clone of the
base element style.

Reviewed by Simon Fraser.

Test: fast/animation/keyframe-with-font-size-in-em-units.html

* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleForKeyframe):

LayoutTests:
Add a reduced test case to cover this bug.

Reviewed by Simon Fraser.

* fast/animation/keyframe-with-font-size-in-em-units-expected.txt: Added.
* fast/animation/keyframe-with-font-size-in-em-units.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171785 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Reduce forced layouts in TimelineOverview
https://bugs.webkit.org/show_bug.cgi?id=135405

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

Remove another forced layout. The scroll container won't
change size unless the ContentView itself resized. Make the
distinction between a layout update due to a resize and
normal events (scale changes, etc) and only calculate
element sizes then.

* UserInterface/Views/TimelineContentView.js:
(WebInspector.TimelineContentView.prototype.updateLayout):
* UserInterface/Views/TimelineOverview.js:
(WebInspector.TimelineOverview):
(WebInspector.TimelineOverview.prototype.get visibleDuration):
(WebInspector.TimelineOverview.prototype.updateLayoutForResize):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Only compute full ProfileNode times if needed - Legacy Profiler
https://bugs.webkit.org/show_bug.cgi?id=135406

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

Full ProfileNode times are only used by the Legacy Profiler. The new profile
information in the Scripts Timelines currently never uses the pass. We should
avoid calculating it if we never use it.

* UserInterface/Models/ProfileNode.js:
(WebInspector.ProfileNode.prototype.get startTime):
(WebInspector.ProfileNode.prototype.get endTime):
(WebInspector.ProfileNode.prototype.get selfTime):
(WebInspector.ProfileNode.prototype.get totalTime):
(WebInspector.ProfileNode.prototype.establishRelationships):
(WebInspector.ProfileNode.prototype._computeTotalTimes):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171787 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Do not initialize g_type system explicitly in the ewk_init()
https://bugs.webkit.org/show_bug.cgi?id=135407

Reviewed by Gyuyoung Kim.

EFL build requires glib version 2.38 but g_type_init() has been deprecated
since version 2.36. As the type system is initialized automatically since
version 2.36, we do not need to call g_type_init() in the ewk_init().

https://developer.gnome.org/gobject/unstable/gobject-Type-Information.html#g-type-init

* UIProcess/API/efl/ewk_main.cpp:
(ewk_init):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add knowledge of the iOS Simulator to webkitpy
http://bugs.webkit.org/show_bug.cgi?id=133963

Reviewed by Simon Fraser.

* Scripts/webkitdirs.pm:
(argumentsForConfiguration): Add --ios-sim*
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
--runtime and --device-type args added.
* Scripts/webkitpy/port/base.py:
* Scripts/webkitpy/port/driver.py: Add simulator driver.
(IOSSimulatorDriver): Added.
* Scripts/webkitpy/port/factory.py: Add simulator platform.
* Scripts/webkitpy/port/ios.py: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171789 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: 80% of time during recording is spent creating source code locations for profile nodes
https://bugs.webkit.org/show_bug.cgi?id=135399

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

Profiling the inspector while recording a timeline, a significant amount of
time was spent creating SourceCodeLocation objects for profiling information
and call frames. A lot of this data was eagerly being processed, even though
it would not immediately be presentable to the user.

This makes two significant changes. We create a LazySourceCodeLocation class
which does as little as possible until display information is requested. We
also lazily convert the profiler payload data to a Profile object, so the
processing is only done if you drill into the Script specific timeline.

This results in a significant performance improvement in the overview view.

* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager.prototype.eventRecorded.processRecord):
(WebInspector.TimelineManager.prototype.eventRecorded):
(WebInspector.TimelineManager.prototype._callFramesFromPayload.createCallFrame):
(WebInspector.TimelineManager.prototype._callFramesFromPayload):
(WebInspector.TimelineManager.prototype._profileFromPayload.profileNodeFromPayload): Deleted.
(WebInspector.TimelineManager.prototype._profileFromPayload.profileNodeCallFromPayload): Deleted.
(WebInspector.TimelineManager.prototype._profileFromPayload): Deleted.
Do not eagerly process profile payloads. Instead pass the payload to ScriptTimelineRecords.
Likewise create callframes with lazy source code locations to do the minimum amount of work.

* UserInterface/Models/ScriptTimelineRecord.js:
(WebInspector.ScriptTimelineRecord):
(WebInspector.ScriptTimelineRecord.prototype.get profile):
(WebInspector.ScriptTimelineRecord.prototype._initializeProfileFromPayload.profileNodeFromPayload):
(WebInspector.ScriptTimelineRecord.prototype._initializeProfileFromPayload.profileNodeCallFromPayload):
(WebInspector.ScriptTimelineRecord.prototype._initializeProfileFromPayload):
Only when the profile is asked do we process the profiler payload information.
This defer the processing until at least the user drills into the Script timeline.

* UserInterface/Main.html:
Add the new class and ensure SourceCodeLocation is available beforehand.

* UserInterface/Models/LazySourceCodeLocation.js: Added.
(WebInspector.LazySourceCodeLocation):
(WebInspector.LazySourceCodeLocation.prototype.isEqual):
(WebInspector.LazySourceCodeLocation.prototype.get sourceCode):
(WebInspector.LazySourceCodeLocation.prototype.set sourceCode):
(WebInspector.LazySourceCodeLocation.prototype.get formattedLineNumber):
(WebInspector.LazySourceCodeLocation.prototype.get formattedColumnNumber):
(WebInspector.LazySourceCodeLocation.prototype.formattedPosition):
(WebInspector.LazySourceCodeLocation.prototype.hasFormattedLocation):
(WebInspector.LazySourceCodeLocation.prototype.hasDifferentDisplayLocation):
(WebInspector.LazySourceCodeLocation.prototype.resolveMappedLocation):
(WebInspector.LazySourceCodeLocation.prototype._lazyInitialization):
Only when display information is requested will we perform extra processing.
For basic information we do not need to check for formatted (pretty-printed) info.

* UserInterface/Models/SourceCode.js:
(WebInspector.SourceCode.prototype.createLazySourceCodeLocation):
Provide an explict create function for lazy source codes.

* UserInterface/Models/SourceCodeLocation.js:
(WebInspector.SourceCodeLocation.prototype.set sourceCode):
(WebInspector.SourceCodeLocation.prototype.get displaySourceCode):
(WebInspector.SourceCodeLocation.prototype.get displayLineNumber):
(WebInspector.SourceCodeLocation.prototype.get displayColumnNumber):
(WebInspector.SourceCodeLocation.prototype.hasMappedLocation):
(WebInspector.SourceCodeLocation.prototype.setSourceCode):
(WebInspector.SourceCodeLocation.prototype.resolveMappedLocation):
(WebInspector.SourceCodeLocation.prototype._makeChangeAndDispatchChangeEventIfNeeded):
(WebInspector.SourceCodeLocation.prototype._resolveMappedLocation): Deleted.
Include two protected functions which LazySourceCodeLocation overrides.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171790 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Unreviewed EFL gardening. Rebaseline tests after r170418.

* platform/efl/mathml/opentype/horizontal-expected.txt:
* platform/efl/mathml/opentype/horizontal-munderover-expected.txt:
* platform/efl/mathml/opentype/large-operators-expected.txt:
* platform/efl/mathml/opentype/vertical-expected.txt:
* platform/efl/mathml/presentation/menclose-notation-default-longdiv-expected.txt:
* platform/efl/mathml/presentation/mo-stretch-expected.png:
* platform/efl/mathml/presentation/mo-stretch-expected.txt:
* platform/efl/mathml/presentation/roots-expected.png:
* platform/efl/mathml/presentation/roots-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Remove WebKitCertificateInfo from WebKit2GTK+ API
https://bugs.webkit.org/show_bug.cgi?id=134830

Reviewed by Gustavo Noronha Silva.

Source/WebKit2:
It was added to make the API more convenient but it has ended up
making it more complicated. WebKitWebView::load-failed-with-tls-errors
now receives a GTlsCertificate + GTlsCertificateFlags and
webkit_web_context_allow_tls_certificate_for_host() receives a GTlsCertificate
since the errors are not actually needed. This makes the API more
consistent with the existing method webkit_web_view_get_tls_info().

* PlatformGTK.cmake: Remove files from compilation.
* UIProcess/API/gtk/WebKitCertificateInfo.cpp: Removed.
* UIProcess/API/gtk/WebKitCertificateInfo.h: Removed.
* UIProcess/API/gtk/WebKitCertificateInfoPrivate.h: Removed.
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkit_web_context_allow_tls_certificate_for_host):
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_class_init):
(webkitWebViewLoadFailedWithTLSErrors):
* UIProcess/API/gtk/WebKitWebView.h:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
* UIProcess/API/gtk/webkit2.h:

Tools:
Update the SSL test for the API changes.

* TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp:
(testLoadFailedWithTLSErrors):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171792 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CMake] Bump the minimum required version
https://bugs.webkit.org/show_bug.cgi?id=135382

Reviewed by Gyuyoung Kim.

* CMakeLists.txt: Bump the minimum required version to 2.8.11 after
we introduced usage of target_include_directories().


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