Timeline



Mar 28, 2017: Today

8:30 AM Changeset in webkit [214474] by jbedard@apple.com
  • 4 edits
    3 copies
    12 adds in trunk/LayoutTests

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.
7:06 AM Changeset in webkit [214473] by jbedard@apple.com
  • 4 edits in trunk/Tools

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.

4:56 AM Changeset in webkit [214472] by yoav@yoav.ws
  • 18 edits
    1 copy
    3 adds in trunk

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.
3:42 AM Changeset in webkit [214471] by commit-queue@webkit.org
  • 5 edits
    2 adds in trunk

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 <Antoine Quint> 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.
2:33 AM Changeset in webkit [214470] by aakash_jain@apple.com
  • 2 edits in trunk/Tools

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.

12:49 AM Changeset in webkit [214469] by commit-queue@webkit.org
  • 3 edits
    2 adds in trunk

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.
12:34 AM Changeset in webkit [214468] by graouts@webkit.org
  • 11 edits
    2 copies
    17 adds in trunk

[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:
12:31 AM Changeset in webkit [214467] by mmaxfield@apple.com
  • 2 edits in trunk/Source/WebCore

Follow-up patch after r214364.
https://bugs.webkit.org/show_bug.cgi?id=168895

Unreviewed.

  • platform/graphics/FontDescription.cpp:

(WebCore::FontDescription::FontDescription):

Mar 27, 2017: Yesterday

11:35 PM Changeset in webkit [214466] by commit-queue@webkit.org
  • 2 edits in trunk/Source/ThirdParty/libwebrtc

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.

11:20 PM Changeset in webkit [214465] by jfbastien@apple.com
  • 2 edits
    1 move in trunk/Source/JavaScriptCore

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.
11:17 PM Changeset in webkit [214464] by webkit@devinrousso.com
  • 2 edits in trunk/Source/WebInspectorUI

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):

10:43 PM Changeset in webkit [214463] by Lucas Forschler
  • 1 edit in trunk/Tools/ChangeLog

Another test v8.

10:30 PM Changeset in webkit [214462] by Lucas Forschler
  • 1 edit in trunk/Tools/ChangeLog

Another test v7.

10:19 PM Changeset in webkit [214461] by Lucas Forschler
  • 1 edit in trunk/Tools/ChangeLog

Another test v6.

9:39 PM Changeset in webkit [214460] by commit-queue@webkit.org
  • 3 edits in trunk/Source/WebKit2

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:
9:08 PM Changeset in webkit [214459] by jfbastien@apple.com
  • 2 edits in trunk/Source/WebKit

make build fix for WebDefaultUIDelegate.m
https://bugs.webkit.org/show_bug.cgi?id=170163

Unreviewed build fix.

  • PlatformMac.cmake: WebDefaultUIDelegate.m was renamed
8:55 PM Changeset in webkit [214458] by Lucas Forschler
  • 1 edit in trunk/Tools/ChangeLog

Another test v5.

8:50 PM Changeset in webkit [214457] by Lucas Forschler
  • 1 edit in trunk/Tools/ChangeLog

Another test v4.

8:41 PM Changeset in webkit [214456] by Lucas Forschler
  • 1 edit in trunk/Tools/ChangeLog

Another test v3.

8:06 PM Changeset in webkit [214455] by wenson_hsieh@apple.com
  • 2 edits in trunk/Source/WebKit2

[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:]):

8:05 PM Changeset in webkit [214454] by Lucas Forschler
  • 1 edit in trunk/Tools/ChangeLog

Another test v2.

8:03 PM Changeset in webkit [214453] by Lucas Forschler
  • 1 edit in trunk/Tools/ChangeLog

Another test.

7:53 PM Changeset in webkit [214452] by Lucas Forschler
  • 1 edit in trunk/Tools/ChangeLog

<rdar://problem/30949128>
Update build.webkit.org to use port 16000 for PBChangeSource.

Reviewed by Alexey Proskuryakov.

  • BuildSlaveSupport/build.webkit.org-config/master.cfg:
7:43 PM Changeset in webkit [214451] by Lucas Forschler
  • 1 edit in trunk/Tools/ChangeLog

Test commit to verify post-commit hook.

7:23 PM Changeset in webkit [214450] by commit-queue@webkit.org
  • 42 edits
    8 adds in trunk

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.
7:06 PM Changeset in webkit [214449] by aestes@apple.com
  • 3 edits in trunk/Source/WebKit2

[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.
7:02 PM Changeset in webkit [214448] by wenson_hsieh@apple.com
  • 2 edits in trunk/Source/WebKit2

[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:
6:48 PM Changeset in webkit [214447] by Lucas Forschler
  • 1 edit in trunk/Tools/ChangeLog

Test commit against new svn server.

6:31 PM Changeset in webkit [214446] by Lucas Forschler
  • 2 edits in trunk/Tools

<rdar://problem/30949128>
Update build.webkit.org to use port 16000 for PBChangeSource.

Reviewed by Alexey Proskuryakov.

  • BuildSlaveSupport/build.webkit.org-config/master.cfg:
5:32 PM Changeset in webkit [214445] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebCore

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):

5:16 PM Changeset in webkit [214444] by krollin@apple.com
  • 2 edits in trunk/Source/WebKit2

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):

5:06 PM Changeset in webkit [214443] by antti@apple.com
  • 10 edits in trunk/Source/WebCore

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):

4:37 PM Changeset in webkit [214442] by commit-queue@webkit.org
  • 5 edits in trunk/Source

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.

4:36 PM Changeset in webkit [214441] by commit-queue@webkit.org
  • 13 edits in trunk

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):

4:32 PM Changeset in webkit [214440] by commit-queue@webkit.org
  • 3 edits in trunk/Source/WebKit2

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.

4:31 PM Changeset in webkit [214439] by webkit@devinrousso.com
  • 12 edits in trunk/Source/WebInspectorUI

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.

4:24 PM Changeset in webkit [214438] by jfbastien@apple.com
  • 4 edits
    2 adds in trunk

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

4:21 PM Changeset in webkit [214437] by Ryan Haddad
  • 1 edit
    3 adds in trunk/LayoutTests

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.
4:19 PM Changeset in webkit [214436] by commit-queue@webkit.org
  • 3 edits in trunk/Source/WebInspectorUI

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.

3:56 PM Changeset in webkit [214435] by antti@apple.com
  • 15 edits
    2 adds in trunk

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.
3:22 PM Changeset in webkit [214434] by jmarcell@apple.com
  • 4 edits in trunk/Tools

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:
3:09 PM Changeset in webkit [214433] by mmaxfield@apple.com
  • 5 edits
    2 adds in trunk

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.
2:49 PM Changeset in webkit [214432] by jbedard@apple.com
  • 3 edits in trunk/Tools

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.

2:42 PM Changeset in webkit [214431] by jbedard@apple.com
  • 2 edits in trunk/Tools

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.

2:32 PM Changeset in webkit [214430] by andersca@apple.com
  • 2 edits in trunk/Source/WebCore

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):

2:20 PM Changeset in webkit [214429] by Ryan Haddad
  • 11 edits
    15 deletes in trunk

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

1:55 PM Changeset in webkit [214428] by andersca@apple.com
  • 2 edits in trunk/Source/WebKit2

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.

12:57 PM Changeset in webkit [214427] by achristensen@apple.com
  • 4 edits in trunk/Source/ThirdParty/libwebrtc

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:
12:44 PM Changeset in webkit [214426] by graouts@webkit.org
  • 5 edits in trunk

[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.
12:40 PM Changeset in webkit [214425] by Ryan Haddad
  • 2 edits in trunk/LayoutTests

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:
12:36 PM Changeset in webkit [214424] by Ryan Haddad
  • 2 edits in trunk/LayoutTests

Mark inspector/dom-debugger/dom-breakpoints.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=170127

Unreviewed test gardening.

  • platform/mac/TestExpectations:
12:16 PM Changeset in webkit [214423] by Ryan Haddad
  • 2 edits in trunk/LayoutTests

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:
12:09 PM Changeset in webkit [214422] by Ryan Haddad
  • 2 edits in trunk/LayoutTests

Marking two modern-media-controls tests as timeouts.
https://bugs.webkit.org/show_bug.cgi?id=170123

Unreviewed test gardening.

  • platform/ios-simulator/TestExpectations:
11:13 AM Changeset in webkit [214421] by commit-queue@webkit.org
  • 10 edits in trunk

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:
11:10 AM Changeset in webkit [214420] by commit-queue@webkit.org
  • 23 edits
    4 adds in trunk

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.
10:50 AM Changeset in webkit [214419] by mmaxfield@apple.com
  • 17 edits in trunk

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:
10:48 AM Changeset in webkit [214418] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebCore

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):

10:21 AM Changeset in webkit [214417] by jbedard@apple.com
  • 2 edits in trunk/Tools

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.

