WebKit-https.git
4 years agoFTL should pin the tag registers at inline caches
fpizlo@apple.com [Mon, 18 Apr 2016 17:13:33 +0000 (17:13 +0000)]
FTL should pin the tag registers at inline caches
https://bugs.webkit.org/show_bug.cgi?id=156678

Reviewed by Saam Barati.

This is a long-overdue fix to our inline caches. Back when we had LLVM, we couldn't rely on the tags
being pinned to any registers. So, if the inline caches needed tags, they'd have to materialize them.

This removes those materializations. This should reduce the amount of code generated in inline caches
and it should make inline caches faster. The effect appears to be small.

It may be that after this change, we'll even be able to kill the
HaveTagRegisters/DoNotHaveTagRegisters logic.

* bytecode/PolymorphicAccess.cpp:
(JSC::AccessCase::generateWithGuard):
(JSC::AccessCase::generateImpl):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compilePutById):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileTailCall):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToB3::compileIn):
(JSC::FTL::DFG::LowerDFGToB3::getById):
* jit/Repatch.cpp:
(JSC::readCallTarget):
(JSC::linkPolymorphicCall):
* jit/ThunkGenerators.cpp:
(JSC::virtualThunkFor):

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

4 years agosvn-apply: add option for ignoring changes to ChangeLog files
dburkart@apple.com [Mon, 18 Apr 2016 17:13:04 +0000 (17:13 +0000)]
svn-apply: add option for ignoring changes to ChangeLog files
https://bugs.webkit.org/show_bug.cgi?id=156618

Reviewed by Darin Adler.

This change adds a new option to svn-apply, --skip-changelogs, which short-circuits out of
patch() if the file in question is a ChangeLog.

* Scripts/svn-apply:
(patch):

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

4 years agoSource/WebCore:
bfulgham@apple.com [Mon, 18 Apr 2016 16:45:35 +0000 (16:45 +0000)]
Source/WebCore:
CSP: Remove stubs for dynamically-added favicons (via link rel="icon")
https://bugs.webkit.org/show_bug.cgi?id=153151
<rdar://problem/24383176>

Reviewed by Darin Adler.

Remove the unused dynamic favicon code and tests.

* loader/EmptyClients.h:
* loader/FrameLoaderClient.h:
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLink):

Source/WebKit/mac:
CSP: Remove stubs for dynamically-added favicons (via link rel="icon")
https://bugs.webkit.org/show_bug.cgi?id=153151
<rdar://problem/24383176>

Reviewed by Darin Adler.

Remove the unused dynamic favicon code and tests.

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::dispatchDidChangeIcons): Deleted.

Source/WebKit/win:
CSP: Make dynamically-added favicons (via link rel="icon") obey Content-Security-Policy
https://bugs.webkit.org/show_bug.cgi?id=153151
<rdar://problem/24383176>

Reviewed by Darin Adler.

Remove the unused dynamic favicon code and tests.

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::dispatchDidChangeIcons): Deleted.
* WebCoreSupport/WebFrameLoaderClient.h:

Source/WebKit2:
CSP: Remove stubs for dynamically-added favicons (via link rel="icon")
https://bugs.webkit.org/show_bug.cgi?id=153151
<rdar://problem/24383176>

Reviewed by Darin Adler.

Remove the unused dynamic favicon code and tests.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidChangeIcons): Deleted.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

LayoutTests:
CSP: Remove stubs for dynamically-added favicons (via link rel="icon")
https://bugs.webkit.org/show_bug.cgi?id=153151
<rdar://problem/24383176>

Reviewed by Darin Adler.

Remove the unused dynamic favicon code and tests.

* TestExpectations:
* http/tests/security/contentSecurityPolicy/icon-allowed-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/icon-allowed.html: Removed.
* http/tests/security/contentSecurityPolicy/icon-blocked-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/icon-blocked.html: Removed.

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

4 years ago[Mac][EME] Protected content over HLS is not notified when a HDCP violation occurs.
jer.noble@apple.com [Mon, 18 Apr 2016 16:14:36 +0000 (16:14 +0000)]
[Mac][EME] Protected content over HLS is not notified when a HDCP violation occurs.
https://bugs.webkit.org/show_bug.cgi?id=156633

Reviewed by Eric Carlson.

Pass through the existing "outputObscuredDueToInsufficientExternalProtection" status as an
error, similarly to what we do for CDMSessionMediaSourceAVFObjC.

* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
(WebCore::CDMSessionAVFoundationObjC::~CDMSessionAVFoundationObjC): Deleted.
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
(SOFT_LINK_CLASS):
(-[WebCDMSessionAVFoundationObjCListener initWithParent:player:]):
(-[WebCDMSessionAVFoundationObjCListener invalidate]):
(-[WebCDMSessionAVFoundationObjCListener observeValueForKeyPath:ofObject:change:context:]):
(WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
(WebCore::CDMSessionAVFoundationObjC::~CDMSessionAVFoundationObjC):
(WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
(WebCore::CDMSessionAVFoundationObjC::playerDidReceiveError):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
(WebCore::MediaPlayerPrivateAVFoundationObjC::avPlayer):

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

4 years agoREGRESSION( r199603): Pandora crashes WebKit in WebPlaybackSessionManager::removeClie...
jer.noble@apple.com [Mon, 18 Apr 2016 16:04:07 +0000 (16:04 +0000)]
REGRESSION( r199603): Pandora crashes WebKit in WebPlaybackSessionManager::removeClientForContext
https://bugs.webkit.org/show_bug.cgi?id=156648

Reviewed by Darin Adler.

Follow up patch to r199615; avoid a double hash lookup by using a .find() pattern instead of
.contains() & .get().

* WebProcess/cocoa/WebPlaybackSessionManager.mm:
(WebKit::WebPlaybackSessionManager::setUpPlaybackControlsManager):
(WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):

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

4 years ago[l10n] Updated Greek translation of WebKitGTK+
mcatanzaro@igalia.com [Mon, 18 Apr 2016 15:54:50 +0000 (15:54 +0000)]
[l10n] Updated Greek translation of WebKitGTK+
https://bugs.webkit.org/show_bug.cgi?id=156677

Patch by Tom Tryfonidis <tomtryf@gmail.com> on 2016-04-18
Rubber-stamped by Michael Catanzaro.

* el.po:

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

4 years agoUnreviewed, rolling out r199644.
cdumez@apple.com [Mon, 18 Apr 2016 15:36:34 +0000 (15:36 +0000)]
Unreviewed, rolling out r199644.

Seems to have caused a 1-2% regression on warm PLT

Reverted changeset:

"[WK2][iOS] Do not dlopen() QuickLook in the NetworkProcess"
https://bugs.webkit.org/show_bug.cgi?id=156639
http://trac.webkit.org/changeset/199644

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

4 years agoGet rid of IDBAny
darin@apple.com [Mon, 18 Apr 2016 15:33:30 +0000 (15:33 +0000)]
Get rid of IDBAny
https://bugs.webkit.org/show_bug.cgi?id=156681

Reviewed by Brady Eidson.

IDBAny is not part of the public interface of Indexed Database.
It was an implementation technique used to help create language bindings for
functions that have to deal with types that aren't easly expressed with the
normal IDL and C++ type system.

What was particularly dangerous about IDBAny is that it can be used to store
arbitrary JavaScript objects and it's not easy to handle garbage collection and
reference cycles when they are hidden behind this class's abstraction. It's also
a needless extra layer, a reference counted object just to carry the types from
the bindings to the C++ DOM implementation.

Ths patch also does many small style tweaks.

* CMakeLists.txt: Removed IDBAny source files. Added JSIDBRequestCustom.cpp.
* DerivedSources.cpp: Ditto.
* DerivedSources.make: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.

* Modules/indexeddb/IDBAny.cpp: Removed.
* Modules/indexeddb/IDBAny.h: Removed.
* Modules/indexeddb/IDBAny.idl: Removed.

* Modules/indexeddb/IDBCursor.cpp: Added includes needed now that headers don't
include as much.
(WebCore::IDBCursor::stringToDirection): Removed unneeded IDBCursor namespacing.
(WebCore::IDBCursor::directionToString): Ditto.
(WebCore::IDBCursor::IDBCursor): Removed creation of IDBAny object.
(WebCore::IDBCursor::direction): Removed unneeded IDBCursor namespacing.
(WebCore::IDBCursor::key): Moved this function to the header.
(WebCore::IDBCursor::primaryKey): Ditto.
(WebCore::IDBCursor::value): Ditto.
(WebCore::IDBCursor::source): Deleted this function; replaced with multiple
type-specific functions; all but one will return null.
(WebCore::IDBCursor::update): Take JSValue instead of Deprecated::ScriptValue.
(WebCore::IDBCursor::advance): Take unsigned instead of unsigned long.
Fell prey to the confusion because "unsigned long" in IDL means "unsigned" in C++.
(WebCore::IDBCursor::continueFunction): Take JSValue instead of Deprecated::ScriptValue.
(WebCore::IDBCursor::uncheckedIterateCursor): Take unsigned instead of unsigned long.
(WebCore::IDBCursor::setGetResult): Rewrote to get the VM pointer from the
ScriptExecutionContext here instead of inside the binding utilities functions.

* Modules/indexeddb/IDBCursor.h: Removed many unneeded includes.
Changed key, primaryKey, and value to no longer take an unneeded ExecState.
Made more functions private.

* Modules/indexeddb/IDBCursor.idl: Changed type of "source" to "any", which matches
the IDB specification, rather than "IDBAny". Added [CustomGetter] so we can write the
getter that understands the multiple possible values. Removed unneeded
[CallWith=ScriptState] from key and primaryKey attributes.

* Modules/indexeddb/IDBCursorWithValue.h: Marked the class final.
* Modules/indexeddb/IDBCursorWithValue.idl: Removed unneeded [CallWith=ScriptState]
from the value attribute.

* Modules/indexeddb/IDBDatabase.cpp: Added now-needed include.
* Modules/indexeddb/IDBDatabase.h: Removed this header's include of itself!

* Modules/indexeddb/IDBFactory.cpp: Added some now-needed includes.
(WebCore::IDBFactory::~IDBFactory): Moved this out of the header file.
(WebCore::IDBFactory::getDatabaseNames): Removed function that always returns nullptr.
(WebCore::IDBFactory::open): Removed unneeded release() calls when returning a RefPtr.
(WebCore::IDBFactory::cmp): Take JSValue instead of Deprecated::ScriptValue.
Also removed unneeded typecast.

* Modules/indexeddb/IDBFactory.h: Removed many unneeded includes.
Removed the getDatabaseNames function. We still need a solution here, but there is
no reason to keep the placeholder function that returns nullptr here.

* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::keyPathAny): Removed.
(WebCore::IDBIndex::openCursor): Take JSValue instead of Deprecated::ScriptValue.
(WebCore::IDBIndex::count): Ditto.
(WebCore::IDBIndex::openKeyCursor): Ditto.
(WebCore::IDBIndex::get): Ditto.
(WebCore::IDBIndex::getKey): Ditto.

* Modules/indexeddb/IDBIndex.h: Removed many unneeded includes, including this file
including itself. Marked class final. Updated for above changes.

* Modules/indexeddb/IDBIndex.idl: Changed type of "keyPath" to "any", which matches
the IDB specification, rather than "IDBAny". Specified [ImplementationReturnType=IDBKeyPath]
so the code generator creates the appropriate code to convert from an IDBKeyPath.
In the future, we may find a way to do this without an explicit attribute in the IDL
file but this is fine for now.

* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::create): Moved this here from the header. Use booleans instead
of enums because all the call sites outside this class are using booleans.
(WebCore::IDBKeyRange::IDBKeyRange): Updated to use booleans.
(WebCore::IDBKeyRange::~IDBKeyRange): Moved here from the header.
(WebCore::IDBKeyRange::lowerValue): Removed now-unneeded get().
(WebCore::IDBKeyRange::upperValue): Ditto.
(WebCore::IDBKeyRange::only): Take JSValue instead of Deprecated::ScriptValue.
(WebCore::IDBKeyRange::lowerBound): Updated for above changes.
(WebCore::IDBKeyRange::upperBound): Ditto.
(WebCore::IDBKeyRange::bound): Ditto.
(WebCore::IDBKeyRange::isOnlyKey): Removed assertions that lower and upper are not null;
there is no real guarantee of this! Rewrote and streamlined and it handles the null case now.

* Modules/indexeddb/IDBKeyRange.h: Removed unneeded includes. Changed class to use booleans
instead of enums for m_isLowerOpen and m_isUpperOpen. Moved functions into the cpp file.

* Modules/indexeddb/IDBKeyRangeData.cpp:
(WebCore::IDBKeyRangeData::maybeCreateIDBKeyRange): Updated to use booleans instead of enums.

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::name): Changed return type to const String& to cut down on
reference count churn.
(WebCore::IDBObjectStore::keyPathAny): Deleted.
(WebCore::IDBObjectStore::keyPath): Changed return type to const IDBKeyPath& to cut down on
unnecessary copies.
(WebCore::IDBObjectStore::openCursor): Take JSValue instead of Deprecated::SCriptValue.
(WebCore::IDBObjectStore::get): Ditto.
(WebCore::IDBObjectStore::putOrAdd): Ditto. Removed peculiar adoptRef/leakRef that was not needed.
(WebCore::IDBObjectStore::deleteFunction): Ditto.
(WebCore::IDBObjectStore::modernDelete): Ditto. Use releaseNonNull for better efficiency.
(WebCore::IDBObjectStore::count): Ditto.

* Modules/indexeddb/IDBObjectStore.h: Removed unneeded includes and changed types as mentioned
above in the cpp file function descriptions.

* Modules/indexeddb/IDBObjectStore.idl: Changed type of "keyPath" to "any" and
specified [ImplementationReturnType=IDBKeyPath] as above in IDBIndex.idl.

* Modules/indexeddb/IDBOpenDBRequest.cpp: Added now-needed includes.
(WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit): Removed unneeded assertions
that depend on how m_result is implemented, which changed.
(WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion): Call setResultToUndefined
instead of setting m_result directly.
(WebCore::IDBOpenDBRequest::onSuccess): Call setResult instead of setting m_result and
m_readyState directly.
(WebCore::IDBOpenDBRequest::onUpgradeNeeded):: Ditto. Also use WTFMove to set
m_transaction instead of peculiar adoptRef/leakRef.
(WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess): Call setResultToUndefined
instead of setting m_result directly.

* Modules/indexeddb/IDBOpenDBRequest.h: Marked the class final. Removed some unneeded headers
and made more things private.

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::IDBRequest): Don't initialize m_source any more. Instead initialize
m_objectStoreSource and m_indexSource, preserving the old behavior and not setting m_cursorSource
even when passed an IDBCursor.
(WebCore::IDBRequest::~IDBRequest): Simplify the code that calls clearRequest on the result
if it's a cursor. The logic is now simply a null check.
(WebCore::IDBRequest::result): Deleted. The logic is now in a custom binding.
(WebCore::IDBRequest::error): Updated to use m_isDone instead of m_readyState.
(WebCore::IDBRequest::source): Deleted. The logic is now in a custom binding.
(WebCore::IDBRequest::setSource): Set m_objectStoreSource, m_indexSource, and m_cursorSource
instead of setting m_source.
(WebCore::IDBRequest::readyState): Updated to use m_isDone instead of m_readyState.
(WebCore::IDBRequest::sourceObjectStoreIdentifier): Use m_objectStoreSource and
m_indexSource instead of using m_source. To preserve current behavior, this this does not
use m_cursorSource since the old code did not handle IDBCursor.
(WebCore::IDBRequest::sourceIndexIdentifier): Use m_indexSource instead of m_source, preserving
current behavior.
(WebCore::IDBRequest::requestedIndexRecordType): Ditto.
(WebCore::IDBRequest::dispatchEvent): Updated to use m_isDone instead of m_readyState.
(WebCore::IDBRequest::setResult): Rewrote to use the clearResult function so we don't
have to repeat the code to clear result pointers. Also take a reference.
(WebCore::IDBRequest::setResultToStructuredClone): Ditto.
(WebCore::IDBRequest::clearResult): Clear out m_scriptResult, m_cursorResult, and m_databaseResult
instead of m_result.
(WebCore::IDBRequest::setResultToUndefined): Set m_scriptResult instead of m_result.
(WebCore::IDBRequest::resultCursor): Use m_cursorResult instead of m_result.
(WebCore::IDBRequest::willIterateCursor): Updated to use m_isDone instead of m_readyState.
Also call setResultToUndefined instead of setting m_result.
(WebCore::IDBRequest::didOpenOrIterateCursor): Call setResultToUndefined and set m_cursorResult
instead of setting m_result.
(WebCore::IDBRequest::requestCompleted): Updated to use m_isDone instead of m_readyState.
(WebCore::IDBRequest::setResult): Added for use by the derived class; sets m_databaseResult.

* Modules/indexeddb/IDBRequest.h: Removed unneeded includes. Removed unused IDBRequestReadyState,
since that's now done with strings. Added cursorResult, databaseResult, scriptResult,
objectStoreSource, indexSource, and cursorSource function members and corresponding data members.
Later we might re-cast this as some sort of union, but for now these separate functions seem fine.
Removed unused modernResult function. Made more things private.

* Modules/indexeddb/IDBRequest.idl: Use "any" instead of "IDBAny" for "result" and "source".

* Modules/indexeddb/IDBTransaction.cpp: Added now-needed includes.
(WebCore::IDBTransaction::didGetRecordOnServer): Updated to call the version of setResult that takes
a reference.
(WebCore::IDBTransaction::didPutOrAddOnServer): Ditto.
* Modules/indexeddb/IDBTransaction.h: Removed unneeded includes, derive privately from ActiveDOMObject.
Removed some unneeded WebCore prefixes.

* Modules/indexeddb/server/MemoryIndex.h: Added now-needed include.

* Modules/indexeddb/server/MemoryObjectStore.cpp: Added now-needed includes.
(WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord): Remove unneeded get() call.
(WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords): Ditto.

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: Added now-needed includes.
(WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord): Remove unneeded get() call.
(WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord): Ditto.

* Modules/indexeddb/server/SQLiteIDBCursor.cpp: Added now-needed include.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp: Added now-needed includes.
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Updated to use JSValue.

* Modules/indexeddb/server/UniqueIDBDatabase.h: Added now-needed forward declaration of JSC::VM.

* bindings/js/IDBBindingUtilities.cpp: Added now-needed includes.
(WebCore::deserializeIDBValueToJSValue): Return JSValue instead of Strong<Unknown>.
(WebCore::deserializeIDBValueDataToJSValue): Ditto.
(WebCore::idbKeyDataToScriptValue): Ditto.
(WebCore::toJS): Added an overload of toJS for IDBKeyPath here. Moved here from JSIDBAnyCustom.cpp.

* bindings/js/IDBBindingUtilities.h: Removed unneeded include. Changed return types to JSValue.
Added the toJS function for IDBKeyPath.

* bindings/js/JSIDBAnyCustom.cpp: Removed.

* bindings/js/JSIDBCursorCustom.cpp: Added some now-needed includes.
(WebCore::JSIDBCursor::visitAdditionalChildren): Removed ann unneeded type cast.
(WebCore::JSIDBCursor::source): Added. Converts either the index source or the object source into
a JSValue.

* bindings/js/JSIDBRequestCustom.cpp: Added.
(WebCore::JSIDBRequest::result): Added. Throws an exception if isDone is false and then converts
cursor result, database result, or script result into a JSValue.
(WebCore::JSIDBRequest::source): Added. Converts the cursor source, index source, or object store
source into a JSValue.

* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValue): Tweaked the code for array slightly. Added an ImplementationReturnType case
for IDBKeyPath. The code that's generated is pretty generic, just a call to toJS with the conventional
arguments, so at some point we may be able to do this with C++ overloading and not require a
special case in the code generator.

* inspector/InspectorIndexedDBAgent.cpp: Put #if 0 around the getDatabaseNames code, which was
dormant and not working.
(WebCore::OpenDatabaseCallback::handleEvent): Changed this to use IDBOpenDBRequest::databaseResult
instead of calling the result function checking for an exception and then doing type checking.
(WebCore::idbKeyRangeFromKeyRange): Updated to use booleans for key range bound open state.
(WebCore::OpenCursorCallback::handleEvent): Same kind of change as for OpenDatabaseCallback above.
Also use simpler interface to key, primaryKey, and value.
(WebCore::InspectorIndexedDBAgent::requestDatabaseNames): Put #if 0 around the getDatabaseNames
code, which was dormant and not working. Needs to be re-implemented.

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

4 years agoMedia element "user gesture for fullscreen" restriction is never lifted
eric.carlson@apple.com [Mon, 18 Apr 2016 15:24:47 +0000 (15:24 +0000)]
Media element "user gesture for fullscreen" restriction is never lifted
https://bugs.webkit.org/show_bug.cgi?id=156547
<rdar://problem/25707814>

Reviewed by Jer Noble.

Source/WebCore:

Test: media/video-fullscreen-restriction-removed.html

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted): Check fullscreenPermitted rather than
  checking for a user gesture because the restriction can be removed.

LayoutTests:

* media/video-fullscreen-restriction-removed-expected.txt: Added.
* media/video-fullscreen-restriction-removed.html: Added.

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

4 years agoMark script-height reftest as ImageOnlyFailure on iOS
fred.wang@free.fr [Mon, 18 Apr 2016 15:23:45 +0000 (15:23 +0000)]
Mark script-height reftest as ImageOnlyFailure on iOS
https://bugs.webkit.org/show_bug.cgi?id=153918

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

4 years agoRefactor RenderMathMLScripts layout to avoid using flexbox
fred.wang@free.fr [Mon, 18 Apr 2016 14:45:00 +0000 (14:45 +0000)]
Refactor RenderMathMLScripts layout to avoid using flexbox
https://bugs.webkit.org/show_bug.cgi?id=153917

Patch by Frederic Wang <fwang@igalia.com> on 2016-04-18
Reviewed by Martin Robinson.

Source/WebCore:

Tests: mathml/mathml-in-html5/subsup-parameters-1.html
       mathml/opentype/large-operators-italic-correction.html

Reimplement RenderMathMLScripts without any flexbox or anonymous.
We also rely on parameters from the MATH table to improve rendering.

* css/mathml.css:
(msub > * + * + *, msup > * + * + *, msubsup > * + * + * + *, msub > mprescripts, msup > mprescripts, msubsup > mprescripts, msub > none, msup > none, msubsup > none, mmultiscripts > mprescripts ~ mprescripts, mmultiscripts > mprescripts ~ mprescripts ~ *): Deleted.
Invalid markup for scripts is now just hidden.
* rendering/mathml/RenderMathMLOperator.h: ditto.
* rendering/mathml/RenderMathMLScripts.cpp:
(WebCore::RenderMathMLScripts::unembellishedOperator): Reimplemented.
(WebCore::RenderMathMLScripts::getBaseAndScripts): Helper function to verify whether the
child list is valid and retrieve pointers on important children.
(WebCore::RenderMathMLScripts::spaceAfterScript): Helper function to get the
space after a script.
(WebCore::RenderMathMLScripts::italicCorrection): Helper function to read the
italic correction of a largeop base.
(WebCore::RenderMathMLScripts::computePreferredLogicalWidths): Implement this function.
(WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded): Helper function to get
the maximum ascent/descent of all the scripts and determine the minimal
sub/sup shifts to apply.
(WebCore::RenderMathMLScripts::mirrorIfNeeded): Helper function to calculate the horizontal
offset depending on the directionality.
(WebCore::RenderMathMLScripts::layoutBlock): Implement this function.
(WebCore::RenderMathMLScripts::firstLineBaseline): Implement this function.
(WebCore::RenderMathMLScripts::paintChildren): Implement this function.
(WebCore::RenderMathMLScripts::RenderMathMLScripts): Deleted.
(WebCore::RenderMathMLScripts::base): Deleted.
(WebCore::RenderMathMLScripts::fixAnonymousStyleForSubSupPair): Deleted.
(WebCore::RenderMathMLScripts::fixAnonymousStyles): Deleted.
(WebCore::RenderMathMLScripts::addChildInternal): Deleted.
(WebCore::RenderMathMLScripts::removeChildInternal): Deleted.
(WebCore::RenderMathMLScripts::addChild): Deleted.
(WebCore::RenderMathMLScripts::removeChild): Deleted.
(WebCore::RenderMathMLScripts::styleDidChange): Deleted.
(WebCore::RenderMathMLScripts::layout): Deleted.
(WebCore::RenderMathMLScriptsWrapper::createAnonymousWrapper): Deleted.
(WebCore::RenderMathMLScriptsWrapper::addChildInternal): Deleted.
(WebCore::RenderMathMLScriptsWrapper::addChild): Deleted.
(WebCore::RenderMathMLScriptsWrapper::removeChildInternal): Deleted.
(WebCore::RenderMathMLScriptsWrapper::removeChild): Deleted.
* rendering/mathml/RenderMathMLScripts.h: Update definitions and remove classes
for anonymous wrappers.

