[Mac] Deprecate getPropertyShorthand from objective c bindings for future removal
https://bugs.webkit.org/show_bug.cgi?id=98916

Reviewed by Timothy Hatcher.

Mark getPropertyShorthand as deprecated so we can remove it later. It will allow us
to remove getPropertyShorthand from the web exposed API (this function is not part of
any specification, it was there for historical reason).

No new tests : just mark a function as deprecated.

* bindings/objc/PublicDOMInterfaces.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130943 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix after r130940.

* platform/graphics/skia/GraphicsContextSkia.cpp:
(WebCore::GraphicsContext::drawLineForDocumentMarker):
Avoid redefining the same variable twice.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130944 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Add empty WebCompositorFrame/WebCompositorFrameAck
https://bugs.webkit.org/show_bug.cgi?id=98841

Reviewed by James Robinson.

These were used in the WebKit API but never defined.

* chromium/public/WebCompositorFrame.h: Added.
(WebKit):
* chromium/public/WebCompositorFrameAck.h: Added.
(WebKit):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130945 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Switch CachedResource over from SharedBuffer to a new ResourceBuffer
https://bugs.webkit.org/show_bug.cgi?id=98541

Reviewed by Anders Carlsson.

Source/WebCore:

As part of preparation for a WebKit2 NetworkProcess, we need to change the data handle shared
between CachedResources and ResourceLoaders to be one that can be backed by something other
than a SharedBuffer.

ResourceBuffer is this new object. Right now it is directly backed by a SharedBuffer and there
should be no change in behavior.

No new tests (No behavior change).

* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* WebCore.vcproj/WebCore.vcproj:
* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:

Implementation of the new ResourceBuffer, backed directly by a SharedBuffer:
* loader/ResourceBuffer.cpp: Added.
(WebCore):
(WebCore::ResourceBuffer::ResourceBuffer):
(WebCore::ResourceBuffer::~ResourceBuffer):
(WebCore::ResourceBuffer::data):
(WebCore::ResourceBuffer::size):
(WebCore::ResourceBuffer::isEmpty):
(WebCore::ResourceBuffer::getSomeData):
(WebCore::ResourceBuffer::sharedBuffer):
(WebCore::ResourceBuffer::copy):
(WebCore::ResourceBuffer::hasPurgeableBuffer):
(WebCore::ResourceBuffer::releasePurgeableBuffer):
(WebCore::ResourceBuffer::createCFData):

* loader/ResourceBuffer.h: Added.
(WebCore):
(ResourceBuffer):
(WebCore::ResourceBuffer::create):
(WebCore::ResourceBuffer::adoptSharedBuffer):
* loader/mac/ResourceBuffer.mm: Added.

(WebCore):
(WebCore::ResourceBuffer::createNSData):

Switch CachedResource over to using it:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::makePurgeable):

* loader/cache/CachedResource.h:
(WebCore):
(WebCore::CachedResource::resourceBuffer):
(CachedResource):

Switch all the other CachedResource subclasses over to using it:
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::data):

* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::data):
(WebCore::CachedFont::ensureCustomFontData):

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::didAddClient):
(WebCore::CachedImage::data):

* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::data):

* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::data):

* loader/cache/CachedShader.cpp:
(WebCore::CachedShader::data):

* loader/cache/CachedTextTrack.cpp:
(WebCore::CachedTextTrack::data):

* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::data):

Switch other affect parties over to using it:
* inspector/InspectorPageAgent.cpp:
(WebCore::decodeBuffer):
(WebCore::InspectorPageAgent::cachedResourceContent):
(WebCore::InspectorPageAgent::sharedBufferContent):

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::subresource):

* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::processNewCueData):
(WebCore::TextTrackLoader::didReceiveData):

* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):

* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::notifyFinished):

* platform/mac/PasteboardMac.mm:
(WebCore::fileWrapperForImage):

Source/WebKit/mac:

* WebView/WebHTMLView.mm:
(-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]):

Source/WebKit/win:

* WebDataSource.cpp:
(WebDataSource::subresourceForURL):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130947 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WebKit2] Create an API for adding and removing user stylesheets from a page group
https://bugs.webkit.org/show_bug.cgi?id=98432

Reviewed by Sam Weinig.

Source/WebKit2:

This patch adds the following API to WKBrowsingContextGroup:

- (void)addUserStyleSheet:(NSString *)source baseURL:(NSURL *)baseURL whitelist:(NSArray *)whitelist blacklist:(NSArray *)blacklist mainFrameOnly:(BOOL)mainFrameOnly;
- (void)removeAllUserStyleSheets;

Sheets added via this API are sent to all processes that contain a page
in the given page group. Sheets are also cached in the UI process in a
new object called UserContentContainer, which is a property of each
group's WebPageGroupData and is sent to new web processes during page
initialization.

This is less than ideal, since new pages added to a pre-existing
process / page group combination will send redundant user stylesheet
strings over the wire. To avoid this we'd have to keep track track of
the groups that currently exist in each process and only send user
content during page creation if it is the first time a process has seen
the page's group. I decided to not add this complexity for the time
being, but we might need to consider it if we find that the current
approach impacts performance for clients that heavily utilize user
content.

