WebKit-https.git
2 years agoScroll offset jumps after a programmatic scroll in an overflow container with scroll...
wenson_hsieh@apple.com [Fri, 7 Apr 2017 00:38:42 +0000 (00:38 +0000)]
Scroll offset jumps after a programmatic scroll in an overflow container with scroll snapping
https://bugs.webkit.org/show_bug.cgi?id=170560
<rdar://problem/31484693>

Reviewed by Tim Horton.

Source/WebCore:

Test: css3/scroll-snap/scroll-snap-programmatic-overflow-scroll.html

Logic for maintaining the scroll snap state in ScrollController was previously removed from iOS when refactoring
ScrollController. This was done because scroll snapping on iOS is driven not by the ScrollController (as it is
on Mac) but rather by sending scroll snap offsets to the UI process and hooking into UIScrollView delegates to
handle retargeted scrolling.

However, on iOS, this ScrollController state is still important for the purposes of keeping the last active
snap point index in sync with the UI process when the scroll offset changes outside of a user gesture (i.e.
programmatic scrolling). Since the UI process does not get a chance to update the active snap offset during a
programmatic scroll, our last active snap offset state was only being updated to the last snap position that the
user manually scrolled to, making programmatic scrolling jump to this offset.

To fix this, we need to update scroll snap state on iOS within ScrollController. Also adds a new Layout test
that exercises programmatic scrolling in an overflow scrolling container on all platforms.

* platform/cocoa/ScrollController.mm:
(WebCore::otherScrollEventAxis):
(WebCore::ScrollController::updateScrollSnapState):
(WebCore::ScrollController::updateScrollSnapPoints):

LayoutTests:

Add a test verifying that programmatically changing the scroll offset of an overflow container does not cause the
scroll offset to jump back to the last active snap position. See WebCore ChangeLog for more details.

* css3/scroll-snap/scroll-snap-programmatic-overflow-scroll-expected.txt: Added.
* css3/scroll-snap/scroll-snap-programmatic-overflow-scroll.html: Added.

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

2 years agoFix broken link.
dino@apple.com [Fri, 7 Apr 2017 00:36:53 +0000 (00:36 +0000)]
Fix broken link.

* demos/webgpu/index.html:

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

2 years agoRename allocateStack to allocateStackByGraphColoring.
fpizlo@apple.com [Fri, 7 Apr 2017 00:26:53 +0000 (00:26 +0000)]
Rename allocateStack to allocateStackByGraphColoring.

Rubber stamped by Saam Barati.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/air/AirAllocateStack.cpp: Removed.
* b3/air/AirAllocateStack.h: Removed.
* b3/air/AirAllocateStackByGraphColoring.cpp: Copied from Source/JavaScriptCore/b3/air/AirAllocateStack.cpp.
(JSC::B3::Air::allocateStackByGraphColoring):
(JSC::B3::Air::allocateStack): Deleted.
* b3/air/AirAllocateStackByGraphColoring.h: Copied from Source/JavaScriptCore/b3/air/AirAllocateStack.h.
* b3/air/AirGenerate.cpp:
(JSC::B3::Air::prepareForGeneration):

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

2 years agoCannot Object.seal() or Object.freeze() global "this"
msaboff@apple.com [Fri, 7 Apr 2017 00:16:18 +0000 (00:16 +0000)]
Cannot Object.seal() or Object.freeze() global "this"
https://bugs.webkit.org/show_bug.cgi?id=170549

Reviewed by Mark Lam.

JSTests:

Enabled failing tests fixed by the corresponding code change:
    ChakraCore/test/LetConst/delete.js
    ChakraCore/test/LetConst/dop.js
    ChakraCore/test/LetConst/dop1.js

* ChakraCore.yaml:
* ChakraCore/test/LetConst/dop.baseline-jsc: Added JSC specific expected output.
* ChakraCore/test/LetConst/dop1.baseline-jsc: Added JSC specific expected output.

Source/JavaScriptCore:

Needed to implement JSProxy::isExtensible() which returns the results of calling
the same on wrapped object.

Implemented step 11 of Runtime Semantics: EvalDeclarationInstantiation from the ECMAScript
spec to properly return a TypeError object when attempting to add properties to a
non-extensible global object.

* interpreter/Interpreter.cpp:
(JSC::Interpreter::execute):
* runtime/JSProxy.cpp:
(JSC::JSProxy::isExtensible):
* runtime/JSProxy.h:

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

2 years agoLinear scan should run liveness only once
fpizlo@apple.com [Fri, 7 Apr 2017 00:11:16 +0000 (00:11 +0000)]
Linear scan should run liveness only once
https://bugs.webkit.org/show_bug.cgi?id=170569

Reviewed by Keith Miller.

Source/JavaScriptCore:

Air has a longstanding design bug that Tmps from different banks are indexed independently. This
means that all of our analyses over Tmps do separate GP and FP passes. This does have some
marginal benefits (the rest of the algorithm is specialized for Bank) but it's probably net bad.
However, I don't want to think about solving that general problem.

Instead, this just makes linear scan use a UnifiedTmpLiveness that uses a single "linear"
indexing for GP and FP. This lets me avoid the much larger refactoring (which would involve
substantial changes in graph coloring) while getting the bulk of the benefit (liveness runs once,
instead of twice, for linear scan).

This patch implements a lot of plumbing to make it possible for Liveness<> to view Tmps as having
a unified indexing scheme. Tmp calls this LinearlyIndexed (to match the naming convention of
AbsolutelyIndexed and Indexed), while AirLiveness calls this UnifiedTmpLiveness. With this
change, -O1 never does any liveness analysis that uses separate GP and FP passes. I think this
eliminates any urgency from the larger Tmp indexing bug. We can probably live with graph coloring
doing separate passes.

This is a ~6% speed-up for wasm -O1 compile times. I think this means that linear scan is no
longer the longest pole in the tent.

* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3VariableLiveness.h:
(JSC::B3::VariableLivenessAdapter::prepareToCompute):
* b3/air/AirAllocateRegistersByLinearScan.cpp:
(JSC::B3::Air::allocateRegistersByLinearScan):
* b3/air/AirCode.h:
(JSC::B3::Air::Code::forEachTmp):
* b3/air/AirLiveness.h:
* b3/air/AirLivenessAdapter.h:
(JSC::B3::Air::LivenessAdapter::Actions::Actions):
(JSC::B3::Air::LivenessAdapter::LivenessAdapter):
(JSC::B3::Air::LivenessAdapter::adapter):
(JSC::B3::Air::LivenessAdapter::prepareToCompute):
(JSC::B3::Air::LivenessAdapter::actionsAt):
(JSC::B3::Air::LivenessAdapter::forEachUse):
(JSC::B3::Air::LivenessAdapter::forEachDef):
(JSC::B3::Air::TmpLivenessAdapter::numIndices):
(JSC::B3::Air::UnifiedTmpLivenessAdapter::UnifiedTmpLivenessAdapter):
(JSC::B3::Air::UnifiedTmpLivenessAdapter::numIndices):
(JSC::B3::Air::UnifiedTmpLivenessAdapter::acceptsBank):
(JSC::B3::Air::UnifiedTmpLivenessAdapter::acceptsRole):
(JSC::B3::Air::UnifiedTmpLivenessAdapter::valueToIndex):
(JSC::B3::Air::UnifiedTmpLivenessAdapter::indexToValue):
* b3/air/AirLivenessConstraints.h: Removed.
* b3/air/AirRegLiveness.h:
(JSC::B3::Air::RegLiveness::LocalCalc::LocalCalc):
* b3/air/AirTmp.cpp:
* b3/air/AirTmp.h:
* b3/air/AirTmpInlines.h:
(JSC::B3::Air::Tmp::LinearlyIndexed::LinearlyIndexed):
(JSC::B3::Air::Tmp::LinearlyIndexed::index):
(JSC::B3::Air::Tmp::linearlyIndexed):
(JSC::B3::Air::Tmp::indexEnd):
(JSC::B3::Air::Tmp::absoluteIndexEnd):
(JSC::B3::Air::Tmp::linearIndexEnd):
(JSC::B3::Air::Tmp::tmpForAbsoluteIndex):
(JSC::B3::Air::Tmp::tmpForLinearIndex):
* b3/air/AirTmpMap.h: Added.
(JSC::B3::Air::TmpMap::TmpMap):
(JSC::B3::Air::TmpMap::resize):
(JSC::B3::Air::TmpMap::clear):
(JSC::B3::Air::TmpMap::operator[]):
(JSC::B3::Air::TmpMap::append):

Source/WTF:

Have Liveness<> call Adapter::prepareToCompute(), since this makes it a lot easier to implement
constraint generation, since the constraint generator now gets to run after the Adapter is fully
constructed.

* wtf/IndexMap.h:
(WTF::IndexMap::append): Also make this a bit more versatile.
* wtf/Liveness.h:
(WTF::Liveness::LocalCalc::Iterable::contains):
(WTF::Liveness::Iterable::contains):
(WTF::Liveness::compute):

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

2 years agoThrottle requestAnimationFrame in cross-origin iframes to 30fps
simon.fraser@apple.com [Fri, 7 Apr 2017 00:04:10 +0000 (00:04 +0000)]
Throttle requestAnimationFrame in cross-origin iframes to 30fps
https://bugs.webkit.org/show_bug.cgi?id=170534

Reviewed by Dan Bates.

Source/WebCore:

Add a throttling reason to ScriptedAnimationController which is NonInteractedCrossOriginFrame,
set on cross-origin iframes whose documents have never seen a user interaction. It's cleared
as soon as an interaction on this frame or a child frame is detected.

Move the initialization of the LowPowerMode throttling reason to Document::requestAnimationFrame(),
since it's more appropriate to compute NonInteractedCrossOriginFrame here than down in ScriptedAnimationController,
and best to do both in the same place.

Tests: http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe.html

* dom/Document.cpp:
(WebCore::Document::requestAnimationFrame):
(WebCore::Document::updateLastHandledUserGestureTimestamp):
* dom/Document.h:
(WebCore::Document::hasHadUserInteraction):
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::ScriptedAnimationController):
(WebCore::throttlingReasonToString):
(WebCore::ScriptedAnimationController::interval):
* dom/ScriptedAnimationController.h:
* loader/FrameLoader.cpp:
(WebCore::shouldAskForNavigationConfirmation):

LayoutTests:

* http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe-expected.txt: Added.
* http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe.html: Added.
* http/tests/frame-throttling/resources/requestAnimationFrame-frame.html: Added.

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

2 years agoUse the Accelerate framework to optimize FEColorMatrix operations
simon.fraser@apple.com [Fri, 7 Apr 2017 00:01:29 +0000 (00:01 +0000)]
Use the Accelerate framework to optimize FEColorMatrix operations
https://bugs.webkit.org/show_bug.cgi?id=170518

Reviewed by Tim Horton.

On macOS and iOS, we can use the Accelerate framework (vImage) to do color matrix
math to optimize color matrix, hue rotate, saturation and luminosity to alpha filters.

Change ImageBuffer::getUnmultipliedImageData() and getPremultipliedImageData() to
return the size of the returned Uint8ClampedArray in physical pixels, because we
need to pass that to vImage.

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::getImageData):
* platform/graphics/ImageBuffer.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::getUnmultipliedImageData):
(WebCore::ImageBuffer::getPremultipliedImageData):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::getUnmultipliedImageData):
(WebCore::ImageBuffer::getPremultipliedImageData):
* platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::effectApplyAccelerated):
(WebCore::effectType):
(WebCore::FEColorMatrix::platformApplySoftware):
* platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::platformApplySoftware):
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::getUnmultipliedImageData):
(WebCore::ImageBuffer::getPremultipliedImageData):

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

2 years agoDo some minor FEColorMatrix code cleanup and optimization
simon.fraser@apple.com [Fri, 7 Apr 2017 00:01:25 +0000 (00:01 +0000)]
Do some minor FEColorMatrix code cleanup and optimization
https://bugs.webkit.org/show_bug.cgi?id=170474

Reviewed by Dean Jackson.

Don't switch inside of a pixel processing loop; repeat the loop inside switch (filterType).

Change matrix() and saturateAndHueRotate() to dereference the source pixels once, instead
of multiple times, which is faster.

This kind of code benefits from aligning things with spaces for readability, so do so,
violating webkit style.

Add some off-by-default performance logging code.

Increases pixel processing performance from about 86ms per megapixel to 65ms per megapixel.

* platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::matrix):
(WebCore::saturateAndHueRotate):
(WebCore::effectType):
(WebCore::FEColorMatrix::platformApplySoftware):

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

2 years agoUnreviewed, rolling out r215041.
ryanhaddad@apple.com [Thu, 6 Apr 2017 23:24:44 +0000 (23:24 +0000)]
Unreviewed, rolling out r215041.

The LayoutTest for this change is failing on ios-simulator.

Reverted changeset:

"Rendering flexbox children across columns"
https://bugs.webkit.org/show_bug.cgi?id=164166
http://trac.webkit.org/changeset/215041

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

2 years agoUnreviewed, rolling out r215046.
ryanhaddad@apple.com [Thu, 6 Apr 2017 23:11:45 +0000 (23:11 +0000)]
Unreviewed, rolling out r215046.

This change broke internal builds.

Reverted changeset:

"WebRTC tests gardening"
https://bugs.webkit.org/show_bug.cgi?id=170508
http://trac.webkit.org/changeset/215046

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

