WebKit-https.git
3 years agoFix max length check in ArrayPrototype.js' concatSlowPath().
bfulgham@apple.com [Fri, 10 Feb 2017 01:54:24 +0000 (01:54 +0000)]
Fix max length check in ArrayPrototype.js' concatSlowPath().
https://bugs.webkit.org/show_bug.cgi?id=167270
<rdar://problem/30128133>

Patch by Mark Lam <mark.lam@apple.com> on 2017-02-09
Reviewed by Filip Pizlo.

JSTests:

* stress/array-prototype-concat-of-long-spliced-arrays.js: Added.
* stress/array-prototype-concat-of-long-spliced-arrays2.js: Added.

Source/JavaScriptCore:

1. Fixed concatSlowPath() to ensure that the result array length does not exceed
   @MAX_ARRAY_INDEX.  The old code was checking against @MAX_SAFE_INTEGER in some
   cases, but this is overly permissive.

2. Changed concatSlowPath() to throw a RangeError instead of a TypeError to be
   consistent with the C++ runtime functions in JSArray.cpp.

3. Changed the RangeError message in concatSlowPath() and JSArray.cpp to "Length
   exceeded the maximum array length" when the error is that the result length
   exceeds MAX_ARRAY_INDEX.  We do this for 2 reasons:
   a. "Length exceeded the maximum array length" is more informative than
      "Invalid array length".
   b. We want to use the same string consistently for the same error.

   There are still 2 places in JSArray.cpp that still throws a RangeError with
   message "Invalid array length".  In those cases, the error is not necessarily
   due to the result length exceeding MAX_ARRAY_INDEX, but is due to attempting to
   set a length value that is not an integer that fits in MAX_ARRAY_INDEX e.g.
   an attempt to set a fractional length value.  Hence, "Invalid array length" is
   appropriate for those cases.

4. Fixed JSArray::appendMemcpy() to handle overflows when computing the result
   array length.

* builtins/ArrayPrototype.js:
(concatSlowPath):
* bytecode/BytecodeIntrinsicRegistry.cpp:
(JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
* bytecode/BytecodeIntrinsicRegistry.h:
* runtime/ArrayPrototype.cpp:
(JSC::concatAppendOne):
(JSC::arrayProtoPrivateFuncAppendMemcpy):
* runtime/JSArray.cpp:
(JSC::JSArray::appendMemcpy):
(JSC::JSArray::push):

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

3 years agoConstructed object's global object should be the global object of the constructor.
bfulgham@apple.com [Fri, 10 Feb 2017 01:39:13 +0000 (01:39 +0000)]
Constructed object's global object should be the global object of the constructor.
https://bugs.webkit.org/show_bug.cgi?id=167121
<rdar://problem/30054759>

Patch by Mark Lam <mark.lam@apple.com> on 2017-02-09
Reviewed by Filip Pizlo and Geoffrey Garen.

Source/JavaScriptCore:

The realm (i.e. globalObject) of any object should be the same as the constructor
that instantiated the object.  Changed PrototypeMap::createEmptyStructure() to
be passed the correct globalObject to use instead of assuming it's the same one
as the prototype object.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
* bytecode/InternalFunctionAllocationProfile.h:
(JSC::InternalFunctionAllocationProfile::createAllocationStructureFromBase):
* bytecode/ObjectAllocationProfile.h:
(JSC::ObjectAllocationProfile::initialize):
* runtime/FunctionRareData.cpp:
(JSC::FunctionRareData::initializeObjectAllocationProfile):
* runtime/FunctionRareData.h:
(JSC::FunctionRareData::createInternalFunctionAllocationStructureFromBase):
* runtime/InternalFunction.cpp:
(JSC::InternalFunction::createSubclassStructure):
* runtime/IteratorOperations.cpp:
(JSC::createIteratorResultObjectStructure):
* runtime/JSBoundFunction.cpp:
(JSC::getBoundFunctionStructure):
* runtime/JSFunction.cpp:
(JSC::JSFunction::allocateAndInitializeRareData):
(JSC::JSFunction::initializeRareData):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/JSProxy.cpp:
(JSC::JSProxy::setTarget):
* runtime/ObjectConstructor.h:
(JSC::constructEmptyObject):
* runtime/PrototypeMap.cpp:
(JSC::PrototypeMap::createEmptyStructure):
(JSC::PrototypeMap::emptyStructureForPrototypeFromBaseStructure):
(JSC::PrototypeMap::emptyObjectStructureForPrototype):
(JSC::PrototypeMap::clearEmptyObjectStructureForPrototype):
* runtime/PrototypeMap.h:

LayoutTests:

* http/tests/security/xssAuditor/regress-167121-expected.txt: Added.
* http/tests/security/xssAuditor/regress-167121.html: Added.

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

3 years agoDon't build libwebrtc.
achristensen@apple.com [Fri, 10 Feb 2017 01:33:43 +0000 (01:33 +0000)]
Don't build libwebrtc.

* Scripts/build-webkit:
Not ready yet.  It broke El Capitan and iOS.

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

3 years agoFix CMake build.
achristensen@apple.com [Fri, 10 Feb 2017 01:27:38 +0000 (01:27 +0000)]
Fix CMake build.

* PlatformMac.cmake:

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

3 years agoREGRESSION: LayoutTest http/tests/cache/disk-cache/disk-cache-remove-several-pending...
cdumez@apple.com [Fri, 10 Feb 2017 01:23:30 +0000 (01:23 +0000)]
REGRESSION: LayoutTest http/tests/cache/disk-cache/disk-cache-remove-several-pending-writes.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=161650

Reviewed by Alexey Proskuryakov.

Make sure we clear the memory cache before trigerring new loads as this
test is meant to cover the disk cache.

* http/tests/cache/disk-cache/disk-cache-remove-several-pending-writes.html:
* platform/mac/TestExpectations:

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

3 years agoBuild libwebrtc on bots without using it yet
achristensen@apple.com [Fri, 10 Feb 2017 01:11:20 +0000 (01:11 +0000)]
Build libwebrtc on bots without using it yet
https://bugs.webkit.org/show_bug.cgi?id=168062

Reviewed by Brent Fulgham.

* Scripts/build-webkit:

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

3 years agoMark inspector/model/remote-object-weak-collection.html as a flaky timeout.
ryanhaddad@apple.com [Fri, 10 Feb 2017 01:07:35 +0000 (01:07 +0000)]
Mark inspector/model/remote-object-weak-collection.html as a flaky timeout.

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoWe should not allow Function.caller to be used on native functions
bfulgham@apple.com [Fri, 10 Feb 2017 00:59:15 +0000 (00:59 +0000)]
We should not allow Function.caller to be used on native functions
https://bugs.webkit.org/show_bug.cgi?id=165628

Patch by Keith Miller <keith_miller@apple.com> on 2017-02-09
Reviewed by Mark Lam.

JSTests:

* stress/caller-native-code.js: Added.
(f):

Source/JavaScriptCore:

Also remove unneeded dynamic cast.

* runtime/JSFunction.cpp:
(JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor):
(JSC::JSFunction::callerGetter):

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

3 years agoMark pointer-lock/mouse-event-delivery.html as flaky.
ryanhaddad@apple.com [Fri, 10 Feb 2017 00:49:12 +0000 (00:49 +0000)]
Mark pointer-lock/mouse-event-delivery.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=167965

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoMark inspector/worker/resources-in-worker.html as flaky.
ryanhaddad@apple.com [Fri, 10 Feb 2017 00:46:02 +0000 (00:46 +0000)]
Mark inspector/worker/resources-in-worker.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=168091

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoMark inspector/debugger/breakpoint-columns.html as a flaky timeout.
ryanhaddad@apple.com [Fri, 10 Feb 2017 00:42:00 +0000 (00:42 +0000)]
Mark inspector/debugger/breakpoint-columns.html as a flaky timeout.
https://bugs.webkit.org/show_bug.cgi?id=168090

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoMark fast/backgrounds/hidpi-bitmap-background-on-subpixel-position.html as flaky.
ryanhaddad@apple.com [Fri, 10 Feb 2017 00:41:58 +0000 (00:41 +0000)]
Mark fast/backgrounds/hidpi-bitmap-background-on-subpixel-position.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=167186

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoFix warnings in libwebrtc build
achristensen@apple.com [Fri, 10 Feb 2017 00:37:04 +0000 (00:37 +0000)]
Fix warnings in libwebrtc build
https://bugs.webkit.org/show_bug.cgi?id=168088

Reviewed by Youenn Fablet.

* Source/third_party/opus/src/src/opus_decoder.c:
Silence a warning.  Debug builds of opus can be slow.  No big deal.
* libwebrtc.xcodeproj/project.pbxproj:
More sdk files need ARC.

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

3 years agoTransition "WebKit Library Version" checks to SDK version checks.
beidson@apple.com [Fri, 10 Feb 2017 00:21:11 +0000 (00:21 +0000)]
Transition "WebKit Library Version" checks to SDK version checks.
<rdar://problem/30313696> and https://bugs.webkit.org/show_bug.cgi?id=168056

Reviewed by Geoffrey Garen.

Source/WebKit2:

When doing linkedOnOrAfter checks, relying solely on the WebKit library version number is error prone,
since apps may not link against WebKit directly and therefore the linked WebKit is unknown.

We should first prefer a version check on the SDK that the app was built with.

If that check fails, we can fallback to the linked WebKit library version number if it exists.

* Shared/Cocoa/CompletionHandlerCallChecker.mm:
(WebKit::shouldThrowExceptionForDuplicateCompletionHandlerCall):

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):

For each "linked-on-or-after" feature, include both the WebKit library version and SDK version:
* UIProcess/Cocoa/VersionChecks.h:
(WebKit::linkedOnOrAfter):
* UIProcess/Cocoa/VersionChecks.mm:
(WebKit::linkedOnOrAfter):
(WebKit::linkTimeVersion): Deleted.

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::isNetworkCacheEnabled):

Source/WTF:

* wtf/spi/darwin/dyldSPI.h: Add entries for the iOS 10.3, macOS 10.11, and macOS 10.12.4 SDKs.

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

3 years agoDisconnect shadow children of root when detaching a frame
bfulgham@apple.com [Fri, 10 Feb 2017 00:10:14 +0000 (00:10 +0000)]
Disconnect shadow children of root when detaching a frame
https://bugs.webkit.org/show_bug.cgi?id=166851
<rdar://problem/29930443>

Reviewed by Andy Estes.

Source/WebCore:

If the root of the tree we are disconnecting has a shadow element, include it in the set of
things to disconnect.

Tests: fast/shadow-dom/shadow-at-root-during-disconnect.html

* dom/ContainerNodeAlgorithms.cpp:
(WebCore::disconnectSubframes):

LayoutTests:

* fast/shadow-dom/resources/start.html: Added.
* fast/shadow-dom/shadow-at-root-during-disconnect-expected.txt: Added.
* fast/shadow-dom/shadow-at-root-during-disconnect.html: Added.

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

3 years agoRename isAppleMacWebKit to isAppleCocoaWebKit
commit-queue@webkit.org [Thu, 9 Feb 2017 23:46:56 +0000 (23:46 +0000)]
Rename isAppleMacWebKit to isAppleCocoaWebKit
https://bugs.webkit.org/show_bug.cgi?id=168075

Patch by Alex Christensen <achristensen@webkit.org> on 2017-02-09
Reviewed by Geoffrey Garen.

It returns true for Mac and iOS.  "isAppleMacWebKit" is confusing and wrong.

* Scripts/build-api-tests:
* Scripts/build-dumprendertree:
* Scripts/build-jsc:
(buildMyProject):
* Scripts/build-layouttestrelay:
* Scripts/build-webkit:
* Scripts/build-webkittestrunner:
* Scripts/run-api-tests:
(isSupportedPlatform):
(runTest):
(listAllTests):
(prepareEnvironmentForRunningTestTool):
* Scripts/run-content-extension-tester:
* Scripts/run-javascriptcore-tests:
* Scripts/run-minibrowser:
* Scripts/show-pretty-diff:
* Scripts/webkitdirs.pm:
(determineBaseProductDir):
(determineArchitecture):
(determinePassedArchitecture):
(safariPath):
(builtDylibPathForName):
(checkFrameworks):
(isAppleWebKit):
(isAppleCocoaWebKit):
(determineNmPath):
(launcherName):
(wrapperPrefixIfNeeded):
(isCMakeBuild):
(mobileSafariBundle):
(debugSafari):
(runSafari):
(runMiniBrowser):
(debugMiniBrowser):
(runWebKitTestRunner):
(debugWebKitTestRunner):
(isAppleMacWebKit): Deleted.
* Scripts/webkitperl/FeatureList.pm:

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

3 years agoMark http/tests/contentextensions/async-xhr-onerror.html as flaky.
ryanhaddad@apple.com [Thu, 9 Feb 2017 23:39:58 +0000 (23:39 +0000)]
Mark http/tests/contentextensions/async-xhr-onerror.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=168081

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoMark http/tests/contentextensions/invalid-selector.html as flaky.
ryanhaddad@apple.com [Thu, 9 Feb 2017 23:36:48 +0000 (23:36 +0000)]
Mark http/tests/contentextensions/invalid-selector.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=168082

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoMark http/tests/security/credentials-iframes.html as failing on ios-simulator.
ryanhaddad@apple.com [Thu, 9 Feb 2017 23:28:46 +0000 (23:28 +0000)]
Mark http/tests/security/credentials-iframes.html as failing on ios-simulator.
https://bugs.webkit.org/show_bug.cgi?id=167967

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

3 years agoMark fast/css-grid-layout/grid-simplified-layout-positioned.html as flaky.
ryanhaddad@apple.com [Thu, 9 Feb 2017 23:18:43 +0000 (23:18 +0000)]
Mark fast/css-grid-layout/grid-simplified-layout-positioned.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=167538

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoRevert r211991
achristensen@apple.com [Thu, 9 Feb 2017 22:06:31 +0000 (22:06 +0000)]
Revert r211991
https://bugs.webkit.org/show_bug.cgi?id=168062