LayoutTests:

We import tests from the MathML in HTML5 test suite to verify various OpenType MATH parameters.
We also add a test for the italic correction of large operators (bug 130325).
Finally, we adjust some tests and expectations to take into account the new rendering.

* imported/mathml-in-html5/LICENSE: Added.
* imported/mathml-in-html5/README.md: Added.
* imported/mathml-in-html5/fonts/math/scripts-spaceafterscript3000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-spaceafterscript3000.woff.
* imported/mathml-in-html5/fonts/math/scripts-subscriptbaselinedropmin9000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-subscriptbaselinedropmin9000.woff.
* imported/mathml-in-html5/fonts/math/scripts-subscriptshiftdown6000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-subscriptshiftdown6000.woff.
* imported/mathml-in-html5/fonts/math/scripts-subscripttopmax4000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-subscripttopmax4000.woff.
* imported/mathml-in-html5/fonts/math/scripts-subsuperscriptgapmin11000-superscriptbottommaxwithsubscript3000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-subsuperscriptgapmin11000-superscriptbottommaxwithsubscript3000.woff.
* imported/mathml-in-html5/fonts/math/scripts-subsuperscriptgapmin11000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-subsuperscriptgapmin11000.woff.
* imported/mathml-in-html5/fonts/math/scripts-superscriptbaselinedropmax10000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-superscriptbaselinedropmax10000.woff.
* imported/mathml-in-html5/fonts/math/scripts-superscriptbottommin8000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-superscriptbottommin8000.woff.
* imported/mathml-in-html5/fonts/math/scripts-superscriptshiftup7000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-superscriptshiftup7000.woff.
* imported/mathml-in-html5/fonts/math/scripts-superscriptshiftupcramped5000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-superscriptshiftupcramped5000.woff.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-parameters-1-expected.txt: Renamed from LayoutTests/mathml/mathml-in-html5/subsup-parameters-1-expected.txt.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-parameters-1.html: Renamed from LayoutTests/mathml/mathml-in-html5/subsup-parameters-1.html.
* mathml/msubsup-fuzz-expected.txt: Test adjustment: Update the reference now that nothing
is displayed for invalid markup.
* accessibility/mac/mathml-multiscript-expected.txt: ditto.
* mathml/opentype/large-operators-italic-correction.html: Added. This test verifies that the
italic correction from the MATH table is used for positioning subscripts of large operators.
* mathml/opentype/large-operators-italic-correction-expected.txt: Added.
* mathml/presentation/bug95015.html: Test adjustment: move down a bit the covering red
rectangle, since the script is slightly lower.
* mathml/presentation/bug95015-expected.html: ditto
* mathml/presentation/multiscripts-positions.html: Test adjustment: Modify the expected
vertical positions of scripts now that we follow Gecko's behavior.
* mathml/presentation/multiscripts-positions-expected.html: ditto.
* mathml/presentation/multiscripts-noscripts-expected.html: There seem to be small errors in
the ascent of mmultiscripts, probably due to the conversions between firstLineBaseline (int)
and LayoutUnit (fractional pixel). For now, let's tweak the tests.
* mathml/presentation/multiscripts-noscripts.html: ditto.
* mathml/presentation/scripts-height-expected.html: ditto
* mathml/presentation/scripts-height.html: ditto
* mathml/presentation/scripts-horizontal-alignment.html: Modify the test to make it work
with the new layout rules.
* mathml/presentation/scripts-horizontal-alignment-expected.html: ditto.
* platform/gtk/accessibility/math-multiscript-attributes-expected.txt: Test adjustment:
Update reference to take into account a small shift.
* platform/mac/accessibility/math-multiscript-attributes-expected.txt: ditto.
* platform/gtk/mathml/presentation/roots-expected.png: Test adjustment: Update reference to
take into account small rendering changes.
* platform/gtk/mathml/presentation/roots-expected.txt: ditto.
* platform/ios-simulator/mathml/presentation/roots-expected.txt: ditto.
* platform/mac/TestExpectations: Mark some tests for scripts as failing on mac. MATH fonts
are really needed to make them reliable.
* platform/ios-simulator/TestExpectations: Ditto

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

4 years agoPending API Request URL is wrong after reloading
carlosgc@webkit.org [Mon, 18 Apr 2016 10:36:29 +0000 (10:36 +0000)]
Pending API Request URL is wrong after reloading
https://bugs.webkit.org/show_bug.cgi?id=139342

Reviewed by Darin Adler.

Source/WebKit2:

It happens when reloading a web view loaded with anything but a
URL, because the bf list is not updated for those cases and
WebPageProxy::reload() is setting the current bf list item URL as
pending API request URL. This also causes that progress is
reported wrongly, because
WebPageProxy::decidePolicyForNavigationAction() resets the pending
API request URL when it's different than the requested URL. The
page load transaction causes the progress to be changed, reporting
1.0 (the previous one), but later something < 1.0 is reported
again by the progress tracker.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reload): Use the current active URL as
pending API request URL, falling back to the current bf list item
URL when empty.

Tools:

Update test case to check that the active URL should remain the
same after a reload.

* TestWebKitAPI/Tests/WebKit2/PendingAPIRequestURL.cpp:
(TestWebKitAPI::TEST):

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

4 years agoPending API request URL no set when loading Data, Alternate HTML or plain text
carlosgc@webkit.org [Mon, 18 Apr 2016 10:01:45 +0000 (10:01 +0000)]
Pending API request URL no set when loading Data, Alternate HTML or plain text
https://bugs.webkit.org/show_bug.cgi?id=136916

Reviewed by Darin Adler.

Source/WebKit2:

Set pending API request URL for all load methods in
WebPageProxy. This ensures that right after calling those methods,
the active URL is the requested one and that
PageLoadState::isLoading() returns true.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadAlternateHTMLString):
(WebKit::WebPageProxy::loadPlainTextString):
(WebKit::WebPageProxy::loadWebArchiveData):

Tools:

Add new test to check that active URL is the requested one right
after calling WKPage load methods.

* TestWebKitAPI/PlatformEfl.cmake:
* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/PendingAPIRequestURL.cpp: Added.
(TestWebKitAPI::TEST):
* TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:
(WebViewTest::loadPlainText): Remove FIXME.
(WebViewTest::loadBytes): Ditto.
(WebViewTest::loadAlternateHTML): Ditto.

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

4 years agoUnreviewed, rolling out r199660.
commit-queue@webkit.org [Mon, 18 Apr 2016 09:48:33 +0000 (09:48 +0000)]
Unreviewed, rolling out r199660.
https://bugs.webkit.org/show_bug.cgi?id=156691

It broke the iOS build (Requested by KaL on #webkit).

Reverted changeset:

"Pending API request URL no set when loading Data, Alternate
HTML or plain text"
https://bugs.webkit.org/show_bug.cgi?id=136916
http://trac.webkit.org/changeset/199660

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

4 years ago[css-grid] Use grid-template-areas to determine the explicit grid
rego@igalia.com [Mon, 18 Apr 2016 09:45:30 +0000 (09:45 +0000)]
[css-grid] Use grid-template-areas to determine the explicit grid
https://bugs.webkit.org/show_bug.cgi?id=156575

Reviewed by Darin Adler.

Source/WebCore:

From the spec (https://drafts.csswg.org/css-grid/#grid-definition):
"The size of the explicit grid is determined by the larger of the number
of rows/columns defined by grid-template-areas and the number
of rows/columns sized by grid-template-rows/grid-template-columns."

So we need to take into account the rows/columns defined by
grid-template-areas to determine the size of the explicit grid.

Test: fast/css-grid-layout/explicit-grid-size.html

* rendering/style/GridPositionsResolver.cpp:
(WebCore::GridPositionsResolver::explicitGridColumnCount):
(WebCore::GridPositionsResolver::explicitGridRowCount):

LayoutTests:

Created new test to check the right behavior.

* fast/css-grid-layout/explicit-grid-size-expected.txt: Added.
* fast/css-grid-layout/explicit-grid-size.html: Added.
* fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt:
Small modification as now the columns defined by
grid-tempalte-areas are in the explicit grid.
* fast/css-grid-layout/grid-template-shorthand-get-set.html:
Ditto.

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

4 years agoPending API request URL no set when loading Data, Alternate HTML or plain text
carlosgc@webkit.org [Mon, 18 Apr 2016 08:50:21 +0000 (08:50 +0000)]
Pending API request URL no set when loading Data, Alternate HTML or plain text
https://bugs.webkit.org/show_bug.cgi?id=136916

Reviewed by Darin Adler.

Source/WebKit2:

Set pending API request URL for all load methods in
WebPageProxy. This ensures that right after calling those methods,
the active URL is the requested one and that
PageLoadState::isLoading() returns true.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadAlternateHTMLString):
(WebKit::WebPageProxy::loadPlainTextString):
(WebKit::WebPageProxy::loadWebArchiveData):

Tools:

Add new test to check that active URL is the requested one right
after calling WKPage load methods.

* TestWebKitAPI/PlatformEfl.cmake:
* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/PendingAPIRequestURL.cpp: Added.
(TestWebKitAPI::TEST):
* TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:
(WebViewTest::loadPlainText): Remove FIXME.
(WebViewTest::loadBytes): Ditto.
(WebViewTest::loadAlternateHTML): Ditto.

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

4 years ago[GTK] Menu list button doesn't use the text color from the theme
carlosgc@webkit.org [Mon, 18 Apr 2016 08:44:55 +0000 (08:44 +0000)]
[GTK] Menu list button doesn't use the text color from the theme
https://bugs.webkit.org/show_bug.cgi?id=118234

Reviewed by Darin Adler.

.:

* ManualTests/gtk/theme.html: Add a disabled combo test.

Source/WebCore:

Set the combo box color accroding to the theme when adjusting the menu list style like Mac port does.

* rendering/RenderThemeGtk.cpp:
(WebCore::menuListColor):
(WebCore::RenderThemeGtk::adjustMenuListStyle):

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

4 years ago[UNIX] Initialize WebKit before the platform initializations
carlosgc@webkit.org [Mon, 18 Apr 2016 08:31:11 +0000 (08:31 +0000)]
[UNIX] Initialize WebKit before the platform initializations
https://bugs.webkit.org/show_bug.cgi?id=156622

Reviewed by Michael Catanzaro.

The platform specific initialization might use something that would require WebKit2 to be initialized. For
example, in debug mode, the GTK+ port uses WTF::sleep that requires the threading to be initialized.

* Shared/unix/ChildProcessMain.h:
(WebKit::ChildProcessMain): Move InitializeWebKit2() before platformInitialize().

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

4 years ago[css-grid] Fix positioned items with content alignment
rego@igalia.com [Mon, 18 Apr 2016 08:20:08 +0000 (08:20 +0000)]
[css-grid] Fix positioned items with content alignment
https://bugs.webkit.org/show_bug.cgi?id=156597

Reviewed by Darin Adler.

Source/WebCore:

Like for the case of gaps we need to take into account
the content alignment in order to properly place and size
the positioned items.

Regarding content alignment we need to care about 2 values:
the position offset and the distribution offset.
The position offset can be extracted from m_column|rowPositions,
but the distribution offset is stored in 2 new variables called
m_offsetBetweenColumns|Rows.

Tests: fast/css-grid-layout/grid-positioned-items-content-alignment.html
       fast/css-grid-layout/grid-positioned-items-content-alignment-rtl.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
(WebCore::RenderGrid::populateGridPositions):
(WebCore::RenderGrid::columnAxisOffsetForChild):
(WebCore::RenderGrid::rowAxisOffsetForChild):
(WebCore::RenderGrid::rowAxisPositionForChild): Deleted.
* rendering/RenderGrid.h:

LayoutTests:

* fast/css-grid-layout/grid-positioned-items-content-alignment-expected.txt: Added.
* fast/css-grid-layout/grid-positioned-items-content-alignment-rtl-expected.txt: Added.
* fast/css-grid-layout/grid-positioned-items-content-alignment-rtl.html: Added.
* fast/css-grid-layout/grid-positioned-items-content-alignment.html: Added.

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

4 years agoFix incorrect assumption that APPLE implies Mac.
commit-queue@webkit.org [Mon, 18 Apr 2016 08:09:56 +0000 (08:09 +0000)]
Fix incorrect assumption that APPLE implies Mac.
https://bugs.webkit.org/show_bug.cgi?id=156679

Addresses build failure introduced in r198947

Patch by Jeremy Huddleston Sequoia <jeremyhu@apple.com> on 2016-04-18
Reviewed by Alex Christensen.

* CMakeLists.txt:

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

4 years ago[css-grid] Add method to translate RTL coordinates
rego@igalia.com [Mon, 18 Apr 2016 08:03:24 +0000 (08:03 +0000)]
[css-grid] Add method to translate RTL coordinates
https://bugs.webkit.org/show_bug.cgi?id=156589

Reviewed by Antonio Gomes.

This is just a small refactoring adding a new function
LayoutGrid::translateRTLCoordinate().
This method translates to physical coordinates the information
stored in m_columnPositions when you're using RTL direction.

No new tests, no change of behavior.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild): Use the new
method translateRTLCoordinate().
(WebCore::RenderGrid::translateRTLCoordinate): New method that converts
a coordinate from m_columnPositions in RTL into a physical coordinate.
(WebCore::RenderGrid::findChildLogicalPosition): Use the new method
translateRTLCoordinate().
* rendering/RenderGrid.h: Add method signature.

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

4 years ago[Fetch] Use @isArray instead of `instanceof @Array`
utatane.tea@gmail.com [Mon, 18 Apr 2016 08:01:07 +0000 (08:01 +0000)]
[Fetch] Use @isArray instead of `instanceof @Array`
https://bugs.webkit.org/show_bug.cgi?id=156682

Reviewed by Alex Christensen.

Source/WebCore:

Currently, we query whether the given value is Array by using `instanceof @Array`.
But it is not enough; Array from the other realm should be accepted. And Array
not inheriting @Array should be also accepted.

Test: fetch/header-constructor-is-array.html

* Modules/fetch/FetchHeaders.js:
(initializeFetchHeaders):

LayoutTests:

* fetch/header-constructor-is-array-expected.txt: Added.
* fetch/header-constructor-is-array.html: Added.

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

4 years ago[GTK] Test /webkit2/WebKitWebView/mouse-target fails with overlay scrollbars
carlosgc@webkit.org [Mon, 18 Apr 2016 07:40:22 +0000 (07:40 +0000)]
[GTK] Test /webkit2/WebKitWebView/mouse-target fails with overlay scrollbars
https://bugs.webkit.org/show_bug.cgi?id=156621

Reviewed by Martin Robinson.

This is a problem of the test itself, we are using an overflow that is not actually scrollable, but that shows
scrollbar troughs when not using overlay scrollbars because it's marked as scrollable. It would be easier to
simply use the main frame scrollbars to test that and it will work no matter of scrollbars are overlay or not.

* TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp:
(testWebViewMouseTarget): Remove the div and move the mouse over the main frame scrollbar to test scrolbars hit test.

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

4 years ago[ES7] yield star should not return if the inner iterator.throw returns { done: true }
utatane.tea@gmail.com [Mon, 18 Apr 2016 07:35:48 +0000 (07:35 +0000)]
[ES7] yield star should not return if the inner iterator.throw returns { done: true }
https://bugs.webkit.org/show_bug.cgi?id=156576

Reviewed by Saam Barati.

This is slight generator fix in ES7. When calling generator.throw(),
the yield-star should call the throw() of the inner generator. At that
time, when the result of throw() is { done: true}, the generator should
not stop itself.

    function * gen()
    {
        yield * (function * () {
            try {
                yield 42;
            } catch (error) { }
        }());
        // Continue executing.
        yield 42;
    }

    let g = gen();
    g.next();
    shouldBe(g.throw().value, 42);

* builtins/GeneratorPrototype.js:
(generatorResume):
(next):
(return):
(throw):
* bytecode/BytecodeIntrinsicRegistry.cpp:
(JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
* bytecode/BytecodeIntrinsicRegistry.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitDelegateYield):
* runtime/JSGeneratorFunction.h:
* tests/stress/generator-yield-star.js:
(gen):
* tests/stress/yield-star-throw-continue.js: Added.
(shouldBe):
(generator):
(shouldThrow):

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

4 years agoFix incorrect assumption that APPLE implies Mac.
commit-queue@webkit.org [Mon, 18 Apr 2016 06:52:41 +0000 (06:52 +0000)]
Fix incorrect assumption that APPLE implies Mac.
https://bugs.webkit.org/show_bug.cgi?id=156683

Addresses build failure introduced in r199094

Patch by Jeremy Huddleston Sequoia <jeremyhu@apple.com> on 2016-04-17
Reviewed by Alex Christensen.

* CMakeLists.txt:

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

4 years agoInitial Link preload support
yoav@yoav.ws [Mon, 18 Apr 2016 06:06:42 +0000 (06:06 +0000)]
Initial Link preload support
https://bugs.webkit.org/show_bug.cgi?id=156334

Source/WebCore:

Added basic `<link rel=preload>` functionality that enables preloading
of resources according to their type.

Reviewed by Darin Adler.

Tests: http/tests/preload/download_resources.html
       http/tests/preload/dynamic_adding_preload.html
       http/tests/preload/dynamic_remove_preload_href.html
       http/tests/preload/dynamic_removing_preload.html

* bindings/generic/RuntimeEnabledFeatures.cpp: Added a runtime flag for the feature.
(WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
* bindings/generic/RuntimeEnabledFeatures.h: Added a runtime flag for the feature.
(WebCore::RuntimeEnabledFeatures::setLinkPreloadEnabled):
(WebCore::RuntimeEnabledFeatures::linkPreloadEnabled):
* html/HTMLAttributeNames.in: Added an `as` attribute.
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process): Added `as` and `crossorigin` attribute values to the loadLink() call.
(WebCore::HTMLLinkElement::setCrossOrigin): Setter for crossOrigin.
(WebCore::HTMLLinkElement::crossOrigin): Getter for crossOrigin.
* html/HTMLLinkElement.idl: Added `as` and `crossorigin` to HTMLLinkElement.
* html/HTMLLinkElement.h: Added getter and setter for crossorigin.
* html/LinkRelAttribute.cpp:
(WebCore::LinkRelAttribute::LinkRelAttribute): Added "preload" as a potential value.
* html/LinkRelAttribute.h: Added isLinkPreload.
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::resourceTypeFromAsAttribute): Translates an `as` value into a resource type.
(WebCore::preloadIfNeeded): Triggers a resource preload when link element is a preload one.
(WebCore::LinkLoader::loadLink): Added a call to preloadIfNeeded.
* loader/LinkLoader.h: Added signatures.
* loader/ResourceLoadInfo.cpp:
(WebCore::toResourceType): Added LinkPreload as a possible CachedResource::type.
* loader/SubresourceLoader.cpp:
(WebCore::logResourceLoaded): Added LinkPreload as a possible CachedResource::type.
* loader/cache/CachedResource.cpp: Turned defaultPriorityForResourceType into a static member, as it's now also called from LinkLoader.
(WebCore::CachedResource::defaultPriorityForResourceType): Added LinkPreload as a possible CachedResource::type, giving it low priority.
(WebCore::defaultPriorityForResourceType): Deleted.
* loader/cache/CachedResource.h: Added LinkPreload as a possible CachedResource::type. Added defaultPriorityForResourceType as static.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::contentTypeFromResourceType): Added LinkPreload as a possible CachedResource::type.
(WebCore::createResource): Added creation of a LinkPreload resource if needed.
(WebCore::CachedResourceLoader::checkInsecureContent): Added LinkPreload as a possible CachedResource::type.
(WebCore::CachedResourceLoader::canRequest): Added LinkPreload as a possible CachedResource::type.
* testing/Internals.cpp: Added function to turn on the link preload feature.
(WebCore::setLinkPreloadSupport):
* testing/Internals.idl: Added function to turn on the link preload feature.
* testing/Internals.h: Added function signature to turn on the link preload feature.

Source/WebKit2:

Reviewed by Darin Adler.

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::maximumBufferingTime): Added LinkPreload as a possible CachedResource::type.

LayoutTests:

Added tests that make sure that `<link rel=preload>` performs its basic
tasks and preloads resources.

Reviewed by Darin Adler.

* http/tests/preload/download_resources-expected.txt: Added.
* http/tests/preload/download_resources.html: Added.
* http/tests/preload/dynamic_adding_preload-expected.txt: Added.
* http/tests/preload/dynamic_adding_preload.html: Added.
* http/tests/preload/dynamic_remove_preload_href-expected.txt: Added.
* http/tests/preload/dynamic_remove_preload_href.html: Added.
* http/tests/preload/dynamic_removing_preload-expected.txt: Added.
* http/tests/preload/dynamic_removing_preload.html: Added.
* imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt: Adjusted expected results to progressions.
* imported/w3c/web-platform-tests/html/dom/reflection-metadata-expected.txt: Adjusted expected results to progressions.
* platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt: Adjusted expected results to progressions.

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

4 years ago[EFL] Bump gstreamer from 1.4.4 to 1.6.3
gyuyoung.kim@webkit.org [Mon, 18 Apr 2016 05:36:31 +0000 (05:36 +0000)]
[EFL] Bump gstreamer from 1.4.4 to 1.6.3
https://bugs.webkit.org/show_bug.cgi?id=156655

Reviewed by Antonio Gomes.

To support html5 video feature, we should bump gstreamer version.

* efl/jhbuild.modules:
* efl/patches/gst-libav.patch: Update against newer version.
* efl/patches/gst-plugins-bad-remove-gnustep-support.patch: Removed because this patch was merged.

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

4 years ago[JSC] ReduceDoubleToFloat should work accross Phis
benjamin@webkit.org [Mon, 18 Apr 2016 05:13:13 +0000 (05:13 +0000)]
[JSC] ReduceDoubleToFloat should work accross Phis
https://bugs.webkit.org/show_bug.cgi?id=156603
<rdar://problem/25736205>

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-04-17
Reviewed by Saam Barati and Filip Pizlo.

This patch extends B3's ReduceDoubleToFloat phase to work accross
Upsilon-Phis. This is important to optimize loops and some crazy cases.

In its simplest form, we can have conversion propagated from something
like this:
    Double @1 = Phi()
    Float @2 = DoubleToFloat(@1)

When that happens, we just need to propagate that the result only
need float precision accross all values coming to this Phi.

There are more complicated cases when the value produced is effectively Float
but the user of the value does not do DoubleToFloat.

Typically, we have something like:
    #1
        @1 = ConstDouble(1)
        @2 = Upsilon(@1, ^5)
    #2
        @3 = FloatToDouble(@x)
        @4 = Upsilon(@3, ^5)
    #3
        @5 = Phi()
        @6 = Add(@5, @somethingFloat)
        @7 = DoubleToFloat(@6)

Here with a Phi-Upsilon that is a Double but can be represented
as Float without loss of precision.

It is valuable to convert such Phis to float if and only if the value
is used as float. Otherwise, you may be just adding useless conversions
(for example, two double constants that flow into a double Add should not
turn into two float constant flowing into a FloatToDouble then Add).

ReduceDoubleToFloat do two analysis passes to gather the necessary
meta information. Then we have a simplify() phase to actually reduce
operation. Finally, the cleanup() pass put the graph into a valid
state again.

The two analysis passes work by disproving that something is float.
-findCandidates() accumulates anything used as Double.
-findPhisContainingFloat() accumulates phis that would lose precision
 by converting the input to float.

With this change, Unity3D improves by ~1.5%, box2d-f32 improves
by ~2.8% (on Haswell).

* b3/B3ReduceDoubleToFloat.cpp:
(JSC::B3::reduceDoubleToFloat):
* b3/testb3.cpp:
(JSC::B3::testCompareTwoFloatToDouble):
(JSC::B3::testCompareOneFloatToDouble):
(JSC::B3::testCompareFloatToDoubleThroughPhi):
(JSC::B3::testDoubleToFloatThroughPhi):
(JSC::B3::testDoubleProducerPhiToFloatConversion):
(JSC::B3::testDoubleProducerPhiToFloatConversionWithDoubleConsumer):
(JSC::B3::testDoubleProducerPhiWithNonFloatConst):
(JSC::B3::testStoreDoubleConstantAsFloat):
(JSC::B3::run):
* tests/stress/double-compare-to-float.js: Added.
(canSimplifyToFloat):
(canSimplifyToFloatWithConstant):
(cannotSimplifyA):
(cannotSimplifyB):
* tests/stress/double-to-float.js: Added.
(upsilonReferencingItsPhi):
(upsilonReferencingItsPhiAllFloat):
(upsilonReferencingItsPhiWithoutConversion):
(conversionPropagages):
(chainedUpsilonBothConvert):
(chainedUpsilonFirstConvert):

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