2 years agoWeb Inspector: Only Capture Extra Network Load Metrics when there is a Web Inspector...
commit-queue@webkit.org [Thu, 6 Apr 2017 22:58:08 +0000 (22:58 +0000)]
Web Inspector: Only Capture Extra Network Load Metrics when there is a Web Inspector Frontend
https://bugs.webkit.org/show_bug.cgi?id=170525

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-04-06
Reviewed by Youenn Fablet.

Source/WebCore:

Covered by existing tests that when Web Inspector is open we enable collecting the extra data.

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::firstFrontendCreated):
(WebCore::InspectorInstrumentation::lastFrontendDeleted):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::frontendCreated):
(WebCore::InspectorInstrumentation::frontendDeleted):
When the first frontend is created enable a new loader strategy to
collect extra network load metrics. When the last frontend is closed
disable the extra metrics.

* loader/LoaderStrategy.h:
* platform/PlatformStrategies.h:
New load strategy to enable/disable new metrics.

Source/WebKit:

* WebCoreSupport/WebResourceLoadScheduler.h:

Source/WebKit2:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
Only collect extra metrics if the WebProcess this load is for has enabled
collecting extra metrics.

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::setCaptureExtraNetworkLoadMetricsEnabled):
* WebProcess/Network/WebLoaderStrategy.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled):
* NetworkProcess/NetworkConnectionToWebProcess.h:
(WebKit::NetworkConnectionToWebProcess::captureExtraNetworkLoadMetricsEnabled):
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
New bool state toggled through the loader policy.

* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics):
* NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTaskClient::shouldCaptureExtraNetworkLoadMetrics):
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::shouldCaptureExtraNetworkLoadMetrics):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkLoadClient.h:
(WebKit::NetworkLoadClient::shouldCaptureExtraNetworkLoadMetrics):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::shouldCaptureExtraNetworkLoadMetrics):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
Default handling for network loads is to not include extra data. Thread
client messages back from the NetworkLoads / SpeculativeLoads to check
the NetworkConnectionToWebProcess state on whether or not we should collect
extra metrics.

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

2 years agoSkip a test that was accidentally enabled with r214982.
ryanhaddad@apple.com [Thu, 6 Apr 2017 22:39:15 +0000 (22:39 +0000)]
Skip a test that was accidentally enabled with r214982.

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

2 years agoObj-C bindings build fails with CSS_DEVICE_ADAPTATION turned on
timothy_horton@apple.com [Thu, 6 Apr 2017 22:38:04 +0000 (22:38 +0000)]
Obj-C bindings build fails with CSS_DEVICE_ADAPTATION turned on
https://bugs.webkit.org/show_bug.cgi?id=170566

Reviewed by Simon Fraser.

* DOM/DOMCSS.mm:
(kitClass):
Use the WebCore-side enum for this, since that's actually what we're switching over.
This allows us to handle values here without adding them to the API header.
All of the other kitClass() functions work the same way.
Also, unindent for style purposes.

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

2 years agoWeb Inspector: Show all headers in the Request Headers section of the Resource detail...
joepeck@webkit.org [Thu, 6 Apr 2017 22:02:04 +0000 (22:02 +0000)]
Web Inspector: Show all headers in the Request Headers section of the Resource details sidebar
https://bugs.webkit.org/show_bug.cgi?id=16531
<rdar://problem/5712895>

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/protocol/Network.json:
Optional refined list of request headers in Metrics.

Source/WebCore:

Test: http/tests/inspector/network/resource-request-headers.html

* loader/ResourceTiming.cpp:
(WebCore::ResourceTiming::ResourceTiming):
Eliminate unnecessary data from the NetworkLoadTiming object
when it is used for ResourceTiming. This clears up some memory
that will otherwise never be used.

* platform/network/NetworkLoadMetrics.h:
(WebCore::NetworkLoadMetrics::isolatedCopy):
(WebCore::NetworkLoadMetrics::reset):
(WebCore::NetworkLoadMetrics::clearNonTimingData):
(WebCore::NetworkLoadMetrics::operator==):
(WebCore::NetworkLoadMetrics::encode):
(WebCore::NetworkLoadMetrics::decode):
Include an optional HTTPHeaderMap for a refined list of
request headers for this network load.

* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForMetrics):
Include request headers with other optional metrics data
when the load is completed.

Source/WebInspectorUI:

* UserInterface/Models/Resource.js:
(WebInspector.Resource.prototype.updateWithMetrics):
Update request headers if provided in metrics.

Source/WebKit2:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
Include a complete list of the request headers sent for this load.
There may be headers that WebCore did not know about and developer
tools should be informed of.

LayoutTests:

* http/tests/inspector/network/resource-request-headers-expected.txt: Added.
* http/tests/inspector/network/resource-request-headers.html: Added.
* http/tests/inspector/network/resources/basic-auth.php: Added.
Test coverage for Cookie and Basic Authentication headers.

* platform/mac/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:
Mark the test as expected to fail on WebKit1 CFNetwork based platforms,
and ElCapitan which uses the legacy non-NSURLSession loading path.

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

2 years agoEach build request should be associated with a repository group
rniwa@webkit.org [Thu, 6 Apr 2017 21:56:59 +0000 (21:56 +0000)]
Each build request should be associated with a repository group
https://bugs.webkit.org/show_bug.cgi?id=170528

Rubber-stamped by Chris Dumez.

Make the buildbot syncing script use the concept of repository groups so that each repository group can post
a different set of properties to buildbot. In order to do this, we associate each build request with
a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via
/api/update-triggerable just the same way the set of the supported platform, test pairs are updated.

Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name
to either a string value or a repository name enclosed in < and >:

```js
"repositoryGroups": {
    "webkit-svn": {
        "repositories": ["WebKit", "macOS"],
        "properties": {"os": "<macOS>", "wk": "<WebKit>"}
    }
}
```

With this, removed the support for specifying a repository to use in generic dictionary of properties via
a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of
repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in
build requests.

After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group.
Run the appropriate database queries to set the repository group on each build request. Because of this change,
this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests.
Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same
test group if the next build request to be scheduled does not specify a repository group.

* init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for
repository and group pair in triggerable_repositories table.

* public/api/update-triggerable.php:
(main): Validate and insert repository groups.
(validate_configurations): Extracted from main.
(validate_repository_groups): Added.

* public/v3/models/repository.js:
(Repository.findTopLevelByName): Added.

