Fix crash in WebKit client app when zooming
https://bugs.webkit.org/show_bug.cgi?id=132475
<rdar://problem/16703405>

Reviewed by Tim Horton.

It's possible for a WebTiledBackingLayer CALayer to remain in the CALayer
hierarchy after we've called -invalidate on it, which clears the _tileController.
Project the getters against null derefs to handle this.

* platform/graphics/ca/mac/WebTiledBackingLayer.mm:
(-[WebTiledBackingLayer isOpaque]):
(-[WebTiledBackingLayer acceleratesDrawing]):
(-[WebTiledBackingLayer contentsScale]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168226 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Very fuzzy layers under non-decompasable matrices
https://bugs.webkit.org/show_bug.cgi?id=132516
<rdar://problem/16717478>

Reviewed by Sam Weinig.

Source/WebCore:
r155977 added code to modify layer contentsScale based on a root-relative
scale, so that scaled-up layers remained sharp. It does this by decomposing
an accumulated matrix, but failed to test whether the decomposition
succeeded. This would result in contentsScale of 0, which is clamped to 0.1,
resulting in very fuzzy layers.

Fix by testing for success of decomposition.

Test: compositing/contents-scale/non-decomposable-matrix.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::maxScaleFromTransform):
* platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::decompose2): Return early for identity matrices,
with fix for m11 and m22.
(WebCore::TransformationMatrix::decompose4): Return early for identity matrices.
* platform/graphics/transforms/TransformationMatrix.h:
Make Decomposed2Type and Decomposed4Type into C++ structs.
(WebCore::TransformationMatrix::Decomposed2Type::operator==): Added to make it easier
to write code that asserts that decomposition is correct.
(WebCore::TransformationMatrix::Decomposed4Type::operator==): Ditto.

LayoutTests:
Compare scaling under non-decomposable and decomposable matrices.

* compositing/contents-scale/non-decomposable-matrix-expected.html: Added.
* compositing/contents-scale/non-decomposable-matrix.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[UI-side compositing] Assertion in PlatformCAFilters::setFiltersOnLayer with animated reference filter
https://bugs.webkit.org/show_bug.cgi?id=132528
<rdar://problem/16671660>

Reviewed by Tim Horton.

Source/WebKit2:
Allow PASSTHROUGH filters to be encoded and sent to the UI process; they can be set
on layers as the result of a filter animation using a reference filter, and just get
ignored anyway, but encoding them maintains consistency of the filters list.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<FilterOperation>::encode): Assert during encoding if
we try to encode a NONE or REFERENCE filter (to match the decoding assertions).
(IPC::decodeFilterOperation): Allow decoding of PASSTHROUGH filters. Have
trying to decode a NONE or REFERENCE filter mark the message as invalid.
(IPC::ArgumentCoder<IDBKeyData>::decode): Mark the message invalid when receiving
unexpected key types.
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTextStream::operator<<): Have the logging not crash if
a filter is null (should never happen).

LayoutTests:
Make the animation duration a little longer to cause bug 132528 to reproduce more
reliably. The test does notifyDone() from an animation start event, so this doesn't
increase test duration.

* css3/filters/crash-filter-animation-invalid-url.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168228 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa WebKit2] Add basic _WKWebsiteDataStore implementation
https://bugs.webkit.org/show_bug.cgi?id=132526

Reviewed by Anders Carlsson.

- Renames WKSession to _WKWebsiteDataStore to better reflect its intended use (renaming
  the implementation object will come later).
- Makes _WKWebsiteDataStore work as a wrapped Objective-C object.
- Adds the ability to set a _WKWebsiteDataStore on the WKWebViewConfiguration.

* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* UIProcess/API/Cocoa/WKSession.h:
* UIProcess/API/Cocoa/WKSession.mm:
(-[WKSession dealloc]): Deleted.
(-[WKSession ephemeral]): Deleted.
(-[WKSession API::]): Deleted.
* UIProcess/API/Cocoa/WKSessionInternal.h:
(WebKit::wrapper): Deleted.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _websiteDataStore]):
(-[WKWebViewConfiguration _setWebsiteDataStore:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStore.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKSession.h.
* UIProcess/API/Cocoa/_WKWebsiteDataStore.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKSession.mm.
(+[_WKWebsiteDataStore nonPersistentDataStore]):
(-[_WKWebsiteDataStore isNonPersistentDataStore]):
(-[WKSession ephemeral]): Deleted.
* UIProcess/API/Cocoa/_WKWebsiteDataStoreInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKSessionInternal.h.
* WebKit2.xcodeproj/project.pbxproj:


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