4 years ago[ES6] Use @isObject to check Object Type instead of using instanceof
utatane.tea@gmail.com [Sun, 17 Apr 2016 21:53:11 +0000 (21:53 +0000)]
[ES6] Use @isObject to check Object Type instead of using instanceof
https://bugs.webkit.org/show_bug.cgi?id=156676

Reviewed by Darin Adler.

Use @isObject instead of `instanceof @Object`.
The `instanceof` check is not enough to check Object Type.
For example, given 2 realms, the object created in one realm does not inherit the Object of another realm.
Another example is that the object which does not inherit Object.
This object can be easily created by calling `Object.create(null)`.

* builtins/RegExpPrototype.js:
(match):
* jsc.cpp:
(GlobalObject::finishCreation):
(functionCreateGlobalObject):
* tests/stress/regexp-match-in-other-realm-should-work.js: Added.
(shouldBe):
* tests/stress/regexp-match-should-work-with-objects-not-inheriting-object-prototype.js: Added.
(shouldBe):
(regexp.exec):

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

4 years agoTry (again) to fix debug builds after r199643.
conrad_shultz@apple.com [Sun, 17 Apr 2016 19:33:57 +0000 (19:33 +0000)]
Try (again) to fix debug builds after r199643.

Unreviewed.

* dom/ScriptExecutionContext.cpp:
Add another missing include.

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

4 years agoTry to fix debug builds after r199643.
conrad_shultz@apple.com [Sun, 17 Apr 2016 19:28:38 +0000 (19:28 +0000)]
Try to fix debug builds after r199643.

Unreviewed.

* Modules/indexeddb/IDBObjectStore.cpp:
Add a missing include.

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

4 years ago[WK2][iOS] Do not dlopen() QuickLook in the NetworkProcess
cdumez@apple.com [Sun, 17 Apr 2016 18:58:56 +0000 (18:58 +0000)]
[WK2][iOS] Do not dlopen() QuickLook in the NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=156639

Reviewed by Darin Adler.

Source/WebCore:

Do not unnecessarily dlopen() QuickLook in the NetworkProcess on iOS, as
we already dlopen() this library in the WebContent process. This patch
moves the resource response MIME type adjusting code for QuickLook from
adjustMIMETypeIfNecessary() to a new adjustMIMETypeForQuickLook() function.
adjustMIMETypeIfNecessary() is called in didReceiveResponse() in the Network
process side, for *every* resource response, even though QuickLook can only
be used to preview main resources. The new adjustMIMETypeForQuickLook()
function is called in the QuickLookHandle::createIfNecessary() factory
function, right before checking the MIME type to determine if we need to
use QuickLook, and after checking that the load is for a main resource.
In the WebKit2 case, the factory function is called from
WebResourceLoader::didReceiveResponse(), on the WebContent process side.

This patch speeds up the first page load during PLT by ~22%, because the
first load no longer triggers a dlopen() to QuickLook in the NetworkProcess.
The overall PLT score seems to be progressed by 0.9-1% as well. The change
should also be memory-positive as we no longer need to dlopen() the
QuickLook library in the NetworkProcess at all (and we would already dlopen()
it on the WebContent process side anyway). Sadly, PLUM benchmark does not
show the memory benefit because it does not measure the memory used by the
Network process.

* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
Refactor the code a bit for clarity, so that we only
ResourceHandle::setQuickLookHandle() when QuickLookHandle::createIfNecessary()
returns a non-null pointer.

* platform/network/ios/QuickLook.h:
- Rename the factories from create() to createIfNecessary() given that they
  return nullptr when it is unnecessary to create such handle (i.e. this is not
  a main resource loader, or it is unecessary given the response's MIME type.
- Make shouldCreateForMIMEType() private now that this is always called inside
  the factory functions.

* platform/network/ios/QuickLook.mm:
(adjustMIMETypeForQuickLook):
Extracted code for adjusting the MIME type for QuickLook from the generic
adjustMIMETypeIfNecessary() in WebCoreURLResponseIOS.mm to its own function
here.

(WebCore::QuickLookHandle::createIfNecessary):
Call adjustMIMETypeForQuickLook() before checking the MIME type.

* platform/network/ios/WebCoreURLResponseIOS.mm:
(WebCore::adjustMIMETypeIfNecessary):
Extracted QuickLook-specific code to QuickLook.mm.

* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
(-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
Refactor the code a bit for clarity, so that we only
ResourceHandle::setQuickLookHandle() when QuickLookHandle::createIfNecessary()
returns a non-null pointer.

Source/WebKit2:

* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didReceiveResponse):
Move checks for main resource load and for MIME type inside of
QuickLookHandle::createIfNecessary(), for consistency with the
other QuickLookHandle factory functions.

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

4 years agoClean up IDBBindingUtilities.
beidson@apple.com [Sun, 17 Apr 2016 18:49:53 +0000 (18:49 +0000)]
Clean up IDBBindingUtilities.
https://bugs.webkit.org/show_bug.cgi?id=156472

Reviewed by Alex Christensen.

No new tests (No change in behavior).

- Get rid of a whole bunch of unused functions (since we got rid of Legacy IDB).
- Make more functions deal in ExecState/ScriptExecutionContexts instead of DOMRequestState.
- Make more functions deal in JSValue (as JSC::Strong<JSC::Unknown>) instead of Deprecated::ScriptValue.

* bindings/scripts/IDLAttributes.txt: Add a new attribute to signify that an implementation returns
  JSValues instead of Deprecated::ScriptState
* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValue): Use that new attribute.

* Modules/indexeddb/IDBAny.cpp:
(WebCore::IDBAny::IDBAny):
(WebCore::IDBAny::scriptValue):
* Modules/indexeddb/IDBAny.h:
(WebCore::IDBAny::create):

* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::key):
(WebCore::IDBCursor::primaryKey):
(WebCore::IDBCursor::value):
(WebCore::IDBCursor::update):
(WebCore::IDBCursor::continueFunction):
(WebCore::IDBCursor::deleteFunction):
(WebCore::IDBCursor::setGetResult):
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBCursor.idl:
* Modules/indexeddb/IDBCursorWithValue.idl:

* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::cmp):

* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::count):
(WebCore::IDBIndex::get):
(WebCore::IDBIndex::getKey):

* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::lowerValue):
(WebCore::IDBKeyRange::upperValue):
(WebCore::IDBKeyRange::only):
(WebCore::IDBKeyRange::lowerBound):
(WebCore::IDBKeyRange::upperBound):
(WebCore::IDBKeyRange::bound):
* Modules/indexeddb/IDBKeyRange.h:
* Modules/indexeddb/IDBKeyRange.idl:

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::get):
(WebCore::IDBObjectStore::modernDelete):
(WebCore::IDBObjectStore::count):

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::setResult):
(WebCore::IDBRequest::setResultToStructuredClone):

* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
(WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::idbKeyPathFromValue):
(WebCore::internalCreateIDBKeyFromScriptValueAndKeyPath):
(WebCore::injectIDBKeyIntoScriptValue):
(WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath):
(WebCore::canInjectIDBKeyIntoScriptValue):
(WebCore::deserializeIDBValueToJSValue):
(WebCore::deserializeIDBValueDataToJSValue):
(WebCore::scriptValueToIDBKey):
(WebCore::idbKeyDataToScriptValue):
(WebCore::idbKeyDataToJSValue): Deleted.
(WebCore::createIDBKeyFromScriptValueAndKeyPath): Deleted.
(WebCore::deserializeIDBValue): Deleted.
(WebCore::deserializeIDBValueData): Deleted.
(WebCore::deserializeIDBValueBuffer): Deleted.
(WebCore::idbValueDataToJSValue): Deleted.
(WebCore::idbKeyToScriptValue): Deleted.
* bindings/js/IDBBindingUtilities.h:

* bindings/js/JSIDBAnyCustom.cpp:
(WebCore::toJS):

* bindings/js/JSIDBDatabaseCustom.cpp:
(WebCore::JSIDBDatabase::createObjectStore):

* bindings/js/JSIDBObjectStoreCustom.cpp:
(WebCore::JSIDBObjectStore::createIndex):

* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::execState):
* dom/ScriptExecutionContext.h:

* inspector/InspectorIndexedDBAgent.cpp:

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

4 years agoRemove more uses of Deprecated::ScriptXXX
darin@apple.com [Sun, 17 Apr 2016 18:39:13 +0000 (18:39 +0000)]
Remove more uses of Deprecated::ScriptXXX
https://bugs.webkit.org/show_bug.cgi?id=156660

Reviewed by Antti Koivisto.

Source/JavaScriptCore:

* bindings/ScriptFunctionCall.cpp:
(Deprecated::ScriptCallArgumentHandler::appendArgument): Deleted
unneeded overloads that take a ScriptObject and ScriptValue.
* bindings/ScriptFunctionCall.h: Ditto.

* bindings/ScriptObject.h: Added operator so this can change
itself into a JSObject*. Helps while phasing this class out.

* bindings/ScriptValue.h: Export toInspectorValue so it can be
used in WebCore.

* inspector/InjectedScriptManager.cpp:
(Inspector::InjectedScriptManager::createInjectedScript): Changed
return value from Deprecated::ScriptObject to JSObject*.
(Inspector::InjectedScriptManager::injectedScriptFor): Updated for
the return value change above.
* inspector/InjectedScriptManager.h: Ditto.

Source/WebCore:

* Modules/mediacontrols/MediaControlsHost.h: Removed unneeded include.

* Modules/plugins/PluginReplacement.h: Removed unneeded include.
Changed argument to installReplacement into a reference. Changed return
value for creation function from PassRefPtr to Ref.

* Modules/plugins/QuickTimePluginReplacement.h: Removed unneeded includes and
forward declarations. Marked class final. Made almost everything private.

* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::create): Changed to return Ref.
(WebCore::QuickTimePluginReplacement::installReplacement): Changed to take
a reference.

* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::YouTubePluginReplacement::create): Changed to return Ref.
(WebCore::YouTubePluginReplacement::installReplacement): Changed to take
a reference.

* Modules/plugins/YouTubePluginReplacement.h: Removed unneeded includes and
forward declarations. Marked class final. Changed return type of create.

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::didReceiveBinaryData): Removed local variable so the
MessageEvent::create function gets a Ref&& instead of a RefPtr without having
to add explicit WTFMove.

* bindings/js/DOMRequestState.h: Removed code that set m_exec twice.

* bindings/js/Dictionary.h: Reformatted function templates to use a single
line so they are easier to look at.
(WebCore::Dictionary::getEventListener): Rewrote this so it no longer uses
a Deprecated::ScriptValue and also make it a little more compact and terse.

* bindings/js/JSCommandLineAPIHostCustom.cpp:
(WebCore::JSCommandLineAPIHost::inspect): Rewrote to use JSValue instead of
Deprecated::ScriptValue. Considerably more efficient.

* bindings/js/JSMessageEventCustom.cpp:
(WebCore::JSMessageEvent::data): Streamlined to use Deprecated::ScriptValue
a little bit less.

* bindings/js/JSNodeCustom.cpp: Moved include here from header.
* bindings/js/JSNodeCustom.h: Moved include from here to cpp file.

* bindings/js/JSPopStateEventCustom.cpp:
(WebCore::JSPopStateEvent::state): Updated for changes to return value of the
state() and serializedState functions.

* bindings/js/ScriptState.h: Removed the ScriptState typedef.

* bindings/js/SerializedScriptValue.cpp: Moved include here from header.
* bindings/js/SerializedScriptValue.h: Moved include from here to cpp file.

* css/FontFace.cpp:
(WebCore::FontFace::create): Changed argument to JSValue instead of ScriptValue.
* css/FontFace.h: Ditto.

* dom/MessageEvent.cpp: Moved create functions in here from header file.
Removed some unused ones including one that took a Deprecated::ScriptValue.
* dom/MessageEvent.h: Streamlined create functions, removing unused functions,
unused arguments, and unused default values for arguments. Also moved them all
into the cpp file instead of inlining them. Also changed the return type of
dataAsScriptValue to JSValue.

* dom/NodeFilterCondition.h: Removed unneeded include. Tweaked formatting.

* dom/PopStateEvent.h: Changed return value of state to be a JSValue and of
serializedState to be a raw pointer, not a PassRefPtr.

* dom/Traversal.h: Removed unneeded include. Removed unnecessary use of
unsigned long instead of unsigned. Fixed indentation.

* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot): Pass reference.

* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForEventListener): Pass JSValue instead
of constructing a Deprecated::ScriptValue.

* inspector/InspectorFrontendHost.cpp:
(WebCore::FrontendMenuProvider::disconnect): Initialize without explicitly
mentioning the Deprecated::ScriptObject type.

* inspector/InspectorIndexedDBAgent.cpp: Removed unneeded include.

* inspector/InspectorInstrumentation.h: Removed unneeded include and also
declaration of two non-existent functions.

* page/DOMWindow.cpp:
(WebCore::PostMessageTimer::PostMessageTimer): Tweaked types a little bit to
match what is used in MessageEvent now.
(WebCore::PostMessageTimer::event): Streamlined a bit and changed type to
reference.
(WebCore::DOMWindow::postMessage): Updated for changes above.
(WebCore::DOMWindow::postMessageTimerFired): Ditto.

* page/EventSource.cpp:
(WebCore::EventSource::createMessageEvent): Removed now-unneeded
"false, false" from MessageEvent::create function call.

* page/csp/ContentSecurityPolicy.h: Removed unneeded include.

* page/csp/ContentSecurityPolicyDirectiveList.h: Removed unneeded
include and also unneeded non-copyable, since the class has a reference as
a data member and so is automatically non-copyable.

* testing/Internals.cpp:
(WebCore::Internals::description): Changed to take JSValue.
(WebCore::Internals::parserMetaData): Ditto.
(WebCore::Internals::serializeObject): Removed unnecessary copying of vector.
(WebCore::Internals::isFromCurrentWorld): Changed to take JSValue.
(WebCore::Internals::isReadableStreamDisturbed): Changed to not rely on the
ScriptState typedef and call it JSC::ExecState.

* testing/Internals.h: Removed unneeded includes. Removed unneeded and
inappropriate use of ASSERT_NO_EXCEPTION.

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

4 years agoLayoutTests/imported/w3c:
youenn.fablet@crf.canon.fr [Sun, 17 Apr 2016 18:04:20 +0000 (18:04 +0000)]
LayoutTests/imported/w3c:
[Fetch API] Consume HTTP data as a ReadableStream
https://bugs.webkit.org/show_bug.cgi?id=138968

Reviewed by Alex Christensen.

* web-platform-tests/fetch/api/basic/stream-response-expected.txt:
* web-platform-tests/fetch/api/basic/stream-response-worker-expected.txt:
* web-platform-tests/fetch/api/request/request-consume.html:
* web-platform-tests/fetch/api/resources/data.json: Added.
* web-platform-tests/fetch/api/resources/utils.js:
(validateStreamFromString):
* web-platform-tests/fetch/api/response/response-cancel-stream-expected.txt: Added.
* web-platform-tests/fetch/api/response/response-cancel-stream.html: Added.
* web-platform-tests/fetch/api/response/response-clone-expected.txt:
* web-platform-tests/fetch/api/response/response-consume-stream-expected.txt: Added.
* web-platform-tests/fetch/api/response/response-consume-stream.html: Added.
* web-platform-tests/fetch/api/response/response-init-002-expected.txt:
* web-platform-tests/fetch/api/response/response-stream-disturbed-expected-1.txt: Added.
* web-platform-tests/fetch/api/response/response-stream-disturbed-1.html: Added.
* web-platform-tests/fetch/api/response/response-stream-disturbed-expected-2.txt: Added.
* web-platform-tests/fetch/api/response/response-stream-disturbed-2.html: Added.
* web-platform-tests/fetch/api/response/response-stream-disturbed-expected-3.txt: Added.
* web-platform-tests/fetch/api/response/response-stream-disturbed-3.html: Added.
* web-platform-tests/fetch/api/response/response-stream-disturbed-expected-4.txt: Added.
* web-platform-tests/fetch/api/response/response-stream-disturbed-4.html: Added.
* web-platform-tests/fetch/api/response/response-stream-disturbed-expected-5.txt: Added.
* web-platform-tests/fetch/api/response/response-stream-disturbed-5.html: Added.

Source/WebCore:
[Fetch API] Consume HTTP data as a ReadableStream
https://bugs.webkit.org/show_bug.cgi?id=138968

Reviewed by Alex Christensen.

This patch introduces ReadableStreamSource and ReadableStreamController which allow feeding a ReadableStream from DOM classes.
ReadableStreamSource is a base class for all DOM ReadableStream sources.
ReadableStreamController is a wrapper around JSReadableStreamController that can be invoked by DOM code to enqueue/close/error a ReadableStream.
A createReadableStream function is introduced to allow DOM classes creating ReadableStream.

Added support for a FetchResponse ReadableStream source.
Both synthetic FetchResponse and loading FetchResponse are supported.
A new "Stream" FetchLoader::Type is introduced to allow receiving data as chunks and feeding them to a ReadableStream through ReadableStreamSource.

Currently, FetchResponse is consumed and marked as disturbed as soon as a ReadableStreamSource is created.
This should be changed so that consumption happens on the first read call to the ReadableStreamReader, i.e. when stream gets disturbed.

FetchResponseSource never fulfills the start promise, which allows to enqueue, error or close the stream at any time.
FetchResponseSource must therefore always ensure to close or error the stream.
Added support for locked check in FetchResponse.

Tests: imported/w3c/web-platform-tests/fetch/api/response/response-cancel-stream.html
       imported/w3c/web-platform-tests/fetch/api/response/response-consume-stream.html
       imported/w3c/web-platform-tests/fetch/api/response/response-stream-disturbed-1.html
       imported/w3c/web-platform-tests/fetch/api/response/response-stream-disturbed-2.html
       imported/w3c/web-platform-tests/fetch/api/response/response-stream-disturbed-3.html
       imported/w3c/web-platform-tests/fetch/api/response/response-stream-disturbed-4.html
       imported/w3c/web-platform-tests/fetch/api/response/response-stream-disturbed-5.html
Also covered by rebased tests.

* CMakeLists.txt:
* DerivedSources.make:
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::consumeAsStream): Fill stream with body data.
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::type): Added accessor to body type, used for assertions.
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::isDisturbed): Adding stream isLocked check.
(WebCore::FetchBodyOwner::blobLoadingSucceeded): Added assertion that body type is blob. Closing stream if created.
(WebCore::FetchBodyOwner::blobLoadingFailed): Erroring the stream if created and not cancelled.
(WebCore::FetchBodyOwner::blobChunk): Filling stream with chunk.
(WebCore::FetchBodyOwner::stop): Rmoved call to finishBlobLoading as it should be called as part of FetchLoaderCLient::didFail callbacki.
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchLoader.cpp: Fixing the case of cancel being called when creating the ThreadableLoader by introducing FetchLoader::m_isStarted.
(WebCore::FetchLoader::start): Setting m_isStarted at the end of the start method.
(WebCore::FetchLoader::stop): Fixing the case that FetchLoader can be destroyed when cancelling its loader.
(WebCore::FetchLoader::startStreaming): Introduced to switch the loading type from ArayBuffer to Stream. Already buffered data is returned.
(WebCore::FetchLoader::didReceiveData): Handling of the new Stream type.
(WebCore::FetchLoader::didFinishLoading):
* Modules/fetch/FetchLoader.h:
* Modules/fetch/FetchLoaderClient.h:
(WebCore::FetchLoaderClient::didReceiveData): Callback to get data as chunks if loader is of type Stream.
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::clone): Removed m_isLocked as it is handled within isDisturbed().
(WebCore::FetchResponse::isDisturbed): Checking whether related ReadableStream is locked.
(WebCore::FetchResponse::BodyLoader::didSucceed): Introduced to handle ReadableStream case.
(WebCore::FetchResponse::BodyLoader::didFail): Ditto.
(WebCore::FetchResponse::BodyLoader::didReceiveData): Ditto.
(WebCore::FetchResponse::BodyLoader::startStreaming): Ditto.
(WebCore::FetchResponse::consumeBodyAsStream): Start filling the ReadableStream with data. Changing loader to Stream if there is one.
(WebCore::FetchResponse::createReadableStreamSource): Called by custom binding to create the source.
(WebCore::FetchResponse::stop): Fixing potential crash in case of cancelling the ibody stream.
(WebCore::FetchResponse::startFetching):
(WebCore::FetchResponse::BodyLoader::didFinishLoadingAsArrayBuffer):
* Modules/fetch/FetchResponse.h:
* Modules/fetch/FetchResponse.idl:
* Modules/fetch/FetchResponseSource.cpp: Specialization of ReadableStreamSource for FetchResponse. It is a push source that never resolves the start promise.
(WebCore::FetchResponseSource::FetchResponseSource):
(WebCore::FetchResponseSource::isReadableStreamLocked):
(WebCore::FetchResponseSource::setActive):
(WebCore::FetchResponseSource::setInactive):
(WebCore::FetchResponseSource::doStart):
(WebCore::FetchResponseSource::doCancel):
(WebCore::FetchResponseSource::close):
(WebCore::FetchResponseSource::error):
* Modules/fetch/FetchResponseSource.h: Added.
* Modules/streams/ReadableStreamController.js:
(error):
* Modules/streams/ReadableStreamSource.h: Added (base class for ReadableStream DOM sources).
(WebCore::ReadableStreamSource::~ReadableStreamSource):
(WebCore::ReadableStreamSource::isStarting):
(WebCore::ReadableStreamSource::isPulling):
(WebCore::ReadableStreamSource::isCancelling):
(WebCore::ReadableStreamSource::controller):
(WebCore::ReadableStreamSource::doStart):
(WebCore::ReadableStreamSource::doCancel):
(WebCore::ReadableStreamSource::start):
(WebCore::ReadableStreamSource::cancel):
(WebCore::ReadableStreamSource::startFinished):
(WebCore::ReadableStreamSource::clean):
* Modules/streams/ReadableStreamSource.idl: Added.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSFetchResponseCustom.cpp: In case body is not created, call createReadableStreamSource.
(WebCore::JSFetchResponse::body):
* bindings/js/JSReadableStreamSourceCustom.cpp: Added.
(WebCore::JSReadableStreamSource::start):
(WebCore::JSReadableStreamSource::pull):
(WebCore::JSReadableStreamSource::controller):
* bindings/js/ReadableStreamController.cpp: Added.
(WebCore::callFunction):
(WebCore::ReadableStreamController::invoke):
(WebCore::ReadableStreamController::isControlledReadableStreamLocked):
(WebCore::createReadableStream):
* bindings/js/ReadableStreamController.h: The DOM wrapper for JSReadableStreamController.
(WebCore::ReadableStreamController::ReadableStreamController):
(WebCore::ReadableStreamController::close):
(WebCore::ReadableStreamController::error):
(WebCore::ReadableStreamController::enqueue):
(WebCore::ReadableStreamController::globalObject):
(WebCore::ReadableStreamController::enqueue<RefPtr<JSC::ArrayBuffer>>):
(WebCore::ReadableStreamController::error<String>):

LayoutTests:
[Streams] Consume HTTP data as a ReadableStream
https://bugs.webkit.org/show_bug.cgi?id=138968

Reviewed by Alex Christensen.

* fast/xmlhttprequest/xmlhttprequest-responsetype-stream-expected.txt: Added.
* fast/xmlhttprequest/xmlhttprequest-responsetype-stream.html: Added.
* http/tests/xmlhttprequest/streams/streams-read-api-cancelled-expected.txt: Added.
* http/tests/xmlhttprequest/streams/streams-read-api-cancelled.html: Added.
* http/tests/xmlhttprequest/streams/streams-read-api-closed-expected.txt: Added.
* http/tests/xmlhttprequest/streams/streams-read-api-closed.html: Added.
* http/tests/xmlhttprequest/streams/streams-read-api-expected.txt: Added.
* http/tests/xmlhttprequest/streams/streams-read-api.html: Added.
* http/tests/xmlhttprequest/streams/streams-read-expected.txt: Added.
* http/tests/xmlhttprequest/streams/streams-read.html: Added.

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

