WebKit-https.git
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

2 years agoMark media/modern-media-controls/airplay-button/airplay-button.html as flaky on mac...
ryanhaddad@apple.com [Wed, 5 Apr 2017 00:56:17 +0000 (00:56 +0000)]
Mark media/modern-media-controls/airplay-button/airplay-button.html as flaky on mac-wk1 Release.
https://bugs.webkit.org/show_bug.cgi?id=168409

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years agoWebAssembly: ModuleInformation should be a ref counted thing that can be shared acros...
keith_miller@apple.com [Wed, 5 Apr 2017 00:55:54 +0000 (00:55 +0000)]
WebAssembly: ModuleInformation should be a ref counted thing that can be shared across threads.
https://bugs.webkit.org/show_bug.cgi?id=170478

Reviewed by Saam Barati.

Source/JavaScriptCore:

ModuleInformation has been moved to its own file and is now
ThreadSafeRefCounted.  All the Strings we used to keep in the
ModuleInformation have been switched to Vector<LChar> this has the
advantage that it can be passed across threads. However, this does
mean that we need to decode the utf8 strings in each thread. This
is likely not a problem because:

1) most modules have few imports/exports/custom sections.
2) most of the time they are ascii so the conversion is cheap.
3) we only have to do it once per thread, and there shouldn't be too many.

This patch also removes
moduleSignatureIndicesToUniquedSignatureIndices since that
information can already be recovered from the
SignatureInformation.

* JavaScriptCore.xcodeproj/project.pbxproj:
* jsc.cpp:
(functionTestWasmModuleFunctions):
* runtime/Identifier.h:
(JSC::Identifier::fromString):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::parseAndCompile):
* wasm/WasmB3IRGenerator.h:
* wasm/WasmFormat.cpp:
(JSC::Wasm::makeString):
(JSC::Wasm::ModuleInformation::~ModuleInformation): Deleted.
* wasm/WasmFormat.h:
(JSC::Wasm::makeString):
(JSC::Wasm::ModuleInformation::functionIndexSpaceSize): Deleted.
(JSC::Wasm::ModuleInformation::isImportedFunctionFromFunctionIndexSpace): Deleted.
(JSC::Wasm::ModuleInformation::signatureIndexFromFunctionIndexSpace): Deleted.
(JSC::Wasm::ModuleInformation::importFunctionCount): Deleted.
(JSC::Wasm::ModuleInformation::internalFunctionCount): Deleted.
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::FunctionParser):
* wasm/WasmModuleInformation.cpp: Copied from Source/JavaScriptCore/wasm/WasmValidate.h.
(JSC::Wasm::ModuleInformation::~ModuleInformation):
* wasm/WasmModuleInformation.h: Added.
(JSC::Wasm::ModuleInformation::functionIndexSpaceSize):
(JSC::Wasm::ModuleInformation::isImportedFunctionFromFunctionIndexSpace):
(JSC::Wasm::ModuleInformation::signatureIndexFromFunctionIndexSpace):
(JSC::Wasm::ModuleInformation::importFunctionCount):
(JSC::Wasm::ModuleInformation::internalFunctionCount):
(JSC::Wasm::ModuleInformation::ModuleInformation):
* wasm/WasmModuleParser.cpp:
* wasm/WasmModuleParser.h:
(JSC::Wasm::ModuleParser::ModuleParser):
* wasm/WasmParser.h:
(JSC::Wasm::Parser<SuccessType>::consumeUTF8String):
* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::Plan):
(JSC::Wasm::Plan::parseAndValidateModule):
(JSC::Wasm::Plan::prepare):
(JSC::Wasm::Plan::compileFunctions):
(JSC::Wasm::Plan::complete):
(JSC::Wasm::Plan::cancel):
* wasm/WasmPlan.h:
(JSC::Wasm::Plan::internalFunctionCount):
(JSC::Wasm::Plan::takeModuleInformation):
* wasm/WasmSignature.cpp:
(JSC::Wasm::SignatureInformation::get):
* wasm/WasmSignature.h:
* wasm/WasmValidate.cpp:
(JSC::Wasm::validateFunction):
* wasm/WasmValidate.h:
* wasm/js/JSWebAssemblyHelpers.h:
(JSC::createSourceBufferFromValue):
* wasm/js/JSWebAssemblyModule.cpp:
(JSC::JSWebAssemblyModule::createStub):
(JSC::JSWebAssemblyModule::JSWebAssemblyModule):
(JSC::JSWebAssemblyModule::finishCreation):
* wasm/js/JSWebAssemblyModule.h:
(JSC::JSWebAssemblyModule::moduleInformation):
(JSC::JSWebAssemblyModule::source):
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance):
* wasm/js/WebAssemblyModuleConstructor.cpp:
(JSC::WebAssemblyModuleConstructor::createModule):
* wasm/js/WebAssemblyModulePrototype.cpp:
(JSC::webAssemblyModuleProtoCustomSections):
(JSC::webAssemblyModuleProtoImports):
(JSC::webAssemblyModuleProtoExports):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):
* wasm/js/WebAssemblyModuleRecord.h:
* wasm/js/WebAssemblyPrototype.cpp:
(JSC::webAssemblyCompileFunc):
(JSC::instantiate):
(JSC::compileAndInstantiate):

Source/WTF:

This adds a new String::fromUTF8 that converts a vector of characters to
a string.

Also, it cleans up some style.

* wtf/text/WTFString.h:
(WTF::String::fromUTF8):
* wtf/unicode/UTF8.cpp:
(WTF::Unicode::convertLatin1ToUTF8):

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

2 years agoMore build fixing.
ap@apple.com [Wed, 5 Apr 2017 00:48:25 +0000 (00:48 +0000)]
More build fixing.

* platform/spi/mac/AVFoundationSPI.h:

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

2 years agoB3::fixSSA() needs a tune-up
fpizlo@apple.com [Wed, 5 Apr 2017 00:25:02 +0000 (00:25 +0000)]
B3::fixSSA() needs a tune-up
https://bugs.webkit.org/show_bug.cgi?id=170485

Reviewed by Saam Barati.

Source/JavaScriptCore:

After the various optimizations to liveness, register allocation, and other phases, the
fixSSA() phase now looks like one of the top offenders. This includes a bunch of
changes to make this phase run faster. This is a ~7% wasm -O1 compile time progression.

Here's what I did:

- We now use IndexSparseSet instead of IndexMap for tracking variable values. This
  makes it cheaper to chew through small blocks while there is a non-trivial number of
  total variables.

- We now do a "local SSA conversion" pass before anything else. This eliminates
  obvious Get's. If we were using temporary Variables, it would eliminate many of
  those. That's useful for when we use demoteValues() and duplciateTails(). For wasm
  -O1, we mainly care about the fact that it makes a bunch of Set's dead.

- We now do a Set DCE pass after the local SSA but before SSA conversion. This ensures
  that any block-local live intervals of Variables disappear and don't need further
  consideration.

- We now cache the reaching defs calculation.

- We now perform the reaching defs calculation lazily.

* b3/B3FixSSA.cpp:
(JSC::B3::demoteValues):
(JSC::B3::fixSSA):
* b3/B3SSACalculator.cpp:
(JSC::B3::SSACalculator::reachingDefAtTail):
* b3/B3VariableLiveness.cpp:
(JSC::B3::VariableLiveness::VariableLiveness):
* b3/air/AirLiveness.h:
(JSC::B3::Air::Liveness::Liveness):
* dfg/DFGLivenessAnalysisPhase.cpp:
(JSC::DFG::LivenessAnalysisPhase::LivenessAnalysisPhase): Deleted.
(JSC::DFG::LivenessAnalysisPhase::run): Deleted.
(JSC::DFG::LivenessAnalysisPhase::processBlock): Deleted.

