Add stubbed out WKRemoteObjectRegistry class
https://bugs.webkit.org/show_bug.cgi?id=123512

Reviewed by Andreas Kling.

Also add a WKRemoteObjectInterface class that represents a remote object interface.

* Shared/API/Cocoa/WKRemoteObjectInterface.h: Added.
* Shared/API/Cocoa/WKRemoteObjectInterface.mm: Added.
(-[WKRemoteObjectInterface initWithProtocol:identifier:]):
(+[WKRemoteObjectInterface remoteObjectInterfaceWithProtocol:]):
* Shared/API/Cocoa/WKRemoteObjectRegistry.h: Added.
* Shared/API/Cocoa/WKRemoteObjectRegistry.mm: Added.
(-[WKRemoteObjectRegistry registerExportedObject:interface:]):
(-[WKRemoteObjectRegistry unregisterExportedObject:interface:]):
(-[WKRemoteObjectRegistry remoteObjectProxyWithInterface:]):
* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158274 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unguard Element::childShouldCreateRenderer
https://bugs.webkit.org/show_bug.cgi?id=123496

Reviewed by Andreas Kling.

Make Element::childShouldCreateRenderer normally accessible. Guarding it with flags
just leaves potential build issues.

No new tests since no functionality changed.

* dom/Element.cpp:
(WebCore::Element::childShouldCreateRenderer):
* dom/Element.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Curl][Win] Suggested filename of download is not url decoded.
https://bugs.webkit.org/show_bug.cgi?id=123511

Patch by peavo@outlook.com <peavo@outlook.com> on 2013-10-30
Reviewed by Brent Fulgham.

* WebDownloadCurl.cpp:
(WebDownload::didReceiveResponse): Url decode suggested filename.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158276 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Curl] Cookies are sometimes not set in download request.
https://bugs.webkit.org/show_bug.cgi?id=123445

Patch by peavo@outlook.com <peavo@outlook.com> on 2013-10-30
Reviewed by Brent Fulgham.

Sometimes cookies are not set in the download request because the cookie file cannot be opened,
it's already been opened by the ResourceHandleManager for writing.
This can be fixed by getting the cookie list from the share handle in ResourceHandleManager instead.
This will also improve performance, as there is no need to read and parse the cookie file for each download.

* platform/network/curl/CurlDownload.cpp:
(WebCore::CurlDownload::init): Use share handle to get cookie list.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WIN] Add missing USE(CFNETWORK) to WebError.h
https://bugs.webkit.org/show_bug.cgi?id=121834

Reviewed by Brent Fulgham.

WebError.cpp uses USE(CFNETWORK), so add it to the header too.

* WebError.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158278 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add debug settings for simple line layout
https://bugs.webkit.org/show_bug.cgi?id=123514

Source/WebCore: 

Reviewed by Andreas Kling.

* WebCore.exp.in:
* page/Settings.in:
        
    Add simpleLineLayoutEnabled and simpleLineLayoutDebugBordersEnabled.

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseFor):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintDebugBorders):
(WebCore::SimpleLineLayout::paintFlow):

Source/WebKit2: 

Reviewed by Andreas Kling.
        
Expose debug settings.

* Shared/WebPreferencesStore.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetSimpleLineLayoutEnabled):
(WKPreferencesGetSimpleLineLayoutEnabled):
(WKPreferencesSetSimpleLineLayoutDebugBordersEnabled):
(WKPreferencesGetSimpleLineLayoutDebugBordersEnabled):
* UIProcess/API/C/WKPreferencesPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158279 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix memory leaks in platform/image-encoders/JPEGImageEncoder.cpp
https://bugs.webkit.org/show_bug.cgi?id=118781

Patch by Liangjun Zeng <lizeng@blackberry.com> on 2013-10-30
Reviewed by Brent Fulgham.

We can find the function "jpeg_finish_compress" call the function "jpeg_abort" at the end.
And the comments of "jpeg_abort" is "Abort processing of a JPEG compression operation,
but don't destroy the object itself". (We can find these in the "jcapimin.c" of jpeg)
So the compression object destroy need be called.
No new tests because this doesn't change functionality.