9:39 AM Changeset in webkit [214416] by msaboff@apple.com
  • 3 edits in trunk/Source/JavaScriptCore

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.

9:18 AM Changeset in webkit [214415] by mmaxfield@apple.com
  • 3 edits
    2 adds in trunk

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.
9:12 AM Changeset in webkit [214414] by mmaxfield@apple.com
  • 6 edits
    6 adds in trunk

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):

8:43 AM Changeset in webkit [214413] by achristensen@apple.com
  • 33 edits
    9 adds in trunk

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:
6:38 AM Changeset in webkit [214412] by commit-queue@webkit.org
  • 3 edits in trunk/Source/WebKit2

[GTK] NetscapePluginX11::m_windowID is unused/unneeded
https://bugs.webkit.org/show_bug.cgi?id=170115

Patch by Adrian Perez de Castro <Adrian Perez de Castro> 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.

2:37 AM Changeset in webkit [214411] by commit-queue@webkit.org
  • 11 edits
    2 copies
    17 adds in trunk

[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 <Antoine Quint> 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:

Mar 26, 2017:

9:17 PM Changeset in webkit [214410] by fpizlo@apple.com
  • 11 edits
    4 adds in trunk/Source

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):

3:11 PM Changeset in webkit [214409] by fpizlo@apple.com
  • 11 edits in trunk/Source

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.

2:39 PM Changeset in webkit [214408] by fpizlo@apple.com
  • 14 edits
    2 adds in trunk/Source

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.

Mar 25, 2017:

8:52 PM Changeset in webkit [214407] by Chris Dumez
  • 2 edits in trunk/Source/WebCore

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):

5:53 PM Changeset in webkit [214406] by aestes@apple.com
  • 4 edits in trunk/Source/WebKit2