Source/WTF:

This makes IndexSparseSet capable of being used as a map if you instantiate it with
KeyValuePair<unsigned, ValueType>.

* wtf/HashTraits.h:
* wtf/IndexSparseSet.h:
(WTF::DefaultIndexSparseSetTraits::create):
(WTF::DefaultIndexSparseSetTraits::key):
(WTF::OverflowHandler>::IndexSparseSet):
(WTF::OverflowHandler>::add):
(WTF::OverflowHandler>::set):
(WTF::OverflowHandler>::remove):
(WTF::OverflowHandler>::clear):
(WTF::OverflowHandler>::size):
(WTF::OverflowHandler>::isEmpty):
(WTF::OverflowHandler>::contains):
(WTF::OverflowHandler>::sort):
(WTF::IndexSparseSet<OverflowHandler>::IndexSparseSet): Deleted.
(WTF::IndexSparseSet<OverflowHandler>::add): Deleted.
(WTF::IndexSparseSet<OverflowHandler>::remove): Deleted.
(WTF::IndexSparseSet<OverflowHandler>::clear): Deleted.
(WTF::IndexSparseSet<OverflowHandler>::size): Deleted.
(WTF::IndexSparseSet<OverflowHandler>::isEmpty): Deleted.
(WTF::IndexSparseSet<OverflowHandler>::contains): Deleted.
(WTF::IndexSparseSet<OverflowHandler>::sort): Deleted.
* wtf/Liveness.h:
(WTF::Liveness::LocalCalc::Iterable::iterator::iterator):
(WTF::Liveness::workset):

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