* platform/image-encoders/JPEGImageEncoder.cpp:
(WebCore::compressRGBABigEndianToJPEG):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158280 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add result caching for Math.cos
https://bugs.webkit.org/show_bug.cgi?id=123255

Patch by Iago Toral Quiroga <itoral@igalia.com> on 2013-10-30
Reviewed by Brent Fulgham.

* runtime/MathObject.cpp:
(JSC::mathProtoFuncCos):
* runtime/VM.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158281 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Compile errors when enabling DFG JIT.
https://bugs.webkit.org/show_bug.cgi?id=120998

Patch by peavo@outlook.com <peavo@outlook.com> on 2013-10-30
Reviewed by Brent Fulgham.

Source/JavaScriptCore:

* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Added files.
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: Ditto.
* dfg/DFGAllocator.h: Removed scope.
* dfg/DFGWorklist.cpp: Use new ThreadingOnce class instead of pthread_once.
(JSC::DFG::globalWorklist):
* heap/DeferGC.h: Link fix, member needs to be public.
* jit/JITOperationWrappers.h: Added required assembler macros.

Source/WTF:

* wtf/CompilationThread.cpp: Use new ThreadingOnce class instead of pthread_once.
(WTF::initializeCompilationThreads):
* wtf/ThreadingOnce.h: Added ThreadingOnce class encapsulating pthread_once functionality.
(WTF::ThreadingOnce::ThreadingOnce):
(WTF::ThreadingOnce::~ThreadingOnce):
(WTF::ThreadingOnce::callOnce):
* wtf/text/CString.h: Export needed symbols.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158282 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Teach the style checker how to handle Objective-C categories and NS_ENUM
https://bugs.webkit.org/show_bug.cgi?id=123482

Reviewed by Dan Bernstein.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_spacing_for_function_call): Allow a space before '(' in a line
starting with @interface or @implementation, since this is defining an
Objective-C category rather than a function.
(check_braces): The opening brace of an NS_ENUM should not be on its
own line.
* Scripts/webkitpy/style/checkers/cpp_unittest.py: Added unit tests.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158283 268f45cc-cd09-0410-ab3c-d52691b4dbfc
A WebGL test times out sometimes.

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158284 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unbreak the release build.

* rendering/SimpleLineLayoutFunctions.cpp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158285 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSExport doesn't support constructors
https://bugs.webkit.org/show_bug.cgi?id=123380

Reviewed by Geoffrey Garen.

Support for constructor-style callbacks for the Objective-C API to JSC is currently limited to 
Objective-C blocks. Any clients who try to call the constructor of a JSExport-ed Objective-C class 
are met with a type error stating that it cannot be called as a constructor.

It would be nice to expand JSExport's functionality to support this idiom. It is a natural 
extension to JSExport and would increase the expressiveness and simplicity in both Objective-C and 
JavaScript client code.

The way we'll do this is to expand the capabilities of ObjCCallbackFunction and associated classes. 
Instead of constructing a normal C API object for the constructor, we'll instead allocate a full-blown 
ObjCCallbackFunction object which can already properly handle being invoked as a constructor.

* API/JSWrapperMap.mm:
(copyMethodsToObject):
(allocateConstructorForCustomClass):
(-[JSObjCClassInfo allocateConstructorAndPrototypeWithSuperClassInfo:]):
(tryUnwrapObjcObject):
* API/ObjCCallbackFunction.h:
(JSC::ObjCCallbackFunction::impl):
* API/ObjCCallbackFunction.mm:
(JSC::ObjCCallbackFunctionImpl::ObjCCallbackFunctionImpl):
(JSC::ObjCCallbackFunctionImpl::wrappedConstructor):
(JSC::ObjCCallbackFunctionImpl::isConstructible):
(JSC::ObjCCallbackFunction::getConstructData):
(JSC::ObjCCallbackFunctionImpl::name):
(JSC::ObjCCallbackFunctionImpl::call):
(objCCallbackFunctionForInvocation):
(objCCallbackFunctionForInit):
(tryUnwrapConstructor):
* API/tests/testapi.mm:
(-[TextXYZ initWithString:]):
(-[ClassA initWithA:]):
(-[ClassB initWithA:b:]):
(-[ClassC initWithA:]):
(-[ClassC initWithA:b:]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158286 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Fix PrettyPrinting Tool Load from Saved URL

Reviewed by Timothy Hatcher.

* Tools/PrettyPrinting/index.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158287 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE] Remove legacy Media Source APIs (WebKitMediaSource, WebKitSourceBuffer, WebKitSourceBufferList)
https://bugs.webkit.org/show_bug.cgi?id=123463

