Remote Layer Tree: Make LayerTypeCustom remote-host CALayers from the Web process
https://bugs.webkit.org/show_bug.cgi?id=123766

Reviewed by Anders Carlsson.

Put each LayerTypeCustom layer into a CAContext, so that we can
host small CALayer trees (for video, plugins, etc.) from the Web process
to the UI process without proxying their (more complex) content.

* Shared/mac/RemoteLayerTreeTransaction.h:
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode):
(WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
(WebKit::RemoteLayerTreeTransaction::dump):
Store, encode, and dump the CAContext ID of custom layers.

* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::createLayer):
Create a CALayerHost with the CAContext ID from the Web process.

* WebKit2.xcodeproj/project.pbxproj:
Add PlatformCALayerRemoteCustom.

* WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
(WebKit::GraphicsLayerCARemote::createPlatformCALayer):
Call the newly-added custom-layer constructor.

* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(PlatformCALayerRemote::create):
(PlatformCALayerRemote::PlatformCALayerRemote):
Move the call to layerWasCreated() out to ::create(), so that all of
the constructors for this class and all subclasses have completed
before we call it (so that layerWasCreated() can store the context ID
in the created layer properties object).

(WebKit::PlatformCALayerRemote::hostingContextID):
Should never be reached on the base class, only PlatformCALayerRemoteCustom.

* WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.cpp: Added.
(PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
(PlatformCALayerRemoteCustom::~PlatformCALayerRemoteCustom):
(PlatformCALayerRemoteCustom::hostingContextID):
* WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h: Added.
Add PlatformCALayerRemoteCustom, which owns a LayerHostingContext
which it will use to share a custom CALayer tree with the UI process.

* WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
Drive-by remove an unnecessary include.

* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::layerWasCreated):
Store the CAContext ID with the layer creation properties so it can
be used to create a CALayerHost upon commit in the UI process.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r158586): plugins/refcount-leaks.html fails
https://bugs.webkit.org/show_bug.cgi?id=123765

Source/JavaScriptCore: 

We were leaving a hole of one slot above a new frame when pushing the new frame on
the stack with pushFrame().  This unused slot can contain residual values that will
be marked during GC.

Reviewed by Filip Pizlo.

* interpreter/JSStackInlines.h:
(JSC::JSStack::pushFrame):

LayoutTests: 

Reviewed by Filip Pizlo.

Reverted the test expectation changes after fixing the underlying issue.

* TestExpectations:
* platform/wk2/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IDB: deleteDatabase() interface should be asynchronous
https://bugs.webkit.org/show_bug.cgi?id=123787

Reviewed by Tim Horton.

No new tests (No behavior change for a tested port).

deleteDatabase now has no return value, but calls back to a bool function:
* Modules/indexeddb/IDBBackingStoreInterface.h:
* Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
(WebCore::IDBBackingStoreLevelDB::deleteDatabase):
* Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h:

Refactor to account for the new async deleteDatabase:
* Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
(WebCore::IDBDatabaseBackendImpl::processPendingCalls):
(WebCore::IDBDatabaseBackendImpl::deleteDatabase):
(WebCore::IDBDatabaseBackendImpl::deleteDatabaseAsync):
* Modules/indexeddb/IDBDatabaseBackendImpl.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158649 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[webcore/html] remove extra header includes from cpp files.
https://bugs.webkit.org/show_bug.cgi?id=123740

Patch by Santosh Mahto <santosh.ma@samsung.com> on 2013-11-04
Reviewed by Darin Adler.

Removing redundant headers.