2 years agoDo some minor FEColorMatrix code cleanup and optimization
simon.fraser@apple.com [Wed, 5 Apr 2017 00:23:46 +0000 (00:23 +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@214916 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoDo not assert when CharacterData representing an Attr fires events
bfulgham@apple.com [Wed, 5 Apr 2017 00:05:27 +0000 (00:05 +0000)]
Do not assert when CharacterData representing an Attr fires events
https://bugs.webkit.org/show_bug.cgi?id=170454
<rdar://problem/30979320>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Make the NoEventDispatchAssertion in CharacterData::notifyParentAfterChange conditional
since Attr elements should be allowed to fire events.

Tests: fast/dom/no-assert-for-malformed-js-url-attribute.html

* dom/CharacterData.cpp:
(WebCore::CharacterData::notifyParentAfterChange):

LayoutTests:

* fast/dom/no-assert-for-malformed-js-url-attribute-expected.txt: Added.
* fast/dom/no-assert-for-malformed-js-url-attribute.html: Added.

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

2 years agoRemove stale LLVM Header Path includes from JavaScriptCore
commit-queue@webkit.org [Tue, 4 Apr 2017 23:38:33 +0000 (23:38 +0000)]
Remove stale LLVM Header Path includes from JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=170483

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

* Configurations/Base.xcconfig:

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

2 years agoLayoutTest webrtc/libwebrtc/descriptionGetters.html is a flaky failure
commit-queue@webkit.org [Tue, 4 Apr 2017 23:37:55 +0000 (23:37 +0000)]
LayoutTest webrtc/libwebrtc/descriptionGetters.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=169481

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

Source/WebCore:

No need to enumerate all network interfaces in most layout tests.
Adding an Internals API for that in case we want to use TCP localhost candidates.

* testing/Internals.cpp:
(WebCore::Internals::Internals):
(WebCore::Internals::setEnumeratingAllNetworkInterfacesEnabled):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* platform/mac-wk2/TestExpectations: Removing flaky expectation.
* webrtc/datachannel/basic.html:

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

2 years agoUnreviewed build fix: fix compilation error on Sierra.
jer.noble@apple.com [Tue, 4 Apr 2017 23:32:28 +0000 (23:32 +0000)]
Unreviewed build fix: fix compilation error on Sierra.

* platform/spi/mac/AVFoundationSPI.h:

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

2 years agoVarious settings in Minibrowser are off by default, and should be on
simon.fraser@apple.com [Tue, 4 Apr 2017 23:32:03 +0000 (23:32 +0000)]
Various settings in Minibrowser are off by default, and should be on
https://bugs.webkit.org/show_bug.cgi?id=170465
rdar://problem/31421543

Reviewed by Tim Horton.

Explicitly set preferences that should be on by default to enabled, if they have not been
set previously.

* MiniBrowser/mac/SettingsController.m:
(-[SettingsController init]):

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

2 years agoFix leaks in WebUITextIndicatorData
megan_gardner@apple.com [Tue, 4 Apr 2017 22:57:22 +0000 (22:57 +0000)]
Fix leaks in WebUITextIndicatorData
https://bugs.webkit.org/show_bug.cgi?id=170480

Reviewed by Wenson Hsieh.

Removes extraneous retains.

* WebView/WebView.mm:
(-[WebUITextIndicatorData initWithImage:textIndicatorData:scale:]):

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

2 years agoreviewer
jfbastien@apple.com [Tue, 4 Apr 2017 22:48:40 +0000 (22:48 +0000)]
reviewer

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

2 years agoB3::LowerToAir incorrectly selects BitXor(AtomicStrongCAS(...), $1)
fpizlo@apple.com [Tue, 4 Apr 2017 22:37:51 +0000 (22:37 +0000)]
B3::LowerToAir incorrectly selects BitXor(AtomicStrongCAS(...), $1)
https://bugs.webkit.org/show_bug.cgi?id=169867

Reviewed by Saam Barati.

The BitXor(AtomicWeakCAS(...), $1) optimization makes a lot of sense because we an fold the
BitXor into the CAS condition read-out. But there is no version of this that is profitable or
correct for AtomicStrongCAS. The inversion case is handled by Equal(AtomicStrongCAS(...), ...)
becoming NotEqual(AtomicStrongCAS(...), ...), and we alraedy handle that separately.

So, the fix here is to make the BitXor CAS pattern only recognize AtomicWeakCAS.

* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::lower):
* b3/testb3.cpp:
(JSC::B3::testAtomicStrongCAS):

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

2 years agoMove AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h
jer.noble@apple.com [Tue, 4 Apr 2017 22:30:04 +0000 (22:30 +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:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer): Deleted.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeDisplayLayer): Deleted.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
* platform/spi/mac/AVFoundationSPI.h:

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

2 years agoWeb Inspector: RTL: layout issues in Type Profiler popovers
bburg@apple.com [Tue, 4 Apr 2017 22:23:46 +0000 (22:23 +0000)]
Web Inspector: RTL: layout issues in Type Profiler popovers
https://bugs.webkit.org/show_bug.cgi?id=170467

Reviewed by Timothy Hatcher.

Flip some margins and padding. Remove the -1px leading margin for
the prototype disclosure button, as it is unnecessary and looks
(more) wrong when in RTL.

* UserInterface/Views/TypeTreeElement.css:
(.item.type-tree-element > .disclosure-button):
(.item.type-tree-element.prototype):
(body[dir=ltr] .item.type-tree-element.prototype):
(body[dir=rtl] .item.type-tree-element.prototype):
* UserInterface/Views/TypeTreeView.css:
(.tree-outline.type):
(body[dir=ltr] .tree-outline.type):
(body[dir=rtl] .tree-outline.type):
(.tree-outline.type li .empty-message):
(body[dir=ltr] .tree-outline.type li .empty-message):
(body[dir=rtl] .tree-outline.type li .empty-message):

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

2 years agoWebAssembly: JSWebAssemblyCallee should not be a JSCell
sbarati@apple.com [Tue, 4 Apr 2017 22:23:37 +0000 (22:23 +0000)]
WebAssembly: JSWebAssemblyCallee should not be a JSCell
https://bugs.webkit.org/show_bug.cgi?id=170135

Reviewed by Michael Saboff.

Source/JavaScriptCore:

This patch is perhaps the last big change to the design of fundamental
Wasm API to allow for PIC. It changes JSWebAssemblyCallee into a thing
called Wasm::Callee. It serves the same purpose as before, except
Wasm::Callee is not a JSCell. I had to refactor the various parts of the
runtime that will see CallFrame's with Wasm::Callee's in the callee slot.
Thankfully, the parts of the runtime that Wasm touches are limited. The
main refactoring is changing the exception handling code, such as taking
a stack trace, to be friendly to seeing a non JSCell callee.

The callee() function on ExecState now returns a class I added in this
patch called CalleeBits. CalleeBits will tell you if the callee is a
JSCell or a Wasm::Callee. We tag Wasm::Callee's with a 1 in their lower
bit so we can easily tell what is and isn't a Wasm::Callee.

The stub that calls out from Wasm to JS still puts a JSCell callee
into the call frame, even though the callee logically represents a
Wasm frame. The reason for this is that we use the call IC infrastructure
to make a call out to JS code, and the code that writes the IC expects
a JSCell as the callee. This is knowingly part of our design. When we
do structured cloning of Wasm Modules, we'll need to regenerate these
JS call stubs.

* API/JSContextRef.cpp:
(BacktraceFunctor::operator()):
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* debugger/Debugger.cpp:
(JSC::Debugger::pauseIfNeeded):
(JSC::Debugger::currentDebuggerCallFrame):
* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::create):
(JSC::DebuggerCallFrame::DebuggerCallFrame):
(JSC::DebuggerCallFrame::currentPosition):
(JSC::DebuggerCallFrame::positionForCallFrame):
* debugger/DebuggerCallFrame.h:
* interpreter/CallFrame.cpp:
(JSC::CallFrame::vmEntryGlobalObject):
(JSC::CallFrame::wasmAwareLexicalGlobalObject):
(JSC::CallFrame::isAnyWasmCallee):
(JSC::CallFrame::callerSourceOrigin):
* interpreter/CallFrame.h:
(JSC::ExecState::calleeAsValue):
(JSC::ExecState::jsCallee):
(JSC::ExecState::callee):
(JSC::ExecState::unsafeCallee):
(JSC::ExecState::scope):
(JSC::ExecState::iterate):
* interpreter/CalleeBits.h: Added.
(JSC::CalleeBits::CalleeBits):
(JSC::CalleeBits::operator=):
(JSC::CalleeBits::boxWasm):
(JSC::CalleeBits::isWasm):
(JSC::CalleeBits::isCell):
(JSC::CalleeBits::asCell):
(JSC::CalleeBits::asWasmCallee):
(JSC::CalleeBits::rawPtr):
* interpreter/Interpreter.cpp:
(JSC::GetStackTraceFunctor::operator()):
(JSC::Interpreter::getStackTrace):
(JSC::notifyDebuggerOfUnwinding):
(JSC::UnwindFunctor::UnwindFunctor):
(JSC::UnwindFunctor::operator()):
(JSC::UnwindFunctor::copyCalleeSavesToVMEntryFrameCalleeSavesBuffer):
(JSC::Interpreter::unwind):
(JSC::Interpreter::notifyDebuggerOfExceptionToBeThrown):
* interpreter/Interpreter.h:
* interpreter/Register.h:
(JSC::Register::pointer):
* interpreter/ShadowChicken.cpp:
(JSC::ShadowChicken::update):
* interpreter/ShadowChickenInlines.h:
(JSC::ShadowChicken::iterate):
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::StackVisitor):
(JSC::StackVisitor::readFrame):
(JSC::StackVisitor::readNonInlinedFrame):
(JSC::StackVisitor::readInlinedFrame):
(JSC::StackVisitor::Frame::calleeSaveRegisters):
(JSC::StackVisitor::Frame::functionName):
(JSC::StackVisitor::Frame::dump):
* interpreter/StackVisitor.h:
(JSC::StackVisitor::Frame::callee):
(JSC::StackVisitor::visit):
* jit/Repatch.cpp:
(JSC::linkFor):
(JSC::linkPolymorphicCall):
* jsc.cpp:
(callWasmFunction):
(functionTestWasmModuleFunctions):
* runtime/ArrayPrototype.cpp:
* runtime/Error.cpp:
(JSC::addErrorInfoAndGetBytecodeOffset):
* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::finishCreation):
* runtime/JSCell.cpp:
(JSC::JSCell::isAnyWasmCallee): Deleted.
* runtime/JSCell.h:
* runtime/JSCellInlines.h:
(JSC::ExecState::vm):
* runtime/JSFunction.cpp:
(JSC::RetrieveArgumentsFunctor::operator()):
(JSC::RetrieveCallerFunctionFunctor::operator()):
* runtime/JSGlobalObject.cpp:
* runtime/SamplingProfiler.cpp:
(JSC::FrameWalker::recordJSFrame):
(JSC::SamplingProfiler::processUnverifiedStackTraces):
* runtime/SamplingProfiler.h:
(JSC::SamplingProfiler::UnprocessedStackFrame::UnprocessedStackFrame):
* runtime/StackFrame.cpp:
(JSC::StackFrame::sourceURL):
(JSC::StackFrame::functionName):
* runtime/StackFrame.h:
(JSC::StackFrame::wasm):
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::throwException):
* runtime/VM.h:
* wasm/JSWebAssembly.h:
* wasm/WasmB3IRGenerator.cpp:
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToWasm):
* wasm/WasmCallee.cpp: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyCallee.cpp.
(JSC::Wasm::Callee::Callee):
(JSC::JSWebAssemblyCallee::JSWebAssemblyCallee): Deleted.
(JSC::JSWebAssemblyCallee::finishCreation): Deleted.
(JSC::JSWebAssemblyCallee::destroy): Deleted.
* wasm/WasmCallee.h: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyCallee.h.
(JSC::Wasm::Callee::create):
(JSC::JSWebAssemblyCallee::create): Deleted.
(JSC::JSWebAssemblyCallee::createStructure): Deleted.
(JSC::JSWebAssemblyCallee::entrypoint): Deleted.
(JSC::JSWebAssemblyCallee::calleeSaveRegisters): Deleted.
* wasm/WasmContext.h:
* wasm/WasmPlan.cpp:
* wasm/WasmPlan.h:
* wasm/WasmPlanInlines.h:
(JSC::Wasm::Plan::initializeCallees):
* wasm/WasmThunks.cpp:
(JSC::Wasm::throwExceptionFromWasmThunkGenerator):
* wasm/js/JSWebAssemblyCallee.cpp: Removed.
* wasm/js/JSWebAssemblyCallee.h: Removed.
* wasm/js/JSWebAssemblyCodeBlock.cpp:
(JSC::JSWebAssemblyCodeBlock::JSWebAssemblyCodeBlock):
(JSC::JSWebAssemblyCodeBlock::initialize):
(JSC::JSWebAssemblyCodeBlock::visitChildren):
* wasm/js/JSWebAssemblyCodeBlock.h:
(JSC::JSWebAssemblyCodeBlock::create):
(JSC::JSWebAssemblyCodeBlock::jsEntrypointCalleeFromFunctionIndexSpace):
(JSC::JSWebAssemblyCodeBlock::wasmEntrypointCalleeFromFunctionIndexSpace):
(JSC::JSWebAssemblyCodeBlock::wasmToJsCallStubForImport):
(JSC::JSWebAssemblyCodeBlock::offsetOfImportWasmToJSStub):
(JSC::JSWebAssemblyCodeBlock::setJSEntrypointCallee):
(JSC::JSWebAssemblyCodeBlock::setWasmEntrypointCallee):
(JSC::JSWebAssemblyCodeBlock::offsetOfImportStubs):
(JSC::JSWebAssemblyCodeBlock::allocationSize):
(JSC::JSWebAssemblyCodeBlock::importWasmToJSStub):
(JSC::JSWebAssemblyCodeBlock::callees): Deleted.
(JSC::JSWebAssemblyCodeBlock::offsetOfCallees): Deleted.
* wasm/js/JSWebAssemblyInstance.h:
(JSC::JSWebAssemblyInstance::webAssemblyToJSCallee):
* wasm/js/JSWebAssemblyModule.cpp:
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):
(JSC::WebAssemblyFunction::create):
(JSC::WebAssemblyFunction::WebAssemblyFunction):
(JSC::WebAssemblyFunction::visitChildren):
(JSC::WebAssemblyFunction::finishCreation):
* wasm/js/WebAssemblyFunction.h:
(JSC::WebAssemblyFunction::wasmEntrypoint):
(JSC::WebAssemblyFunction::jsEntrypoint):
(JSC::WebAssemblyFunction::offsetOfWasmEntrypoint):
(JSC::WebAssemblyFunction::offsetOfWasmEntryPointCode): Deleted.
* wasm/js/WebAssemblyModuleConstructor.cpp:
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):
(JSC::WebAssemblyModuleRecord::evaluate):