4 years agoElement should be const in StyleResolver
antti@apple.com [Sun, 17 Apr 2016 17:56:47 +0000 (17:56 +0000)]
Element should be const in StyleResolver
https://bugs.webkit.org/show_bug.cgi?id=156672

Reviewed by Darin Adler.

Resolving element style shouldn't mutate it.

This patch just does Element* -> const Element*, all the groundwork has been done already.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::sweepMatchedPropertiesCache):
(WebCore::StyleResolver::State::State):
(WebCore::StyleResolver::State::setStyle):
(WebCore::isAtShadowBoundary):
(WebCore::StyleResolver::styleForElement):
(WebCore::doesNotInheritTextDecoration):
(WebCore::StyleResolver::adjustStyleForInterCharacterRuby):
(WebCore::StyleResolver::adjustRenderStyle):
(WebCore::StyleResolver::checkRegionStyle):
(WebCore::StyleResolver::updateFont):
(WebCore::StyleResolver::styleRulesForElement):
(WebCore::StyleResolver::pseudoStyleRulesForElement):
(WebCore::StyleResolver::applyMatchedProperties):
* css/StyleResolver.h:
(WebCore::StyleResolver::style):
(WebCore::StyleResolver::parentStyle):
(WebCore::StyleResolver::rootElementStyle):
(WebCore::StyleResolver::element):
(WebCore::StyleResolver::document):
(WebCore::StyleResolver::documentSettings):
(WebCore::StyleResolver::usesFirstLineRules):
(WebCore::StyleResolver::usesFirstLetterRules):
(WebCore::StyleResolver::State::State):
(WebCore::StyleResolver::State::document):
(WebCore::StyleResolver::State::element):
(WebCore::StyleResolver::State::style):
(WebCore::StyleResolver::hasSelectorForId):
(WebCore::checkRegionSelector):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::RenderTheme):
(WebCore::RenderTheme::adjustStyle):
(WebCore::RenderTheme::adjustCheckboxStyle):
(WebCore::RenderTheme::adjustRadioStyle):
(WebCore::RenderTheme::adjustButtonStyle):
(WebCore::RenderTheme::adjustInnerSpinButtonStyle):
(WebCore::RenderTheme::adjustTextFieldStyle):
(WebCore::RenderTheme::adjustTextAreaStyle):
(WebCore::RenderTheme::adjustMenuListStyle):
(WebCore::RenderTheme::adjustMeterStyle):
(WebCore::RenderTheme::paintMeter):
(WebCore::RenderTheme::adjustCapsLockIndicatorStyle):
(WebCore::RenderTheme::paintCapsLockIndicator):
(WebCore::RenderTheme::adjustAttachmentStyle):
(WebCore::RenderTheme::animationDurationForProgressBar):
(WebCore::RenderTheme::adjustProgressBarStyle):
(WebCore::RenderTheme::shouldHaveCapsLockIndicator):
(WebCore::RenderTheme::adjustMenuListButtonStyle):
(WebCore::RenderTheme::adjustMediaControlStyle):
(WebCore::RenderTheme::adjustSliderTrackStyle):
(WebCore::RenderTheme::adjustSliderThumbStyle):
(WebCore::RenderTheme::adjustSliderThumbSize):
(WebCore::RenderTheme::adjustSearchFieldStyle):
(WebCore::RenderTheme::adjustSearchFieldCancelButtonStyle):
(WebCore::RenderTheme::adjustSearchFieldDecorationPartStyle):
(WebCore::RenderTheme::adjustSearchFieldResultsDecorationPartStyle):
(WebCore::RenderTheme::adjustSearchFieldResultsButtonStyle):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::minimumMenuListSize):
(WebCore::RenderTheme::popupInternalPaddingBox):
(WebCore::RenderTheme::popupOptionSupportsTextIndent):
(WebCore::RenderTheme::paintRadioDecorations):
(WebCore::RenderTheme::paintButtonDecorations):
(WebCore::RenderTheme::paintTextField):
(WebCore::RenderTheme::paintTextFieldDecorations):
(WebCore::RenderTheme::paintTextArea):
(WebCore::RenderTheme::paintTextAreaDecorations):
(WebCore::RenderTheme::paintMenuList):
(WebCore::RenderTheme::paintMenuListDecorations):
(WebCore::RenderTheme::paintMenuListButtonDecorations):
(WebCore::RenderTheme::paintPushButtonDecorations):
(WebCore::RenderTheme::paintSquareButtonDecorations):
(WebCore::RenderTheme::paintProgressBar):
(WebCore::RenderTheme::paintSliderTrack):
(WebCore::RenderTheme::paintSliderThumb):
(WebCore::RenderTheme::paintSliderThumbDecorations):
(WebCore::RenderTheme::paintSearchField):
(WebCore::RenderTheme::paintSearchFieldDecorations):
(WebCore::RenderTheme::paintSearchFieldCancelButton):
(WebCore::RenderTheme::paintSearchFieldDecorationPart):
(WebCore::RenderTheme::paintSearchFieldResultsDecorationPart):
(WebCore::RenderTheme::paintSearchFieldResultsButton):
(WebCore::RenderTheme::paintMediaFullscreenButton):
(WebCore::RenderTheme::paintMediaPlayButton):
(WebCore::RenderTheme::paintMediaOverlayPlayButton):
* rendering/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::paintSliderTrack):
(WebCore::RenderThemeEfl::adjustSliderTrackStyle):
(WebCore::RenderThemeEfl::adjustSliderThumbStyle):
(WebCore::RenderThemeEfl::adjustSliderThumbSize):
(WebCore::RenderThemeEfl::paintSliderThumb):
(WebCore::RenderThemeEfl::adjustCheckboxStyle):
(WebCore::RenderThemeEfl::paintCheckbox):
(WebCore::RenderThemeEfl::adjustRadioStyle):
(WebCore::RenderThemeEfl::paintRadio):
(WebCore::RenderThemeEfl::adjustButtonStyle):
(WebCore::RenderThemeEfl::paintButton):
(WebCore::RenderThemeEfl::adjustMenuListStyle):
(WebCore::RenderThemeEfl::paintMenuList):
(WebCore::RenderThemeEfl::adjustMenuListButtonStyle):
(WebCore::RenderThemeEfl::paintMenuListButtonDecorations):
(WebCore::RenderThemeEfl::adjustTextFieldStyle):
(WebCore::RenderThemeEfl::paintTextField):
(WebCore::RenderThemeEfl::adjustTextAreaStyle):
(WebCore::RenderThemeEfl::paintTextArea):
(WebCore::RenderThemeEfl::adjustSearchFieldResultsButtonStyle):
(WebCore::RenderThemeEfl::paintSearchFieldResultsButton):
(WebCore::RenderThemeEfl::adjustSearchFieldResultsDecorationPartStyle):
(WebCore::RenderThemeEfl::paintSearchFieldResultsDecorationPart):
(WebCore::RenderThemeEfl::adjustSearchFieldCancelButtonStyle):
(WebCore::RenderThemeEfl::paintSearchFieldCancelButton):
(WebCore::RenderThemeEfl::adjustSearchFieldStyle):
(WebCore::RenderThemeEfl::paintSearchField):
(WebCore::RenderThemeEfl::adjustInnerSpinButtonStyle):
(WebCore::RenderThemeEfl::updateCachedSystemFontDescription):
(WebCore::RenderThemeEfl::adjustProgressBarStyle):
* rendering/RenderThemeEfl.h:
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::adjustRepaintRect):
(WebCore::RenderThemeGtk::adjustButtonStyle):
(WebCore::RenderThemeGtk::paintButton):
(WebCore::RenderThemeGtk::adjustMenuListStyle):
(WebCore::RenderThemeGtk::adjustMenuListButtonStyle):
(WebCore::RenderThemeGtk::paintMenuListButtonDecorations):
(WebCore::RenderThemeGtk::adjustTextFieldStyle):
(WebCore::RenderThemeGtk::paintTextField):
(WebCore::RenderThemeGtk::paintTextArea):
(WebCore::RenderThemeGtk::adjustSearchFieldResultsButtonStyle):
(WebCore::RenderThemeGtk::paintSearchFieldResultsButton):
(WebCore::RenderThemeGtk::adjustSearchFieldResultsDecorationPartStyle):
(WebCore::RenderThemeGtk::adjustSearchFieldCancelButtonStyle):
(WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
(WebCore::RenderThemeGtk::adjustSearchFieldStyle):
(WebCore::RenderThemeGtk::shouldHaveCapsLockIndicator):
(WebCore::RenderThemeGtk::adjustSliderTrackStyle):
(WebCore::RenderThemeGtk::adjustSliderThumbStyle):
(WebCore::RenderThemeGtk::paintSliderTrack):
(WebCore::RenderThemeGtk::adjustSliderThumbSize):
(WebCore::RenderThemeGtk::innerSpinButtonLayout):
(WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
(WebCore::spinButtonArrowSize):
(WebCore::RenderThemeGtk::paintMediaCurrentTime):
(WebCore::RenderThemeGtk::adjustProgressBarStyle):
* rendering/RenderThemeGtk.h:
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::addRoundedBorderClip):
(WebCore::RenderThemeIOS::adjustCheckboxStyle):
(WebCore::RenderThemeIOS::isControlStyled):
(WebCore::RenderThemeIOS::adjustRadioStyle):
(WebCore::adjustInputElementButtonStyle):
(WebCore::RenderThemeIOS::adjustMenuListButtonStyle):
(WebCore::RenderThemeIOS::adjustSliderTrackStyle):
(WebCore::RenderThemeIOS::paintSliderTrack):
(WebCore::RenderThemeIOS::adjustSliderThumbSize):
(WebCore::RenderThemeIOS::sliderTickOffsetFromTrackCenter):
(WebCore::RenderThemeIOS::adjustSearchFieldStyle):
(WebCore::RenderThemeIOS::paintSearchFieldDecorations):
(WebCore::RenderThemeIOS::adjustButtonStyle):
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintTextField):
(WebCore::RenderThemeMac::adjustTextFieldStyle):
(WebCore::RenderThemeMac::paintTextArea):
(WebCore::RenderThemeMac::adjustTextAreaStyle):
(WebCore::RenderThemeMac::animationDurationForProgressBar):
(WebCore::RenderThemeMac::adjustProgressBarStyle):
(WebCore::menuListButtonSizes):
(WebCore::RenderThemeMac::adjustMenuListStyle):
(WebCore::RenderThemeMac::popupMenuSize):
(WebCore::RenderThemeMac::adjustMenuListButtonStyle):
(WebCore::RenderThemeMac::adjustSliderTrackStyle):
(WebCore::RenderThemeMac::paintSliderTrack):
(WebCore::RenderThemeMac::adjustSliderThumbStyle):
(WebCore::RenderThemeMac::setSearchFieldSize):
(WebCore::RenderThemeMac::adjustSearchFieldStyle):
(WebCore::RenderThemeMac::cancelButtonSizes):
(WebCore::RenderThemeMac::adjustSearchFieldCancelButtonStyle):
(WebCore::RenderThemeMac::resultsButtonSizes):
(WebCore::RenderThemeMac::adjustSearchFieldDecorationPartStyle):
(WebCore::RenderThemeMac::paintSearchFieldDecorationPart):
(WebCore::RenderThemeMac::adjustSearchFieldResultsDecorationPartStyle):
(WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart):
(WebCore::RenderThemeMac::adjustSearchFieldResultsButtonStyle):
(WebCore::RenderThemeMac::adjustSliderThumbSize):
* rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::paintButton):
(WebCore::RenderThemeWin::adjustInnerSpinButtonStyle):
(WebCore::RenderThemeWin::paintMenuList):
(WebCore::RenderThemeWin::adjustMenuListStyle):
(WebCore::RenderThemeWin::adjustMenuListButtonStyle):
(WebCore::RenderThemeWin::adjustSliderThumbSize):
(WebCore::RenderThemeWin::paintSearchField):
(WebCore::RenderThemeWin::adjustSearchFieldStyle):
(WebCore::RenderThemeWin::paintSearchFieldCancelButton):
(WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle):
(WebCore::RenderThemeWin::adjustSearchFieldDecorationPartStyle):
(WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle):
(WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
(WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle):
(WebCore::RenderThemeWin::adjustMeterStyle):
* rendering/RenderThemeWin.h:

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

4 years ago[JSC] DFG should support relational comparisons of Number and Other
commit-queue@webkit.org [Sun, 17 Apr 2016 04:55:02 +0000 (04:55 +0000)]
[JSC] DFG should support relational comparisons of Number and Other
https://bugs.webkit.org/show_bug.cgi?id=156669

Patch by Benjamin Poulain <bpoulain@webkit.org> on 2016-04-16
Reviewed by Darin Adler.

In Sunspider/3d-raytrace, DFG falls back to JSValue in some important
relational compare because profiling sees "undefined" from time to time.

This case is fairly common outside Sunspider too because of out-of-bounds array access.
Unfortunately for us, our fallback for compare is really inefficient.

Fortunately, relational comparison with null/undefined/true/false are trival.
We can just convert both side to Double. That's what this patch adds.

I also extended constant folding for those cases because I noticed
a bunch of "undefined" constant going through DoubleRep at runtime.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* tests/stress/compare-number-and-other.js: Added.
(opaqueSideEffect):
(let.operator.of.operators.eval.testPolymorphic):
(let.operator.of.operators.let.left.of.typeCases.let.right.of.typeCases.eval.testMonomorphic):
(let.operator.of.operators.let.left.of.typeCases.let.right.of.typeCases.testMonomorphicLeftConstant):
(let.operator.of.operators.let.left.of.typeCases.let.right.of.typeCases.testMonomorphicRightConstant):
(let.operator.of.operators.let.left.of.typeCases.let.right.of.typeCases.i.testPolymorphic):

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

4 years ago[JSC] FRound/Negate can produce an impure NaN out of a pure NaN
commit-queue@webkit.org [Sun, 17 Apr 2016 03:44:52 +0000 (03:44 +0000)]
[JSC] FRound/Negate can produce an impure NaN out of a pure NaN
https://bugs.webkit.org/show_bug.cgi?id=156528

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-04-16
Reviewed by Filip Pizlo.

If you fround a double with the bits 0xfff7000000000000
you get 0xfffe000000000000. The first is a pure NaN, the second isn't.

This is without test because I could not find a way to create a 0xfff7000000000000
while convincing DFG that its pure.
When we purify NaNs from typed array, we use a specific value of NaN if the input
is any NaN, making testing tricky.

* bytecode/SpeculatedType.cpp:
(JSC::typeOfDoubleNegation):

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

4 years agoLocalization files with empty Language: block build with gettext 0.19
mcatanzaro@igalia.com [Sun, 17 Apr 2016 02:39:19 +0000 (02:39 +0000)]
Localization files with empty Language: block build with gettext 0.19
https://bugs.webkit.org/show_bug.cgi?id=133611

Reviewed by Darin Adler.

Fix the language tags. Note that the build error is not actually important here as it only
occurs with an older version of gettext, but presumably it's bad for the language tags to be
wrong.

* as.po:
* en_CA.po:
* gu.po: Also correct the translation team to Gujarati.
* hu.po:
* id.po:
* ko.po:
* lv.po:
* pa.po:
* ru.po:
* sl.po:

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

4 years agoJS::DFG::nodeValuePairListDump does not compile with libstdc++ 4.8
commit-queue@webkit.org [Sun, 17 Apr 2016 01:29:55 +0000 (01:29 +0000)]
JS::DFG::nodeValuePairListDump does not compile with libstdc++ 4.8
https://bugs.webkit.org/show_bug.cgi?id=156670

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-04-16
Reviewed by Darin Adler.

* dfg/DFGNode.h:
(JSC::DFG::nodeValuePairListDump): Modified to use lambda as comparator.

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

4 years agoWeb Inspector: Adopt Number.prototype.toLocaleString For All Sizes and Times
mattbaker@apple.com [Sun, 17 Apr 2016 01:26:07 +0000 (01:26 +0000)]
Web Inspector: Adopt Number.prototype.toLocaleString For All Sizes and Times
https://bugs.webkit.org/show_bug.cgi?id=152033
<rdar://problem/23815589>

Reviewed by Timothy Hatcher.

Source/WebInspectorUI:

Update string formatters to localize float and percentage strings. Hook up
console message formatters to use String.standardFormatters so that console
statements (e.g. console.log("%.3f", 3.14159)) are properly formatted.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Utilities.js:
(value):
tokenizeFormatString should default to 6 digits when no precision
sub-specifier is provided.

percentageString should localize formatting, and take a fraction value
(0 to 1) instead of a percentage.

secondsToString should perform special-case formatting for zero values
("0ms") instead of the general purpose float formatter.

(value.d):
Switch to parseInt to floor floating point values and support numeric strings.
Return NaN instead of zero when passed a value that can't be converted to integer.

(value.f):
Switch to parseFloat to support numeric strings, and localize formatting.
Remove precision check, as it will never be less than zero. Return NaN
instead of zero when passed a value that can't be converted to float.

(prettyFunctionName):
Convert substitutions (an arguments object) to an array before calling join.

* UserInterface/Views/ConsoleMessageView.js:
(WebInspector.ConsoleMessageView.prototype._formatWithSubstitutionString.floatFormatter):
Use String.standardFormatters.f.

(WebInspector.ConsoleMessageView.prototype._formatWithSubstitutionString.integerFormatter):
Use String.standardFormatters.d.

* UserInterface/Views/LayoutTimelineDataGridNode.js:
(WebInspector.LayoutTimelineDataGridNode.prototype.createCellContent):
(WebInspector.LayoutTimelineDataGridNode):
Use integer formatting for pixel values.

* UserInterface/Views/ProfileDataGridNode.js:
(WebInspector.ProfileDataGridNode.prototype._recalculateData):
(WebInspector.ProfileDataGridNode.prototype._totalTimeContent):
Treat percentage as a fraction from 0 to 1.

* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WebInspector.ResourceDetailsSidebarPanel.prototype._refreshImageSizeSection):
Use integer formatting for pixel values.

LayoutTests:

Add test coverage for string formatters, and additional test cases for
Number.percentageString and Number.secondsToString.

* inspector/unit-tests/number-utilities-expected.txt:
* inspector/unit-tests/number-utilities.html:
* inspector/unit-tests/string-utilities-expected.txt: Added.
* inspector/unit-tests/string-utilities.html: Added.

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

4 years agodisplay:inline on the tbody is causing the width of the iframe to be shrunk to the...
mattbaker@apple.com [Sun, 17 Apr 2016 01:20:00 +0000 (01:20 +0000)]
display:inline on the tbody is causing the width of the iframe to be shrunk to the minimum size of its text.
https://bugs.webkit.org/show_bug.cgi?id=15666

Reviewed by Timothy Hatcher.

Fix a regression caused by the recent Timelines UI redesign, and
reorder TimelineDataGrid's constructor arguments now that most
timeline views no longer have an associated tree outline.

* UserInterface/Views/HeapAllocationsTimelineView.js:
(WebInspector.HeapAllocationsTimelineView):
* UserInterface/Views/LayoutTimelineView.js:
(WebInspector.LayoutTimelineView):
* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView):
* UserInterface/Views/NetworkTimelineView.js:
(WebInspector.NetworkTimelineView):
* UserInterface/Views/RenderingFrameTimelineView.js:
(WebInspector.RenderingFrameTimelineView):
* UserInterface/Views/ScriptDetailsTimelineView.js:
(WebInspector.ScriptDetailsTimelineView):
Reorder constructor parameters and omit optional treeOutline and
synchronizerDelegate arguments when they aren't needed.

* UserInterface/Views/TimelineDataGrid.js:
(WebInspector.TimelineDataGrid):
Reorder constructor arguments so that treeOutline can be optional.
(WebInspector.TimelineDataGrid.prototype._refreshDirtyDataGridNodes):
Nodes should be refreshed and re-inserted in the data grid without
requiring a grid synchronizer. If a synchronizer exists, re-insert
the tree element for the node. Since the syncronizer is disabled the
order of grid/tree operations doesn't matter.

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

4 years agoMore build fixing.
weinig@apple.com [Sun, 17 Apr 2016 00:40:55 +0000 (00:40 +0000)]
More build fixing.

* MiniBrowser/mac/BrowserWindowController.m:
(-[BrowserWindowController share:]):

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

4 years agoAnother build fix.
weinig@apple.com [Sun, 17 Apr 2016 00:26:05 +0000 (00:26 +0000)]
Another build fix.

* MiniBrowser/mac/BrowserWindowController.m:
(-[BrowserWindowController sharingServicePicker:sharingServicesForItems:proposedSharingServices:]):

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

4 years agoFix 32-bit build.
weinig@apple.com [Sun, 17 Apr 2016 00:19:58 +0000 (00:19 +0000)]
Fix 32-bit build.

* MiniBrowser/mac/BrowserWindowController.m:
(-[BrowserWindowController share:]):
(-[BrowserWindowController fetch:]):
(-[BrowserWindowController sharingService:transitionImageForShareItem:contentRect:]):

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

4 years agoAdd support for NSSharingService to MiniBrowser, for no great reasons
weinig@apple.com [Sun, 17 Apr 2016 00:10:45 +0000 (00:10 +0000)]
Add support for NSSharingService to MiniBrowser, for no great reasons
https://bugs.webkit.org/show_bug.cgi?id=156658

Reviewed by Darin Adler.

* MiniBrowser/mac/BrowserWindow.xib:
* MiniBrowser/mac/BrowserWindowController.h:
Add the share button.

* MiniBrowser/mac/BrowserWindowController.m:
(-[BrowserWindowController windowDidLoad]):
Set the share button to fire it's actions on mouse down, as it is supposed to act like a menu.

(-[BrowserWindowController share:]):
Show the picker when the button is pressed.
(-[BrowserWindowController mainContentView]):
Add a new override to get the main content view of derived classes (either a WKWebView or the WebView).

(-[BrowserWindowController sharingServicePicker:sharingServicesForItems:proposedSharingServices:]):
(-[BrowserWindowController sharingServicePicker:delegateForSharingService:]):
(-[BrowserWindowController sharingServicePicker:didChooseSharingService:]):
(-[BrowserWindowController sharingService:sourceFrameOnScreenForShareItem:]):
(-[BrowserWindowController sharingService:transitionImageForShareItem:contentRect:]):
(-[BrowserWindowController sharingService:sourceWindowForShareItems:sharingContentScope:]):
Add delegate methods.

* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController mainContentView]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController mainContentView]):
Implement to return the web view.

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

4 years ago[GTK] [l10n] Updated Turkish translation of WebKitGTK+
mcatanzaro@igalia.com [Sat, 16 Apr 2016 22:52:48 +0000 (22:52 +0000)]
[GTK] [l10n] Updated Turkish translation of WebKitGTK+
https://bugs.webkit.org/show_bug.cgi?id=156667

Patch by Muhammet Kara <muhammetk@gmail.com> on 2016-04-16
Rubber-stamped by Michael Catanzaro.

* tr.po:

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

4 years ago[Mac] Web Content service with a restricted entitlement may load arbitrary dylibs
mitz@apple.com [Sat, 16 Apr 2016 21:37:08 +0000 (21:37 +0000)]
[Mac] Web Content service with a restricted entitlement may load arbitrary dylibs
https://bugs.webkit.org/show_bug.cgi?id=156668
<rdar://problem/25429784>

Reviewed by Anders Carlsson.

* Configurations/WebContentService.xcconfig: Enable library validation when the Web Content
  service is given the XPC domain extension entitlement.

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

4 years agoBuild fix.
ap@apple.com [Sat, 16 Apr 2016 18:16:17 +0000 (18:16 +0000)]
Build fix.

Temporary workaround for rdar://problem/25754945.

* LayoutTestRelay/LayoutTestRelay/CoreSimulatorSPI.h:

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

4 years ago[mips] Implemented moveZeroToDouble.
commit-queue@webkit.org [Sat, 16 Apr 2016 17:59:54 +0000 (17:59 +0000)]
[mips] Implemented moveZeroToDouble.
https://bugs.webkit.org/show_bug.cgi?id=155429

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-04-16
Reviewed by Darin Adler.

This function is required to fix compilation after r197687.

* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::moveZeroToDouble):

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

4 years agoCSSCursorImageValue shouldn't mutate element during style resolution
antti@apple.com [Sat, 16 Apr 2016 17:53:18 +0000 (17:53 +0000)]
CSSCursorImageValue shouldn't mutate element during style resolution
https://bugs.webkit.org/show_bug.cgi?id=156659

Reviewed by Darin Adler.