* public/include/build-requests-fetcher.php:
(BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response.

* public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given
triggerable for a list of repositories.
(RepositoryGroupFinder): Added.
(RepositoryGroupFinder::__construct): Added.
(RepositoryGroupFinder::find_by_repositories): Added.
(RepositoryGroupFinder::populate_map): Added.

* public/privileged-api/create-test-group.php:
(main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains
"set", the list of commit IDs, and "repository_group", the repository group identified for each commit set.
Use that to set the repository group in each new build request.
(commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group.
(ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its
argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]}

* public/v3/models/build-request.js:
(BuildRequest):
(BuildRequest.prototype.triggerable): Added.
(BuildRequest.prototype.repositoryGroup): Added.
(BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group.

* public/v3/models/triggerable.js:
(Triggerable.prototype.name): Added.
(Triggerable.prototype.acceptedRepositories): Deleted.
(TriggerableRepositoryGroup):
(TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group

* server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request.
* server-tests/api-manifest-tests.js: Added assertions for the repository groups.
* server-tests/api-report-tests.js:
(.emptyReport):
(.reportWithTwoLevelsOfAggregations):
* server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with
a triggerable.
(.updateWithOSXRepositoryGroup):
(.mapRepositoriesByGroup):
* server-tests/privileged-api-create-test-group-tests.js:
(addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups
in existing test cases, and added a test case for creating a test group with two different repository groups.

* server-tests/resources/mock-data.js:
(MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps.
(MockData.emptyTriggeragbleId): Added.
(MockData.macosRepositoryId): Added.
(MockData.webkitRepositoryId): Added.
(MockData.gitWebkitRepositoryId): Added.
(MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some
tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks.
(MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js.
(MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js.
(MockData.addAnotherMockTestGroup): Cleanup.
(MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes.
(MockData.mockTestSyncConfigWithTwoBuilders): Ditto.

* server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test
updating the set of repository groups in addition to the set of test, platform pairs.
(.refetchManifest): Added.

* tools/js/buildbot-syncer.js:
(BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument,
and buildRequestArgument as the third argument.
(BuildbotSyncer.prototype.repositoryGroups): Added.
(BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find.
Also added an assertion that the build request is associated with a repository group.
(BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to
specify a revision in favor of explicity listing each property and repository name in a repository group.
(BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties
shared across syncers, the name of properties which specifies the build slave name and build request ID. These
values are not stored as top-level properties and superseded by the concept of repository groups.
(BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups.
(BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of
properties or buildRequestArgument (often inherited from shared).
(BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of
allowed proeprties in each configuration now that they're specified as top-level properties.

* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups.
(BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is
not included in the list of valid build requests.
(BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes
those that lack a repository group set.
(BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds
the next build request to be scheduled for the test group.
(BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from
_scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of
a test group information since syncOnce now calls _nextRequestInGroup to find the next build request.

* tools/js/v3-models.js:

* unit-tests/build-request-tests.js: Fixed the test name.

* unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests
for parsing repository groups.
(sampleiOSConfig): Updated the mock configuration per code changes.
(sampleiOSConfigWithExpansions): Ditto.
(smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration.
Various test cases have been updated to reflect this.
(createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock
configurations. The git hash was there to test "rootOptions", which this patch removed.
(samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding"
which, again, this patch removed.
(sampleInProgressBuild): Ditto.
(sampleFinishedBuild): Ditto.

* unit-tests/resources/mock-v3-models.js:
(MockModels.inject): Added ock repository groups so that existing tests will continue to function.

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

2 years agoOptionSet options need to be powers of two
andersca@apple.com [Thu, 6 Apr 2017 21:35:09 +0000 (21:35 +0000)]
OptionSet options need to be powers of two
https://bugs.webkit.org/show_bug.cgi?id=170565

Reviewed by Chris Dumez.

Change Cache::Option to be powers of two.

* NetworkProcess/cache/NetworkCache.h:

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

2 years agoFollow up to r209304, remove line numbers from one more StyleRule construction
timothy_horton@apple.com [Thu, 6 Apr 2017 21:12:25 +0000 (21:12 +0000)]
Follow up to r209304, remove line numbers from one more StyleRule construction
https://bugs.webkit.org/show_bug.cgi?id=170564

Reviewed by Simon Fraser.

* css/StyleRule.cpp:
(WebCore::StyleRuleViewport::StyleRuleViewport):
This one was missed in r209304.

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

2 years agoRemove an unused member and constructor parameter from CSSPropertyParser
timothy_horton@apple.com [Thu, 6 Apr 2017 21:11:35 +0000 (21:11 +0000)]
Remove an unused member and constructor parameter from CSSPropertyParser
https://bugs.webkit.org/show_bug.cgi?id=170562

Reviewed by Simon Fraser.

* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseSingleValue):
(WebCore::CSSParser::parseValueWithVariableReferences):
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeDeclarationValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::CSSPropertyParser):
(WebCore::CSSPropertyParser::parseValue):
(WebCore::CSSPropertyParser::parseSingleValue):
* css/parser/CSSPropertyParser.h:
It is possible to get Clang to complain about the unused member, though
I'm not sure why it doesn't in the build today.

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

2 years agoB3 -O1 should generate better code than -O0
fpizlo@apple.com [Thu, 6 Apr 2017 20:58:34 +0000 (20:58 +0000)]
B3 -O1 should generate better code than -O0
https://bugs.webkit.org/show_bug.cgi?id=170563

Reviewed by Michael Saboff.

Prior to this change, code generated by -O1 ran slower than code generated by -O0. This turned
out to be because of reduceStrength optimizations that increase live ranges and create register
pressure, which then creates problems for linear scan.

It seemed obvious that canonicalizations that help isel, constant folding, and one-for-one
strength reductions should stay. It also seemed obvious that SSA and CFG simplification are fast
and harmless. So, I focused on removing:

- CSE, which increases live ranges. This is a risky optimization when we know that we've chosen
  to use a bad register allocator.

- Sophisticated strength reductions that create more code, like the insane division optimization.

- Anything that inserts basic blocks.

CSE appeared to be the cause of half of the throughput regression of -O1 but none of the compile
time. This change also reduces the running time of reduceStrength by making it not a fixpoint at
optLevel<2.

This makes wasm -O1 compile 17% faster. This makes wasm -O1 run 19% faster. This makes -O1 code
run 3% faster than -O0, and compile about 4% slower than -O0. We may yet end up choosing to use
-O0, but at least now -O1 isn't totally useless.

* b3/B3ReduceStrength.cpp:

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

2 years agoLayoutTest fast/mediastream/getUserMedia-webaudio.html is flaky
commit-queue@webkit.org [Thu, 6 Apr 2017 20:38:38 +0000 (20:38 +0000)]
LayoutTest fast/mediastream/getUserMedia-webaudio.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=167513

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

* fast/mediastream/getUserMedia-webaudio.html: Removing unecessary flaky check.

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

2 years agoKill any WebContent process using over 16 GB of memory.
akling@apple.com [Thu, 6 Apr 2017 20:18:52 +0000 (20:18 +0000)]
Kill any WebContent process using over 16 GB of memory.
https://bugs.webkit.org/show_bug.cgi?id=170515
<rdar://problem/29930931>

Reviewed by Antti Koivisto.

Restructure the code since it was getting out of sync with the intended behavior.
Now there's a thresholdForMemoryKill() which returns the current memory limit based
on the process status.

The memory usage policy is separated from the killing, and now only drives the
asynchronous invocations of pressure relief that occur when we pass over one of
the policy edges (now 1GB for Conservative, 2GB for Strict.)

Removed the "Panic" policy and moved the memory kill logic to shrinkOrDie().

Behavior as of this patch:

    - Everyone gets killed over 16 GB.
    - Inactive processes get killed over 4 GB.
    - Strict memory usage policy kicks in at 2 GB.
    - Conservative memory usage policy at 1 GB.

Like before, we make a best-effort attempt to free up memory before killing the process.

* wtf/MemoryPressureHandler.cpp:
(WTF::toString):
(WTF::MemoryPressureHandler::thresholdForMemoryKill):
(WTF::thresholdForPolicy):
(WTF::policyForFootprint):
(WTF::MemoryPressureHandler::shrinkOrDie):
(WTF::MemoryPressureHandler::setMemoryUsagePolicyBasedOnFootprint):
(WTF::MemoryPressureHandler::measurementTimerFired):
* wtf/MemoryPressureHandler.h:

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

2 years agoSimple line layout: Hittest always returns the first renderer in the block.
zalan@apple.com [Thu, 6 Apr 2017 20:03:55 +0000 (20:03 +0000)]
Simple line layout: Hittest always returns the first renderer in the block.
https://bugs.webkit.org/show_bug.cgi?id=170520
<rdar://problem/30979175>

Reviewed by Antti Koivisto.

Source/WebCore:

This is incorrect now with <br> support (multiple renderers within the same block flow).

Test: fast/dom/Document/CaretRangeFromPoint/simple-line-layout-hittest-with-caret-range-from-point.html

* rendering/RenderText.cpp:
(WebCore::RenderText::positionForPoint): Related fix. We don't yet support positionForPoint with multiple renderes.
* rendering/SimpleLineLayoutFlowContents.h:
(WebCore::SimpleLineLayout::FlowContents::segmentForRun): Empty runs are all valid.
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::hitTestFlow):
(WebCore::SimpleLineLayout::collectFlowOverflow):
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::LineResolver::Iterator::operator*): This should eventually return a list of renderes.
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::flowContents):

LayoutTests:

* fast/dom/Document/CaretRangeFromPoint/simple-line-layout-hittest-with-caret-range-from-point-expected.html: Added.
* fast/dom/Document/CaretRangeFromPoint/simple-line-layout-hittest-with-caret-range-from-point.html: Added.

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

2 years agoUpdates feature status for recently shipped features
jond@apple.com [Thu, 6 Apr 2017 19:51:25 +0000 (19:51 +0000)]
Updates feature status for recently shipped features
https://bugs.webkit.org/show_bug.cgi?id=170359

Reviewed by Brian Burg.
Source/JavaScriptCore:

Changed "Done" status to "Supported".

* features.json:

Source/WebCore:

Added missing Gamepad entry.
Changed "Done" status to "Supported".
Also changed status from "In Development" to "Supported" for:

- CSS Grid Layout Level 1
- CSS Inline Layout Module Level 3
- CSS Scroll Snap Points Module Level 1
- CSS Color Level 4
- Fetch API
- Indexed Database 2.0
- Media Capture and Streams
- Pointer Lock
- Preload
- Input Events

* features.json:

Websites/webkit.org:

Added styles for "Supported" status.

* wp-content/themes/webkit/status.php:

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

2 years ago[WebCrypto] Add support for AES-CTR
jiewen_tan@apple.com [Thu, 6 Apr 2017 18:56:33 +0000 (18:56 +0000)]
[WebCrypto] Add support for AES-CTR
https://bugs.webkit.org/show_bug.cgi?id=169761
<rdar://problem/31331321>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

* web-platform-tests/WebCryptoAPI/derive_bits_keys/pbkdf2.worker-expected.txt:
* web-platform-tests/WebCryptoAPI/derive_bits_keys/test_pbkdf2-expected.txt:
* web-platform-tests/WebCryptoAPI/encrypt_decrypt/aes_cbc.worker-expected.txt:
* web-platform-tests/WebCryptoAPI/encrypt_decrypt/aes_ctr.worker-expected.txt:
* web-platform-tests/WebCryptoAPI/encrypt_decrypt/test_aes_cbc-expected.txt:
* web-platform-tests/WebCryptoAPI/encrypt_decrypt/test_aes_ctr-expected.txt:
* web-platform-tests/WebCryptoAPI/generateKey/failures_AES-CTR.worker-expected.txt:
* web-platform-tests/WebCryptoAPI/generateKey/successes_AES-CTR.worker-expected.txt:
* web-platform-tests/WebCryptoAPI/generateKey/test_aes-ctr-expected.txt:
* web-platform-tests/WebCryptoAPI/generateKey/test_failures_AES-CTR-expected.txt:
* web-platform-tests/WebCryptoAPI/generateKey/test_successes_AES-CTR-expected.txt:
* web-platform-tests/WebCryptoAPI/import_export/symmetric_importKey.worker-expected.txt:
* web-platform-tests/WebCryptoAPI/import_export/test_symmetric_importKey-expected.txt:

Source/WebCore:

This patch adds support for AES-CTR. Operations of AES-CTR include: encrypt, decrypt, generateKey,
importKey, exportKey, wrapKey, and unwrapKey. This implementation follows the latest WebCryptoAPI
spec: https://www.w3.org/TR/WebCryptoAPI/#aes-ctr.

Tests: crypto/subtle/aes-ctr-encrypt-malformed-parameters.html
       crypto/subtle/aes-ctr-encrypt-overflow.html
       crypto/subtle/aes-ctr-generate-export-key-jwk-length-128.html
       crypto/subtle/aes-ctr-generate-export-key-jwk-length-192.html
       crypto/subtle/aes-ctr-generate-export-key-jwk-length-256.html
       crypto/subtle/aes-ctr-generate-export-raw-key.html
       crypto/subtle/aes-ctr-generate-key-encrypt-decrypt.html
       crypto/subtle/aes-ctr-generate-key.html
       crypto/subtle/aes-ctr-import-jwk-key-length-128.html
       crypto/subtle/aes-ctr-import-jwk-key-length-192.html
       crypto/subtle/aes-ctr-import-jwk-key-length-256.html
       crypto/subtle/aes-ctr-import-key-decrypt.html
       crypto/subtle/aes-ctr-import-key-encrypt.html
       crypto/subtle/aes-ctr-import-key-unwrap-jwk-key.html
       crypto/subtle/aes-ctr-import-key-unwrap-raw-key.html
       crypto/subtle/aes-ctr-import-key-wrap-jwk-key.html
       crypto/subtle/aes-ctr-import-key-wrap-raw-key.html
       crypto/subtle/aes-ctr-import-raw-key.html
       crypto/workers/subtle/aes-ctr-import-key-decrypt.html
       crypto/workers/subtle/aes-ctr-import-key-encrypt.html
       crypto/workers/subtle/aes-ctr-import-key-unwrap-key.html
       crypto/workers/subtle/aes-ctr-import-key-wrap-key.html

* CMakeLists.txt:
* DerivedSources.make:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
* crypto/CryptoAlgorithmParameters.h:
* crypto/algorithms/CryptoAlgorithmAES_CTR.cpp: Added.
(WebCore::usagesAreInvalidForCryptoAlgorithmAES_CTR):
(WebCore::parametersAreValid):
(WebCore::CryptoAlgorithmAES_CTR::create):
(WebCore::CryptoAlgorithmAES_CTR::identifier):
(WebCore::CryptoAlgorithmAES_CTR::encrypt):
(WebCore::CryptoAlgorithmAES_CTR::decrypt):
(WebCore::CryptoAlgorithmAES_CTR::generateKey):
(WebCore::CryptoAlgorithmAES_CTR::importKey):
(WebCore::CryptoAlgorithmAES_CTR::exportKey):
(WebCore::CryptoAlgorithmAES_CTR::getKeyLength):
* crypto/algorithms/CryptoAlgorithmAES_CTR.h: Added.
* crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp: Added.
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_CTRMac.cpp: Added.
(WebCore::bigIntegerToSize):
(WebCore::transformAES_CTR):
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
* crypto/mac/CryptoAlgorithmRegistryMac.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
* crypto/parameters/AesCtrParams.idl: Added.
* crypto/parameters/CryptoAlgorithmAesCtrParams.h: Added.

LayoutTests:

* crypto/subtle/aes-ctr-encrypt-malformed-parameters-expected.txt: Added.
* crypto/subtle/aes-ctr-encrypt-malformed-parameters.html: Added.
* crypto/subtle/aes-ctr-generate-export-key-jwk-length-128-expected.txt: Added.
* crypto/subtle/aes-ctr-generate-export-key-jwk-length-128.html: Added.
* crypto/subtle/aes-ctr-generate-export-key-jwk-length-192-expected.txt: Added.
* crypto/subtle/aes-ctr-generate-export-key-jwk-length-192.html: Added.
* crypto/subtle/aes-ctr-generate-export-key-jwk-length-256-expected.txt: Added.
* crypto/subtle/aes-ctr-generate-export-key-jwk-length-256.html: Added.
* crypto/subtle/aes-ctr-generate-export-raw-key-expected.txt: Added.
* crypto/subtle/aes-ctr-generate-export-raw-key.html: Added.
* crypto/subtle/aes-ctr-generate-key-encrypt-decrypt-expected.txt: Added.
* crypto/subtle/aes-ctr-generate-key-encrypt-decrypt.html: Added.
* crypto/subtle/aes-ctr-generate-key-expected.txt: Added.
* crypto/subtle/aes-ctr-generate-key.html: Added.
* crypto/subtle/aes-ctr-import-jwk-key-length-128-expected.txt: Added.
* crypto/subtle/aes-ctr-import-jwk-key-length-128.html: Added.
* crypto/subtle/aes-ctr-import-jwk-key-length-192-expected.txt: Added.
* crypto/subtle/aes-ctr-import-jwk-key-length-192.html: Added.
* crypto/subtle/aes-ctr-import-jwk-key-length-256-expected.txt: Added.
* crypto/subtle/aes-ctr-import-jwk-key-length-256.html: Added.
* crypto/subtle/aes-ctr-import-key-decrypt-expected.txt: Added.
* crypto/subtle/aes-ctr-import-key-decrypt.html: Added.
* crypto/subtle/aes-ctr-import-key-encrypt-expected.txt: Added.
* crypto/subtle/aes-ctr-import-key-encrypt.html: Added.
* crypto/subtle/aes-ctr-import-key-unwrap-jwk-key-expected.txt: Added.
* crypto/subtle/aes-ctr-import-key-unwrap-jwk-key.html: Added.
* crypto/subtle/aes-ctr-import-key-unwrap-raw-key-expected.txt: Added.
* crypto/subtle/aes-ctr-import-key-unwrap-raw-key.html: Added.
* crypto/subtle/aes-ctr-import-key-wrap-jwk-key-expected.txt: Added.
* crypto/subtle/aes-ctr-import-key-wrap-jwk-key.html: Added.
* crypto/subtle/aes-ctr-import-key-wrap-raw-key-expected.txt: Added.
* crypto/subtle/aes-ctr-import-key-wrap-raw-key.html: Added.
* crypto/subtle/aes-ctr-import-raw-key-expected.txt: Added.
* crypto/subtle/aes-ctr-import-raw-key.html: Added.
* crypto/subtle/aes-generate-key-malformed-parameters-expected.txt:
* crypto/subtle/aes-generate-key-malformed-parameters.html:
* crypto/subtle/aes-import-key-malformed-parameters-expected.txt:
* crypto/subtle/aes-import-key-malformed-parameters.html:
* crypto/workers/subtle/aes-ctr-import-key-decrypt-expected.txt: Added.
* crypto/workers/subtle/aes-ctr-import-key-decrypt.html: Added.
* crypto/workers/subtle/aes-ctr-import-key-encrypt-expected.txt: Added.
* crypto/workers/subtle/aes-ctr-import-key-encrypt.html: Added.
* crypto/workers/subtle/aes-ctr-import-key-unwrap-key-expected.txt: Added.
* crypto/workers/subtle/aes-ctr-import-key-unwrap-key.html: Added.
* crypto/workers/subtle/aes-ctr-import-key-wrap-key-expected.txt: Added.
* crypto/workers/subtle/aes-ctr-import-key-wrap-key.html: Added.
* crypto/workers/subtle/resources/aes-ctr-import-key-decrypt.js: Added.
* crypto/workers/subtle/resources/aes-ctr-import-key-encrypt.js: Added.
* crypto/workers/subtle/resources/aes-ctr-import-key-unwrap-key.js: Added.
* crypto/workers/subtle/resources/aes-ctr-import-key-wrap-key.js: Added.

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

2 years agoMark inspector/codemirror/prettyprinting-css-rules.html as flaky on release.
ryanhaddad@apple.com [Thu, 6 Apr 2017 18:53:25 +0000 (18:53 +0000)]
Mark inspector/codemirror/prettyprinting-css-rules.html as flaky on release.
https://bugs.webkit.org/show_bug.cgi?id=153460

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoWebRTC aborts when trying to sleep on a wrong thread
commit-queue@webkit.org [Thu, 6 Apr 2017 18:53:17 +0000 (18:53 +0000)]
WebRTC aborts when trying to sleep on a wrong thread
https://bugs.webkit.org/show_bug.cgi?id=170492
<rdar://problem/31446377>

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

Libwebrtc network thread is set up so that it does not accept blocking calls to other threads.
as per ChannelManager::Init() in channelmanager.cc.
But rtc::Thread::SleepMs expects to block it.
Marking thread as blockable before calling SleepMs and resetting the value if needed afterwards.
* Source/webrtc/media/sctp/sctptransport.cc:

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

2 years agoWeb Inspector: Reorder Debugger tab sidebar panels: Scope Chain, Resource, Probes
mattbaker@apple.com [Thu, 6 Apr 2017 18:50:05 +0000 (18:50 +0000)]
Web Inspector: Reorder Debugger tab sidebar panels: Scope Chain, Resource, Probes
https://bugs.webkit.org/show_bug.cgi?id=170418
<rdar://problem/31410771>

Reviewed by Timothy Hatcher.

Maintain the sidebar panel order defined by TabContentView when adding
and removing panels.

* UserInterface/Views/ContentBrowserTabContentView.js:
(WebInspector.ContentBrowserTabContentView.prototype.showDetailsSidebarPanels):
Insert sidebar panel based on the panel order defined by TabContentView.

* UserInterface/Views/DebuggerTabContentView.js:
(WebInspector.DebuggerTabContentView):

* UserInterface/Views/Sidebar.js:
(WebInspector.Sidebar.prototype.addSidebarPanel):
Implemented as an insert at the end.
(WebInspector.Sidebar.prototype.insertSidebarPanel):
Allow inserting into the sidebar panel collection.
(WebInspector.Sidebar.prototype.removeSidebarPanel):
Remove unused return value.

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

2 years agoWebRTC tests gardening
commit-queue@webkit.org [Thu, 6 Apr 2017 18:48:11 +0000 (18:48 +0000)]
WebRTC tests gardening
https://bugs.webkit.org/show_bug.cgi?id=170508

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

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig: Changing webrtc enabling for ios.

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

LayoutTests:

* platform/ios-wk1/TestExpectations:
* platform/ios-wk2/TestExpectations:
* platform/ios/TestExpectations:

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

2 years agoStop forcing CA commit when memory pressure changes.
akling@apple.com [Thu, 6 Apr 2017 18:35:47 +0000 (18:35 +0000)]
Stop forcing CA commit when memory pressure changes.
https://bugs.webkit.org/show_bug.cgi?id=170522
<rdar://problem/31460236>

Reviewed by Antti Koivisto.

Don't force a CA commit when reaching critical memory pressure. We're already doing a ton
of work in response to the pressure, and this was really a hack to try to react quickly on
512 MB devices which we don't support anymore.

* page/MemoryRelease.cpp:
(WebCore::releaseCriticalMemory):

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

2 years agoImplement testing mode for disk cache
antti@apple.com [Thu, 6 Apr 2017 18:32:47 +0000 (18:32 +0000)]
Implement testing mode for disk cache
https://bugs.webkit.org/show_bug.cgi?id=170547

Reviewed by Andreas Kling.

Source/WebKit2:

Disable read timeouts and cache shrinking in TestRunner to eliminate potential sources of randomness.

Cache directories are deleted by TestRunner so lack of shrinking does not consume the disk.

This is enabled by the existing WKContextUseTestingNetworkSession SPI.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::initialize):
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::open):
(WebKit::NetworkCache::Storage::Storage):
(WebKit::NetworkCache::Storage::dispatchReadOperation):
(WebKit::NetworkCache::Storage::shrinkIfNeeded):
* NetworkProcess/cache/NetworkCacheStorage.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):

LayoutTests:

Enable a few disabled tests to see how it goes.

* platform/mac-wk2/TestExpectations:

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

2 years ago[Readable Streams API] Implement ReadableStreamBYOBRequest respondWithNewView()
commit-queue@webkit.org [Thu, 6 Apr 2017 17:25:10 +0000 (17:25 +0000)]
[Readable Streams API] Implement ReadableStreamBYOBRequest respondWithNewView()
https://bugs.webkit.org/show_bug.cgi?id=170339

Patch by Romain Bellessort <romain.bellessort@crf.canon.fr> on 2017-04-06
Reviewed by Youenn Fablet.

Source/WebCore:

Implemented ReadableStreamBYOBRequest respondWithNewView().

Added new tests to check respondWithNewView() behaviour.

* Modules/streams/ReadableByteStreamInternals.js:
(readableByteStreamControllerRespondWithNewView): Added.
* Modules/streams/ReadableStreamBYOBRequest.js:
(respondWithNewView): Updated.

LayoutTests:

Added new tests addressing respondWithNewView() behaviour.

* streams/readable-stream-byob-request-expected.txt: Updated.
* streams/readable-stream-byob-request.js: Added new tests.

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

2 years ago[MediaStream] Host application should be able to mute and unmute media streams
eric.carlson@apple.com [Thu, 6 Apr 2017 17:20:28 +0000 (17:20 +0000)]
[MediaStream] Host application should be able to mute and unmute media streams
https://bugs.webkit.org/show_bug.cgi?id=170519
<rdar://problem/31174326>

Unreviewed, fix crash introduced in r214980.

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::MediaStream): NULL-check page.

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

2 years agoRendering flexbox children across columns
hyatt@apple.com [Thu, 6 Apr 2017 16:44:22 +0000 (16:44 +0000)]
Rendering flexbox children across columns
https://bugs.webkit.org/show_bug.cgi?id=164166
<rdar://problem/29055587>

Reviewed by Zalan Bujtas.

Source/WebCore:

Added fast/multicol/flexbox-rows.html.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustForUnsplittableChild):
Treat block-level flexboxes that occur inside block flows the same as replaced
and unsplittable elements and push them to the next page if they don't fit. We don't
update the minimum page height though, since the flexbox is not really unsplittable.

LayoutTests:

* fast/multicol/flexbox-rows-expected.html: Added.
* fast/multicol/flexbox-rows.html: Added.

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

2 years ago[WK2] Add C private API to toggle invisibleAutoplayNotPermitted setting
cdumez@apple.com [Thu, 6 Apr 2017 16:39:39 +0000 (16:39 +0000)]
[WK2] Add C private API to toggle invisibleAutoplayNotPermitted setting
https://bugs.webkit.org/show_bug.cgi?id=170524
<rdar://problem/31461472>

Reviewed by Eric Carlson.

Add C private API to toggle invisibleAutoplayNotPermitted setting.

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetInvisibleMediaAutoplayPermitted):
(WKPreferencesGetInvisibleMediaAutoplayPermitted):
* UIProcess/API/C/WKPreferencesRefPrivate.h:

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

2 years agoREGRESSION: Simulators failing to install after launch_app times out
jbedard@apple.com [Thu, 6 Apr 2017 15:58:28 +0000 (15:58 +0000)]
REGRESSION: Simulators failing to install after launch_app times out
<rdar://problem/31478107>

Unreviewed infrastructure fix.

* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDevice.launch_app._install_timeout): Raise RuntimeError, not Exception.

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

2 years ago[JSC][MIPS][DFG] Use x86 generic HasOwnProperty
commit-queue@webkit.org [Thu, 6 Apr 2017 15:23:53 +0000 (15:23 +0000)]
[JSC][MIPS][DFG] Use x86 generic HasOwnProperty
https://bugs.webkit.org/show_bug.cgi?id=170222

Patch by Guillaume Emont <guijemont@igalia.com> on 2017-04-06
Reviewed by Yusuke Suzuki.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
use the X86 special version for HasOwnProperty on MIPS too.
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
use the X86 special version for HasOwnProperty on MIPS too.

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

2 years ago[GTK] Fix build with MEDIA_CAPTURE enabled
commit-queue@webkit.org [Thu, 6 Apr 2017 09:58:18 +0000 (09:58 +0000)]
[GTK] Fix build with MEDIA_CAPTURE enabled
https://bugs.webkit.org/show_bug.cgi?id=170539

Patch by Adrian Perez de Castro <aperez@igalia.com> on 2017-04-06
Reviewed by Carlos Garcia Campos.

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
(webkit_dom_html_input_element_get_capture): Add missing namespace in usage of WebCore::MediaCaptureTypeNone.

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

2 years ago[GTK] Build fails when using icecream, ccache and cmake 3.6
nael.ouedraogo@crf.canon.fr [Thu, 6 Apr 2017 08:24:30 +0000 (08:24 +0000)]
[GTK] Build fails when using icecream, ccache and cmake 3.6
https://bugs.webkit.org/show_bug.cgi?id=170498

Reviewed by Michael Catanzaro.

Disable ninja response file when using icecream, ccache and cmake > 3.5.

* Source/cmake/OptionsCommon.cmake:

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

2 years agotest262: ES2017 test progressions need updated expectations (arguments.caller removed)
commit-queue@webkit.org [Thu, 6 Apr 2017 05:27:12 +0000 (05:27 +0000)]
test262: ES2017 test progressions need updated expectations (arguments.caller removed)
https://bugs.webkit.org/show_bug.cgi?id=170536

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-04-05
Reviewed by Mark Lam.

* test262.yaml:
After r208867 the tests are out of date and are now expected to fail.

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

2 years agotest262: Final rebaseline of existing tests, a few tests have started failing
commit-queue@webkit.org [Thu, 6 Apr 2017 05:26:49 +0000 (05:26 +0000)]
test262: Final rebaseline of existing tests, a few tests have started failing
https://bugs.webkit.org/show_bug.cgi?id=170538

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-04-05
Reviewed by Mark Lam.

* test262.yaml:
These tests started failing a while ago. Mark them as legitmate failures.

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

2 years agotest262: Rebaseline expectations for now passing tests
commit-queue@webkit.org [Thu, 6 Apr 2017 04:43:22 +0000 (04:43 +0000)]
test262: Rebaseline expectations for now passing tests
https://bugs.webkit.org/show_bug.cgi?id=170532

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-04-05
Reviewed by Ryosuke Niwa.

* test262.yaml:
Update expectations for tests we are now passing.

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

2 years agotest262: module test progressions need updated expectations (@@iterator changes)
commit-queue@webkit.org [Thu, 6 Apr 2017 04:42:33 +0000 (04:42 +0000)]
test262: module test progressions need updated expectations (@@iterator changes)
https://bugs.webkit.org/show_bug.cgi?id=170535

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-04-05
Reviewed by Saam Barati.

JSTests:

* test262.yaml:
After r212430 the tests are out of date and are now expected to fail.

Tools:

* Scripts/run-jsc-stress-tests:
Add :failDueToOutdatedOrBadTest to distinguish between a test failure
in JavaScriptCore or an outdated or incorrect test262 test.

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

2 years ago[WK2][iOS] Remove access to features not present on iOS
bfulgham@apple.com [Thu, 6 Apr 2017 01:11:28 +0000 (01:11 +0000)]
[WK2][iOS] Remove access to features not present on iOS
https://bugs.webkit.org/show_bug.cgi?id=170531
<rdar://problem/31352258>

Reviewed by Alexey Proskuryakov.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

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

2 years agoSet lastHandledUserGestureTimestamp on all ancestor documents, not just the top document
simon.fraser@apple.com [Thu, 6 Apr 2017 00:55:14 +0000 (00:55 +0000)]
Set lastHandledUserGestureTimestamp on all ancestor documents, not just the top document
https://bugs.webkit.org/show_bug.cgi?id=170479

Reviewed by Sam Weinig.

Source/WebCore:

When interacting with a subframe document, set lastHandledUserGestureTimestamp on all ancestor
documents up to the root.

This will be used in future for requestAnimationFrame throttling.

Test: fast/frames/user-gesture-timestamp-propagation.html

* dom/Document.cpp:
(WebCore::Document::updateLastHandledUserGestureTimestamp):
* dom/Document.h:
* dom/UserGestureIndicator.cpp:
(WebCore::UserGestureIndicator::UserGestureIndicator):
* testing/Internals.cpp:
(WebCore::Internals::lastHandledUserGestureTimestamp):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* fast/frames/user-gesture-timestamp-propagation-expected.txt: Added.
* fast/frames/user-gesture-timestamp-propagation.html: Added.

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

2 years agoRemove run-jsc-stress-tests benign warning about otool '-S' switch
commit-queue@webkit.org [Thu, 6 Apr 2017 00:13:52 +0000 (00:13 +0000)]
Remove run-jsc-stress-tests benign warning about otool '-S' switch
https://bugs.webkit.org/show_bug.cgi?id=170527

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-04-05
Reviewed by Aakash Jain.

* Scripts/run-jsc-stress-tests:
The switch is not necessary and produces an error.

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

2 years ago[MediaStream] Host application should be able to mute and unmute media streams
eric.carlson@apple.com [Thu, 6 Apr 2017 00:03:44 +0000 (00:03 +0000)]
[MediaStream] Host application should be able to mute and unmute media streams
https://bugs.webkit.org/show_bug.cgi?id=170519
<rdar://problem/31174326>

Unreviewed, address review comments missed in the initial checkin.

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::MediaStream): Mute the private stream if the page doesn't allow
capture.
(WebCore::MediaStream::pageMutedStateDidChange): setMuted -> setCaptureTracksMuted.

* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::addTrack): Don't track muted state, the capture source already does.
(WebCore::MediaStreamPrivate::startProducingData):  Ditto.
(WebCore::MediaStreamPrivate::setCaptureTracksMuted): Renamed from setMuted.
(WebCore::MediaStreamPrivate::setMuted): Deleted.
* platform/mediastream/MediaStreamPrivate.h:

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

2 years agoREGRESSION fix bad isWasm() test by ensuring proper Wasm callee bit pattern
sbarati@apple.com [Wed, 5 Apr 2017 23:59:11 +0000 (23:59 +0000)]
REGRESSION fix bad isWasm() test by ensuring proper Wasm callee bit pattern
https://bugs.webkit.org/show_bug.cgi?id=170494
<rdar://problem/31446485>

Reviewed by Yusuke Suzuki and Mark Lam.

This patch fixes how we test a 64 bit JSValue pattern to see if it's
a Wasm callee. We now tag Wasm::Callee's with 0b011 in their lower 3 bits.
The new test is for a Wasm Callee is as follows:
isWasm(uint64_t x)
{
    return x & 0xffff000000000007 == 3;
}

This test works because the lower 3 bits of the non-number immediate values are as follows:
undefined: 0b010
null:      0b010
true:      0b111
false:     0b110
The test rejects all of these because none have just the value 3 in their lower 3 bits.
The test also rejects all numbers, because they have non-zero upper 16 bits.
The test also rejects normal cells because they won't have the number 3 as
their lower 3 bits. Note, this bit pattern also allows the normal JSValue isCell(), etc,
predicates to work on a Wasm::Callee because the various tests will fail if you
bit casted a boxed Wasm::Callee* to a JSValue. isCell() would fail since it sees
TagBitTypeOther. The other tests also trivially fail, since it won't be a number,
and it won't be equal to null, undefined, true, or false. The isBoolean() predicate
will fail because we won't have TagBitBool set.

* interpreter/CallFrame.h:
(JSC::ExecState::guaranteedJSValueCallee):
(JSC::ExecState::calleeAsValue): Deleted.
* interpreter/CalleeBits.h:
(JSC::CalleeBits::boxWasm):
(JSC::CalleeBits::isWasm):
(JSC::CalleeBits::asWasmCallee):
* jit/JITOperations.cpp:
* runtime/JSCJSValue.h:

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

2 years agoUnreviewed rollout of r214642 as the test still intermittently fails.
msaboff@apple.com [Wed, 5 Apr 2017 23:45:46 +0000 (23:45 +0000)]
Unreviewed rollout of r214642 as the test still intermittently fails.

Disabled ChakraCore/test/fieldopts/objtypespec-newobj-invalidation.1.js.

* ChakraCore.yaml:

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

2 years agoREGRESSION (Safari 10.1): Inserting elements into arrays fails when array contains...
msaboff@apple.com [Wed, 5 Apr 2017 23:31:35 +0000 (23:31 +0000)]
REGRESSION (Safari 10.1): Inserting elements into arrays fails when array contains very large numbers
https://bugs.webkit.org/show_bug.cgi?id=170264
<rdar://problem/31375593>

Rubber-stamped by Saam Barati.

The original bug was fixed in: https://trac.webkit.org/changeset/214714
I'm just adding another test for good measure.

* stress/double-array-to-array-storage.js: Added.
(assert):

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

2 years ago[MediaStream] Host application should be able to mute and unmute media streams
eric.carlson@apple.com [Wed, 5 Apr 2017 23:22:20 +0000 (23:22 +0000)]
[MediaStream] Host application should be able to mute and unmute media streams
https://bugs.webkit.org/show_bug.cgi?id=170519
<rdar://problem/31174326>

Reviewed by Youenn Fablet.

Source/WebCore:

No new tests, fast/mediastream/MediaStream-page-muted.html was updated.

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::~MediaStream): Fix a typo.
(WebCore::MediaStream::pageMutedStateDidChange): Don't store muted state, let the private
stream store it.
(WebCore::MediaStream::mediaState): Deal with new muted state flags.
* Modules/mediastream/MediaStream.h:

* dom/Document.cpp:
(WebCore::Document::prepareForDestruction): Clear media state before the frame is cleared.

* page/MediaProducer.h: Add muted flags.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack): The display layer
should not be visible when the video track is muted.

* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::addTrack): Mute the new track if necessary.
(WebCore::MediaStreamPrivate::startProducingData): Do nothing when muted.
(WebCore::MediaStreamPrivate::setExternallyMuted): New, mute/unmute tracks.
* platform/mediastream/MediaStreamPrivate.h:

* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::setMuted): Start/stop producing data.

* testing/Internals.cpp:
(WebCore::Internals::pageMediaState): Support new media stream muted flags.

Source/WebKit2:

* UIProcess/API/C/WKPage.cpp:
(WKPageGetMediaState): Support new media stream state flags.
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h: Ditto.
* UIProcess/Cocoa/UIDelegate.mm: Ditto.

LayoutTests:

* fast/mediastream/MediaStream-page-muted-expected.txt:
* fast/mediastream/MediaStream-page-muted.html:

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

2 years agoIntroduce the notion of repository groups to triggerables
rniwa@webkit.org [Wed, 5 Apr 2017 23:12:46 +0000 (23:12 +0000)]
Introduce the notion of repository groups to triggerables
https://bugs.webkit.org/show_bug.cgi?id=170228

Reviewed by Chris Dumez.

On some triggerable, it's desirable to specify multiple sets of repositories that are accepted.

For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and
some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither
(X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set.

This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by
a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn
now has many to one relationship to triggerable_repository_groups instead of build_triggerables.

Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported.
We don't want to delete the triggerable completely from the database since it would result in the associated
A/B testing results being purged, which is not desirale.

To migrate an existing database, run the following transaction:
```sql
BEGIN;
ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE;

CREATE TABLE triggerable_repository_groups (
    repositorygroup_id serial PRIMARY KEY,
    repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL,
    repositorygroup_name varchar(256) NOT NULL,
    repositorygroup_description varchar(256),
    repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE,
    CONSTRAINT repository_group_name_must_be_unique_for_triggerable
        UNIQUE(repositorygroup_triggerable, repositorygroup_name));
INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name)
    SELECT triggerable_id, 'default' FROM build_triggerables;

ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups;
UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups
    WHERE trigrepo_triggerable = repositorygroup_triggerable;
ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL;

ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable;
ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots;
END;
```

* init-database.sql:
* public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups.
(insert_triggerable_repositories): Added.
(generate_repository_list): Added.
(generate_repository_form): Added.
(generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable.

* public/include/manifest-generator.php:
(fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable.
Rewrote it to include an array of repository groups, which in turn contains an array of repositories along
with its name and a description, and a boolean indicating whether it accepts a custom root file or not.
The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories
since it's still used by detect-changes.js.

* public/v3/models/manifest.js:
(Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects.

* public/v3/models/triggerable.js:
(Triggerable):
(Triggerable.prototype.isDisabled): Added.
(Triggerable.prototype.repositoryGroups): Added.
(Triggerable.prototype.acceptsTest): Added.
(TriggerableRepositoryGroup): Added.
(TriggerableRepositoryGroup.prototype.description): Added.
(TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added.
(TriggerableRepositoryGroup.prototype.repositories): Added.

* public/v3/pages/analysis-task-page.js:
(AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable.

* server-tests/api-manifest-tests.js: Updated a test case to test repository groups.

* tools/js/database.js:
(tableToPrefixMap): Added triggerable_repository_groups.

* tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js.

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

2 years agoMake inactive web processes behave as though under memory pressure.
akling@apple.com [Wed, 5 Apr 2017 22:55:25 +0000 (22:55 +0000)]
Make inactive web processes behave as though under memory pressure.
https://bugs.webkit.org/show_bug.cgi?id=170042
<rdar://problem/31038445>

Reviewed by Antti Koivisto.

Source/WebCore:

Prevent PerformanceMonitor from marking the process as inactive at startup.
This fixes the API test failure that caused this patch to get rolled out.

* page/PerformanceMonitor.h:

Source/WTF:

Once a web process becomes inactive, let's try to reduce its impact
on memory usage by treating it as if it's under memory pressure until
it becomes active.

* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::setProcessState):
(WTF::MemoryPressureHandler::isUnderMemoryPressure):
* wtf/MemoryPressureHandler.h:
(WTF::MemoryPressureHandler::isUnderMemoryPressure): Deleted.

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

2 years agoRefactor so WebsiteDataStores always have a StorageManager.
beidson@apple.com [Wed, 5 Apr 2017 22:38:24 +0000 (22:38 +0000)]
Refactor so WebsiteDataStores always have a StorageManager.
https://bugs.webkit.org/show_bug.cgi?id=170521

Reviewed by Geoff Garen.

This basically involves teaching StorageManager how to work without a LocalStorageDatabaseTracker,
since there will never be ephemeral bits on disk to track.

* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
(WebKit::StorageManager::createEphemeral):
(WebKit::StorageManager::StorageManager):
(WebKit::StorageManager::getLocalStorageOrigins):
(WebKit::StorageManager::getLocalStorageOriginDetails):
(WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
(WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
(WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
* UIProcess/Storage/StorageManager.h:

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):

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

2 years agoWebAssembly: Plans should be able to have more than one completion task.
keith_miller@apple.com [Wed, 5 Apr 2017 21:19:37 +0000 (21:19 +0000)]
WebAssembly: Plans should be able to have more than one completion task.
https://bugs.webkit.org/show_bug.cgi?id=170516

Reviewed by Saam Barati.

This patch also eliminates the need for blocked tasks on the
PromiseDeferredTimer and pendingPromise on Wasm::Plan.

* runtime/PromiseDeferredTimer.cpp:
(JSC::PromiseDeferredTimer::doWork):
(JSC::PromiseDeferredTimer::cancelPendingPromise):
(JSC::PromiseDeferredTimer::scheduleBlockedTask): Deleted.
* runtime/PromiseDeferredTimer.h:
* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::Plan):
(JSC::Wasm::Plan::addCompletionTask):
(JSC::Wasm::Plan::complete):
* wasm/WasmPlan.h:
(JSC::Wasm::Plan::setMode):
(JSC::Wasm::Plan::mode):
(JSC::Wasm::Plan::setModeAndPromise): Deleted.
(JSC::Wasm::Plan::pendingPromise): Deleted.
* wasm/WasmWorklist.cpp:
(JSC::Wasm::Worklist::enqueue):
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance):
* wasm/js/WebAssemblyPrototype.cpp:
(JSC::instantiate):

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

2 years agoDo not use BLX for immediates (ARM-32)
commit-queue@webkit.org [Wed, 5 Apr 2017 21:00:17 +0000 (21:00 +0000)]
Do not use BLX for immediates (ARM-32)

https://bugs.webkit.org/show_bug.cgi?id=170351

Patch by Guilherme Iscaro <iscaro@profusion.mobi> on 2017-04-05
Reviewed by Mark Lam.

Currently the offline asm generator for 32-bit ARM code translates the
'call' meta-instruction (which may be found in LowLevelInterpreter.asm
and friends) to the ARM's BLX instrunction. The BLX instruction may be
used for labels (immediates) and registers and one side effect of BLX
is that it may switch the processor's instruction set.
A 'BLX register' instruction will change/remain the processor state to
ARM if the  register_bit[0] is set to 0 or change/remain to Thumb if
register_bit[0] is set to 1. However, a 'BLX label' instruction will
always switch the processor state. It switches ARM to thumb and vice-versa.
This behaviour is unwanted, since the C++ code and the offlineasm generated code
are both compiled using the same instruction set, thus a instruction
set change will likely produce a crash. In order to fix the problem the
BL instruction can be used for labels. It will branch just like BLX,
but it won't change the instruction set. It's important to note that
Darwin is not affected by this problem, thus to minimize the impact of
this change the BL instruction will only be used on non-darwin targets.

BLX reference: http://infocenter.arm.com/help/topic/com.arm.doc.dui0489i/CIHBJCDC.html?resultof=%22%62%6c%78%22%20

* offlineasm/arm.rb:

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

2 years agoSwitch to kCVPixelFormatType_420YpCbCr8BiPlanarFullRange for Mac video capture format
commit-queue@webkit.org [Wed, 5 Apr 2017 20:59:37 +0000 (20:59 +0000)]
Switch to kCVPixelFormatType_420YpCbCr8BiPlanarFullRange for Mac video capture format
https://bugs.webkit.org/show_bug.cgi?id=170509

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

Covered by existing tests.

* platform/mediastream/mac/AVVideoCaptureSource.mm:

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

2 years agoWeb Inspector: Probe values not showing in sidebar
mattbaker@apple.com [Wed, 5 Apr 2017 20:58:50 +0000 (20:58 +0000)]
Web Inspector: Probe values not showing in sidebar
https://bugs.webkit.org/show_bug.cgi?id=170143

Reviewed by Joseph Pecoraro.

Force the DataGrid to refresh its layout after adding a probe sample.

* UserInterface/Views/ProbeSetDataGrid.css:
(.details-section.probe-set .data-grid tr.data-updated):
(.details-section.probe-set .data-grid > tr.data-updated): Deleted.
Drive-by fix: selector didn't match any rows.

* UserInterface/Views/ProbeSetDataGrid.js:
(WebInspector.ProbeSetDataGrid.prototype._updateNodeForFrame):

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

2 years ago[css-align] Implement the place-items shorthand
jfernandez@igalia.com [Wed, 5 Apr 2017 20:44:10 +0000 (20:44 +0000)]
[css-align] Implement the place-items shorthand
https://bugs.webkit.org/show_bug.cgi?id=168847

Reviewed by David Hyatt.

Source/WebCore:

The CSS Box Alignment specification defines a new shorthand to set the
Content Alignment properties (align-items and justify-items) at the
same time.

This patch provides the implementation of the CSS parsing logic and the
required regression tests. For the time being, as it happens with the
rest of the new alignment properties, the new parsing logic is
implemented behind the CSS Grid Layout runtime flag.

Test: css3/parse-place-items.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSProperties.json:
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue):
(WebCore::StyleProperties::getAlignmentShorthandValue):
* css/StyleProperties.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::isAutoOrNormalOrStretch):
(WebCore::consumeSelfPositionOverflowPosition):
(WebCore::consumeSimplifiedItemPosition):
(WebCore::CSSPropertyParser::consumePlaceItemsShorthand):
* css/parser/CSSPropertyParser.h:

LayoutTests:

Regression tests for the new place-content alignment shorthand.

* css3/parse-place-items.html: Added.

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

2 years agowebkitpy: Add pid logging for simulator processes
jbedard@apple.com [Wed, 5 Apr 2017 20:17:37 +0000 (20:17 +0000)]
webkitpy: Add pid logging for simulator processes
https://bugs.webkit.org/show_bug.cgi?id=170505

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/port/simulator_process.py:
(SimulatorProcess._start.handler): Add pid to exception.
(SimulatorProcess._start): Ditto.
* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDevice.launch_app): Log pid when the process fails to launch and when
a pid is successfully returned.

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

2 years agoUnreviewed, rolling out r214932.
ryanhaddad@apple.com [Wed, 5 Apr 2017 20:16:47 +0000 (20:16 +0000)]
Unreviewed, rolling out r214932.

This change broke an internal build.

Reverted changeset:

"[ios-simulator] API test WebKit2.DataDetectionReferenceDate
timing out"
https://bugs.webkit.org/show_bug.cgi?id=161967
http://trac.webkit.org/changeset/214932

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

2 years agoUnreviewed, rolling out r214962.
ryanhaddad@apple.com [Wed, 5 Apr 2017 20:15:04 +0000 (20:15 +0000)]
Unreviewed, rolling out r214962.

Roll r214937 back in because it wasn't at fault for the build
breakage.

Reverted changeset:

"Unreviewed, rolling out r214937."
https://bugs.webkit.org/show_bug.cgi?id=170365
http://trac.webkit.org/changeset/214962

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

2 years agoUnreviewed, rolling out r214937.
ryanhaddad@apple.com [Wed, 5 Apr 2017 19:43:04 +0000 (19:43 +0000)]
Unreviewed, rolling out r214937.

This change broke an internal build.

Reverted changeset:

"REGRESSION (r202472): Data Detection overwrites existing
links in detected ranges"
https://bugs.webkit.org/show_bug.cgi?id=170365
http://trac.webkit.org/changeset/214937

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

2 years agoIncrease timeouts for simulator testing
jbedard@apple.com [Wed, 5 Apr 2017 19:26:50 +0000 (19:26 +0000)]
Increase timeouts for simulator testing
Unreviewed infrastructure fix.

r214895 was not sufficient, increasing timeouts again.

* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDevice.install_app): Increase timeout from 3 to 10 seconds.

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

2 years ago[WebRTC][OpenWebRTC] Add support for SDP BUNDLE ("a:group:BUNDLE" and "a=bundle-only...
clopez@igalia.com [Wed, 5 Apr 2017 19:14:36 +0000 (19:14 +0000)]
[WebRTC][OpenWebRTC] Add support for SDP BUNDLE ("a:group:BUNDLE" and "a=bundle-only" lines)
https://bugs.webkit.org/show_bug.cgi?id=170157

Reviewed by Alejandro G. Castro.

Source/WebCore:

This implements support on the SDPProcessor for generating an "a=group:BUNDLE"
attribute with the MID identifiers specified in the bundle group in the most
recent answer.
It also implements support for generating "a=bundle-only" attributes on the
"m=" sections of the SDP according to the bundlePolicy defined.

Test: fast/mediastream/RTCPeerConnection-inspect-offer-bundlePolicy-bundle-only.html

* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::createOfferTask):
(WebCore::MediaEndpointPeerConnection::createAnswerTask):
* Modules/mediastream/SDPProcessor.cpp:
(WebCore::getBundlePolicyName):
(WebCore::configurationToJSON):
* Modules/mediastream/sdp.js:
(SDP.generate):
* platform/mediastream/MediaEndpointSessionConfiguration.h:
(WebCore::MediaEndpointSessionConfiguration::bundlePolicy):
(WebCore::MediaEndpointSessionConfiguration::setBundlePolicy):
(WebCore::MediaEndpointSessionConfiguration::clone):

LayoutTests:

The test fast/mediastream/RTCPeerConnection-inspect-offer-bundlePolicy-bundle-only.html
is used to check that we generate the "a=bundle-only" lines on the "m=" sections
according to the bundlePolicy. The 3 possible values of bundlePolicy are tested.
To properly test bundlePolicy:"balanced" we generate 5 extra tracks (6 in total)
for each one of the audio media type and video media type.

* TestExpectations: Set RTCPeerConnection-inspect-offer-bundlePolicy-bundle-only.html
as failing in the general TestExpectations, because the libwebrtc backend currently
doesn't generate the expected a=bundle-only lines.
On the GTK+ port TestExpectations file this is overriden, and the test is marked to pass.
The whole fast/mediastream directory is already overriden to pass.
* fast/mediastream/RTCPeerConnection-inspect-offer-bundlePolicy-bundle-only-expected.txt: Added.
* fast/mediastream/RTCPeerConnection-inspect-offer-bundlePolicy-bundle-only.html: Added.
* fast/mediastream/resources/sdp-utils.js:
(printComparableSessionDescription): Validate the a=group:BUNDLE line to contain the required MID identifiers.
* platform/gtk/fast/mediastream/RTCPeerConnection-inspect-answer-expected.txt: Added. Rebaseline with the expected a=group:BUNDLE line.
* platform/gtk/fast/mediastream/RTCPeerConnection-inspect-offer-expected.txt: Added. Rebaseline with the expected a=group:BUNDLE line.

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

2 years ago[MSE] Seeks to currentTime=0 will fail if currentTime is already 0.
jer.noble@apple.com [Wed, 5 Apr 2017 19:09:28 +0000 (19:09 +0000)]
[MSE] Seeks to currentTime=0 will fail if currentTime is already 0.
https://bugs.webkit.org/show_bug.cgi?id=170510
Source/WebCore:

<rdar://problem/30988403>

Reviewed by Eric Carlson.

Test: media/media-source/media-source-unnecessary-seek-seeked.html

The AVSampleBufferRenderSynchronizer won't fire a time jumped notification if no seek is actully
necessary. So short circuit the seek logic if the seek time is identical to the current synchronizer
time.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):

LayoutTests:

Reviewed by Eric Carlson.

* media/media-source/media-source-unnecessary-seek-seeked-expected.txt: Added.
* media/media-source/media-source-unnecessary-seek-seeked.html: Added.

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

2 years agoFormatting fix to remove extra space.
aakash_jain@apple.com [Wed, 5 Apr 2017 19:08:07 +0000 (19:08 +0000)]
Formatting fix to remove extra space.

Unreviewed formatting fix.

* Scripts/webkitdirs.pm:
(isEmbeddedWebKit): Remove extra space.

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

2 years agoRename isIOSLikeWebKit to isEmbeddedWebKit.
aakash_jain@apple.com [Wed, 5 Apr 2017 19:03:58 +0000 (19:03 +0000)]
Rename isIOSLikeWebKit to isEmbeddedWebKit.

Rubber-stamped by Alexey Proskuryakov.

* Scripts/webkitdirs.pm:
(isEmbeddedWebKit): Added
(isIOSLikeWebKit): Deleted.

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

2 years agoWeb Inspector: XHR breakpoints should be global
mattbaker@apple.com [Wed, 5 Apr 2017 18:57:35 +0000 (18:57 +0000)]
Web Inspector: XHR breakpoints should be global
https://bugs.webkit.org/show_bug.cgi?id=170033

Source/WebInspectorUI:

Reviewed by Joseph Pecoraro.

* Localizations/en.lproj/localizedStrings.js:
Shorten XHR breakpoint tree element "URL contains:" title to "URL".

* UserInterface/Controllers/DOMDebuggerManager.js:
Change storage of XHR breakpoints from a map to a simple array.
(WebInspector.DOMDebuggerManager):
(WebInspector.DOMDebuggerManager.prototype.get xhrBreakpoints):
(WebInspector.DOMDebuggerManager.prototype.addXHRBreakpoint):
Dispatch the "breakpoint added" event immediately after adding the
breakpoint, rather than waiting for it to resolve.

(WebInspector.DOMDebuggerManager.prototype.removeXHRBreakpoint):
(WebInspector.DOMDebuggerManager.prototype._speculativelyResolveBreakpoints):
(WebInspector.DOMDebuggerManager.prototype._resolveXHRBreakpoint):
(WebInspector.DOMDebuggerManager.prototype._saveXHRBreakpoints):
(WebInspector.DOMDebuggerManager.prototype._mainResourceDidChange):

* UserInterface/Models/XHRBreakpoint.js:
An XHR breakpoint should not be associated with a particular document.
(WebInspector.XHRBreakpoint):
(WebInspector.XHRBreakpoint.prototype.get serializableInfo):
(WebInspector.XHRBreakpoint.prototype.saveIdentityToCookie):
(WebInspector.XHRBreakpoint.prototype.get documentURL): Deleted.

* UserInterface/Views/DebuggerSidebarPanel.css:
Use default emdash-separated title/subtitle style instead of the
custom "URL contains:" labeling.

(.sidebar > .panel.navigation.debugger .details-section.xhr-breakpoints .item.breakpoint .subtitle):
(.sidebar > .panel.navigation.debugger .details-section.xhr-breakpoints .item.breakpoint .subtitle:before): Deleted.
(body[dir=ltr] .sidebar > .panel.navigation.debugger .details-section.xhr-breakpoints .item.breakpoint .subtitle): Deleted.
(body[dir=rtl] .sidebar > .panel.navigation.debugger .details-section.xhr-breakpoints .item.breakpoint .subtitle): Deleted.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype.willDismissPopover):
(WebInspector.DebuggerSidebarPanel):

* UserInterface/Views/XHRBreakpointTreeElement.js:
(WebInspector.XHRBreakpointTreeElement):

LayoutTests:

Reviewed by Joseph Pecoraro..

* inspector/dom-debugger/xhr-breakpoints.html:
Update for XHRBreakpoint constructor change.

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

2 years ago<input type="range"> changing to disabled while active breaks all pointer events
cdumez@apple.com [Wed, 5 Apr 2017 18:47:39 +0000 (18:47 +0000)]
<input type="range"> changing to disabled while active breaks all pointer events
https://bugs.webkit.org/show_bug.cgi?id=170447
<rdar://problem/31442875>

Reviewed by Geoffrey Garen.

Source/WebCore:

When a range's slider is being moved, we set SliderThumbElement's m_inDragMode flag
to true and mark the range elements as the CapturingMouseEventsElement. When we get
the mouseUp event, we are supposed to exit drag mode. However, when the range element
gets disabled while dragging, we do not get the mouseUp event and we need to make
sure we exit dragging mode anyway. r112547 tried to fix this by calling stopDragging()
in SliderThumbElement::defaultEventHandler() when the input element is disabled.
While this often works, this is fragile and we sometimes fail to exit dragging mode
when we should.

This patch addressed the issue by calling stopDragging() in
SliderThumbElement::disabledAttributeChanged() instead. This is much safer as we
guarantee will exit dragging mode whenever the range element gets disabled, even
if SliderThumbElement::defaultEventHandler() does not get called after that.

Test: fast/forms/range/disabled-while-dragging.html

* html/RangeInputType.cpp:
(WebCore::RangeInputType::disabledAttributeChanged):
* html/RangeInputType.h:
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::defaultEventHandler):
(WebCore::SliderThumbElement::disabledAttributeChanged):
* html/shadow/SliderThumbElement.h:

LayoutTests:

Add layout test coverage.

* fast/forms/range/disabled-while-dragging-expected.txt: Added.
* fast/forms/range/disabled-while-dragging.html: Added.

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

2 years ago[MediaStream] Video doesn't render in fullscreen on iOS
eric.carlson@apple.com [Wed, 5 Apr 2017 18:34:24 +0000 (18:34 +0000)]
[MediaStream] Video doesn't render in fullscreen on iOS
https://bugs.webkit.org/show_bug.cgi?id=170404

Reviewed by Youenn Fablet.

No new tests, filed https://bugs.webkit.org/show_bug.cgi?id=170512.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Include
video fullscreen manager on iOS too.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix): Add paramater
to force transform recalculation.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): Restructure code since
the display layer resize happens elsewhere.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): Include video fullscreen
manager on iOS too.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::backgroundLayerBoundsChanged): Change the
display layer size and position immediately instead of waiting for the next sample buffer
so the display is correct when fullscreen mode changes when paused.

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