Source/WebCore:

* bindings/js/JSDOMWindowBase.cpp:
(WebCore::callerDOMWindow):

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

2 years agoWasmBench asserts in debug jsc
keith_miller@apple.com [Tue, 4 Apr 2017 22:19:38 +0000 (22:19 +0000)]
WasmBench asserts in debug jsc
https://bugs.webkit.org/show_bug.cgi?id=170462

Reviewed by Saam Barati.

The assertion should have been an if.

* wasm/WasmWorklist.cpp:

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

2 years agoWeb Inspector: Include more Network information in Resource Details Sidebar
commit-queue@webkit.org [Tue, 4 Apr 2017 22:14:31 +0000 (22:14 +0000)]
Web Inspector: Include more Network information in Resource Details Sidebar
https://bugs.webkit.org/show_bug.cgi?id=170470

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-04-04
Reviewed by Brian Burg.

* Localizations/en.lproj/localizedStrings.js:
Updated localized strings.

* UserInterface/Models/Resource.js:
(WebInspector.Resource.displayNameForProtocol):
(WebInspector.Resource.displayNameForPriority):
Aggregate all display name helpers here.

* UserInterface/Views/DetailsSectionSimpleRow.js:
(WebInspector.DetailsSectionSimpleRow.prototype.get tooltip):
(WebInspector.DetailsSectionSimpleRow.prototype.set tooltip):
Allow setting a tooltip on the value.

* UserInterface/Views/NetworkGridContentView.css:
(.cache-type):
Cache type shows up in multiple places. Simplify the CSS to apply anywhere.

* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView):
* UserInterface/Views/NetworkTimelineView.js:
(WebInspector.NetworkTimelineView):
Updated column names.

* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WebInspector.ResourceDetailsSidebarPanel):
(WebInspector.ResourceDetailsSidebarPanel.prototype._refreshRequestAndResponse):
(WebInspector.ResourceDetailsSidebarPanel.prototype._cachedRowValue):
Include more detail information in the sidebar.

* UserInterface/Views/ResourceTimelineDataGridNode.js:
(WebInspector.ResourceTimelineDataGridNode.prototype.createCellContent):
(WebInspector.ResourceTimelineDataGridNode.prototype._displayNameForPriority): Deleted.
Use shared code for display names.

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

2 years agoWeb Inspector: RTL: fix alignment of close button shown while docked
bburg@apple.com [Tue, 4 Apr 2017 22:05:36 +0000 (22:05 +0000)]
Web Inspector: RTL: fix alignment of close button shown while docked
https://bugs.webkit.org/show_bug.cgi?id=170472

Reviewed by Matt Baker.

* UserInterface/Views/Toolbar.css:
(.toolbar .control-section):
(body[dir=ltr] .toolbar .control-section):
(body[dir=rtl] .toolbar .control-section):

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

2 years agoAir::lowerAfterRegAlloc should bail early if it finds no Shuffles or ColdCCalls
fpizlo@apple.com [Tue, 4 Apr 2017 21:48:41 +0000 (21:48 +0000)]
Air::lowerAfterRegAlloc should bail early if it finds no Shuffles or ColdCCalls
https://bugs.webkit.org/show_bug.cgi?id=170305

Reviewed by Saam Barati.

This reduces and sometimes completely eliminates the need to run lowerAfterRegAlloc().

This lowers the Shuffle for the arguments of a CCall before register allocation unless
the CCall arguments require a real shuffle (like if the CCall arguments were argument
registers). This lowers a ColdCCall like a CCall for optLevel<2.

Finally, lowerAfterRegAlloc() now checks if there are any Shuffles or CCalls before it
does anything else. For wasm at -O1, this means that the phase doesn't run at all. This
is a ~3% wasm -O1 compile time progression.

To make this easy, I changed optLevel into a property of Procedure and Code rather than
an argument we thread through everything. I like how Procedure and Code are dumping
ground classes. This does not bother me. Note that I cloned optLevel into Procedure and
Code so that it's cheap to query inside Air phases.

* b3/B3Compile.cpp:
(JSC::B3::compile):
* b3/B3Compile.h:
* b3/B3Generate.cpp:
(JSC::B3::prepareForGeneration):
(JSC::B3::generateToAir):
* b3/B3Generate.h:
* b3/B3Procedure.cpp:
(JSC::B3::Procedure::setOptLevel):
* b3/B3Procedure.h:
(JSC::B3::Procedure::optLevel):
* b3/air/AirCode.h:
(JSC::B3::Air::Code::isPinned):
(JSC::B3::Air::Code::setOptLevel):
(JSC::B3::Air::Code::optLevel):
* b3/air/AirEmitShuffle.cpp:
(JSC::B3::Air::ShufflePair::bank):
(JSC::B3::Air::ShufflePair::opcode):
(JSC::B3::Air::ShufflePair::inst):
(JSC::B3::Air::emitShuffle):
* b3/air/AirEmitShuffle.h:
(JSC::B3::Air::moveFor):
* b3/air/AirGenerate.cpp:
(JSC::B3::Air::prepareForGeneration):
* b3/air/AirGenerate.h:
* b3/air/AirLowerAfterRegAlloc.cpp:
(JSC::B3::Air::lowerAfterRegAlloc):
* b3/air/AirLowerMacros.cpp:
(JSC::B3::Air::lowerMacros):
* b3/testb3.cpp:
(JSC::B3::compileProc):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::parseAndCompile):

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

