WebKit-https.git
3 years agoWebAssembly: implement Module imports/exports
jfbastien@apple.com [Tue, 28 Mar 2017 18:41:53 +0000 (18:41 +0000)]
WebAssembly: implement Module imports/exports
https://bugs.webkit.org/show_bug.cgi?id=166982

Reviewed by Saam Barati.

JSTests:

* wasm/js-api/Module.exports.js: Added.
(assert.throws.WebAssembly.Module.prototype.exports):
(assert.eq):
* wasm/js-api/Module.imports.js: Added.
(assert.throws.WebAssembly.Module.prototype.imports):
(assert.eq):

Source/JavaScriptCore:

As defined in: https://github.com/WebAssembly/design/commit/18cbacb90cd3584dd5c9aa3d392e4e55f66af6ab

* wasm/WasmFormat.h:
(JSC::Wasm::makeString): use uppercase instead, it was only used
for diagnostic but is now used for the expected JS property's
capitalization
* wasm/js/WebAssemblyModulePrototype.cpp:
(JSC::webAssemblyModuleProtoImports):
(JSC::webAssemblyModuleProtoExports):

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

3 years agoEnhance the touch region debug overlay to show regions for the different events
simon.fraser@apple.com [Tue, 28 Mar 2017 18:29:40 +0000 (18:29 +0000)]
Enhance the touch region debug overlay to show regions for the different events
https://bugs.webkit.org/show_bug.cgi?id=170162

Reviewed by Tim Horton.

Have NonFastScrollableRegionOverlay use a different color for each region in EventTrackingRegions,
and to draw a legend showing what the colors mean.

On Mac, this overlay displays the non-fast scrollable region (which we don't keep separate from the wheel event
region).

* page/DebugPageOverlays.cpp:
(WebCore::NonFastScrollableRegionOverlay::updateRegion):
(WebCore::touchEventRegionColors):
(WebCore::drawRightAlignedText):
(WebCore::NonFastScrollableRegionOverlay::drawRect):
(WebCore::RegionOverlay::drawRect):
(WebCore::RegionOverlay::drawRegion):

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

3 years agoMake sure the non-fast scrolling debug overlay is correctly updated
simon.fraser@apple.com [Tue, 28 Mar 2017 18:29:37 +0000 (18:29 +0000)]
Make sure the non-fast scrolling debug overlay is correctly updated
https://bugs.webkit.org/show_bug.cgi?id=170142

Reviewed by Tim Horton.

AsyncScrollingCoordinator::frameViewEventTrackingRegionsChanged() is called on a timer
from Document code, so the existing DebugPageOverlays::didLayout() call at the end
of FrameView::layout() wasn't sufficient to keep the non-fast scrollable region up-to-date
on iOS.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewEventTrackingRegionsChanged):

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

3 years ago[Modern Media Controls] AirPlay placard text looks bad on 1x displays
commit-queue@webkit.org [Tue, 28 Mar 2017 18:27:02 +0000 (18:27 +0000)]
[Modern Media Controls] AirPlay placard text looks bad on 1x displays
https://bugs.webkit.org/show_bug.cgi?id=170183
<rdar://problem/30663416>

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

Use subpixel antialiasing for all text in modern media controls.

* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls-container,):

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

3 years agoREGRESSION (r214386): [ios-simulator] LayoutTest media/modern-media-controls/media...
commit-queue@webkit.org [Tue, 28 Mar 2017 17:36:50 +0000 (17:36 +0000)]
REGRESSION (r214386): [ios-simulator] LayoutTest media/modern-media-controls/media-controller/media-controller-scale-factor-audio.html is failing
https://bugs.webkit.org/show_bug.cgi?id=170180

Unreviewed. Restore a value that was mistakenly changed in the fix for webkit.org/b/169962.

Patch by Antoine Quint <graouts@apple.com> on 2017-03-28

* media/modern-media-controls/media-controller/media-controller-scale-factor-audio-expected.txt:
* media/modern-media-controls/media-controller/media-controller-scale-factor-audio.html:

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

3 years agoMark fast/history/ios/history-scroll-restoration.html as flaky.
ryanhaddad@apple.com [Tue, 28 Mar 2017 16:42:05 +0000 (16:42 +0000)]
Mark fast/history/ios/history-scroll-restoration.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=169558

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

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

3 years agoMark media/modern-media-controls/media-controller/media-controller-scale-factor-audio...
ryanhaddad@apple.com [Tue, 28 Mar 2017 16:29:15 +0000 (16:29 +0000)]
Mark media/modern-media-controls/media-controller/media-controller-scale-factor-audio.html as failing on ios-simulator.
https://bugs.webkit.org/show_bug.cgi?id=170180

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

3 years agoLayoutTest webrtc/video-getParameters.html is failing
commit-queue@webkit.org [Tue, 28 Mar 2017 16:12:42 +0000 (16:12 +0000)]
LayoutTest webrtc/video-getParameters.html is failing
https://bugs.webkit.org/show_bug.cgi?id=170148

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-28

* TestExpectations: Marking webrtc/video-getParameters.html as failing.

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

3 years agoMark webrtc/video-replace-track-to-null.html as flaky.
ryanhaddad@apple.com [Tue, 28 Mar 2017 16:09:11 +0000 (16:09 +0000)]
Mark webrtc/video-replace-track-to-null.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=170178

Unreviewed test gardening.

* TestExpectations:

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

3 years ago[Modern Media Controls] Improve appearance of tracks panel on macOS
commit-queue@webkit.org [Tue, 28 Mar 2017 15:55:20 +0000 (15:55 +0000)]
[Modern Media Controls] Improve appearance of tracks panel on macOS
https://bugs.webkit.org/show_bug.cgi?id=168929
<rdar://problem/30741589>

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

We use a solid color for the focus state that matches the style used on macOS
and blend the titles the same way we blend other non-solid labels in the controls bar.

* Modules/modern-media-controls/controls/tracks-panel.css:
(.tracks-panel section):
(.tracks-panel section > h3):
(.tracks-panel section > ul > li:focus):

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

3 years agoMoved gardened ios-simulator tests to ios folders
jbedard@apple.com [Tue, 28 Mar 2017 15:30:06 +0000 (15:30 +0000)]
Moved gardened ios-simulator tests to ios folders
<rdar://problem/30948691>

Unreviewed test re-organization.

Moving ios-simulator test expectations to share as many expectations
as possible with on-device testing.

* platform/ios: Moved from platform/ios-simulator.
* platform/ios-device: Added.
* platform/ios-device-wk1: Added.
* platform/ios-device-wk2: Added.
* platform/ios-simulator: Moved to platform/ios.
* platform/ios-simulator-wk1: Moved to platform/ios-wk1.
* platform/ios-simulator-wk2: Moved to platform/ios-wk2.
* platform/ios-wk1: Moved from platform/ios-simulator-wk1.
* platform/ios-wk2: Moved from platform/ios-simulator-wk2.

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

3 years agowebkitpy: Use host pattern for devices
jbedard@apple.com [Tue, 28 Mar 2017 14:06:49 +0000 (14:06 +0000)]
webkitpy: Use host pattern for devices
https://bugs.webkit.org/show_bug.cgi?id=170121

Reviewed by Daniel Bates.

Devices should be treated like hosts throughout webkitpy
so that more code can be re-used.  Add the needed properties
and use executive over custom implemented polling/killing
functions.

* Scripts/webkitpy/port/device.py:
(Device):
(Device.executive): Add optional executive property.
(Device.filesystem): Add optional filesystem property.
(Device.user): Add optional user property.
(Device.platform): Add optional platform property.
(Device.workspace): Add optional workspace property.
(Device.poll): Deleted.
* Scripts/webkitpy/port/simulator_process.py:
(SimulatorProcess.Popen.poll): Use the devices executive.
(SimulatorProcess.stop): Ditto.
(SimulatorProcess._kill): Ditto.
* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDevice.__init__): Add executive, filesystem, user, platform
and workspace to the platform device.
(SimulatedDevice.poll): Deleted.

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

3 years agoAdd a warning for unused link preloads.
yoav@yoav.ws [Tue, 28 Mar 2017 11:56:52 +0000 (11:56 +0000)]
Add a warning for unused link preloads.
https://bugs.webkit.org/show_bug.cgi?id=165670

Reviewed by Youenn Fablet.

Source/WebCore:

Tests: http/tests/preload/single_download_preload_headers_charset.php
       http/tests/preload/unused_preload_warning.html

* dom/Document.cpp:
(WebCore::Document::prepareForDestruction): Stop the timer once the document is destructed.
* loader/LinkPreloadResourceClients.h: Add shouldMarkAsReferenced overides for the LinkPreloadResourceClient classes.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::addClientToSet): Make sure LinkPreloadResourceClients don't set resource to be referenced.
* loader/cache/CachedResourceClient.h:
(WebCore::CachedResourceClient::shouldMarkAsReferenced): Make sure that ResourceClients mark preloads as referenced by default.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::CachedResourceLoader): Initialize timer.
(WebCore::CachedResourceLoader::~CachedResourceLoader): Stop timer.
(WebCore::CachedResourceLoader::documentDidFinishLoadEvent): Trigger a timer if preloads weren't cleared at load time.
(WebCore::CachedResourceLoader::stopUnusedPreloadsTimer): Stop the timer.
(WebCore::CachedResourceLoader::warnUnusedPreloads): Iterate over m_preloads and issue a warning for non-referenced preloads.
* loader/cache/CachedResourceLoader.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::willDetachDocumentFromFrame): Clear Resource Timing buffer when document detaches, to avoid test flakiness.

LayoutTests:

* TestExpectations: Added a "Failure Pass" for the flaky charset header test.
* http/tests/preload/download_resources-expected.txt:
* http/tests/preload/download_resources.html: Added references to preloaded resources.
* http/tests/preload/onerror_event-expected.txt:
* http/tests/preload/onerror_event.html: Added references to preloaded resources.
* http/tests/preload/onload_event-expected.txt:
* http/tests/preload/onload_event.html: Added references to preloaded resources.
* http/tests/preload/single_download_preload.html: Deflaked.
* http/tests/preload/single_download_preload_headers.php: Removed the charset to avoid double download bug.
* http/tests/preload/single_download_preload_headers_charset-expected.txt: Added.
* http/tests/preload/single_download_preload_headers_charset.php: Flaky test showing the double download bug when charset is declared.
* http/tests/preload/unused_preload_warning-expected.txt: Added.
* http/tests/preload/unused_preload_warning.html: Added.

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

3 years agoREGRESSION: Double-clicking the captions button while the captions popover is open...
commit-queue@webkit.org [Tue, 28 Mar 2017 10:42:39 +0000 (10:42 +0000)]
REGRESSION: Double-clicking the captions button while the captions popover is open prevents the popover from being opened again
https://bugs.webkit.org/show_bug.cgi?id=170171
<rdar://problem/31095500>

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

Source/WebCore:

We used to consider that the tracks panel was presented as long as it had a parent, but since we were using for the animated
transition to complete before actually removing the panel from the node hierarchy, consecutive calls to hide then present
would fail to present the panel. We now use a private instance variable to track the presented state which is set immediately
as presentInParent() and hide() are called.

Test: media/modern-media-controls/tracks-support/tracks-support-show-panel-then-double-click-on-tracks-button.html

* Modules/modern-media-controls/controls/tracks-panel.js:
(TracksPanel.prototype.get presented):
(TracksPanel.prototype.presentInParent):
(TracksPanel.prototype.hide):

LayoutTests:

Adding a new test that runs the steps to reproduce the issue, and rebaselining an existing one now that
the "presented" property returns false immediately after calling hide() on the panel.

* media/modern-media-controls/tracks-panel/tracks-panel-hide-expected.txt:
* media/modern-media-controls/tracks-panel/tracks-panel-hide.html:
* media/modern-media-controls/tracks-support/tracks-support-show-panel-then-double-click-on-tracks-button-expected.txt: Added.
* media/modern-media-controls/tracks-support/tracks-support-show-panel-then-double-click-on-tracks-button.html: Added.

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

3 years agoDashboard test fails with error: latestIterationGetter is not a function
aakash_jain@apple.com [Tue, 28 Mar 2017 09:33:21 +0000 (09:33 +0000)]
Dashboard test fails with error: latestIterationGetter is not a function
https://bugs.webkit.org/show_bug.cgi?id=170167

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/tests.js:
(this.view._latestProductiveIteration): Configure _latestProductiveIteration in setup.

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

3 years agoAX: Media controls should be able to be re-activated after faded away
commit-queue@webkit.org [Tue, 28 Mar 2017 07:49:56 +0000 (07:49 +0000)]
AX: Media controls should be able to be re-activated after faded away
https://bugs.webkit.org/show_bug.cgi?id=170048
<rdar://problem/30157179>

Patch by Aaron Chu <aaron_chu@apple.com> on 2017-03-28
Reviewed by Antoine Quint.

Source/WebCore:

Added a "foucsin" listener for the controls bar so that when an element
within fires a "focusin" event, the controls bar reappears if it is faded.

Test: media/modern-media-controls/media-controls/media-controls-appear-when-focus.html

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

LayoutTests:

* media/modern-media-controls/media-controls/media-controls-appear-when-focus-expected.txt: Added.
* media/modern-media-controls/media-controls/media-controls-appear-when-focus.html: Added.

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

3 years ago[Modern Media Controls] Improve media documents across macOS, iPhone and iPad
graouts@webkit.org [Tue, 28 Mar 2017 07:34:18 +0000 (07:34 +0000)]
[Modern Media Controls] Improve media documents across macOS, iPhone and iPad
https://bugs.webkit.org/show_bug.cgi?id=169145
<rdar://problem/17048858>

Reviewed by Dean Jackson.

Source/WebCore:

There were a variety of issues with media documents, some longstanding, and some specifically
about modern media controls.

One issue was that fullscreen and picture-in-picture buttons would show for audio media documents,
due to using a <video> element to load the audio file. We now have additional logic in MediaController
to identify if the loaded media is really an audio file, and using this information to hide the
fullscreen and picture-in-picture buttons.

Another issue was that we would inject style in MediaDocument.cpp that was specific to modern media
controls when we could have the modern-media-controls module injected CSS handle this styling. We now
use the injected style in the shadow root to size media documents based on the device characteristics
and ensuring that page styles are overridden.

We also simplify how MediaDocument.cpp sets the source of the media element to simply use the "src"
attribute and not a <source> element.

Finally, we introduce a MediaDocumentController class that is instantiated when we're dealing with
a media document to hide the controls while we determine the type of media we're loading (audio vs.
video) in order to apply the appropriate styling without flashes.

As a result of the new styles applied by the modern-media-controls module, media documents have a
similar behavior on macOS and iPad, where we only enforce a min-width for video allowing them
to play at their natural size otherwise, and enforcing a fixed width for audio. On iPhone however,
we want to always play the media at full width, with some padding in the case of audio.

Tests: media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only.html
       media/modern-media-controls/media-documents/ipad/media-document-audio-ios-sizing.html
       media/modern-media-controls/media-documents/ipad/media-document-video-ios-sizing.html
       media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html
       media/modern-media-controls/media-documents/media-document-audio-mac-sizing.html
       media/modern-media-controls/media-documents/media-document-video-ios-sizing.html
       media/modern-media-controls/media-documents/media-document-video-mac-sizing.html
       media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only.html

* Modules/modern-media-controls/controls/ios-inline-media-controls.css:
(:host(audio) .media-controls.ios.inline > .controls-bar:before,):
(:host(audio) .media-controls.ios.inline > .controls-bar:before): Deleted.
* Modules/modern-media-controls/controls/macos-media-controls.css:
(:host(audio) .media-controls.mac.inline > .controls-bar,):
(:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint,):
(:host(audio) .media-controls.mac.inline > .controls-bar): Deleted.
(:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint): Deleted.
* Modules/modern-media-controls/controls/media-document.css: Copied from Source/WebCore/Modules/modern-media-controls/controls/macos-media-controls.css.
(:host(.media-document)):
(:host(.media-document.ready)):
(:host(.media-document.audio.mac)):
(:host(.media-document.audio.ipad)):
(:host(.media-document.audio.iphone)):
(:host(.media-document.video.mac)):
(:host(.media-document.video.ipad)):
(:host(.media-document.video.iphone)):
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/fullscreen-support.js:
(FullscreenSupport.prototype.syncControl):
(FullscreenSupport):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.get isAudio):
* Modules/modern-media-controls/media/media-document-controller.js: Copied from Source/WebCore/Modules/modern-media-controls/media/fullscreen-support.js.
(MediaDocumentController):
(MediaDocumentController.prototype.handleEvent):
(MediaDocumentController.prototype._mediaDocumentHasMetadata):
(MediaDocumentController.prototype._mediaDocumentHasSize):
* Modules/modern-media-controls/media/pip-support.js:
(PiPSupport.prototype.syncControl):
(PiPSupport):
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):