[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().

4:08 PM Changeset in webkit [214405] by Brian Burg
  • 10 edits in trunk/Source/WebInspectorUI

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.

2:19 PM Changeset in webkit [214404] by wilander@apple.com
  • 2 edits in trunk/Source/WebKit2

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.

1:24 PM Changeset in webkit [214403] by wenson_hsieh@apple.com
  • 29 edits
    1 copy
    1 move in trunk/Source

[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:
12:43 PM Changeset in webkit [214402] by fpizlo@apple.com
  • 2 edits in trunk/Source/JavaScriptCore

Fix wasm by returning after we do TLS.

Rubber stamped by Keith Miller.

  • jit/AssemblyHelpers.h:

(JSC::AssemblyHelpers::storeWasmContext):

11:25 AM Changeset in webkit [214401] by ddkilzer@apple.com
  • 2 edits in trunk/Websites/bugs.webkit.org

[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.

10:45 AM Changeset in webkit [214400] by commit-queue@webkit.org
  • 31 edits in trunk

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:
7:44 AM Changeset in webkit [214399] by jbedard@apple.com
  • 3 edits
    1 move in trunk/Tools

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.

1:35 AM Changeset in webkit [214398] by commit-queue@webkit.org
  • 2 edits in trunk/Tools

[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 <Adrian Perez de Castro> 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.

1:20 AM Changeset in webkit [214397] by Carlos Garcia Campos
  • 2 edits in trunk/Source/WebCore

[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):

1:19 AM Changeset in webkit [214396] by Carlos Garcia Campos
  • 2 edits in trunk/LayoutTests

Unreviewed GTK+ gardening. Update expectations of several tests.

  • platform/gtk/TestExpectations:
12:42 AM Changeset in webkit [214395] by mmaxfield@apple.com
  • 2 edits in trunk/LayoutTests

Post-commit test fix after r214394
https://bugs.webkit.org/show_bug.cgi?id=170083

Unreviewed.

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

Mar 24, 2017:

11:50 PM Changeset in webkit [214394] by mmaxfield@apple.com
  • 9 edits
    3 copies
    1 add in trunk

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.
10:34 PM Changeset in webkit [214393] by mark.lam@apple.com
  • 2 edits in trunk/Source/JavaScriptCore

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):

6:13 PM Changeset in webkit [214392] by dbates@webkit.org
  • 6 edits in trunk/Source/WebCore

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:
6:04 PM Changeset in webkit [214391] by simon.fraser@apple.com
  • 2 edits in trunk/Source/WebKit2

[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:]):

5:39 PM Changeset in webkit [214390] by Ryan Haddad
  • 2 edits in trunk/LayoutTests

Consolidate TestExpectations for media/restore-from-page-cache.html.

Unreviewed test gardening.

  • platform/mac/TestExpectations:
5:12 PM Changeset in webkit [214389] by wilander@apple.com
  • 2 edits in trunk/Source/WebKit2

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.

5:10 PM Changeset in webkit [214388] by Ryan Haddad
  • 15 edits
    2 deletes in trunk

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

4:43 PM Changeset in webkit [214387] by nvasilyev@apple.com
  • 2 edits in trunk/Source/WebInspectorUI

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.

4:32 PM Changeset in webkit [214386] by graouts@webkit.org
  • 9 edits
    2 moves
    2 adds in trunk

[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.
4:27 PM Changeset in webkit [214385] by eric.carlson@apple.com
  • 16 edits in trunk

[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:
4:25 PM Changeset in webkit [214384] by jfbastien@apple.com
  • 22 edits
    3 copies in trunk/Source

WebAssembly: store state in TLS instead of on VM
https://bugs.webkit.org/show_bug.cgi?id=169611

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Using thread-local storage instead of VM makes code more position
independent. We used to store the WebAssembly top Instance (the
latest one in the call stack) on VM, now we instead store it in
TLS. This top Instance is used to access a bunch of state such as
Memory location, size, table (for call_indirect), etc.

Instead of calling it "top", which is confusing, we now just call
it WasmContext.

Making the code PIC means future patches will be able to
postMessage and structured clone into IDB without having to
recompile the code. This wasn't possible before because we
hard-coded the address of VM at compilation time. That doesn't
work between workers, and doesn't work across reloads (which IDB
is intended to do).

It'll also potentially make code faster once we start tuning
what's in TLS, what's in which of the 4 free slots, and what's in
pinned registers. I'm leaving this tuning for later because
there's lower lying fruit for us to pick.

  • CMakeLists.txt:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • assembler/AbstractMacroAssembler.h:
  • assembler/AllowMacroScratchRegisterUsageIf.h: Copied from assembler/AllowMacroScratchRegisterUsage.h.

(JSC::AllowMacroScratchRegisterUsageIf::AllowMacroScratchRegisterUsageIf):
(JSC::AllowMacroScratchRegisterUsageIf::~AllowMacroScratchRegisterUsageIf):

  • assembler/MacroAssembler.h:

(JSC::MacroAssembler::storeToTLSPtr): we previously didn't have
the code required to store to TLS, only to load

  • assembler/MacroAssemblerARM64.h:

(JSC::MacroAssemblerARM64::loadFromTLSPtrNeedsMacroScratchRegister):
(JSC::MacroAssemblerARM64::storeToTLS32):
(JSC::MacroAssemblerARM64::storeToTLS64):
(JSC::MacroAssemblerARM64::storeToTLSPtrNeedsMacroScratchRegister):

  • assembler/MacroAssemblerX86Common.h:

(JSC::MacroAssemblerX86Common::loadFromTLSPtrNeedsMacroScratchRegister):
(JSC::MacroAssemblerX86Common::storeToTLS32):
(JSC::MacroAssemblerX86Common::storeToTLSPtrNeedsMacroScratchRegister):

  • assembler/MacroAssemblerX86_64.h:

(JSC::MacroAssemblerX86_64::loadFromTLS64): was loading 32-bit instead of 64-bit
(JSC::MacroAssemblerX86_64::storeToTLS64):

  • assembler/X86Assembler.h:

(JSC::X86Assembler::movl_rm):
(JSC::X86Assembler::movq_rm):

  • b3/testb3.cpp:

(JSC::B3::testFastTLSLoad):
(JSC::B3::testFastTLSStore):
(JSC::B3::run):

  • jit/AssemblyHelpers.h:

(JSC::AssemblyHelpers::loadWasmContext):
(JSC::AssemblyHelpers::storeWasmContext):
(JSC::AssemblyHelpers::loadWasmContextNeedsMacroScratchRegister):
(JSC::AssemblyHelpers::storeWasmContextNeedsMacroScratchRegister):

  • jit/Repatch.cpp:

(JSC::webAssemblyOwner):

  • jit/ThunkGenerators.cpp:

(JSC::throwExceptionFromWasmThunkGenerator):

  • runtime/Options.h:
  • runtime/VM.cpp:

(JSC::VM::VM):

  • runtime/VM.h:
  • wasm/WasmB3IRGenerator.cpp:

(JSC::Wasm::loadWasmContext):
(JSC::Wasm::storeWasmContext):
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::getMemoryBaseAndSize):
(JSC::Wasm::restoreWebAssemblyGlobalState):
(JSC::Wasm::createJSToWasmWrapper):
(JSC::Wasm::parseAndCompile):

  • wasm/WasmBinding.cpp:

(JSC::Wasm::materializeImportJSCell):
(JSC::Wasm::wasmToJs):
(JSC::Wasm::wasmToWasm):

  • wasm/WasmContext.cpp: Added.

(JSC::loadWasmContext):
(JSC::storeWasmContext):

  • wasm/WasmContext.h: Added. Replaces "top" JSWebAssemblyInstance.
  • wasm/js/WebAssemblyFunction.cpp:

(JSC::callWebAssemblyFunction):

  • wasm/js/WebAssemblyInstanceConstructor.h:

Source/WTF:

  • wtf/FastTLS.h: reserve one key for WebAssembly, delete a bunch

of dead code which clang couldn't compile (it's valid GCC assembly
which LLVM dislikes).

4:16 PM Changeset in webkit [214383] by dino@apple.com
  • 5 edits in trunk

Serialization of custom props in longhand should be "" not value of shorthand
https://bugs.webkit.org/show_bug.cgi?id=167699
<rdar://problem/30324200>

Reviewed by Sam Weinig.

Source/WebCore:

https://www.w3.org/TR/css-variables/#variables-in-shorthands says
"Pending-substitution values must be serialized as the empty string, if
an API allows them to be observed."

We were returning the cssText instead.

Test: fast/css/variables/rule-property-get.html has been updated.

  • css/StyleProperties.cpp:

(WebCore::StyleProperties::getPropertyValue): Return the empty string
if we're a pending substitution value.

LayoutTests:

  • fast/css/variables/rule-property-get-expected.html:
  • fast/css/variables/rule-property-get.html:
4:09 PM Changeset in webkit [214382] by wenson_hsieh@apple.com
  • 2 edits in trunk/Source/WebCore

Unreviewed, fix the ToT build on the latest SDK.

Add deprecated declaration guards around two synchronous UIItemProvider methods in WebItemProviderPasteboard.
<rdar://problem/30451096> tracks adoption of the asynchronous versions of these methods.

  • platform/ios/WebItemProviderPasteboard.mm:

(-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
(-[WebItemProviderPasteboard _tryToCreateAndAppendObjectOfClass:toArray:usingProvider:]):

3:10 PM Changeset in webkit [214381] by graouts@webkit.org
  • 11 edits
    2 adds in trunk

[Modern Media Controls] Captions don't move with the appearance of the inline controls
https://bugs.webkit.org/show_bug.cgi?id=170051
<rdar://problem/30754428>

Reviewed by Dean Jackson.

Source/WebCore:

We now size the captions container to account for the controls bar height when visible. To do this,
we use CSS variables to specify the height of the controls bar in default inline mode, compact inline
mode and fullscreen mode.

Test: media/modern-media-controls/tracks-support/tracks-support-captions-offset-with-controls-bar.html

  • Modules/modern-media-controls/controls/controls-bar.js:

(ControlsBar.prototype.set faded):
Notify the hosting MediaControls that the "faded" property changed.

  • Modules/modern-media-controls/controls/ios-inline-media-controls.css:

(.media-controls.ios.inline > .controls-bar):
Use the new --inline-controls-bar-height CSS variable to specify the inline bar height.

  • Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css:

(.media-controls.mac.inline.compact > .controls-bar):
Use the new --inline-compact-controls-bar-height CSS variable to specify the inline bar height.

  • Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:

(.media-controls.mac.fullscreen > .controls-bar):
Use the new --fullscreen-controls-bar-height CSS variable to specify the inline bar height.

  • Modules/modern-media-controls/controls/macos-inline-media-controls.css:

(.media-controls.mac.inline > .controls-bar):
Use the new --inline-controls-bar-height CSS variable to specify the inline bar height.

  • Modules/modern-media-controls/controls/media-controls.css:

(*):
Specify new CSS variables for the various controls bar heights.

  • Modules/modern-media-controls/controls/media-controls.js:

(MediaControls.prototype.controlsBarFadedStateDidChange):
Notify the delegate of a controls bar "faded" property change.

  • Modules/modern-media-controls/controls/text-tracks.css:

(video::-webkit-media-text-track-container):
(video::-webkit-media-text-track-container.visible-controls-bar):
(video::-webkit-media-text-track-container.visible-controls-bar.compact-controls-bar):
(video::-webkit-media-text-track-display):
Shorten the height of the captions container when the controls bar is visible. We also
fix a couple of prefixed properties that didn't need to be.

  • Modules/modern-media-controls/media/media-controller.js:

(MediaController.prototype.controlsBarFadedStateDidChange):
(MediaController.prototype._updateControlsIfNeeded):
(MediaController.prototype._updateTextTracksClassList):
(MediaController):
Ensure we reflect the "faded" state of the controls bar on the captions container using
a CSS class, as well as whether the controls bar mode is compact.

LayoutTests:

Add a new test, which would have previously failed, where we check that we account for the controls bar height
when showing captions with the controls bar visible.

  • media/modern-media-controls/tracks-support/tracks-support-captions-offset-with-controls-bar-expected.txt: Added.
  • media/modern-media-controls/tracks-support/tracks-support-captions-offset-with-controls-bar.html: Added.
3:09 PM Changeset in webkit [214380] by jfbastien@apple.com
  • 14 edits in trunk/Source/JavaScriptCore

WebAssembly: spec-tests/memory.wast.js fails in debug
https://bugs.webkit.org/show_bug.cgi?id=169794

Reviewed by Keith Miller.

The failure was due to empty memories (with maximum size 0). Those
only occur in tests and in code that's trying to trip us. This
patch adds memory mode "none" which represents no memory. It can
work with either bounds checked or signaling code because it never
contains loads and stores.

The spec tests which were failing did the following:

(module (memory (data)) (func (export "memsize") (result i32) (current_memory)))
(assert_return (invoke "memsize") (i32.const 0))
(module (memory (data "")) (func (export "memsize") (result i32) (current_memory)))
(assert_return (invoke "memsize") (i32.const 0))
(module (memory (data "x")) (func (export "memsize") (result i32) (current_memory)))
(assert_return (invoke "memsize") (i32.const 1))

  • wasm/WasmB3IRGenerator.cpp:

(JSC::Wasm::B3IRGenerator::memoryKind):

  • wasm/WasmMemory.cpp:

(JSC::Wasm::tryGetFastMemory):
(JSC::Wasm::releaseFastMemory):
(JSC::Wasm::Memory::Memory):
(JSC::Wasm::Memory::createImpl):
(JSC::Wasm::Memory::create):
(JSC::Wasm::Memory::grow):
(JSC::Wasm::Memory::makeString):

  • wasm/WasmMemory.h:
  • wasm/WasmMemoryInformation.cpp:

(JSC::Wasm::MemoryInformation::MemoryInformation):

  • wasm/js/JSWebAssemblyCodeBlock.cpp:

(JSC::JSWebAssemblyCodeBlock::isSafeToRun):

  • wasm/js/JSWebAssemblyModule.cpp:

(JSC::JSWebAssemblyModule::codeBlock):
(JSC::JSWebAssemblyModule::finishCreation):

  • wasm/js/JSWebAssemblyModule.h:

(JSC::JSWebAssemblyModule::codeBlock):
(JSC::JSWebAssemblyModule::codeBlockFor):

2:57 PM Changeset in webkit [214379] by simon.fraser@apple.com
  • 4 edits in trunk/Source/WebKit2

Make UI-side compositing on macOS a bit more usable
https://bugs.webkit.org/show_bug.cgi?id=170073

Reviewed by Tim Horton.

Mach port as layer contents doesn't work on macOS, so don't use it there.

Also remove two assertions that hit with UI-side compositing in MiniBrowser.

  • UIProcess/DrawingAreaProxy.cpp:

(WebKit::DrawingAreaProxy::createFence):

  • UIProcess/mac/PageClientImpl.mm:

(WebKit::PageClientImpl::requestScroll):

  • UIProcess/mac/RemoteLayerTreeHost.mm:

(WebKit::RemoteLayerTreeHost::updateLayerTree):

2:46 PM Changeset in webkit [214378] by bfulgham@apple.com
  • 9 edits
    11 copies in trunk

Handle recursive calls to ProcessingInstruction::checkStyleSheet
https://bugs.webkit.org/show_bug.cgi?id=169982
<rdar://problem/31083051>

Reviewed by Antti Koivisto.

Source/WebCore:

See if we triggered a recursive load of the stylesheet during the 'beforeload'
event handler. If so, reset to a valid state before completing the load.

We should also check after 'beforeload' that we were not disconnected from (or
moved to a new) document.

I also looked for other cases of this pattern and fixed them, too.

Tests: fast/dom/beforeload/image-removed-during-before-load.html
fast/dom/beforeload/recursive-css-pi-before-load.html
fast/dom/beforeload/recursive-link-before-load.html
fast/dom/beforeload/recursive-xsl-pi-before-load.html

  • dom/ProcessingInstruction.cpp:

(WebCore::ProcessingInstruction::clearExistingCachedSheet): Added.
(WebCore::ProcessingInstruction::checkStyleSheet): Prevent recursive calls into
this function during 'beforeload' handling. Also, safely handle the case where
the element was disconnected in the 'beforeload' handler (similar to what
we do in HTMLLinkElement).
(WebCore::ProcessingInstruction::setCSSStyleSheet): Drive-by Fix: Protect the
current document to match what we do in setXSLStyleSheet.

  • dom/ProcessingInstruction.h:
  • html/HTMLLinkElement.cpp:

(WebCore::HTMLLinkElement::process): Prevent recursive calls into
this function during 'beforeload' handling.

  • html/HTMLLinkElement.h:
  • loader/ImageLoader.cpp:

(WebCore::ImageLoader::dispatchPendingBeforeLoadEvent): safely handle the case where
the element was disconnected in the 'beforeload' handler (similar to what
we do in HTMLLinkElement).

  • style/StyleScope.cpp:

(WebCore::Style::Scope::hasPendingSheet): Added.

  • style/StyleScope.h:

LayoutTests:

  • fast/dom/beforeload/image-removed-during-before-load-expected.txt: Copied from LayoutTests/fast/dom/beforeload/image-removed-during-before-load-expected.txt.
  • fast/dom/beforeload/image-removed-during-before-load.html: Copied from LayoutTests/fast/dom/beforeload/image-removed-during-before-load.html.
  • fast/dom/beforeload/recursive-css-pi-before-load-expected.txt: Copied from LayoutTests/fast/dom/beforeload/recursive-css-pi-before-load-expected.txt.
  • fast/dom/beforeload/recursive-css-pi-before-load.html: Copied from LayoutTests/fast/dom/beforeload/recursive-css-pi-before-load.html.
  • fast/dom/beforeload/recursive-link-before-load-expected.txt: Copied from LayoutTests/fast/dom/beforeload/recursive-link-before-load-expected.txt.
  • fast/dom/beforeload/recursive-link-before-load.html: Copied from LayoutTests/fast/dom/beforeload/recursive-link-before-load.html.
  • fast/dom/beforeload/recursive-xsl-pi-before-load-expected.txt: Copied from LayoutTests/fast/dom/beforeload/recursive-xsl-pi-before-load-expected.txt.
  • fast/dom/beforeload/recursive-xsl-pi-before-load.html: Copied from LayoutTests/fast/dom/beforeload/recursive-xsl-pi-before-load.html.
  • fast/dom/beforeload/resources/content.xhtml: Copied from LayoutTests/fast/dom/beforeload/resources/content.xhtml.
  • fast/dom/beforeload/resources/pass.css: Copied from LayoutTests/fast/dom/beforeload/resources/pass.css.
  • fast/dom/beforeload/resources/test.xsl: Copied from LayoutTests/fast/dom/beforeload/resources/test.xsl.
2:23 PM Changeset in webkit [214377] by commit-queue@webkit.org
  • 5 edits in trunk/Tools

webkitpy should be able to run API tests
https://bugs.webkit.org/show_bug.cgi?id=170028

Patch by Srinivasan Vijayaraghavan <svijayaraghavan@apple.com> on 2017-03-24
Reviewed by Alexey Proskuryakov.

  • Scripts/webkitpy/common/config/ports.py:

(DeprecatedPort.run_api_tests_command): Added.

  • Scripts/webkitpy/port/base.py:

(Port.api_results_directory): Added.

  • Scripts/webkitpy/tool/steps/runtests.py:

(RunTests.run): Check if we should be running API tests.
(RunTests._run_api_tests): Generate script to run API tests with json output.

  • Scripts/webkitpy/tool/steps/steps_unittest.py: Unit tests.
2:14 PM Changeset in webkit [214376] by achristensen@apple.com
  • 2 edits in trunk/Source/WebKit2

Fix assertions after r214358.
https://bugs.webkit.org/show_bug.cgi?id=169167

  • UIProcess/API/APIContentExtensionStore.cpp:

(API::ContentExtensionStore::compileContentExtension):
AtomicString::init must be called for the first time from the main thread.
We were calling it for the first time from a non-main thread sometimes.
Call it from the main thread before initiating compiling on another thread.

2:13 PM Changeset in webkit [214375] by beidson@apple.com
  • 7 edits
    5 adds in trunk

A null compound index value crashes the Databases process.
<rdar://problem/30499831> and https://bugs.webkit.org/show_bug.cgi?id=170000

Reviewed by Alex Christensen.

Source/WebCore:

Test: storage/indexeddb/modern/single-entry-index-invalid-key-crash.html

  • bindings/js/IDBBindingUtilities.cpp:

(WebCore::createKeyPathArray): Fix the bug by rejecting arrays with any invalid keys in them.

Add some logging:

  • Modules/indexeddb/IDBKeyPath.cpp:

(WebCore::loggingString):

  • Modules/indexeddb/IDBKeyPath.h:
  • Modules/indexeddb/IDBObjectStore.cpp:

(WebCore::IDBObjectStore::createIndex):

  • Modules/indexeddb/shared/IDBIndexInfo.cpp:

(WebCore::IDBIndexInfo::loggingString):

LayoutTests:

  • storage/indexeddb/modern/resources/single-entry-index-invalid-key-crash.js: Added.
  • storage/indexeddb/modern/single-entry-index-invalid-key-crash-expected.txt: Added.
  • storage/indexeddb/modern/single-entry-index-invalid-key-crash-private-expected.txt: Added.
  • storage/indexeddb/modern/single-entry-index-invalid-key-crash-private.html: Added.
  • storage/indexeddb/modern/single-entry-index-invalid-key-crash.html: Added.
1:56 PM Changeset in webkit [214374] by mark.lam@apple.com
  • 3 edits in trunk/Source/JavaScriptCore

Array memcpy'ing fast paths should check if we're having a bad time if they cannot handle it.
https://bugs.webkit.org/show_bug.cgi?id=170064
<rdar://problem/31246098>

Reviewed by Geoffrey Garen.

  • runtime/ArrayPrototype.cpp:

(JSC::arrayProtoPrivateFuncConcatMemcpy):

  • runtime/JSArray.cpp:

(JSC::JSArray::fastSlice):

1:51 PM Changeset in webkit [214373] by Ryan Haddad
  • 2 edits in trunk/LayoutTests

Skip svg/animations/animations-paused-when-inserted-in-hidden-document* tests on ios-simulator.
https://bugs.webkit.org/show_bug.cgi?id=170068

Unreviewed test gardening.

  • platform/ios-simulator/TestExpectations:
1:51 PM Changeset in webkit [214372] by commit-queue@webkit.org
  • 2 edits in trunk/Tools

Add JSON results for API tests
https://bugs.webkit.org/show_bug.cgi?id=170021

Patch by Srinivasan Vijayaraghavan <svijayaraghavan@apple.com> on 2017-03-24
Reviewed by Alexey Proskuryakov.

  • Scripts/run-api-tests:

(runTestsBySuite): Appends failures and timeouts to JSON data.
(writeJsonDataIfApplicable): Writes JSON data to a file.

1:46 PM Changeset in webkit [214371] by webkit@devinrousso.com
  • 4 edits in trunk/Source/WebInspectorUI

Web Inspector: add context menu item to log content of WebSocket frame
https://bugs.webkit.org/show_bug.cgi?id=169945

Reviewed by Joseph Pecoraro.

  • Localizations/en.lproj/localizedStrings.js:
  • UserInterface/Views/WebSocketContentView.js:

(WebInspector.WebSocketContentView):
(WebInspector.WebSocketContentView.prototype.addFrame):
(WebInspector.WebSocketContentView.prototype._addRow):
Rework the way CSS classes are applied so the isOutgoing and isText flags can also be passed
to the WebSocketDataGridNode. This is necessary because a non-text frame shouldn't be able
to be logged to the console.

  • UserInterface/Views/WebSocketDataGridNode.js:

(WebInspector.WebSocketDataGridNode.prototype.appendContextMenuItems):

1:45 PM Changeset in webkit [214370] by Ryan Haddad
  • 3 edits in trunk/Source/WTF

Unreviewed, rolling out r214351.

This change caused API test
WebKit1.DidCreateJavaScriptContextBackForwardCacheTest to
fail.

Reverted changeset:

"Make inactive web processes behave as though under memory
pressure."
https://bugs.webkit.org/show_bug.cgi?id=170042
http://trac.webkit.org/changeset/214351

1:39 PM Changeset in webkit [214369] by Ryan Haddad
  • 10 edits
    11 deletes in trunk

Unreviewed, rolling out r214360.

This change caused 20+ LayoutTest failures.

Reverted changeset:

"Handle recursive calls to
ProcessingInstruction::checkStyleSheet"
https://bugs.webkit.org/show_bug.cgi?id=169982
http://trac.webkit.org/changeset/214360

12:43 PM Changeset in webkit [214368] by commit-queue@webkit.org
  • 4 edits in trunk

Add support for qpSum in WebRTC stats
https://bugs.webkit.org/show_bug.cgi?id=170060

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

Source/WebCore:

  • Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:

(WebCore::fillRTCRTPStreamStats): exposing libwebrtc qpSum value.

LayoutTests:

  • webrtc/video-stats.html:
12:41 PM Changeset in webkit [214367] by Lucas Forschler
  • 2 edits in trunk/Tools

update committer_auth.py to be python 2.7 compliant
https://bugs.webkit.org/show_bug.cgi?id=170063

Reviewed by Alexey Proskuryakov.

  • BuildSlaveSupport/build.webkit.org-config/committer_auth.py:

(CommitterAuth.authenticate):

convert e.message to e.args[0]

12:36 PM Changeset in webkit [214366] by webkit@devinrousso.com
  • 2 edits in trunk/Source/WebInspectorUI

Web Inspector: allow users to click links in inline/user-agent styles
https://bugs.webkit.org/show_bug.cgi?id=170054

Reviewed by Joseph Pecoraro.

  • UserInterface/Views/CSSStyleDeclarationTextEditor.js:

(WebInspector.CSSStyleDeclarationTextEditor.prototype.set style):
(WebInspector.CSSStyleDeclarationTextEditor.prototype._updateJumpToSymbolTrackingMode):
(WebInspector.CSSStyleDeclarationTextEditor.prototype.tokenTrackingControllerHighlightedRangeWasClicked):
(WebInspector.CSSStyleDeclarationTextEditor.prototype.tokenTrackingControllerNewHighlightCandidate):
Always enable the token tracking controller, but only act on hovered/clicked token if it is
a link or the owner style declaration has a source code location (for jumping to the Resource).

12:34 PM Changeset in webkit [214365] by dbates@webkit.org
  • 6 edits
    2 adds in trunk

Prevent new navigations during document unload
https://bugs.webkit.org/show_bug.cgi?id=169934
<rdar://problem/31247584>

Reviewed by Chris Dumez.

Source/WebCore:

Similar to our policy of preventing new navigations from onbeforeunload handlers
we should prevent new navigations that are initiated during the document unload
process.

The significant part of this change is the instantiation of the RAII object NavigationDisabler
in Document::prepareForDestruction(). The rest of this change just renames class
NavigationDisablerForBeforeUnload to NavigationDisabler now that this RAII class is
used to prevent navigation from both onbeforeunload event handlers and when unloading
a document.

Test: fast/frames/frame-unload-navigate-and-setTimeout-assert-fail.html

  • dom/Document.cpp:

(WebCore::Document::prepareForDestruction): Disable new navigations when disconnecting
subframes. Also assert that the document is not in the page cache before we fall off
the end of the function.

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::isNavigationAllowed): Update for renaming below.
(WebCore::FrameLoader::shouldClose): Ditto.

  • loader/NavigationScheduler.cpp:

(WebCore::NavigationScheduler::shouldScheduleNavigation): Ditto.

  • loader/NavigationScheduler.h:

(WebCore::NavigationDisabler::NavigationDisabler): Renamed class; formerly named NavigationDisablerForBeforeUnload.
(WebCore::NavigationDisabler::~NavigationDisabler): Ditto.
(WebCore::NavigationDisabler::isNavigationAllowed): Ditto.
(WebCore::NavigationDisablerForBeforeUnload::NavigationDisablerForBeforeUnload): Deleted.
(WebCore::NavigationDisablerForBeforeUnload::~NavigationDisablerForBeforeUnload): Deleted.
(WebCore::NavigationDisablerForBeforeUnload::isNavigationAllowed): Deleted.

LayoutTests:

Add a test to ensure that we do not cause an assertion fail when calling setTimeout
after starting a navigation from an onunload event handler.

  • fast/frames/frame-unload-navigate-and-setTimeout-assert-fail-expected.txt: Added.
  • fast/frames/frame-unload-navigate-and-setTimeout-assert-fail.html: Added.
12:01 PM Changeset in webkit [214364] by mmaxfield@apple.com
  • 12 edits
    2 adds in trunk

Implement font-optical-sizing
https://bugs.webkit.org/show_bug.cgi?id=168895

Reviewed by Dean Jackson.

Source/WebCore:

Upon advice from Microsoft, the only input to optical sizing is just the
font-size computed value. It is implemented by setting the 'opsz' font
variation axis. Because the propery has such a simple grammar, the
implementation is quite straightforward.

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

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::ComputedStyleExtractor::propertyValue):

  • css/CSSPrimitiveValueMappings.h:

(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator FontOpticalSizing):

  • css/CSSProperties.json:
  • css/parser/CSSParserFastPaths.cpp:

(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):

  • platform/graphics/FontCache.h:

(WebCore::FontDescriptionKey::makeFlagsKey):

  • platform/graphics/FontDescription.h:

(WebCore::FontDescription::opticalSizing):
(WebCore::FontDescription::setOpticalSizing):
(WebCore::FontDescription::operator==):
(WebCore::FontCascadeDescription::initialOpticalSizing):

  • platform/graphics/cocoa/FontCacheCoreText.cpp:

(WebCore::preparePlatformFont):
(WebCore::fontWithFamily):
(WebCore::FontCache::createFontPlatformData):
(WebCore::FontCache::systemFallbackForCharacters):

  • platform/graphics/mac/FontCustomPlatformData.cpp:

(WebCore::FontCustomPlatformData::fontPlatformData):

  • platform/text/TextFlags.h:

LayoutTests:

  • fast/text/variations/optical-sizing-expected.txt: Added.
  • fast/text/variations/optical-sizing.html: Added.
12:01 PM Changeset in webkit [214363] by commit-queue@webkit.org
  • 1 edit
    3 adds in trunk/Tools

webkitpy: Parse JSON results from run-api-tests
https://bugs.webkit.org/show_bug.cgi?id=170062

