../JavaScriptCore: [Win] Support compiling with VS2013
https://bugs.webkit.org/show_bug.cgi?id=125353

Reviewed by Anders Carlsson.

* API/tests/testapi.c: Use C99 defines if available.
* jit/JITOperations.cpp: Don't attempt to define C linkage when
returning a C++ object.

../WebCore: [Win] Support compiling with VS2013
https://bugs.webkit.org/show_bug.cgi?id=125353

Reviewed by Anders Carlsson.

* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create): Use nullptr
(WebCore::LegacyWebArchive::createFromSelection): Ditto

../WebKit: [Win] Support compiling with VS2013.
https://bugs.webkit.org/show_bug.cgi?id=125353

Reviewed by Anders Carlsson.

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: Provide
proper exports for VS2013 build.

../WTF: [Win] Support compiling with VS2013
https://bugs.webkit.org/show_bug.cgi?id=125353

Reviewed by Anders Carlsson.

* wtf/Compiler.h: Show proper features for VS2012 and VS2013.
* wtf/MathExtras.h: Don't implement common C99 routines when
they are available through the runtime libraries.
* wtf/RetainPtr.h:
(WTF::RetainPtr::operator bool): Added.
* wtf/StdLibExtras.h: Use Microsoft's version of make_unique
when it exists.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160254 268f45cc-cd09-0410-ab3c-d52691b4dbfc
r159827 broke plug-in snapshotting
https://bugs.webkit.org/show_bug.cgi?id=125365

Reviewed by Dean Jackson.

No new tests, covered by existing tests.

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot): Return early if there is NOT
    a page, not if there IS a page.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160255 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r159543.
http://trac.webkit.org/changeset/159543
https://bugs.webkit.org/show_bug.cgi?id=125371

Build fix for mac no longer needed (Requested by rfong on
#webkit).

* ANGLE.xcodeproj/project.pbxproj:
* src/compiler/glslang_tab.cpp:
(yysyntax_error):
(glslang_parse):
* src/compiler/glslang_tab.h:
* src/compiler/preprocessor/ExpressionParser.cpp:
(yy_symbol_print):
(yy_stack_print):
(yy_reduce_print):
(yytnamerr):
(yysyntax_error):
(yydestruct):
(yyparse):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160256 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FTL should support all of Branch/LogicalNot
https://bugs.webkit.org/show_bug.cgi?id=125370

Reviewed by Mark Hahnenberg.

Source/JavaScriptCore: 

* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLIntrinsicRepository.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::boolify):

LayoutTests: 

* js/regress/logical-not-expected.txt: Added.
* js/regress/logical-not.html: Added.
* js/regress/script-tests/logical-not.js: Added.
(foo):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160257 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE] Refactor MediaSourceBase back into MediaSource
https://bugs.webkit.org/show_bug.cgi?id=125245

Reviewed by Eric Carlson.

Now that the legacy WebKitMediaSource has been removed, there is no reason to have
a separate MediaSource and MediaSourceBase. Re-integrate the two.

Copy all the methods from MediaSource into MediaSourceBase, and rename the class MediaSource:
* Modules/mediasource/MediaSource.cpp: Copied from MediaSourceBase.cpp.
(WebCore::MediaSource::create): Copied from MediaSource.cpp.
(WebCore::MediaSource::addSourceBuffer): Ditto.
(WebCore::MediaSource::removeSourceBuffer): Ditto.
(WebCore::MediaSource::isTypeSupported): Ditto.
(WebCore::MediaSource::eventTargetInterface): Ditto.
(WebCore::MediaSource::sourceBufferDidChangeAcitveState): Ditto.
* Modules/mediasource/MediaSource.h: Copied from MediaSourceBase.h.
(WebCore::MediaSource::sourceBuffers): Copied from MediaSource.h.
(WebCore::MediaSource::activeSourceBuffers): Copied from MediaSource.h.
* Modules/mediasource/MediaSourceBase.cpp: Removed.
* Modules/mediasource/MediaSourceBase.h: Removed.