LayoutTests:

We add new tests for media documents and related features that cover the following cases:

    - checking <video> with only audio tracks does not show the fullscreen button
    - checking <video> with only audio tracks does not show the picture-in-picture button
    - checking the size used in media documents for audio and video across macOS, iPhone and iPad

* media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only-expected.txt: Added.
* media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only.html: Added.
* media/modern-media-controls/media-documents/ipad/media-document-audio-ios-sizing-expected.txt: Added.
* media/modern-media-controls/media-documents/ipad/media-document-audio-ios-sizing.html: Added.
* media/modern-media-controls/media-documents/ipad/media-document-video-ios-sizing-expected.txt: Added.
* media/modern-media-controls/media-documents/ipad/media-document-video-ios-sizing.html: Added.
* media/modern-media-controls/media-documents/media-document-audio-ios-sizing-expected.txt: Added.
* media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html: Added.
* media/modern-media-controls/media-documents/media-document-audio-mac-sizing-expected.txt: Added.
* media/modern-media-controls/media-documents/media-document-audio-mac-sizing.html: Added.
* media/modern-media-controls/media-documents/media-document-video-ios-sizing-expected.txt: Added.
* media/modern-media-controls/media-documents/media-document-video-ios-sizing.html: Added.
* media/modern-media-controls/media-documents/media-document-video-mac-sizing-expected.txt: Added.
* media/modern-media-controls/media-documents/media-document-video-mac-sizing.html: Added.
* media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only-expected.txt: Added.
* media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only.html: Added.
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:

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

3 years agoFollow-up patch after r214364.
mmaxfield@apple.com [Tue, 28 Mar 2017 07:31:28 +0000 (07:31 +0000)]
Follow-up patch after r214364.
https://bugs.webkit.org/show_bug.cgi?id=168895

Unreviewed.

* platform/graphics/FontDescription.cpp:
(WebCore::FontDescription::FontDescription):

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

3 years agoFixes for libwebrtc logging after r214288
commit-queue@webkit.org [Tue, 28 Mar 2017 06:35:18 +0000 (06:35 +0000)]
Fixes for libwebrtc logging after r214288
https://bugs.webkit.org/show_bug.cgi?id=170116

Patch by Alejandro G. Castro <alex@igalia.com> on 2017-03-27
Reviewed by Youenn Fablet.

* Source/webrtc/base/logging.cc: Added the critical section
requirement and the call to the new getter for g_log_crit.

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

3 years agoWebAssembly: JSWebAssemblyCodeBlock.h belongs in JavaScriptCore/wasm/js not JavaScrip...
jfbastien@apple.com [Tue, 28 Mar 2017 06:20:55 +0000 (06:20 +0000)]
WebAssembly: JSWebAssemblyCodeBlock.h belongs in JavaScriptCore/wasm/js not JavaScriptCore/wasm
https://bugs.webkit.org/show_bug.cgi?id=170160

Reviewed by Mark Lam.

* JavaScriptCore.xcodeproj/project.pbxproj:
* wasm/js/JSWebAssemblyCodeBlock.h: Renamed from Source/JavaScriptCore/wasm/JSWebAssemblyCodeBlock.h.

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

3 years agoWeb Inspector: Option-clicking the close tab button should close all other tabs
webkit@devinrousso.com [Tue, 28 Mar 2017 06:17:58 +0000 (06:17 +0000)]
Web Inspector: Option-clicking the close tab button should close all other tabs
https://bugs.webkit.org/show_bug.cgi?id=169046

Reviewed by Matt Baker.

* UserInterface/Views/TabBar.js:
(WebInspector.TabBar.prototype._handleClick):

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

3 years agoAnother test v8.
lforschler@apple.com [Tue, 28 Mar 2017 05:43:48 +0000 (05:43 +0000)]
Another test v8.

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

3 years agoAnother test v7.
lforschler@apple.com [Tue, 28 Mar 2017 05:30:06 +0000 (05:30 +0000)]
Another test v7.

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

3 years agoAnother test v6.
lforschler@apple.com [Tue, 28 Mar 2017 05:19:19 +0000 (05:19 +0000)]
Another test v6.

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

3 years agoRemove WebPage::m_shouldDoICECandidateFiltering
commit-queue@webkit.org [Tue, 28 Mar 2017 04:39:39 +0000 (04:39 +0000)]
Remove WebPage::m_shouldDoICECandidateFiltering
https://bugs.webkit.org/show_bug.cgi?id=170150

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-27
Reviewed by Sam Weinig.

It is redundant with RTCController::m_shouldFilterICECandidates.
Manually tested on webrtc test samples.
This code path is currently untested by rwt as we hook it to getUserMedia which is mocked in rwt.
Additional testing will be added as a follow-up patch.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::disableICECandidateFiltering):
(WebKit::WebPage::enableICECandidateFiltering):
* WebProcess/WebPage/WebPage.h:

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

3 years agomake build fix for WebDefaultUIDelegate.m
jfbastien@apple.com [Tue, 28 Mar 2017 04:08:13 +0000 (04:08 +0000)]
make build fix for WebDefaultUIDelegate.m
https://bugs.webkit.org/show_bug.cgi?id=170163

Unreviewed build fix.

* PlatformMac.cmake: WebDefaultUIDelegate.m was renamed

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

3 years agoAnother test v5.
lforschler@apple.com [Tue, 28 Mar 2017 03:55:48 +0000 (03:55 +0000)]
Another test v5.

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

3 years agoAnother test v4.
lforschler@apple.com [Tue, 28 Mar 2017 03:50:21 +0000 (03:50 +0000)]
Another test v4.

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

3 years agoAnother test v3.
lforschler@apple.com [Tue, 28 Mar 2017 03:41:13 +0000 (03:41 +0000)]
Another test v3.

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

3 years ago[WK2] UIKit assertion when rotating device after dismissing popover
wenson_hsieh@apple.com [Tue, 28 Mar 2017 03:06:09 +0000 (03:06 +0000)]
[WK2] UIKit assertion when rotating device after dismissing popover
https://bugs.webkit.org/show_bug.cgi?id=170159
<rdar://problem/31283829>

Reviewed by Tim Horton.

Ensure that when we are finished presenting a WKActionSheet, we unregister with the shared notifications center.

* UIProcess/ios/WKActionSheet.mm:
(-[WKActionSheet dealloc]):
(-[WKActionSheet _cleanup]):
(-[WKActionSheet doneWithSheet:]):

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

3 years agoAnother test v2.
lforschler@apple.com [Tue, 28 Mar 2017 03:05:07 +0000 (03:05 +0000)]
Another test v2.

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

3 years agoAnother test.
lforschler@apple.com [Tue, 28 Mar 2017 03:03:43 +0000 (03:03 +0000)]
Another test.

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

3 years ago<rdar://problem/30949128>
lforschler@apple.com [Tue, 28 Mar 2017 02:53:46 +0000 (02:53 +0000)]
<rdar://problem/30949128>
Update build.webkit.org to use port 16000 for PBChangeSource.

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/master.cfg:

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

3 years agoTest commit to verify post-commit hook.
lforschler@apple.com [Tue, 28 Mar 2017 02:43:37 +0000 (02:43 +0000)]
Test commit to verify post-commit hook.

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

3 years agoREGRESSION(213764): Large images should not be decoded asynchronously when they are...
commit-queue@webkit.org [Tue, 28 Mar 2017 02:23:10 +0000 (02:23 +0000)]
REGRESSION(213764): Large images should not be decoded asynchronously when they are drawn on a canvas
https://bugs.webkit.org/show_bug.cgi?id=169771

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

Source/WebCore:

Sometimes we have to draw the image immediately like when a canvas calls
drawImage. In this case we have to decode the image synchronously to guarantee
the drawing. Other times we need to decode with the native size of the image.
The animated images have to be decoded with native size always. Otherwise
the frame cache will be messed up if the same image is animated with different
sizes. Currently we always decode asynchronously with sizeForDrawing. We need
to decouple the decoding mode from the sizeForDrawing.

This patch introduce the DecodingOptions class which can store and compare the
following four cases:
    -- Synchronous: The frame has be decoded with native size only.
    -- Asynchronous + anySize: This is passed from the Image::draw() callers.
    -- Asynchronous + fullSize: The image has to be decoded with its full size.
    -- Asynchronous + sizeForDrawing: The image can be decoded with sizeForDrawing unless
    it was decoded with either a full size or sizeForDrawing which is larger than the
    requested sizeForDrawing.

A new argument of type DecodingMode will be added to Image::draw() function.
Only when the drawing comes from the render tree, it will be Asynchronous.
Otherwise it will be Synchronous.

Tests: fast/images/animated-image-different-dest-size.html
       fast/images/async-image-background-image.html
       fast/images/async-image-canvas-draw-image.html

* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::frameImageAtIndexCacheIfNeeded): Gets the frame image, cache it synchronously if
the current one is invalid. frameImageAtIndex() returns whatever stored in the cache.
(WebCore::BitmapImage::nativeImage): Call frameImageAtIndexCacheIfNeeded() instead of frameImageAtIndex().
(WebCore::BitmapImage::nativeImageForCurrentFrame): Ditto.
(WebCore::BitmapImage::nativeImageOfSize): Ditto.
(WebCore::BitmapImage::framesNativeImages): Ditto.
(WebCore::BitmapImage::draw): Change the logic to do the following:
-- The animated image has to be decoded with its full size.
-- The animated image expects the current frame to be ready for drawing.
-- The large image decoding does not need to call internalStartAnimation().
-- The large image has to request async image decoding but draw the current one if it exists.
(WebCore::BitmapImage::drawPattern): Draw the pattern synchronously.
(WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImages): Delete the call to shouldUseAsyncDecodingForTesting()
since it is only applied for animated images.
(WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImages): Call shouldUseAsyncDecodingForAnimatedImageForTesting().
(WebCore::BitmapImage::internalStartAnimation): Request decoding with the full size.
(WebCore::BitmapImage::advanceAnimation): Call shouldUseAsyncDecodingForAnimatedImageForTesting().
(WebCore::BitmapImage::internalAdvanceAnimation): Assert the current frame is not being decoding asynchronously for any size.
(WebCore::BitmapImage::frameImageAtIndex): Deleted. Moved to the header file but with a new purpose: return
the current frame from the frame cache as is; do not cache a new one.
(WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImage): Deleted. Function was renamed to shouldUseAsyncDecodingForLargeImages.
(WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImage): Deleted. Function was renamed to shouldUseAsyncDecodingForAnimatedImages.
* platform/graphics/BitmapImage.h:
* platform/graphics/CrossfadeGeneratedImage.cpp:
(WebCore::CrossfadeGeneratedImage::draw): Add a new argument of type DecodingMode.
* platform/graphics/CrossfadeGeneratedImage.h:
* platform/graphics/DecodingOptions.h: Added.
(WebCore::DecodingOptions::DecodingOptions): Default constructor: Synchronous mode.
(WebCore::DecodingOptions::operator==): Compares two DecodingOptions for equality.
(WebCore::DecodingOptions::isSynchronous): Is the frame decoded synchronously?
(WebCore::DecodingOptions::isAsynchronous): Is the frame decoded asynchronously?
(WebCore::DecodingOptions::isAsynchronousCompatibleWith): Is this DecodingOptions compatible with another one?
(WebCore::DecodingOptions::hasFullSize): Is the decoding mode asynchronous but for the image full size?
(WebCore::DecodingOptions::hasSizeForDrawing): Is this decoding mode asynchronous but for a sizeForDrawing?
(WebCore::DecodingOptions::sizeForDrawing): Returns the sizeForDrawing. m_decodingModeOrSize has to hold an IntSize.
(WebCore::DecodingOptions::maxDimension): Moved form ImageFrame.cpp.
(WebCore::DecodingOptions::has): A helper function.
(WebCore::DecodingOptions::hasDecodingMode): Does m_decodingModeOrSize a DecodingMode?
(WebCore::DecodingOptions::hasSize): Does m_decodingModeOrSize an IntSize?
* platform/graphics/GeneratedImage.h: Add a new argument of type DecodingMode.
* platform/graphics/GradientImage.cpp:
(WebCore::GradientImage::draw): Ditto.
* platform/graphics/GradientImage.h: Ditto.
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawImage): Pass the ImagePaintingOptions::m_DecodingMode to Image::draw().
* platform/graphics/GraphicsContext.h:
(WebCore::ImagePaintingOptions::ImagePaintingOptions): Add a new member of type DecodingMode to ImagePaintingOptions.
* platform/graphics/Image.cpp:
(WebCore::Image::drawTiled): Pass DecodingMode::Synchronous to Image::draw().
* platform/graphics/Image.h: Add a new argument of type DecodingMode to Image::draw().
* platform/graphics/ImageFrame.cpp:
(WebCore::ImageFrame::operator=): Replace m_sizeForDrawing by m_decodingOptions.
(WebCore::ImageFrame::hasNativeImage): Check if m_nativeImage is valid and the subsamplingLevels match.
(WebCore::ImageFrame::hasFullSizeNativeImage): Checks hasNativeImage() and whether the image frame was
decoded for the image full size.
(WebCore::ImageFrame::hasDecodedNativeImageCompatibleWithOptions): Checks hasNativeImage() and the DecodingOptions match.
(WebCore::maxDimension): Deleted. Moved to DecodingOptions.h.
(WebCore::ImageFrame::isBeingDecoded): Deleted. The check for having an ImageFrame being decoded is
moved to ImageFrameCache.
(WebCore::ImageFrame::hasValidNativeImage): Deleted. No need to this function.
* platform/graphics/ImageFrame.h:
(WebCore::ImageFrame::hasNativeImage): Add an std::optional<SubsamplingLevel> argument.
(WebCore::ImageFrame::hasFullSizeNativeImage): Checks whether the ImageFrame was decoded for the image full size.
(WebCore::ImageFrame::enqueueSizeForDecoding): Deleted.
(WebCore::ImageFrame::dequeueSizeForDecoding): Deleted.
(WebCore::ImageFrame::clearSizeForDecoding): Deleted.
(WebCore::ImageFrame::isBeingDecoded): Deleted.
(WebCore::ImageFrame::sizeForDrawing): Deleted.
(WebCore::ImageFrame::hasDecodedNativeImage): Deleted.
The logic of knowing whether an ImageFrame is being decoded is moved to ImageFrameCache.
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::cacheFrameMetadataAtIndex): Caches the metadata of an ImageFrame. If the NativeImage
was decoded for a sizeForDrawing, the size of the ImageFrame will be the nativeImageSize(). Otherwise, the
frameSizeAtIndex() will be called.
(WebCore::ImageFrameCache::cacheFrameNativeImageAtIndex): Cache a new NativeImage which involves caching new
metadata and updating the memory cache. No need to check if the existing native image is valid or not for the
DecodingOptions. Actually it would be a bug if it happens. This is why cacheNativeImageForFrameRequest() asserts
!frame.hasAsyncNativeImage() before calling cacheFrameNativeImageAtIndex().
(WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): Cache new NativeImage which was decoded asynchronously.
(WebCore::ImageFrameCache::startAsyncDecodingQueue): Call cacheAsyncFrameNativeImageAtIndex() instead of
cacheNativeImageForFrameRequest() for clarity.
(WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Call hasAsyncNativeImage() instead of hasValidNativeImage()
Call frameIsDecodingCompatibleWithOptionsAtIndex() instead of frame.isBeingDecoded(). Replace the call to enqueueSizeForDecoding()
by appending the same ImageFrameRequest to m_frameCommitQueue.
(WebCore::ImageFrameCache::isAsyncDecodingQueueIdle): Use m_frameCommitQueue to answer the question whether the decodingQueue is idle.
(WebCore::ImageFrameCache::stopAsyncDecodingQueue): Use m_frameCommitQueue to loop through all the ImageFrames which are currently being decoded.
(WebCore::ImageFrameCache::frameAtIndexCacheIfNeeded): For getting the metadata, this function needs a valid frame. If it is requested
to decode the nativeImage, it has to do it synchronously.
(WebCore::ImageFrameCache::singlePixelSolidColor): Don't cache the frame if it is an animated image or the size is not a single pixel.
(WebCore::ImageFrameCache::frameIsBeingDecodedAndIsCompatibleWithOptionsAtIndex): Use m_frameCommitQueue to answer the question whether an ImageFrame
is being decoded and is compatible with DecodingOptions.
(WebCore::ImageFrameCache::frameHasFullSizeNativeImageAtIndex): Calls ImageFrame::hasFullNativeImage() for a frame.
(WebCore::ImageFrameCache::frameHasDecodedNativeImageCompatibleWithOptionsAtIndex): Calls ImageFrame::hasDecodedNativeImageCompatibleWithOptions() for a frame.
(WebCore::ImageFrameCache::frameImageAtIndex): Returns the current NativeImage without caching.
(WebCore::ImageFrameCache::frameImageAtIndexCacheIfNeeded): Returns the current NativeImage but cache it synchronously if needed.
(WebCore::ImageFrameCache::setFrameNativeImageAtIndex): Deleted.
(WebCore::ImageFrameCache::setFrameMetadataAtIndex): Deleted.
(WebCore::ImageFrameCache::replaceFrameNativeImageAtIndex): Deleted.
(WebCore::ImageFrameCache::frameIsBeingDecodedAtIndex): Deleted.
(WebCore::ImageFrameCache::frameHasImageAtIndex): Deleted.
(WebCore::ImageFrameCache::frameHasValidNativeImageAtIndex): Deleted.
(WebCore::ImageFrameCache::frameHasDecodedNativeImage): Deleted.
* platform/graphics/ImageFrameCache.h: Two ImageFrameRequest queues will be used.
-- The existing one m_frameRequestQueue which is shared between the main thread and decoding thread. The requests will be
dequeued from it before starting the decoding. The decoded NativeImage will be cached only on the main thread. The decoding
thread is not blocked by the callOnMainThread(). This means there might be multiple ImageFrameRequests which were dequeued
while their NativeImages have not been cached yet.
-- A new one m_frameCommitQueue which is track all the ImageFrameRequests whose NativeImages have not been cached yet.
(WebCore::ImageFrameCache::frameAtIndexCacheIfNeeded): Be explicit about caching the image frame. frameImageAtIndex()
returns the current image frame without caching. frameAtIndexCacheIfNeeded(). returns the current image frame but cache
it if needed.
(WebCore::ImageFrameCache::ImageFrameRequest::operator==): Compares two ImageFrameRequests for equality.
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::frameImageAtIndexCacheIfNeeded):
(WebCore::ImageSource::frameImageAtIndex): Deleted.
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::requestFrameAsyncDecodingAtIndex): Change the type of the argument from IntSize to be const std::optional<IntSize>.
(WebCore::ImageSource::frameIsBeingDecodedAndIsCompatibleWithOptionsAtIndex): Rename of frameIsBeingDecodedAtIndex(). Replace the argument of type
std::optional<IntSize> by an argument of type DecodingOptions.
(WebCore::ImageSource::frameHasFullSizeNativeImageAtIndex): A wrapper around the ImageFrameCache function.
(WebCore::ImageSource::frameHasDecodedNativeImageCompatibleWithOptionsAtIndex): Ditto.
(WebCore::ImageSource::frameImageAtIndex): Ditto.
(WebCore::ImageSource::frameIsBeingDecodedAtIndex): Deleted.
(WebCore::ImageSource::frameHasValidNativeImageAtIndex): Deleted.
(WebCore::ImageSource::frameHasDecodedNativeImage): Deleted.
* platform/graphics/NamedImageGeneratedImage.cpp:
(WebCore::NamedImageGeneratedImage::draw): Add a new argument of type DecodingMode.
* platform/graphics/NamedImageGeneratedImage.h: Ditto.
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::draw): Add a new argument of type DecodingMode.
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoder::createFrameImageAtIndex): Replace the sizeForDrawing argument by a DecodingMode argument. Add a new handling
for decoding asynchronously for the image full size.
* platform/graphics/cg/ImageDecoderCG.h: Change the prototype of the function.
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::draw): Add a new argument of type DecodingMode.
* platform/graphics/cg/PDFDocumentImage.h:
* platform/graphics/win/ImageCGWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize): Pass DecodingMode::Synchronous to Image::draw().
(WebCore::BitmapImage::drawFrameMatchingSourceSize): Ditto.
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoder::createFrameImageAtIndex): Replace the sizeForDrawing argument by a DecodingMode argument.
* platform/graphics/win/ImageDecoderDirect2D.h: Change the prototype of the function.
* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageDecoder::createFrameImageAtIndex): Replace the sizeForDrawing argument by a DecodingMode argument.
* platform/image-decoders/ImageDecoder.h: Change the prototype of the function.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended): Draw the background image asynchronously if the image size is large.
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect): Draw the background image element asynchronously if the image size is large.
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::drawForContainer): Pass DecodingMode::Synchronous to draw().
(WebCore::SVGImage::nativeImageForCurrentFrame): Ditto.
(WebCore::SVGImage::nativeImage): Ditto.
(WebCore::SVGImage::draw): Add a new argument of type DecodingMode.
* svg/graphics/SVGImage.h: Change the prototype of the function.
* svg/graphics/SVGImageForContainer.cpp:
(WebCore::SVGImageForContainer::draw): Add a new argument of type DecodingMode.
* svg/graphics/SVGImageForContainer.h: Change the prototype of the function.