2 years agoChange Document's lastHandledUserGestureTimestamp to be a MonotonicTime
simon.fraser@apple.com [Tue, 4 Apr 2017 21:32:15 +0000 (21:32 +0000)]
Change Document's lastHandledUserGestureTimestamp to be a MonotonicTime
https://bugs.webkit.org/show_bug.cgi?id=170468

Reviewed by Zalan Bujtas.

Change the double to MonotonicTime. No behavior change.

* dom/Document.cpp:
(WebCore::Document::updateLastHandledUserGestureTimestamp):
* dom/Document.h:
(WebCore::Document::lastHandledUserGestureTimestamp):
* html/HTMLPlugInImageElement.cpp:
(WebCore::documentHadRecentUserGesture):
* loader/FrameLoader.cpp:
(WebCore::shouldAskForNavigationConfirmation):

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

2 years agoWeb Inspector: RTL: layout issues in debugger dashboard, arrows are on wrong side
bburg@apple.com [Tue, 4 Apr 2017 21:30:29 +0000 (21:30 +0000)]
Web Inspector: RTL: layout issues in debugger dashboard, arrows are on wrong side
https://bugs.webkit.org/show_bug.cgi?id=170425

Reviewed by Devin Rousso.

We need to move the up/down dashboard arrows to the trailing side for RTL.
Clean up some messy spacing rules so that the source location does not
overlap the arrows or get too close to the function icon.

* UserInterface/Views/DashboardContainerView.css:
(.toolbar .dashboard):
(body[dir=ltr] .toolbar .dashboard):
(body[dir=rtl] .toolbar .dashboard):
(.dashboard-container .advance-arrow):
(body[dir=ltr] .dashboard-container .advance-arrow):
(body[dir=rtl] .dashboard-container .advance-arrow):
(.toolbar.label-only .dashboard-container .advance-arrow):
(body[dir=ltr] .toolbar.label-only .dashboard-container .advance-arrow):
(body[dir=rtl] .toolbar.label-only .dashboard-container .advance-arrow):
* UserInterface/Views/DebuggerDashboardView.css:
(.toolbar .dashboard.debugger):
(body[dir=ltr] .toolbar .dashboard.debugger):
(body[dir=rtl] .toolbar .dashboard.debugger):
(.dashboard.debugger .navigation-bar):
(body[dir=ltr] .dashboard.debugger .navigation-bar):
(body[dir=rtl] .dashboard.debugger .navigation-bar):
(.dashboard.debugger > .location):
(.dashboard.debugger > .location > :first-child):
(body[dir=ltr] .dashboard.debugger > .location > :last-child):
(body[dir=rtl] .dashboard.debugger > .location > :last-child):
(.dashboard.debugger > .location .function-icon):
(body[dir=ltr] .dashboard.debugger > .location .function-icon):
(body[dir=rtl] .dashboard.debugger > .location .function-icon):
(.dashboard.debugger > .location .go-to-link):

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

2 years agoUnreviewed. Add details on how to enable the experimental feature.
dino@apple.com [Tue, 4 Apr 2017 21:22:05 +0000 (21:22 +0000)]
Unreviewed. Add details on how to enable the experimental feature.

* demos/webgpu/index.html:

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

2 years ago[Debug] ASSERT(!throwScope.exception()) on imported/w3c/web-platform-tests/fetch...
commit-queue@webkit.org [Tue, 4 Apr 2017 21:11:38 +0000 (21:11 +0000)]
[Debug] ASSERT(!throwScope.exception()) on imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html
https://bugs.webkit.org/show_bug.cgi?id=170395
<rdar://problem/31394017>

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

No change of behavior.

* bindings/js/JSDOMPromise.cpp:
(WebCore::DeferredPromise::reject): Adding early ASSERT that creating an exception is happening correctly.

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

2 years agoIncrease timeouts for simulator testing
jbedard@apple.com [Tue, 4 Apr 2017 21:08:43 +0000 (21:08 +0000)]
Increase timeouts for simulator testing

Unreviewed infrastructure fix.

* Scripts/webkitpy/port/simulator_process.py:
(SimulatorProcess._start): Increase timeout from 3 to 6 seconds.
* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDevice.install_app): Increase timeout from 1 to 3 seconds.

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

2 years agoRolling back the build fix, as it broke other builds.
ap@apple.com [Tue, 4 Apr 2017 20:09:55 +0000 (20:09 +0000)]
Rolling back the build fix, as it broke other builds.

* platform/spi/mac/AVFoundationSPI.h:

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

2 years agoBuild fix.
ap@apple.com [Tue, 4 Apr 2017 20:03:47 +0000 (20:03 +0000)]
Build fix.

Rubber-stamped by Jer Noble.

* platform/spi/mac/AVFoundationSPI.h:

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

2 years ago[Mac] -[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultC...
timothy_horton@apple.com [Tue, 4 Apr 2017 19:59:52 +0000 (19:59 +0000)]
[Mac] -[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:] invokes the resultCollector with didWrap = NO even when it wraps
https://bugs.webkit.org/show_bug.cgi?id=165801
<rdar://problem/29649535>

Reviewed by Wenson Hsieh.

New API tests: WebKit2.FindInPageWrapping*

Previously, when doing an incremental find that wrapped, we would
say that it did not, leading NSTextFinder to not provide its usual
wrapping UI, and other clients of the NSTextFinderClient protocol to
get confused by the lack of wrapping.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFindString):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/API/APIFindClient.h:
(API::FindClient::didFindString):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageFindClient):
* UIProcess/Cocoa/FindClient.h:
* UIProcess/Cocoa/FindClient.mm:
(WebKit::FindClient::didFindString):
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindUIAfterPageScroll):
(WebKit::FindController::findString):
* WebProcess/WebPage/FindController.h:
Plumb DidWrap from FindController's call to findString back through
the DidFindString message.

* UIProcess/mac/WKTextFinderClient.mm:
(-[WKTextFinderClient didFindStringMatchesWithRects:didWrapAround:]):
(-[WKTextFinderClient didFindStringMatchesWithRects:]): Deleted.
Make use of the new DidWrap information to stop lying to NSTextFinder
about whether a wrap actually occurred.

* page/FrameTree.cpp:
(WebCore::FrameTree::traverseNextWithWrap):
(WebCore::FrameTree::traversePreviousWithWrap):
(WebCore::FrameTree::traverseNextInPostOrderWithWrap):
* page/FrameTree.h:
Add CanWrap and DidWrap boolean enums, and add an optional out argument
to traverse*WithWrap indicating whether a wrap actually occurred.

* history/CachedPage.cpp:
(WebCore::firePageShowAndPopStateEvents):
* history/PageCache.cpp:
(WebCore::destroyRenderTree):
Adjust to the new CanWrap enum.

* page/Page.cpp:
(WebCore::incrementFrame):
(WebCore::Page::findString):
(WebCore::Page::findStringMatchingRanges):
(WebCore::Page::rangeOfString):
(WebCore::Page::findMatchesForText):
(WebCore::Page::unmarkAllTextMatches):
* page/Page.h:
Adjust to the new CanWrap enum, and optionally plumb DidWrap through
to callers of findString().

* WebView/WebView.mm:
(incrementFrame):
Adjust to the new CanWrap enum.