Reviewed by Eric Carlson.

Source/WebCore:

No new tests; updated test results.

Remove all reference to WebKitMediaSource, WebKitSourceBuffer, and WebKitSourceBufferList.

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* GNUmakefile.list.am:
* Modules/mediasource/DOMURLMediaSource.idl:
* Modules/mediasource/WebKitMediaSource.cpp: Removed.
* Modules/mediasource/WebKitMediaSource.h: Removed.
* Modules/mediasource/WebKitMediaSource.idl: Removed.
* Modules/mediasource/WebKitSourceBuffer.cpp: Removed.
* Modules/mediasource/WebKitSourceBuffer.h: Removed.
* Modules/mediasource/WebKitSourceBuffer.idl: Removed.
* Modules/mediasource/WebKitSourceBufferList.cpp: Removed.
* Modules/mediasource/WebKitSourceBufferList.h: Removed.
* Modules/mediasource/WebKitSourceBufferList.idl: Removed.
* WebCore.xcodeproj/project.pbxproj:
* dom/EventTargetFactory.in:

LayoutTests:

* platform/mac/js/dom/global-constructors-attributes-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158288 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Update NEWS and Versions.m4 for 2.3.1 release.

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2013-10-29

* Source/autotools/Versions.m4: Bump version numbers.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mavericks: 128 tests are failing due to pixel differences
https://bugs.webkit.org/show_bug.cgi?id=123488

Reviewed by Simon Fraser.

Apple font preferences cannot be fully reset after they've been read, so we
need to set them using CFPreferences before initializing NSApplication.

In theory, this should be an issue on WebKit2 as well, but somehow it doesn't
appear to be. I guess we can figure out the reasons for this difference when/if
any observable problems start to occur.

* DumpRenderTree/mac/DumpRenderTree.mm:
(setDefaultsToConsistentValuesForTesting): Only set defaults here, move other work
to prepareConsistentTestingEnvironment().
(main): Call setDefaultsToConsistentValuesForTesting before [NSApplication sharedApplication]
(which is unnecessary anyway since NSUserDefaults will implicitly call it, but seems
useful to keep in case we change out approach to defaults again).



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158290 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE] Add MediaSource compatable loading functions to MediaPlayer
https://bugs.webkit.org/show_bug.cgi?id=123353

Reviewed by Eric Carlson.

Add methods to MediaPlayer to allow it to select the correct MediaPlayerFactory
when attempting to load a MediaSource URL.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::addSourceBuffer):
(WebCore::MediaSource::isTypeSupported):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::loadResource):
(WebCore::HTMLMediaElement::canPlayType):
(WebCore::HTMLMediaElement::selectNextSourceChild):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::load):
(WebCore::MediaPlayer::supportsType):
* platform/graphics/MediaPlayer.h:
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):

Remove the isSupportedMediaSourceMIMEType() method:
* platform/MIMETypeRegistry.h:
* platform/efl/MIMETypeRegistryEfl.cpp:
* platform/mac/MIMETypeRegistryMac.mm:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Favicons are flipped in vertical direction in WinCairo builds.
https://bugs.webkit.org/show_bug.cgi?id=102077

Patch by peavo@outlook.com <peavo@outlook.com> on 2013-10-30
Reviewed by Brent Fulgham.

* platform/graphics/win/ImageCairoWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize):

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