Patch by Srinivasan Vijayaraghavan <svijayaraghavan@apple.com> on 2017-03-24
Reviewed by Alexey Proskuryakov.

  • Scripts/webkitpy/common/net/apitestresults.py: Added.

(APITestResults): Structure to represent API test results.
(APITestResults.init):
(APITestResults.intersection): Return the failures common to both sets of results.
(APITestResults.results_from_string): Create an APITestResults object from a JSON results string.
(APITestResults.equals): Return True if both results were the same.
(APITestResults.is_subset): Return True if failing tests are a subset of the other failing tests.
(APITestResults.all_passed): Return True if everything passed.
(APITestResults.failing_tests): List of tests that didn't pass.
(APITestResults.did_exceed_test_failure_limit): Always False.

  • Scripts/webkitpy/common/net/apitestresults_unittest.py: Added.

(APITestResultsTest): Unit tests.

  • Scripts/webkitpy/tool/bot/apitestresultsreader.py: Added.

(APITestResultsReader): Read contents of JSON results file.

11:56 AM Changeset in webkit [214362] by Chris Dumez
  • 7 edits
    1 copy in trunk/Source

Unreviewed, rolling out r214329.

Significantly regressed Speedometer

Reverted changeset:

"window.crypto.getRandomValues() uses the insecure RC4 RNG"
https://bugs.webkit.org/show_bug.cgi?id=169623
http://trac.webkit.org/changeset/214329

11:41 AM Changeset in webkit [214361] by yoav@yoav.ws
  • 15 edits
    2 adds in trunk

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

Reviewed by Youenn Fablet.

Source/WebCore:

This patch adds a warning message, to warn developers that are using
link preloads in cases where the downloaded resource is likely to
remain unused.

Test: 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::warnUnusedPreloads): Iterate over m_preloads and issue a warning for non-referenced preloads.
(WebCore::CachedResourceLoader::documentDidFinishLoadEvent): Trigger a timer if preloads weren't cleared at load time.
(WebCore::CachedResourceLoader::warnUnusedPreloads): Triggered by the timer, and called CachedResourceLoader::warnUnusedPreloads.
(WebCore::CachedResourceLoader::stopUnusedPreloadsTimer): Stop the timer.

LayoutTests:

This adds a test for the unused preload warning, and adapts some of the other preload tests,
to avoid warnings.

  • http/tests/preload/download_resources-expected.txt: Changed.
  • http/tests/preload/download_resources.html: Added references to preloaded resources.
  • http/tests/preload/onerrer_event-expected.txt: Changed.
  • http/tests/preload/onerror_event.html: Added references to preloaded resources.
  • http/tests/preload/onload_event.html: Added references to preloaded resources.
  • http/tests/preload/resources/single_download_preload.html: Deflaked.
  • http/tests/preload/unused_preload_warning-expected.txt: Added.
  • http/tests/preload/unused_preload_warning.html: Added.
11:39 AM Changeset in webkit [214360] by bfulgham@apple.com
  • 10 edits
    11 adds in trunk