* TestWebKitAPI/Tests/WebKit2Cocoa/FindInPage.mm:
(TEST):
Add some tests for wrapping finds.

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

2 years agoAdd back results that were accidentally removed with r214848.
ryanhaddad@apple.com [Tue, 4 Apr 2017 19:43:29 +0000 (19:43 +0000)]
Add back results that were accidentally removed with r214848.
https://bugs.webkit.org/show_bug.cgi?id=169301

Unreviewed test gardening.

* platform/mac/fast/text/international/synthesized-italic-vertical-latin-expected.png: Added.
* platform/mac/fast/text/international/synthesized-italic-vertical-latin-expected.txt: Added.

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

2 years agoMark media/modern-media-controls/macos-inline-media-controls/macos-inline-media-contr...
ryanhaddad@apple.com [Tue, 4 Apr 2017 19:43:26 +0000 (19:43 +0000)]
Mark media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-buttons-styles.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=170456

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years agowebrtc/peer-connection-audio-mute.html is flaky
commit-queue@webkit.org [Tue, 4 Apr 2017 19:24:31 +0000 (19:24 +0000)]
webrtc/peer-connection-audio-mute.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=170451

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

* TestExpectations: Removed flaky expectation for webrtc/peer-connection-audio-mute.html.
* webrtc/peer-connection-remote-audio-mute.html: Added timer to ensure setting enable propagates.
Decreasing time spent at detecting hum or not.
* webrtc/peer-connection-remote-audio-mute2.html: Ditto (but keeping flakiness expectation for now).

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

2 years agoDon't need to Air::reportUsedRegisters for wasm at -O1
fpizlo@apple.com [Tue, 4 Apr 2017 19:09:03 +0000 (19:09 +0000)]
Don't need to Air::reportUsedRegisters for wasm at -O1
https://bugs.webkit.org/show_bug.cgi?id=170459

Reviewed by Saam Barati.

Source/JavaScriptCore:

I did some refactorings to Liveness<> to try to understand its performance. Based on
this I concluded that the bigger immediate issue is just removing unnecessary phases
from -O1.

This removes Air::reportUsedRegisters() from -O1 if the user has indicated that he is
not interested in StackmapGenerationParams::usedRegisters(). The logic here is a bit
weird because of how Air does spill code generation. The register allocator's spiller
will emit spill code using identifiable spill slots, which allows subsequent phases to
register-allocate the spill slots. We do this by a forward flow CSE phase called
fixObviousSpills (which is a terrible name since there is no longer anything obvious
about some of the spills that this phase can fix!). As is most natural for CSEs over
3AC, it rewires the uses of redundant computations rather than removing the redundant
computations. This means that if a spill got "fixed", there may be either or both of
the following:

- Dead loads from the stack.
- Dead stores to the stack.

We know that a load from the stack is dead if the register is dead at the point of the
load. We know that a store to the stack is dead if the spill slot is dead at the point
of the store.

Unfortunately, liveness analysis - over either registers or spill slots - is expensive.

Fortunately, allocateStack() already does liveness analysis over spill slots. So, we
baked elimination of stores to the stack into that phase. That aspect of clean-up after
the spill CSE comes for free.

Also fortunately for the FTL, we have to do reportUsedRegisters() anyway. This is a
phase that enables StackmapGenerationParams::usedRegisters() to work, which then
enables the FTL's patchpoints to do crazy slow-path live range splitting. So, Air's
strategy for the load fix-up after spill CSE is to do it as part of
reportUsedRegisters().

This patch introduces the Procedure::setNeedsUsedRegisters() API. But if you set
needsUsedRegisters to false then we will still run reportUsedRegisters() at -O2 as an
optimization - it removes dead loads from the stack that are left behind from
fixObviousSpills().

This is a ~6% compile time progression at -O1.

* b3/B3Procedure.h:
(JSC::B3::Procedure::setNeedsUsedRegisters):
(JSC::B3::Procedure::needsUsedRegisters):
* b3/B3StackmapGenerationParams.h:
* b3/B3VariableLiveness.cpp:
(JSC::B3::VariableLiveness::VariableLiveness):
* b3/air/AirCode.cpp:
(JSC::B3::Air::Code::needsUsedRegisters):
* b3/air/AirCode.h:
* b3/air/AirGenerate.cpp:
(JSC::B3::Air::prepareForGeneration):
* b3/air/AirLiveness.h:
(JSC::B3::Air::Liveness::Liveness):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::parseAndCompile):

Source/WTF:

Just moved the liveness computation into a method, which enabled me to do the profiling
that I used to write this patch.

* wtf/Liveness.h:
(WTF::Liveness::Liveness):
(WTF::Liveness::compute):

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

2 years ago[CMake] Enforce Python 2
commit-queue@webkit.org [Tue, 4 Apr 2017 19:06:46 +0000 (19:06 +0000)]
[CMake] Enforce Python 2
https://bugs.webkit.org/show_bug.cgi?id=170439

Patch by Ross Kirsling <ross.kirsling@sony.com> on 2017-04-04
Reviewed by Brent Fulgham.

* Source/cmake/WebKitCommon.cmake: Fail build immediately if Python 3 is detected.

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

2 years ago[GTK] PLATFORM(GTK) && !USE(COORDINATED_GRAPHICS_THREADED) is no longer possible
carlosgc@webkit.org [Tue, 4 Apr 2017 18:01:05 +0000 (18:01 +0000)]
[GTK] PLATFORM(GTK) && !USE(COORDINATED_GRAPHICS_THREADED) is no longer possible
https://bugs.webkit.org/show_bug.cgi?id=170458

Reviewed by Carlos Alberto Lopez Perez.

That is not supported anymore, so we can remove dead code from VideoSinkGStreamer.cpp

* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
(VideoRenderRequestScheduler::VideoRenderRequestScheduler):

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

2 years agoMark fast/images/animated-gif-webkit-transform.html as flaky.
ryanhaddad@apple.com [Tue, 4 Apr 2017 17:38:58 +0000 (17:38 +0000)]
Mark fast/images/animated-gif-webkit-transform.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=170410

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoAir liveness should build constraints and solve them rather than repeatedly parsing IR
fpizlo@apple.com [Tue, 4 Apr 2017 17:20:43 +0000 (17:20 +0000)]
Air liveness should build constraints and solve them rather than repeatedly parsing IR
https://bugs.webkit.org/show_bug.cgi?id=170421

Reviewed by Saam Barati.
Source/JavaScriptCore:

Inst::forEach<> is expensive. The LivenessAdapter uses forEach with a particularly
gnarly lambda that has many extra checks. Therefore, a lot of the time spent in
liveness analysis is just recomputing forEach<> and that lambda to get uses and defs.

This introduces LivenessConstraints<>, which is a liveness constraint system based on
Adapter. It basically caches the results of doing forEach. It'll give you the uses and
defs at each instruction boundary.

This is a ~5% compile time progression at optLevel=1. It's also a ~3% compile time
progression at optLevel=2.

* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/air/AirLivenessAdapter.h:
(JSC::B3::Air::LivenessAdapter::LivenessAdapter):
(JSC::B3::Air::LivenessAdapter::forEachUse):
(JSC::B3::Air::LivenessAdapter::forEachDef):
* b3/air/AirLivenessConstraints.h: Added.
(JSC::B3::Air::LivenessConstraints::Actions::Actions):
(JSC::B3::Air::LivenessConstraints::LivenessConstraints):
(JSC::B3::Air::LivenessConstraints::at):