LayoutTests:

* fast/images/animated-image-different-dest-size-expected.html: Added.
* fast/images/animated-image-different-dest-size.html: Added.
This test crashes without this patch.

* fast/images/animated-image-loop-count.html:
Clear the memory cache so the test can be not flaky. Running it with -repeat-each was failing.

* fast/images/async-image-background-image-expected.html: Added.
* fast/images/async-image-background-image.html: Added.
Ensures the background image can be drawn asynchronously if it is large.

* fast/images/async-image-canvas-draw-image-expected.html: Added.
* fast/images/async-image-canvas-draw-image.html: Added.
Ensures the image is drawn synchronously on the canvas regardless of its size.

* fast/images/ordered-animated-image-frames.html:
Clear the memory cache so the test can be not flaky. Running it with -repeat-each was failing.

* fast/images/reset-image-animation-expected.txt:
* fast/images/reset-image-animation.html:
Change how the steps of the test are ordered so the test can be not flaky.
Running it with -repeat-each was failing.

* fast/images/resources/red-green-blue-900-300.png: Added.

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

3 years ago[iOS] Suppress page count recalc when setting a snapshot paper rect
aestes@apple.com [Tue, 28 Mar 2017 02:06:11 +0000 (02:06 +0000)]
[iOS] Suppress page count recalc when setting a snapshot paper rect
https://bugs.webkit.org/show_bug.cgi?id=170156
<rdar://problem/30787872>

Reviewed by Tim Horton.

When _WKWebViewPrintFormatter computes a page count for snapshotting, it updates the paper
rect, which triggers UIKit to ask for the page count again while we're in the middle of
printing, putting us in a bad state.

Suppress page count recalc while setting the new paper rect, since we know this will not
cause it to change.

* UIProcess/_WKWebViewPrintFormatter.mm:
(-[_WKWebViewPrintFormatter _setSnapshotPaperRect:]): Temporarily set
_suppressPageCountRecalc to YES before updating the paper rect.
(-[_WKWebViewPrintFormatter _setNeedsRecalc]): Only call [super _setNeedsRecalc] if
_suppressPageCountRecalc is NO.
* UIProcess/_WKWebViewPrintFormatterInternal.h: Declared -_setNeedsRecalc.

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

3 years ago[WK2] Callout Bar should be dismissed during data interaction
wenson_hsieh@apple.com [Tue, 28 Mar 2017 02:02:21 +0000 (02:02 +0000)]
[WK2] Callout Bar should be dismissed during data interaction
https://bugs.webkit.org/show_bug.cgi?id=170109
<rdar://problem/31171570>

Reviewed by Tim Horton.

Minor tweak to get the callout bar to duck during data interaction. Import a new UIKit SPI header in WebKit2.

* Platform/spi/ios/UIKitSPI.h:

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

3 years agoTest commit against new svn server.
lforschler@apple.com [Tue, 28 Mar 2017 01:48:09 +0000 (01:48 +0000)]
Test commit against new svn server.

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

3 years ago<rdar://problem/30949128>
lforschler@apple.com [Tue, 28 Mar 2017 01:31:58 +0000 (01:31 +0000)]
<rdar://problem/30949128>
Update build.webkit.org to use port 16000 for PBChangeSource.

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/master.cfg:

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

3 years agoActivate release libwebrtc logging when WebRTC log channel is on
commit-queue@webkit.org [Tue, 28 Mar 2017 00:32:56 +0000 (00:32 +0000)]
Activate release libwebrtc logging when WebRTC log channel is on
https://bugs.webkit.org/show_bug.cgi?id=169659

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-27
Reviewed by Alex Christensen.

* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::initializePeerConnectionFactoryAndThreads):

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

3 years agoUpdate NetworkResourceLoader logging statement
krollin@apple.com [Tue, 28 Mar 2017 00:16:09 +0000 (00:16 +0000)]
Update NetworkResourceLoader logging statement
https://bugs.webkit.org/show_bug.cgi?id=170126

Reviewed by Alex Christensen.

NetworkResourceLoader contains a logging statement that prints, in
part: "start: Retrieving resource from cache". This is misleading,
since it's not necessarily the case that the resource will be loaded
from the cache. What is actually happening at the point where that is
logged is that the cache is being checked for the resource. It still
remains to be seen if the resource will be found in it. To address
this, change the logging to say "start: Checking cache for resource".

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::start):

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

3 years agoMove visibleInViewportStateChanged callback from Element to render tree
antti@apple.com [Tue, 28 Mar 2017 00:06:28 +0000 (00:06 +0000)]
Move visibleInViewportStateChanged callback from Element to render tree
https://bugs.webkit.org/show_bug.cgi?id=170039

Reviewed by Zalan Bujtas.

Make it easier to use from the render tree.

Also for simplicity move the bits from RenderObject rare data to RenderElement.
There is plenty of space there.

* dom/Element.h:
(WebCore::Element::isVisibleInViewportChanged): Deleted.
* html/HTMLMediaElement.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::RenderElement):
(WebCore::RenderElement::willBeDestroyed):
(WebCore::RenderElement::registerForVisibleInViewportCallback):
(WebCore::RenderElement::unregisterForVisibleInViewportCallback):
(WebCore::RenderElement::setVisibleInViewportState):
(WebCore::RenderElement::visibleInViewportStateChanged):
* rendering/RenderElement.h:
(WebCore::RenderElement::visibleInViewportState):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::setIsRegisteredForVisibleInViewportCallback): Deleted.
(WebCore::RenderObject::setVisibleInViewportState): Deleted.
* rendering/RenderObject.h:
(WebCore::RenderObject::hasOutlineAutoAncestor):
(WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
(WebCore::RenderObject::isRegisteredForVisibleInViewportCallback): Deleted.
(WebCore::RenderObject::visibleInViewportState): Deleted.
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::visibleInViewportStateChanged):
* rendering/RenderVideo.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::updateVisibleViewportRect):

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

3 years agoWeb Inspector: Saving files should not suggest the top level directory
commit-queue@webkit.org [Mon, 27 Mar 2017 23:37:40 +0000 (23:37 +0000)]
Web Inspector: Saving files should not suggest the top level directory
https://bugs.webkit.org/show_bug.cgi?id=170085
<rdar://problem/30197794>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-03-27
Reviewed by Matt Baker.

Source/WebKit/mac:

* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorFrontendClient::save):
Don't set panel.directoryURL unless we have a good suggestion.

Source/WebKit2:

* UIProcess/mac/RemoteWebInspectorProxyMac.mm:
(WebKit::RemoteWebInspectorProxy::platformSave):
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformSave):
Don't set panel.directoryURL unless we have a good suggestion.

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

3 years agoaddIceCandidate should not throw if passed null or undefined
commit-queue@webkit.org [Mon, 27 Mar 2017 23:36:36 +0000 (23:36 +0000)]
addIceCandidate should not throw if passed null or undefined
https://bugs.webkit.org/show_bug.cgi?id=170118

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

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt:

Source/WebCore:

Covered by updated test.

A null/undefined candidate passed to addIceCandidate means end of Ice candidate..

* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::addIceCandidate):
* Modules/mediastream/PeerConnectionBackend.h:
(WebCore::PeerConnectionBackend::endOfIceCandidates):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::queuedAddIceCandidate):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCPeerConnection.js:
(addIceCandidate):

LayoutTests:

Updating test to log addIceCandidate rejection.

* webrtc/datachannel/basic.html:
* webrtc/routines.js:
(iceCallback1):
(iceCallback2):
(onAddIceCandidateError):

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

3 years agoAdd delegate method to let an WebKit client provide a custom image preview controller.
commit-queue@webkit.org [Mon, 27 Mar 2017 23:32:56 +0000 (23:32 +0000)]
Add delegate method to let an WebKit client provide a custom image preview controller.
https://bugs.webkit.org/show_bug.cgi?id=170076
rdar://problem/31153051

Add a new delegate method (_webView:previewViewControllerForImage:alternateURL:defaultActions:elementInfo:) to
WKUIDelegatePrivate, an client can use this method to provide a custom image preview view controller if the image
has alternated URL or custom image info.

Patch by Yongjun Zhang <yongjun_zhang@apple.com> on 2017-03-27
Reviewed by Beth Dakin.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add delegate method _webView:previewViewControllerForImage:alternateURL:defaultActions:elementInfo:.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _presentedViewControllerForPreviewItemController:]): If the image has alternated URL or custom info, try to use the client-provided
    preview view controller. Otherwise, use the default WKImagePreviewViewController.

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

3 years agoWeb Inspector: The inspector sidebar has weird sub-column sizing issues
webkit@devinrousso.com [Mon, 27 Mar 2017 23:31:01 +0000 (23:31 +0000)]
Web Inspector: The inspector sidebar has weird sub-column sizing issues
https://bugs.webkit.org/show_bug.cgi?id=161966

Reviewed by Joseph Pecoraro.

* UserInterface/Views/Sidebar.js:
(WebInspector.Sidebar.prototype.resizerDragEnded):
(WebInspector.Sidebar.prototype._recalculateWidth):
Ensure that the selected sidebar panel is notified of the size change (sizeDidChange) when
the resizer drag ends.

* UserInterface/Views/DetailsSectionDataGridRow.js:
(WebInspector.DetailsSectionDataGridRow.prototype.sizeDidChange):
* UserInterface/Views/ProbeSetDetailsSection.js:
(WebInspector.ProbeSetDetailsSection.prototype.sizeDidChange):
Add/update the sizeDidChange protected function.

* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WebInspector.ComputedStyleDetailsPanel.prototype.initialLayout):
(WebInspector.ComputedStyleDetailsPanel.prototype.sizeDidChange):
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
(WebInspector.DOMNodeDetailsSidebarPanel.prototype.sizeDidChange):
* UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
(WebInspector.LayerTreeDetailsSidebarPanel.prototype.sizeDidChange):
* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WebInspector.ResourceDetailsSidebarPanel.prototype.sizeDidChange):
* UserInterface/Views/ProbeDetailsSidebarPanel.js:
(WebInspector.ProbeDetailsSidebarPanel.prototype.sizeDidChange):
Update the contained DataGrid elements whenever the sidebar size changes so that the resizer
elements are positioned correctly.

* UserInterface/Views/View.js:
(WebInspector.View.prototype.updateLayoutIfNeeded):
* UserInterface/Views/TimelineOverview.js:
(WebInspector.TimelineOverview.prototype.updateLayoutIfNeeded):
* UserInterface/Views/TimelineRuler.js:
(WebInspector.TimelineRuler.prototype.updateLayoutIfNeeded):
Ensure the layoutReason is also propagated.

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

3 years agoWebAssembly: misc memory testing
jfbastien@apple.com [Mon, 27 Mar 2017 23:24:31 +0000 (23:24 +0000)]
WebAssembly: misc memory testing
https://bugs.webkit.org/show_bug.cgi?id=170137

Reviewed by Keith Miller.

JSTests:

* wasm/assert.js: handle newlines in code we print out, avoid regex
* wasm/function-tests/memory-import-and-grow.js: Added.
(const.instantiate):
(const.test):
* wasm/function-tests/memory-section-and-import.js: Added.
(const.instantiate):