2 years agoUnreviewed, rebasing crypto/subtle/rsa-import-key-malformed-parameters.html
jiewen_tan@apple.com [Wed, 5 Apr 2017 18:26:25 +0000 (18:26 +0000)]
Unreviewed, rebasing crypto/subtle/rsa-import-key-malformed-parameters.html
<rdar://problem/31322400>

* crypto/subtle/rsa-import-key-malformed-parameters-expected.txt:
* crypto/subtle/rsa-import-key-malformed-parameters.html:

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

2 years agoDeprecate and remove URL.createObjectURL(mediastream)
commit-queue@webkit.org [Wed, 5 Apr 2017 17:31:37 +0000 (17:31 +0000)]
Deprecate and remove URL.createObjectURL(mediastream)
https://bugs.webkit.org/show_bug.cgi?id=167518
<rdar://problem/31149607>

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

Source/WebCore:

Covered by updated tests.

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/mediastream/DOMURLMediaStream.cpp: Removed.
* Modules/mediastream/DOMURLMediaStream.h: Removed.
* Modules/mediastream/DOMURLMediaStream.idl: Removed.
* WebCore.xcodeproj/project.pbxproj:
* html/DOMURL.idl:

LayoutTests:

* fast/mediacapturefromelement/CanvasCaptureMediaStream-2d-events.html:
* fast/mediacapturefromelement/CanvasCaptureMediaStream-request-frame-events.html:
* fast/mediacapturefromelement/CanvasCaptureMediaStream-webgl-events.html:
* fast/mediastream/MediaStream-video-element-displays-buffer-expected.txt:
* fast/mediastream/MediaStream-video-element-displays-buffer.html:
* fast/mediastream/MediaStream-video-element-expected.txt:
* fast/mediastream/MediaStream-video-element-track-stop-expected.txt:
* fast/mediastream/MediaStream-video-element-track-stop.html:
* fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled-expected.txt:
* fast/mediastream/MediaStream-video-element-video-tracks-disabled.html:
* fast/mediastream/MediaStream-video-element.html:
* fast/mediastream/resources/getUserMedia-helper.js:
(setupVideoElementWithStream):

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