Source/WTF:

* wtf/Vector.h:
(WTF::minCapacity>::appendIfNotContains): Because sometimes Vector<> is the best kind of set.

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

2 years agoUnreviewed Windows build fix.
pvollan@apple.com [Tue, 4 Apr 2017 07:20:14 +0000 (07:20 +0000)]
Unreviewed Windows build fix.

* bindings/js/JSDOMGuardedObject.h:

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

2 years ago[WTF] Introduce WTF::RandomDevice which keeps /dev/urandom opened
utatane.tea@gmail.com [Tue, 4 Apr 2017 07:04:38 +0000 (07:04 +0000)]
[WTF] Introduce WTF::RandomDevice which keeps /dev/urandom opened
https://bugs.webkit.org/show_bug.cgi?id=170095

Reviewed by Michael Catanzaro.

In this patch, we introduce RandomDevice, which keeps /dev/urandom opened
to avoid repeatedly open and close urandom file descriptor in Linux.

The purpose is similar to std::random_device, but WTF::RandomDevice explicitly
avoids using ARC4, which is recently attempted to be removed from the WebKit
tree[1].

[1]: https://trac.webkit.org/r214329

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/OSRandomSource.cpp:
(WTF::cryptographicallyRandomValuesFromOS):
(WTF::crashUnableToOpenURandom): Deleted.
(WTF::crashUnableToReadFromURandom): Deleted.
* wtf/RandomDevice.cpp: Copied from Source/WTF/wtf/OSRandomSource.cpp.
(WTF::crashUnableToOpenURandom):
(WTF::crashUnableToReadFromURandom):
(WTF::RandomDevice::RandomDevice):
(WTF::RandomDevice::~RandomDevice):
(WTF::RandomDevice::cryptographicallyRandomValues):
* wtf/RandomDevice.h: Added.

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

2 years agoAdd some new patterns to filter-build-webkit
commit-queue@webkit.org [Tue, 4 Apr 2017 06:52:31 +0000 (06:52 +0000)]
Add some new patterns to filter-build-webkit
https://bugs.webkit.org/show_bug.cgi?id=170429

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

* Scripts/filter-build-webkit:
(setOutputFormatOption):

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

2 years agoData interaction should register type identifiers in order of priority
wenson_hsieh@apple.com [Tue, 4 Apr 2017 04:31:48 +0000 (04:31 +0000)]
Data interaction should register type identifiers in order of priority
https://bugs.webkit.org/show_bug.cgi?id=170428
<rdar://problem/30633296>

Reviewed by Tim Horton.

Source/WebCore:

Currently, due to the shared logic for writing to a UIPasteboard (in the case of copy/paste) and the shared
UIItemProvider-based pasteboard wrapper (in the case of data interaction), we don't enforce any particular
ordering in which type identifiers are registered in the generated item provider. This is because
-[UIPasteboard setItems:] only takes an unordered mapping of type identifiers to objects.

To fix this, we introduce a separate way to set pasteboard data that first writes a list of object
representations in order of priority (which is dependent on the content being interacted with) and then register
individual type-data mappings at the end.

Augmented existing API tests in DataInteractionTests to check for the existence and priority of type identifiers
in the UIItemProviders created upon starting data interaction. Also adds a new unit test:
DataInteractionTests.TextAreaToInput.

* WebCore.xcodeproj/project.pbxproj:
* editing/cocoa/EditorCocoa.mm:
(WebCore::archivedDataForAttributedString):
(WebCore::Editor::writeSelectionToPasteboard):
(WebCore::Editor::writeSelection):
* platform/Pasteboard.h:
* platform/PasteboardWriterData.h:
* platform/PlatformPasteboard.h:
* platform/ios/AbstractPasteboard.h:
* platform/ios/AbstractPasteboard.mm: Copied from Source/WebCore/platform/ios/AbstractPasteboard.h.

Introduce WebPasteboardItemData, a wrapper around a list of objects representating the pasteboard data in order
of priority, and a dictionary containing additional NSData blobs that contain data useful for private clients.

(+[WebPasteboardItemData itemWithRepresentingObjects:additionalData:]):
(-[WebPasteboardItemData initWithRepresentingObjects:additionalData:]):
(-[WebPasteboardItemData representingObjects]):
(-[WebPasteboardItemData additionalData]):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::richTextRepresentationsForPasteboardWebContent):
(WebCore::PlatformPasteboard::writeObjectRepresentations):
(WebCore::PlatformPasteboard::write):

Tweaked to check whether the pasteboard responds to -setItemsFromObjectRepresentations:. If so, uses the
PlatformPasteboard::writeObjectRepresentations codepath to write data to the pasteboard, respecting type
priority.

* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard pasteboardTypes]):
(-[WebItemProviderPasteboard setItemProviders:]):
(-[WebItemProviderPasteboard setItemsFromObjectRepresentations:]):

Replaces -setItems: with -setItemsFromObjectRepresentations:, which respects the priority of each object
representation of the data in the pasteboard.

(-[WebItemProviderPasteboard setItems:]): Deleted.

Source/WebKit2:

Serialize PasteboardWebContent.dataInAttributedStringFormat when sending over IPC. Refer to WebCore ChangeLog
for more details.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<PasteboardWebContent>::encode):
(IPC::ArgumentCoder<PasteboardWebContent>::decode):
* UIProcess/API/Cocoa/WKWebView.mm:

Tools:

Augments existing unit tests to check for the existence and priority of type identifiers in the UIItemProviders
created upon starting data interaction. Also fixes a race condition in one of the unit tests and adds a new unit
test for data interaction from a textarea to an input.

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(checkTypeIdentifierPrecedesOtherTypeIdentifier):
(TestWebKitAPI::TEST):
* TestWebKitAPI/ios/DataInteractionSimulator.h:
* TestWebKitAPI/ios/DataInteractionSimulator.mm:
(-[DataInteractionSimulator _advanceProgress]):
(-[DataInteractionSimulator sourceItemProviders]):
(-[DataInteractionSimulator _webView:showCustomSheetForElement:]):

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

2 years agoWeb Inspector: RTL: results in Search navigation sidebar have misplaced highlights
bburg@apple.com [Tue, 4 Apr 2017 03:30:30 +0000 (03:30 +0000)]
Web Inspector: RTL: results in Search navigation sidebar have misplaced highlights
https://bugs.webkit.org/show_bug.cgi?id=170292

Reviewed by Timothy Hatcher.

* UserInterface/Models/SourceCodeSearchMatchObject.js:
(WebInspector.SourceCodeSearchMatchObject.prototype.get className):
* UserInterface/Views/SearchIcons.css:
(.source-code-match .icon):
(.source-code-match-icon .icon): Deleted.
Remove -icon suffix from the class name since the class is attached to a result
and is not specific to the icon displayed within the result <li>.

* UserInterface/Views/SearchResultTreeElement.js:
(WebInspector.SearchResultTreeElement.truncateAndHighlightTitle):
Flip the leading and trailing context in RTL so that the highlight is not overflowed
to the left when too much context is included on the right side. Less context must be
used in RTL because we must not overflow to the right, as it may hide the result. And,
we don't know the exact starting character either as it may be overflowed to the right
as the user resizes the expanded sidebar larger or smaller. So show less context to
be conservative about never overflowing the highlighted result string.