Source/JavaScriptCore:

* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::WebAssemblyInstanceConstructor::createInstance): improve error messages

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

3 years agoRebaseline svg/css/getComputedStyle-basic.xhtml for macOS.
ryanhaddad@apple.com [Mon, 27 Mar 2017 23:21:19 +0000 (23:21 +0000)]
Rebaseline svg/css/getComputedStyle-basic.xhtml for macOS.

Unreviewed test gardening.

* platform/mac-elcapitan/svg/css/getComputedStyle-basic-expected.txt: Added.
* platform/mac/svg/css/getComputedStyle-basic-expected.txt: Added.

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

3 years agoWeb Inspector: Resource Details Sidebar displays previous image metrics when viewing...
commit-queue@webkit.org [Mon, 27 Mar 2017 23:19:21 +0000 (23:19 +0000)]
Web Inspector: Resource Details Sidebar displays previous image metrics when viewing resource where content load failed
https://bugs.webkit.org/show_bug.cgi?id=170065
<rdar://problem/27081591>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-03-27
Reviewed by Matt Baker.

* UserInterface/Models/Resource.js:
(WebInspector.Resource.prototype.getImageSize.imageDidLoad):
(WebInspector.Resource.prototype.getImageSize.requestContentFailure):
(WebInspector.Resource.prototype.getImageSize):
If the requestContent failed, return a null image size.

* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WebInspector.ResourceDetailsSidebarPanel.prototype._refreshImageSizeSection.hideImageSection):
(WebInspector.ResourceDetailsSidebarPanel.prototype._refreshImageSizeSection):
If the callback is called with a null size, hide the image size section.

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

3 years agoSource/WebCore:
antti@apple.com [Mon, 27 Mar 2017 22:56:32 +0000 (22:56 +0000)]
Source/WebCore:
Allow the page to render before <link> stylesheet tags in body
https://bugs.webkit.org/show_bug.cgi?id=149157
<rdar://problem/24658830>

Reviewed by Simon Fraser.

Currently we block style and renderer building completely if document has any loading
stylesheets. In case a script queries something layout dependent we construct the render
tree with whatever style we have but block painting in it.

This patch changes behavior so that a loading stylesheet in body only blocks rendering for elements
that are after it. The expectation is that such stylesheets rarely affect elements before them
and the elements can be rendered without causing ugly visible styling changes.

The patch replaces the old flash-of-unstyled-content (FOUC) preventation mechanism with a more
fine-grained one. Paint blocking is now done on per-renderer basis with based on isNonFinal flag in
RenderStyle.

For stylesheets in head the behavior should be largely unchanged.

Test: http/tests/incremental/stylesheet-body-incremental-rendering.html

* css/StyleResolver.cpp:
(WebCore::StyleResolver::pseudoStyleRulesForElement):
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::resolveStyle):
(WebCore::Document::updateLayoutIgnorePendingStylesheets):

    Remove the old FOUC preventation state tracking.

(WebCore::Document::shouldScheduleLayout):
(WebCore::Document::didRemoveAllPendingStylesheet):

    Repaints will now get triggered by the normal style mechanism.

* dom/Document.h:
(WebCore::Document::hasNodesWithNonFinalStyle):
(WebCore::Document::setHasNodesWithNonFinalStyle):

    Track if we need to recompute the style later because non-final or unstyled elements.

(WebCore::Document::didLayoutWithPendingStylesheets): Deleted.
(WebCore::Document::hasNodesWithPlaceholderStyle): Deleted.
(WebCore::Document::setHasNodesWithPlaceholderStyle): Deleted.
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::rendererIsNeeded):
* page/FrameView.cpp:
(WebCore::FrameView::qualifiesAsVisuallyNonEmpty):

    Don't qualify as visually non-empty if we have loading stylesheets in head (even if there is
    a fouc-prevented render tree).

(WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintContents):

    Instead of a global test, block painting if isNonFinal is set in the renderer's style.

* rendering/RenderLayer.cpp:
(WebCore::shouldSuppressPaintingLayer):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresRepaint):

    The isNonFinal flag prevents painting so we need to trigger repaint when it gets cleared.

* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::isNotFinal):
(WebCore::RenderStyle::setIsNotFinal):
(WebCore::RenderStyle::isPlaceholderStyle): Deleted.
(WebCore::RenderStyle::setIsPlaceholderStyle): Deleted.

    There is no need for placeholder styles anymore. Reuse the bit for isNotFinal.

* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:
* style/StyleScope.cpp:
(WebCore::Style::Scope::analyzeStyleSheetChange):
(WebCore::Style::Scope::updateActiveStyleSheets):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::styleForElement):
(WebCore::Style::TreeResolver::resolveElement):

    If we have seens a loading stylesheet and don't have a renderer yet don't style the element.
    In case there is a renderer or we are ignoring pending sheets, resolve the style normally
    but mark it as non-final.

(WebCore::Style::makePlaceholderStyle): Deleted.

LayoutTests:
Loading in-body stylesheets should not block rendering of elements before them
https://bugs.webkit.org/show_bug.cgi?id=169345

Reviewed by Simon Fraser.

* http/tests/incremental/resources/delayed-css.php: Added.
* http/tests/incremental/stylesheet-body-incremental-rendering-expected.html: Added.
* http/tests/incremental/stylesheet-body-incremental-rendering.html: Added.

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

3 years agoBots should run the dashboard tests
jmarcell@apple.com [Mon, 27 Mar 2017 22:22:40 +0000 (22:22 +0000)]
Bots should run the dashboard tests
https://bugs.webkit.org/show_bug.cgi?id=168994

Reviewed by Daniel Bates and David Kilzer.

We pull the `--results-directory` argument value out so that `RunDashboardTests` can override it so that we can separately run the dashboard layout tests.

* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(RunWebKitTests): Define a class variable called resultDirectory for the `--results-directory` argument so that subclasses can override this if needed.
(RunWebKitTests.start): Set the `--results-directory` argument value to the value of self.resultDirectory.
(RunDashboardTests): Subclass of RunWebKitTests in which we run the layout tests for the Bot Watcher's Dashboard.
(RunDashboardTests.start): Override the `--layout-tests-directory` to point to the dashboard layout tests.
(ExtractTestResults.addCustomURLs): Update the current results URL label to indicate that it links to layout tests results and add a new link to link to dashboard layout test results.
(TestFactory.__init__): Update unit tests to account for new RunDashboardTests step.
* BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotIteration.js:

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

3 years agoTest variation font ranges in the CSS Font Loading API
mmaxfield@apple.com [Mon, 27 Mar 2017 22:09:14 +0000 (22:09 +0000)]
Test variation font ranges in the CSS Font Loading API
https://bugs.webkit.org/show_bug.cgi?id=170022

Reviewed by Dean Jackson.

Source/WebCore:

Test: fast/text/variations/font-loading-api-parse-ranges.html

Don't use keywords when reporting font variation range values.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::fontNonKeywordWeightFromStyleValue):
(WebCore::ComputedStyleExtractor::fontWeightFromStyleValue):
(WebCore::ComputedStyleExtractor::fontNonKeywordStretchFromStyleValue):
(WebCore::ComputedStyleExtractor::fontStretchFromStyleValue):
(WebCore::ComputedStyleExtractor::fontNonKeywordStyleFromStyleValue):
(WebCore::ComputedStyleExtractor::fontStyleFromStyleValue):
* css/CSSComputedStyleDeclaration.h:
* css/FontFace.cpp:
(WebCore::FontFace::style):
(WebCore::FontFace::weight):
(WebCore::FontFace::stretch):

LayoutTests:

* fast/text/variations/font-loading-api-parse-ranges-expected.txt: Added.
* fast/text/variations/font-loading-api-parse-ranges.html: Added.

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

3 years agowebkitpy: Look for 'ios' test expectations for IOSPorts
jbedard@apple.com [Mon, 27 Mar 2017 21:49:09 +0000 (21:49 +0000)]
webkitpy: Look for 'ios' test expectations for IOSPorts
https://bugs.webkit.org/show_bug.cgi?id=169413

Reviewed by Alexey Proskuryakov.

Test expectations for iOS tests should include the 'ios' folder.  Modify
default_baseline_search_path to include 'ios' folder and derivatives for
IOSPort.

* Scripts/webkitpy/port/ios.py:
(IOSPort._generate_all_test_configurations): Moved from IOSSimulatorPort.
(IOSPort.default_baseline_search_path): Add ios expectations along with port specific expectations.
(IOSPort.test_expectations_file_position): Added for testing.
* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort._generate_all_test_configurations): Moved to IOSPort.
(IOSSimulatorPort.default_baseline_search_path): Moved to IOSPort.

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

3 years agoREGRESSION: Reseting _device_map on each child process
jbedard@apple.com [Mon, 27 Mar 2017 21:42:50 +0000 (21:42 +0000)]
REGRESSION: Reseting _device_map on each child process
<rdar://problem/31274476>

Unreviewed infrastructure fix.

* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort): Add _DEVICE_MAP class variable.
(IOSSimulatorPort.__init__): Use shared class variable
(IOSSimulatorPort._device_for_worker_number_map): Use _DEVICE_MAP class variable
(IOSSimulatorPort._create_devices): Ditto.
(IOSSimulatorPort._quit_ios_simulator): Ditto.
(IOSSimulatorPort.clean_up_test_run): Ditto.

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

3 years agoPropagate shipping contact update errors
andersca@apple.com [Mon, 27 Mar 2017 21:32:17 +0000 (21:32 +0000)]
Propagate shipping contact update errors
https://bugs.webkit.org/show_bug.cgi?id=170141
rdar://problem/31276576

Reviewed by Tim Horton.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):

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

3 years agoUnreviewed, rolling out r214411.
ryanhaddad@apple.com [Mon, 27 Mar 2017 21:20:30 +0000 (21:20 +0000)]
Unreviewed, rolling out r214411.

Two of the LayoutTests for this change time out on ios-
simulator.

Reverted changeset:

"[Modern Media Controls] Improve media documents across macOS,
iPhone and iPad"
https://bugs.webkit.org/show_bug.cgi?id=169145
http://trac.webkit.org/changeset/214411

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

3 years agoFix uses of deprecated API
andersca@apple.com [Mon, 27 Mar 2017 20:55:45 +0000 (20:55 +0000)]
Fix uses of deprecated API
https://bugs.webkit.org/show_bug.cgi?id=170138
rdar://problem/28882449

Reviewed by Tim Horton.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toPKContactFields):
(WebKit::toPKAddressField):
(WebKit::toPKPaymentRequest):
Don't use deprecated APIs.

(WebKit::toNSError):
Don't try to insert nil in a dictionary.

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

3 years agoBuild libwebrtc with even more warnings
achristensen@apple.com [Mon, 27 Mar 2017 19:57:22 +0000 (19:57 +0000)]
Build libwebrtc with even more warnings
https://bugs.webkit.org/show_bug.cgi?id=169997

Reviewed by Tim Horton.

There are still OSAtomic* functions I don't want to worry about right now,
so I'm keeping a few -Wno-deprecated-declarations, but everything else can go.

* Configurations/libsrtp.xcconfig:
* Configurations/libwebrtc.xcconfig:
* Configurations/libwebrtcpcrtc.xcconfig:

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

3 years ago[Modern Media Controls] Clicking on the tracks button when the tracks panel is up...
graouts@webkit.org [Mon, 27 Mar 2017 19:44:09 +0000 (19:44 +0000)]
[Modern Media Controls] Clicking on the tracks button when the tracks panel is up in a media document pauses the video
https://bugs.webkit.org/show_bug.cgi?id=168517
<rdar://problem/30577636>

Reviewed by Dean Jackson.

Source/WebCore:

We completely turn off default event handling in MediaDocument.cpp since we're implementing the
behavior we expect to pause and resume the video in the modern-media-controls module already. This
gets rid of this odd case where the content would not see the "click" event while the C++ side would
handle it and pause the video.

* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.handleEvent):
(MediaController.prototype._containerWasClicked): Deleted.
* html/MediaDocument.cpp:
(WebCore::MediaDocument::defaultEventHandler):

LayoutTests:

* media/video-click-dblckick-standalone.html: We disable modern-media-controls here since we know that this test won't pass with them on.

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

3 years agoMark media/modern-media-controls/time-label/time-label-white-space-nowrap.html as...
ryanhaddad@apple.com [Mon, 27 Mar 2017 19:40:01 +0000 (19:40 +0000)]
Mark media/modern-media-controls/time-label/time-label-white-space-nowrap.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=169679

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoMark inspector/dom-debugger/dom-breakpoints.html as flaky.
ryanhaddad@apple.com [Mon, 27 Mar 2017 19:36:55 +0000 (19:36 +0000)]
Mark inspector/dom-debugger/dom-breakpoints.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=170127

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoMark media/modern-media-controls/time-label/time-label.html as flaky.
ryanhaddad@apple.com [Mon, 27 Mar 2017 19:16:50 +0000 (19:16 +0000)]
Mark media/modern-media-controls/time-label/time-label.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=169678

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

3 years agoMarking two modern-media-controls tests as timeouts.
ryanhaddad@apple.com [Mon, 27 Mar 2017 19:09:48 +0000 (19:09 +0000)]
Marking two modern-media-controls tests as timeouts.
https://bugs.webkit.org/show_bug.cgi?id=170123

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

3 years agoTighten RTCDatachannel creation and parameter getters
commit-queue@webkit.org [Mon, 27 Mar 2017 18:13:19 +0000 (18:13 +0000)]
Tighten RTCDatachannel creation and parameter getters
https://bugs.webkit.org/show_bug.cgi?id=170081

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

Source/WebCore:

Covered by updated tests.

Adding some parameter checks when creating data channels.
Making some getters nullable as per the spec.

* Modules/mediastream/RTCDataChannel.h:
* Modules/mediastream/RTCDataChannel.idl:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::createDataChannel):
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::createDataChannel):
(WebCore::LibWebRTCMediaEndpoint::addDataChannel):
* platform/mediastream/RTCDataChannelHandler.h:
(): Deleted.

LayoutTests:

* webrtc/datachannel/basic-expected.txt:
* webrtc/datachannel/basic.html:

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

3 years agoAdd support for RTCRtpReceiver/RTCRtpSender getParameters
commit-queue@webkit.org [Mon, 27 Mar 2017 18:10:45 +0000 (18:10 +0000)]
Add support for RTCRtpReceiver/RTCRtpSender getParameters
https://bugs.webkit.org/show_bug.cgi?id=170057

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-27
Reviewed by Alex Christensen.

Source/ThirdParty/libwebrtc:

* Source/webrtc/api/mediatypes.h:

Source/WebCore:

Test: webrtc/video-getParameters.html

getParameters returns a dictionary of values taken from libwebrtc RtpReceiverInterface/RtpSenderInrterface objects.
Added a direct link between WebCore RTCRtpReceiver and libwebrtc RtpReceiverInterface object.
Making the link between WebCore RTCRtpSender and libwebrtc RtpSenderInrterface object through
PeerConnectionBackend to keep the current architecture shared with OpenWebRTC.
In the future, we should try to make the link more direct.

Added routines to support the conversion from libwebrtc to WebCore.
Ensured that RTCRtpReceiver is cleaning its backend when being stopped.

* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
* Modules/mediastream/PeerConnectionBackend.h:
(WebCore::PeerConnectionBackend::getParameters):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::doClose):
(WebCore::RTCPeerConnection::getParameters):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpParameters.h: Added.
* Modules/mediastream/RTCRtpParameters.idl: Added.
* Modules/mediastream/RTCRtpReceiver.cpp:
(WebCore::RTCRtpReceiver::RTCRtpReceiver):
* Modules/mediastream/RTCRtpReceiver.h:
(WebCore::RTCRtpReceiver::Backend::~Backend):
(WebCore::RTCRtpReceiver::Backend::getParameters):
(WebCore::RTCRtpReceiver::create):
(WebCore::RTCRtpReceiver::stop):
(WebCore::RTCRtpReceiver::setBackend):
(WebCore::RTCRtpReceiver::getParameters):
* Modules/mediastream/RTCRtpReceiver.idl:
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::create):
(WebCore::RTCRtpSender::RTCRtpSender):
(WebCore::RTCRtpSender::replaceTrack):
(WebCore::RTCRtpSender::getParameters):
* Modules/mediastream/RTCRtpSender.h:
(WebCore::RTCRtpSender::Backend::~Backend):
(WebCore::RTCRtpSender::isStopped):
(WebCore::RTCRtpSender::stop):
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::addTrack):
(WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
(WebCore::LibWebRTCMediaEndpoint::OnAddTrack):
(WebCore::LibWebRTCMediaEndpoint::stop):
(WebCore::fillEncodingParameters):
(WebCore::fillHeaderExtensionParameters):
(WebCore::fillCodecParameters):
(WebCore::fillRtpParameters):
(WebCore::RTCRtpReceiverBackend::getParameters):
(WebCore::LibWebRTCMediaEndpoint::getRTCRtpSenderParameters):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::notifyAddedTrack):
(WebCore::LibWebRTCPeerConnectionBackend::getParameters):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:

LayoutTests:

* webrtc/video-getParameters-expected.txt: Added.
* webrtc/video-getParameters.html: Added.

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

3 years agofont variation properties don't need to accept numbers
mmaxfield@apple.com [Mon, 27 Mar 2017 17:50:33 +0000 (17:50 +0000)]
font variation properties don't need to accept numbers
https://bugs.webkit.org/show_bug.cgi?id=169357

Reviewed by Antti Koivisto.

Source/WebCore:

The CSS Fonts level 4 spec stabilized the grammar accepted by font-weight,
font-style, and font-stretch. The changes are that font-style and
font-stretch no longer accept raw numbers, and the @font-face descriptor
ranges are now separated by spaces instead of slashes.

Tests: fast/text/font-selection-font-face-parse.html
       fast/text/font-selection-font-loading-api-parse.html
       fast/text/font-stretch-parse.html
       fast/text/font-style-parse.html
       fast/text/variations/font-selection-properties.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::fontWeightFromStyleValue):
(WebCore::fontWeightFromStyle):
(WebCore::ComputedStyleExtractor::fontStretchFromStyleValue):
(WebCore::fontStretchFromStyle):
(WebCore::ComputedStyleExtractor::fontStyleFromStyleValue):
(WebCore::fontStyleFromStyle):
* css/CSSComputedStyleDeclaration.h:
* css/FontFace.cpp:
(WebCore::FontFace::style):
(WebCore::FontFace::weight):
(WebCore::FontFace::stretch):
(WebCore::rangeIsSingleValue): Deleted.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertFontStretchFromValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontWeightRange):
(WebCore::consumeFontStretch):
(WebCore::consumeFontStretchRange):
(WebCore::consumeFontStyle):
(WebCore::consumeFontStyleRange):

LayoutTests:

* fast/text/font-selection-font-face-parse-expected.txt:
* fast/text/font-selection-font-face-parse.html:
* fast/text/font-selection-font-loading-api-parse-expected.txt:
* fast/text/font-selection-font-loading-api-parse.html:
* fast/text/font-stretch-parse-expected.txt:
* fast/text/font-stretch-parse.html:
* fast/text/font-style-parse-expected.txt:
* fast/text/font-style-parse.html:
* fast/text/variations/font-selection-properties.html:
* platform/mac-elcapitan/fast/text/font-selection-font-face-parse-expected.txt:

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

3 years agoFurther optimize checkWebRTCAvailability
commit-queue@webkit.org [Mon, 27 Mar 2017 17:48:22 +0000 (17:48 +0000)]
Further optimize checkWebRTCAvailability
https://bugs.webkit.org/show_bug.cgi?id=169147

Patch by Youenn Fablet <youenn@apple.com> on 2017-03-27
Reviewed by Alex Christensen.

Tested locally by removing libwebrtc.dylib.
Replacing dlopen check by checking an exported symbol, rtc::LogMessage::LogToDebug.
This check is more efficient and accurate. It should work in more configurations than the previous one.

* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::isNullFunctionPointer):
(WebCore::LibWebRTCProvider::webRTCAvailable):

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

3 years agoREGRESSION: Failing to iterate over Simulator.managed_devices map
jbedard@apple.com [Mon, 27 Mar 2017 17:21:22 +0000 (17:21 +0000)]
REGRESSION: Failing to iterate over Simulator.managed_devices map
<rdar://problem/31274476>

Unreviewed infrastructure fix.

* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort._create_devices): Iterate through managed_devices by worker number.

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

3 years agoAdd ARM64 system instructions to disassembler
msaboff@apple.com [Mon, 27 Mar 2017 16:39:47 +0000 (16:39 +0000)]
Add ARM64 system instructions to disassembler
https://bugs.webkit.org/show_bug.cgi?id=170084

Reviewed by Saam Barati.

This changes adds support for MRS and MSR instructions, and refactors the DMB
disassembly to handle all of the barrier instructions.

* disassembler/ARM64/A64DOpcode.cpp:
(JSC::ARM64Disassembler::A64DOpcodeMSRImmediate::format):
(JSC::ARM64Disassembler::A64DOpcodeMSROrMRSRegister::format):
(JSC::ARM64Disassembler::A64DOpcodeSystemSync::format):
(JSC::ARM64Disassembler::A64DOpcodeDmb::format): Deleted.
* disassembler/ARM64/A64DOpcode.h:
(JSC::ARM64Disassembler::A64DOpcodeSystem::lBit):
(JSC::ARM64Disassembler::A64DOpcodeSystem::op0):
(JSC::ARM64Disassembler::A64DOpcodeSystem::op1):
(JSC::ARM64Disassembler::A64DOpcodeSystem::crN):
(JSC::ARM64Disassembler::A64DOpcodeSystem::crM):
(JSC::ARM64Disassembler::A64DOpcodeSystem::op2):
(JSC::ARM64Disassembler::A64DOpcodeMSROrMRSRegister::opName):
(JSC::ARM64Disassembler::A64DOpcodeMSROrMRSRegister::systemRegister):
(JSC::ARM64Disassembler::A64DOpcodeSystemSync::opName):
(JSC::ARM64Disassembler::A64DOpcodeSystemSync::option):
(JSC::ARM64Disassembler::A64DOpcodeDmb::opName): Deleted.
(JSC::ARM64Disassembler::A64DOpcodeDmb::option): Deleted.
(JSC::ARM64Disassembler::A64DOpcodeDmb::crM): Deleted.

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

3 years agoImplement format specifier for variation fonts
mmaxfield@apple.com [Mon, 27 Mar 2017 16:18:33 +0000 (16:18 +0000)]
Implement format specifier for variation fonts
https://bugs.webkit.org/show_bug.cgi?id=169327

Reviewed by Simon Fraser.

Source/WebCore:

Variation fonts require the format("woff-variations"), format("truetype-variations"),
and format("opentype-variations") format specifies in @font-face rules.

Test: fast/text/variations/font-face-format.html

* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::supportsFormat):

LayoutTests:

* fast/text/variations/font-face-format-expected.html: Added.
* fast/text/variations/font-face-format.html: Added.

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

3 years agoMake sure animation works for font-weight, font-stretch, and font-style
mmaxfield@apple.com [Mon, 27 Mar 2017 16:12:21 +0000 (16:12 +0000)]
Make sure animation works for font-weight, font-stretch, and font-style
https://bugs.webkit.org/show_bug.cgi?id=169683

Reviewed by Simon Fraser.

Source/WebCore:

Hook up animation code for FontSelectionValues.

Tests: animations/font-variations/font-stretch.html
       animations/font-variations/font-style.html
       animations/font-variations/font-weight.html

* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontWeight):
(WebCore::RenderStyle::setFontStretch):
(WebCore::RenderStyle::setFontItalic):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fontWeight):
(WebCore::RenderStyle::fontStretch):
(WebCore::RenderStyle::fontItalic):

LayoutTests:

* animations/font-variations/font-stretch-expected.txt: Added.
* animations/font-variations/font-stretch.html: Added.
* animations/font-variations/font-style-expected.txt: Added.
* animations/font-variations/font-style.html: Added.
* animations/font-variations/font-weight-expected.txt: Added.
* animations/font-variations/font-weight.html: Added.
* animations/resources/animation-test-helpers.js:
(compareFontStyle):
(getPropertyValue):
(comparePropertyValue):

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

3 years agoMake WebSockets work in network process
achristensen@apple.com [Mon, 27 Mar 2017 15:43:34 +0000 (15:43 +0000)]
Make WebSockets work in network process
https://bugs.webkit.org/show_bug.cgi?id=169930

Reviewed by Youenn Fablet.

Source/WebCore:

Covered by 136 existing tests in http/tests/websocket/tests/hybi
This also does fine with the 544 websocket tests in the web-platform-tests which we have not yet imported.
Also added http/tests/websocket/tests/hybi/network-process-crash-error.html
to test a new condition that couldn't happen before this move: the NetworkProcess crashing.

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::fail):
We were asserting that didCloseSocketStream was called.  It is still called,
but not synchronously like it used to.  This assertion is now invalid, but tests
that would hit it still pass.
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::platformSendInternal):
CFWriteStreamCanAcceptBytes crashes if you give it a null parameter, and that can happen now.
If we have no write stream, then we cannot write.  Tests that hit this pass still.

Source/WebKit2:

This adds WebSocketStream, which is a SocketStreamHandle that sends asynchronous
messages to a NetworkSocketStream in the NetworkProcess.  WebKit1 uses a SocketStreamHandleImpl
still, but WebKit2 now has a SocketStreamHandleImpl in the NetworkProcess owned by the
NetworkSocketStream, which is a SocketStreamHandleClient that sends asynchronous messages back
to the WebProcess.  WebSocketStream's implementation of SocketStreamHandle::platformSend is special
because it stores the completion handler in a map and asynchronously reports to the caller whether
it succeeded or not.  If the network processes crashes before the completion handlers are called,
then they are called indicating failure and an error is reported, but that never happens, right?

* CMakeLists.txt:
* DerivedSources.make:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
(WebKit::NetworkConnectionToWebProcess::createSocketStream):
(WebKit::NetworkConnectionToWebProcess::destroySocketStream):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSocketStream.cpp: Added.
(WebKit::NetworkSocketStream::create):
(WebKit::NetworkSocketStream::NetworkSocketStream):
(WebKit::NetworkSocketStream::sendData):
(WebKit::NetworkSocketStream::close):
(WebKit::NetworkSocketStream::didOpenSocketStream):
(WebKit::NetworkSocketStream::didCloseSocketStream):
(WebKit::NetworkSocketStream::didReceiveSocketStreamData):
(WebKit::NetworkSocketStream::didFailToReceiveSocketStreamData):
(WebKit::NetworkSocketStream::didUpdateBufferedAmount):
(WebKit::NetworkSocketStream::didFailSocketStream):
(WebKit::NetworkSocketStream::messageSenderConnection):
(WebKit::NetworkSocketStream::messageSenderDestinationID):
* NetworkProcess/NetworkSocketStream.h: Added.
* NetworkProcess/NetworkSocketStream.messages.in: Added.
* UIProcess/API/C/WKContext.cpp:
(WKContextSetAllowsAnySSLCertificateForWebSocketTesting):
(WKContextTerminateNetworkProcess):
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::sendSyncToNetworkingProcess):
(WebKit::WebProcessPool::setAllowsAnySSLCertificateForWebSocket):
(WebKit::WebProcessPool::terminateNetworkProcess):
* UIProcess/WebProcessPool.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveMessage):
* WebProcess/Network/WebSocketProvider.cpp:
(WebKit::WebSocketProvider::createSocketStreamHandle):
* WebProcess/Network/WebSocketStream.cpp: Added.
(WebKit::globalWebSocketStreamMap):
(WebKit::WebSocketStream::streamWithIdentifier):
(WebKit::WebSocketStream::networkProcessCrashed):
(WebKit::WebSocketStream::create):
(WebKit::WebSocketStream::WebSocketStream):
(WebKit::WebSocketStream::~WebSocketStream):
(WebKit::WebSocketStream::messageSenderConnection):
(WebKit::WebSocketStream::messageSenderDestinationID):
(WebKit::WebSocketStream::platformSend):
(WebKit::WebSocketStream::didSendData):
(WebKit::WebSocketStream::platformClose):
(WebKit::WebSocketStream::bufferedAmount):
(WebKit::WebSocketStream::didOpenSocketStream):
(WebKit::WebSocketStream::didCloseSocketStream):
(WebKit::WebSocketStream::didReceiveSocketStreamData):
(WebKit::WebSocketStream::didFailToReceiveSocketStreamData):
(WebKit::WebSocketStream::didUpdateBufferedAmount):
(WebKit::WebSocketStream::didFailSocketStream):
* WebProcess/Network/WebSocketStream.h: Added.
* WebProcess/Network/WebSocketStream.messages.in: Added.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::networkProcessConnectionClosed):

Tools:

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
Add terminateNetworkProcess for the new test
http/tests/websocket/tests/hybi/network-process-crash-error.html
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setAllowsAnySSLCertificate):
(WTR::TestRunner::terminateNetworkProcess):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::setAllowsAnySSLCertificate):
(WTR::TestController::terminateNetworkProcess):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::platformContext):
* WebKitTestRunner/gtk/TestControllerGtk.cpp:
(WTR::TestController::platformContext):
(WTR::TestController::platformLibraryPathForTesting):
Add some infrastructure for http/tests/websocket/tests/hybi/simple-wss.html
which calls testRunner.setAllowsAnySSLCertificate.  It used to only be effective
for the WebProcess, but SocketStreamHandleImpl::createStreams is now in the NetworkProcess,
and we need its call to Settings::allowsAnySSLCertificate to be loosened for this test,
which tests that wss works, but our test certificate has an invalid certificate chain.
We want production software to not have the ability to have its security weakened, so this
is a test code path that is only implemented in WebKitTestRunner.

LayoutTests:

* http/tests/websocket/tests/hybi/network-process-crash-error-expected.txt: Added.
* http/tests/websocket/tests/hybi/network-process-crash-error.html: Added.
* http/tests/websocket/tests/hybi/slow-reply_wsh.py: Added.
(web_socket_do_extra_handshake):
(web_socket_transfer_data):
* platform/ios-simulator-wk1/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

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

3 years ago[GTK] NetscapePluginX11::m_windowID is unused/unneeded
commit-queue@webkit.org [Mon, 27 Mar 2017 13:38:34 +0000 (13:38 +0000)]
[GTK] NetscapePluginX11::m_windowID is unused/unneeded
https://bugs.webkit.org/show_bug.cgi?id=170115

Patch by Adrian Perez de Castro <aperez@igalia.com> on 2017-03-27
Reviewed by Michael Catanzaro.

* WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
(WebKit::NetscapePluginX11::NetscapePluginX11):
Remove the unneeded NetscapePluginX11::m_windowID member.
* WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h:
Remove the unneeded NetscapePluginX11::m_windowID member.

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

3 years ago[Modern Media Controls] Improve media documents across macOS, iPhone and iPad
commit-queue@webkit.org [Mon, 27 Mar 2017 09:37:47 +0000 (09:37 +0000)]
[Modern Media Controls] Improve media documents across macOS, iPhone and iPad
https://bugs.webkit.org/show_bug.cgi?id=169145
<rdar://problem/17048858>

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

Source/WebCore:

There were a variety of issues with media documents, some longstanding, and some specifically
about modern media controls.

One issue was that fullscreen and picture-in-picture buttons would show for audio media documents,
due to using a <video> element to load the audio file. We now have additional logic in MediaController
to identify if the loaded media is really an audio file, and using this information to hide the
fullscreen and picture-in-picture buttons.

Another issue was that we would inject style in MediaDocument.cpp that was specific to modern media
controls when we could have the modern-media-controls module injected CSS handle this styling. We now
use the injected style in the shadow root to size media documents based on the device characteristics
and ensuring that page styles are overridden.

We also simplify how MediaDocument.cpp sets the source of the media element to simply use the "src"
attribute and not a <source> element.

Finally, we introduce a MediaDocumentController class that is instantiated when we're dealing with
a media document to hide the controls while we determine the type of media we're loading (audio vs.
video) in order to apply the appropriate styling without flashes.

As a result of the new styles applied by the modern-media-controls module, media documents have a
similar behavior on macOS and iPad, where we only enforce a min-width for video allowing them
to play at their natural size otherwise, and enforcing a fixed width for audio. On iPhone however,
we want to always play the media at full width, with some padding in the case of audio.

Tests: media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only.html
       media/modern-media-controls/media-documents/ipad/media-document-audio-ios-sizing.html
       media/modern-media-controls/media-documents/ipad/media-document-video-ios-sizing.html
       media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html
       media/modern-media-controls/media-documents/media-document-audio-mac-sizing.html
       media/modern-media-controls/media-documents/media-document-video-ios-sizing.html
       media/modern-media-controls/media-documents/media-document-video-mac-sizing.html
       media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only.html