Handle recursive calls to ProcessingInstruction::checkStyleSheet
https://bugs.webkit.org/show_bug.cgi?id=169982
<rdar://problem/31083051>

Reviewed by Antti Koivisto.

Source/WebCore:

See if we triggered a recursive load of the stylesheet during the 'beforeload'
event handler. If so, reset to a valid state before completing the load.

We should also check after 'beforeload' that we were not disconnected from (or
moved to a new) document.

I also looked for other cases of this pattern and fixed them.

Tests: fast/dom/beforeload/image-removed-during-before-load.html

fast/dom/beforeload/recursive-css-pi-before-load.html
fast/dom/beforeload/recursive-link-before-load.html
fast/dom/beforeload/recursive-xsl-pi-before-load.html

  • dom/ProcessingInstruction.cpp:

(WebCore::ProcessingInstruction::clearExistingCachedSheet): Added.
(WebCore::ProcessingInstruction::checkStyleSheet): Reset to valid state
if necessary after the 'beforeload' handler. Also, safely handle the case where
the element was disconnected in the 'beforeload' handler (similar to what
we do in HTMLLinkElement).
(WebCore::ProcessingInstruction::setCSSStyleSheet): Drive-by Fix: Protect the
current document to match what we do in setXSLStyleSheet.

  • dom/ProcessingInstruction.h:
  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::selectMediaResource): Safely handle the case where
the element was disconnected in the 'beforeload' handler.
(WebCore::HTMLMediaElement::selectNextSourceChild): Ditto.

  • loader/ImageLoader.cpp:

(WebCore::ImageLoader::dispatchPendingBeforeLoadEvent): Ditto.

LayoutTests:

  • fast/dom/beforeload/image-removed-during-before-load-expected.txt: Added.
  • fast/dom/beforeload/image-removed-during-before-load.html: Added.
  • fast/dom/beforeload/recursive-css-pi-before-load-expected.txt: Added.
  • fast/dom/beforeload/recursive-css-pi-before-load.html: Added.
  • fast/dom/beforeload/recursive-link-before-load-expected.txt: Added.
  • fast/dom/beforeload/recursive-link-before-load.html: Added.
  • fast/dom/beforeload/recursive-xsl-pi-before-load-expected.txt: Added.
  • fast/dom/beforeload/recursive-xsl-pi-before-load.html: Added.
  • fast/dom/beforeload/resources/content.xhtml: Added.
  • fast/dom/beforeload/resources/pass.css: Added.
  • fast/dom/beforeload/resources/test.xsl: Added.
11:23 AM Changeset in webkit [214359] by mmaxfield@apple.com
  • 25 edits
    4 adds in trunk

font-style needs a new CSSValue to make CSSRule.cssText work correctly
https://bugs.webkit.org/show_bug.cgi?id=169258

Reviewed by David Hyatt.

Source/WebCore:

With variation fonts, font-style's value can't be captured in a CSSPrimitiveValue (nor any other subclass
off CSSValue) any more. Instead, we need to create two new CSSValues which represent the grammar that font-
style and it's associated @font-face descriptor accept.

The grammar of the font-style property is "normal | italic | oblique [ <<angle>> ]?"
The grammar of the font-style descriptor is "normal | italic | oblique [ <<angle>> | <<angle>> <<angle>> ]?"

We currently still support numbers in place of the <<angle>> value (contrary to the spec). We will remove
this support in https://bugs.webkit.org/show_bug.cgi?id=169357.

Tests: fast/text/font-selection-font-face-parse.html:

fast/text/font-style-parse.html:

  • CMakeLists.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • css/CSSAllInOne.cpp:
  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::fontStyleFromStyle):
(WebCore::fontShorthandValueForSelectionProperties):

  • css/CSSFontFace.cpp:

(WebCore::calculateWeightRange):
(WebCore::calculateStretchRange):
(WebCore::calculateItalicRange):

  • css/CSSFontFaceSet.cpp:

(WebCore::computeFontSelectionRequest):
(WebCore::CSSFontFaceSet::matchingFaces):
(WebCore::calculateWeightValue): Deleted.
(WebCore::calculateStretchValue): Deleted.
(WebCore::calculateStyleValue): Deleted.

  • css/CSSFontFaceSet.h:
  • css/CSSFontSelector.cpp:

(WebCore::CSSFontSelector::addFontFaceRule):

  • css/CSSFontStyleRangeValue.cpp: Added.

(WebCore::CSSFontStyleRangeValue::customCSSText):
(WebCore::CSSFontStyleRangeValue::equals):

  • css/CSSFontStyleRangeValue.h: Added.
  • css/CSSFontStyleValue.cpp: Added.

(WebCore::CSSFontStyleValue::customCSSText):
(WebCore::CSSFontStyleValue::equals):

  • css/CSSFontStyleValue.h: Added.
  • css/CSSFontValue.cpp:

(WebCore::CSSFontValue::customCSSText):

  • css/CSSFontValue.h:
  • css/CSSValue.cpp:

(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):

  • css/CSSValue.h:

(WebCore::CSSValue::isFontStyleValue):
(WebCore::CSSValue::isFontStyleRangeValue):

  • css/FontFace.cpp:

(WebCore::FontFace::style):
(WebCore::FontFace::weight):
(WebCore::FontFace::stretch):

  • css/StyleBuilderConverter.h:

(WebCore::StyleBuilderConverter::convertFontWeightFromValue):
(WebCore::StyleBuilderConverter::convertFontStretchFromValue):
(WebCore::StyleBuilderConverter::convertFontStyleFromValue):
(WebCore::StyleBuilderConverter::convertFontWeight):
(WebCore::StyleBuilderConverter::convertFontStretch):
(WebCore::StyleBuilderConverter::convertFontStyle):

  • css/parser/CSSPropertyParser.cpp:

(WebCore::consumeFontStyle):
(WebCore::consumeFontStyleRange):
(WebCore::CSSPropertyParser::consumeSystemFont):
(WebCore::CSSPropertyParser::consumeFont):

  • svg/SVGFontFaceElement.cpp:

(WebCore::SVGFontFaceElement::parseAttribute):

LayoutTests:

Update tests' expected results.

  • fast/text/font-selection-font-face-parse-expected.txt:
  • fast/text/font-selection-font-face-parse.html:
  • fast/text/font-style-parse-expected.txt:
  • fast/text/font-style-parse.html:
  • platform/mac-elcapitan/fast/text/font-selection-font-face-parse-expected.txt:
  • svg/css/getComputedStyle-basic-expected.txt:
11:17 AM Changeset in webkit [214358] by achristensen@apple.com
  • 5 edits in trunk

REGRESSION: Content Blocker: Blocking "a[href*=randomString]" doesn't work
https://bugs.webkit.org/show_bug.cgi?id=169167

Reviewed by Simon Fraser.

Source/WebCore:

When testing content extensions, we have always called an API function that internally
has called AtomicString::init somewhere before we start compiling the content extension.
On iOS, though, we call [_WKUserContentExtensionStore compileContentExtensionForIdentifier:...]
without having already called anything that calls AtomicString::init. The new CSS parser is now
failing to parse some selectors because CSSSelectorParser::defaultNamespace is returning starAtom,
which is a null atomic string before AtomicString::init is called.

Covered by a new API test.

  • contentextensions/ContentExtensionParser.cpp:

(WebCore::ContentExtensions::isValidCSSSelector):
(WebCore::ContentExtensions::loadAction):
(WebCore::ContentExtensions::isValidSelector): Deleted.

  • contentextensions/ContentExtensionParser.h:

Call AtomicString::init before checking if a css selector is valid.

Tools:

  • TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:

(TestWebKitAPI::TEST_F):
Test an example of a selector that was incorrectly determined to be invalid.

11:01 AM Changeset in webkit [214357] by commit-queue@webkit.org
  • 14 edits
    6 adds in trunk

Add libwebrtc backend support for RTCRtpSender::replaceTrack
https://bugs.webkit.org/show_bug.cgi?id=169841

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

Source/WebCore:

Tests: webrtc/audio-replace-track.html

webrtc/video-replace-track.html

Adding support for replaceTrack for audio and video sources.
Replacing tracks will always succeed for audio sources.
For video tracks, it will only succeed if the video resolution is not greater.
LibWebRTCPeerConnectionBackend will delegate the track replacing by replacing the source of the outgoing sources with the source wrapped in the replacing track.

Video test is not fully passing as size constraints for mock video sources are not providing the right video stream resolution.

  • Modules/mediastream/RTCRtpSender.cpp:

(WebCore::RTCRtpSender::replaceTrack):

  • Modules/mediastream/RTCRtpSender.h:
  • Modules/mediastream/RTCRtpSender.idl:
  • Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:

(WebCore::LibWebRTCPeerConnectionBackend::replaceTrack):

  • Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
  • platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:

(WebCore::RealtimeOutgoingAudioSource::setSource):

  • platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
  • platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:

(WebCore::RealtimeOutgoingVideoSource::setSource):

  • platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
  • platform/mock/MockRealtimeVideoSource.cpp:

(WebCore::MockRealtimeVideoSource::drawText):
(WebCore::MockRealtimeVideoSource::generateFrame):

LayoutTests:

  • webrtc/audio-replace-track-expected.txt: Added.
  • webrtc/audio-replace-track.html: Added.
  • webrtc/video-replace-track-expected.txt: Added.
  • webrtc/video-replace-track.html: Added.
  • webrtc/video-replace-track-to-null-expected.txt: Added.
  • webrtc/video-replace-track-to-null.html: Added.
10:46 AM Changeset in webkit [214356] by jonlee@apple.com
  • 2 edits in trunk/Source/WebCore

Remove comment from RTCStatsReport.idl to convert ssrc to DOMString.
Unreviewed.

Latest available Editor's Draft of WebRTC Statistics API is from 14 December 2016,
but since then, in https://github.com/w3c/webrtc-stats/pull/157, it was changed to become
unsigned long.

  • Modules/mediastream/RTCStatsReport.idl:
10:20 AM Changeset in webkit [214355] by Ryan Haddad
  • 3 edits in trunk/LayoutTests

Update TestExpectations for media/restore-from-page-cache.html.

Unreviewed test gardening.

  • platform/mac-wk2/TestExpectations:
  • platform/mac/TestExpectations:
10:18 AM Changeset in webkit [214354] by webkit@devinrousso.com
  • 12 edits
    1 copy
    1 add in trunk/Source/WebInspectorUI

Web Inspector: Indicate whether a WebSocket connection is open or close
https://bugs.webkit.org/show_bug.cgi?id=168948

Reviewed by Joseph Pecoraro.

  • Localizations/en.lproj/localizedStrings.js:
  • UserInterface/Main.html:

Added WebSocketResourceTreeElement.js and SpanningDataGridNode.js.

  • UserInterface/Views/WebSocketContentView.js:

(WebInspector.WebSocketContentView):
(WebInspector.WebSocketContentView.prototype.shown):
(WebInspector.WebSocketContentView.prototype.hidden):
(WebInspector.WebSocketContentView.prototype._updateState):
Listen to changes in the readyState and add a SpanningDataGridNode when the current state
becomes Closed.

  • UserInterface/Views/WebSocketResourceTreeElement.js: Added.

(WebInspector.WebSocketResourceTreeElement.prototype.onattach):
(WebInspector.WebSocketResourceTreeElement.prototype.ondetach):
(WebInspector.WebSocketResourceTreeElement.prototype._updateConnectionStatus):
Listen to changes in the readyState and add/remove the status element depending on the
current state:

  • Closed: show no status indicator
  • Connecting: show a small circle with a yellow color
  • Open: show a small circle with a green color
  • UserInterface/Views/ResourceTreeElement.css:

(.item.resource.resource-type-websocket .status > div):
(.item.resource.resource-type-websocket:not(.selected) .status .open):
(.tree-outline:not(:focus, .force-focus) .item.resource.resource-type-websocket.selected .status .open):
(body:matches(.window-inactive, .window-docked-inactive) .item.resource.resource-type-websocket.selected .status .open):
(.item.resource.resource-type-websocket:not(.selected) .status .connecting):
(.tree-outline:not(:focus, .force-focus) .item.resource.resource-type-websocket.selected .status .connecting):
(body:matches(.window-inactive, .window-docked-inactive) .item.resource.resource-type-websocket.selected .status .connecting):

  • UserInterface/Views/FrameTreeElement.js:

(WebInspector.FrameTreeElement):
Use WebSocketResourceTreeElement as the constructor for WebSocket resources.

  • UserInterface/Views/SpanningDataGridNode.js: Added.

(WebInspector.SpanningDataGridNode.prototype.createCells):
Creates a single cell that spans all the columns (via CSS colspan) of the parent DataGrid.

  • UserInterface/Views/DataGrid.css:

(.data-grid td.spanning):
Center content of spanning nodes and prevent user interaction.

  • UserInterface/Views/DataGridNode.js:

(WebInspector.DataGridNode.prototype.createCell):
Add additional checks so that a DataGridNode can be created with a column identifier that is
not in the DataGrid. This is used by SpanningGridDataNode, as it shouldn't match one single
column in the DataGrid since it spans them all.

  • UserInterface/Views/GeneralTreeElement.js:

(WebInspector.GeneralTreeElement.prototype.ondetach):

  • UserInterface/Views/BreakpointTreeElement.js:

(WebInspector.BreakpointTreeElement.prototype.ondetach):

  • UserInterface/Views/DOMBreakpointTreeElement.js:

(WebInspector.DOMBreakpointTreeElement.prototype.ondetach):

  • UserInterface/Views/XHRBreakpointTreeElement.js:

(WebInspector.XHRBreakpointTreeElement.prototype.ondetach):
Add ondetach function (with super calls) for future use.

10:11 AM Changeset in webkit [214353] by Carlos Garcia Campos
  • 2 edits in trunk/LayoutTests

Unreviewed GTK+ gardening. Mark webrtc/video-stats.html as failing.

  • platform/gtk/TestExpectations:
10:03 AM Changeset in webkit [214352] by jbedard@apple.com
  • 2 edits in trunk/Tools

Increase timeout for booting simulators.
<rdar://problem/31080009>

Unreviewed infrastructure fix.

  • Scripts/webkitpy/xcode/simulator.py:

(Simulator.wait_until_device_is_booted): Increase timeout.
(Simulator.wait_until_device_is_in_state): Increase timeout.

9:45 AM Changeset in webkit [214351] by akling@apple.com
  • 3 edits in trunk/Source/WTF

Make inactive web processes behave as though under memory pressure.
<https://webkit.org/b/170042>

Reviewed by Antti Koivisto.

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

  • wtf/MemoryPressureHandler.cpp:

(WTF::MemoryPressureHandler::setProcessState):
(WTF::MemoryPressureHandler::isUnderMemoryPressure):

  • wtf/MemoryPressureHandler.h:

(WTF::MemoryPressureHandler::isUnderMemoryPressure): Deleted.

9:32 AM Changeset in webkit [214350] by commit-queue@webkit.org
  • 5 edits
    4 adds in trunk

Add support for DataChannel and MediaStreamTrack stats
https://bugs.webkit.org/show_bug.cgi?id=170031

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

Source/WebCore:

Tests: webrtc/datachannel/datachannel-stats.html

webrtc/video-mediastreamtrack-stats.html

Exposing libwebrtc stats through WebRTC stats API, gathered for data channel and media stream tracks.

  • Modules/mediastream/RTCStatsReport.h:

(WebCore::RTCStatsReport::MediaStreamTrackStats::MediaStreamTrackStats):
(WebCore::RTCStatsReport::DataChannelStats::DataChannelStats):

  • Modules/mediastream/RTCStatsReport.idl:
  • Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:

(WebCore::fillRTCMediaStreamTrackStats):
(WebCore::fillRTCDataChannelStats):
(WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):

LayoutTests:

  • webrtc/datachannel/datachannel-stats-expected.txt: Added.
  • webrtc/datachannel/datachannel-stats.html: Added.
  • webrtc/video-mediastreamtrack-stats-expected.txt: Added.
  • webrtc/video-mediastreamtrack-stats.html: Added.
9:27 AM Changeset in webkit [214349] by Chris Dumez
  • 3 edits in trunk/LayoutTests

Extend svg/animations/animations-paused-disconnected-iframe.html
https://bugs.webkit.org/show_bug.cgi?id=170035

Reviewed by Andreas Kling.

Extend svg/animations/animations-paused-disconnected-iframe.html to cover more things.

  • svg/animations/animations-paused-disconnected-iframe-expected.txt:
  • svg/animations/animations-paused-disconnected-iframe.html:
9:25 AM Changeset in webkit [214348] by commit-queue@webkit.org
  • 3 edits
    2 adds in trunk

Fix framesEncoded/framesDecoded RTC stats
https://bugs.webkit.org/show_bug.cgi?id=170024

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

Source/WebCore:

Test: webrtc/video-stats.html

Adding access to these fields now that they are available.

  • Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:

(WebCore::fillInboundRTPStreamStats):
(WebCore::fillOutboundRTPStreamStats):

LayoutTests:

  • webrtc/video-stats-expected.txt: Added.
  • webrtc/video-stats.html: Added.
7:55 AM Changeset in webkit [214347] by Carlos Garcia Campos
  • 2 edits in trunk/Tools

Unreviewed. Fix GTK+ test /webkit2/WebKitWebView/javascript-dialogs after r214277.

Since r214277 beforeunload events are not fired unless there's some user interaction, so we need to simulate it
in our unit tests to work.

  • TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp:

(testWebViewJavaScriptDialogs):

7:33 AM Changeset in webkit [214346] by Carlos Garcia Campos
  • 2 edits in trunk/Source/WebCore

Unreviewed. Fix GTK+ test /webkit2/WebKitWebView/default-menu after r214244.