* Scripts/build-webkit:
Not quite ready yet.

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

3 years agoBuild libwebrtc on bots without using it yet
achristensen@apple.com [Thu, 9 Feb 2017 21:48:21 +0000 (21:48 +0000)]
Build libwebrtc on bots without using it yet
​https://bugs.webkit.org/show_bug.cgi?id=168062

Reviewed by Brent Fulgham.

* Scripts/build-webkit:
Build libwebrtc on Mac when we build ANGLE.

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

3 years agoUnreviewed, rolling out r211980 and r211987.
ryanhaddad@apple.com [Thu, 9 Feb 2017 21:47:14 +0000 (21:47 +0000)]
Unreviewed, rolling out r211980 and r211987.
https://bugs.webkit.org/show_bug.cgi?id=168072

Caused API test WebKit2.DuplicateCompletionHandlerCalls to
fail (Requested by ryanhaddad on #webkit).

Reverted changesets:

"Transition "WebKit Library Version" checks to SDK version
checks."
https://bugs.webkit.org/show_bug.cgi?id=168056
http://trac.webkit.org/changeset/211980

"Build fix for APPLE_INTERNAL_SDK builds after r211980."
http://trac.webkit.org/changeset/211987

Patch by Commit Queue <commit-queue@webkit.org> on 2017-02-09

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

3 years agoRemove unused WebThreadRunSync
ap@apple.com [Thu, 9 Feb 2017 21:34:19 +0000 (21:34 +0000)]
Remove unused WebThreadRunSync
https://bugs.webkit.org/show_bug.cgi?id=168024

Reviewed by Tim Horton.

Source/WebCore:

* platform/ios/wak/WebCoreThreadRun.cpp:
* platform/ios/wak/WebCoreThreadRun.h:
* platform/ios/wak/WebCoreThreadSystemInterface.cpp:
(InitWebCoreThreadSystemInterface):

Source/WTF:

* wtf/ios/WebCoreThread.cpp:
* wtf/ios/WebCoreThread.h:

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

3 years agoBuild libwebrtc on bots without using it yet
achristensen@apple.com [Thu, 9 Feb 2017 21:33:24 +0000 (21:33 +0000)]
Build libwebrtc on bots without using it yet
https://bugs.webkit.org/show_bug.cgi?id=168062

Reviewed by Brent Fulgham.

.:

* Source/Makefile:

Source/ThirdParty:

* Makefile:

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

3 years agoBuild fix for APPLE_INTERNAL_SDK builds after r211980.
beidson@apple.com [Thu, 9 Feb 2017 21:32:31 +0000 (21:32 +0000)]
Build fix for APPLE_INTERNAL_SDK builds after r211980.

Unreviewed.

* wtf/spi/darwin/dyldSPI.h:

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

3 years agoUnreviewed, rolling out r211802.
ryanhaddad@apple.com [Thu, 9 Feb 2017 21:31:35 +0000 (21:31 +0000)]
Unreviewed, rolling out r211802.

This change caused fast/regions/inline-block-inside-anonymous-
overflow-with-covered-controls.html to be a flaky failure.

Reverted changeset:

"[Modern Media Controls] Improve handling of <video> with only
audio tracks"
https://bugs.webkit.org/show_bug.cgi?id=167836
http://trac.webkit.org/changeset/211802

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

3 years agoMark http/tests/media/track-in-band-hls-metadata-crash.html as a flaky timeout.
ryanhaddad@apple.com [Thu, 9 Feb 2017 21:20:44 +0000 (21:20 +0000)]
Mark http/tests/media/track-in-band-hls-metadata-crash.html as a flaky timeout.
https://bugs.webkit.org/show_bug.cgi?id=167749

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoMark two scroll-snap tests as flaky.
ryanhaddad@apple.com [Thu, 9 Feb 2017 21:20:41 +0000 (21:20 +0000)]
Mark two scroll-snap tests as flaky.

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoMark inspector/unit-tests/heap-snapshot.html as flaky.
ryanhaddad@apple.com [Thu, 9 Feb 2017 21:11:26 +0000 (21:11 +0000)]
Mark inspector/unit-tests/heap-snapshot.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=168065

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoMark two performance-api tests as flaky.
ryanhaddad@apple.com [Thu, 9 Feb 2017 21:11:24 +0000 (21:11 +0000)]
Mark two performance-api tests as flaky.

Unreviewed test gardening.

* TestExpectations:

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

3 years agoFix i386 libwebrtc build
achristensen@apple.com [Thu, 9 Feb 2017 21:10:15 +0000 (21:10 +0000)]
Fix i386 libwebrtc build
https://bugs.webkit.org/show_bug.cgi?id=168038

* Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
DataChannelInterface::buffered_amount returns a uint64_t, and we want a size_t.
If this overflows, then we've run out of memory and crashed a long time ago.

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

3 years agoTransition "WebKit Library Version" checks to SDK version checks.
beidson@apple.com [Thu, 9 Feb 2017 20:37:34 +0000 (20:37 +0000)]
Transition "WebKit Library Version" checks to SDK version checks.
<rdar://problem/30313696> and https://bugs.webkit.org/show_bug.cgi?id=168056

Reviewed by Geoffrey Garen.

Source/WebKit2:

Library version linkedOnOrAfter checks are error prone since apps may not link directly to WebKit.

We always know what version of the SDK an app was built with, so we should use SDK version checks
whenever possible.

* Shared/Cocoa/CompletionHandlerCallChecker.mm:
(WebKit::shouldThrowExceptionForDuplicateCompletionHandlerCall):

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):

Add SDKVersion form of the linkedOnOrAfter check, and transition over the current Library Version checks:
* UIProcess/Cocoa/VersionChecks.h:
* UIProcess/Cocoa/VersionChecks.mm:
(WebKit::linkedOnOrAfter):

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::isNetworkCacheEnabled):

Source/WTF:

* wtf/spi/darwin/dyldSPI.h: Add entries for the iOS 10.3, macOS 10.11, and macOS 10.12.4 SDKs.

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

3 years agoDocument::settings() should return a const Settings&.
akling@apple.com [Thu, 9 Feb 2017 20:32:27 +0000 (20:32 +0000)]
Document::settings() should return a const Settings&.
<https://webkit.org/b/168061>

Reviewed by Geoffrey Garen.

- Make Document::settings() return a const reference.
- Added Document::mutableSettings() for all your non-const needs.
- Fixed up settings generator to produce const getters.
- Simplify a few settings() call sites that exposed themselves.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::shouldDiscloseApplePayCapability):
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::canCallGetUserMedia):
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::appendSources):
* css/CSSFontSelector.cpp:
(WebCore::resolveGenericFamily):
* css/StyleResolver.h:
(WebCore::StyleResolver::settings):
* dom/Document.h:
(WebCore::Document::settings):
(WebCore::Document::mutableSettings):
* html/FTPDirectoryDocument.cpp:
(WebCore::createTemplateDocumentData):
* html/HTMLCanvasElement.cpp:
(WebCore::shouldEnableWebGL):
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::rendererIsNeeded):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::menuListDefaultEventHandler):
* html/ImageDocument.cpp:
(WebCore::ImageDocument::updateDuringParsing):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol):
* page/make_settings.pl:
(printGetterAndSetter):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::toggleSimpleLineLayout):

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

3 years agoMake passing PlatformAudioData in audioSamplesAvaliable const-correct.
jer.noble@apple.com [Thu, 9 Feb 2017 20:28:44 +0000 (20:28 +0000)]
Make passing PlatformAudioData in audioSamplesAvaliable const-correct.
https://bugs.webkit.org/show_bug.cgi?id=168051

Reviewed by Eric Carlson.

Modify all the functions which take a (conceptually) read-only audio buffer const-correct.

Drive-by fix: AudioSampleBufferList::copyFrom() set a ivar pointer to the passed in
AudioBufferList. Ensure that the ivar is reset when copyFrom() returns by using a
SetForScope.

* platform/audio/mac/AudioSampleBufferList.cpp:
(WebCore::AudioSampleBufferList::copyFrom):
* platform/audio/mac/AudioSampleBufferList.h:
* platform/audio/mac/AudioSampleDataSource.cpp:
(WebCore::AudioSampleDataSource::pushSamplesInternal):
(WebCore::AudioSampleDataSource::pushSamples):
* platform/audio/mac/AudioSampleDataSource.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::audioSamplesAvailable):
* platform/mediastream/RealtimeMediaSource.h:
(WebCore::RealtimeMediaSource::Observer::audioSamplesAvailable):
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:

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

3 years agoFix some logging statements in MediaPlayerPrivateMediaStreamAVFObjC
jer.noble@apple.com [Thu, 9 Feb 2017 20:22:31 +0000 (20:22 +0000)]
Fix some logging statements in MediaPlayerPrivateMediaStreamAVFObjC
https://bugs.webkit.org/show_bug.cgi?id=168063

Reviewed by Eric Carlson.

Make the format string match the types passed in (i.e., floats, not strings).

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateSampleTimes):

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

3 years agoWeb Inspector: changing dock side from windowed to bottom should cause split console...
commit-queue@webkit.org [Thu, 9 Feb 2017 20:12:14 +0000 (20:12 +0000)]
Web Inspector: changing dock side from windowed to bottom should cause split console to collapse on Timeline and Network tabs
https://bugs.webkit.org/show_bug.cgi?id=167841

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2017-02-09
Reviewed by Matt Baker.

* UserInterface/Base/Main.js:
(WebInspector.updateDockedState):

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

3 years agoSkip media/modern-media-controls/media-controller/media-controller-ios-only-enable...
ryanhaddad@apple.com [Thu, 9 Feb 2017 20:11:28 +0000 (20:11 +0000)]
Skip media/modern-media-controls/media-controller/media-controller-ios-only-enable-tap-gesture-recognizer-with-fades-when-idle.html.

Unreviewed test gardening.

This test relies on touch events.

* platform/ios-simulator/TestExpectations:

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

3 years ago[MediaStream Mac] Handle NULL m_sampleBufferDisplayLayer
eric.carlson@apple.com [Thu, 9 Feb 2017 20:10:26 +0000 (20:10 +0000)]
[MediaStream Mac] Handle NULL m_sampleBufferDisplayLayer
https://bugs.webkit.org/show_bug.cgi?id=168060

Reviewed by Jer Noble.

No new tests, this avoids an occasional crash on the bots.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerStatusDidChange): Don't assume
m_sampleBufferDisplayLayer is valid.

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

3 years agoWeb Inspector: Option+hover on -webkit-transform in Styles sidebar underlines only...
commit-queue@webkit.org [Thu, 9 Feb 2017 19:29:05 +0000 (19:29 +0000)]
Web Inspector: Option+hover on -webkit-transform in Styles sidebar underlines only half the property
https://bugs.webkit.org/show_bug.cgi?id=167949

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2017-02-09
Reviewed by Joseph Pecoraro.

* UserInterface/Controllers/CodeMirrorTokenTrackingController.js:
(WebInspector.CodeMirrorTokenTrackingController.prototype._updateHoveredTokenInfo):
Attempt to merge tokens (specifically the `text` and `start` values) if the either the
previous or next token is of the type "meta".

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

3 years agoFix iOS libwebrtc build after r211960
achristensen@apple.com [Thu, 9 Feb 2017 19:23:40 +0000 (19:23 +0000)]
Fix iOS libwebrtc build after r211960
https://bugs.webkit.org/show_bug.cgi?id=168038

* Source/webrtc/sdk/objc/Framework/Classes/RTCOpenGLVideoRenderer.h:
GlContextType declaration needs to be platform specific here like it is in RTCOpenGLDefines.h

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

3 years agoObject.getPrototypeOf(NodeFilter) should be Function.prototype, not Object.prototype
cdumez@apple.com [Thu, 9 Feb 2017 18:54:26 +0000 (18:54 +0000)]
Object.getPrototypeOf(NodeFilter) should be Function.prototype, not Object.prototype
https://bugs.webkit.org/show_bug.cgi?id=167964

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline web platform test now that more checks are passing.

* web-platform-tests/dom/interfaces-expected.txt:

Source/WebCore:

Object.getPrototypeOf(NodeFilter) should be Function.prototype, not Object.prototype
after the following WebIDL spec change:
- https://github.com/heycam/webidl/issues/96

This aligns our behavior with other browsers as the spec has been updated to match
the majority.

No new tests, rebaselined existing test.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorHelperMethods):
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
(WebCore::JSTestCallbackInterfaceConstructor::prototypeForStructure):

LayoutTests:

Rebaseline existing tests now that output differs a bit.

* http/tests/security/cross-frame-access-put-expected.txt:
* platform/mac/fast/dom/Window/window-lookup-precedence-expected.txt:

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

3 years agoUnreviewed, fix module test that has a meaningless onload handler
utatane.tea@gmail.com [Thu, 9 Feb 2017 18:15:56 +0000 (18:15 +0000)]
Unreviewed, fix module test that has a meaningless onload handler
https://bugs.webkit.org/show_bug.cgi?id=161291

* http/tests/misc/module-absolute-url.html:

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

3 years ago[GTK] scroll with transparent background not repainted after scrollY >= 32768
magomez@igalia.com [Thu, 9 Feb 2017 18:11:22 +0000 (18:11 +0000)]
[GTK] scroll with transparent background not repainted after scrollY >= 32768
https://bugs.webkit.org/show_bug.cgi?id=154283

Reviewed by Carlos Garcia Campos.

Due to a limitation of the pixman backend, which uses 16 bits to hold signed integers, cairo is
not able to draw anything when using transformation matrices with values bigger than 32768. When
drawing patterns into large pages, the matrices values can overflow those 16 bits, so cairo doesn't
draw anything in, which causes the reported transparent backgrounds.