* Shared/API/c/WKArray.cpp:
(WKArrayCreateAdoptingValues): Add a WKArray creation function that
adopts the incoming WKTypeRefs rather than refing them.
* Shared/API/c/WKArray.h:
* Shared/API/c/WKBase.h: Move WKUserContentInjectedFrames out of
WKBundlePrivate.h so it can be used in WKPageGroup, too.
* Shared/API/c/cf/WKURLCF.cpp:
(WKURLCreateWithCFURL): Return 0 for null CFURLRefs instead of crashing
inside CFURLGetString().
* Shared/ImmutableArray.cpp:
(WebKit::ImmutableArray::ImmutableArray): Add a tag to differentiate
between the adopting and refing ctors.
* Shared/ImmutableArray.h:
(WebKit::ImmutableArray::create): Call the refing ctor.
(WebKit::ImmutableArray::adopt): Call the adopting ctor.
* Shared/UserContentContainer.cpp: Added.
(UserContentItemMessageEncoder): Create a UserMessageEncoder for
serializing UserContentContainer::Item's APIObjects.
(WebKit::UserContentItemMessageEncoder::UserContentItemMessageEncoder):
(WebKit::UserContentItemMessageEncoder::encode):
(UserContentItemMessageDecoder): Create a UserMessageEncoder for
deserializing UserContentContainer::Item's APIObjects.
(WebKit::UserContentItemMessageDecoder::UserContentItemMessageDecoder):
(WebKit::UserContentItemMessageDecoder::decode):
(WebKit::UserContentContainer::Item::Item):
(WebKit::encodeStringArray): Add a helper function for encoding
ImmutableArrays of WebStrings.
(WebKit::UserContentContainer::Item::encode): Encode the item's
properties using UserContentItemMessageEncoder.
(WebKit::decodeStringArray): Add a helper function for decoding
ImmutableArrays of WebStrings.
(WebKit::UserContentContainer::Item::decode): Decode the item's
properties using UserContentItemMessageDecoder.
(WebKit::toStringVector): Add a helper function for converting an
ImmutableArray of WebStrings to a Vector of Strings.
(WebKit::UserContentContainer::Item::whitelist): Use toStringVector().
(WebKit::UserContentContainer::Item::blacklist): Ditto.
(WebKit::UserContentContainer::encode): Encode the Vector of UserContentContainer::Items.
(WebKit::UserContentContainer::decode): Decode the Vector of UserContentContainer::Items.
* Shared/UserContentContainer.h: Added.
* Shared/WebPageGroupData.cpp:
(WebKit::WebPageGroupData::encode): Include userStyleSheets when encoding.
(WebKit::WebPageGroupData::decode): Include userStyleSheets when decoding.
* Shared/WebPageGroupData.h:
(WebPageGroupData): Add a UserContentContainer called userStyleSheets
to WebPageGroupData.
* UIProcess/API/C/WKPageGroup.cpp: Add the C SPI version of the Objective-C API.
(WKPageGroupAddUserStyleSheet):
(WKPageGroupRemoveAllUserStyleSheets):
* UIProcess/API/C/WKPageGroup.h:
* UIProcess/API/mac/WKBrowsingContextGroup.h: Add the Objective-C API.
* UIProcess/API/mac/WKBrowsingContextGroup.mm:
(createWKArray): Add a helper function that converts an NSArray of NSStrings to a WKArray of WKStrings.
(-[WKBrowsingContextGroup addUserStyleSheet:baseURL:whitelist:blacklist:mainFrameOnly:]):
Implement the Objective-C API in terms of the C SPI.
(-[WKBrowsingContextGroup removeAllUserStyleSheets]): Ditto.
* UIProcess/WebPageGroup.cpp:
(WebKit::WebPageGroup::addUserStyleSheet): Add the new sheet to the
group's WebPageGroupData, which ensures that the group's sheets are
sent to new web processes.
(WebKit::WebPageGroup::removeAllUserStyleSheets): Ditto for removal.
* UIProcess/WebPageGroup.h:
(WebKit::WebPageGroup::sendToAllProcessesInGroup): Add a helper message
that sends a message to all processes that have a page in the current
group. This is used to add new user sheets to already-initialized page
groups in the UI processes.
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: Moved
WKUserContentInjectedFrames from here to WKBase.h.
* WebProcess/WebPage/WebPageGroupProxy.cpp:
(WebKit::WebPageGroupProxy::WebPageGroupProxy): Add each sheet in the
WebPageGroupData to WebCore's page group.
(WebKit::WebPageGroupProxy::addUserStyleSheet): Add the sheet received
from the UI process to WebCore's page group.
(WebKit::WebPageGroupProxy::removeAllUserStyleSheets): Remove all
sheets from WebCore's page group.
* WebProcess/WebPage/WebPageGroupProxy.h:
* WebProcess/WebPage/WebPageGroupProxy.messages.in: Define
AddUserStyleSheet and RemoveAllUserStyleSheets, two messages sent from
the UI process to a web process's WebPageGroupProxy.

Tools:

Add three new API tests:

- Test adding a user stylesheet before a page is created. This tests
the code path where the sheet is sent to the web process as part of
the new page's WebPageCreationParameters.
- Test adding a user stylesheet after a page is created. This tests the
code patch where the sheet is sent as a separate message to all
processes containing the given page group.
- Test removing all user stylesheets.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2ObjC/UserContentTest.mm: Added.
(-[UserContentTestLoadDelegate initWithBlockToRunOnLoad:]):
(-[UserContentTestLoadDelegate browsingContextControllerDidFinishLoad:]):
(expectScriptValue):
* TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextGroupTest.mm:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130948 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, speculative build fix for Qt Win.

* css/makegrammar.pl: Rather than making a temp file, use a pipe to
pass data from gcc to the final output file.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130949 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Turn on ENABLE_MATHML for Chromium
https://bugs.webkit.org/show_bug.cgi?id=96960

Reviewed by Adam Barth.

Source/WebCore: 

Add the rendering/mathml directory to search.

* WebCore.gyp/WebCore.gyp:

Source/WebKit/chromium: 

* features.gypi:

LayoutTests: 

We're enabling MathML now partly to let the automated fuzzers go to work. Some layout tuning will also be done in the
next few days, so we expect MathML pixel tests to be changing during that time.

* platform/chromium/TestExpectations:


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