CSSCursorImageValue::updateIfSVGCursorIsUsed may mutate the argument element.

This patch removes the code that caches cursor element and image to SVGElement rare data.
The whole things is basically unused. CSSCursorImageValue now maintains a weak map to
SVGCursorElements directly instead of indirectly via the using SVGElements.

* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::CSSCursorImageValue):
(WebCore::CSSCursorImageValue::~CSSCursorImageValue):
(WebCore::CSSCursorImageValue::customCSSText):
(WebCore::CSSCursorImageValue::updateCursorElement):

    We no longer rely on SVGElement rare data so no need to test for SVGElement.

(WebCore::CSSCursorImageValue::cursorElementRemoved):
(WebCore::CSSCursorImageValue::cursorElementChanged):

    Factor to a function.

(WebCore::CSSCursorImageValue::cachedImage):
(WebCore::CSSCursorImageValue::clearCachedImage):
(WebCore::CSSCursorImageValue::equals):
(WebCore::CSSCursorImageValue::removeReferencedElement): Deleted.

    Don't track client elements anymore. Just track referenced SVGCursorElements.

* css/CSSCursorImageValue.h:
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueCursor):

    No need to make style unique. Initialization is now done in updateSVGCursorElement.

* svg/SVGCursorElement.cpp:
(WebCore::SVGCursorElement::~SVGCursorElement):
(WebCore::SVGCursorElement::isSupportedAttribute):
(WebCore::SVGCursorElement::parseAttribute):
(WebCore::SVGCursorElement::addClient):
(WebCore::SVGCursorElement::removeClient):

    Client is now an CSSCursorImageValue rather than SVGElement.

(WebCore::SVGCursorElement::svgAttributeChanged):

    Instead of invalidating element style just invalidate the CSSCursorImageValue directly.

(WebCore::SVGCursorElement::addSubresourceAttributeURLs):
(WebCore::SVGCursorElement::removeReferencedElement): Deleted.
* svg/SVGCursorElement.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::~SVGElement):
(WebCore::SVGElement::getBoundingBox):
(WebCore::SVGElement::correspondingElement):
(WebCore::SVGElement::setCursorElement): Deleted.
(WebCore::SVGElement::cursorElementRemoved): Deleted.
(WebCore::SVGElement::setCursorImageValue): Deleted.
(WebCore::SVGElement::cursorImageValueRemoved): Deleted.

    SVGElements no longer need to know about their cursors.

* svg/SVGElement.h:
* svg/SVGElementRareData.h:
(WebCore::SVGElementRareData::instanceUpdatesBlocked):
(WebCore::SVGElementRareData::setInstanceUpdatesBlocked):
(WebCore::SVGElementRareData::correspondingElement):
(WebCore::SVGElementRareData::setCorrespondingElement):
(WebCore::SVGElementRareData::animatedSMILStyleProperties):
(WebCore::SVGElementRareData::ensureAnimatedSMILStyleProperties):
(WebCore::SVGElementRareData::cursorElement): Deleted.
(WebCore::SVGElementRareData::setCursorElement): Deleted.
(WebCore::SVGElementRareData::cursorImageValue): Deleted.
(WebCore::SVGElementRareData::setCursorImageValue): Deleted.

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

4 years agoSubmit the first version of Finnish translation
mcatanzaro@igalia.com [Sat, 16 Apr 2016 16:08:54 +0000 (16:08 +0000)]
Submit the first version of Finnish translation
https://bugs.webkit.org/show_bug.cgi?id=153406

Patch by Jiri Grönroos <jiri.gronroos+l10n@iki.fi> on 2016-04-16
Rubber-stamped by Michael Catanzaro. For FINLAN.

* fi.po: Added. Note it's pretty incomplete as of yet.

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

4 years ago[GTK] [l10n] Updated Bulgarian translation of WebKitGTK+
mcatanzaro@igalia.com [Sat, 16 Apr 2016 15:54:34 +0000 (15:54 +0000)]
[GTK] [l10n] Updated Bulgarian translation of WebKitGTK+
https://bugs.webkit.org/show_bug.cgi?id=156656

Patch by Zahari Yurukov <zahari.yurukov@gmail.com> on 2016-04-16
Rubber-stamped by Michael Catanzaro.

* bg.po:

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

4 years ago[Mac] WebContent, Networking and Databases services have i386 slices that are never...
mitz@apple.com [Sat, 16 Apr 2016 05:26:39 +0000 (05:26 +0000)]
[Mac] WebContent, Networking and Databases services have i386 slices that are never used
https://bugs.webkit.org/show_bug.cgi?id=156654

Reviewed by Alexey Proskuryakov.

* Configurations/BaseXPCService.xcconfig: Set VALID_ARCHS to ARCHS_STANDARD when not building only
  for the active architecture.
* Configurations/PluginService.32.xcconfig: Removed now-redundant definitions.
* Configurations/PluginService.64.xcconfig: Ditto.

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

4 years agoiTunes crashing JavaScriptCore.dll
msaboff@apple.com [Sat, 16 Apr 2016 04:52:18 +0000 (04:52 +0000)]
iTunes crashing JavaScriptCore.dll
https://bugs.webkit.org/show_bug.cgi?id=156647

Reviewed by Geoffrey Garen.

If a thread was created without using the WTF thread apis and that thread uses
a JavaScript VM and that thread exits with the VM still around, JSC won't know
that the thread has exited.  Currently, we use ThreadSpecificThreadExit() to
clean up any thread specific keys.  Cleaning up these keys is how JSC is
notified of a thread exit.  We only call ThreadSpecificThreadExit() from
wtfThreadEntryPoint() when the thread entry point function returns.
This mechanism was put in place for Windos because we layer the WTF::ThreadSpecific
functionality on top of TLS (Thread Local Storage), but TLS doesn't have
a thread exiting callback the way that pthread_create_key.

The fix is to change from using TLS to using FLS (Fiber Local Storage).  Although
Windows allows multiple fibers per thread, WebKit is not designed to work with a
multiple fibers per thread.  When ther is only one fiber per thread, FLS works just
like TLS, but it has the destroy callback.

I restructured the Windows version of WTF::ThreadSpecific to be almost the same
as the pthread version.

* wtf/ThreadSpecific.h:
(WTF::threadSpecificKeyCreate):
(WTF::threadSpecificKeyDelete):
(WTF::threadSpecificSet):
(WTF::threadSpecificGet):
(WTF::ThreadSpecific<T>::ThreadSpecific):
(WTF::ThreadSpecific<T>::~ThreadSpecific):
(WTF::ThreadSpecific<T>::get):
(WTF::ThreadSpecific<T>::set):
(WTF::ThreadSpecific<T>::destroy):
Restructured to use FLS.  Renamed TLS* to FLS*.

* wtf/ThreadSpecificWin.cpp:
(WTF::flsKeyCount):
(WTF::flsKeys):
Renamed from tlsKey*() to flsKey*().

(WTF::destructorsList): Deleted.
(WTF::destructorsMutex): Deleted.
(WTF::PlatformThreadSpecificKey::PlatformThreadSpecificKey): Deleted.
(WTF::PlatformThreadSpecificKey::~PlatformThreadSpecificKey): Deleted.
(WTF::PlatformThreadSpecificKey::setValue): Deleted.
(WTF::PlatformThreadSpecificKey::value): Deleted.
(WTF::PlatformThreadSpecificKey::callDestructor): Deleted.
(WTF::tlsKeyCount): Deleted.
(WTF::tlsKeys): Deleted.
(WTF::threadSpecificKeyCreate): Deleted.
(WTF::threadSpecificKeyDelete): Deleted.
(WTF::threadSpecificSet): Deleted.
(WTF::threadSpecificGet): Deleted.
(WTF::ThreadSpecificThreadExit): Deleted.

* wtf/ThreadingWin.cpp:
(WTF::wtfThreadEntryPoint): Eliminated call to ThreadSpecificThreadExit.

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

4 years agoNeed a way to specify a script name to show in the inspector for scripts injected...
weinig@apple.com [Sat, 16 Apr 2016 04:29:32 +0000 (04:29 +0000)]
Need a way to specify a script name to show in the inspector for scripts injected via WKUserScript
<rdar://problem/25626662>
https://bugs.webkit.org/show_bug.cgi?id=156653

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKUserScript.mm:
(-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:userContentWorld:]):
* UIProcess/API/Cocoa/WKUserScriptPrivate.h:
Add a new initializer that takes an associate URL that is used to represent the user script.

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

4 years agoReduce use of Deprecated::ScriptXXX classes
darin@apple.com [Sat, 16 Apr 2016 02:25:56 +0000 (02:25 +0000)]
Reduce use of Deprecated::ScriptXXX classes
https://bugs.webkit.org/show_bug.cgi?id=156632

Reviewed by Alex Christensen.

Source/JavaScriptCore:

* bindings/ScriptFunctionCall.cpp:
(Deprecated::ScriptCallArgumentHandler::appendArgument): Deleted version that takes a Deprecated::ScriptValue.
(Deprecated::ScriptFunctionCall::call): Changed to return a JSValue.
* bindings/ScriptFunctionCall.h: Updated for the above.

* bindings/ScriptValue.cpp:
(Inspector::jsToInspectorValue): Moved from Deprecated namespace to Inspector namespace. Later, we should
move this to another source file in the inspector directory.
(Inspector::toInspectorValue): Added.
(Deprecated::ScriptValue::toInspectorValue): Updated for change to underlying function.
* bindings/ScriptValue.h: Update for the above.

* inspector/InjectedScript.cpp:
(Inspector::InjectedScript::evaluateOnCallFrame): Changed arguments and return values from
Deprecated::ScriptValue to JSC::JSValue.
(Inspector::InjectedScript::functionDetails): Ditto.
(Inspector::InjectedScript::wrapCallFrames): Ditto.
(Inspector::InjectedScript::wrapObject): Ditto.
(Inspector::InjectedScript::wrapTable): Ditto.
(Inspector::InjectedScript::previewValue): Ditto.
(Inspector::InjectedScript::setExceptionValue): Ditto.
(Inspector::InjectedScript::findObjectById): Ditto.
(Inspector::InjectedScript::inspectObject): Ditto.
* inspector/InjectedScript.h: Ditto.
* inspector/InjectedScriptBase.cpp:
(Inspector::InjectedScriptBase::callFunctionWithEvalEnabled): Ditto.
(Inspector::InjectedScriptBase::makeCall): Ditto.
* inspector/InjectedScriptBase.h: Ditto.
* inspector/InjectedScriptModule.cpp:
(Inspector::InjectedScriptModule::ensureInjected): Ditto.
* inspector/ScriptDebugListener.h: Ditto.
* inspector/ScriptDebugServer.cpp:
(Inspector::ScriptDebugServer::evaluateBreakpointAction): Ditto.
(Inspector::ScriptDebugServer::dispatchDidPause): Ditto.
(Inspector::ScriptDebugServer::dispatchBreakpointActionProbe): Ditto.
(Inspector::ScriptDebugServer::exceptionOrCaughtValue): Ditto.
* inspector/ScriptDebugServer.h: Ditto.
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::buildExceptionPauseReason): Ditto.
(Inspector::InspectorDebuggerAgent::didPause): Ditto.
(Inspector::InspectorDebuggerAgent::breakpointActionProbe): Ditto.
(Inspector::InspectorDebuggerAgent::didContinue): Ditto.
(Inspector::InspectorDebuggerAgent::clearDebuggerBreakpointState): Ditto.
* inspector/agents/InspectorDebuggerAgent.h: Ditto.
* inspector/agents/InspectorHeapAgent.cpp:
(Inspector::InspectorHeapAgent::getPreview): Ditto.
(Inspector::InspectorHeapAgent::getRemoteObject): Ditto.

Source/WebCore:

* Modules/mediastream/SDPProcessor.cpp: Removed unneeded include.

* bindings/js/JSCommandLineAPIHostCustom.cpp:
(WebCore::JSCommandLineAPIHost::inspectedObject): Use JSValue.
* bindings/js/JSCustomEventCustom.cpp:
(WebCore::JSCustomEvent::detail): Ditto.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateInWorld): Ditto.
(WebCore::ScriptController::evaluate): Ditto.
(WebCore::ScriptController::executeScriptInWorld): Ditto.
(WebCore::ScriptController::executeScript): Ditto.
(WebCore::ScriptController::executeIfJavaScriptURL): Ditto.
* bindings/js/ScriptController.h: Ditto.

* bindings/js/ScriptGlobalObject.cpp: Removed unused overload of set,
and unused remove and folded handleException function into its one call site.
(WebCore::ScriptGlobalObject::set): Take references instead of pointers.
(WebCore::ScriptGlobalObject::get): Use JSObject instead of Deprecated::ScriptObject.
* bindings/js/ScriptGlobalObject.h: Updated for the above.

* dom/CustomEvent.cpp:
(WebCore::CustomEvent::initCustomEvent): Take JSValue and ExecState instead of
Deprecated::ScriptValue.
(WebCore::CustomEvent::trySerializeDetail): Take a reference instead of a pointer.
Also removed an unneeded null check.
* dom/CustomEvent.h: Use JSValue.
* dom/CustomEvent.idl: Updated for the above.

* html/HTMLMediaElement.cpp: Remove unneeded include.

* inspector/CommandLineAPIHost.cpp:
(WebCore::CommandLineAPIHost::InspectableObject::get): Take reference instead of
pointer and return JSValue.
* inspector/CommandLineAPIHost.h: Updated for the above.

* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::setDocument): Use "document" instead of "doc".
(WebCore::InspectorDOMAgent::setAttributesAsText): Omit redundant class name.
(WebCore::InspectorDOMAgent::focusNode): Ditto. Pass reference instead of pointer.
(WebCore::InspectorDOMAgent::undo): Ditto.
(WebCore::InspectorDOMAgent::redo): Ditto.
(WebCore::InspectorDOMAgent::nodeForObjectId): Stop using Deprecated::ScriptValue.
(WebCore::InspectorDOMAgent::resolveNode): Ditto.
(WebCore::InspectorDOMAgent::scriptValueAsNode): Removed unneeded isObject check,
which is already done by JSNode::toWrapped. Use JSValue.
(WebCore::InspectorDOMAgent::nodeAsScriptValue): Use JSValue.
* inspector/InspectorDOMAgent.h: Updated for the above.

* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::windowObjectCleared): Use references instead of
pointers and removed unneeded local.
(WebCore::InspectorFrontendClientLocal::evaluateAsBoolean): More of the same.
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::showContextMenu): Ditto.

* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::breakpointActionProbe): Updated to take
reference instead of pointer and JSValue instead of ScriptValue.
* inspector/InspectorTimelineAgent.h: Ditto.
* inspector/PageConsoleAgent.cpp: Ditto.
* inspector/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::breakpointActionLog): Ditto.
* inspector/PageDebuggerAgent.h: Ditto.

Source/WebKit/mac:

* WebView/WebFrame.mm:
(-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): Use references instead
of pointers.
(-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]): Updated
since return value is a JSValue.
* WebView/WebView.mm:
(-[WebView aeDescByEvaluatingJavaScriptFromString:]): Ditto.

Source/WebKit/win:

* Plugins/PluginView.cpp:
(WebCore::PluginView::performRequest): Use JSValue.
* WebFrame.cpp:
(WebFrame::stringByEvaluatingJavaScriptInScriptWorld): Ditto.
* WebView.cpp:
(WebView::stringByEvaluatingJavaScriptFromString): Ditto.

Source/WebKit2:

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::performJavaScriptURLRequest): Use JSValue.
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::windowObjectCleared): Use references.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::runJavaScriptInMainFrame): Use JSValue.

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

4 years agoSome JIT/DFG operations need NativeCallFrameTracers
keith_miller@apple.com [Sat, 16 Apr 2016 01:26:10 +0000 (01:26 +0000)]
Some JIT/DFG operations need NativeCallFrameTracers
https://bugs.webkit.org/show_bug.cgi?id=156650

Reviewed by Michael Saboff.

Some of our operation functions did not have native call frame
tracers. This meant that we would crash occasionally on some
of our tests when they triggered a GC in one of the functions
without a tracer. In particular, this was exemplified by another
upcoming patch when calling operationSetFunctionName.

This patch does not add tests since this happens consistently in
the patch adding delete_by_id to the DFG.

* dfg/DFGOperations.cpp:
* jit/JITOperations.cpp:

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

4 years agoAnimometer test could report a NaN
jonlee@apple.com [Sat, 16 Apr 2016 01:02:59 +0000 (01:02 +0000)]
Animometer test could report a NaN
https://bugs.webkit.org/show_bug.cgi?id=156646

Reviewed by Darin Adler.
Provisionally reviewed by Said Abou-Hallawa.

* Animometer/tests/resources/main.js:
(didFinishInterval): The ramp controller has a first phase where it ramps up the complexity and
reacts based on how well the system handles the load. The assumption was that it would handle at least
1 particle easily. That is not always the case. As a result, an interpolation calculation could
end up setting an upper bound of NaN.

This occurs because we never get out of the first tier, so this._lastTierComplexity is undefined.
Now that we guarantee a minimum complexity of 1, modify the conditional to check for this._lastTierComplexity
before interpolating the upper bound of the first ramp. In the case where the system struggles with
1 particle, set it to currentComplexity.

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

4 years agoREGRESSION( r199603): Pandora crashes WebKit in WebPlaybackSessionManager::removeClie...
jer.noble@apple.com [Sat, 16 Apr 2016 00:01:59 +0000 (00:01 +0000)]
REGRESSION( r199603): Pandora crashes WebKit in WebPlaybackSessionManager::removeClientForContext
https://bugs.webkit.org/show_bug.cgi?id=156648
<rdar://problem/25758117>

Reviewed by Beth Dakin.

Mistakenly checked in a reversed condition check, which causes a subsequent assert and crash.

* WebProcess/cocoa/WebPlaybackSessionManager.mm:
(WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):

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

4 years ago[Font Loading] Test promise gets rejected when unknown format used
mmaxfield@apple.com [Fri, 15 Apr 2016 22:24:36 +0000 (22:24 +0000)]
[Font Loading] Test promise gets rejected when unknown format used
https://bugs.webkit.org/show_bug.cgi?id=156643

Reviewed by Simon Fraser.

When all the sources have an unknown format, the promise should be rejected.

* fast/text/font-face-javascript-expected.txt:
* fast/text/font-face-javascript.html:

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

4 years agoCSP: Ignore paths in CSP matching after redirects
dbates@webkit.org [Fri, 15 Apr 2016 22:23:44 +0000 (22:23 +0000)]
CSP: Ignore paths in CSP matching after redirects
https://bugs.webkit.org/show_bug.cgi?id=153154
<rdar://problem/24383215>

Reviewed by Brent Fulgham.

Source/WebCore:

For sub-resources that redirect, match the URL that is the result of the redirect against
the source expressions in Content Security Policy ignoring any paths in those source
expressions as per section Paths and Redirects of the Content Security Policy Level 2 spec.,
<https://w3c.github.io/webappsec-csp/2/> (Editor's Draft, 29 August 2015).

Tests: http/tests/security/contentSecurityPolicy/audio-redirect-allowed2.html
       http/tests/security/contentSecurityPolicy/embed-redirect-allowed.html
       http/tests/security/contentSecurityPolicy/embed-redirect-allowed2.html
       http/tests/security/contentSecurityPolicy/embed-redirect-blocked.html
       http/tests/security/contentSecurityPolicy/embed-redirect-blocked2.html
       http/tests/security/contentSecurityPolicy/embed-redirect-blocked3.html
       http/tests/security/contentSecurityPolicy/font-redirect-allowed2.html
       http/tests/security/contentSecurityPolicy/form-action-src-redirect-allowed.html
       http/tests/security/contentSecurityPolicy/form-action-src-redirect-allowed2.html
       http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-child-src.html
       http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-child-src2.html
       http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-frame-src.html
       http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-frame-src2.html
       http/tests/security/contentSecurityPolicy/iframe-redirect-blocked-by-child-src.html
       http/tests/security/contentSecurityPolicy/iframe-redirect-blocked-by-frame-src.html
       http/tests/security/contentSecurityPolicy/image-redirect-allowed2.html
       http/tests/security/contentSecurityPolicy/object-redirect-allowed.html
       http/tests/security/contentSecurityPolicy/object-redirect-allowed2.html
       http/tests/security/contentSecurityPolicy/object-redirect-blocked.html
       http/tests/security/contentSecurityPolicy/object-redirect-blocked2.html
       http/tests/security/contentSecurityPolicy/object-redirect-blocked3.html
       http/tests/security/contentSecurityPolicy/script-redirect-allowed2.html
       http/tests/security/contentSecurityPolicy/stylesheet-redirect-allowed2.html
       http/tests/security/contentSecurityPolicy/svg-font-redirect-allowed2.html
       http/tests/security/contentSecurityPolicy/svg-image-redirect-allowed2.html
       http/tests/security/contentSecurityPolicy/track-redirect-allowed2.html
       http/tests/security/contentSecurityPolicy/video-redirect-allowed2.html
       http/tests/security/contentSecurityPolicy/xsl-redirect-allowed2.html

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest): Define a local variable didReceiveRedirectResponse as
to whether this request follows from having received a redirect response from the server. Pass this
information to FrameLoader::checkIfFormActionAllowedByCSP() and PolicyChecker::checkNavigationPolicy()
for its consideration.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::redirectReceived): Pass whether we have a non-null redirect
response (i.e. received a redirect response from the server) to DocumentThreadableLoader::isAllowedByContentSecurityPolicy()
for its consideration.
(WebCore::DocumentThreadableLoader::loadRequest): Pass whether we performed a redirect to
DocumentThreadableLoader::isAllowedByContentSecurityPolicy() for its consideration.
(WebCore::DocumentThreadableLoader::isAllowedByContentSecurityPolicy): Modified to take a boolean
argument as to whether a redirect was performed. We pass this information to the appropriate
ContentSecurityPolicy method.
* loader/DocumentThreadableLoader.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkIfFormActionAllowedByCSP): Modified to take a boolean argument as to whether
a redirect response was received and passes this information to ContentSecurityPolicy::allowFormAction()
for its consideration.
(WebCore::FrameLoader::loadURL): Modified to tell PolicyChecker::checkNavigationPolicy() that the navigation
is not in response to having received a redirect response from the server.
(WebCore::FrameLoader::loadWithDocumentLoader): Ditto.
* loader/FrameLoader.h:
* loader/PolicyChecker.cpp:
(WebCore::isAllowedByContentSecurityPolicy): Modified to take a boolean argument as to whether
a redirect response was received and passes this information to the appropriate ContentSecurityPolicy member
function for consideration.
(WebCore::PolicyChecker::checkNavigationPolicy): Modified to take a boolean argument as to whether a redirect
response was received and passes this information through to WebCore::isAllowedByContentSecurityPolicy().
* loader/PolicyChecker.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal): Modified to tell CachedResourceLoader::canRequest() that
the request is in response to having received a redirect response from the server.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::canRequest): Modified to take a boolean argument as to whether a redirect
response was received and passes this information through to the appropriate ContentSecurityPolicy member
function for consideration.
* loader/cache/CachedResourceLoader.h:
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowScriptFromSource): Modified to take an argument as to whether a
redirect response was received and passes this information through to ContentSecurityPolicyDirectiveList.
(WebCore::ContentSecurityPolicy::allowObjectFromSource): Ditto.
(WebCore::ContentSecurityPolicy::allowChildFrameFromSource): Ditto.
(WebCore::ContentSecurityPolicy::allowChildContextFromSource): Ditto.
(WebCore::ContentSecurityPolicy::allowImageFromSource): Ditto.
(WebCore::ContentSecurityPolicy::allowStyleFromSource): Ditto.
(WebCore::ContentSecurityPolicy::allowFontFromSource): Ditto.
(WebCore::ContentSecurityPolicy::allowMediaFromSource): Ditto.
(WebCore::ContentSecurityPolicy::allowConnectToSource): Ditto.
(WebCore::ContentSecurityPolicy::allowFormAction): Ditto.
* page/csp/ContentSecurityPolicy.h:
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::checkSource):
(WebCore::checkFrameAncestors):
(WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForChildContext): Modified to take an argument
as to whether a redirect response was received and passes this information through to the CSP directive.
(WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForConnectSource): Ditto.
(WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFont): Ditto.
(WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFormAction): Ditto.
(WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFrame): Ditto.
(WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForImage): Ditto.
(WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForMedia): Ditto.
(WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForObjectSource): Ditto.
(WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForScript): Ditto.
(WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForStyle): Ditto.
* page/csp/ContentSecurityPolicyDirectiveList.h:
* page/csp/ContentSecurityPolicySource.cpp:
(WebCore::ContentSecurityPolicySource::matches): Modified to take an argument as to whether a redirect response
was received. When the specified URL follows from having received a redirect response then ignore the path
component of the source expression when checking for a match. Otherwise, consider the path component of the
source expression when performing the match.
* page/csp/ContentSecurityPolicySource.h:
* page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::ContentSecurityPolicySourceList::matches): Modified to take an argument as to whether a redirect
response was received and pass this information through to ContentSecurityPolicySource::matches().
* page/csp/ContentSecurityPolicySourceList.h:
* page/csp/ContentSecurityPolicySourceListDirective.cpp:
(WebCore::ContentSecurityPolicySourceListDirective::allows): Modified to take an argument as to whether a
redirect response was received and pass this information through to ContentSecurityPolicySourceList::matches().
* page/csp/ContentSecurityPolicySourceListDirective.h:

LayoutTests:

Add tests to ensure that we ignore the path component of a source expression when matching
a sub-resource URL that is the result of a redirect.

* TestExpectations: Unskip test http/tests/security/contentSecurityPolicy/redirect-does-not-match-paths.html as it now passes.
* http/tests/security/contentSecurityPolicy/audio-redirect-allowed2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/audio-redirect-allowed2.html: Added.
* http/tests/security/contentSecurityPolicy/embed-redirect-allowed-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/embed-redirect-allowed.html: Added.
* http/tests/security/contentSecurityPolicy/embed-redirect-allowed2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/embed-redirect-allowed2.html: Added.
* http/tests/security/contentSecurityPolicy/embed-redirect-blocked-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/embed-redirect-blocked.html: Added.
* http/tests/security/contentSecurityPolicy/embed-redirect-blocked2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/embed-redirect-blocked2.html: Added.
* http/tests/security/contentSecurityPolicy/embed-redirect-blocked3-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/embed-redirect-blocked3.html: Added.
* http/tests/security/contentSecurityPolicy/font-redirect-allowed2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/font-redirect-allowed2.html: Added.
* http/tests/security/contentSecurityPolicy/form-action-src-redirect-allowed-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/form-action-src-redirect-allowed.html: Added.
* http/tests/security/contentSecurityPolicy/form-action-src-redirect-allowed2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/form-action-src-redirect-allowed2.html: Added.
* http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-child-src-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-child-src.html: Added.
* http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-child-src2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-child-src2.html: Added.
* http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-frame-src-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-frame-src.html: Added.
* http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-frame-src2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-frame-src2.html: Added.
* http/tests/security/contentSecurityPolicy/iframe-redirect-blocked-by-child-src-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/iframe-redirect-blocked-by-child-src.html: Added.
* http/tests/security/contentSecurityPolicy/iframe-redirect-blocked-by-frame-src-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/iframe-redirect-blocked-by-frame-src.html: Added.
* http/tests/security/contentSecurityPolicy/image-redirect-allowed2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/image-redirect-allowed2.html: Added.
* http/tests/security/contentSecurityPolicy/object-redirect-allowed-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/object-redirect-allowed.html: Added.
* http/tests/security/contentSecurityPolicy/object-redirect-allowed2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/object-redirect-allowed2.html: Added.
* http/tests/security/contentSecurityPolicy/object-redirect-blocked-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/object-redirect-blocked.html: Added.
* http/tests/security/contentSecurityPolicy/object-redirect-blocked2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/object-redirect-blocked2.html: Added.
* http/tests/security/contentSecurityPolicy/object-redirect-blocked3-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/object-redirect-blocked3.html: Added.
* http/tests/security/contentSecurityPolicy/redirect-does-not-match-paths-expected.txt: Update expected result now that we pass this test.
* http/tests/security/contentSecurityPolicy/resources/alert-pass.html:
* http/tests/security/contentSecurityPolicy/resources/redirect.pl: For resourceType == "image", load image http://127.0.0.1:8000/security/resources/abe.png
instead of http://127.0.0.1:8000/resources/square20.jpg as the latter does not exist.
* http/tests/security/contentSecurityPolicy/resources/xsl-redirect-allowed.php:
* http/tests/security/contentSecurityPolicy/script-redirect-allowed2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/script-redirect-allowed2.html: Added.
* http/tests/security/contentSecurityPolicy/stylesheet-redirect-allowed2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/stylesheet-redirect-allowed2.html: Added.
* http/tests/security/contentSecurityPolicy/svg-font-redirect-allowed2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/svg-font-redirect-allowed2.html: Added.
* http/tests/security/contentSecurityPolicy/svg-image-redirect-allowed2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/svg-image-redirect-allowed2.html: Added.
* http/tests/security/contentSecurityPolicy/track-redirect-allowed2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/track-redirect-allowed2.html: Added.
* http/tests/security/contentSecurityPolicy/video-redirect-allowed2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/video-redirect-allowed2.html: Added.
* http/tests/security/contentSecurityPolicy/xsl-redirect-allowed.html:
* http/tests/security/contentSecurityPolicy/xsl-redirect-allowed2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/xsl-redirect-allowed2.html: Copied from LayoutTests/http/tests/security/contentSecurityPolicy/xsl-redirect-allowed.html.
* platform/ios-simulator/TestExpectations: Skip tests {embed, object}-redirect-blocked{2, 3}.html as they make
use of a plug-in and plug-ins are not supported on iOS.
* platform/wk2/TestExpectations: Skip tests {embed, object}-redirect-blocked3.html on WebKit2 as they fail
because of <https://bugs.webkit.org/show_bug.cgi?id=156612>.

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

4 years ago[CSS Font Loading] FontFace's promise may never be resolved/rejected if Content Secur...
mmaxfield@apple.com [Fri, 15 Apr 2016 21:28:12 +0000 (21:28 +0000)]
[CSS Font Loading] FontFace's promise may never be resolved/rejected if Content Security Policy blocks all the URLs
https://bugs.webkit.org/show_bug.cgi?id=156605

Reviewed by Daniel Bates.

Source/WebCore:

If all the fonts are blocked, we will create a FontFace with no FontFaceSources.
Loading such a FontFace should reject the promise.

Test: fast/text/font-loading-csp-block-all.html

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::pump):

LayoutTests:

* fast/text/font-loading-csp-block-all-expected.txt: Added.
* fast/text/font-loading-csp-block-all.html: Added.

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

4 years agoUnreviewed, rolling out r199600.
commit-queue@webkit.org [Fri, 15 Apr 2016 21:09:21 +0000 (21:09 +0000)]
Unreviewed, rolling out r199600.
https://bugs.webkit.org/show_bug.cgi?id=156642

It didn't help (Requested by ap_ on #webkit).

Reverted changeset:

"Build fix."
http://trac.webkit.org/changeset/199600

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

4 years ago[WinCairo] Another unreviewed build fix.
achristensen@apple.com [Fri, 15 Apr 2016 20:57:15 +0000 (20:57 +0000)]
[WinCairo] Another unreviewed build fix.

* platform/network/curl/MultipartHandle.cpp:
(WebCore::MultipartHandle::parseHeadersIfPossible):

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

4 years ago[WinCairo] Unreviewed build fix.,
bfulgham@apple.com [Fri, 15 Apr 2016 20:55:28 +0000 (20:55 +0000)]
[WinCairo] Unreviewed build fix.,

* platform/network/curl/MultipartHandle.cpp:
(WebCore::MultipartHandle::parseHeadersIfPossible): Correct for new method signature.

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

4 years agoASSERT when loading github.com
mmaxfield@apple.com [Fri, 15 Apr 2016 19:59:20 +0000 (19:59 +0000)]
ASSERT when loading github.com
https://bugs.webkit.org/show_bug.cgi?id=156604
<rdar://problem/19890634>

Reviewed by Darin Adler.

Source/WebCore:

HTMLFormControlElement::m_isValid is a cache of the results of the valid() function.
When cloning the node, we were preserving each individual item, but not the state
of the cache. Therefore, the cache and the attributes didn't agree with each other.

Test: fast/forms/checkValidity-cloneNode-crash.html

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::copyNonAttributePropertiesFromElement):

LayoutTests:

* fast/forms/checkValidity-cloneNode-crash-expected.txt: Added.
* fast/forms/checkValidity-cloneNode-crash.html: Added.

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

4 years agoRemove support for X-Frame-Options in `<meta>`
bfulgham@apple.com [Fri, 15 Apr 2016 19:49:58 +0000 (19:49 +0000)]
Remove support for X-Frame-Options in `<meta>`
https://bugs.webkit.org/show_bug.cgi?id=156625
<rdar://problem/25748714>

Reviewed by Darin Adler.

Source/WebCore:

Follow RFC7034 (Section 4), which recommends that 'X-Frame-Options' be ignored when delivered as part of
a '<meta http-equiv="...">' tag. This brings us in line with Firefox, Edge, and Blink.

Tests: http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-in-body.html
       http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-allow.html
       http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-deny.html
       http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag.html
       http/tests/security/xssAuditor/meta-tag-http-refresh-x-frame-options-ignored.html

* dom/Document.cpp:
(WebCore::Document::processHttpEquiv): Log error message instead of blocking the load.

LayoutTests:

Revise tests to match our desired behavior based on RFC 7034 (Section 4).

* http/tests/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-in-body.html:
* http/tests/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-parent-same-origin-deny.html:
* http/tests/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe.html:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt: Removed.
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt: Removed.
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html: Removed.
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-allow-expected.txt: Removed.
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-allow.html: Removed.
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt: Removed.
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html: Removed.
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html: Removed.
* http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-expected.txt: Added.
* http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-in-body-expected.txt: Added.
* http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-in-body.html: Copied from LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html.
* http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-allow-expected.txt: Added.
* http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-allow.html: Copied from LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-allow.html.
* http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-deny-expected.txt: Added.
* http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-deny.html: Copied from LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html.
* http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag.html: Copied from LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html.
* http/tests/security/xssAuditor/meta-tag-http-refresh-x-frame-options-expected.txt: Removed.
* http/tests/security/xssAuditor/meta-tag-http-refresh-x-frame-options-ignored-expected.txt: Added.
* http/tests/security/xssAuditor/meta-tag-http-refresh-x-frame-options-ignored.html: Copied from LayoutTests/http/tests/security/xssAuditor/meta-tag-http-refresh-x-frame-options.html.
* http/tests/security/xssAuditor/meta-tag-http-refresh-x-frame-options.html: Removed.
* inspector/console/x-frame-options-message-expected.txt: Rebaselined.
* platform/win/TestExpectations:

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

4 years agoMark inspector/formatting/formatting-javascript.html as flaky on mac
jiewen_tan@apple.com [Fri, 15 Apr 2016 19:20:35 +0000 (19:20 +0000)]
Mark inspector/formatting/formatting-javascript.html as flaky on mac
https://bugs.webkit.org/show_bug.cgi?id=156634

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

4 years agoAudio elements should be able to have a controls manager.
jer.noble@apple.com [Fri, 15 Apr 2016 19:06:30 +0000 (19:06 +0000)]
Audio elements should be able to have a controls manager.
https://bugs.webkit.org/show_bug.cgi?id=156630

Reviewed by Beth Dakin.

Now that there is no longer a architectural restriction about what kind of media elements
can be used with WebPlaybackSessionManager, allow audio elements to create a controls
manager.

Drive-by fix: clear the controls manager when destroying the media player due to entering
the page cache, and when destroying the media element.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement):
(WebCore::HTMLMediaElement::updatePlayState):
(WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canControlControlsManager):

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

4 years agoWeb Inspector: sourceMappingURL not used when sourceURL is set
commit-queue@webkit.org [Fri, 15 Apr 2016 19:01:39 +0000 (19:01 +0000)]
Web Inspector: sourceMappingURL not used when sourceURL is set
https://bugs.webkit.org/show_bug.cgi?id=156021
<rdar://problem/25438417>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-04-15
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

Clean up Debugger.sourceParsed to separately include:

    - url ("resource URL", "source url" in JSC APIs)
    - sourceURL - //# sourceURL directive

By always having the resource URL the Web Inspector frontend
can better match this Script to a Resource of the same URL,
and decide to use the sourceURL if it is available when
appropriate.

* inspector/protocol/Debugger.json:
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::setBreakpointByUrl):
(Inspector::InspectorDebuggerAgent::didParseSource):
Send the new sourceParsed parameters.

Source/WebInspectorUI:

Previously Debugger.sourceParsed only providing the sourceURL, and
wiping out the resourceURL, meant that a Script from a Resource that
set a sourceURL directive would fail to be associated with its Resource.

This would result in duplicated tree elements in the Resources Sidebar,
one for the Resource, and one for the Script. With the Script getting
ultimately getting the SourceMap resources. However, since the frontend
prefers Resources over Scripts when possible, an error that generated
from the script would point to a location in the Resource, not following
source maps.

By always providing the resource URL in Debugger.sourceParsed, a Script
can better be associated with its Resource. The result is now a single
shared tree element in the Resources Sidebar, and the Resource getting
the SourceMap resources. Now the script error goes through the Resource
to its SourceMap resources as we would expect.

* UserInterface/Protocol/DebuggerObserver.js:
(WebInspector.DebuggerObserver):
(WebInspector.DebuggerObserver.prototype.scriptParsed):
We now have to handle two different signatures of scriptParsed. One
for legacy, and one for non-legacy. Cache that value early on, since
scriptParsed happens a lot.

* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackend.Agent.prototype.hasEventParameter):
Runtime check a protocol event to see if it has a parameter. This
is used to check if Debugger.sourceParsed is legacy or not based
on if it has the legacy "hasSourceURL" parameter.

* UserInterface/Models/Script.js:
(WebInspector.Script):
(WebInspector.Script.prototype.get sourceURL):
Treat sourceURL and url separately.

(WebInspector.Script.prototype.get displayName):
Handle both the url and sourceURL in displayName.

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.prototype.get knownNonResourceScripts):
(WebInspector.DebuggerManager.prototype.debuggerDidPause):
(WebInspector.DebuggerManager.prototype.scriptDidParse):
* UserInterface/Protocol/RemoteObject.js:
(WebInspector.RemoteObject.prototype.findFunctionSourceCodeLocation):
Update code that checks the sourceURL to explicitly use sourceURL.

* UserInterface/Controllers/SourceMapManager.js:
(WebInspector.SourceMapManager.prototype.downloadSourceMap):
For legacy backends, or in case we get a resource that has an incomplete
baseURL, attempt to get an absolute URL based on the main resource.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype._addScript):
* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel.prototype._scriptWasAdded):
Ignore scripts without a url or sourceURL.

LayoutTests:

* inspector/debugger/scriptParsed.html:
* inspector/debugger/search-scripts.html:
* inspector/debugger/setBreakpointByUrl-sourceURL.html:
* inspector/debugger/sourceURLs.html:
Update tests that need to handle sourceURL separately.

* inspector/model/resources/relationship-named.js: Added.
* inspector/model/resources/relationship-normal.js: Added.
* inspector/model/script-resource-relationship-expected.txt: Added.
* inspector/model/script-resource-relationship.html: Added.
Tests for Script and Resource relationships.

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

4 years agoBuild fix.
ap@apple.com [Fri, 15 Apr 2016 18:33:29 +0000 (18:33 +0000)]
Build fix.

* LayoutTestRelay/LayoutTestRelay/main.m: Allow some deprecated methods.

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

4 years agoMark NetworkLoad as FastAllocated
cdumez@apple.com [Fri, 15 Apr 2016 18:26:50 +0000 (18:26 +0000)]
Mark NetworkLoad as FastAllocated
https://bugs.webkit.org/show_bug.cgi?id=156628

Reviewed by Alex Christensen.

Mark NetworkLoad as FastAllocated for performance.

* NetworkProcess/NetworkLoad.h:

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

4 years agoCalling SVGAnimatedPropertyTearOff::animationEnded() will crash if the SVG property...
commit-queue@webkit.org [Fri, 15 Apr 2016 18:24:32 +0000 (18:24 +0000)]
Calling SVGAnimatedPropertyTearOff::animationEnded() will crash if the SVG property is not animating
https://bugs.webkit.org/show_bug.cgi?id=156549

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-04-15
Reviewed by Darin Adler.

A speculative fix for a crash which may happen when calling animationEnded()
of any SVGAnimatedProperty while it is not animating.

* svg/SVGAnimatedTypeAnimator.h:
(WebCore::SVGAnimatedTypeAnimator::executeAction):

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

4 years agoUnreviewed build fix for iOS simulator. Assert the correct variable.
jer.noble@apple.com [Fri, 15 Apr 2016 18:08:13 +0000 (18:08 +0000)]
Unreviewed build fix for iOS simulator. Assert the correct variable.

* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerLayer layoutSublayers]):
(-[WebAVPlayerLayer resolveBounds]):
(-[WebAVPlayerLayer setVideoGravity:]):

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

4 years agoMark fast/text/font-face-javascript.html as flaky
jiewen_tan@apple.com [Fri, 15 Apr 2016 17:59:00 +0000 (17:59 +0000)]
Mark fast/text/font-face-javascript.html as flaky
https://bugs.webkit.org/show_bug.cgi?id=156631

Unreviewed test gardening.

* TestExpectations:

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

4 years agoMark imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element...
jiewen_tan@apple.com [Fri, 15 Apr 2016 17:50:28 +0000 (17:50 +0000)]
Mark imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html as flaky on mac-wk1
https://bugs.webkit.org/show_bug.cgi?id=156629

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

4 years agoAllow WebVideoFullscreenManager and Proxy to be used by audio elements.
jer.noble@apple.com [Fri, 15 Apr 2016 17:50:26 +0000 (17:50 +0000)]
Allow WebVideoFullscreenManager and Proxy to be used by audio elements.
https://bugs.webkit.org/show_bug.cgi?id=156564

Reviewed by Beth Dakin.

Source/WebCore:

No new tests; this refactors existing functionality into new classes.

Tease apart the various WebVideoFullscreen{Interface,Model}{AVKit,Mac,VideoElement} into new
WebPlaybackSession… classes dealing exclusively with playback state and commands, leaving
fullscreen state and commands in the WebVideoFullscreen… classes. Specifically, create the
following new classes:

- WebPlaybackSessionInterface (copied from WebVideoFullscreenInterface)
- WebPlaybackSessionModelMediaElement (copied from WebVideoFullscreenModelMediaElement)
- WebPlaybackSessionModel (copied from WebVideoFullscreenModel)
- WebPlaybackSessionInterfaceAVKit (copied from WebVideoFullscreenInterfaceAVKit)
- WebPlaybackSessionInterfaceMac (copied from WebVideoFullscreenInterfaceMac)

WebVideoFullscreenInterface and WebVideoFullscreenModel now inherit from
WebPlaybackSessionInterface and WebPlaybackSessionModel, respectively. The concrete
WebVideoFullscreen… subclasses each take their respective WebPlaybackSession… subclasses and
fulfill their WebPlaybackSession interfaces through composition.