2 years agoWebAssembly: We shouldn't need to pin size registers if we have a fast memory.
keith_miller@apple.com [Wed, 5 Apr 2017 17:19:16 +0000 (17:19 +0000)]
WebAssembly: We shouldn't need to pin size registers if we have a fast memory.
https://bugs.webkit.org/show_bug.cgi?id=170504

Reviewed by Mark Lam.

JSTests:

* wasm/function-tests/trap-after-cross-instance-call.js: Added.
(b.new.WebAssembly.Memory):
(importObject.foo.bar):
(wasmFrameCountFromError):

Source/JavaScriptCore:

* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::createJSToWasmWrapper):
(JSC::Wasm::parseAndCompile):
* wasm/WasmMemoryInformation.h:
(JSC::Wasm::PinnedRegisterInfo::toSave):

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

2 years ago[Webrtc] Mock realtime sources factories should be static after r213941
commit-queue@webkit.org [Wed, 5 Apr 2017 17:15:55 +0000 (17:15 +0000)]
[Webrtc] Mock realtime sources factories should be static after r213941
https://bugs.webkit.org/show_bug.cgi?id=170282

Patch by Alejandro G. Castro <alex@igalia.com> on 2017-04-05
Reviewed by Alex Christensen.

If we don't make the variables static we would be returning a
local variable.

* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::factory):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::factory):

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

2 years ago[WK2][iOS] Add entitlements to enable audio/video capture in WebProcess
bfulgham@apple.com [Wed, 5 Apr 2017 17:02:24 +0000 (17:02 +0000)]
[WK2][iOS] Add entitlements to enable audio/video capture in WebProcess
https://bugs.webkit.org/show_bug.cgi?id=170507
<rdar://problem/31121248>

Reviewed by Youenn Fablet.

Add two entitlements that are required to access audio/video capture on iOS.

* Configurations/WebContent-iOS.entitlements:

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

2 years agoShow a log message when an invalid message is received in non cocoa ports
commit-queue@webkit.org [Wed, 5 Apr 2017 16:50:03 +0000 (16:50 +0000)]
Show a log message when an invalid message is received in non cocoa ports
https://bugs.webkit.org/show_bug.cgi?id=170506

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2017-04-05
Reviewed by Michael Catanzaro.

We just crash, but without knowing the details about the message it's impossible to debug.

* Shared/ChildProcess.cpp:
(WebKit::ChildProcess::didReceiveInvalidMessage):

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

2 years agoFix CMake build.
achristensen@apple.com [Wed, 5 Apr 2017 16:06:49 +0000 (16:06 +0000)]
Fix CMake build.