The patch modifies the transformation matrices both from the current context and the pattern we
are painting, to avoid them to hold values that cannot stored in 16 bits.

There's still the possibility that this happens, but it would require using a pattern with a size
bigger than 32768.

Based on a previous patch by Gwang Yoon Hwang  <yoon@igalia.com>.

No new tests.

* platform/graphics/cairo/CairoUtilities.cpp:
(WebCore::drawPatternToCairoContext):

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

3 years agoUnreviewed build fix after r211965.
bfulgham@apple.com [Thu, 9 Feb 2017 18:10:42 +0000 (18:10 +0000)]
Unreviewed build fix after r211965.

* dom/Document.cpp:
(WebCore::Document::adoptNode): inDocument -> isConnected

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

3 years agoAdopting a child node of a script element can run script
bfulgham@apple.com [Thu, 9 Feb 2017 17:59:45 +0000 (17:59 +0000)]
Adopting a child node of a script element can run script
https://bugs.webkit.org/show_bug.cgi?id=167318

Patch by Ryosuke Niwa <rniwa@webkit.org> on 2017-02-09
Reviewed by Darin Adler.

Source/WebCore:

The bug was caused by ScriptElement::childrenChanged indiscriminately running the script.
Do this only if some node has been inserted as spec'ed:

https://html.spec.whatwg.org/multipage/scripting.html#script-processing-model
"The script element is connected and a node or document fragment is inserted into
the script element, after any script elements inserted at that time."

Split NonContentsChildChanged into NonContentsChildInserted and NonContentsChildRemoved to disambiguate
non-contents child such as text and element being removed or inserted. New behavior matches that of
Gecko and Chrome as well as the latest HTML5 specification.

Also deploy NoEventDispatchAssertion in more places. Unfortunately, this results in some DOM trees
internal to WebKit to be mutated while there is NoEventDispatchAssertion in the stack. Added a new RAII
object "EventAllowedScope" to temporarily disable this assertion within such a tree. CachedSVGFont's
ensureCustomFontData used to completely disable this assertion but we no longer have to do this either.

To clarify the new semantics, renamed isEventDispatchForbidden to isEventAllowedInMainThread with
the negated boolean value, and added a new variant isEventDispatchAllowedInSubtree, which checks
isEventDispatchForbidden() is true or if the node was one of an internal DOM node or its descendent
held by EventAllowedScope.

Inspired by https://chromium.googlesource.com/chromium/src/+/604e798ec6ee30f44d57a5c4a44ce3dab3a871ed

Tests: fast/html/script-must-not-run-when-child-is-adopted.html
       fast/html/script-must-not-run-when-child-is-removed.html

* dom/CharacterData.cpp:
(WebCore::CharacterData::notifyParentAfterChange): Added NoEventDispatchAssertion.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::insertBefore): Added NoEventDispatchAssertion around TreeScope's adoptIfNeeded
and insertBeforeCommon as done elsewhere.
(WebCore::ContainerNode::appendChildCommon): Added NoEventDispatchAssertion.
(WebCore::ContainerNode::changeForChildInsertion): Use NonContentsChildInserted here.
(WebCore::ContainerNode::notifyChildRemoved): Added NoEventDispatchAssertion.
(WebCore::ContainerNode::replaceChild): Moved adoptIfNeeded into NoEventDispatchAssertion.
(WebCore::ContainerNode::removeChild): Added NoEventDispatchAssertion.
(WebCore::ContainerNode::parserRemoveChild): Added NoEventDispatchAssertion.
(WebCore::ContainerNode::removeChildren): Call childrenChanged in NoEventDispatchAssertion.
(WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): Moved adoptIfNeeded into
NoEventDispatchAssertion.
(WebCore::dispatchChildInsertionEvents): Check the forbidden-ness more precisely.
(WebCore::dispatchChildRemovalEvents): Ditto.
* dom/ContainerNode.h:
(WebCore::ContainerNode::ChildChange::isInsertion): Added.
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyChildNodeInserted): Check the forbidden-ness more precisely. Here, we check against
insertionPoint since EventAllowedScope checks against the root node.
* dom/Document.cpp:
(WebCore::Document::adoptNode): Assert the node to be adopted has not been inserted back, or else
remove() had resulted in an exception before calling TreeScope::adoptIfNeeded.
* dom/Element.cpp:
(WebCore::Element::childrenChanged):
* dom/NoEventDispatchAssertion.h:
(WebCore::NoEventDispatchAssertion::isEventDispatchForbidden): Added a new variant that takes a node.
If this node is a descendent of a node "marked as safe" by EventAllowedScope, then we don't consider
the event dispatch to be forbidden.
(WebCore::NoEventDispatchAssertion::dropTemporarily): Deleted.
(WebCore::NoEventDispatchAssertion::restoreDropped): Deleted.
(WebCore::NoEventDispatchAssertion::EventAllowedScope): Added. A RAII object which marks descendants of
a given node as "safe" for the purpose of checking isEventDispatchForbidden.
(WebCore::NoEventDispatchAssertion::EventAllowedScope::EventAllowedScope): Added. There can be a chain
of EventAllowedScope objects in the stack. s_currentScope points to the most recently instantiated
RAII object, and each instance remembers prior instance.
(WebCore::NoEventDispatchAssertion::EventAllowedScope::~EventAllowedScope): Added.
(WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNode): Added. Returns true if the given
node is a descendent of any node held by instances of EventAllowedScope.
(WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNodeInternal): Added. A helper function
for isAllowedNode.
* dom/Node.cpp:
(WebCore::Node::dispatchSubtreeModifiedEvent): Check the forbidden-ness more precisely.
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::childrenChanged): Only prepare the script if we've inserted nodes.
(WebCore::ScriptElement::executeClassicScript): Assert isEventDispatchForbidden is false since running
arbitrary author scripts can, indeed, result dispatch any events.
* dom/ScriptElement.h:
* html/HTMLElement.cpp:
(WebCore::textToFragment): Made this a static local function and not return an exception since there
is no way appendChild called in this function can throw an exception.
(WebCore::HTMLElement::setInnerText): Create EventAllowedScope for the fragment. It's called called by
HTMLTextAreaElement's childrenChanged to update its UA shadow tree, and it's dispatching as event on
a new fragment can't execute arbitrary scripts since it has never been exposed to author scripts.
Because of the precise-ness of this check, this does not disable the assertion for "this" element.
HTMLTextFormControlElement::setInnerTextValue explicitly creates another EventAllowedScope to mark
the shadow tree into which the fragment is inserted safe.
(WebCore::HTMLElement::setOuterText):
* html/HTMLElement.h:
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::childrenChanged):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setInnerTextValue): See above (setInnerText).
* html/track/VTTCue.cpp:
(WebCore::VTTCue::createCueRenderingTree): Create EventAllowedScope for the cloned fragment here since
the VTT tree is never exposed to author scripts.
(WebCore::VTTCue::updateDisplayTree): Ditto.
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::ensureCustomFontData): Use EventAllowedScope to disable assertions only on
the new SVG document we just created instead of disabling for all DOM trees.
* svg/SVGScriptElement.cpp:
(WebCore::SVGScriptElement::childrenChanged):

LayoutTests:

Added regression tests for adopting or removing a child node of a script element.
The script must not run when nodes are adopted or removed.

* fast/html/script-must-not-run-when-child-is-adopted-expected.txt: Added.
* fast/html/script-must-not-run-when-child-is-adopted.html: Added.
* fast/html/script-must-not-run-when-child-is-removed-expected.txt: Added.
* fast/html/script-must-not-run-when-child-is-removed.html: Added.

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

3 years agoDocument should always have a Settings.
akling@apple.com [Thu, 9 Feb 2017 17:47:33 +0000 (17:47 +0000)]
Document should always have a Settings.
<https://webkit.org/b/120172>

Reviewed by Antti Koivisto.

Since a Document can't move between Frames, and it's either frameless
or partnered with a Frame provided at construction time, we know that
it will never need to switch between different Settings objects either.

Give Document a Ref<Settings> that contains either the Frame's Settings
or a default-constructed Settings object if frameless.
Document::settings() is promoted to a reference getter.

The bulk of this patch is removing now-unnecessary null checks.

* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory):
* Modules/plugins/PluginReplacement.h:
(WebCore::ReplacementPlugin::isEnabledBySettings):
* Modules/plugins/QuickTimePluginReplacement.h:
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::isEnabledBySettings):
* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::YouTubePluginReplacement::isEnabledBySettings):
* Modules/plugins/YouTubePluginReplacement.h:
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::constructCommon):
* bindings/js/CachedScriptFetcher.cpp:
(WebCore::CachedScriptFetcher::requestScriptWithCache):
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::appendSources):
(WebCore::CSSFontFace::webFontsShouldAlwaysFallBack):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::fallbackFontCount):
(WebCore::CSSFontSelector::fallbackFontAt):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertResize):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueFontFamily):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::StyleResolver):
(WebCore::StyleResolver::defaultStyleForElement):
(WebCore::StyleResolver::adjustRenderStyle):
(WebCore::StyleResolver::checkForGenericFamilyChange):
(WebCore::StyleResolver::initializeFontStyle):
* css/StyleResolver.h:
(WebCore::StyleResolver::settings):
(WebCore::StyleResolver::documentSettings): Deleted.
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::setReadyState):
(WebCore::Document::setVisualUpdatesAllowed):
(WebCore::Document::defaultCharsetForLegacyBindings):
(WebCore::Document::recalcStyle):
(WebCore::Document::implicitClose):
(WebCore::Document::minimumLayoutDelay):
(WebCore::Document::setDomain):
(WebCore::Document::audioPlaybackRequiresUserGesture):
(WebCore::Document::videoPlaybackRequiresUserGesture):
(WebCore::Document::storageBlockingStateDidChange):
(WebCore::Document::isTelephoneNumberParsingEnabled):
(WebCore::Document::initSecurityContext):
(WebCore::Document::initDNSPrefetch):
(WebCore::Document::getCachedLocale):
(WebCore::Document::shouldEnforceContentDispositionAttachmentSandbox):
(WebCore::Document::settings): Deleted.
* dom/Document.h:
(WebCore::Document::settings):
* dom/Element.cpp:
(WebCore::subpixelMetricsEnabled):
* dom/ExtensionStyleSheets.cpp:
(WebCore::ExtensionStyleSheets::pageUserSheet):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::dispatchErrorEvent):
* dom/ScriptableDocumentParser.cpp:
(WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::requestAnimationFrameEnabled):
* dom/make_names.pl:
(printConstructorInterior):
* editing/Editor.cpp:
* editing/markup.cpp:
(WebCore::createMarkupInternal):
* html/FTPDirectoryDocument.cpp:
(WebCore::createTemplateDocumentData):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::setActive):
(WebCore::HTMLAnchorElement::sendPings):
(WebCore::HTMLAnchorElement::treatLinkAsLiveForEventType):
* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::canEmbedJava):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext2d):
(WebCore::shouldEnableWebGL):
(WebCore::HTMLCanvasElement::shouldAccelerate):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::submitImplicitly):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::setLocation):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::updateImageControls):
* html/HTMLImageLoader.cpp:
(WebCore::HTMLImageLoader::sourceURI):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setupDateTimeChooserParameters):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory):
(WebCore::HTMLMediaElement::mediaPlayerAcceleratedCompositingEnabled):
(WebCore::HTMLMediaElement::enterFullscreen):
(WebCore::HTMLMediaElement::exitFullscreen):
(WebCore::HTMLMediaElement::mediaPlayerNeedsSiteSpecificHacks):
(WebCore::HTMLMediaElement::mediaPlayerNetworkInterfaceName):
(WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor):
(WebCore::HTMLMediaElement::doesHaveAttribute):
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::HTMLVideoElement):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::wirelessVideoPlaybackDisabled):
(WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
(WebCore::MediaElementSession::allowsAutomaticMediaDataLoading):
(WebCore::MediaElementSession::allowsPictureInPicture):
(WebCore::MediaElementSession::maximumMediaSourceBufferSize):
* html/parser/HTMLParserOptions.cpp:
(WebCore::HTMLParserOptions::HTMLParserOptions):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLink):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::toggleSimpleLineLayout):
* style/StyleFontSizeFunctions.cpp:
(WebCore::Style::computedFontSizeFromSpecifiedSize):
(WebCore::Style::fontSizeForKeyword):
(WebCore::Style::legacyFontSizeForPixelSize):
* style/StyleScope.cpp:
(WebCore::Style::Scope::collectActiveStyleSheets):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::usesDashboardBackwardCompatibilityMode):

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

3 years agoUse all cacheable speculatively loaded responses
antti@apple.com [Thu, 9 Feb 2017 17:36:58 +0000 (17:36 +0000)]
Use all cacheable speculatively loaded responses
https://bugs.webkit.org/show_bug.cgi?id=168052

Reviewed by Andreas Kling.

Source/WebCore:

* platform/network/CacheValidation.cpp:
(WebCore::isStatusCodeCacheableByDefault):
(WebCore::isStatusCodePotentiallyCacheable):

Moved here from WebKit2.

* platform/network/CacheValidation.h:

Source/WebKit2:

We currently only allow 200 responses. There is no reason not to use speculative responses
that have other cacheable status codes. This is helpful for 204s and 404s.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::makeStoreDecision):
(WebKit::NetworkCache::isStatusCodeCacheableByDefault): Deleted.
(WebKit::NetworkCache::isStatusCodePotentiallyCacheable): Deleted.

    Move to CacheValidation.h/cpp

* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):

    Allow all cacheable-by-default responses.

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

3 years ago[MediaStream] Remove legacy Navigator.webkitGetUserMedia
eric.carlson@apple.com [Thu, 9 Feb 2017 17:29:58 +0000 (17:29 +0000)]
[MediaStream] Remove legacy Navigator.webkitGetUserMedia
https://bugs.webkit.org/show_bug.cgi?id=168016
Source/WebCore:

Reviewed by Youenn Fablet.

No new tests, existing tests updated.

* WebCore.xcodeproj/project.pbxproj: NavigatorUserMedia.
* DerivedSources.make: Ditto.
* CMakeLists.txt: Ditto.
* Modules/mediastream/NavigatorUserMedia.idl: Removed.
* Modules/mediastream/NavigatorUserMedia.js: Removed.
* WebCore.xcodeproj/project.pbxproj:
* page/Navigator.idl: Add some whitespace to force derived sources to be rebuild correctly.

Source/WebInspectorUI:

Reviewed by Youenn Fablet.

* UserInterface/Models/NativeFunctionParameters.js:

LayoutTests:

<rdar://problem/30431544>

Reviewed by Youenn Fablet.

Update valid tests to use navigator.mediaDevices.getUserMedia. Remove tests
specific to Navigator.webkitGetUserMedia.

* fast/mediastream/RTCPeerConnection-AddRemoveStream.html:
* fast/mediastream/argument-types.html: Removed.
* fast/mediastream/delayed-permission-allowed.html:
* fast/mediastream/delayed-permission-denied.html:
* fast/mediastream/enabled-expected.txt:
* fast/mediastream/error.html:
* fast/mediastream/getusermedia.html: Removed.
* fast/mediastream/script-tests/argument-types.js: Removed.
* fast/mediastream/script-tests/enabled.js:
(hasGetUserMediaProperty):
* fast/mediastream/success.html:
* fast/mediastream/webkitGetUserMedia-shadowing-then.html: Removed.
* http/tests/media/media-stream/disconnected-frame-already-expected.txt:
* http/tests/media/media-stream/disconnected-frame-already.html:
* http/tests/media/media-stream/disconnected-frame-permission-denied.html:
* http/tests/media/media-stream/disconnected-frame.html:

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

3 years ago[Modern Media Controls] Tapping the skip back button on iOS inline media controls...
commit-queue@webkit.org [Thu, 9 Feb 2017 17:13:12 +0000 (17:13 +0000)]
[Modern Media Controls] Tapping the skip back button on iOS inline media controls make the controls disappear
https://bugs.webkit.org/show_bug.cgi?id=168049
<rdar://problem/30442660>

Patch by Antoine Quint <graouts@apple.com> on 2017-02-09
Reviewed by Eric Carlson.

Source/WebCore:

Calling elementAtPoint() on the Document will not return an element in the ShadowRoot,
we need to call it on the ShadowRoot. So we now iterate over ancestors of the controls
bar to find the ShadowRoot, if any, and check whether the tapped element is contained
within the controls bar. We only fade the controls bar out if the tapped element is
outside of the controls bar hierarchy.

Test: media/modern-media-controls/media-controller/media-controller-ios-do-not-hide-controls-when-tapping-button.html

* Modules/modern-media-controls/controls/controls-bar.js:
(ControlsBar.prototype.gestureRecognizerStateDidChange):

LayoutTests:

Add a new iOS-specific test that checks that tapping a button does not automatically dismisses the controls bar.

* media/modern-media-controls/media-controller/media-controller-ios-do-not-hide-controls-when-tapping-button-expected.txt: Added.
* media/modern-media-controls/media-controller/media-controller-ios-do-not-hide-controls-when-tapping-button.html: Added.
* platform/mac/TestExpectations:

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

3 years agoFix i386 libwebrtc build
achristensen@apple.com [Thu, 9 Feb 2017 16:37:17 +0000 (16:37 +0000)]
Fix i386 libwebrtc build
https://bugs.webkit.org/show_bug.cgi?id=168038

Reviewed by Geoffrey Garen.

Unfortunately, 32-bit ObjC can't use all the coolest new features of ObjC.
Fortunately, we can move things around a bit to become valid old ObjC.

* Source/webrtc/sdk/objc/Framework/Classes/RTCAVFoundationVideoSource.mm:
* Source/webrtc/sdk/objc/Framework/Classes/RTCAudioSource.mm:
* Source/webrtc/sdk/objc/Framework/Classes/RTCFileLogger.mm:
* Source/webrtc/sdk/objc/Framework/Classes/RTCI420Shader.mm:
* Source/webrtc/sdk/objc/Framework/Classes/RTCMediaConstraints.mm:
* Source/webrtc/sdk/objc/Framework/Classes/RTCMediaSource+Private.h:
* Source/webrtc/sdk/objc/Framework/Classes/RTCMediaSource.mm:
* Source/webrtc/sdk/objc/Framework/Classes/RTCMediaStream.mm:
* Source/webrtc/sdk/objc/Framework/Classes/RTCMediaStreamTrack+Private.h:
* Source/webrtc/sdk/objc/Framework/Classes/RTCMediaStreamTrack.mm:
* Source/webrtc/sdk/objc/Framework/Classes/RTCOpenGLVideoRenderer.h:
* Source/webrtc/sdk/objc/Framework/Classes/RTCOpenGLVideoRenderer.mm:
* Source/webrtc/sdk/objc/Framework/Classes/RTCPeerConnectionFactory.mm:
* Source/webrtc/sdk/objc/Framework/Classes/RTCRtpReceiver.mm:
* Source/webrtc/sdk/objc/Framework/Classes/RTCRtpSender.mm:
* Source/webrtc/sdk/objc/Framework/Classes/RTCShader.h:
* Source/webrtc/sdk/objc/Framework/Classes/RTCVideoFrame.mm:
* Source/webrtc/sdk/objc/Framework/Classes/RTCVideoRendererAdapter.h:
* Source/webrtc/sdk/objc/Framework/Classes/RTCVideoRendererAdapter.mm:
* Source/webrtc/sdk/objc/Framework/Classes/RTCVideoSource.mm:
* Source/webrtc/sdk/objc/Framework/Classes/RTCVideoTrack.mm:
* Source/webrtc/sdk/objc/Framework/Classes/avfoundationvideocapturer.mm:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCAVFoundationVideoSource.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCAudioSource.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCAudioTrack.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCConfiguration.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCDataChannelConfiguration.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCFileLogger.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCIceCandidate.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCIceServer.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCLegacyStatsReport.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCMediaConstraints.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCMediaSource.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCMediaStream.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCMediaStreamTrack.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCMetricsSampleInfo.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCPeerConnectionFactory.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCRtpCodecParameters.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCRtpEncodingParameters.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCRtpParameters.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCRtpReceiver.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCRtpSender.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCSessionDescription.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoFrame.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoSource.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoTrack.h:
Make code compile for i386.
* libwebrtc.xcodeproj/project.pbxproj:
Added missing headers so Xcode can search them.

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

3 years agoConfigure MockRealtimeAudioSourceMac to generate stereo audio
jer.noble@apple.com [Thu, 9 Feb 2017 16:33:06 +0000 (16:33 +0000)]
Configure MockRealtimeAudioSourceMac to generate stereo audio
https://bugs.webkit.org/show_bug.cgi?id=168027

Reviewed by Eric Carlson.

Update MockRealtimeAudioSourceMac to generate stereo audio.

First, because the pattern of creating a AudioBufferList structure (with all it's quirks and
weird requirements) was repeated multiple places, add a new wrapper around ABL called
WebAudioBufferList which takes care of correctly initializing the ABL structure and manages
the lifetime of its data members.

* WebCore.xcodeproj/project.pbxproj:
* platform/audio/PlatformAudioData.h: Added.
(WebCore::PlatformAudioData::kind):
* platform/audio/WebAudioBufferList.cpp: Added.
(WebCore::WebAudioBufferList::WebAudioBufferList):
(WebCore::WebAudioBufferList::buffers):
(WebCore::WebAudioBufferList::bufferCount):
(WebCore::WebAudioBufferList::buffer):
* platform/audio/WebAudioBufferList.h: Added.
(WebCore::WebAudioBufferList::list):
(WebCore::WebAudioBufferList::operator AudioBufferList&):
(WebCore::WebAudioBufferList::kind):
(isType):

Then update existing code to work in terms of WebAudioBufferList:

* platform/audio/mac/AudioSampleBufferList.cpp:
(WebCore::AudioSampleBufferList::AudioSampleBufferList):
(WebCore::AudioSampleBufferList::mixFrom):
(WebCore::AudioSampleBufferList::copyFrom):
(WebCore::AudioSampleBufferList::copyTo):
(WebCore::AudioSampleBufferList::reset):
(WebCore::AudioSampleBufferList::configureBufferListForStream): Deleted.
* platform/audio/mac/AudioSampleBufferList.h:
(WebCore::AudioSampleBufferList::bufferList):
* platform/audio/mac/AudioSampleDataSource.cpp:
(WebCore::AudioSampleDataSource::pushSamples):
* platform/audio/mac/AudioSampleDataSource.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::audioSamplesAvailable):
* platform/mediastream/RealtimeMediaSource.h:
(WebCore::RealtimeMediaSource::Observer::audioSamplesAvailable):
* platform/mediastream/mac/AVAudioCaptureSource.h:
* platform/mediastream/mac/AVAudioCaptureSource.mm:
(WebCore::AVAudioCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:

Finally, actually update MockRealtimeAudioSource to emit stereo samples. Importantly, set
the correct values for the m_streamFormat; mBytesPerFrame and mBytesPerPacket are not
multiplied by the channelCount. When generating audio, write to both channels of data.

* platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers):
(WebCore::MockRealtimeAudioSourceMac::reconfigure):
(WebCore::MockRealtimeAudioSourceMac::render):

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

3 years agoNullptr crash under styleForFirstLetter
antti@apple.com [Thu, 9 Feb 2017 16:32:13 +0000 (16:32 +0000)]
Nullptr crash under styleForFirstLetter
https://bugs.webkit.org/show_bug.cgi?id=167756
rdar://problem/30029354

Reviewed by Zalan Bujtas.

Don't know how we get here. Paper over the crash.

* rendering/RenderBlock.cpp:
(WebCore::styleForFirstLetter):

    Use parent first line style if we compute null style for the first letter renderer.

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

3 years agoUnreviewed GTK+ gardening. Skip tests that require UIScriptController::zoomToScale.
carlosgc@webkit.org [Thu, 9 Feb 2017 16:22:13 +0000 (16:22 +0000)]
Unreviewed GTK+ gardening. Skip tests that require UIScriptController::zoomToScale.

* platform/gtk/TestExpectations:

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

3 years ago[Modern Media Controls] Playing an <audio> element on iOS makes the controls disappear
graouts@webkit.org [Thu, 9 Feb 2017 16:20:18 +0000 (16:20 +0000)]
[Modern Media Controls] Playing an <audio> element on iOS makes the controls disappear
https://bugs.webkit.org/show_bug.cgi?id=168047
<rdar://problem/30441939>

Reviewed by Eric Carlson.

Source/WebCore:

The controls bar auto-hide behavior is disabled for <audio> elements, but on iOS we have
a TapGestureRecognizer to identify when controls are tapped to toggle controls visibility.
This gesture recognizer would be on at all times, but it should only be enabled when
fadesToIdle is set to true.

Test: media/modern-media-controls/media-controller/media-controller-ios-only-enable-tap-gesture-recognizer-with-fades-when-idle.html

* Modules/modern-media-controls/controls/controls-bar.js:
(ControlsBar.prototype.set fadesWhileIdle):

LayoutTests:

Add a new iOS-specific test that checks the TapGestureRecognizer is only enabled when
fadesToIdle is true.

* media/modern-media-controls/media-controller/media-controller-ios-only-enable-tap-gesture-recognizer-with-fades-when-idle-expected.txt: Added.
* media/modern-media-controls/media-controller/media-controller-ios-only-enable-tap-gesture-recognizer-with-fades-when-idle.html: Added.
* platform/mac/TestExpectations:

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

3 years agoImprove W3C importer command line options
commit-queue@webkit.org [Thu, 9 Feb 2017 16:03:05 +0000 (16:03 +0000)]
Improve W3C importer command line options
https://bugs.webkit.org/show_bug.cgi?id=167448

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-09
Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

* resources/TestRepositories: Skipped module generation and gitignore generation for the moment.

Tools:

Making the list of test paths to import the main arguments of the script.
Allow passing the source directory to import as a -s option.
Adding a warning when given test paths are skipped by default in ImportExpectations.

Making link conversion off by default when importing from a specific directory since this script is mostly used with web-platform-tests.
Link conversion rules do not change when imported tests are downloaded by the script.

* Scripts/webkitpy/w3c/test_importer.py:
(main):
(parse_args):
(TestImporter.__init__):
(TestImporter.do_import):
(TestImporter):
(TestImporter.check_imported_expectations):

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

3 years ago[Modern Media Controls] <audio> element does not show any background on iOS
commit-queue@webkit.org [Thu, 9 Feb 2017 15:59:22 +0000 (15:59 +0000)]
[Modern Media Controls] <audio> element does not show any background on iOS
https://bugs.webkit.org/show_bug.cgi?id=168046
<rdar://problem/30441872>

Patch by Antoine Quint <graouts@apple.com> on 2017-02-09
Reviewed by Eric Carlson.

Source/WebCore:

Use a solid gray background for <audio> elements on iOS.

Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-audio-background.html

* Modules/modern-media-controls/controls/ios-inline-media-controls.css:
(:host(audio) .media-controls.ios.inline > .controls-bar:before):

LayoutTests:

Add an iOS-specific test that checks that <audio> elements have a solid gray background.

* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-audio-background-expected.txt: Added.
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-audio-background.html: Added.
* platform/mac/TestExpectations:

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

3 years ago[Modern Media Controls] Controls fail to instantiate in an XHTML document
commit-queue@webkit.org [Thu, 9 Feb 2017 15:13:29 +0000 (15:13 +0000)]
[Modern Media Controls] Controls fail to instantiate in an XHTML document
https://bugs.webkit.org/show_bug.cgi?id=168045
<rdar://problem/30290095>