Fix mnemonic string of contextMenuItemTagOpenAudioInNewWindow() that I copy pasted from
contextMenuItemTagOpenVideoInNewWindow().

  • platform/LocalizedStrings.cpp:

(WebCore::contextMenuItemTagOpenAudioInNewWindow):

7:30 AM Changeset in webkit [214345] by Yusuke Suzuki
  • 3 edits
    1 add in trunk

[JSC] Use jsNontrivialString agressively for ToString(Int52)
https://bugs.webkit.org/show_bug.cgi?id=170002

Reviewed by Sam Weinig.

JSTests:

  • stress/to-string-int52.js: Added.

(shouldBe):
(toString10):
(expected):

Source/JavaScriptCore:

We use the same logic used for Int32 to use jsNontvirialString.
After single character check, produced string is always longer than 1.
Thus, we can use jsNontrivialString.

  • runtime/NumberPrototype.cpp:

(JSC::int52ToString):

6:59 AM Changeset in webkit [214344] by Carlos Garcia Campos
  • 2 edits in trunk/LayoutTests

Unreviewed GTK+ gardening. Mark media/video-load-require-user-gesture.html as failing after r214338.

  • platform/gtk/TestExpectations:
6:30 AM Changeset in webkit [214343] by Carlos Garcia Campos
  • 2 edits
    3 adds in trunk/LayoutTests

Unreviewed GTK+ gardening. Rebaseline http/tests/inspector/network/fetch-response-body.html/xhr-response-body.html after r214338.

We are now getting the right application/json for a file data.json. The soup network backend tries to gess the
mime type from the extension when sniffing is not allowed and the mime type is not known. See bug
webkit.org/b/168299, that was added actually to fix these tests, but at that time we also failed to guess the
mime type and returned application/octet-stream.

  • platform/gtk/TestExpectations:
  • platform/gtk/http/tests/inspector/network/fetch-response-body-expected.txt: Added.
  • platform/gtk/http/tests/inspector/network/xhr-response-body-expected.txt: Added.
6:22 AM WebKitGTK/2.16.x edited by mcatanzaro@igalia.com
(diff)
6:19 AM Changeset in webkit [214342] by Carlos Garcia Campos
  • 1 edit
    1 add in trunk/LayoutTests

Unreviewed GTK+ gardening. Rebaseline fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download.html after r214338.

We are now getting a MIME type for otf files.

  • platform/gtk/fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download-expected.txt: Added.
5:50 AM Changeset in webkit [214341] by Carlos Garcia Campos
  • 2 edits in trunk/Source/WebCore

[GStreamer] MediaPlayerPrivateGStreamerOwr shouldn't be the default engine
https://bugs.webkit.org/show_bug.cgi?id=170049

Reviewed by Žan Doberšek.

This is causing several media tests to fail after r214338. When trying to load something like this:

http://127.0.0.1:8000/media/resources/serve-video.php?name=../../../../media/content/silence.wav&type=audio/wav&content-length=no&icy-data=yes

since r214338, the content type is known and inferred from the extension in this case, what ends up calling
nextMediaEngine() in MediaPlayer::loadWithNextMediaEngine. That returns the first registered media engine, that
is Owr that doesn't know how to load that and fails.

Fixes: http/tests/media/media-play-stream-chunked-icy.html

http/tests/media/media-seeking-no-ranges-server.html
http/tests/media/video-auth.html
http/tests/media/video-play-stall-before-meta-data.html
http/tests/security/contentSecurityPolicy/audio-redirect-allowed.html
http/tests/security/contentSecurityPolicy/audio-redirect-allowed2.html
http/tests/security/contentSecurityPolicy/audio-redirect-blocked.html
http/tests/security/contentSecurityPolicy/video-redirect-allowed.html
http/tests/security/contentSecurityPolicy/video-redirect-allowed2.html
http/tests/security/contentSecurityPolicy/video-redirect-blocked.html

  • platform/graphics/MediaPlayer.cpp:

(WebCore::buildMediaEnginesVector):

5:01 AM Changeset in webkit [214340] by pvollan@apple.com
  • 6 edits in trunk

Text stroke is sometimes clipped on video captions.
https://bugs.webkit.org/show_bug.cgi?id=170006

Reviewed by Eric Carlson.

Source/WebCore:

Set 'overflow' property to 'visible' on cue element to avoid clipping of text stroke.

Updated test media/track/track-css-stroke-cues.html.

  • html/track/TextTrackCueGeneric.cpp:

(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):

  • html/track/VTTCue.cpp:

(WebCore::VTTCueBox::applyCSSProperties):

LayoutTests:

  • media/track/track-css-stroke-cues-expected.txt:
  • media/track/track-css-stroke-cues.html:
1:26 AM Changeset in webkit [214339] by Carlos Garcia Campos
  • 1 edit
    3 adds in trunk/Source/ThirdParty

Unreviewed. Fix the build after r214338.

Add missing files I forgot to git add again.

  • xdgmime/CMakeLists.txt: Added.
  • xdgmime/README: Added.
  • xdgmime/README.webkit: Added.
1:21 AM Changeset in webkit [214338] by Carlos Garcia Campos
  • 27 edits
    1 move
    1 add in trunk

[GTK] Add MIMETypeRegistry implementation using xdgmime and remove the GTK+ one
https://bugs.webkit.org/show_bug.cgi?id=170001

Reviewed by Michael Catanzaro.

.:

  • Source/CMakeLists.txt: Compile xdgmime if USE_XDGMIME is ON.
  • Source/cmake/OptionsGTK.cmake: Set USE_XDGMIME to ON.

Source/ThirdParty:

Add xdgmime to ThirdParty.

  • xdgmime/CMakeLists.txt: Added.
  • xdgmime/README: Added.
  • xdgmime/README.webkit: Added.
  • xdgmime/src/xdgmime.c: Added.
  • xdgmime/src/xdgmime.h: Added.
  • xdgmime/src/xdgmimealias.c: Added.
  • xdgmime/src/xdgmimealias.h: Added.
  • xdgmime/src/xdgmimecache.c: Added.
  • xdgmime/src/xdgmimecache.h: Added.
  • xdgmime/src/xdgmimeglob.c: Added.
  • xdgmime/src/xdgmimeglob.h: Added.
  • xdgmime/src/xdgmimeicon.c: Added.
  • xdgmime/src/xdgmimeicon.h: Added.
  • xdgmime/src/xdgmimeint.c: Added.
  • xdgmime/src/xdgmimeint.h: Added.
  • xdgmime/src/xdgmimemagic.c: Added.
  • xdgmime/src/xdgmimemagic.h: Added.
  • xdgmime/src/xdgmimeparent.c: Added.
  • xdgmime/src/xdgmimeparent.h: Added.

Source/WebCore:

The XDG implementation could be used by any port where shared-mime-info is expected to be available. It also
improves the current GTK+ implementation that is based on a very small map of mime types and extensions.

  • CMakeLists.txt:
  • PlatformGTK.cmake:
  • platform/xdg/MIMETypeRegistryXdg.cpp: Renamed from Source/WebCore/platform/gtk/MIMETypeRegistryGtk.cpp.

(WebCore::MIMETypeRegistry::getMIMETypeForExtension):
(WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):

Tools:

Ignore style of xdgmime sources.

  • Scripts/webkitpy/tool/steps/checkstyle.py:

LayoutTests:

Remove platform specific expectations of two test because now we do the same as other wk2 ports.

  • platform/gtk/TestExpectations:
1:07 AM Changeset in webkit [214337] by Carlos Garcia Campos
  • 1 edit
    18 adds in trunk/Source/ThirdParty

Unreviewed. Add stubs for xdgmime sources to ThirdParty.

This is in preparation for bug #170001, to try to bypass the SVN hook that doesn't allow to commit source files
containing tabs. I'm committing empty files, so that once those files are known by SVN I can set the
allow-tabs property and then commit the actual contents.

  • xdgmime/src/xdgmime.c: Added.
  • xdgmime/src/xdgmime.h: Added.
  • xdgmime/src/xdgmimealias.c: Added.
  • xdgmime/src/xdgmimealias.h: Added.
  • xdgmime/src/xdgmimecache.c: Added.
  • xdgmime/src/xdgmimecache.h: Added.
  • xdgmime/src/xdgmimeglob.c: Added.
  • xdgmime/src/xdgmimeglob.h: Added.
  • xdgmime/src/xdgmimeicon.c: Added.
  • xdgmime/src/xdgmimeicon.h: Added.
  • xdgmime/src/xdgmimeint.c: Added.
  • xdgmime/src/xdgmimeint.h: Added.
  • xdgmime/src/xdgmimemagic.c: Added.
  • xdgmime/src/xdgmimemagic.h: Added.
  • xdgmime/src/xdgmimeparent.c: Added.
  • xdgmime/src/xdgmimeparent.h: Added.
Note: See TracTimeline for information about the timeline view.