Source/WebCore:

* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
Some JavaScript inline functions were not being accessed from this file with different enable flags.
* platform/spi/cf/CFNetworkSPI.h:
* platform/spi/cocoa/NSURLConnectionSPI.h:
Moved NSURLSession-specific SPI from NSURLConnectionSPI.h to CFNetworkSPI.h.

Tools:

* TestRunnerShared/EventSerialization/mac/EventSerializerMac.mm:
* TestRunnerShared/spi/CoreGraphicsSPI.h: Removed.
* TestRunnerShared/spi/CoreGraphicsTestSPI.h: Copied from Tools/TestRunnerShared/spi/CoreGraphicsSPI.h.
There is a CoreGraphicsSPI.h in WebCore and the CMake build was finding the wrong one.
Since we just inherit the include paths from WebCore in the CMake build and since this SPI is only used for testing,
I just renamed CoreGraphicsSPI.h to CoreGraphicsTestSPI.h to avoid any name collisions.
* WebKitTestRunner/PlatformMac.cmake:
Add some missing files.
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:

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

2 years agoAdd debug option to run-jsc script
keith_miller@apple.com [Wed, 5 Apr 2017 14:28:57 +0000 (14:28 +0000)]
Add debug option to run-jsc script
https://bugs.webkit.org/show_bug.cgi?id=170503

Reviewed by Yusuke Suzuki.

Adds a new option to the run-jsc script so that when passed
"--debug" it will wrap the jsc call with an lldb invocation. If
someone wishes to use a different debugger they can set the
DEBUGGER environment variable. Additionally, run-jsc now exits
with the exit status of the jsc call.

* Scripts/run-jsc:

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

2 years ago_blank / _self / _parent / _top browsing context names should be case-insensitive
cdumez@apple.com [Wed, 5 Apr 2017 13:36:47 +0000 (13:36 +0000)]
_blank / _self / _parent / _top browsing context names should be case-insensitive
https://bugs.webkit.org/show_bug.cgi?id=169747

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Import test coverage from upstream web-platform-tests.

* resources/import-expectations.json:
* web-platform-tests/html/browsers/windows/browsing-context-names/001.html:
* web-platform-tests/html/browsers/windows/browsing-context-names/002.html:
* web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank-expected.txt: Added.
* web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank.html: Added.
* web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-existing.html:
* web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001-expected.txt: Added.
* web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001.html: Added.
* web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002-expected.txt: Added.
* web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002.html: Added.
* web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003-expected.txt: Added.
* web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html: Added.
* web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004-expected.txt: Added.
* web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004.html: Added.
* web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-1.html:
* web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-2.html:
* web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-default-name-expected.txt:
* web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-default-name.html:
* web-platform-tests/html/browsers/windows/browsing-context-names/existing.html:
* web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-1.html: Added.
* web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-2.html: Copied from LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/existing.html.
* web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-3.html: Added.
* web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-insensitive-1.html: Added.
* web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-insensitive-2.html: Added.
* web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-top-nested.html: Added.
* web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-top-replace.html: Added.
* web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-top.html: Added.
* web-platform-tests/html/browsers/windows/browsing-context-names/resources/post-to-opener.html: Added.
* web-platform-tests/html/browsers/windows/browsing-context-names/resources/post-to-top-or-close.html: Added.
* web-platform-tests/html/browsers/windows/browsing-context-names/resources/post-to-top.html: Added.
* web-platform-tests/html/browsers/windows/browsing-context-names/resources/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/w3c-import.log.
* web-platform-tests/html/browsers/windows/browsing-context-names/self1.html:
* web-platform-tests/html/browsers/windows/browsing-context-names/self2.html:
* web-platform-tests/html/browsers/windows/browsing-context-names/w3c-import.log:

Source/WebCore:

_blank / _self / _parent / _top browsing context names should be case-insensitive
as per the HTML specification:
- https://html.spec.whatwg.org/#browsing-context-names

This aligns our behavior with Firefox as well. See discussion at:
- https://github.com/whatwg/html/issues/2443

Tests: imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank.html
       imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001.html
       imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002.html
       imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html
       imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
(WebCore::createWindow):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::open):
* page/FrameTree.cpp:
(WebCore::FrameTree::uniqueChildName):
(WebCore::FrameTree::find):

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

2 years ago[WinCairo] Invalid address specified to RtlValidateHeap at std::ctype<char>::_Tidy...
commit-queue@webkit.org [Wed, 5 Apr 2017 13:19:57 +0000 (13:19 +0000)]
[WinCairo] Invalid address specified to RtlValidateHeap at std::ctype<char>::_Tidy() when finishing MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=157067

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-04-05
Reviewed by Per Arne Vollan.

WebKit is compiled with /MT switch to use static CRT on Windows.
But, WinCairo port does not link the static CRT by specifying
/NODEFAULTLIB:LIBCMT and /NODEFAULTLIB:LIBCMTD switches.
Eventually, a dynamically linked CRT is linked.  This causes
potential heap corruption.

* PlatformWin.cmake: Do not set /NODEFAULTLIB:LIBCMT and
/NODEFAULTLIB:LIBCMTD, but /NODEFAULTLIB:MSVCRT and
/NODEFAULTLIB:MSVCRTD as well as AppleWin port does

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

2 years ago[JSC] Suppress warnings in GCC
utatane.tea@gmail.com [Wed, 5 Apr 2017 13:07:09 +0000 (13:07 +0000)]
[JSC] Suppress warnings in GCC
https://bugs.webkit.org/show_bug.cgi?id=170501

Reviewed by Keith Miller.

Source/JavaScriptCore:

Should use ASSERT_NOT_REACHED since return-type pragma is only
enabled under ASSERT_DISABLED environment. We shoud use
ASSERT_NOTREACHED to emit assertions in debug build. It effectively
catches bugs while keeping performance in release build.

* b3/B3Opcode.cpp:
(JSC::B3::storeOpcode):
* b3/B3Width.h:
(JSC::B3::mask):
* runtime/Options.cpp:
(JSC::parse):
* wasm/WasmSections.h:
(JSC::Wasm::makeString):
* wasm/WasmSignature.cpp:
(JSC::Wasm::SignatureInformation::tryCleanup):
* wasm/generateWasmValidateInlinesHeader.py:

Source/WTF:

Add a new macro UNUSED_FUNCTION to annotate unused static functions.
#pragma GCC diagnostic ignored "-Wunused-function" does not work.

* wtf/Compiler.h:

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

2 years ago[GTK+] PNG animations that should run once are not played at all
magomez@igalia.com [Wed, 5 Apr 2017 10:09:11 +0000 (10:09 +0000)]
[GTK+] PNG animations that should run once are not played at all
https://bugs.webkit.org/show_bug.cgi?id=170499

Reviewed by Carlos Garcia Campos.

The repetition count reported bu the PNGImageDecoder is wrong. It's returning m_playCount - 1, which
means 0 for the animations that need to be played once. Change it to return an appropriate value.

Covered by existent tests.

* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::repetitionCount):
* platform/image-decoders/png/PNGImageDecoder.h:

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

2 years ago[GTK] Unreviewed tests gardening
jfernandez@igalia.com [Wed, 5 Apr 2017 09:13:42 +0000 (09:13 +0000)]
[GTK] Unreviewed tests gardening
https://bugs.webkit.org/show_bug.cgi?id=170497

Unreviewed test gardening. Rebaseline tests after r214712.

* platform/gtk/fast/multicol/table-vertical-align-expected.txt:

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

2 years agoREGRESSION (r202472): Data Detection overwrites existing links in detected ranges
aestes@apple.com [Wed, 5 Apr 2017 08:24:48 +0000 (08:24 +0000)]
REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
https://bugs.webkit.org/show_bug.cgi?id=170365
<rdar://problem/29205721>

Reviewed by Tim Horton.

Source/WebCore:

r202472 changed the node traversal in searchForLinkRemovingExistingDDLinks() to only
consider nodes that are descendants of startNode, but we need to traverse all nodes between
startNode and endNode to find existing non-DD links.

As a result, we'd add a Data Detector link to the following snippet and make the original
links un-clickable:

    <a href='#'>tomorrow</a> <a href='#'>night</a>

Fix this by not specifying a stayWithin node when calling NodeTraversal::next(). The loop
will terminate when we reach endNode.

Updated WebKit2.DataDetectionReferenceDate API test.

* editing/cocoa/DataDetection.mm:
(WebCore::searchForLinkRemovingExistingDDLinks):

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/DataDetection.mm:
(expectLinkCount): Changed to only query links with the x-apple-data-detectors attribute.
(TEST): Re-enabled the test, which now passes.

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

2 years agoImplement PromiseDeferredTimer for non CF based ports
carlosgc@webkit.org [Wed, 5 Apr 2017 07:58:02 +0000 (07:58 +0000)]
Implement PromiseDeferredTimer for non CF based ports
https://bugs.webkit.org/show_bug.cgi?id=170391

Reviewed by Yusuke Suzuki.

RunLoop handling is only implemented for CF causing several wasm tests to fail for other ports.

* jsc.cpp:
(runJSC): Remove CF ifdefs.
* runtime/PromiseDeferredTimer.cpp:
(JSC::PromiseDeferredTimer::doWork): Add non CF implementation using WTF RunLoop.
(JSC::PromiseDeferredTimer::runRunLoop): Ditto.
* runtime/PromiseDeferredTimer.h:

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

2 years agoWebAssembly: several tests added in r214504 crash when building with GCC
carlosgc@webkit.org [Wed, 5 Apr 2017 07:53:43 +0000 (07:53 +0000)]
WebAssembly: several tests added in r214504 crash when building with GCC
https://bugs.webkit.org/show_bug.cgi?id=170390

Reviewed by Saam Barati.

The pattern foo->bar([f = WTFMove(foo)]{}); crashes when building with GCC, I assume the move happens before the
foo is used to invoke the function.

* wasm/js/WebAssemblyPrototype.cpp:
(JSC::webAssemblyCompileFunc): Use p.vm() instead of plan->vm(), because plan is moved by the lambda.
(JSC::instantiate): Ditto.
(JSC::compileAndInstantiate): Ditto.

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

2 years agoMove WebErrors from WebProcess to Shared and get rid of ErrorsGtk in WebCore
carlosgc@webkit.org [Wed, 5 Apr 2017 07:41:53 +0000 (07:41 +0000)]
Move WebErrors from WebProcess to Shared and get rid of ErrorsGtk in WebCore
https://bugs.webkit.org/show_bug.cgi?id=156974