Patch by Antoine Quint <graouts@apple.com> on 2017-02-09
Reviewed by Eric Carlson.

Source/WebCore:

Always use valid HTML and XHTML strings when creating HTML elements.

Test: media/modern-media-controls/media-controller/media-controller-in-xhtml.xhtml

* Modules/modern-media-controls/controls/button.js:
(Button):
* Modules/modern-media-controls/controls/buttons-container.js:
* Modules/modern-media-controls/controls/controls-bar.js:
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
* Modules/modern-media-controls/controls/media-controls.js:
* Modules/modern-media-controls/controls/slider.js:
* Modules/modern-media-controls/controls/status-label.js:
* Modules/modern-media-controls/controls/time-control.js:
* Modules/modern-media-controls/controls/time-label.js:
* Modules/modern-media-controls/controls/tracks-panel.js:

LayoutTests:

Add a new test to check that controls are created correctly when the media element
is hosted in an XHTML document.

* media/modern-media-controls/media-controller/media-controller-in-xhtml-expected.txt: Added.
* media/modern-media-controls/media-controller/media-controller-in-xhtml.xhtml: Added.

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

3 years agoUnreviewed GTK+ gardening. Update tests that pass now with the URLParser enabled.
carlosgc@webkit.org [Thu, 9 Feb 2017 14:43:14 +0000 (14:43 +0000)]
Unreviewed GTK+ gardening. Update tests that pass now with the URLParser enabled.

* platform/gtk/TestExpectations:
* platform/gtk/fast/loader/redirect-to-invalid-url-using-javascript-calls-policy-delegate-expected.txt: Removed.
* platform/gtk/fast/loader/redirect-to-invalid-url-using-meta-refresh-calls-policy-delegate-expected.txt: Removed.
* platform/gtk/fast/loader/url-parse-1-expected.txt: Removed.
* platform/gtk/fast/loader/window-open-to-invalid-url-calls-policy-delegate-expected.txt: Removed.
* platform/gtk/fast/url/invalid-idn-expected.txt: Removed.
* platform/gtk/fast/url/segments-userinfo-vs-host-expected.txt: Removed.
* platform/gtk/fast/url/tab-and-newline-stripping-expected.txt: Removed.
* platform/gtk/fast/url/url-credentials-escaping-expected.txt: Removed.

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

3 years agoUnreviewed, fix typo in comment
mcatanzaro@igalia.com [Thu, 9 Feb 2017 13:57:45 +0000 (13:57 +0000)]
Unreviewed, fix typo in comment

* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::replaceDocument):

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

3 years agoDisallow accelerated rendering for ginormous 2D canvases.
akling@apple.com [Thu, 9 Feb 2017 13:55:41 +0000 (13:55 +0000)]
Disallow accelerated rendering for ginormous 2D canvases.
<https://webkit.org/b/167968>
<rdar://problem/30119483>

Reviewed by Antti Koivisto.

Source/WebCore:

Add a "maximumAccelerated2dCanvasSize" setting that defaults to 5120x2880
which is the 5K resolution for 16:9.

Also added a way to include the "accelerates drawing" flag in layer tree dumps.

Test: compositing/canvas/accelerated-canvas-compositing-size-limit.html

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::shouldAccelerate):
* page/Frame.h:
* page/Settings.in:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::dumpProperties):
* platform/graphics/GraphicsLayerClient.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerTreeAsText):
* testing/Internals.cpp:
(WebCore::toLayerTreeFlags):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Add a simple test that documents the fact that we no longer accelerate canvases
larger than 5120x2880.

* compositing/canvas/accelerated-canvas-compositing-size-limit-expected.txt: Added.
* compositing/canvas/accelerated-canvas-compositing-size-limit.html: Added.
* platform/ios-simulator/compositing/canvas/accelerated-canvas-compositing-size-limit-expected.txt: Added.

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

3 years agoUnreviewed GTK+ gardening. Add expectations for more tests that require drag and...
carlosgc@webkit.org [Thu, 9 Feb 2017 13:52:56 +0000 (13:52 +0000)]
Unreviewed GTK+ gardening. Add expectations for more tests that require drag and drop.

* platform/gtk/TestExpectations:

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

3 years agoUnreviewed. Fix gtk-doc warning
tpopela@redhat.com [Thu, 9 Feb 2017 12:20:39 +0000 (12:20 +0000)]
Unreviewed. Fix gtk-doc warning

html/WebKitSettings.html:4435: warning: no link for: 'api-index-2.3' -> (2.3).

* UIProcess/API/gtk/WebKitSettings.cpp:
(webkit_settings_class_init):

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

3 years agoRemove most cases of #if ENABLE(CACHE_PARTITIONING)
antti@apple.com [Thu, 9 Feb 2017 11:09:28 +0000 (11:09 +0000)]
Remove most cases of #if ENABLE(CACHE_PARTITIONING)
https://bugs.webkit.org/show_bug.cgi?id=167990

Reviewed by Sam Weinig.

Source/WebCore:

We'll just return empty string for the partition if partitioning is not enabled.

* html/DOMURL.cpp:
(WebCore::DOMURL::revokeObjectURL):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResource):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::url):
(WebCore::CachedResource::cachePartition):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
(WebCore::CachedResourceLoader::requestResource):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setDomainForCachePartition):
* loader/cache/CachedResourceRequest.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::add):
(WebCore::MemoryCache::revalidationSucceeded):
(WebCore::MemoryCache::resourceForRequestImpl):
(WebCore::MemoryCache::addImageToCache):
(WebCore::MemoryCache::removeImageFromCache):
(WebCore::MemoryCache::remove):
(WebCore::MemoryCache::removeResourcesWithOrigin):
(WebCore::MemoryCache::removeResourcesWithOrigins):
(WebCore::MemoryCache::getOriginsWithCache):
(WebCore::MemoryCache::originsWithCache):
* loader/cache/MemoryCache.h:
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::domainForCachePartition):
* page/SecurityOrigin.h:
* platform/SchemeRegistry.cpp:
(WebCore::cachePartitioningSchemes):
(WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme):
* platform/SchemeRegistry.h:
* platform/ios/WebCoreSystemInterfaceIOS.mm:
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setAsIsolatedCopy):
(WebCore::ResourceRequestBase::setCachePartition):
(WebCore::ResourceRequestBase::partitionName):
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::cachePartition):
(WebCore::ResourceRequestBase::setDomainForCachePartition):
* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::cachePartition): Deleted.
(WebCore::ResourceRequest::setCachePartition): Deleted.
(WebCore::ResourceRequest::setDomainForCachePartition): Deleted.
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::ResourceRequest::partitionName): Deleted.
(WebCore::ResourceRequest::doPlatformSetAsIsolatedCopy): Deleted.
* platform/network/cf/ResourceResponse.h:
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::ResourceRequest::doUpdatePlatformRequest):
* testing/Internals.cpp:
(WebCore::Internals::isLoadingFromMemoryCache):

Source/WebKit/mac:

* Misc/WebCache.mm:
(+[WebCache addImageToCache:forURL:forFrame:]):
(+[WebCache removeImageFromCacheForURL:forFrame:]):
* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

Source/WebKit2:

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::makeCacheKey):
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::constructRevalidationRequest):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ResourceRequest>::encode):
(IPC::ArgumentCoder<ResourceRequest>::decode):
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextRegisterURLSchemeAsCachePartitioned):
* UIProcess/WebProcessPool.cpp:
(WebKit::m_hiddenPageThrottlingTimer):
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::registerURLSchemeAsCachePartitioned):
* UIProcess/WebProcessPool.h:
* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::registerURLSchemeAsCachePartitioned):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

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

3 years agoAdd Web Bluetooth as Not Considering
rniwa@webkit.org [Thu, 9 Feb 2017 10:41:16 +0000 (10:41 +0000)]
Add Web Bluetooth as Not Considering
https://bugs.webkit.org/show_bug.cgi?id=168042

Reviewed by Yusuke Suzuki.

Add Web Bluetooth as a feature not being considered to be implemented in WebKit.

* features.json:

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

3 years agoRemove svn:executable property from headers.
achristensen@apple.com [Thu, 9 Feb 2017 08:15:17 +0000 (08:15 +0000)]
Remove svn:executable property from headers.

* Source/webrtc/base/sigslottester.h: Removed property svn:executable.
* Source/webrtc/modules/video_processing/util/skin_detection.h: Removed property svn:executable.

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

3 years agoDon't migrate WebKit DOM headers in MigrateHeaders.make
ap@apple.com [Thu, 9 Feb 2017 06:07:06 +0000 (06:07 +0000)]
Don't migrate WebKit DOM headers in MigrateHeaders.make
https://bugs.webkit.org/show_bug.cgi?id=167608

Source/WebKit:

Reviewed by Darin Adler.

Stop migrating DOM headers that are now in WebKit.

* WebKit.xcodeproj/project.pbxproj: Marked DOM headers as private, so that Xcode
takes care of making them available as SPI.

Source/WebKit/mac:

Reviewed by Darin Adler.

Stop migrating DOM headers that are now in WebKit.

* DOM/DOMDOMImplementation.h: Removed.
* DOM/DOMDOMImplementation.mm: Removed.
* DOM/DOMDOMImplementationInternal.h: Removed.
* DOM/DOMDOMTokenList.h: Removed.
* DOM/DOMDOMTokenList.mm: Removed.
* DOM/DOMDOMTokenListInternal.h: Removed.
* DOM/DOMImplementation.h: Copied from Source/WebKit/mac/DOM/DOMDOMImplementation.h.
* DOM/DOMImplementation.mm: Copied from Source/WebKit/mac/DOM/DOMDOMImplementation.mm.
* DOM/DOMImplementationInternal.h: Copied from Source/WebKit/mac/DOM/DOMDOMImplementationInternal.h.
* DOM/DOMTokenList.h: Copied from Source/WebKit/mac/DOM/DOMDOMTokenList.h.
* DOM/DOMTokenList.mm: Copied from Source/WebKit/mac/DOM/DOMDOMTokenList.mm.
* DOM/DOMTokenListInternal.h: Copied from Source/WebKit/mac/DOM/DOMDOMTokenListInternal.h.
As the files are not in WebCore any more, there is no need to differentiate from
WebCore internal headers with the same name. This makes it possible to make these
headers private using Xcode mechanisms, as opposed to copying with a shell script.

* DOM/DOMElement.mm: Removed "using namespace WebCore". Other DOM implementation
files don't have it.

* DOM/DOMCore.h:
* DOM/DOMDocument.mm:
* DOM/DOMHTMLAnchorElement.mm:
* DOM/DOMHTMLAreaElement.mm:
* DOM/DOMHTMLLinkElement.mm:
* DOM/DOMUtility.mm:
No more "DOMDOM".

* WebKit.exp:
No more "DOMDOM". DOMDOMTokenList was not directly exposed via an SPI header, so
renaming it is likely to be safe.

* MigrateHeaders.make: Don't migrate WebKit headers.

* Configurations/WebKitLegacy.xcconfig: Don't include two iOS specific SPI headers
on macOS.

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