* Modules/modern-media-controls/controls/ios-inline-media-controls.css:
(:host(audio) .media-controls.ios.inline > .controls-bar:before,):
(:host(audio) .media-controls.ios.inline > .controls-bar:before): Deleted.
* Modules/modern-media-controls/controls/macos-media-controls.css:
(:host(audio) .media-controls.mac.inline > .controls-bar,):
(:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint,):
(:host(audio) .media-controls.mac.inline > .controls-bar): Deleted.
(:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint): Deleted.
* Modules/modern-media-controls/controls/media-document.css: Added.
(:host(.media-document)):
(:host(.media-document.ready)):
(:host(.media-document.audio.mac)):
(:host(.media-document.audio.ipad)):
(:host(.media-document.audio.iphone)):
(:host(.media-document.video.mac)):
(:host(.media-document.video.ipad)):
(:host(.media-document.video.iphone)):
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/fullscreen-support.js:
(FullscreenSupport.prototype.syncControl):
(FullscreenSupport):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.get isAudio):
* Modules/modern-media-controls/media/media-document-controller.js: Added.
(MediaDocumentController):
(MediaDocumentController.prototype.handleEvent):
(MediaDocumentController.prototype._mediaDocumentHasMetadata):
(MediaDocumentController.prototype._mediaDocumentHasSize):
* Modules/modern-media-controls/media/pip-support.js:
(PiPSupport.prototype.syncControl):
(PiPSupport):
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):

LayoutTests:

We add new tests for media documents and related features that cover the following cases:

    - checking <video> with only audio tracks does not show the fullscreen button
    - checking <video> with only audio tracks does not show the picture-in-picture button
    - checking the size used in media documents for audio and video across macOS, iPhone and iPad

* media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only-expected.txt: Added.
* media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only.html: Added.
* media/modern-media-controls/media-documents/ipad/media-document-audio-ios-sizing-expected.txt: Added.
* media/modern-media-controls/media-documents/ipad/media-document-audio-ios-sizing.html: Added.
* media/modern-media-controls/media-documents/ipad/media-document-video-ios-sizing-expected.txt: Added.
* media/modern-media-controls/media-documents/ipad/media-document-video-ios-sizing.html: Added.
* media/modern-media-controls/media-documents/media-document-audio-ios-sizing-expected.txt: Added.
* media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html: Added.
* media/modern-media-controls/media-documents/media-document-audio-mac-sizing-expected.txt: Added.
* media/modern-media-controls/media-documents/media-document-audio-mac-sizing.html: Added.
* media/modern-media-controls/media-documents/media-document-video-ios-sizing-expected.txt: Added.
* media/modern-media-controls/media-documents/media-document-video-ios-sizing.html: Added.
* media/modern-media-controls/media-documents/media-document-video-mac-sizing-expected.txt: Added.
* media/modern-media-controls/media-documents/media-document-video-mac-sizing.html: Added.
* media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only-expected.txt: Added.
* media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only.html: Added.
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:

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

3 years agoB3::fixSSA should do liveness pruning
fpizlo@apple.com [Mon, 27 Mar 2017 04:17:52 +0000 (04:17 +0000)]
B3::fixSSA should do liveness pruning
https://bugs.webkit.org/show_bug.cgi?id=170111

Reviewed by Saam Barati.

Source/JavaScriptCore:

This moves all of the logic of Air::Liveness<> to WTF::Liveness<> and then uses that to
create B3::VariableLiveness. Then this uses VariableLiveness::LiveAtHead to prune Phi
construction.

This makes B3::fixSSA run twice as fast. This is a 13% progression on WasmBench compile
times.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3BasicBlock.h:
(JSC::B3::BasicBlock::get):
* b3/B3FixSSA.cpp:
(JSC::B3::fixSSA):
* b3/B3VariableLiveness.cpp: Added.
(JSC::B3::VariableLiveness::VariableLiveness):
(JSC::B3::VariableLiveness::~VariableLiveness):
* b3/B3VariableLiveness.h: Added.
(JSC::B3::VariableLivenessAdapter::VariableLivenessAdapter):
(JSC::B3::VariableLivenessAdapter::numIndices):
(JSC::B3::VariableLivenessAdapter::valueToIndex):
(JSC::B3::VariableLivenessAdapter::indexToValue):
(JSC::B3::VariableLivenessAdapter::blockSize):
(JSC::B3::VariableLivenessAdapter::forEachEarlyUse):
(JSC::B3::VariableLivenessAdapter::forEachLateUse):
(JSC::B3::VariableLivenessAdapter::forEachEarlyDef):
(JSC::B3::VariableLivenessAdapter::forEachLateDef):
* b3/air/AirCFG.h: Added.
(JSC::B3::Air::CFG::CFG):
(JSC::B3::Air::CFG::root):
(JSC::B3::Air::CFG::newMap):
(JSC::B3::Air::CFG::successors):
(JSC::B3::Air::CFG::predecessors):
(JSC::B3::Air::CFG::index):
(JSC::B3::Air::CFG::node):
(JSC::B3::Air::CFG::numNodes):
(JSC::B3::Air::CFG::dump):
* b3/air/AirCode.cpp:
(JSC::B3::Air::Code::Code):
* b3/air/AirCode.h:
(JSC::B3::Air::Code::cfg):
* b3/air/AirLiveness.h:
(JSC::B3::Air::LivenessAdapter::LivenessAdapter):
(JSC::B3::Air::LivenessAdapter::blockSize):
(JSC::B3::Air::LivenessAdapter::forEachEarlyUse):
(JSC::B3::Air::LivenessAdapter::forEachLateUse):
(JSC::B3::Air::LivenessAdapter::forEachEarlyDef):
(JSC::B3::Air::LivenessAdapter::forEachLateDef):
(JSC::B3::Air::TmpLivenessAdapter::TmpLivenessAdapter):
(JSC::B3::Air::TmpLivenessAdapter::numIndices):
(JSC::B3::Air::StackSlotLivenessAdapter::StackSlotLivenessAdapter):
(JSC::B3::Air::StackSlotLivenessAdapter::numIndices):
(JSC::B3::Air::StackSlotLivenessAdapter::indexToValue):
(JSC::B3::Air::Liveness::Liveness):
(JSC::B3::Air::Liveness::LocalCalc::LocalCalc): Deleted.
(JSC::B3::Air::Liveness::LocalCalc::Iterable::Iterable): Deleted.
(JSC::B3::Air::Liveness::LocalCalc::Iterable::iterator::iterator): Deleted.
(JSC::B3::Air::Liveness::LocalCalc::Iterable::iterator::operator++): Deleted.
(JSC::B3::Air::Liveness::LocalCalc::Iterable::iterator::operator*): Deleted.
(JSC::B3::Air::Liveness::LocalCalc::Iterable::iterator::operator==): Deleted.
(JSC::B3::Air::Liveness::LocalCalc::Iterable::iterator::operator!=): Deleted.
(JSC::B3::Air::Liveness::LocalCalc::Iterable::begin): Deleted.
(JSC::B3::Air::Liveness::LocalCalc::Iterable::end): Deleted.
(JSC::B3::Air::Liveness::LocalCalc::Iterable::contains): Deleted.
(JSC::B3::Air::Liveness::LocalCalc::live): Deleted.
(JSC::B3::Air::Liveness::LocalCalc::isLive): Deleted.
(JSC::B3::Air::Liveness::LocalCalc::execute): Deleted.
(JSC::B3::Air::Liveness::rawLiveAtHead): Deleted.
(JSC::B3::Air::Liveness::Iterable::Iterable): Deleted.
(JSC::B3::Air::Liveness::Iterable::iterator::iterator): Deleted.
(JSC::B3::Air::Liveness::Iterable::iterator::operator*): Deleted.
(JSC::B3::Air::Liveness::Iterable::iterator::operator++): Deleted.
(JSC::B3::Air::Liveness::Iterable::iterator::operator==): Deleted.
(JSC::B3::Air::Liveness::Iterable::iterator::operator!=): Deleted.
(JSC::B3::Air::Liveness::Iterable::begin): Deleted.
(JSC::B3::Air::Liveness::Iterable::end): Deleted.
(JSC::B3::Air::Liveness::Iterable::contains): Deleted.
(JSC::B3::Air::Liveness::liveAtHead): Deleted.
(JSC::B3::Air::Liveness::liveAtTail): Deleted.
(JSC::B3::Air::Liveness::workset): Deleted.

Source/WTF:

Move Air::Liveness<> to WTF::Liveness<>. This is pretty easy since Air::Liveness<> was
already fairly generic. It leverages the CFG concept so that it can understand many
different kinds of basic blocks. It doesn't try to understand the contents of basic
blocks; it just asks the adaptor for the block size and asks for the early/late
uses/defs of each thing in the block.

This makes it easy to create a B3::VariableLiveness, which fixSSA then uses for
pruning. One of the new features is the Liveness::LiveAtHead nested class, which you
instantiate if you want to perform liveAtHead queries, which SSA construction wants to
do.

This also fixes https://bugs.webkit.org/show_bug.cgi?id=170102#c12

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Liveness.h: Added.
(WTF::Liveness::Liveness):
(WTF::Liveness::LocalCalc::LocalCalc):
(WTF::Liveness::LocalCalc::Iterable::Iterable):
(WTF::Liveness::LocalCalc::Iterable::iterator::iterator):
(WTF::Liveness::LocalCalc::Iterable::iterator::operator++):
(WTF::Liveness::LocalCalc::Iterable::iterator::operator*):
(WTF::Liveness::LocalCalc::Iterable::iterator::operator==):
(WTF::Liveness::LocalCalc::Iterable::iterator::operator!=):
(WTF::Liveness::LocalCalc::Iterable::begin):
(WTF::Liveness::LocalCalc::Iterable::end):
(WTF::Liveness::LocalCalc::Iterable::contains):
(WTF::Liveness::LocalCalc::live):
(WTF::Liveness::LocalCalc::isLive):
(WTF::Liveness::LocalCalc::execute):
(WTF::Liveness::rawLiveAtHead):
(WTF::Liveness::Iterable::Iterable):
(WTF::Liveness::Iterable::iterator::iterator):
(WTF::Liveness::Iterable::iterator::operator*):
(WTF::Liveness::Iterable::iterator::operator++):
(WTF::Liveness::Iterable::iterator::operator==):
(WTF::Liveness::Iterable::iterator::operator!=):
(WTF::Liveness::Iterable::begin):
(WTF::Liveness::Iterable::end):
(WTF::Liveness::Iterable::contains):
(WTF::Liveness::liveAtHead):
(WTF::Liveness::liveAtTail):
(WTF::Liveness::workset):
(WTF::Liveness::LiveAtHead::LiveAtHead):
(WTF::Liveness::LiveAtHead::isLiveAtHead):

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

3 years agoAir::Liveness shouldn't need HashSets
fpizlo@apple.com [Sun, 26 Mar 2017 22:11:13 +0000 (22:11 +0000)]
Air::Liveness shouldn't need HashSets
https://bugs.webkit.org/show_bug.cgi?id=170102

Reviewed by Yusuke Suzuki.
Source/JavaScriptCore:

This converts Air::Liveness<> to no longer use HashSets or BitVectors. This turns out to be
easy because it's cheap enough to do a sorted merge of the things being added to liveAtHead and
the things in the predecessors' liveAtTail. This turns out to be faster - it's a 2% overall
compile time progression on WasmBench.

* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::lower): Add a FIXME unrelated to this patch.
* b3/air/AirLiveness.h:
(JSC::B3::Air::AbstractLiveness::AbstractLiveness):
(JSC::B3::Air::AbstractLiveness::LocalCalc::LocalCalc):
(JSC::B3::Air::AbstractLiveness::rawLiveAtHead):
(JSC::B3::Air::AbstractLiveness::liveAtHead):
(JSC::B3::Air::AbstractLiveness::liveAtTail):
* b3/air/AirTmp.h:
(JSC::B3::Air::Tmp::bank):
(JSC::B3::Air::Tmp::tmpIndex):
* dfg/DFGStoreBarrierClusteringPhase.cpp:

Source/WTF:

* wtf/IndexSparseSet.h: Add some helpers for a HashSet-free liveness analysis.
(WTF::IndexSparseSet::values):
(WTF::IndexSparseSet<OverflowHandler>::sort):
* wtf/StdLibExtras.h:
(WTF::mergeDeduplicatedSorted): Rapidly merge two sorted lists that don't have duplicates to produce a new sorted list that doesn't have duplicates.
* wtf/Vector.h:
(WTF::minCapacity>::uncheckedAppend): Inline this!
(WTF::removeRepeatedElements): This is a version of std::unique() that works naturally for Vectors.

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

3 years agoAir should use RegisterSet for RegLiveness
fpizlo@apple.com [Sun, 26 Mar 2017 21:39:27 +0000 (21:39 +0000)]
Air should use RegisterSet for RegLiveness
https://bugs.webkit.org/show_bug.cgi?id=170108

Reviewed by Yusuke Suzuki.
Source/JavaScriptCore:

The biggest change here is the introduction of the new RegLiveness class. This is a
drop-in replacement for the old RegLiveness, which was a specialization of
AbstractLiveness<>, but it's about 30% faster. It gets its speed boost from just using
sets everywhere, which is efficient for registers since RegisterSet is just two (on
x86-64) or three 32-bit (on ARM64) statically allocated words. This looks like a 1%
compile time progression on WasmBench.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3TimingScope.cpp: Records phase timing totals.
(JSC::B3::TimingScope::TimingScope):
(JSC::B3::TimingScope::~TimingScope):
* b3/B3TimingScope.h:
* b3/air/AirAllocateRegistersByGraphColoring.cpp:
(JSC::B3::Air::allocateRegistersByGraphColoring):
* b3/air/AirLiveness.h: Move code around and rename a bit to make it more like RegLiveness; in particular we want the `iterator` to be called `iterator` not `Iterator`, and we want it to be internal to its iterable. Also rename this template to Liveness, to match the header filename.
(JSC::B3::Air::Liveness::Liveness):
(JSC::B3::Air::Liveness::LocalCalc::LocalCalc):
(JSC::B3::Air::Liveness::LocalCalc::Iterable::Iterable):
(JSC::B3::Air::Liveness::LocalCalc::Iterable::iterator::iterator):
(JSC::B3::Air::Liveness::LocalCalc::Iterable::iterator::operator++):
(JSC::B3::Air::Liveness::LocalCalc::Iterable::iterator::operator*):
(JSC::B3::Air::Liveness::LocalCalc::Iterable::iterator::operator==):
(JSC::B3::Air::Liveness::LocalCalc::Iterable::iterator::operator!=):
(JSC::B3::Air::Liveness::LocalCalc::Iterable::begin):
(JSC::B3::Air::Liveness::LocalCalc::Iterable::end):
(JSC::B3::Air::Liveness::Iterable::Iterable):
(JSC::B3::Air::Liveness::Iterable::iterator::iterator):
(JSC::B3::Air::RegLivenessAdapter::RegLivenessAdapter): Deleted.
(JSC::B3::Air::RegLivenessAdapter::numIndices): Deleted.
(JSC::B3::Air::RegLivenessAdapter::acceptsBank): Deleted.
(JSC::B3::Air::RegLivenessAdapter::acceptsRole): Deleted.
(JSC::B3::Air::RegLivenessAdapter::valueToIndex): Deleted.
(JSC::B3::Air::RegLivenessAdapter::indexToValue): Deleted.
(JSC::B3::Air::AbstractLiveness::AbstractLiveness): Deleted.
(JSC::B3::Air::AbstractLiveness::LocalCalc::LocalCalc): Deleted.
(JSC::B3::Air::AbstractLiveness::LocalCalc::Iterator::Iterator): Deleted.
(JSC::B3::Air::AbstractLiveness::LocalCalc::Iterator::operator++): Deleted.
(JSC::B3::Air::AbstractLiveness::LocalCalc::Iterator::operator*): Deleted.
(JSC::B3::Air::AbstractLiveness::LocalCalc::Iterator::operator==): Deleted.
(JSC::B3::Air::AbstractLiveness::LocalCalc::Iterator::operator!=): Deleted.
(JSC::B3::Air::AbstractLiveness::LocalCalc::Iterable::Iterable): Deleted.
(JSC::B3::Air::AbstractLiveness::LocalCalc::Iterable::begin): Deleted.
(JSC::B3::Air::AbstractLiveness::LocalCalc::Iterable::end): Deleted.
(JSC::B3::Air::AbstractLiveness::LocalCalc::Iterable::contains): Deleted.
(JSC::B3::Air::AbstractLiveness::LocalCalc::live): Deleted.
(JSC::B3::Air::AbstractLiveness::LocalCalc::isLive): Deleted.
(JSC::B3::Air::AbstractLiveness::LocalCalc::execute): Deleted.
(JSC::B3::Air::AbstractLiveness::rawLiveAtHead): Deleted.
(JSC::B3::Air::AbstractLiveness::Iterable::Iterable): Deleted.
(JSC::B3::Air::AbstractLiveness::Iterable::iterator::iterator): Deleted.
(JSC::B3::Air::AbstractLiveness::Iterable::iterator::operator*): Deleted.
(JSC::B3::Air::AbstractLiveness::Iterable::iterator::operator++): Deleted.
(JSC::B3::Air::AbstractLiveness::Iterable::iterator::operator==): Deleted.
(JSC::B3::Air::AbstractLiveness::Iterable::iterator::operator!=): Deleted.
(JSC::B3::Air::AbstractLiveness::Iterable::begin): Deleted.
(JSC::B3::Air::AbstractLiveness::Iterable::end): Deleted.
(JSC::B3::Air::AbstractLiveness::Iterable::contains): Deleted.
(JSC::B3::Air::AbstractLiveness::liveAtHead): Deleted.
(JSC::B3::Air::AbstractLiveness::liveAtTail): Deleted.
(JSC::B3::Air::AbstractLiveness::workset): Deleted.
* b3/air/AirLogRegisterPressure.cpp:
* b3/air/AirLowerAfterRegAlloc.cpp:
* b3/air/AirRegLiveness.cpp: Added.
(JSC::B3::Air::RegLiveness::RegLiveness):
(JSC::B3::Air::RegLiveness::~RegLiveness):
(JSC::B3::Air::RegLiveness::LocalCalc::execute):
* b3/air/AirRegLiveness.h: Added.
(JSC::B3::Air::RegLiveness::LocalCalc::LocalCalc):
(JSC::B3::Air::RegLiveness::LocalCalc::live):
(JSC::B3::Air::RegLiveness::LocalCalc::isLive):
(JSC::B3::Air::RegLiveness::liveAtHead):
(JSC::B3::Air::RegLiveness::liveAtTail):
* b3/air/AirReportUsedRegisters.cpp:
* jit/RegisterSet.h:
(JSC::RegisterSet::add):
(JSC::RegisterSet::remove):
(JSC::RegisterSet::contains):
(JSC::RegisterSet::subsumes):
(JSC::RegisterSet::iterator::iterator):
(JSC::RegisterSet::iterator::operator*):
(JSC::RegisterSet::iterator::operator++):
(JSC::RegisterSet::iterator::operator==):
(JSC::RegisterSet::iterator::operator!=):
(JSC::RegisterSet::begin):
(JSC::RegisterSet::end):