Change all references to MediaSourceBase into MediaSource:
* Modules/mediasource/DOMURLMediaSource.cpp:
(WebCore::DOMURLMediaSource::createObjectURL):
* Modules/mediasource/DOMURLMediaSource.h:
* Modules/mediasource/MediaSourceRegistry.cpp:
(WebCore::MediaSourceRegistry::registerURL):
(WebCore::MediaSourceRegistry::unregisterURL):
* Modules/mediasource/MediaSourceRegistry.h:

Remove MediaSourceBase.cpp/h from the project file:
* WebCore.xcodeproj/project.pbxproj:
* GNUmakefile.list.am:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160258 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Save original text for RenderText to a map
https://bugs.webkit.org/show_bug.cgi?id=125278

Reviewed by Darin Adler.
        
Currently the original text is fetched from the Text node. This is one of the few things 
where we use the RenderText node pointer and is stopping Text nodes from being anonymous.
        
It is very rare of original text to differ from the actual text so we can just squirrel the
original to a map when it differs. This is also simplifies the code.

* rendering/RenderQuote.cpp:
(WebCore::RenderQuote::styleDidChange):
(WebCore::RenderQuote::updateDepth):
* rendering/RenderText.cpp:
(WebCore::originalTextMap):
(WebCore::RenderText::RenderText):
(WebCore::RenderText::~RenderText):
(WebCore::RenderText::styleDidChange):
(WebCore::RenderText::originalText):
(WebCore::RenderText::setTextInternal):
(WebCore::RenderText::setText):
* rendering/RenderText.h:
* rendering/RenderTextFragment.cpp:
* rendering/RenderTextFragment.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160259 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[mac] Keep around more decoded image data, since it's purgeable
https://bugs.webkit.org/show_bug.cgi?id=125273
<rdar://problem/13205438>

Reviewed by Simon Fraser.

No new tests, just an optimization.

Instead of throwing away decoded image data eagerly, allow the operating
system to manage the memory via the standard purgeability mechanism,
where it can.

This improves the performance on some pathological cases (extremely large
animated GIFs) by up to 8x.

* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::pruneLiveResourcesToSize):
Don't prune live resources' decoded data if it is purgeable.

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::destroyDecodedDataIfNecessary):
Don't eagerly throw away decoded image data if it's purgeable.

* loader/cache/CachedImage.h:
* loader/cache/CachedResource.h:
(WebCore::CachedResource::decodedDataIsPurgeable):
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:
(WebCore::Image::decodedDataIsPurgeable):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160260 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE] Add a runtime-setting for the MediaSource constructor.
https://bugs.webkit.org/show_bug.cgi?id=125336

Reviewed by Eric Carlson.

Source/WebCore:

Add a Setting to enable the MediaSource constructor.

* Modules/mediasource/MediaSource.idl:
* page/Settings.in:

Source/WebKit/mac:

Add a private WebPreference which controls the WebCore mediaSourceEnabled setting.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences mediaSourceEnabled]):
(-[WebPreferences setMediaSourceEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Add a private WKPreferences API to control the WebCore mediaSourceEnabled setting.

* Shared/WebPreferencesStore.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetMediaSourceEnabled):
(WKPreferencesGetMediaSourceEnabled):
* UIProcess/API/C/WKPreferencesPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

Enable MediaSource in DRT and WKTR.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160261 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use NeverDestroyed instead of DEFINE_STATIC_LOCAL

Reviewed by Anders Carlsson.

* rendering/RenderText.cpp:
(WebCore::originalTextMap):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160262 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE][Mac] Disable AVFoundation when enabling the MockMediaPlayerMediaSource.
https://bugs.webkit.org/show_bug.cgi?id=125338

Reviewed by Darin Adler.

The MediaSource API has some assumptions which break if more than one installed
media engine supports MediaSources at the same time. So when enabling the mock
media source engine in DRT or WKTR, disable AVFoundation so that only the mock
engine will support media source loading.

* testing/Internals.cpp:
(WebCore::Internals::initializeMockMediaSource):

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