Reviewed by Sam Weinig.

Source/WebCore:

Remove ErrorsGtk.

* PlatformGTK.cmake:
* platform/gtk/ErrorsGtk.cpp: Removed.
* platform/gtk/ErrorsGtk.h: Removed.

Source/WebCore/platform/gtk/po:

* POTFILES.in: Add new paths with translatable strings.

Source/WebKit2:

WebErrors are not only used by the frame loader client in the web process, but also by the network process. So,
move them to Shared make most of the implementation cross-platform.

* CMakeLists.txt: Add new files to compilation.
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::download): Use WebErrors directly instead of platform methods that are no longer needed.
(WebKit::NetworkDataTaskSoup::writeDownloadCallback): Ditto.
(WebKit::NetworkDataTaskSoup::didFinishDownload): Ditto.
(WebKit::NetworkDataTaskSoup::didFail): Ditto.
* PlatformGTK.cmake: Add new files to compilation and remove DownloadSoupErrorsGtk.cpp
* PlatformMac.cmake:
* Shared/API/APIError.cpp: Add error domains used by glib based ports.
(API::Error::webKitNetworkErrorDomain):
(API::Error::webKitPolicyErrorDomain):
(API::Error::webKitPluginErrorDomain):
(API::Error::webKitDownloadErrorDomain):
(API::Error::webKitPrintErrorDomain):
* Shared/API/APIError.h:
* Shared/Cocoa/WebErrorsCocoa.mm: Copied from Source/WebKit2/WebProcess/WebCoreSupport/WebErrors.h.
(WebKit::createNSError):
(WebKit::cancelledError):
(WebKit::fileDoesNotExistError):
* Shared/WebErrors.cpp: Copied from Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp.
(WebKit::blockedError):
(WebKit::blockedByContentBlockerError):
(WebKit::cannotShowURLError):
(WebKit::interruptedForPolicyChangeError):
(WebKit::blockedByContentFilterError):
(WebKit::cannotShowMIMETypeError):
(WebKit::pluginWillHandleLoadError):
(WebKit::internalError):
* Shared/WebErrors.h: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebErrors.h.
* Shared/glib/WebErrorsGlib.cpp: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp.
(WebKit::cancelledError):
(WebKit::fileDoesNotExistError):
* Shared/gtk/WebErrorsGtk.cpp: Copied from Source/WebKit2/NetworkProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp.
(WebKit::printError):
(WebKit::printerNotFoundError):
(WebKit::invalidPageRangeToPrint):
* Shared/soup/WebErrorsSoup.cpp: Renamed from Source/WebKit2/NetworkProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp.
(WebKit::downloadNetworkError):
(WebKit::downloadCancelledByUserError):
(WebKit::downloadDestinationError):
* UIProcess/API/gtk/WebKitDownload.cpp:
* UIProcess/API/gtk/WebKitError.cpp:
(webkit_network_error_quark):
(webkit_policy_error_quark):
(webkit_plugin_error_quark):
(webkit_download_error_quark):
(webkit_print_error_quark):
* UIProcess/API/gtk/WebKitPrivate.cpp:
(toWebKitError):
(toWebCoreError):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/mac/WebErrorsMac.mm: Removed.
* WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:

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

2 years ago[ios-simulator] API test WebKit2.WKWebProcessPlugInRangeHandle timing out
aestes@apple.com [Wed, 5 Apr 2017 07:39:35 +0000 (07:39 +0000)]
[ios-simulator] API test WebKit2.WKWebProcessPlugInRangeHandle timing out
https://bugs.webkit.org/show_bug.cgi?id=167594

Re-enabled this API test now that webkit.org/b/161967 is fixed.

* TestWebKitAPI/Tests/WebKit2Cocoa/BundleRangeHandle.mm:
(TEST):

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

2 years ago[ios-simulator] API test WebKit2.DataDetectionReferenceDate timing out
aestes@apple.com [Wed, 5 Apr 2017 07:36:05 +0000 (07:36 +0000)]
[ios-simulator] API test WebKit2.DataDetectionReferenceDate timing out
https://bugs.webkit.org/show_bug.cgi?id=161967

Reviewed by Alexey Proskuryakov.

Source/WebCore:

DataDetectorsCoreSPI.h defined DDQueryOffset as a struct of two CFIndexes, which is 16 bytes
on LP64, but the struct is actually defined as two CFIndex-typed 32-bit bitfields, which is
8 bytes on LP64. This breaks the ABI on Public SDK builds when calling functions that take
or return DDQueryOffsets.

* platform/spi/cocoa/DataDetectorsCoreSPI.h: Updated the DDQueryOffset definition for
Public SDK builds, and added a static_assert to detect future size changes at compile time.

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/DataDetection.mm:
(TEST): Re-enabled WebKit2.DataDetectionReferenceDate.

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

2 years ago[JSC] Generate TemplateObjects at linking time
utatane.tea@gmail.com [Wed, 5 Apr 2017 07:09:41 +0000 (07:09 +0000)]
[JSC] Generate TemplateObjects at linking time
https://bugs.webkit.org/show_bug.cgi?id=169743

Reviewed by Keith Miller.

JSTests:

* stress/template-string-tags-eval.js: Added.
(shouldBe):
(tag):

Source/JavaScriptCore:

Currently, the code calls getTemplateObject to get appropriate template objects at runtime.
But this template object is constant value and never changed. So instead of creating it
at runtime, we should create it at linking time and store it in the constant registers.

* builtins/BuiltinNames.h:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::setConstantRegisters):
* bytecode/CodeBlock.h:
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::shrinkToFit):
* bytecode/UnlinkedCodeBlock.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::addTemplateRegistryKeyConstant):
(JSC::BytecodeGenerator::emitGetTemplateObject):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::TaggedTemplateNode::emitBytecode):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::getTemplateObject): Deleted.
* runtime/JSTemplateRegistryKey.cpp:
* runtime/JSTemplateRegistryKey.h:
(JSC::isTemplateRegistryKey):

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

2 years agoMove AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h
jer.noble@apple.com [Wed, 5 Apr 2017 05:38:25 +0000 (05:38 +0000)]
Move AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h
https://bugs.webkit.org/show_bug.cgi?id=170471

Reviewed by Eric Carlson.

Move the declaration of AVSampleBufferDisplayLayer (and related classes) into AVFoundationSPI.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
* platform/spi/mac/AVFoundationSPI.h:

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

2 years agoMark imported/w3c/web-platform-tests/fetch/api/response/response-trailer.html as...
ap@apple.com [Wed, 5 Apr 2017 05:14:52 +0000 (05:14 +0000)]
Mark imported/w3c/web-platform-tests/fetch/api/response/response-trailer.html as flaky
for https://bugs.webkit.org/show_bug.cgi?id=170493

* platform/mac/TestExpectations:

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

2 years agoCanvas is tainted when painting a video with MediaStreamTrack
commit-queue@webkit.org [Wed, 5 Apr 2017 04:48:03 +0000 (04:48 +0000)]
Canvas is tainted when painting a video with MediaStreamTrack
https://bugs.webkit.org/show_bug.cgi?id=170486

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

Source/WebCore:

Test: http/tests/media/media-stream/getusermedia-with-canvas.html

Adding the notion of isolated source so that we can later on implement WebRTC isolated tracks.
For now, canvas will not be tainted if painted from a MediaStreamTrack.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::didPassCORSAccessCheck):
* platform/mediastream/MediaStreamTrackPrivate.h:
(WebCore::MediaStreamTrackPrivate::isIsolated):
* platform/mediastream/RealtimeMediaSource.h:

LayoutTests:

* http/tests/media/media-stream/getusermedia-with-canvas-expected.txt: Added.
* http/tests/media/media-stream/getusermedia-with-canvas.html: Added.
* http/tests/media/media-stream/resources/getUserMedia-helper.js: Added.
(reject):
(getUserMedia):
(defaultRejectOrCatch):
(setupVideoElementWithStream):

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

2 years agoOn ARM64, DFG::SpeculativeJIT::compileArithMod() failed to ensure result is of DataFo...
mark.lam@apple.com [Wed, 5 Apr 2017 03:50:07 +0000 (03:50 +0000)]
On ARM64, DFG::SpeculativeJIT::compileArithMod() failed to ensure result is of DataFormatInt32.
https://bugs.webkit.org/show_bug.cgi?id=170473
<rdar://problem/29912391>

Reviewed by Saam Barati.

JSTests:

* stress/regress-170473.js: Added.

Source/JavaScriptCore:

In Unchecked mode, when DFG::SpeculativeJIT::compileArithMod() detects that the
divisor is 0, we want it to return 0.  The result is expected to be of
DataFormatIn32.

The ARM implementation just returns the value in the divisor register.  However,
the divisor in this case can be of DataFormatJSInt32.  On ARM64, returning the
divisor register yields the wrong result format because the same register also
holds the upper 32-bit of the JSValue encoding.  The fix is to return an
immediate 0 instead.

Also turned on the assertion in jitAssertIsInt32 for ARM64.  This assertion being
disabled may have contributed to this bug going unnoticed all this time.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArithMod):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::jitAssertIsInt32):

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

2 years agoAir::eliminateDeadCode should not repeatedly process the same live instructions
fpizlo@apple.com [Wed, 5 Apr 2017 03:43:44 +0000 (03:43 +0000)]
Air::eliminateDeadCode should not repeatedly process the same live instructions
https://bugs.webkit.org/show_bug.cgi?id=170490

Reviewed by Keith Miller.

This makes the eliminateDeadCode() fixpoint somewhat worklist-based: we track the set
of Insts that might be dead. Every time we detect that one is live, we remove it from
the set. This is a big (>2x) speed-up because lots of Insts are immediately found to
be live.

This is a ~1% wasm -O1 compile time progression.

* b3/air/AirEliminateDeadCode.cpp:
(JSC::B3::Air::eliminateDeadCode):

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

2 years agoUnreviewed, rolling out r214894, r214895, r214907, r214912,
commit-queue@webkit.org [Wed, 5 Apr 2017 03:26:03 +0000 (03:26 +0000)]
Unreviewed, rolling out r214894, r214895, r214907, r214912,
and r214918.
https://bugs.webkit.org/show_bug.cgi?id=170491

Caused build failures on Mac (Requested by rniwa on #webkit).

Reverted changesets:

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

"Rolling back the build fix, as it broke other builds."
http://trac.webkit.org/changeset/214895

"Move AVSampleBufferDisplayLayer declarations into
AVFoundationSPI.h"
https://bugs.webkit.org/show_bug.cgi?id=170471
http://trac.webkit.org/changeset/214907

"Unreviewed build fix: fix compilation error on Sierra."
http://trac.webkit.org/changeset/214912

"More build fixing."
http://trac.webkit.org/changeset/214918

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

2 years ago[Mac] Add back web audio support for getUserMedia MediaStreamTrack
commit-queue@webkit.org [Wed, 5 Apr 2017 02:50:51 +0000 (02:50 +0000)]
[Mac] Add back web audio support for getUserMedia MediaStreamTrack
https://bugs.webkit.org/show_bug.cgi?id=170482

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

Source/WebCore:

┬┤Covered by reenabled test.

Exporting method and class used in WebKit2.

* WebCore.xcodeproj/project.pbxproj:
* platform/audio/mac/CAAudioStreamDescription.h:
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:

Source/WebKit2:

* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::Source::setStorage):

LayoutTests:

* TestExpectations:

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

2 years agoAir::eliminateDeadCode() should not use a HashSet
fpizlo@apple.com [Wed, 5 Apr 2017 01:18:07 +0000 (01:18 +0000)]
Air::eliminateDeadCode() should not use a HashSet
https://bugs.webkit.org/show_bug.cgi?id=170487

Reviewed by Saam Barati.

Source/JavaScriptCore:

Introduce TmpSet, which is like a HashSet<Tmp>. Use this to make eliminateDeadCode()
about 50% faster, resulting in a 1% wasm -O1 compile time progression.

* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/air/AirEliminateDeadCode.cpp:
(JSC::B3::Air::eliminateDeadCode):
* b3/air/AirTmpSet.h: Added.
(JSC::B3::Air::TmpSet::TmpSet):
(JSC::B3::Air::TmpSet::add):
(JSC::B3::Air::TmpSet::remove):
(JSC::B3::Air::TmpSet::contains):
(JSC::B3::Air::TmpSet::size):
(JSC::B3::Air::TmpSet::isEmpty):
(JSC::B3::Air::TmpSet::iterator::iterator):
(JSC::B3::Air::TmpSet::iterator::operator*):
(JSC::B3::Air::TmpSet::iterator::operator++):
(JSC::B3::Air::TmpSet::iterator::operator==):
(JSC::B3::Air::TmpSet::iterator::operator!=):
(JSC::B3::Air::TmpSet::begin):
(JSC::B3::Air::TmpSet::end):

Source/WTF:

BitVector::iterator knows when it's at the end. Expose this functionality.

* wtf/BitVector.h:
(WTF::BitVector::iterator::isAtEnd):

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

2 years agoMark fast/images/slower-animation-than-decoding-image.html as flaky.
ryanhaddad@apple.com [Wed, 5 Apr 2017 00:59:58 +0000 (00:59 +0000)]
Mark fast/images/slower-animation-than-decoding-image.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=168390

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoMark fast/images/reset-image-animation.html as flaky.
ryanhaddad@apple.com [Wed, 5 Apr 2017 00:59:54 +0000 (00:59 +0000)]
Mark fast/images/reset-image-animation.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=170177

Unreviewed test gardening.

* platform/mac/TestExpectations:

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