* UserInterface/Views/SearchSidebarPanel.css:
(.sidebar > .panel.navigation.search .item.source-code-match .title):
When in RTL, show source code matches as LTR with text-align to right.

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

2 years agoWeb Inspector: clicking on the body of a CSS rule after editing the selector causes...
webkit@devinrousso.com [Tue, 4 Apr 2017 03:28:03 +0000 (03:28 +0000)]
Web Inspector: clicking on the body of a CSS rule after editing the selector causes the section to disappear
https://bugs.webkit.org/show_bug.cgi?id=169803

Reviewed by Timothy Hatcher.

* UserInterface/Views/CSSStyleDeclarationSection.js:
(WebInspector.CSSStyleDeclarationSection.prototype._handleKeyDown):
(WebInspector.CSSStyleDeclarationSection.prototype._handleBlur):
Keep the section marked as `_editorActive` if the action taken would still place focus
within the section (selector or properties).  Doing so will prevent it from being removed.

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

2 years agoWeb Inspector: RTL: hierarchical path component labels should guess directionality...
bburg@apple.com [Tue, 4 Apr 2017 03:20:28 +0000 (03:20 +0000)]
Web Inspector: RTL: hierarchical path component labels should guess directionality based on content
https://bugs.webkit.org/show_bug.cgi?id=170298

Reviewed by Timothy Hatcher.

* UserInterface/Views/HierarchicalPathComponent.js:
(WebInspector.HierarchicalPathComponent):
Use dir="auto" since this will properly set 'unicode-bidi:isolate' for form elements too.
This is applied to the title label and to the <select> for the path component.

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

2 years agoWeb Inspector: Show additional pause reason details for DOM "subtree modified" breakpoint
mattbaker@apple.com [Tue, 4 Apr 2017 03:19:09 +0000 (03:19 +0000)]
Web Inspector: Show additional pause reason details for DOM "subtree modified" breakpoint
https://bugs.webkit.org/show_bug.cgi?id=169479

Reviewed by Timothy Hatcher.

* Localizations/en.lproj/localizedStrings.js:
New Pause Reason UI strings.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
Include a link for the target node when breaking for subtree modifications.
This is either the parent of a node being inserted, or a node that is
being removed.

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

2 years agoRe-adding flaky timeout expectation for http/tests/loading/resourceLoadStatistics...
ap@apple.com [Tue, 4 Apr 2017 01:22:41 +0000 (01:22 +0000)]
Re-adding flaky timeout expectation for http/tests/loading/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html

This test still times out, most of the time.

* platform/wk2/TestExpectations:

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

2 years ago[GTK][JHBuild] Update mesa repository url for tarballs
clopez@igalia.com [Tue, 4 Apr 2017 00:57:32 +0000 (00:57 +0000)]
[GTK][JHBuild] Update mesa repository url for tarballs
https://bugs.webkit.org/show_bug.cgi?id=170431

Reviewed by Michael Catanzaro.

* gtk/jhbuild.modules:

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

2 years agoTestWebKitAPI: Warning: Multiple build commands for Ahem.ttf
commit-queue@webkit.org [Tue, 4 Apr 2017 00:42:54 +0000 (00:42 +0000)]
TestWebKitAPI: Warning: Multiple build commands for Ahem.ttf
https://bugs.webkit.org/show_bug.cgi?id=170430

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

* TestWebKitAPI/Tests/mac/Ahem.ttf: Removed.
Eliminate one of the copies of Ahem.ttf.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
Once eliminated, there is now only one Ahem.ttf that is copied
to the Resources bundle. Drive-by sort the project file.

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

2 years agoFix incorrect capacity delta calculation reported in SparseArrayValueMap::add().
mark.lam@apple.com [Tue, 4 Apr 2017 00:42:02 +0000 (00:42 +0000)]
Fix incorrect capacity delta calculation reported in SparseArrayValueMap::add().
https://bugs.webkit.org/show_bug.cgi?id=170412
<rdar://problem/29697336>

Reviewed by Filip Pizlo.

JSTests:

* stress/regress-170412.js: Added.

Source/JavaScriptCore:

Here's an example of code that will trigger underflow in the "deprecatedExtraMemory"
reported by SparseArrayValueMap::add() that is added to Heap::m_deprecatedExtraMemorySize:

    arr = new Array;
    Object.defineProperty(arr, 18, ({writable: true, configurable: true}));
    for (var i = 0; i < 3; ++i) {
        Array.prototype.push.apply(arr, ["", () => {}, {}]);
        Array.prototype.sort.apply(arr, [() => {}, []]);
    }

However, Heap::m_deprecatedExtraMemorySize is only 1 of 3 values that are added
up to form the result of Heap::extraMemorySize().  Heap::m_extraMemorySize and
Heap::m_arrayBuffers.size() are the other 2.

While Heap::m_arrayBuffers.size() is bounded by actual allocated memory, both
Heap::m_deprecatedExtraMemorySize and Heap::m_extraMemorySize are added to
without any bounds checks, and they are only reset to 0 at the start of a full
GC.  As a result, if we have a long sequence of eden GCs with a lot of additions
to Heap::m_extraMemorySize and/or Heap::m_deprecatedExtraMemorySize, then these
values could theoretically overflow.  Coupling this with the underflow from
SparseArrayValueMap::add(), the result for Heap::extraMemorySize() can easily
overflow.  Note: Heap::extraMemorySize() is used to compute the value
currentHeapSize.

If multiple conditions line up just right, the above overflows can result in this
debug assertion failure during an eden GC:

    ASSERT(currentHeapSize >= m_sizeAfterLastCollect);

Otherwise, the effects of the overflows will only result in the computed
currentHeapSize not being representative of actual memory usage, and therefore,
a full GC may be triggered earlier or later than is ideal.

This patch ensures that SparseArrayValueMap::add() cannot underflow
Heap::m_deprecatedExtraMemorySize.  It also adds overflows checks in the
calculations of Heap::m_deprecatedExtraMemorySize, Heap::m_extraMemorySize, and
Heap::extraMemorySize() so that their values are saturated appropriately to
ensure that GC collections are triggered based on representative memory usage.

* heap/Heap.cpp:
(JSC::Heap::deprecatedReportExtraMemorySlowCase):
(JSC::Heap::extraMemorySize):
(JSC::Heap::updateAllocationLimits):
(JSC::Heap::reportExtraMemoryVisited):
* runtime/SparseArrayValueMap.cpp:
(JSC::SparseArrayValueMap::add):

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

2 years agoWeb Inspector: showing the Find banner doesn't immediately focus it
webkit@devinrousso.com [Tue, 4 Apr 2017 00:41:19 +0000 (00:41 +0000)]
Web Inspector: showing the Find banner doesn't immediately focus it
https://bugs.webkit.org/show_bug.cgi?id=169804

Reviewed by Matt Baker.

* UserInterface/Base/Main.js:
(WebInspector._focusChanged):
Slightly change the logic from <https://webkit.org/b/168119> (r213689) to not prevent a new
selection if the focus change target is an element from WebInspector.startEditing.

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

2 years agoAllow MiniBrowser windows to receive local file drags again
simon.fraser@apple.com [Tue, 4 Apr 2017 00:10:33 +0000 (00:10 +0000)]
Allow MiniBrowser windows to receive local file drags again
https://bugs.webkit.org/show_bug.cgi?id=170422

Reviewed by Wenson Hsieh.

Adopt the new UIDelegate SPI to allow drops.

* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController _webView:dragDestinationActionMaskForDraggingInfo:]):

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