As part of this big tease-apart, the WebAVPlayerController class needs to be exposed in a
header (as it's accessed by two different classes now), so that class is moved into its own
implementation and header files.

The one case where a change in a WebPlaybackSession… class needs to be reflected in a
WebVideoFullscreen… class is in WebPlaybackSessionInterfaceAVKit, where
WebVideoFullscreenInterfaceAVKit needs to be notified when external playback becomes dis/en-
abled, so a new WebPlaybackSessionInterfaceAVKitClient interface has been added to allow the
WebPlaybackSession… to notify the WebVideoFullscreen….

The responsibility for the "controls manager" has moved from the WebVideoFullscreen… classes
to the WebPlaybackSession… classes, so the ChromeClient interface for creating and destroying
those controls is similarly renamed from setUpVideoControlsManager() to
setUpPlaybackControlsManager().

* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updatePlayState):
* page/ChromeClient.h:
* platform/cocoa/WebPlaybackSessionInterface.h: Copied from Source/WebCore/platform/cocoa/WebVideoFullscreenInterface.h.
(WebCore::WebPlaybackSessionInterface::~WebPlaybackSessionInterface):
* platform/cocoa/WebPlaybackSessionModel.h: Added.
(WebCore::WebPlaybackSessionModel::~WebPlaybackSessionModel):
* platform/cocoa/WebPlaybackSessionModelMediaElement.h: Added.
(WebCore::WebPlaybackSessionModelMediaElement::create):
(WebCore::WebPlaybackSessionModelMediaElement::mediaElement):
* platform/cocoa/WebPlaybackSessionModelMediaElement.mm: Added.
(WebPlaybackSessionModelMediaElement::WebPlaybackSessionModelMediaElement):
(WebPlaybackSessionModelMediaElement::~WebPlaybackSessionModelMediaElement):
(WebPlaybackSessionModelMediaElement::setWebPlaybackSessionInterface):
(WebPlaybackSessionModelMediaElement::setMediaElement):
(WebPlaybackSessionModelMediaElement::handleEvent):
(WebPlaybackSessionModelMediaElement::updateForEventName):
(WebPlaybackSessionModelMediaElement::play):
(WebPlaybackSessionModelMediaElement::pause):
(WebPlaybackSessionModelMediaElement::togglePlayState):
(WebPlaybackSessionModelMediaElement::beginScrubbing):
(WebPlaybackSessionModelMediaElement::endScrubbing):
(WebPlaybackSessionModelMediaElement::seekToTime):
(WebPlaybackSessionModelMediaElement::fastSeek):
(WebPlaybackSessionModelMediaElement::beginScanningForward):
(WebPlaybackSessionModelMediaElement::beginScanningBackward):
(WebPlaybackSessionModelMediaElement::endScanning):
(WebPlaybackSessionModelMediaElement::selectAudioMediaOption):
(WebPlaybackSessionModelMediaElement::selectLegibleMediaOption):
(WebPlaybackSessionModelMediaElement::updateLegibleOptions):
(WebPlaybackSessionModelMediaElement::observedEventNames):
(WebPlaybackSessionModelMediaElement::eventNameAll):
* platform/cocoa/WebPlaybackSessionModelVideoElement.cpp: Copied from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm.
(WebPlaybackSessionModelVideoElement::WebPlaybackSessionModelVideoElement):
(WebPlaybackSessionModelVideoElement::~WebPlaybackSessionModelVideoElement):
(WebPlaybackSessionModelVideoElement::setWebVideoFullscreenInterface):
(WebPlaybackSessionModelVideoElement::setVideoElement):
(WebPlaybackSessionModelVideoElement::handleEvent):
(WebPlaybackSessionModelVideoElement::updateForEventName):
(WebPlaybackSessionModelVideoElement::play):
(WebPlaybackSessionModelVideoElement::pause):
(WebPlaybackSessionModelVideoElement::togglePlayState):
(WebPlaybackSessionModelVideoElement::beginScrubbing):
(WebPlaybackSessionModelVideoElement::endScrubbing):
(WebPlaybackSessionModelVideoElement::seekToTime):
(WebPlaybackSessionModelVideoElement::fastSeek):
(WebPlaybackSessionModelVideoElement::beginScanningForward):
(WebPlaybackSessionModelVideoElement::beginScanningBackward):
(WebPlaybackSessionModelVideoElement::endScanning):
(WebPlaybackSessionModelVideoElement::selectAudioMediaOption):
(WebPlaybackSessionModelVideoElement::selectLegibleMediaOption):
(WebPlaybackSessionModelVideoElement::updateLegibleOptions):
(WebPlaybackSessionModelVideoElement::observedEventNames):
(WebPlaybackSessionModelVideoElement::eventNameAll):
* platform/cocoa/WebVideoFullscreenInterface.h:
* platform/cocoa/WebVideoFullscreenModel.h:
(WebCore::WebVideoFullscreenModel::~WebVideoFullscreenModel): Deleted.
* platform/cocoa/WebVideoFullscreenModelVideoElement.h:
(WebCore::WebVideoFullscreenModelVideoElement::create):
* platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
(WebVideoFullscreenModelVideoElement::WebVideoFullscreenModelVideoElement):
(WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface):
(WebVideoFullscreenModelVideoElement::setVideoElement):
(WebVideoFullscreenModelVideoElement::play):
(WebVideoFullscreenModelVideoElement::pause):
(WebVideoFullscreenModelVideoElement::togglePlayState):
(WebVideoFullscreenModelVideoElement::beginScrubbing):
(WebVideoFullscreenModelVideoElement::endScrubbing):
(WebVideoFullscreenModelVideoElement::seekToTime):
(WebVideoFullscreenModelVideoElement::fastSeek):
(WebVideoFullscreenModelVideoElement::beginScanningForward):
(WebVideoFullscreenModelVideoElement::beginScanningBackward):
(WebVideoFullscreenModelVideoElement::endScanning):
(WebVideoFullscreenModelVideoElement::selectAudioMediaOption):
(WebVideoFullscreenModelVideoElement::selectLegibleMediaOption):
(WebVideoFullscreenModelVideoElement::handleEvent): Deleted.
(WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer): Deleted.
(WebVideoFullscreenModelVideoElement::setVideoLayerFrame): Deleted.
(WebVideoFullscreenModelVideoElement::setVideoLayerGravity): Deleted.
(WebVideoFullscreenModelVideoElement::observedEventNames): Deleted.
(WebVideoFullscreenModelVideoElement::eventNameAll): Deleted.
(WebVideoFullscreenModelVideoElement::fullscreenModeChanged): Deleted.
(WebVideoFullscreenModelVideoElement::isVisible): Deleted.
* platform/ios/WebAVPlayerController.h: Added.
* platform/ios/WebAVPlayerController.mm: Added.
(-[WebAVPlayerController dealloc]):
(-[WebAVPlayerController resetState]):
(-[WebAVPlayerController player]):
(-[WebAVPlayerController forwardingTargetForSelector:]):
(-[WebAVPlayerController play:]):
(-[WebAVPlayerController pause:]):
(-[WebAVPlayerController togglePlayback:]):
(-[WebAVPlayerController togglePlaybackEvenWhenInBackground:]):
(-[WebAVPlayerController isPlaying]):
(-[WebAVPlayerController setPlaying:]):
(+[WebAVPlayerController keyPathsForValuesAffectingPlaying]):
(-[WebAVPlayerController beginScrubbing:]):
(-[WebAVPlayerController endScrubbing:]):
(-[WebAVPlayerController seekToTime:]):
(-[WebAVPlayerController currentTimeWithinEndTimes]):
(-[WebAVPlayerController setCurrentTimeWithinEndTimes:]):
(+[WebAVPlayerController keyPathsForValuesAffectingCurrentTimeWithinEndTimes]):
(-[WebAVPlayerController hasLiveStreamingContent]):
(+[WebAVPlayerController keyPathsForValuesAffectingHasLiveStreamingContent]):
(-[WebAVPlayerController skipBackwardThirtySeconds:]):
(-[WebAVPlayerController gotoEndOfSeekableRanges:]):
(-[WebAVPlayerController canScanForward]):
(+[WebAVPlayerController keyPathsForValuesAffectingCanScanForward]):
(-[WebAVPlayerController beginScanningForward:]):
(-[WebAVPlayerController endScanningForward:]):
(-[WebAVPlayerController beginScanningBackward:]):
(-[WebAVPlayerController endScanningBackward:]):
(-[WebAVPlayerController canSeekToBeginning]):
(+[WebAVPlayerController keyPathsForValuesAffectingCanSeekToBeginning]):
(-[WebAVPlayerController seekToBeginning:]):
(-[WebAVPlayerController seekChapterBackward:]):
(-[WebAVPlayerController canSeekToEnd]):
(+[WebAVPlayerController keyPathsForValuesAffectingCanSeekToEnd]):
(-[WebAVPlayerController seekToEnd:]):
(-[WebAVPlayerController seekChapterForward:]):
(-[WebAVPlayerController hasMediaSelectionOptions]):
(+[WebAVPlayerController keyPathsForValuesAffectingHasMediaSelectionOptions]):
(-[WebAVPlayerController hasAudioMediaSelectionOptions]):
(+[WebAVPlayerController keyPathsForValuesAffectingHasAudioMediaSelectionOptions]):
(-[WebAVPlayerController hasLegibleMediaSelectionOptions]):
(+[WebAVPlayerController keyPathsForValuesAffectingHasLegibleMediaSelectionOptions]):
(-[WebAVPlayerController currentAudioMediaSelectionOption]):
(-[WebAVPlayerController setCurrentAudioMediaSelectionOption:]):
(-[WebAVPlayerController currentLegibleMediaSelectionOption]):
(-[WebAVPlayerController setCurrentLegibleMediaSelectionOption:]):
(-[WebAVPlayerController isPlayingOnExternalScreen]):
(+[WebAVPlayerController keyPathsForValuesAffectingPlayingOnExternalScreen]):
(-[WebAVPlayerController isPictureInPictureInterrupted]):
(-[WebAVPlayerController setPictureInPictureInterrupted:]):
* platform/ios/WebPlaybackSessionInterfaceAVKit.h: Added.
(WebCore::WebPlaybackSessionInterfaceAVKitClient::~WebPlaybackSessionInterfaceAVKitClient):
* platform/ios/WebPlaybackSessionInterfaceAVKit.mm: Added.
(WebCore::WebPlaybackSessionInterfaceAVKit::WebPlaybackSessionInterfaceAVKit):
(WebCore::WebPlaybackSessionInterfaceAVKit::~WebPlaybackSessionInterfaceAVKit):
(WebCore::WebPlaybackSessionInterfaceAVKit::resetMediaState):
(WebCore::WebPlaybackSessionInterfaceAVKit::setWebPlaybackSessionModel):
(WebCore::WebPlaybackSessionInterfaceAVKit::setDuration):
(WebCore::WebPlaybackSessionInterfaceAVKit::setCurrentTime):
(WebCore::WebPlaybackSessionInterfaceAVKit::setBufferedTime):
(WebCore::WebPlaybackSessionInterfaceAVKit::setRate):
(WebCore::WebPlaybackSessionInterfaceAVKit::setSeekableRanges):
(WebCore::WebPlaybackSessionInterfaceAVKit::setCanPlayFastReverse):
(WebCore::mediaSelectionOptions):
(WebCore::WebPlaybackSessionInterfaceAVKit::setAudioMediaSelectionOptions):
(WebCore::WebPlaybackSessionInterfaceAVKit::setLegibleMediaSelectionOptions):
(WebCore::WebPlaybackSessionInterfaceAVKit::setExternalPlayback):
(WebCore::WebPlaybackSessionInterfaceAVKit::setWirelessVideoPlaybackDisabled):
(WebCore::WebPlaybackSessionInterfaceAVKit::wirelessVideoPlaybackDisabled):
(WebCore::WebPlaybackSessionInterfaceAVKit::invalidate):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(WebVideoFullscreenControllerContext::setUpFullscreen):
* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewControllerDelegate fullscreenInterface]):
(-[WebAVPlayerViewControllerDelegate setFullscreenInterface:]):
(-[WebAVPlayerLayer fullscreenInterface]):
(-[WebAVPlayerLayer setFullscreenInterface:]):
(-[WebAVPlayerLayer layoutSublayers]):
(-[WebAVPlayerLayer resolveBounds]):
(-[WebAVPlayerLayer setVideoGravity:]):
(WebVideoFullscreenInterfaceAVKit::create):
(WebVideoFullscreenInterfaceAVKit::WebVideoFullscreenInterfaceAVKit):
(WebVideoFullscreenInterfaceAVKit::~WebVideoFullscreenInterfaceAVKit):
(WebVideoFullscreenInterfaceAVKit::playerController):
(WebVideoFullscreenInterfaceAVKit::resetMediaState):
(WebVideoFullscreenInterfaceAVKit::setDuration):
(WebVideoFullscreenInterfaceAVKit::setCurrentTime):
(WebVideoFullscreenInterfaceAVKit::setBufferedTime):
(WebVideoFullscreenInterfaceAVKit::setRate):
(WebVideoFullscreenInterfaceAVKit::setVideoDimensions):
(WebVideoFullscreenInterfaceAVKit::setSeekableRanges):
(WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse):
(WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions):
(WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions):
(WebVideoFullscreenInterfaceAVKit::setExternalPlayback):
(WebVideoFullscreenInterfaceAVKit::externalPlaybackEnabledChanged):
(WebVideoFullscreenInterfaceAVKit::setWirelessVideoPlaybackDisabled):
(WebVideoFullscreenInterfaceAVKit::wirelessVideoPlaybackDisabled):
(WebVideoFullscreenInterfaceAVKit::setupFullscreen):
(WebVideoFullscreenInterfaceAVKit::cleanupFullscreen):
(WebVideoFullscreenInterfaceAVKit::mayAutomaticallyShowVideoPictureInPicture):
(-[WebAVPlayerViewControllerDelegate playerViewControllerWillStartPictureInPicture:]): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewControllerDidStartPictureInPicture:]): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewControllerFailedToStartPictureInPicture:withError:]): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewControllerWillStopPictureInPicture:]): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewControllerDidStopPictureInPicture:]): Deleted.
(convertToExitFullScreenReason): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewController:shouldExitFullScreenWithReason:]): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewController:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:]): Deleted.
(-[WebAVPlayerLayer init]): Deleted.
(-[WebAVPlayerLayer dealloc]): Deleted.
(-[WebAVPlayerLayer videoGravity]): Deleted.
(-[WebAVPlayerLayer videoRect]): Deleted.
(+[WebAVPlayerLayer keyPathsForValuesAffectingVideoRect]): Deleted.
(WebAVPictureInPicturePlayerLayerView_layerClass): Deleted.
(getWebAVPictureInPicturePlayerLayerViewClass): Deleted.
(WebAVPlayerLayerView_layerClass): Deleted.
(WebAVPlayerLayerView_playerController): Deleted.
(WebAVPlayerLayerView_setPlayerController): Deleted.
(WebAVPlayerLayerView_videoView): Deleted.
(WebAVPlayerLayerView_setVideoView): Deleted.
(WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView): Deleted.
(WebAVPlayerLayerView_stopRoutingVideoToPictureInPicturePlayerLayerView): Deleted.
(WebAVPlayerLayerView_pictureInPicturePlayerLayerView): Deleted.
(WebAVPlayerLayerView_dealloc): Deleted.
(getWebAVPlayerLayerViewClass): Deleted.
(WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenModel): Deleted.
(WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenChangeObserver): Deleted.
(WebVideoFullscreenInterfaceAVKit::applicationDidBecomeActive): Deleted.
(WebVideoFullscreenInterfaceAVKit::enterFullscreen): Deleted.
(WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard): Deleted.
(WebVideoFullscreenInterfaceAVKit::exitFullscreen): Deleted.
(WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture): Deleted.
(WebVideoFullscreenInterfaceAVKit::failedToStartPictureInPicture): Deleted.
(WebVideoFullscreenInterfaceAVKit::willStopPictureInPicture): Deleted.
(WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture): Deleted.
(WebVideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler): Deleted.
(WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): Deleted.
(WebVideoFullscreenInterfaceAVKit::watchdogTimerFired): Deleted.
(WebVideoFullscreenInterfaceAVKit::setMode): Deleted.
(WebVideoFullscreenInterfaceAVKit::clearMode): Deleted.
(WebCore::supportsPictureInPicture): Deleted.
* platform/mac/WebPlaybackSessionInterfaceMac.h: Added.
* platform/mac/WebPlaybackSessionInterfaceMac.mm: Copied from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm.
(-[WebAVMediaSelectionOptionMac localizedDisplayName]):
(-[WebAVMediaSelectionOptionMac setLocalizedDisplayName:]):
(-[WebPlaybackControlsManager initWithWebPlaybackSessionInterfaceMac:]):
(-[WebPlaybackControlsManager timing]):
(-[WebPlaybackControlsManager setTiming:]):
(-[WebPlaybackControlsManager seekableTimeRanges]):
(-[WebPlaybackControlsManager setSeekableTimeRanges:]):
(-[WebPlaybackControlsManager isSeeking]):
(-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
(-[WebPlaybackControlsManager audioMediaSelectionOptions]):
(-[WebPlaybackControlsManager setAudioMediaSelectionOptions:]):
(-[WebPlaybackControlsManager currentAudioMediaSelectionOption]):
(-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]):
(-[WebPlaybackControlsManager legibleMediaSelectionOptions]):
(-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:]):
(-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]):
(-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]):
(-[WebPlaybackControlsManager cancelThumbnailAndAudioAmplitudeSampleGeneration]):
(WebCore::WebPlaybackSessionInterfaceMac::~WebPlaybackSessionInterfaceMac):
(WebCore::WebPlaybackSessionInterfaceMac::setWebPlaybackSessionModel):
(WebCore::WebPlaybackSessionInterfaceMac::setDuration):
(WebCore::WebPlaybackSessionInterfaceMac::setCurrentTime):
(WebCore::WebPlaybackSessionInterfaceMac::setRate):
(WebCore::WebPlaybackSessionInterfaceMac::setSeekableRanges):
(WebCore::mediaSelectionOptions):
(WebCore::WebPlaybackSessionInterfaceMac::setAudioMediaSelectionOptions):
(WebCore::WebPlaybackSessionInterfaceMac::setLegibleMediaSelectionOptions):
(WebCore::WebPlaybackSessionInterfaceMac::invalidate):
(WebCore::WebPlaybackSessionInterfaceMac::ensureControlsManager):
(WebCore::WebPlaybackSessionInterfaceMac::playBackControlsManager):
* platform/mac/WebVideoFullscreenInterfaceMac.h:
* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(WebCore::WebVideoFullscreenInterfaceMac::WebVideoFullscreenInterfaceMac):
(WebCore::WebVideoFullscreenInterfaceMac::setWebVideoFullscreenModel):
(WebCore::WebVideoFullscreenInterfaceMac::setDuration):
(WebCore::WebVideoFullscreenInterfaceMac::setCurrentTime):
(WebCore::WebVideoFullscreenInterfaceMac::setRate):
(WebCore::WebVideoFullscreenInterfaceMac::setSeekableRanges):
(WebCore::WebVideoFullscreenInterfaceMac::setAudioMediaSelectionOptions):
(WebCore::WebVideoFullscreenInterfaceMac::setLegibleMediaSelectionOptions):
(WebCore::WebVideoFullscreenInterfaceMac::ensureControlsManager):
(WebCore::WebVideoFullscreenInterfaceMac::~WebVideoFullscreenInterfaceMac): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::setWebVideoFullscreenChangeObserver): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::setMode): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::clearMode): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::setupFullscreen): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::enterFullscreen): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::exitFullscreen): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::cleanupFullscreen): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::invalidate): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::preparedToReturnToInline): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::setVideoDimensions): Deleted.
(WebCore::supportsPictureInPicture): Deleted.

Source/WebKit2:

Tease apart WebVideoFullscreenManager and …Proxy into WebPlaybackSessionManager and …Proxy
classes dealing exclusively with playback state and commands, leaving fullscreen state and
commands in the WebVideoFullscreenManager… classes.

WebVideoFullscreenManager and …Proxy will now require an associated
WebPlaybackSessionManager and …Proxy class. The WebPlaybackSessionManager classes can be
used separately and without the WebVideoFullscreenManager classes.

* DerivedSources.make:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]):
* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: Copied from Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h.
* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: Copied from Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in.
* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: Added.
(WebKit::WebPlaybackSessionModelContext::play):
(WebKit::WebPlaybackSessionModelContext::pause):
(WebKit::WebPlaybackSessionModelContext::togglePlayState):
(WebKit::WebPlaybackSessionModelContext::beginScrubbing):
(WebKit::WebPlaybackSessionModelContext::endScrubbing):
(WebKit::WebPlaybackSessionModelContext::seekToTime):
(WebKit::WebPlaybackSessionModelContext::fastSeek):
(WebKit::WebPlaybackSessionModelContext::beginScanningForward):
(WebKit::WebPlaybackSessionModelContext::beginScanningBackward):
(WebKit::WebPlaybackSessionModelContext::endScanning):
(WebKit::WebPlaybackSessionModelContext::selectAudioMediaOption):
(WebKit::WebPlaybackSessionModelContext::selectLegibleMediaOption):
(WebKit::WebPlaybackSessionManagerProxy::create):
(WebKit::WebPlaybackSessionManagerProxy::WebPlaybackSessionManagerProxy):
(WebKit::WebPlaybackSessionManagerProxy::~WebPlaybackSessionManagerProxy):
(WebKit::WebPlaybackSessionManagerProxy::invalidate):
(WebKit::WebPlaybackSessionManagerProxy::createModelAndInterface):
(WebKit::WebPlaybackSessionManagerProxy::ensureModelAndInterface):
(WebKit::WebPlaybackSessionManagerProxy::ensureModel):
(WebKit::WebPlaybackSessionManagerProxy::ensureInterface):
(WebKit::WebPlaybackSessionManagerProxy::addClientForContext):
(WebKit::WebPlaybackSessionManagerProxy::removeClientForContext):
(WebKit::WebPlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
(WebKit::WebPlaybackSessionManagerProxy::clearPlaybackControlsManager):
(WebKit::WebPlaybackSessionManagerProxy::resetMediaState):
(WebKit::WebPlaybackSessionManagerProxy::setCurrentTime):
(WebKit::WebPlaybackSessionManagerProxy::setBufferedTime):
(WebKit::WebPlaybackSessionManagerProxy::setSeekableRangesVector):
(WebKit::WebPlaybackSessionManagerProxy::setCanPlayFastReverse):
(WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions):
(WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions):
(WebKit::WebPlaybackSessionManagerProxy::setExternalPlaybackProperties):
(WebKit::WebPlaybackSessionManagerProxy::setWirelessVideoPlaybackDisabled):
(WebKit::WebPlaybackSessionManagerProxy::setDuration):
(WebKit::WebPlaybackSessionManagerProxy::setRate):
(WebKit::WebPlaybackSessionManagerProxy::play):
(WebKit::WebPlaybackSessionManagerProxy::pause):
(WebKit::WebPlaybackSessionManagerProxy::togglePlayState):
(WebKit::WebPlaybackSessionManagerProxy::beginScrubbing):
(WebKit::WebPlaybackSessionManagerProxy::endScrubbing):
(WebKit::WebPlaybackSessionManagerProxy::seekToTime):
(WebKit::WebPlaybackSessionManagerProxy::fastSeek):
(WebKit::WebPlaybackSessionManagerProxy::beginScanningForward):
(WebKit::WebPlaybackSessionManagerProxy::beginScanningBackward):
(WebKit::WebPlaybackSessionManagerProxy::endScanning):
(WebKit::WebPlaybackSessionManagerProxy::selectAudioMediaOption):
(WebKit::WebPlaybackSessionManagerProxy::selectLegibleMediaOption):
(WebKit::WebPlaybackSessionManagerProxy::controlsManagerInterface):
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenModelContext::WebVideoFullscreenModelContext):
(WebKit::WebVideoFullscreenModelContext::~WebVideoFullscreenModelContext):
(WebKit::WebVideoFullscreenModelContext::play):
(WebKit::WebVideoFullscreenModelContext::pause):
(WebKit::WebVideoFullscreenModelContext::togglePlayState):
(WebKit::WebVideoFullscreenModelContext::beginScrubbing):
(WebKit::WebVideoFullscreenModelContext::endScrubbing):
(WebKit::WebVideoFullscreenModelContext::seekToTime):
(WebKit::WebVideoFullscreenModelContext::fastSeek):
(WebKit::WebVideoFullscreenModelContext::beginScanningForward):
(WebKit::WebVideoFullscreenModelContext::beginScanningBackward):
(WebKit::WebVideoFullscreenModelContext::endScanning):
(WebKit::WebVideoFullscreenModelContext::selectAudioMediaOption):
(WebKit::WebVideoFullscreenModelContext::selectLegibleMediaOption):
(WebKit::WebVideoFullscreenManagerProxy::create):
(WebKit::WebVideoFullscreenManagerProxy::WebVideoFullscreenManagerProxy):
(WebKit::WebVideoFullscreenManagerProxy::createModelAndInterface):
(WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::setVideoDimensions): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::enterFullscreen): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::exitFullscreen): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::cleanupFullscreen): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::preparedToReturnToInline): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::requestFullscreenMode): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::didSetupFullscreen): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::didExitFullscreen): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::didEnterFullscreen): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::playbackSessionManager):
(WebKit::WebPageProxy::videoFullscreenManager):
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::hasActiveVideoForControlsManager):
(WebKit::WebPageProxy::isPlayingMediaDidChange): Deleted.
* UIProcess/WebPageProxy.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::supportsVideoFullscreen):
(WebKit::WebChromeClient::setUpPlaybackControlsManager):
(WebKit::WebChromeClient::clearPlaybackControlsManager):
(WebKit::WebChromeClient::enterVideoFullscreenForVideoElement):
(WebKit::WebChromeClient::exitVideoFullscreenForVideoElement):
(WebKit::WebChromeClient::exitVideoFullscreenToModeWithoutAnimation):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::playbackSessionManager):
(WebKit::WebPage::videoFullscreenManager):
* WebProcess/WebPage/WebPage.h:
* WebProcess/cocoa/WebPlaybackSessionManager.h: Copied from Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.h.
(WebKit::WebPlaybackSessionInterfaceContext::create):
(WebKit::WebPlaybackSessionInterfaceContext::invalidate):
* WebProcess/cocoa/WebPlaybackSessionManager.messages.in: Added.
* WebProcess/cocoa/WebPlaybackSessionManager.mm: Added.
(WebKit::nextContextId):
(WebKit::WebPlaybackSessionInterfaceContext::WebPlaybackSessionInterfaceContext):
(WebKit::WebPlaybackSessionInterfaceContext::~WebPlaybackSessionInterfaceContext):
(WebKit::WebPlaybackSessionInterfaceContext::resetMediaState):
(WebKit::WebPlaybackSessionInterfaceContext::setDuration):
(WebKit::WebPlaybackSessionInterfaceContext::setCurrentTime):
(WebKit::WebPlaybackSessionInterfaceContext::setBufferedTime):
(WebKit::WebPlaybackSessionInterfaceContext::setRate):
(WebKit::WebPlaybackSessionInterfaceContext::setSeekableRanges):
(WebKit::WebPlaybackSessionInterfaceContext::setCanPlayFastReverse):
(WebKit::WebPlaybackSessionInterfaceContext::setAudioMediaSelectionOptions):
(WebKit::WebPlaybackSessionInterfaceContext::setLegibleMediaSelectionOptions):
(WebKit::WebPlaybackSessionInterfaceContext::setExternalPlayback):
(WebKit::WebPlaybackSessionInterfaceContext::setWirelessVideoPlaybackDisabled):
(WebKit::WebPlaybackSessionManager::create):
(WebKit::WebPlaybackSessionManager::WebPlaybackSessionManager):
(WebKit::WebPlaybackSessionManager::~WebPlaybackSessionManager):
(WebKit::WebPlaybackSessionManager::createModelAndInterface):
(WebKit::WebPlaybackSessionManager::ensureModelAndInterface):
(WebKit::WebPlaybackSessionManager::ensureModel):
(WebKit::WebPlaybackSessionManager::ensureInterface):
(WebKit::WebPlaybackSessionManager::removeContext):
(WebKit::WebPlaybackSessionManager::addClientForContext):
(WebKit::WebPlaybackSessionManager::removeClientForContext):
(WebKit::WebPlaybackSessionManager::setUpPlaybackControlsManager):
(WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):
(WebKit::WebPlaybackSessionManager::contextIdForMediaElement):
(WebKit::WebPlaybackSessionManager::resetMediaState):
(WebKit::WebPlaybackSessionManager::setDuration):
(WebKit::WebPlaybackSessionManager::setCurrentTime):
(WebKit::WebPlaybackSessionManager::setBufferedTime):
(WebKit::WebPlaybackSessionManager::setRate):
(WebKit::WebPlaybackSessionManager::setSeekableRanges):
(WebKit::WebPlaybackSessionManager::setCanPlayFastReverse):
(WebKit::WebPlaybackSessionManager::setAudioMediaSelectionOptions):
(WebKit::WebPlaybackSessionManager::setLegibleMediaSelectionOptions):
(WebKit::WebPlaybackSessionManager::setExternalPlayback):
(WebKit::WebPlaybackSessionManager::setWirelessVideoPlaybackDisabled):
(WebKit::WebPlaybackSessionManager::play):
(WebKit::WebPlaybackSessionManager::pause):
(WebKit::WebPlaybackSessionManager::togglePlayState):
(WebKit::WebPlaybackSessionManager::beginScrubbing):
(WebKit::WebPlaybackSessionManager::endScrubbing):
(WebKit::WebPlaybackSessionManager::seekToTime):
(WebKit::WebPlaybackSessionManager::fastSeek):
(WebKit::WebPlaybackSessionManager::beginScanningForward):
(WebKit::WebPlaybackSessionManager::beginScanningBackward):
(WebKit::WebPlaybackSessionManager::endScanning):
(WebKit::WebPlaybackSessionManager::selectAudioMediaOption):
(WebKit::WebPlaybackSessionManager::selectLegibleMediaOption):
* WebProcess/cocoa/WebVideoFullscreenManager.h:
(WebKit::WebVideoFullscreenInterfaceContext::create):
* WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
* WebProcess/cocoa/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenInterfaceContext::WebVideoFullscreenInterfaceContext):
(WebKit::WebVideoFullscreenInterfaceContext::resetMediaState):
(WebKit::WebVideoFullscreenInterfaceContext::setDuration):
(WebKit::WebVideoFullscreenInterfaceContext::setCurrentTime):
(WebKit::WebVideoFullscreenInterfaceContext::setBufferedTime):
(WebKit::WebVideoFullscreenInterfaceContext::setRate):
(WebKit::WebVideoFullscreenInterfaceContext::setSeekableRanges):
(WebKit::WebVideoFullscreenInterfaceContext::setCanPlayFastReverse):
(WebKit::WebVideoFullscreenInterfaceContext::setAudioMediaSelectionOptions):
(WebKit::WebVideoFullscreenInterfaceContext::setLegibleMediaSelectionOptions):
(WebKit::WebVideoFullscreenInterfaceContext::setExternalPlayback):
(WebKit::WebVideoFullscreenInterfaceContext::setWirelessVideoPlaybackDisabled):
(WebKit::WebVideoFullscreenManager::create):
(WebKit::WebVideoFullscreenManager::WebVideoFullscreenManager):
(WebKit::WebVideoFullscreenManager::createModelAndInterface):
(WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
(WebKit::WebVideoFullscreenInterfaceContext::setVideoDimensions): Deleted.
(WebKit::WebVideoFullscreenManager::~WebVideoFullscreenManager): Deleted.
(WebKit::WebVideoFullscreenManager::ensureModelAndInterface): Deleted.
(WebKit::WebVideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation): Deleted.
(WebKit::WebVideoFullscreenManager::setVideoDimensions): Deleted.
(WebKit::WebVideoFullscreenManager::requestFullscreenMode): Deleted.
(WebKit::WebVideoFullscreenManager::fullscreenModeChanged): Deleted.
(WebKit::WebVideoFullscreenManager::didSetupFullscreen): Deleted.
(WebKit::WebVideoFullscreenManager::didEnterFullscreen): Deleted.
(WebKit::WebVideoFullscreenManager::didExitFullscreen): Deleted.
(WebKit::WebVideoFullscreenManager::didCleanupFullscreen): Deleted.
(WebKit::WebVideoFullscreenManager::setVideoLayerGravityEnum): Deleted.
(WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline): Deleted.
(WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced): Deleted.

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

4 years agoWeb Inspector: Cleanup inspector/debugger tests
joepeck@webkit.org [Fri, 15 Apr 2016 17:18:12 +0000 (17:18 +0000)]
Web Inspector: Cleanup inspector/debugger tests
https://bugs.webkit.org/show_bug.cgi?id=156619

Reviewed by Brian Burg.

Source/JavaScriptCore:

While cleaning up the tests it exposed the fact that breakpoints
were not getting disabled when the inspector closes. This means
that opening the inspector, with breakpoints, and closing the
inspector, would leave the JSC::Debugger thinking breakpoints
are active. The JSC::Debugger should be reset.

* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::disable):