3 years agoUpdate web-platform-tests resources
cdumez@apple.com [Thu, 9 Feb 2017 05:52:02 +0000 (05:52 +0000)]
Update web-platform-tests resources
https://bugs.webkit.org/show_bug.cgi?id=168026

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* resources/web-platform-tests-modules.json:
* resources/web-platform-tests-modules/darobin/webidl2.js/archive/bd216bcd5596d60734450adc938155deab1e1a80.tar.gz: Removed.
* resources/web-platform-tests-modules/dontcallmedom/widlproc/archive/4ef8dde69c0ba3d0167bccfa2775eea7f0d6c7fe.tar.gz: Removed.
* resources/web-platform-tests-modules/w3c/testharness.js/archive/873f9680aff66553f84d38f21a038c4534cc2789.tar.gz: Removed.
* web-platform-tests/.gitignore:
* web-platform-tests/XMLHttpRequest/interfaces-expected.txt:
* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/fetch/api/headers/headers-idl-expected.txt:
* web-platform-tests/html/dom/interfaces-expected.txt:
* web-platform-tests/html/webappapis/animation-frames/idlharness-expected.txt:
* web-platform-tests/resources/LICENSE: Added.
* web-platform-tests/resources/idlharness.js: Added.
(constValue):
(minOverloadLength):
(throwOrReject):
(awaitNCallbacks):
(return.fround):
(fround):
(self.IdlArray):
(IdlArray.prototype.add_idls):
(IdlArray.prototype.add_untested_idls):
(IdlArray.prototype.internal_add_idls):
(IdlArray.prototype.add_objects):
(IdlArray.prototype.prevent_multiple_testing):
(IdlArray.prototype.recursively_get_implements):
(exposed_in):
(IdlArray.prototype.test):
(IdlArray.prototype.assert_type_is):
(IdlObject):
(IdlObject.prototype.test):
(IdlObject.prototype.has_extended_attribute):
(IdlInterface):
(IdlInterface.prototype.is_callback):
(IdlInterface.prototype.has_constants):
(IdlInterface.prototype.is_global):
(IdlInterface.prototype.test):
(IdlInterface.prototype.test_self):
(IdlInterface.prototype.test_member_const):
(IdlInterface.prototype.test_member_attribute):
(IdlInterface.prototype.test_member_operation):
(IdlInterface.prototype.do_member_operation_asserts):
(IdlInterface.prototype.add_iterable_members):
(IdlInterface.prototype.test_member_iterable):
(IdlInterface.prototype.test_member_stringifier):
(IdlInterface.prototype.test_members):
(IdlInterface.prototype.test_object):
(IdlInterface.prototype.test_primary_interface_of):
(IdlInterface.prototype.test_interface_of):
(IdlInterface.prototype.has_stringifier):
(IdlInterface.prototype.do_interface_attribute_asserts):
(IdlInterfaceMember):
(create_suitable_object):
(IdlEnum):
(IdlTypedef):
* web-platform-tests/resources/readme.md: Added.
* web-platform-tests/resources/testharness.js: Added.
(WindowTestEnvironment):
(WindowTestEnvironment.prototype._dispatch):
(WindowTestEnvironment.prototype._forEach_windows):
(WindowTestEnvironment.prototype.on_tests_ready):
(WindowTestEnvironment.prototype.setup_messages):
(WindowTestEnvironment.prototype.next_default_test_name):
(WindowTestEnvironment.prototype.on_new_harness_properties):
(WindowTestEnvironment.prototype.add_on_loaded_callback):
(WindowTestEnvironment.prototype.test_timeout):
(WindowTestEnvironment.prototype.global_scope):
(WorkerTestEnvironment):
(WorkerTestEnvironment.prototype._dispatch):
(WorkerTestEnvironment.prototype._add_message_port):
(WorkerTestEnvironment.prototype.next_default_test_name):
(WorkerTestEnvironment.prototype.on_new_harness_properties):
(WorkerTestEnvironment.prototype.on_tests_ready):
(WorkerTestEnvironment.prototype.add_on_loaded_callback):
(WorkerTestEnvironment.prototype.test_timeout):
(WorkerTestEnvironment.prototype.global_scope):
(DedicatedWorkerTestEnvironment):
(DedicatedWorkerTestEnvironment.prototype.on_tests_ready):
(SharedWorkerTestEnvironment):
(SharedWorkerTestEnvironment.prototype.on_tests_ready):
(ServiceWorkerTestEnvironment):
(ServiceWorkerTestEnvironment.prototype.add_on_loaded_callback):
(create_test_environment):
(is_shared_worker):
(is_service_worker):
(test):
(async_test):
(promise_test):
(this.wait_for):
(EventWatcher):
(setup):
(done):
(generate_tests):
(step_timeout):
(truncate):
(is_node):
(format_value):
* web-platform-tests/resources/webidl2/LICENSE: Added.
* web-platform-tests/resources/webidl2/README.md: Added.
* web-platform-tests/resources/webidl2/lib/webidl2.js: Added.
(tokenise):
(WebIDLParseError):
(WebIDLParseError.prototype.toString):
(error):
(consume):
(ws):
(all_ws):
(integer_type):
(float_type):
(primitive_type):
(const_value):
(type_suffix):
(single_type):
(union_type):
(type):
(argument):
(argument_list):
(type_pair):
(simple_extended_attr):
(extended_attrs):
(default_):
(const_):
(inheritance):
(operation_rest):
(callback):
(attribute):
(return_type):
(operation):
(identifiers):
(serialiser):
(iterable_type):
(readonly_iterable_type):
(iterable):
(interface_):
(partial):
(dictionary):
(exception):
(enum_):
(parse):
* web-platform-tests/resources/webidl2/lib/writer.js: Added.
(noop):
(literal):
(wsPea):
(wsTPea):
(lineComment):
(multilineComment):
(type):
(const_value):
(argument):
(args):
(make_ext_at):
(extended_attributes):
(operation):
(attribute):
(interface_):
(dictionary):
(field):
(exception):
(const_):
(typedef):
(implements_):
(callback):
(enum_):
(dispatch):
(iterate):
(write):
(obj.write):
* web-platform-tests/url/interfaces-expected.txt:

Tools:

Stop copying testharness.js from resources/ to web-platform-tests/resources.

* Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:
(WebPlatformTestServer._copy_webkit_test_files):

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

3 years agoPut names on more UIViews for ease of debugging
simon.fraser@apple.com [Thu, 9 Feb 2017 05:22:51 +0000 (05:22 +0000)]
Put names on more UIViews for ease of debugging
https://bugs.webkit.org/show_bug.cgi?id=168035

Reviewed by Tim Horton.

Source/WebCore:

Name the page overlay layers.

* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::createRootLayersIfNeeded):
(WebCore::PageOverlayController::installPageOverlay):

Source/WebKit2:

Put names on the various bare UIViews that we create.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::showPaintRect):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):

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

3 years agoRebaseline emoji tests for ios-simulator.
ryanhaddad@apple.com [Thu, 9 Feb 2017 05:10:11 +0000 (05:10 +0000)]
Rebaseline emoji tests for ios-simulator.

Unreviewed test gardening.

* platform/ios-simulator/editing/deleting/delete-emoji-expected.txt:
* platform/ios-simulator/fast/text/emoji-expected.txt:

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

3 years agoUnreviewed, rolling out r211912.
commit-queue@webkit.org [Thu, 9 Feb 2017 04:49:25 +0000 (04:49 +0000)]
Unreviewed, rolling out r211912.
https://bugs.webkit.org/show_bug.cgi?id=168034

http/tests/media/media-stream/disconnected-frame-permission-
denied.html should be updated (Requested by youenn on
#webkit).

Reverted changeset:

"[MediaStream] Remove legacy Navigator.webkitGetUserMedia"
https://bugs.webkit.org/show_bug.cgi?id=168016
http://trac.webkit.org/changeset/211912

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

3 years agoHTML Link elements should load data URLs as same origin
commit-queue@webkit.org [Thu, 9 Feb 2017 02:50:00 +0000 (02:50 +0000)]
HTML Link elements should load data URLs as same origin
https://bugs.webkit.org/show_bug.cgi?id=168032
<rdar://problem/30275036>

Patch by Youenn Fablet <youennf@gmail.com> on 2017-02-08
Reviewed by Alex Christensen.

Source/WebCore:

Test: fast/dom/data-url-css-link-element-cors-active.html

Making CSS data URLs resources considered as same origin when loaded through link elements.
In the future, we should consider remove the data URL same origin flag and fully align with the fetch and HTML spec.

* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):

LayoutTests:

* fast/dom/data-url-css-link-element-cors-active-expected.txt: Added.
* fast/dom/data-url-css-link-element-cors-active.html: Added.

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

3 years agoDon't re-export PluginData.h from WebKit
aakash_jain@apple.com [Thu, 9 Feb 2017 02:13:51 +0000 (02:13 +0000)]
Don't re-export PluginData.h from WebKit
https://bugs.webkit.org/show_bug.cgi?id=168020

Reviewed by Alexey Proskuryakov.

* MigrateHeaders.make: Removed PluginData.h

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

3 years agoCustom protocols should not continue loading after a network process crash
aestes@apple.com [Thu, 9 Feb 2017 01:57:21 +0000 (01:57 +0000)]
Custom protocols should not continue loading after a network process crash
https://bugs.webkit.org/show_bug.cgi?id=168028
<rdar://problem/27607520>

Reviewed by Brady Eidson.

Source/WebKit2:

WKCustomProtocolLoaders are meant to be owned by CustomProtocolManagerProxy and have their
loads cancelled when CustomProtocolManagerProxy is destroyed. However, WKCustomProtocolLoader
creates a NSURLConnection for which it is the client, so NSURLConnection retains it for the
duration of the load.

These loaders should be explicitly cancelled when their CustomProtocolManagerProxy is destroyed.

New API test: WebKit2CustomProtocolsTest.CloseDuringCustomProtocolLoad

* UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
(-[WKCustomProtocolLoader customProtocolManagerProxyDestroyed]): Added. Cancels the
_urlConnection and sets _customProtocolManagerProxy to nullptr.
(WebKit::CustomProtocolManagerProxy::~CustomProtocolManagerProxy):
Called -customProtocolManagerProxyDestroyed on every loader in m_loaderMap.

Tools:

* TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm:
(processGroup):
(-[CloseWhileStartingProtocol startLoading]):
(-[CloseWhileStartingProtocol stopLoading]):
(TestWebKitAPI::runTest):
(TestWebKitAPI::TEST):

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

3 years ago[Cocoa] WKRemoteObjectCoder doesn’t handle CGSize
mitz@apple.com [Thu, 9 Feb 2017 01:56:26 +0000 (01:56 +0000)]
[Cocoa] WKRemoteObjectCoder doesn’t handle CGSize
https://bugs.webkit.org/show_bug.cgi?id=168031

Reviewed by Tim Horton.

Source/WebKit2:

* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(encodeInvocationArguments): Encode CGSize by encoding two NSNumbers. Somewhat sadly,
  +[NSValue valueWithCGSize:] is not available in macOS.
(decodeInvocationArguments): Decode wrapped numbers.

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistry.h:
* TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistry.mm:
(TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistryPlugIn.mm:
(-[RemoteObjectRegistryPlugIn takeSize:completionHandler:]):

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

3 years agoREGRESSION (r193286): Promise chain no longer prevent UI refresh
weinig@apple.com [Thu, 9 Feb 2017 01:42:55 +0000 (01:42 +0000)]
REGRESSION (r193286): Promise chain no longer prevent UI refresh
<rdar://problem/28062149>
https://bugs.webkit.org/show_bug.cgi?id=161291

Reviewed by Geoffrey Garen.

LayoutTests/imported/w3c:

* web-platform-tests/custom-elements/adopted-callback-expected.txt:
* web-platform-tests/custom-elements/upgrading-expected.txt:
* web-platform-tests/html/webappapis/scripting/event-loops/microtask_after_script-expected.txt:
Update results for improved promise support.

Source/WebCore:

Add new subtest to js/dom/Promise.html

* dom/Microtasks.cpp:
(WebCore::MicrotaskQueue::append):
(WebCore::MicrotaskQueue::remove):
(WebCore::MicrotaskQueue::performMicrotaskCheckpoint):
* dom/Microtasks.h:
The microtask queue needs to be completely drained, even of new microtasks added while
the previous task was run. Remove the m_tasksAppendedDuringMicrotaskCheckpoint as it is
no longer needed.

LayoutTests:

* js/dom/Promise.html:
Add a new subtest that ensures the ordering of multiple thenables and a setTimeout.

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

3 years ago[MediaStream] Remove legacy Navigator.webkitGetUserMedia
eric.carlson@apple.com [Thu, 9 Feb 2017 01:30:56 +0000 (01:30 +0000)]
[MediaStream] Remove legacy Navigator.webkitGetUserMedia
https://bugs.webkit.org/show_bug.cgi?id=168016

Reviewed by Youenn Fablet.

Source/WebCore:

No new tests, existing tests updated.

* WebCore.xcodeproj/project.pbxproj: NavigatorUserMedia.
* DerivedSources.make: Ditto.
* CMakeLists.txt: Ditto.
* Modules/mediastream/NavigatorUserMedia.idl: Removed.
* Modules/mediastream/NavigatorUserMedia.js: Removed.
* WebCore.xcodeproj/project.pbxproj:
* page/Navigator.idl: Add some whitespace to force derived sources to be rebuild correctly.

Source/WebInspectorUI:

* UserInterface/Models/NativeFunctionParameters.js:

LayoutTests:

Update valid tests to use navigator.mediaDevices.getUserMedia. Remove tests
specific to Navigator.webkitGetUserMedia.

* fast/mediastream/RTCPeerConnection-AddRemoveStream.html:
* fast/mediastream/argument-types.html: Removed.
* fast/mediastream/delayed-permission-allowed.html:
* fast/mediastream/delayed-permission-denied.html:
* fast/mediastream/enabled-expected.txt:
* fast/mediastream/error.html:
* fast/mediastream/getusermedia.html: Removed.
* fast/mediastream/script-tests/argument-types.js: Removed..
* fast/mediastream/script-tests/enabled.js:
(hasGetUserMediaProperty):
* fast/mediastream/success.html:
* fast/mediastream/webkitGetUserMedia-shadowing-then.html: Removed.

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

3 years agoUse smaller tiles in windows that are not active to facilitate App Napping
cdumez@apple.com [Thu, 9 Feb 2017 00:56:42 +0000 (00:56 +0000)]
Use smaller tiles in windows that are not active to facilitate App Napping
https://bugs.webkit.org/show_bug.cgi?id=167997
<rdar://problem/30358835>

Reviewed by Simon Fraser.

Source/WebCore:

Use smaller / non-adaptative tiles in windows that are not active to facilitate
App Napping after <https://trac.webkit.org/r197594>.

Test: compositing/tiling/non-active-window-tiles-size.html

* page/FrameView.cpp:
(WebCore::FrameView::contentsResized):
(WebCore::FrameView::addedOrRemovedScrollbar):
(WebCore::FrameView::computeScrollability):
(WebCore::FrameView::updateTiledBackingAdaptiveSizing):
(WebCore::FrameView::unobscuredContentSizeChanged):
(WebCore::FrameView::setViewExposedRect):
* page/FrameView.h:
* page/Page.cpp:
(WebCore::Page::setActivityState):
(WebCore::Page::isWindowActive):
* page/Page.h:
* platform/graphics/TiledBacking.h:
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::setTileSizeUpdateDelayDisabledForTesting):
(WebCore::TileController::notePendingTileSizeChange):
* platform/graphics/ca/TileController.h:
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::disableTileSizeUpdateDelay):
* testing/Internals.h:
* testing/Internals.idl:

Tools:

* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::setWindowIsKey):
Actually update windowIsKey state of NSWindow so the WebView
properly updates its activity state.

LayoutTests:

Add layout test coverage.

* compositing/tiling/non-active-window-tiles-size-expected.txt: Added.
* compositing/tiling/non-active-window-tiles-size.html: Added.
* platform/ios-simulator-wk2/compositing/tiling/non-active-window-tiles-size-expected.txt: Added.
* platform/mac-wk1/compositing/tiling/non-active-window-tiles-size-expected.txt: Added.

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

3 years agoUnreviewed, rolling out r211907.
cdumez@apple.com [Thu, 9 Feb 2017 00:26:25 +0000 (00:26 +0000)]
Unreviewed, rolling out r211907.