* html/BaseDateAndTimeInputType.cpp:
* html/ColorInputType.cpp:
* html/DOMFormData.cpp:
* html/DOMURL.cpp:
* html/DateInputType.cpp:
* html/DateTimeInputType.cpp:
* html/DateTimeLocalInputType.cpp:
* html/FTPDirectoryDocument.cpp:
* html/FileInputType.cpp:
* html/FormController.cpp:
* html/HTMLAnchorElement.cpp:
* html/HTMLAreaElement.cpp:
* html/HTMLCanvasElement.cpp:
* html/HTMLCollection.cpp:
* html/HTMLDetailsElement.cpp:
* html/HTMLDocument.cpp:
* html/HTMLElement.cpp:
* html/HTMLFormControlsCollection.cpp:
* html/HTMLFormElement.cpp:
* html/HTMLImageElement.cpp:
* html/HTMLInputElement.cpp:
* html/HTMLLegendElement.cpp:
* html/HTMLMapElement.cpp:
* html/HTMLMediaElement.cpp:
* html/HTMLOptionElement.cpp:
* html/HTMLOptionsCollection.cpp:
* html/HTMLPlugInImageElement.cpp:
* html/HTMLProgressElement.cpp:
* html/HTMLSummaryElement.cpp:
* html/HTMLTemplateElement.cpp:
* html/HTMLVideoElement.cpp:
* html/HTMLViewSourceDocument.cpp:
* html/MediaController.cpp:
* html/MediaKeyEvent.cpp:
* html/MonthInputType.cpp:
* html/RangeInputType.cpp:
* html/StepRange.cpp:
* html/TextFieldInputType.cpp:
* html/TimeInputType.cpp:
* html/WeekInputType.cpp:
* html/canvas/CanvasRenderingContext.cpp:
* html/canvas/CanvasRenderingContext2D.cpp:
* html/canvas/CanvasStyle.cpp:
* html/canvas/OESVertexArrayObject.cpp:
* html/parser/BackgroundHTMLParser.cpp:
* html/parser/CSSPreloadScanner.cpp:
* html/parser/CompactHTMLToken.cpp:
* html/parser/HTMLConstructionSite.cpp:
* html/parser/HTMLDocumentParser.cpp:
* html/parser/HTMLElementStack.cpp:
* html/parser/HTMLFormattingElementList.cpp:
* html/parser/HTMLMetaCharsetParser.cpp:
* html/parser/HTMLParserIdioms.cpp:
* html/parser/HTMLPreloadScanner.cpp:
* html/parser/HTMLTokenizer.cpp:
* html/parser/HTMLTreeBuilder.cpp:
* html/parser/HTMLTreeBuilderSimulator.cpp:
* html/parser/HTMLViewSourceParser.cpp:
* html/parser/TextDocumentParser.cpp:
* html/parser/XSSAuditor.cpp:
* html/shadow/ContentDistributor.cpp:
* html/shadow/InsertionPoint.cpp:
* html/shadow/MediaControlElements.cpp:
* html/shadow/MediaControlsApple.cpp:
* html/shadow/MediaControlsBlackBerry.cpp:
* html/shadow/MediaControlsGtk.cpp:
* html/shadow/SliderThumbElement.cpp:
* html/track/AudioTrack.cpp:
* html/track/InbandGenericTextTrack.cpp:
* html/track/InbandTextTrack.cpp:
* html/track/InbandWebVTTTextTrack.cpp:
* html/track/TextTrack.cpp:
* html/track/TextTrackCueGeneric.cpp:
* html/track/TextTrackList.cpp:
* html/track/TextTrackRegion.cpp:
* html/track/TrackListBase.cpp:
* html/track/VideoTrack.cpp:
* html/track/WebVTTParser.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158650 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Do not call setFrameRect on Widget unless its boundaries changed.
https://bugs.webkit.org/show_bug.cgi?id=123781

Reviewed by Andreas Kling.

Call Widget:setFrameRect only when the frame's rect actually changes. It also
cleans up the related weak reference code a bit.

Covered by existing tests.

* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::setWidgetGeometry):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158651 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DumpRenderTree should reset its preferences file on launch
https://bugs.webkit.org/show_bug.cgi?id=29751

Reviewed by Dan Bernstein.

Source/WebKit/mac: 

* WebView/WebView.mm:
(-[WebView _retrieveKeyboardUIModeFromPreferences:]):
Further fix reading of AppleKeyboardUIMode - reading it from kCFPreferencesAnyApplication
domain meant that current application's domain was explcitly ignored, and the only
way to override the setting in DRT was through argument domain.

Source/WebKit2: 

* UIProcess/mac/WKFullKeyboardAccessWatcher.mm:
(-[WKFullKeyboardAccessWatcher retrieveKeyboardUIModeFromPreferences:]):
Further fix reading of AppleKeyboardUIMode - reading it from kCFPreferencesAnyApplication
domain meant that current application's domain was explcitly ignored, and the only
way to override the setting in WTR was through argument domain.

Tools: 

Using NSArgumentDomain was not a good idea. While it works with NSUserDefaults
and CFPreferencesCopyAppValue family of functions, it doesn't work with
CFPreferencesCopyValue(..., kCFPreferencesCurrentApplication, ...).

So, now we'll just set defaults in the current application.

* DumpRenderTree/mac/DumpRenderTree.mm: (setDefaultsToConsistentValuesForTesting):
- Delete the defaults.
- Removed CFPreferencesSetAppValue calls, as -setValuesForKeysWithDictionary: does the same.
- The comment about [NSUserDefaults standardUserDefaults] indirectly initializing NSApplication was incorrect.

* WebKitTestRunner/mac/main.mm: (setDefaultsToConsistentValuesForTesting):
Switched to -setValuesForKeysWithDictionary for consistency.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
internal-js-tests.yaml/Octane/stress-tests/pdfjs.js.default: ASSERTION FAILED: m_state.forNode(child).m_futurePossibleStructure.isSubsetOf(StructureSet(structure)) at DFGConstantFoldingPhase.cpp:249
https://bugs.webkit.org/show_bug.cgi?id=123778

Unreviewed, remove the other such assertion.

* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):



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