Source/WebInspectorUI:

* UserInterface/Base/Main.js:
(WebInspector.loaded):
* UserInterface/Controllers/DebuggerManager.js:
Remove agent checks for agents that are always available.

LayoutTests:

* inspector/debugger/breakpoint-action-detach.html:
* inspector/debugger/breakpoint-action-with-exception.html:
* inspector/debugger/breakpoint-condition-detach.html:
* inspector/debugger/breakpoint-condition-with-bad-script.html:
* inspector/debugger/breakpoint-condition-with-exception.html:
* inspector/debugger/breakpoint-eval-with-exception.html:
* inspector/debugger/breakpoint-inside-conditons-and-actions.html:
* inspector/debugger/call-frame-function-name.html:
* inspector/debugger/call-frame-this-host.html:
* inspector/debugger/call-frame-this-nonstrict.html:
* inspector/debugger/call-frame-this-strict.html:
* inspector/debugger/debugger-statement.html:
* inspector/debugger/didSampleProbe-multiple-probes.html:
* inspector/debugger/hit-breakpoint-from-console.html:
* inspector/debugger/nested-inspectors.html:
* inspector/debugger/pause-on-assert.html:
* inspector/debugger/regress-133182.html:
* inspector/debugger/removeBreakpoint.html:
* inspector/debugger/setBreakpoint-actions.html:
* inspector/debugger/setBreakpoint-autoContinue.html:
* inspector/debugger/setBreakpoint-column.html:
* inspector/debugger/setBreakpoint-condition.html:
* inspector/debugger/setBreakpoint-dfg-and-modify-local.html:
* inspector/debugger/setBreakpoint-dfg-callee-and-examine-dfg-local.html:
* inspector/debugger/setBreakpoint-dfg.html:
* inspector/debugger/setBreakpoint-options-exception.html:
* inspector/debugger/setBreakpoint.html:
* inspector/debugger/setBreakpointByUrl-sourceURL.html:
* inspector/debugger/setPauseOnExceptions-all.html:
* inspector/debugger/setPauseOnExceptions-none.html:
* inspector/debugger/setPauseOnExceptions-uncaught.html:
Activate breakpoints in protocol tests that may set breakpoints and pause.
Inspector tests automatically enable breakpoints.

* inspector/debugger/setVariableValue-expected.txt: Removed.
* inspector/debugger/setVariableValue.html: Removed.
* platform/gtk/TestExpectations:
Remove references to bad test. The protocol command no longer exists.

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

4 years ago[COCOA] Do not unnecessarily initialize ResourceResponse::m_httpVersion as part of...
cdumez@apple.com [Fri, 15 Apr 2016 16:44:14 +0000 (16:44 +0000)]
[COCOA] Do not unnecessarily initialize ResourceResponse::m_httpVersion as part of common fields
https://bugs.webkit.org/show_bug.cgi?id=156606

Reviewed by Darin Adler.

Do not unnecessarily initialize ResourceResponse::m_httpVersion as part of common fields.

We previously initialized m_httpVersion when calling platformLazyInit(CommonFieldsOnly),
even though this is not a common field. The corresponding getter/setter in
HTTPResponseBase call lazyInit(AllFields).

* platform/network/cf/ResourceResponseCFNet.cpp:
(WebCore::ResourceResponse::platformLazyInit):
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformLazyInit):

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

4 years agoRefactor WebSockets handshake to use StringView instead of String for header validation.
commit-queue@webkit.org [Fri, 15 Apr 2016 16:39:00 +0000 (16:39 +0000)]
Refactor WebSockets handshake to use StringView instead of String for header validation.
https://bugs.webkit.org/show_bug.cgi?id=155602

Patch by John Wilander <wilander@apple.com> on 2016-04-15
Reviewed by Darin Adler.

Source/WebCore:

No new tests. Existing test have been augmented.

* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::readServerHandshake):
    Made sure failure reason was set consistently with makeString().
(WebCore::headerHasValidHTTPVersion):
    Now operates on the HTTP status line with StringView.
(WebCore::WebSocketHandshake::readStatusLine):
    Now operates on the HTTP status line with StringView.
(WebCore::WebSocketHandshake::readHTTPHeaders):
    Now operates on header names with StringView.
    Made sure failure reason was set consistently with makeString() and ASCIILiteral().
(WebCore::WebSocketHandshake::checkResponseHeaders):
    Made sure failure reason was set consistently with ASCIILiteral().
* platform/network/HTTPParsers.cpp:
(WebCore::parseHTTPRequestLine):
    Made sure failure reason was set consistently with ASCIILiteral().
(WebCore::isValidHeaderNameCharacter):
    Inlined function to check if a character is allowed in an HTTP header name according to RFC 7230.
    https://tools.ietf.org/html/rfc7230 (June 2014)
(WebCore::parseHTTPHeader):
* platform/network/HTTPParsers.h:
    Now receives the HTTP header name as a StringView.
    Checks that header names only contain valid characters according to RFC 7230 (see above).
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::addHTTPHeaderField):
* platform/network/ResourceRequestBase.h:
     Now has an overloaded function which receives the HTTP header name as an HTTPHeaderName enum value.
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::addHTTPHeaderField):
* platform/network/ResourceResponseBase.h:
     Now has an overloaded function which receives the HTTP header name as an HTTPHeaderName enum value.

Source/WebKit2:

* UIProcess/InspectorServer/HTTPRequest.cpp:
(WebKit::HTTPRequest::parseHeaders):
    Now declares the HTTP header name as a StringView to match the change in WebCore::parseHTTPHeader.

LayoutTests:

* http/tests/websocket/tests/hybi/bad-handshake-crash-expected.txt:
    Fixed so that new error output is expected.
* http/tests/websocket/tests/hybi/handshake-ok-with-http-version-beyond-1_1-expected.txt:
* http/tests/websocket/tests/hybi/handshake-ok-with-http-version-beyond-1_1.html:
* http/tests/websocket/tests/hybi/handshake-ok-with-http-version-beyond-1_1_wsh.py:
    Now tests HTTP versions that are higher than 1.1, are lower than 1.1, have bad characters, and are empty.
* http/tests/websocket/tests/hybi/long-invalid-header-expected.txt:
    Fixed so that slightly refined error output is expected.

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

4 years ago2016-04-14 Geoffrey Garen <ggaren@apple.com>
ggaren@apple.com [Fri, 15 Apr 2016 16:18:37 +0000 (16:18 +0000)]
2016-04-14  Geoffrey Garen  <ggaren@apple.com>

        CopiedBlock should be 64kB

        Reviewed by Benjamin Poulain.

        Let's try another value.

        This is 25% faster on kraken-audio-beat-detection on Mac Pro.

        * heap/CopiedBlock.h:

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

4 years agoAX: Presentational role on SVG elements is trumped by child 'title' and 'desc' elements
jdiggs@igalia.com [Fri, 15 Apr 2016 15:51:27 +0000 (15:51 +0000)]
AX: Presentational role on SVG elements is trumped by child 'title' and 'desc' elements
https://bugs.webkit.org/show_bug.cgi?id=156519

Reviewed by Chris Fleizach.

Source/WebCore:

Override the presentational role on SVG elements which have a child 'title' or 'desc'
element. As a result of this change, AccessibilitySVGRoot objects would be exposed
with an AccessibilityRole of UnknownRole. Therefore map included AccessibilitySVGRoot
objects to GroupRole as per the SVG Accessibility API Mapping specification.

Also use indexOfBestMatchingLanguageInList() to identify which child 'title' or 'desc'
element is the best match for the parent element.

New Test: accessibility/w3c-svg-content-language-attribute.html

Also: Update w3c-svg-presentational-role.html expectations because there are test cases
in which elements are now being included in the accessibility tree as a result of this
change. Also add new test cases which lack child 'title' and 'desc' elements.

* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilitySVGElement.cpp:
(WebCore::AccessibilitySVGElement::childElementWithMatchingLanguage):
(WebCore::AccessibilitySVGElement::accessibilityDescription):
(WebCore::AccessibilitySVGElement::helpText):
(WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored):
(WebCore::AccessibilitySVGElement::determineAriaRoleAttribute):
* accessibility/AccessibilitySVGElement.h:
* accessibility/AccessibilitySVGRoot.h:

LayoutTests:

Update w3c-svg-presentational-role.html expectations because there are test cases in which
elements are now being included in the accessibility tree as a result of this change. Also
add new test cases which lack child 'title' and 'desc' elements.

* accessibility/w3c-svg-content-language-attribute.html: Added.
* accessibility/w3c-svg-presentational-role.html: New test cases added.
* platform/gtk/accessibility/w3c-svg-content-language-attribute-expected.txt: Added.
* platform/gtk/accessibility/w3c-svg-presentational-role-expected.txt: Updated.
* platform/mac/accessibility/w3c-svg-content-language-attribute-expected.txt: Added.
* platform/mac/accessibility/w3c-svg-presentational-role-expected.txt: Updated.

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

4 years agoRename [GlobalContext] extended attribute to [Exposed] and align with WebIDL
cdumez@apple.com [Fri, 15 Apr 2016 14:12:50 +0000 (14:12 +0000)]
Rename [GlobalContext] extended attribute to [Exposed] and align with WebIDL
https://bugs.webkit.org/show_bug.cgi?id=156615

Reviewed by Youenn Fablet.

Rename [GlobalContext] extended attribute to [Exposed] and align with WebIDL:
- http://heycam.github.io/webidl/#Exposed

* bindings/scripts/IDLAttributes.txt:
Stop recognizing [GlobalContext] and start recognizing [Exposed].

* bindings/scripts/IDLParser.pm:
(parseIdentifierList):
(parseExtendedAttributeRest2):
Add IDL parser support for having a list of identifiers as value
for an IDL extended attribute, e.g. Exposed=(Window, Worker).

* bindings/scripts/preprocess-idls.pl:
Tweak existing support for [GlobalContext] to use [Exposed] instead
and support the new syntax.

(getInterfaceExtendedAttributesFromIDL):
Do not split on commas that are within brackets.

* Modules/fetch/FetchBody.idl:
* Modules/fetch/FetchHeaders.idl:
* Modules/fetch/FetchRequest.idl:
* Modules/fetch/FetchResponse.idl:
* Modules/streams/ByteLengthQueuingStrategy.idl:
* Modules/streams/CountQueuingStrategy.idl:
* Modules/streams/ReadableStream.idl:
* Modules/streams/ReadableStreamController.idl:
* Modules/streams/ReadableStreamReader.idl:
* Modules/websockets/WebSocket.idl:
* dom/MessageChannel.idl:
* dom/MessageEvent.idl:
* fileapi/Blob.idl:
* fileapi/FileReader.idl:
* fileapi/FileReaderSync.idl:
* html/DOMURL.idl:
* html/ImageData.idl:
* page/EventSource.idl:
* workers/DedicatedWorkerGlobalScope.idl:
* workers/WorkerGlobalScope.idl:
* workers/WorkerLocation.idl:
* xml/XMLHttpRequest.idl:
* xml/XMLHttpRequestEventTarget.idl:
Use [Exposed] instead of [GlobalContext] to match their respective
specifications.

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

4 years agoTail call optimizations lead to crashes on ARM Thumb + Linux
commit-queue@webkit.org [Fri, 15 Apr 2016 09:07:36 +0000 (09:07 +0000)]
Tail call optimizations lead to crashes on ARM Thumb + Linux
https://bugs.webkit.org/show_bug.cgi?id=150083

Patch by Zan Dobersek <zdobersek@igalia.com> on 2016-04-15
Reviewed by Csaba Osztrogonác.

* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::repatchNearCall): In case of a tail call relink to the
data location of the destination, and not the executable address. This is needed for
the ARM Thumb2 platform where both the source and destination addresses of a jump relink
must not have the bottom bit decorated, as asserted in ARMv7Assembler::relinkJump().
* jit/Repatch.cpp:
(JSC::linkPolymorphicCall): Similarly, when linking a tail call we must link to the
address that has a non-decorated bottom bit, as asserted in ARMv7Assembler::linkJumpAbsolute().

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

4 years agoSelection.deleteFromDocument should not leave a selection character
carlosgc@webkit.org [Fri, 15 Apr 2016 08:53:38 +0000 (08:53 +0000)]
Selection.deleteFromDocument should not leave a selection character
https://bugs.webkit.org/show_bug.cgi?id=151442

Reviewed by Michael Catanzaro.

Source/WebCore:

This is a merge of Blink r172511:
https://codereview.chromium.org/255453003

Let Selection.deleteFromDocument not delete a character when the
selection is a caret.

Selection.deleteFromDocument delete a character when the selection
is a caret.
However, current standard says that Selection.deleteFromDocument
does nothing when the selection is a caret:
https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#dom-selection-deletefromdocument
Both IE10 and FireFox seem following the spec.

Test: imported/blink/editing/selection/deleteFromDocument-undo-crash.html

* page/DOMSelection.cpp:
(WebCore::DOMSelection::deleteFromDocument): Deleted.

LayoutTests:

* editing/selection/deleteFromDocument-expected.txt:
* editing/selection/deleteFromDocument.html:
* imported/blink/editing/selection/deleteFromDocument-undo-crash-expected.txt: Added.
* imported/blink/editing/selection/deleteFromDocument-undo-crash.html: Added.
* TestExpectations: Skip imported/blink/editing/selection/deleteFromDocument-undo-crash.html in Debug.
* platform/gtk/TestExpectations: Unskip imported/blink/editing/selection/deleteFromDocument-crash.html.
* platform/win/TestExpectations: Ditto.

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

4 years agoFix return value nullptr -> false.
antti@apple.com [Fri, 15 Apr 2016 08:16:17 +0000 (08:16 +0000)]
Fix return value nullptr -> false.

* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::canShareStyleWithElement):

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

4 years agoAffectsNextSibling style relation marking is inefficient
antti@apple.com [Fri, 15 Apr 2016 07:54:20 +0000 (07:54 +0000)]
AffectsNextSibling style relation marking is inefficient
https://bugs.webkit.org/show_bug.cgi?id=156593

Reviewed by Benjamin Poulain.

We currently add a Style::Relation entry for each sibling to mark. With long sibling lists this can be inefficient
in terms of both memory and speed. Instead make a single entry that includes the sibling count to mark.

* css/SelectorChecker.cpp:
(WebCore::addStyleRelation):

    When adding AffectsNextSibling entry check if the last entry in the style relation vector has the
    same type and is part of the same sibling chain. If so just update the existing entry.

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation):

    The same thing in hand-crafted macro assembler.

* cssjit/SelectorCompiler.h:

    Stop lying about the constness of the CheckingContext.

* style/StyleRelations.cpp:
(WebCore::Style::commitRelations):

    Mark as many sibling elements as the value indicates.

* style/StyleRelations.h:
(WebCore::Style::Relation::Relation):

    Make element a pointer so we can udpate it.

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

4 years agoDon't copy entire NSURLSessionConfiguration just to test for credentials
commit-queue@webkit.org [Fri, 15 Apr 2016 07:26:40 +0000 (07:26 +0000)]
Don't copy entire NSURLSessionConfiguration just to test for credentials
https://bugs.webkit.org/show_bug.cgi?id=156598

Patch by Alex Christensen <achristensen@webkit.org> on 2016-04-15
Reviewed by Brady Eidson.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate initWithNetworkSession:withCredentials:]):
(-[WKNetworkSessionDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]):
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
(-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
(WebKit::NetworkSession::NetworkSession):
(-[WKNetworkSessionDelegate initWithNetworkSession:]): Deleted.

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

4 years agoAdd the message property to DOMError.
beidson@apple.com [Fri, 15 Apr 2016 07:22:50 +0000 (07:22 +0000)]
Add the message property to DOMError.
https://bugs.webkit.org/show_bug.cgi?id=139173

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Updated existing tests).

Adding this property brings us up to date with other browsers, and will help
test the few web features that still use DOMError.

* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::onError):
(WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::uncaughtExceptionInEventHandler):
(WebCore::IDBRequest::onError):

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::didCreateIndexOnServer):

* Modules/mediastream/NavigatorUserMediaError.h:
(WebCore::NavigatorUserMediaError::NavigatorUserMediaError):

* dom/DOMError.cpp:
(WebCore::DOMError::DOMError):

* dom/DOMError.h:
(WebCore::DOMError::create):
(WebCore::DOMError::message):
* dom/DOMError.idl:

LayoutTests:

* storage/indexeddb/createIndex-after-failure-expected.txt:
* storage/indexeddb/createIndex-after-failure-private-expected.txt:
* storage/indexeddb/intversion-upgrades-expected.txt:
* storage/indexeddb/intversion-upgrades-private-expected.txt:

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

4 years agoMark perf/array-binary-search.html as flaky on ios-simulator-wk2
jiewen_tan@apple.com [Fri, 15 Apr 2016 07:02:17 +0000 (07:02 +0000)]
Mark perf/array-binary-search.html as flaky on ios-simulator-wk2
https://bugs.webkit.org/show_bug.cgi?id=153049

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

4 years agoMark fast/animation/request-animation-frame-iframe2.html as flaky on ios-simulator-wk2
jiewen_tan@apple.com [Fri, 15 Apr 2016 06:51:06 +0000 (06:51 +0000)]
Mark fast/animation/request-animation-frame-iframe2.html as flaky on ios-simulator-wk2
https://bugs.webkit.org/show_bug.cgi?id=156620

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

4 years agoMark fast/animation/request-animation-frame-during-modal.html as flaky on ios-simulat...
jiewen_tan@apple.com [Fri, 15 Apr 2016 06:38:44 +0000 (06:38 +0000)]
Mark fast/animation/request-animation-frame-during-modal.html as flaky on ios-simulator-wk2
https://bugs.webkit.org/show_bug.cgi?id=82762

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

4 years agoUnreviewed. Fix GTK+ build after r199558.
carlosgc@webkit.org [Fri, 15 Apr 2016 06:35:53 +0000 (06:35 +0000)]
Unreviewed. Fix GTK+ build after r199558.

* UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
(webkitFileChooserRequestCreate):
(webkit_file_chooser_request_select_files):
* UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h:
* UIProcess/API/gtk/WebKitUIClient.cpp:

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

4 years agoMark inspector/console/addInspectedNode.html as flaky on mac-wk2 for ElCapitan
jiewen_tan@apple.com [Fri, 15 Apr 2016 06:27:44 +0000 (06:27 +0000)]
Mark inspector/console/addInspectedNode.html as flaky on mac-wk2 for ElCapitan
https://bugs.webkit.org/show_bug.cgi?id=155138

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

4 years agoMark http/tests/cache/disk-cache/disk-cache-vary-no-body.html as flaky on ios-simulat...
jiewen_tan@apple.com [Fri, 15 Apr 2016 06:04:15 +0000 (06:04 +0000)]
Mark http/tests/cache/disk-cache/disk-cache-vary-no-body.html as flaky on ios-simulator-wk2
https://bugs.webkit.org/show_bug.cgi?id=149087

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

4 years agoMark http/tests/cache/disk-cache/disk-cache-vary.html as flaky for ios-simulator-wk2
jiewen_tan@apple.com [Fri, 15 Apr 2016 05:50:31 +0000 (05:50 +0000)]
Mark http/tests/cache/disk-cache/disk-cache-vary.html as flaky for ios-simulator-wk2
https://bugs.webkit.org/show_bug.cgi?id=149087

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

4 years agoSome GuardMalloc bots are not happy when running many parallel processes
ap@apple.com [Fri, 15 Apr 2016 04:37:43 +0000 (04:37 +0000)]
Some GuardMalloc bots are not happy when running many parallel processes
https://bugs.webkit.org/show_bug.cgi?id=156614
rdar://problem/24711525

Reviewed by David Kilzer.

* Scripts/webkitpy/port/mac.py: (MacPort.default_child_processes):

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

4 years agoUnreviewed, rolling out r199567.
ggaren@apple.com [Fri, 15 Apr 2016 03:42:21 +0000 (03:42 +0000)]
Unreviewed, rolling out r199567.

performance regression on kraken on macbook*

Reverted changeset:

"CopiedBlock should be 8kB"
https://bugs.webkit.org/show_bug.cgi?id=156610
http://trac.webkit.org/changeset/199567

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

4 years agoMake <a download> a runtime enabled option
bfulgham@apple.com [Fri, 15 Apr 2016 00:45:52 +0000 (00:45 +0000)]
Make <a download> a runtime enabled option
https://bugs.webkit.org/show_bug.cgi?id=156583
<rdar://problem/25733449>

Reviewed by Alex Christensen.

Source/WebCore:

Mark the download attribute interface as EnabledAtRuntime=DownloadAttribute.
Add DownloadAttribute runtime flag getter and setter.

* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::fetchAPIEnabled):
(WebCore::RuntimeEnabledFeatures::setDownloadAttributeEnabled):
(WebCore::RuntimeEnabledFeatures::downloadAttributeEnabled):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
* html/HTMLAnchorElement.idl:

Source/WebKit/mac:

Add a download attribute runtime flag based on preferences.
Disable the download attribute by default.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences setFetchAPIEnabled:]):
(-[WebPreferences downloadAttributeEnabled]):
(-[WebPreferences setDownloadAttributeEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged]): Set the runtime flag properly
based on the user preferences.

Source/WebKit2:

Add a download attribute runtime flag based on preferences.
Disable the download attribute by default.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesGetFetchAPIEnabled):
(WKPreferencesSetDownloadAttributeEnabled):
(WKPreferencesGetDownloadAttributeEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setDownloadAttributeEnabled):
* WebKitTestRunner/InjectedBundle/TestRunner.h:

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