Broke the build

Reverted changeset:

"[MediaStream] Remove legacy Navigator.webkitGetUserMedia"
https://bugs.webkit.org/show_bug.cgi?id=168016
http://trac.webkit.org/changeset/211907

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

3 years ago[JSC] op_in should have ArrayProfile
keith_miller@apple.com [Thu, 9 Feb 2017 00:02:20 +0000 (00:02 +0000)]
[JSC] op_in should have ArrayProfile
https://bugs.webkit.org/show_bug.cgi?id=164581

Reviewed by Filip Pizlo.

This patch adds an ArrayProfile to the op_in bytecode. In the
DFG, if we see that we the key is an int32 we will convert the In
DFG node to a HasIndexedProperty node instead.

This patch also flips the two arguments of op_in and the In node
to reflect the other property lookup bytecodes.

* bytecode/BytecodeList.json:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::finishCreation):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitIn):
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::emitIn): Deleted.
* bytecompiler/NodesCodegen.cpp:
(JSC::InNode::emitBytecode):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::convertToHasIndexedProperty):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasArrayMode):
(JSC::DFG::Node::hasInternalMethodType):
(JSC::DFG::Node::internalMethodType):
(JSC::DFG::Node::setInternalMethodType):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileIn):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileIn):
(JSC::FTL::DFG::LowerDFGToB3::compileHasIndexedProperty):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* llint/LowLevelInterpreter.asm:
* parser/Nodes.h:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
(JSC::CommonSlowPaths::opIn):

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

3 years ago[MediaStream] Remove legacy Navigator.webkitGetUserMedia
eric.carlson@apple.com [Wed, 8 Feb 2017 23:51:04 +0000 (23:51 +0000)]
[MediaStream] Remove legacy Navigator.webkitGetUserMedia
https://bugs.webkit.org/show_bug.cgi?id=168016

Reviewed by Youenn Fablet.

Source/WebCore:

No new tests, existing tests updated.

* WebCore.xcodeproj/project.pbxproj: NavigatorUserMedia.
* DerivedSources.make: Ditto.
* CMakeLists.txt: Ditto.
* Modules/mediastream/NavigatorUserMedia.idl: Removed.
* Modules/mediastream/NavigatorUserMedia.js: Removed.
* WebCore.xcodeproj/project.pbxproj:

Source/WebInspectorUI:

* UserInterface/Models/NativeFunctionParameters.js:

LayoutTests:

Update valid tests to use navigator.mediaDevices.getUserMedia. Remove tests
specific to Navigator.webkitGetUserMedia.

* fast/mediastream/RTCPeerConnection-AddRemoveStream.html:
* fast/mediastream/argument-types.html: Removed.
* fast/mediastream/delayed-permission-allowed.html:
* fast/mediastream/delayed-permission-denied.html:
* fast/mediastream/enabled-expected.txt:
* fast/mediastream/error.html:
* fast/mediastream/getusermedia.html: Removed.
* fast/mediastream/script-tests/argument-types.js: Removed..
* fast/mediastream/script-tests/enabled.js:
(hasGetUserMediaProperty):
* fast/mediastream/success.html:
* fast/mediastream/webkitGetUserMedia-shadowing-then.html: Removed.

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

3 years agoAdd kUTTypeUTF8PlainText and kUTTypeJPEG to the list of compatible content types...
wenson_hsieh@apple.com [Wed, 8 Feb 2017 23:30:52 +0000 (23:30 +0000)]
Add kUTTypeUTF8PlainText and kUTTypeJPEG to the list of compatible content types in DragData
https://bugs.webkit.org/show_bug.cgi?id=167942
<rdar://problem/30315079>

Reviewed by Tim Horton.

Source/WebCore:

Adds UTI types for dragging UTF8 plain text and JPEG images to the list of supported types in DragDataMac.mm.
Also handles reading these types in PasteboardMac.mm. I verified manually with a test app that if a platform
NSView vends only UTF8 plaintext or JPEG images when dragging, WebKit is able to read the contents of the
pasteboard as text and an image, respectively.

New TestWebKitAPI tests in DragAndDropPasteboardTests.mm.

* platform/mac/DragDataMac.mm:
(WebCore::DragData::containsCompatibleContent):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::read):

Tools:

Adds a new test case that simulates dragging from a source that only vends JPEG images or UTF8 plaintext into a
contenteditable area. An image element and the plain text content, respectively, should be inserted into the
contenteditable in these cases.

The DragSource and DragInfo are used to mock dragging into the WebView. There is no reliance on using mouse
events in this test, since we call the dragging delegate methods (draggingEntered:, draggingUpdated:, and
performDragOperation:) directly.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/DragAndDropPasteboardTests.mm: Added.
(+[FrameLoadCompletionListener listenerWithCompletionBlock:]):
(-[FrameLoadCompletionListener initWithCompletionBlock:]):
(-[FrameLoadCompletionListener webView:didFinishLoadForFrame:]):
(-[DragSource draggingSourceOperationMaskForLocal:]):
(-[DragInfo initWithImage:offset:pasteboard:source:destinationWindow:]):
(-[DragInfo lastMousePosition]):
(-[DragInfo setLastMousePosition:]):
(-[DragInfo draggingDestinationWindow]):
(-[DragInfo draggingSourceOperationMask]):
(-[DragInfo draggingLocation]):
(-[DragInfo draggedImageLocation]):
(-[DragInfo draggedImage]):
(-[DragInfo draggingPasteboard]):
(-[DragInfo draggingSource]):
(-[DragInfo draggingSequenceNumber]):
(-[DragInfo slideDraggedImageTo:]):
(-[DragInfo namesOfPromisedFilesDroppedAtDestination:]):
(-[DragInfo draggingFormation]):
(-[DragInfo setDraggingFormation:]):
(-[DragInfo animatesToDestination]):
(-[DragInfo setAnimatesToDestination:]):
(-[DragInfo numberOfValidItemsForDrop]):
(-[DragInfo setNumberOfValidItemsForDrop:]):
(-[DragInfo enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:]):
(-[DragInfo springLoadingHighlight]):
(-[DragInfo resetSpringLoading]):
(TestWebKitAPI::getTestImage):
(TestWebKitAPI::webViewAfterPerformingDragOperation):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/mac/full-page-contenteditable.html: Added.

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

3 years agogetIntersectionList always returns empty NodeList until layout is complete
commit-queue@webkit.org [Wed, 8 Feb 2017 23:15:58 +0000 (23:15 +0000)]
getIntersectionList always returns empty NodeList until layout is complete
https://bugs.webkit.org/show_bug.cgi?id=81423

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-02-08
Reviewed by Simon Fraser.

Source/WebCore:

Layout needs to be forced before trying to figure out which SVGElements
intersect with a given SVGRect. We do the same thing in the DOM API
Element::getBoundingClientRect().

Test: svg/custom/intersection-list-before-layout.html

* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::getIntersectionList):

LayoutTests:

* svg/custom/intersection-list-before-layout-expected.txt: Added.
* svg/custom/intersection-list-before-layout.html: Added.

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

3 years ago[Modern Media Controls] Implement reduced and tight padding modes
commit-queue@webkit.org [Wed, 8 Feb 2017 22:57:38 +0000 (22:57 +0000)]
[Modern Media Controls] Implement reduced and tight padding modes
https://bugs.webkit.org/show_bug.cgi?id=167933
<rdar://problem/30396994>

Patch by Antoine Quint <graouts@apple.com> on 2017-02-08
Reviewed by Dean Jackson.

Source/WebCore:

The design specs for modern media controls mandate the following for inline media controls:

    - controls at or below 300pt width use a 12pt left margin for the left buttons container,
    and a 12pt right margin for the right buttons container, and 16pth button margin inside
    both containers ("reduced padding mode").

    - when dropping at or below 120pt width, controls use an 8pt left margin for
    the left buttons container, and an 8pt right margin for the right buttons container, and
    12pt button margin inside both containers and a shorter bar (25pt) ("compact mode").

    - in the case of audio controls, at 400pt or less, controls switch to 12pt margins and
    button margins for both buttons containers ("tight padding mode").

The "compact" mode was already implemented as a dedicated MacOSInlineMediaControls subclass.
Since we now have a more generic need to vary the metrics used for inline media controls on
macOS, we add new features to MacOSInlineMediaControls to support varying metrics based on
the controls' "layoutTraits" property.

So MediaController is changed such that it knows to use the new TightPadding and ReducedPadding
layout traits based on the conditions defined above, and _updateControlsIfNeeded() is changed
to set the "layoutTraits" property on the controls whenever called, which in our case is most
relevantly a "resize" event on the shadow root or a TrackEvent on the video tracks (to determine
when we're possibly changing between a video and audio file).

As a result, the "layoutTraits" setter is called on MacOSInlineMediaControls, which updates
the metrics for the various buttons containers, but also notifies the buttons contained
within that layout traits may have changed, since some buttons support a "compact" appearance
that is shorter and require a different image file. To that end, IconButton has been updated
so that it may be notified of a layout traits change through a new layoutTraitsDidChange()
method, that checks whether the current layout traits differ from those last used when loading
the icon.

Tests: media/modern-media-controls/icon-button/icon-button-change-layout-traits.html
       media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-buttons-styles.html
       media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-controls-bar-styles.html
       media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact.html
       media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-reduced-padding.html
       media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-tight-padding.html
       media/modern-media-controls/media-controller/media-controller-compact.html
       media/modern-media-controls/media-controller/media-controller-reduced-padding.html
       media/modern-media-controls/media-controller/media-controller-tight-padding.html

* Modules/modern-media-controls/controls/icon-button.js:
(IconButton.prototype.set iconName):
(IconButton.prototype.layoutTraitsDidChange):
(IconButton.prototype._loadImage):
* Modules/modern-media-controls/controls/layout-item.js:
* Modules/modern-media-controls/controls/macos-compact-inline-media-controls.js: Removed.
* Modules/modern-media-controls/controls/macos-inline-media-controls.js:
(MacOSInlineMediaControls.prototype.get layoutTraits):
(MacOSInlineMediaControls.prototype.set layoutTraits):
(MacOSInlineMediaControls.prototype._matchLayoutTraits):
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.get layoutTraits):
(MediaController.prototype.handleEvent):
(MediaController.prototype._updateControlsIfNeeded):
(MediaController.prototype._controlsClassForLayoutTraits):
(MediaController.prototype._shouldFadeBetweenControls): Deleted.
(MediaController.prototype._controlsClass): Deleted.
* WebCore.xcodeproj/project.pbxproj:

LayoutTests:

We rewrite the previously-written tests for "compact" mode and add some new tests for
"reduced padding" and "tight padding" modes as well as new support in IconButton to
update the icon based on a change of layout traits.

* media/modern-media-controls/icon-button/icon-button-change-layout-traits-expected.txt: Added.
* media/modern-media-controls/icon-button/icon-button-change-layout-traits.html: Added.
* media/modern-media-controls/macos-compact-inline-media-controls/macos-compact-inline-media-controls-buttons-styles-expected.txt: Removed.
* media/modern-media-controls/macos-compact-inline-media-controls/macos-compact-inline-media-controls-constructor-expected.txt: Removed.
* media/modern-media-controls/macos-compact-inline-media-controls/macos-compact-inline-media-controls-constructor.html: Removed.
* media/modern-media-controls/macos-compact-inline-media-controls/macos-compact-inline-media-controls-controls-bar-styles-expected.txt: Removed.
* media/modern-media-controls/macos-compact-inline-media-controls/macos-compact-inline-media-controls-controls-bar-styles.html: Removed.
* media/modern-media-controls/macos-compact-inline-media-controls/macos-compact-inline-media-controls-layout-expected.txt: Removed.
* media/modern-media-controls/macos-compact-inline-media-controls/macos-compact-inline-media-controls-layout.html: Removed.
* media/modern-media-controls/macos-compact-inline-media-controls/macos-compact-inline-media-controls-volume-styles-expected.txt: Removed.
* media/modern-media-controls/macos-compact-inline-media-controls/macos-compact-inline-media-controls-volume-styles.html: Removed.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-buttons-styles-expected.txt: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-buttons-styles.html: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-controls-bar-styles-expected.txt: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-controls-bar-styles.html: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-expected.txt: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact.html: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-reduced-padding-expected.txt: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-reduced-padding.html: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-tight-padding-expected.txt: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-tight-padding.html: Added.
* media/modern-media-controls/media-controller/media-controller-compact-expected.txt: Added.
* media/modern-media-controls/media-controller/media-controller-compact.html: Added.
* media/modern-media-controls/media-controller/media-controller-reduced-padding-expected.txt: Added.
* media/modern-media-controls/media-controller/media-controller-reduced-padding.html: Added.
* media/modern-media-controls/media-controller/media-controller-tight-padding-expected.txt: Added.
* media/modern-media-controls/media-controller/media-controller-tight-padding.html: Added.
* platform/ios-simulator/TestExpectations:

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

3 years agoFix libwebrtc build.
achristensen@apple.com [Wed, 8 Feb 2017 22:50:18 +0000 (22:50 +0000)]
Fix libwebrtc build.
https://bugs.webkit.org/show_bug.cgi?id=168017

* Configurations/libwebrtc.xcconfig:
Trying to compile audio_device_not_implemented_ios.mm on Mac doesn't work.
* libwebrtc.xcodeproj/project.pbxproj:
Add some neon files.  They are nicely protected by macros at the top, so their contents are only compiled if necessary.

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

3 years agoFix libwebrtc build on iOS simulator
achristensen@apple.com [Wed, 8 Feb 2017 22:26:57 +0000 (22:26 +0000)]
Fix libwebrtc build on iOS simulator
https://bugs.webkit.org/show_bug.cgi?id=168017

Reviewed by Tim Horton.