Source/WTF:

* wtf/Atomics.h:
(WTF::ensurePointer): This is a useful replacement for std::once, which requires less fencing.
* wtf/Bitmap.h: Add more utilities.
(WTF::Bitmap::iterator::iterator): An iterator for set bits.
(WTF::Bitmap::iterator::operator*):
(WTF::Bitmap::iterator::operator++):
(WTF::Bitmap::iterator::operator==):
(WTF::Bitmap::iterator::operator!=):
(WTF::Bitmap::begin):
(WTF::Bitmap::end):
(WTF::WordType>::subsumes): a.subsumes(b) if all of b's set bits are set in a.
(WTF::WordType>::findBit): find next set or clear bit.

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

3 years agoREGRESSION(r214195): zillow.com header video doesn't resume when switching to another...
cdumez@apple.com [Sun, 26 Mar 2017 03:52:40 +0000 (03:52 +0000)]
REGRESSION(r214195): zillow.com header video doesn't resume when switching to another tab and back
https://bugs.webkit.org/show_bug.cgi?id=170080
<rdar://problem/31252522>

Reviewed by Eric Carlson.

The video header on zillow.com would pause when switching to another tab after r214195. On
switching back to the zillow.com tab, we would resume the video but fail to take the poster
away, making it look like the video is still paused.

We normally take the poster away when HTMLMediaElement::mediaPlayerFirstVideoFrameAvailable()
is called. However, mediaPlayerFirstVideoFrameAvailable() was only ever called once because of
the m_haveReportedFirstVideoFrame flag in MediaPlayerPrivateAVFoundation::updateStates().
We now reset m_haveReportedFirstVideoFrame to false in updateStates() if hasAvailableVideoFrame()
return false, so that we call mediaPlayerFirstVideoFrameAvailable() again when the return
value of asAvailableVideoFrame() becomes true again (e.g. after the media session interruption
has ended).

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::updateStates):

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

3 years ago[iOS] Use snapshotting instead of printing to draw single-page PDFs
aestes@apple.com [Sun, 26 Mar 2017 00:53:24 +0000 (00:53 +0000)]
[iOS] Use snapshotting instead of printing to draw single-page PDFs
https://bugs.webkit.org/show_bug.cgi?id=170103
<rdar://problem/30542960>

Reviewed by Tim Horton.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::paintSnapshotAtSize): Moved the painting logic from WebPage::snapshotAtSize() to here.
(WebKit::WebPage::snapshotAtSize): Changed to call paintSnapshotAtSize() with the
WebImage's graphics context.
(WebKit::WebPage::pdfSnapshotAtSize): Created a CGPDFGraphicsContext, passed it to
paintSnapshotAtSize(), and returned the context's data.
* WebProcess/WebPage/WebPage.h: Made snapshotAtSize() and snapshotNode() private, changed
their return values from PassRefPtr to RefPtr, and declared pdfSnapshotAtSize().
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::computePagesForPrintingAndDrawToPDF): If snapshotting the first page,
returned a page count of 1 and created a PDF using pdfSnapshotAtSize().

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

3 years agoWeb Inspector: RTL: number scripts are used inconsistently throughout the UI
bburg@apple.com [Sat, 25 Mar 2017 23:08:37 +0000 (23:08 +0000)]
Web Inspector: RTL: number scripts are used inconsistently throughout the UI
https://bugs.webkit.org/show_bug.cgi?id=168290

Reviewed by Joseph Pecoraro.

Original patch by Devin Rousso.

* Localizations/en.lproj/localizedStrings.js: Add new string for FPS bars.
* UserInterface/Base/Utilities.js:
(value.d):
(value):
Localize %d formatted values by default. If that's not desired, then you need to stringify
the number outside of String.format and Number.abbreviate and pass it as %s instead.
Also add a global variable for zwsp (zero-width space) and use it in DataGridNode.

* UserInterface/Views/ConsoleMessageView.js:
(WebInspector.ConsoleMessageView.prototype._renderRepeatCount): Abbreviate the repeat count,
and cause it to be localized.

* UserInterface/Views/DataGridNode.js:
(WebInspector.DataGridNode.prototype.createCellContent):
If we don't know anything about a cell's data other than that it's a number,
run the number through toLocaleString().

* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
Don't localize @%d tags for snapshot objects since this is not done elsewhere in the UI.

* UserInterface/Views/IndexedDatabaseDetailsSidebarPanel.js: Localize integer version number.
(WebInspector.IndexedDatabaseDetailsSidebarPanel.prototype.layout):

* UserInterface/Views/MemoryTimelineView.js:
(WebInspector.MemoryTimelineView.prototype._updateMaxComparisonLegend): Use Number.percentageString().

* UserInterface/Views/RenderingFrameTimelineOverviewGraph.js:
(WebInspector.RenderingFrameTimelineOverviewGraph.prototype._updateDividers.createDividerAtPosition):
(WebInspector.RenderingFrameTimelineOverviewGraph.prototype._updateDividers):
Localize "%d fps" markers.

* UserInterface/Views/TimelineOverview.js:
(WebInspector.TimelineOverview.prototype._viewModeDidChange):
Localize frame label numbers.

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

3 years agoRe-enable the web process' keychain access to fix client certificate authentication
wilander@apple.com [Sat, 25 Mar 2017 21:19:54 +0000 (21:19 +0000)]
Re-enable the web process' keychain access to fix client certificate authentication
https://bugs.webkit.org/show_bug.cgi?id=170074
<rdar://problem/31095987>

Reviewed by Brent Fulgham.

This is a follow-up patch to
https://trac.webkit.org/changeset/214389/webkit
since according to Alexey Proskuryakov, resource
loading has always required identical sandbox
rules in WebContent and Networking processes.

* WebProcess/com.apple.WebProcess.sb.in:
    Reverted remaining change from
    https://trac.webkit.org/changeset/208702/webkit and
    https://trac.webkit.org/changeset/208707/webkit.

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

3 years ago[WK2] Add a UI delegate SPI hook to enable or disable navigation on drop
wenson_hsieh@apple.com [Sat, 25 Mar 2017 20:24:17 +0000 (20:24 +0000)]
[WK2] Add a UI delegate SPI hook to enable or disable navigation on drop
https://bugs.webkit.org/show_bug.cgi?id=169168
<rdar://problem/30688374>

Reviewed by Tim Horton.

Source/WebCore:

Refactor client hooks for the drag destination action in WebCore to ask for the drag destination action mask
upon initializing the DragData. In DragController, rather than setting m_dragDestinationAction to the result of
m_client.actionMaskForDrag, we instead set it to the DragData's destination action.

Tests to come in a future patch.

* loader/EmptyClients.cpp:
* page/DragClient.h:

Rather than pass in a DragData, pass in only the platform data that we need to hand to the delegate. This is
because we now ask for drag destination actions prior to creating the DragData.

* page/DragController.cpp:
(WebCore::DragController::dragEnteredOrUpdated):

Update the available drag destination actions in WebCore using the destination actions stored in DragData rather
than calling out to the client delegate.

* loader/EmptyClients.cpp:
* platform/DragData.cpp:
(WebCore::DragData::DragData):
* platform/DragData.h:
(WebCore::DragData::dragDestinationAction):
(WebCore::DragData::operator =):
* platform/mac/DragDataMac.mm:
(WebCore::DragData::DragData):

Source/WebKit:

See WebKit ChangeLog for more details. Renames WebDefaultUIDelegate.m => WebDefaultUIDelegate.mm.

* WebKit.xcodeproj/project.pbxproj:

Source/WebKit/mac:

Refactors WebDragClient::actionMaskForDrag to take platform data only, rather than the entire DragData. See the
WebCore ChangeLog entry for more details. Also renames WebDefaultUIDelegate.m to WebDefaultUIDelegate.mm, since
we need to import a C++ header for linkedOnOrAfter().

The default delegate implementation of webView:dragDestinationActionMaskForDraggingInfo: now checks if the current
application is linking against 10.12 or earlier, and if so, will allow any drag destination action instead of
the new default value of everything but DragDestinationActionLoad.

* DefaultDelegates/WebDefaultUIDelegate.mm: Renamed from Source/WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.m.
(-[WebDefaultUIDelegate webView:dragDestinationActionMaskForDraggingInfo:]):
* Misc/WebKitVersionChecks.h:
* WebCoreSupport/WebDragClient.h:
* WebCoreSupport/WebDragClient.mm:
(WebDragClient::actionMaskForDrag): Deleted.
* WebView/WebView.mm:
(-[WebView draggingEntered:]):
(-[WebView draggingUpdated:]):

Source/WebKit/win:

Minor tweak to adjust for a changed interface. See WebKit and WebCore ChangeLogs for more information.

* WebCoreSupport/WebDragClient.cpp:
(WebDragClient::actionMaskForDrag):
* WebCoreSupport/WebDragClient.h:

Source/WebKit2:

Support customizing the set of allowed actions on drop in WebKit2 by introducing a new method to WKUIDelegatePrivate
that returns a WKDragDestinationAction given platform dragging info. These flags are then used to initialize the
DragData sent over to the web process, where they update DragController's view of the allowed destination actions.

Moving forward, the default action mask for WKWebViews will include everything except WKDragDestinationActionLoad,
though for applciations linked on or before 10.12, we will still default to WKDragDestinationActionAny to mitigate
any compatibility risk.

* Shared/API/Cocoa/WKDragDestinationAction.h:

Introduce WK2 client-facing versions of WebCore::DragDestinationAction flags.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<DragData>::encode):
(IPC::ArgumentCoder<DragData>::decode):

Serialize DragData's destination actions when sending DragData over IPC.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _web_dragDestinationActionForDraggingInfo:]):

For WKWebView, allow all drag destination actions except for loading (i.e. drop-to-navigate).

* UIProcess/API/mac/WKView.mm:
(-[WKView _web_dragDestinationActionForDraggingInfo:]):

For WKView, allow all types of drag destination actions.

* UIProcess/Cocoa/VersionChecks.h:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::draggingEntered):
(WebKit::WebViewImpl::draggingUpdated):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebDragClient.cpp:
(WebKit::WebDragClient::actionMaskForDrag):
* WebProcess/WebCoreSupport/WebDragClient.h:

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

3 years agoFix wasm by returning after we do TLS.
fpizlo@apple.com [Sat, 25 Mar 2017 19:43:20 +0000 (19:43 +0000)]
Fix wasm by returning after we do TLS.

Rubber stamped by Keith Miller.

* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::storeWasmContext):

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

3 years ago[Bugzilla] Add a checkbox to add self to the CC list when creating or editing an...
ddkilzer@apple.com [Sat, 25 Mar 2017 18:25:47 +0000 (18:25 +0000)]
[Bugzilla] Add a checkbox to add self to the CC list when creating or editing an attachment
<https://webkit.org/b/124047>

Original patch by Csaba Osztrogon√°c.

Reviewed by Daniel Bates.

* template/en/default/attachment/reviewform.html.tmpl:
Add template for "Add me to CC list" by default.  This
adds the reviewer to the CC list whether the "Preview"
or "Publish" button is used.  Only the "Preview" button
allows the checkbox to be unchecked, though.

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

3 years agoAX: Media controls are unlabeled
commit-queue@webkit.org [Sat, 25 Mar 2017 17:45:22 +0000 (17:45 +0000)]
AX: Media controls are unlabeled
https://bugs.webkit.org/show_bug.cgi?id=169947
<rdar://problem/30153323>

Patch by Aaron Chu <aaron_chu@apple.com> on 2017-03-25
Reviewed by Antoine Quint.

Source/WebCore:

Added a "label" property for Icons, which are used to set
the aria-label for the controls in modern media controls.

Test: Addition to all existing modern media controls tests.

* English.lproj/modern-media-controls-localized-strings.js:
* Modules/modern-media-controls/controls/icon-button.js:
(IconButton.prototype.set iconName):
(IconButton.prototype.handleEvent):
(IconButton.prototype._loadImage):
* Modules/modern-media-controls/controls/icon-service.js:
* Modules/modern-media-controls/controls/start-button.js:
(StartButton):
* Modules/modern-media-controls/js-files:

LayoutTests:

* media/modern-media-controls/airplay-button/airplay-button-expected.txt:
* media/modern-media-controls/airplay-button/airplay-button.html:
* media/modern-media-controls/forward-button/forward-button-expected.txt:
* media/modern-media-controls/forward-button/forward-button.html:
* media/modern-media-controls/fullscreen-button/fullscreen-button-expected.txt:
* media/modern-media-controls/fullscreen-button/fullscreen-button.html:
* media/modern-media-controls/icon-button/icon-button-expected.txt:
* media/modern-media-controls/icon-button/icon-button.html:
* media/modern-media-controls/icon-service/icon-service-expected.txt:
* media/modern-media-controls/icon-service/icon-service.html:
* media/modern-media-controls/mute-button/mute-button-expected.txt:
* media/modern-media-controls/mute-button/mute-button.html:
* media/modern-media-controls/pip-button/pip-button-expected.txt:
* media/modern-media-controls/pip-button/pip-button.html:
* media/modern-media-controls/play-pause-button/play-pause-button-expected.txt:
* media/modern-media-controls/play-pause-button/play-pause-button.html:
* media/modern-media-controls/rewind-button/rewind-button-expected.txt:
* media/modern-media-controls/rewind-button/rewind-button.html:
* media/modern-media-controls/skip-back-button/skip-back-button-expected.txt:
* media/modern-media-controls/skip-back-button/skip-back-button.html:
* media/modern-media-controls/start-button/start-button-expected.txt:
* media/modern-media-controls/start-button/start-button.html:
* media/modern-media-controls/tracks-button/tracks-button-expected.txt:
* media/modern-media-controls/tracks-button/tracks-button.html:

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