* Configurations/libwebrtc.xcconfig:
* Configurations/libwebrtcpcrtc.xcconfig:
Use $(inherited)
* Source/webrtc/modules/audio_device/ios/audio_device_ios.h:
* Source/webrtc/modules/audio_device/ios/audio_device_ios.mm:
* Source/webrtc/modules/audio_device/ios/objc/RTCAudioSession+Configuration.mm:
* Source/webrtc/modules/audio_device/ios/objc/RTCAudioSession+Private.h:
* Source/webrtc/modules/audio_device/ios/objc/RTCAudioSession.h:
* Source/webrtc/modules/audio_device/ios/objc/RTCAudioSession.mm:
* Source/webrtc/modules/audio_device/ios/objc/RTCAudioSessionConfiguration.h:
* Source/webrtc/modules/audio_device/ios/objc/RTCAudioSessionConfiguration.m:
* Source/webrtc/modules/audio_device/ios/objc/RTCAudioSessionDelegateAdapter.h:
* Source/webrtc/modules/audio_device/ios/objc/RTCAudioSessionDelegateAdapter.mm:
Renamed RTCAudioSession* to WebRTCAudioSession* so that all ObjC classes in WebCore start with Web prefix.
* libwebrtc.xcodeproj/project.pbxproj:
Add necessary files.  Some iOS-specific files need ARC,
and this matches the Build.gn in Source/webrtc/modules/audio_device

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

3 years agoDon't re-export WKUtilities.h from WebKit
aakash_jain@apple.com [Wed, 8 Feb 2017 22:04:38 +0000 (22:04 +0000)]
Don't re-export WKUtilities.h from WebKit
https://bugs.webkit.org/show_bug.cgi?id=167977

Reviewed by Alexey Proskuryakov.

* MigrateHeaders.make: Removed WKUtilities.h

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

3 years agoMove private methods from WKGraphics.h to a separate header file
aakash_jain@apple.com [Wed, 8 Feb 2017 21:58:21 +0000 (21:58 +0000)]
Move private methods from WKGraphics.h to a separate header file
https://bugs.webkit.org/show_bug.cgi?id=167996

Reviewed by Alexey  Proskuryakov.

* platform/ios/wak/WKGraphicsInternal.h: Added.
* WebCore.xcodeproj/project.pbxproj: Added WKGraphicsInternal.h
* platform/ios/wak/WKGraphics.h: Moved methods to WKGraphicsInternal.h
* platform/graphics/mac/GraphicsContextMac.mm: Included new header file.
* platform/ios/wak/WKGraphics.mm: Same.

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

3 years agoTried to fix the build after r211897.
mitz@apple.com [Wed, 8 Feb 2017 21:37:02 +0000 (21:37 +0000)]
Tried to fix the build after r211897.

* UIProcess/ios/WKContentViewInteraction.h:

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

3 years ago[iOS] WKWebView doesn’t have implementations of UIResponderStandardEditActions that...
mitz@apple.com [Wed, 8 Feb 2017 21:34:40 +0000 (21:34 +0000)]
[iOS] WKWebView doesn’t have implementations of UIResponderStandardEditActions that can be overridden
https://bugs.webkit.org/show_bug.cgi?id=167974

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKWebView.mm:
  Gave each of the actions in FOR_EACH_WKCONTENTVIEW_ACTION an implementation that sends it
  to the WKContentView if we’re using one.
(-[WKWebView canPerformAction:withSender:]): Override and for each of the actions in
  FOR_EACH_WKCONTENTVIEW_ACTION, forward to
  -[WKContentView canPerformActionForWebView:withSender:] if we’re using a WKContentView,
  otherwise returning NO.

* UIProcess/ios/WKContentViewInteraction.h: Declared -canPerformActionForWebView:withSender:
  and several internal methods we override.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformAction:withSender:]): Now returns NO so that the target for any
  action is the WKWebView.
(-[WKContentView canPerformActionForWebView:withSender:]): Moved the logic previously in
  -canPerformAction:withSender: to here.

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

3 years agoAir IRC might spill a terminal that produces a value after the terminal
sbarati@apple.com [Wed, 8 Feb 2017 21:21:45 +0000 (21:21 +0000)]
Air IRC might spill a terminal that produces a value after the terminal
https://bugs.webkit.org/show_bug.cgi?id=167919
<rdar://problem/29754721>

Reviewed by Filip Pizlo.

IRC may spill a value-producing terminal (a patchpoint can be a value-producing terminal).
It used to do this by placing the spill *after* the terminal. This produces an invalid
graph because no instructions are allowed after the terminal.

I fixed this bug by having a cleanup pass over the IR after IRC is done.
The pass detects this problem, and fixes it by moving the spill into the
successors. However, it is careful to detect when the edge to the
successor is a critical edge. If the value-producing patchpoint is
the only predecessor of the successor, it just moves the spill
code to the beginning of the successor. Otherwise, it's a critical
edge and it breaks it by adding a block that does the spilling then
jumps to the successor.

* b3/air/AirInsertionSet.cpp:
* b3/air/AirInsertionSet.h:
(JSC::B3::Air::InsertionSet::insertInsts):
* b3/air/AirIteratedRegisterCoalescing.cpp:
* b3/testb3.cpp:
(JSC::B3::testTerminalPatchpointThatNeedsToBeSpilled):
(JSC::B3::testTerminalPatchpointThatNeedsToBeSpilled2):
(JSC::B3::run):

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

3 years agoOpt-out iBooks from synchronous willSendRequest on iOS.
beidson@apple.com [Wed, 8 Feb 2017 21:19:16 +0000 (21:19 +0000)]
Opt-out iBooks from synchronous willSendRequest on iOS.
<rdar://problem/30129966> and https://bugs.webkit.org/show_bug.cgi?id=168006

Reviewed by Brent Fulgham.

No new tests (Not a testable behavior change at this time).

* platform/network/mac/ResourceHandleMac.mm:
(WebCore::synchronousWillSendRequestEnabled): iBooks never gets synchronous willSendRequest:

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

3 years agoAllow speculative redirects
antti@apple.com [Wed, 8 Feb 2017 21:11:32 +0000 (21:11 +0000)]
Allow speculative redirects
https://bugs.webkit.org/show_bug.cgi?id=167982

Reviewed by Andreas Kling.

If speculative loader hits a redirect it will drop it on the floor. We should use it instead.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::continueWillSendRequest):
(WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):

    Reset m_isWaitingContinueWillSendRequestForCachedRedirect bit immediately.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::makeRedirectEntry):

    Factor to a function.

(WebKit::NetworkCache::Cache::storeRedirect):
* NetworkProcess/cache/NetworkCache.h:
(WebKit::NetworkCache::Cache::speculativeLoadManager):
* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::Entry):

    Use std::optional instead std::unique_ptr for the redirect request.

(WebKit::NetworkCache::Entry::decodeStorageRecord):
* NetworkProcess/cache/NetworkCacheEntry.h:
(WebKit::NetworkCache::Entry::redirectRequest):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):

    Make a cache entry for speculative redirect.
    Redirect is not actually performed, the target resource will have a separate
    speculative entry.

(WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
(WebKit::NetworkCache::SpeculativeLoad::didFailLoading):
(WebKit::NetworkCache::SpeculativeLoad::didComplete):

    Protect against multiple completions.

(WebKit::NetworkCache::SpeculativeLoad::abort): Deleted.
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::SpeculativeLoadManager::retrieve):

    Make successful retrieves asynchronous to avoid re-entrancy problems.

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

3 years agoUnreviewed build fix; FullscreenClient only avaialble on 32-bit builds.
jer.noble@apple.com [Wed, 8 Feb 2017 20:40:32 +0000 (20:40 +0000)]
Unreviewed build fix; FullscreenClient only avaialble on 32-bit builds.

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::WebViewImpl):

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

3 years agoSplit JSDOMConstructor.h/cpp up by class
commit-queue@webkit.org [Wed, 8 Feb 2017 20:24:37 +0000 (20:24 +0000)]
Split JSDOMConstructor.h/cpp up by class
https://bugs.webkit.org/show_bug.cgi?id=167958

Patch by Sam Weinig <sam@webkit.org> on 2017-02-08
Reviewed by Tim Horton.

Splits JSDOMConstructor up by class.
- Renames DOMConstructorObject to JSDOMConstructorBase.
- Renames DOMConstructorWithDocument to JSDOMConstructorWithDocument.
- Renames DOMConstructorJSBuiltinObject to JSDOMBuiltinConstructorBase.
- Renames JSBuiltinConstructor to JSDOMBuiltinConstructor.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
Add new files.

* bindings/js/JSDOMBinding.h:
(WebCore::propertyNameToString): Deleted.
(WebCore::propertyNameToAtomicString): Deleted.
* bindings/js/JSDOMBuiltinConstructor.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
* bindings/js/JSDOMBuiltinConstructorBase.cpp: Copied from Source/WebCore/bindings/js/JSDOMConstructor.cpp.
* bindings/js/JSDOMBuiltinConstructorBase.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
* bindings/js/JSDOMConstructor.cpp: Removed.
* bindings/js/JSDOMConstructor.h: Remove all classes other than JSDOMConstructor.
* bindings/js/JSDOMConstructorBase.cpp: Copied from Source/WebCore/bindings/js/JSDOMConstructor.cpp.
* bindings/js/JSDOMConstructorBase.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
* bindings/js/JSDOMConstructorNotConstructable.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
* bindings/js/JSDOMConstructorWithDocument.cpp: Copied from Source/WebCore/bindings/js/JSDOMConstructor.cpp.
* bindings/js/JSDOMConstructorWithDocument.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
* bindings/js/JSDOMNamedConstructor.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.

* bindings/js/JSDOMConvertStrings.h:
(WebCore::propertyNameToString):
(WebCore::propertyNameToAtomicString):
Move these here from JSDOMBinding.

* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::constructJSHTMLElement):
* bindings/js/JSMutationObserverCustom.cpp:
(WebCore::constructJSMutationObserver):
* bindings/js/JSReadableStreamPrivateConstructors.cpp:
* bindings/js/JSStorageCustom.cpp:
* bindings/js/JSUserMessageHandlersNamespaceCustom.cpp:
(WebCore::JSUserMessageHandlersNamespace::getOwnPropertySlotDelegate):
* bindings/js/JSWorkerCustom.cpp:
(WebCore::constructJSWorker):
* bindings/scripts/CodeGeneratorJS.pm:
(GetConstructorTemplateClassName):
(GenerateConstructorDeclaration):
Update includes/names.

* dom/StaticRange.cpp:
(WebCore::StaticRange::~StaticRange):
* dom/StaticRange.h:
Add out-of-line destructor, so Node.h does not have to be included.

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

3 years agoMove FullscreenClient creation into WebViewImpl, for use in (deprecated) WKView.
jer.noble@apple.com [Wed, 8 Feb 2017 20:16:04 +0000 (20:16 +0000)]
Move FullscreenClient creation into WebViewImpl, for use in (deprecated) WKView.
https://bugs.webkit.org/show_bug.cgi?id=168007

Reviewed by Alex Christensen.

Source/WebKit2:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/_WKFullscreenDelegate.h:
* UIProcess/Cocoa/FullscreenClient.h:
* UIProcess/Cocoa/FullscreenClient.mm:
(WebKit::FullscreenClient::FullscreenClient):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::WebViewImpl):

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenDelegate.mm:
(didFinishLoadForFrame):
(TestWebKitAPI::TEST):

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

3 years agoInitialize the main RunLoop in iOS WebKitLegacy
commit-queue@webkit.org [Wed, 8 Feb 2017 20:04:02 +0000 (20:04 +0000)]
Initialize the main RunLoop in iOS WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=167953

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-02-08
Reviewed by Alexey Proskuryakov.

* platform/ios/wak/WebCoreThread.mm:
(StartWebThread):
Initialize the main runloop on the main thread during iOS WebKit initialization.

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

3 years agoMove private methods from WKContentObservation.h to a separate header file
aakash_jain@apple.com [Wed, 8 Feb 2017 19:42:49 +0000 (19:42 +0000)]
Move private methods from WKContentObservation.h to a separate header file
https://bugs.webkit.org/show_bug.cgi?id=167998

Reviewed by Alexey Proskuryakov.

* WebCore.xcodeproj/project.pbxproj: Added WKContentObservationInternal.h
* platform/ios/wak/WKContentObservationInternal.h: Added.
* platform/ios/wak/WKContentObservation.h: Moved methods to WKContentObservationInternal.h
* platform/ios/wak/WKContentObservation.cpp: Included new header file.
* page/DOMTimer.cpp: Same.
* page/DOMWindow.cpp: Same.
* style/RenderTreeUpdater.cpp: Same.

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

3 years agoFix iOS libwebrtc build
achristensen@apple.com [Wed, 8 Feb 2017 19:36:00 +0000 (19:36 +0000)]
Fix iOS libwebrtc build
https://bugs.webkit.org/show_bug.cgi?id=168004

Reviewed by Youenn Fablet.

We might still need to add some neon files.

* Configurations/libwebrtc.xcconfig:
* Configurations/libwebrtcpcrtc.xcconfig:
* Configurations/opus.xcconfig:
Don't build sse-specific files for iOS.
* libwebrtc.xcodeproj/project.pbxproj:
Don't include the sse4 optimization for now.
We can add the optimization for CPUs that support it later.

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

3 years agoGUM is crashing in Debug mode when access is granted/denied for a page that is gone
commit-queue@webkit.org [Wed, 8 Feb 2017 18:55:30 +0000 (18:55 +0000)]
GUM is crashing in Debug mode when access is granted/denied for a page that is gone
https://bugs.webkit.org/show_bug.cgi?id=168003

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-08
Reviewed by Eric Carlson.

Removing the assertion since manager can be null and case is coevered by the if statement behind it.

* UIProcess/UserMediaPermissionRequestProxy.cpp:
(WebKit::UserMediaPermissionRequestProxy::deny):

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