3 years agowebkitpy: Use generalized device instead of platform specific one
jbedard@apple.com [Sat, 25 Mar 2017 14:44:26 +0000 (14:44 +0000)]
webkitpy: Use generalized device instead of platform specific one
https://bugs.webkit.org/show_bug.cgi?id=170078

Reviewed by Daniel Bates.

SimulatedDevice is re-created each time 'xcrun simctl list' is called.  Device
should remain persistent.  Changing Device to a more explicit interface.
SimulatedDevice no longer inherits from Device and IOSSimulator returns Devices
wrapping SimulatedDevices.

* Scripts/webkitpy/port/device.py: Added.
(Device):
(Device.__init__): Construct with platform device.
(Device.install_app): Install app at app path on platform device.
(Device.launch_app): Launch app with bundle ID on platform device.
(Device.poll): Poll platform device.
(Device.udid): Access platform device UDID.
(Device.__nonzero__): Check if instantiated with a valid platform device.
(Device.__eq__): Compare by udid.
(Device.__ne__): Ditto.
(Device.__repr__): Print out platform_device representation.
* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort.__init__): Initialize the _device_map to an empty dictionary.
(IOSSimulatorPort._device_for_worker_number_map):  Return self._device_map.
(IOSSimulatorPort._create_simulators): Call Simulator.managed_devices directly.
(IOSSimulatorPort._create_devices): Place Simulator.managed_devices into the
device map.
(IOSSimulatorPort._quit_ios_simulator): Reset self._device_map.
* Scripts/webkitpy/xcode/device.py: Removed.
* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDevice):
(SimulatedDevice.__init__): Move host, name and did to SimulatedDevice.
(SimulatedDevice.__eq__): Compare two simulated devices.
(SimulatedDevice.__ne__): Ditto.
(SimulatedDevice.__repr__): Print name and udid.

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

3 years ago[GTK] No value returned from PrintCustomWidgetTest::createWebKitPrintOperation()...
commit-queue@webkit.org [Sat, 25 Mar 2017 08:35:07 +0000 (08:35 +0000)]
[GTK] No value returned from PrintCustomWidgetTest::createWebKitPrintOperation() in TestPrinting.cpp
https://bugs.webkit.org/show_bug.cgi?id=170059

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

* TestWebKitAPI/Tests/WebKit2Gtk/TestPrinting.cpp: Use "void" as return type in the declaration,
the only use of the method in this same file ignores the returned value anyway.

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

3 years ago[XDG] MIMETypeRegistry::getMIMETypeForExtension should return a null/empty string...
carlosgc@webkit.org [Sat, 25 Mar 2017 08:20:57 +0000 (08:20 +0000)]
[XDG] MIMETypeRegistry::getMIMETypeForExtension should return a null/empty string when mime type is unknown
https://bugs.webkit.org/show_bug.cgi?id=170050

Reviewed by Michael Catanzaro.

That's what the callers expect, but we alre always returning XDG_MIME_TYPE_UNKNOWN which is
application/octet-stream.

Fixes: plugins/no-mime-with-valid-extension.html

* platform/xdg/MIMETypeRegistryXdg.cpp:
(WebCore::MIMETypeRegistry::getMIMETypeForExtension):

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

3 years agoUnreviewed GTK+ gardening. Update expectations of several tests.
carlosgc@webkit.org [Sat, 25 Mar 2017 08:19:50 +0000 (08:19 +0000)]
Unreviewed GTK+ gardening. Update expectations of several tests.

* platform/gtk/TestExpectations:

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

3 years agoPost-commit test fix after r214394
mmaxfield@apple.com [Sat, 25 Mar 2017 07:42:46 +0000 (07:42 +0000)]
Post-commit test fix after r214394
https://bugs.webkit.org/show_bug.cgi?id=170083

Unreviewed.

* fast/text/variations/optical-sizing.html:

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

3 years agoAdd font-optical-sizing to CSSComputedStyleDeclaration
mmaxfield@apple.com [Sat, 25 Mar 2017 06:50:18 +0000 (06:50 +0000)]
Add font-optical-sizing to CSSComputedStyleDeclaration
https://bugs.webkit.org/show_bug.cgi?id=170083

Reviewed by Joseph Pecoraro.

Source/WebCore:

Covered by existing tests.

* css/CSSComputedStyleDeclaration.cpp:

LayoutTests:

* fast/css/getComputedStyle/computed-style-expected.txt:
* fast/css/getComputedStyle/computed-style-font-family-expected.txt:
* fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* fast/css/getComputedStyle/resources/property-names.js:
* fast/text/variations/optical-sizing-expected.txt:
* fast/text/variations/optical-sizing.html:
* platform/mac-elcapitan/fast/css/getComputedStyle/computed-style-expected.txt: Added.
* platform/mac-elcapitan/fast/css/getComputedStyle/computed-style-font-family-expected.txt: Added.
* platform/mac-elcapitan/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: Added.

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

3 years agoAdd some instrumentation in Heap::resumeThePeriphery() to help debug an issue.
mark.lam@apple.com [Sat, 25 Mar 2017 05:34:02 +0000 (05:34 +0000)]
Add some instrumentation in Heap::resumeThePeriphery() to help debug an issue.
https://bugs.webkit.org/show_bug.cgi?id=170086
<rdar://problem/31253673>

Reviewed by Saam Barati.

Adding some instrumentation in Heap::resumeThePeriphery() to dump some Heap state
just before we RELEASE_ASSERT_NOT_REACHED.

* heap/Heap.cpp:
(JSC::Heap::resumeThePeriphery):

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

3 years agomedia/restore-from-page-cache.html causes NoEventDispatchAssertion::isEventAllowedInM...
dbates@webkit.org [Sat, 25 Mar 2017 01:13:23 +0000 (01:13 +0000)]
media/restore-from-page-cache.html causes NoEventDispatchAssertion::isEventAllowedInMainThread() assertion failure
https://bugs.webkit.org/show_bug.cgi?id=170087
<rdar://problem/31254822>

Reviewed by Simon Fraser.

Reduce the scope of code that should never dispatch DOM events so as to allow updating contents size
after restoring a page from the page cache.

In r214014 we instantiate a NoEventDispatchAssertion in FrameLoader::commitProvisionalLoad()
around the call to CachedPage::restore() to assert when a DOM event is dispatched during
page restoration as such events can cause re-entrancy into the page cache. As it turns out
it is sufficient to ensure that no DOM events are dispatched after restoring all cached frames
as opposed to after CachedPage::restore() returns.

Also rename Document::enqueue{Pageshow, Popstate}Event() to dispatch{Pageshow, Popstate}Event(),
respectively, since they synchronously dispatch events :(. We hope in the future to make them
asynchronously dispatch events.

* dom/Document.cpp:
(WebCore::Document::implicitClose): Update for renaming.
(WebCore::Document::statePopped): Ditto.
(WebCore::Document::dispatchPageshowEvent): Renamed; formerly named enqueuePageshowEvent().
(WebCore::Document::dispatchPopstateEvent): Renamed; formerly named enqueuePopstateEvent().
(WebCore::Document::enqueuePageshowEvent): Deleted.
(WebCore::Document::enqueuePopstateEvent): Deleted.
* dom/Document.h:
* history/CachedPage.cpp:
(WebCore::firePageShowAndPopStateEvents): Moved logic from FrameLoader::didRestoreFromCachedPage() to here.
(WebCore::CachedPage::restore): Modified to call firePageShowAndPopStateEvents().
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad): Removed use of NoEventDispatchAssertion RAII object. We
will instantiate it in CachedPage::restore() with a smaller scope.
(WebCore::FrameLoader::didRestoreFromCachedPage): Deleted; moved logic from here to WebCore::firePageShowAndPopStateEvents().
* loader/FrameLoader.h:

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

3 years ago[iOS WK2] Move from a pre-commit handler to dispatch_async for visible content rect...
simon.fraser@apple.com [Sat, 25 Mar 2017 01:04:32 +0000 (01:04 +0000)]
[iOS WK2] Move from a pre-commit handler to dispatch_async for visible content rect updates
https://bugs.webkit.org/show_bug.cgi?id=170091
rdar://problem/30682584

Reviewed by Tim Horton.

[CATransaction addCommitHandler:forPhase:] is sometimes not called when running inside another
commit callback (rdar://problem/31253952), and we don't yet have a reliable way to detect this.

So dispatch_async() to postpone the call to [CATransaction addCommitHandler:forPhase:] to a known-
good time.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):

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

3 years agoConsolidate TestExpectations for media/restore-from-page-cache.html.
ryanhaddad@apple.com [Sat, 25 Mar 2017 00:39:20 +0000 (00:39 +0000)]
Consolidate TestExpectations for media/restore-from-page-cache.html.

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoRe-enable the network process' keychain access to fix client certificate authentication
wilander@apple.com [Sat, 25 Mar 2017 00:12:55 +0000 (00:12 +0000)]
Re-enable the network process' keychain access to fix client certificate authentication
https://bugs.webkit.org/show_bug.cgi?id=170074
<rdar://problem/31095987>

Reviewed by Brent Fulgham.

* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
    Reverted remaining change from
    https://trac.webkit.org/changeset/208702/webkit and
    https://trac.webkit.org/changeset/208707/webkit.

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

3 years agoUnreviewed, rolling out r214361.
ryanhaddad@apple.com [Sat, 25 Mar 2017 00:10:06 +0000 (00:10 +0000)]
Unreviewed, rolling out r214361.

This change caused flakiness in http/tests/preload tests.

Reverted changeset:

"Add a warning for unused link preloads."
https://bugs.webkit.org/show_bug.cgi?id=165670
http://trac.webkit.org/changeset/214361

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

3 years agoWeb Inspector: Adding a WebSocket message may change the currently selected resource
nvasilyev@apple.com [Fri, 24 Mar 2017 23:43:56 +0000 (23:43 +0000)]
Web Inspector: Adding a WebSocket message may change the currently selected resource
https://bugs.webkit.org/show_bug.cgi?id=170036
<rdar://problem/31231463>

Reviewed by Joseph Pecoraro.

Calling increaseSize on a resource may cause a WebInspector.TimelineDataGrid#TimelineDataGrid#_refreshDirtyDataGridNodes call.
Make sure _refreshDirtyDataGridNodes preserves selection of a treeElement.

* UserInterface/Views/TimelineDataGrid.js:
(WebInspector.TimelineDataGrid.prototype._refreshDirtyDataGridNodes):
Re-attaching treeElement causes it to lose selection. Select it again after re-attaching.

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

3 years ago[Modern Media Controls] Remove placard icon if height is compressed
graouts@webkit.org [Fri, 24 Mar 2017 23:32:14 +0000 (23:32 +0000)]
[Modern Media Controls] Remove placard icon if height is compressed
https://bugs.webkit.org/show_bug.cgi?id=167935
<rdar://problem/30397128>

Reviewed by Dean Jackson.

Source/WebCore:

We make the addition of certain Placard children conditional on the placard's metrics. Whenever the
media controls metrics changes, the placard, if any, is set to have the same metrics and layout() is
called where we ensure that there is enough space, per designs, to have the icon, description and even
the title visible. We also make some CSS improvements to guarantee that the description is laid out on
two lines at most and that both text labels are trimmed elegantly with an ellipsis shold the width be
insufficient to display the whole text.

Since we would have needed to have more width/height setter overrides to trigger layout, we now make
LayoutNode trigger layout() directly and remove the need for subclasses to do this on a per-class basis.
We also make layout() a method that can be called safely anytime as it's now no longer part of the DOM
commit step, a new commit() method is used instead of that.

Tests: media/modern-media-controls/layout-node/node-made-dirty-during-commit.html
       media/modern-media-controls/media-controls/media-controls-placard-compressed-metrics.html

* Modules/modern-media-controls/controls/layout-node.js:
(LayoutNode.prototype.set width):
(LayoutNode.prototype.set height):
Trigger a call to layout() anytime "width" or "height" is set on any LayoutNode.

(LayoutNode.prototype.layout):
(LayoutNode.prototype.commit):
(performScheduledLayout):
Make layout() an empty method that subclasses can override easily outside of the DOM commit cycle,
its previous implementation is now called "commit()" which is a more accurate name.

* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.get placard):
(MediaControls.prototype.get showsPlacard):
(MediaControls.prototype.showPlacard):
(MediaControls.prototype.hidePlacard):
(MediaControls.prototype.layout):
(MediaControls.prototype.get width): Deleted.
(MediaControls.prototype.set width): Deleted.
Add a "placard" property to make it simpler to reference the placard instead of making assumptions in
several places in that class on the children order. Anytime we run a layout or show the placard, ensure
that the placard metrics are synced with the media controls metrics.

* Modules/modern-media-controls/controls/placard.css:
(.placard .container):
(.placard .title,):
(.placard .description):
We now ensure that both the title and description are trimmed with an ellipsis when we run out of space
to display them fully.

* Modules/modern-media-controls/controls/placard.js:
(Placard.):
(Placard.prototype.layout):
We add new constraints to only show the icon, title and description if the placard is tall and wide enough.

* Modules/modern-media-controls/controls/slider.js:
(Slider.prototype.get width): Deleted.
(Slider.prototype.set width): Deleted.
Removed custom "width" getters and setters now we can just override layout() in case node metrics change.

* Modules/modern-media-controls/controls/time-control.js:
(TimeControl.prototype.set useSixDigitsForTimeLabels):
(TimeControl.prototype.layout):
(TimeControl.prototype.get width): Deleted.
(TimeControl.prototype.set width): Deleted.
(TimeControl.prototype._availableWidthHasChanged): Deleted.
Removed custom "width" getters and setters now we can just override layout() in case node metrics change.

* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
Ensure we flush pending updates at construction time so that we match the size of the media controls right
at the first media layout.

LayoutTests:

We add a new test to check that the various designed constraints to toggle display of a placard's
icon, title and description are honored. Also, due to the old layout() method now being called
"commit()", we refactor a relevant test.

* media/modern-media-controls/layout-node/node-made-dirty-during-commit-expected.txt: Added.
* media/modern-media-controls/layout-node/node-made-dirty-during-commit.html: Added.
* media/modern-media-controls/media-controls/media-controls-placard-compressed-metrics-expected.txt: Added.
* media/modern-media-controls/media-controls/media-controls-placard-compressed-metrics.html: Added.

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

3 years ago[MediaStream] "ideal" constraints passed to getUserMedia should affect fitness score
eric.carlson@apple.com [Fri, 24 Mar 2017 23:27:14 +0000 (23:27 +0000)]
[MediaStream] "ideal" constraints passed to getUserMedia should affect fitness score
https://bugs.webkit.org/show_bug.cgi?id=170056

Reviewed by Youenn Fablet.

Source/WebCore:

Include the fitness score calculated for ideal constraints in the calculation of a capture
overall device fitness score.

No new tests, existing tests updated.

* platform/mediastream/MediaConstraints.cpp:
(WebCore::StringConstraint::fitnessDistance): Drive-by fix: return early if ideal is empty,
not exact.

* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::supportsSizeAndFrameRate): Return fitness distance.
(WebCore::RealtimeMediaSource::selectSettings): Include the fitness distance of supported
ideal constraints.
(WebCore::RealtimeMediaSource::supportsConstraint): New.
(WebCore::RealtimeMediaSource::applyConstraints):
* platform/mediastream/RealtimeMediaSource.h:

* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints): Sort candidate sources
by their fitness score.

* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::initializeCapabilities): Each video source should support
one facing mode, not both.

Source/WebKit2:

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): When
short-circuiting the user prompt because the page is already authorized, return the first
audio and/or video device because so the page gets the one with the best fitness distance.

LayoutTests:

* fast/mediastream/MediaStream-video-element-displays-buffer-expected.txt:
* fast/mediastream/MediaStream-video-element-displays-buffer.html:
* fast/mediastream/MediaStreamTrack-getCapabilities-expected.txt:
* fast/mediastream/apply-constraints-advanced-expected.txt:
* fast/mediastream/apply-constraints-advanced.html:
* fast/mediastream/apply-constraints-video-expected.txt:
* fast/mediastream/apply-constraints-video.html:

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