WebKit-https.git
5 weeks agoSQLite database fails to close in SQLiteIDBBackingStore::databaseNameFromFile
sihui_liu@apple.com [Thu, 21 May 2020 18:02:57 +0000 (18:02 +0000)]
SQLite database fails to close in SQLiteIDBBackingStore::databaseNameFromFile
https://bugs.webkit.org/show_bug.cgi?id=212090

Reviewed by Darin Adler.

We should finish SQLite statement before closing database.

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromFile):

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

5 weeks agoAdd an option that exposes functions on the global object to turn on and off the...
sbarati@apple.com [Thu, 21 May 2020 17:44:13 +0000 (17:44 +0000)]
Add an option that exposes functions on the global object to turn on and off the sampling profiler and the super sampler
https://bugs.webkit.org/show_bug.cgi?id=212178

Reviewed by Yusuke Suzuki.

When profiling things like Speedometer inside the browser, it's important to
to only enable the super sampler and the sampling profiler around the code
that you want profiled. Otherwise, you will be profiling things that aren't
relevant to the benchmark score. This patch adds a new option, exposeProfilersOnGlobalObject,
which when true, will expose JS functions on the global object that allow
enabling/disabling the super sampler and the sampling profiler. This way,
we can change the Speedometer source code locally such that these profilers
are only sampling code accounted for in the benchmark score.

* bytecode/SuperSampler.cpp:
(JSC::initializeSuperSampler):
(JSC::enableSuperSampler):
(JSC::disableSuperSampler):
* bytecode/SuperSampler.h:
* jsc.cpp:
(jscmain):
* runtime/JSGlobalObject.cpp:
(JSC::enableSamplingProfiler):
(JSC::disableSamplingProfiler):
(JSC::enableSuperSampler):
(JSC::disableSuperSampler):
(JSC::JSGlobalObject::init):
* runtime/OptionsList.h:

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

5 weeks ago[JSC] Fix 32bit JSBigInt with INT32_MAX < x <= UINT32_MAX
ysuzuki@apple.com [Thu, 21 May 2020 17:21:14 +0000 (17:21 +0000)]
[JSC] Fix 32bit JSBigInt with INT32_MAX < x <= UINT32_MAX
https://bugs.webkit.org/show_bug.cgi?id=212193

Reviewed by Mark Lam.

In 32bit architecture, we are creating one-length JSBigInt for INT32_MIN <= x <= INT32_MAX, and two-length JSBigInt otherwise.
This is wrong since one-length JSBigInt should cover from -UINT32_MAX <= x <= UINT32_MAX.

This patch fixes the bug and cleans up createFrom(VM&, int64_t). And it also adds JSBigInt::createFrom(VM&, uint64_t) in preparation for [1]
Currently, this path is not used while it was used previously because BigIntConstructor starts using JSBigInt::createFrom(VM&, double). But this
will be used in [1], and simply the existing implementation is wrong.

[1]: https://bugs.webkit.org/show_bug.cgi?id=190800

* runtime/JSBigInt.cpp:
(JSC::JSBigInt::createFromImpl):
(JSC::JSBigInt::createFrom):
* runtime/JSBigInt.h:

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

5 weeks agoLayoutTest compositing/video/video-poster.html is a flaky failure
jacob_uphoff@apple.com [Thu, 21 May 2020 17:03:27 +0000 (17:03 +0000)]
LayoutTest compositing/video/video-poster.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=168953

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

5 weeks agoREGRESSION (r261277): [ Mac iOS ] webrtc/datachannel/gather-candidates-networkprocess...
tsavell@apple.com [Thu, 21 May 2020 17:00:55 +0000 (17:00 +0000)]
REGRESSION (r261277): [ Mac iOS ] webrtc/datachannel/gather-candidates-networkprocess-crash.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=212218

Unreviewed test gardening.

* platform/ios/TestExpectations:
* platform/mac/TestExpectations:

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

5 weeks ago[GTK] webaudio/codec-tests/aac/vbr-128kbps-44khz.html is failing
dpino@igalia.com [Thu, 21 May 2020 16:50:02 +0000 (16:50 +0000)]
[GTK] webaudio/codec-tests/aac/vbr-128kbps-44khz.html is failing
https://bugs.webkit.org/show_bug.cgi?id=211770

Unreviewed gardening.

Test just needs to update audio baseline for target platform.

* platform/glib/TestExpectations:
* platform/gtk/webaudio/codec-tests/aac/vbr-128kbps-44khz-expected.wav:

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

5 weeks ago[ iOS & macOS ] media/track/track-cue-missing.html is a flaky failure
jacob_uphoff@apple.com [Thu, 21 May 2020 16:42:57 +0000 (16:42 +0000)]
[ iOS & macOS ] media/track/track-cue-missing.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=212219

Unreviewed test gardening.

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

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

5 weeks ago[ macOS ] REGRESSION: media/video-isplayingtoautomotiveheadunit.html is a flaky failure
jacob_uphoff@apple.com [Thu, 21 May 2020 16:22:09 +0000 (16:22 +0000)]
[ macOS ] REGRESSION: media/video-isplayingtoautomotiveheadunit.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=212215

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

5 weeks agoSome http/tests/in-app-browser-privacy/ tests are timing out or failing
katherine_cheney@apple.com [Thu, 21 May 2020 16:16:41 +0000 (16:16 +0000)]
Some http/tests/in-app-browser-privacy/ tests are timing out or failing
https://bugs.webkit.org/show_bug.cgi?id=212176
<rdar://problem/63452877>

Reviewed by Maciej Stachowiak.

These tests rely on a new network session load for each test resource.
When run in iterations, caching occurs, and the resource does not get
a new network session. This patch adds a random decoration value and
reloads each resource to ensure it is not cached.

* http/tests/in-app-browser-privacy/app-bound-domain-gets-app-bound-session.html:
* http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session.html:
* http/tests/in-app-browser-privacy/non-app-bound-iframe-under-app-bound-domain-is-app-bound.html:

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

5 weeks agoAddress post review comments from Mitz after r262004.
cdumez@apple.com [Thu, 21 May 2020 16:12:41 +0000 (16:12 +0000)]
Address post review comments from Mitz after r262004.

* Shared/mac/AuxiliaryProcessMac.mm:
(WebKit::sandboxDataVaultParentDirectory):

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

5 weeks ago[WK2] WebKit abandons compiled sandbox profiles
cdumez@apple.com [Thu, 21 May 2020 16:08:50 +0000 (16:08 +0000)]
[WK2] WebKit abandons compiled sandbox profiles
https://bugs.webkit.org/show_bug.cgi?id=212177
<rdar://problem/54613619>

Reviewed by Saam Barati.

WebKit generates new compiled sandbox profiles whenever sandbox profiles are updated or
whenever webkit directories change (which is super common for WebKitTestRunner). Previous
compiled sandbox profiles do not get deleted and therefore may accumulate.

To address the issue, we now save compiled sandbox profiles under _CS_DARWIN_USER_TEMP_DIR
instead of _CS_DARWIN_USER_CACHE_DIR. The system takes care of deleting the files under
_CS_DARWIN_USER_TEMP_DIR upon reboot or if they have not been accessed for 3 days.

* Shared/mac/AuxiliaryProcessMac.mm:
(WebKit::sandboxDataVaultParentDirectory):

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

5 weeks agoDispatch pending events only for current page
dougk@apple.com [Thu, 21 May 2020 16:04:12 +0000 (16:04 +0000)]
Dispatch pending events only for current page
https://bugs.webkit.org/show_bug.cgi?id=211975
<rdar://problem/58942759>

Reviewed by Chris Dumez.

Document::implicitClose() should not dispatch events globally. The EventSender class operates as a singleton pattern
for each event queue, so to add some means to restrict which documents are handling events, we can send the current
page pointer and only dispatch the event if the event is for the same page. Other events are simply re-enqueued
to be triggered at a later time.

* dom/Document.cpp:
(WebCore::Document::implicitClose):
* dom/EventSender.h:
(WebCore::EventSender::timerFired):
(WebCore::EventSender<T>::dispatchPendingEvents):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::dispatchPendingLoadEvents):
* html/HTMLLinkElement.h:
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::dispatchPendingLoadEvents):
* html/HTMLStyleElement.h:
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::dispatchPendingBeforeLoadEvents):
(WebCore::ImageLoader::dispatchPendingLoadEvents):
(WebCore::ImageLoader::dispatchPendingErrorEvents):
* loader/ImageLoader.h:
(WebCore::ImageLoader::document):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::append):

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

5 weeks agoUnreviewed, fix the iOS 13.4 build after r261978
wenson_hsieh@apple.com [Thu, 21 May 2020 15:42:19 +0000 (15:42 +0000)]
Unreviewed, fix the iOS 13.4 build after r261978

Source/WebKit:

* Platform/spi/ios/UIKitSPI.h:

Only declare `_UIHoverEventRespondable` if HAVE(UI_HOVER_EVENT_RESPONDABLE) is defined.

* UIProcess/ios/WKMouseGestureRecognizer.mm:

If `_UIHoverEventRespondable` is not present, fall back to declaring internal methods on
`UIHoverGestureRecognizer`.

Source/WTF:

Add a `HAVE()` macro to guard usages of _UIHoverEventRespondable.

* wtf/PlatformHave.h:

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

5 weeks ago[macOS] Scrolling synchronization part 2: Have the scrolling thread detect when the...
simon.fraser@apple.com [Thu, 21 May 2020 15:35:21 +0000 (15:35 +0000)]
[macOS] Scrolling synchronization part 2: Have the scrolling thread detect when the main thread is slow to respond to start a rendering update
https://bugs.webkit.org/show_bug.cgi?id=212175

Reviewed by Tim Horton.

The scrolling thread now detects when a main thread rendering update is taking too long, going into
desynchronized mode when that happens.

However, there's another state that needs to be handled, which is the main thread being busy and
taking too long to start the rendering update. The scrolling thread gets a "displayDidRefresh" ping
and expects that the main thread will get the same ping, and use it to start the rendering update,
but a busy main thread won't respond to this ping promptly.

Detect this with a short-duration (1ms) timer that fires on the scrolling thread; if the timer fires
we go into desynchronized mode until the next update. The timer is canceled if the scrolling thread
receives the willStartRenderingUpdate().

* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::waitForRenderingUpdateCompletionOrTimeout):
(WebCore::ThreadedScrollingTree::scheduleDelayedRenderingUpdateDetectionTimer):
(WebCore::ThreadedScrollingTree::delayedRenderingUpdateDetectionTimerFired):
(WebCore::ThreadedScrollingTree::displayDidRefreshOnScrollingThread):
* page/scrolling/ThreadedScrollingTree.h:

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

5 weeks ago[ConnectionUnix] Set MSG_NOSIGNAL to avoid SIGPIPE
yoshiaki.jitsukawa@sony.com [Thu, 21 May 2020 15:27:19 +0000 (15:27 +0000)]
[ConnectionUnix] Set MSG_NOSIGNAL to avoid SIGPIPE
https://bugs.webkit.org/show_bug.cgi?id=211719

Reviewed by Don Olmstead.

Set MSG_NOSIGNAL to sendmsg()/resvmsg() in order to avoid
SIGPIPE when the other process disappears.
* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::readBytesFromSocket):
(IPC::Connection::sendOutputMessage):

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

5 weeks agoREGRESSION (r253926): webgl/2.0.0/conformance2/buffers/get-buffer-sub-data.html is...
commit-queue@webkit.org [Thu, 21 May 2020 15:26:46 +0000 (15:26 +0000)]
REGRESSION (r253926): webgl/2.0.0/conformance2/buffers/get-buffer-sub-data.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=205667

Patch by Kenneth Russell <kbr@chromium.org> on 2020-05-21
Reviewed by Alexey Proskuryakov.

Remove get-buffer-sub-data.html suppression since it's now passing
reliably.

* TestExpectations:

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

5 weeks agoSource/WebCore:
svillar@igalia.com [Thu, 21 May 2020 14:45:18 +0000 (14:45 +0000)]
Source/WebCore:
[css-grid] [css-flex] Width of table as grid/flex item is infinite when the sum of columns' width exceed 100%
https://bugs.webkit.org/show_bug.cgi?id=191365

Reviewed by Manuel Rego Casasnovas.

Automatic table layout algorithm generates infinite width tables
(tableMaxWidth to be more exact) when the sum of the columns percentages
exceed the 100% value and there is at least one non-percentage based
column with positive width as in those cases it's impossible to fulfill
the table constrains. That should not be done in the case of the table
being a flex or a grid item because they both define new formatting
contexts.

Based on Blink's crrev.com/1095220 by <mstensho@chromium.org>

* rendering/AutoTableLayout.cpp:
(WebCore::shouldScaleColumnsForParent): return false when the table is
either a grid or a flex item.

LayoutTests:
[css-grid] width of table in a grid is incorrect when table cell has width:100%
https://bugs.webkit.org/show_bug.cgi?id=191365

Reviewed by Manuel Rego Casasnovas.

* TestExpectations: Unskipped 3 tests that are now passing.

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

5 weeks ago[WPE] Gardening, update WAV baseline for webaudio test
dpino@igalia.com [Thu, 21 May 2020 14:41:12 +0000 (14:41 +0000)]
[WPE] Gardening, update WAV baseline for webaudio test
https://bugs.webkit.org/show_bug.cgi?id=212212

Unreviewed gardening.

Baseline was updated on r261878 and since then the test started
failing. The test wasn't failing before though. In conclusion, it
seems the update from r261878 wasn't needed for this test.

* platform/wpe/webaudio/codec-tests/mp3/128kbps-44khz-expected.wav:

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

5 weeks ago[ macOS debug ] REGRESSION: fast/layoutformattingcontext/table-basic-row-baseline...
zalan@apple.com [Thu, 21 May 2020 14:28:06 +0000 (14:28 +0000)]
[ macOS debug ] REGRESSION: fast/layoutformattingcontext/table-basic-row-baseline-with-nested-table.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=212139
<rdar://problem/63447683>

Reviewed by Antti Koivisto.

Source/WebCore:

Uninitialized row baseline value caused unexpected cell height in nested tables.

* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::setUsedGeometryForRows):
* layout/tableformatting/TableGrid.h:

LayoutTests:

* platform/mac/TestExpectations:

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

5 weeks agoFurther non-unified build fixes
pmatos@igalia.com [Thu, 21 May 2020 13:58:04 +0000 (13:58 +0000)]
Further non-unified build fixes
https://bugs.webkit.org/show_bug.cgi?id=212195

Reviewed by Adrian Perez de Castro.

* bytecode/InstanceOfStatus.cpp:
* heap/MarkedSpace.cpp:
* runtime/ObjectInitializationScope.cpp:
* runtime/ThrowScope.cpp:

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

5 weeks agoUnreviewed WPE gardening. Enabling a few subdirectories under fast/,
zandobersek@gmail.com [Thu, 21 May 2020 13:19:31 +0000 (13:19 +0000)]
Unreviewed WPE gardening. Enabling a few subdirectories under fast/,
providing the necessary baselines as well as test expectations.

* platform/wpe/TestExpectations:
* platform/wpe/fast/attachment: 8 baselines added.
* platform/wpe/fast/fast-mobile-scrolling: 2 baselines added.
* platform/wpe/fast/scrolling: 2 baselines added.
* platform/wpe/fast/spatial-navigation: 1 baseline added.
* platform/wpe/fast/text: 211 baselines added.

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

6 weeks ago[LFC][TFC] Collapse in-between cell borders
zalan@apple.com [Thu, 21 May 2020 12:33:00 +0000 (12:33 +0000)]
[LFC][TFC] Collapse in-between cell borders
https://bugs.webkit.org/show_bug.cgi?id=212183

Reviewed by Antti Koivisto.

Source/WebCore:

This patch expands border collapsing to in-between cell borders.

Test: fast/layoutformattingcontext/table-simple-border-collapse3.html

* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutCell):
* layout/tableformatting/TableFormattingContext.h:
* layout/tableformatting/TableFormattingContextGeometry.cpp:
(WebCore::Layout::TableFormattingContext::Geometry::computedCellBorder const):
(WebCore::Layout::TableFormattingContext::Geometry::intrinsicWidthConstraintsForCell):

LayoutTests:

* fast/layoutformattingcontext/table-simple-border-collapse3-expected.html: Added.
* fast/layoutformattingcontext/table-simple-border-collapse3.html: Added.

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

6 weeks agoEXT_color_buffer_half_float not exposed on iOS
commit-queue@webkit.org [Thu, 21 May 2020 10:50:54 +0000 (10:50 +0000)]
EXT_color_buffer_half_float not exposed on iOS
https://bugs.webkit.org/show_bug.cgi?id=212181

Patch by Kenneth Russell <kbr@chromium.org> on 2020-05-21
Reviewed by Dean Jackson.

Remove OES_texture_half_float requirement for advertising
EXT_color_buffer_half_float in ANGLE. This is implicit in ES 3.0.

* src/libANGLE/renderer/gl/formatutilsgl.cpp:
(rx::nativegl::BuildInternalFormatInfoMap):

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

6 weeks ago[WPE] Gardening, remove tests passing after 261987
dpino@igalia.com [Thu, 21 May 2020 10:38:47 +0000 (10:38 +0000)]
[WPE] Gardening, remove tests passing after 261987
https://bugs.webkit.org/show_bug.cgi?id=212196

Unreviewed gardening.

* platform/wpe/TestExpectations:

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

6 weeks ago[GTK] Gardening, remove tests passing after r261986
dpino@igalia.com [Thu, 21 May 2020 10:08:57 +0000 (10:08 +0000)]
[GTK] Gardening, remove tests passing after r261986
https://bugs.webkit.org/show_bug.cgi?id=212194

Unreviewed gardening.

* platform/gtk/TestExpectations:

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

6 weeks agoArray.prototype.concat is incorrect with objects whose "length" exceeds 2 ** 32 - 1
shvaikalesh@gmail.com [Thu, 21 May 2020 08:41:21 +0000 (08:41 +0000)]
Array.prototype.concat is incorrect with objects whose "length" exceeds 2 ** 32 - 1
https://bugs.webkit.org/show_bug.cgi?id=212167

Reviewed by Saam Barati.

JSTests:

* stress/array-prototype-concat-of-long-spliced-arrays.js:
* stress/array-prototype-concat-of-long-spliced-arrays2.js:
* test262/expectations.yaml: Mark 4 test cases as passing.

Source/JavaScriptCore:

This patch increases "length" limit of Array.prototype.concat result to @MAX_SAFE_INTEGER
and changes thrown error to TypeError, aligning JSC with the spec [1], V8, and SpiderMonkey.

Also, adds missing @MAX_SAFE_INTEGER overflow check in Array.from [2] (we implement similar
checks in other methods). SunSpider and microbenchmarks/concat-append-one.js are both neutral.

[1]: https://tc39.es/ecma262/#sec-array.prototype.concat (steps 5.c.iii, 5.d.ii)
[2]: https://tc39.es/ecma262/#sec-array.from (step 5.e.i)

* builtins/ArrayConstructor.js:
(from):
* builtins/ArrayPrototype.js:
(globalPrivate.concatSlowPath):

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

6 weeks ago[GStreamer][GTK][WPE] Expose and honor the media content types requiring hardware...
eocanha@igalia.com [Thu, 21 May 2020 07:47:05 +0000 (07:47 +0000)]
[GStreamer][GTK][WPE] Expose and honor the media content types requiring hardware support setting
https://bugs.webkit.org/show_bug.cgi?id=211950

Reviewed by Adrian Perez de Castro.

Source/WebCore:

Provide the needed information about media content types requiring hardware support
when asking the MediaPlayer about what types are supported. This was already being done
from HTMLMediaElement for player selection, but not in MediaSource nor in
MediaSource::addSourceBuffer() when the webpage used the MSE API to check type support.
In order to ask for the mediaContentTypesRequiringHardwareSupport setting we need a
reference to the current Document in all the places where we need to check type support.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::addSourceBuffer): Provide hardware content types extra info.
(WebCore::MediaSource::isTypeSupported): Get hardware content types extra info from
ScriptExecutionContext and provide it to a new refactored private version of
isTypeSupported() which can also be reused from addSourceBuffer().
* Modules/mediasource/MediaSource.h: Changed isTypeSupported() prototype to take
ScriptExecutionContext and added a new overloaded version of the method.
* Modules/mediasource/MediaSource.idl: isTypeSupported() now provides a reference to
ScriptExecutionContext. It's the only way to access the required document settings from a
static method.
* platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::isContentTypeSupported const): Factor ContentType
discrimination logic common to MediaPlayerPrivateGStreamer and
MediaPlayerPrivateGStreamerMSE.
* platform/graphics/gstreamer/GStreamerRegistryScanner.h: Added new method.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::supportsType): Provide hardware content types extra
info when asking for type support.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsType): Ditto.

Source/WebKit:

Expose mediaContentTypesRequiringHardwareSupport as a setting on WPE and WebKitGTK.

* UIProcess/API/glib/WebKitSettings.cpp:
(_WebKitSettingsPrivate::_WebKitSettingsPrivate):
(webKitSettingsSetProperty):
(webKitSettingsGetProperty):
(webkit_settings_class_init):
(webkit_settings_get_media_content_types_requiring_hardware_support):
(webkit_settings_set_media_content_types_requiring_hardware_support):
* UIProcess/API/gtk/WebKitSettings.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/wpe/WebKitSettings.h:
* UIProcess/API/wpe/docs/wpe-1.0-sections.txt:

Tools:

Exercise the new mediaContentTypesRequiringHardwareSupport setting.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp:
(testWebKitSettings):

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

6 weeks ago[macOS] Scrolling synchronization part 1: Have the scrolling thread wait half a frame...
simon.fraser@apple.com [Thu, 21 May 2020 06:47:24 +0000 (06:47 +0000)]
[macOS] Scrolling synchronization part 1: Have the scrolling thread wait half a frame for the main thread to complete the rendering update
https://bugs.webkit.org/show_bug.cgi?id=212168

Reviewed by Tim Horton.

Source/WebCore:

Currently the scrolling thread is a free-running thread that moves layers around in response
to wheel events, and asynchronously posts data about scrolled layers back to the main thread.
That results in an almost guaranteed lack of synchronization between the displayed layer
positions, and the web-exposed values for scroll position (element.scrollTop, window.pageYOffset etc).
This is a frequent source of stuttering or jumpy web content when scrolling.

The first step to fixing this is to synchronize the scrolling thread layer positions
and the main thread state for the case where the main thread is responsive enough to
render once per frame. This is achieved as follow:
    - When the main thread is starting a rendering update, Page::updateRendering() informs
      the scrolling tree via ScrollingCoordinatorMac::willStartRenderingUpdate(). This
      atomically waits for the scrolling thread to take the m_treeMutex (via a BinarySemaphore)
      and starts waiting on the m_stateCondition Condition. Now the main thread pulls the
      state of the scrolling tree via synchronizeStateFromScrollingTree() and uses it for
      the rendering update.
    - If the rendering update finishes within half a frame (8ms), then m_stateCondition
      is released, and the scrolling thread assumes that the main thread is going to
      commit layers rapidly enough to preserve 60fps scrolling.
    - If the rendering update takes too long, m_stateCondition times out, and the scrolling
      thread applies layer positions, triggering a CA commit on that thread.

We no longer apply layer positions directly when handling wheel events.

synchronizeStateFromScrollingTree() has to only pull state from nodes that have moved on the scrolling thread,
so track that via ScrollingTreeScrollingNode::scrolledSinceLastCommit() and adjust the visitor function to
make it available during scrolling tree traversal.

* page/Page.cpp:
(WebCore::Page::updateRendering):
(WebCore::Page::finalizeRenderingUpdate):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::synchronizeStateFromScrollingTree):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::willStartRenderingUpdate):
(WebCore::ScrollingCoordinator::didCompleteRenderingUpdate):
(WebCore::ScrollingCoordinator::synchronizeStateFromScrollingTree): Deleted.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
(WebCore::ScrollingTree::traverseScrollingTreeRecursive):
(WebCore::ScrollingTree::commitTreeState):
(WebCore::ScrollingTree::updateTreeFromStateNodeRecursive):
(WebCore::ScrollingTree::applyLayerPositionsInternal):
(WebCore::ScrollingTree::nominalFramesPerSecond):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeNode.h:
(WebCore::ScrollingTreeNode::didCompleteCommitForNode):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::didCompleteCommitForNode):
(WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::willStartRenderingUpdate):
(WebCore::ThreadedScrollingTree::maxAllowableRenderingUpdateDurationForSynchronization):
(WebCore::ThreadedScrollingTree::waitForRenderingUpdateCompletionOrTimeout):
(WebCore::ThreadedScrollingTree::didCompleteRenderingUpdate):
(WebCore::ThreadedScrollingTree::displayDidRefreshOnScrollingThread):
* page/scrolling/ThreadedScrollingTree.h:
(WebCore::ThreadedScrollingTree::treeMutex):
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::willStartRenderingUpdate):
(WebCore::ScrollingCoordinatorMac::didCompleteRenderingUpdate):

Source/WTF:

Some new trace points for scrolling thread activity.

* wtf/SystemTracing.h:

Tools:

Some new trace points for scrolling thread activity.

* Tracing/SystemTracePoints.plist:

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

6 weeks agoREGRESSION (iOS 13.4.1): SpeechSynthesisUtterance.onend event won't fire on cancel().
cfleizach@apple.com [Thu, 21 May 2020 05:46:51 +0000 (05:46 +0000)]
REGRESSION (iOS 13.4.1): SpeechSynthesisUtterance.onend event won't fire on cancel().
https://bugs.webkit.org/show_bug.cgi?id=211776
<rdar://problem/63130249>

Reviewed by Per Arne Vollan.

With the move to having speech synthesis happen in the client, the cancel case hits a snag.
We cancel the speech job and clear out the current utterance. By the time the cancel callback comes back,
the current utterance is gone and nothing happens.

The fix is to process the speechError event immediately and not wait on the speech synthesizer -- which seems sane,
since we're just cancelling a speech job.

* Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::cancel):

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

6 weeks ago[WinCairo] Unreviewed test gardening
Hironori.Fujii@sony.com [Thu, 21 May 2020 04:16:37 +0000 (04:16 +0000)]
[WinCairo] Unreviewed test gardening

* platform/wincairo/TestExpectations:
* platform/wincairo/css1/text_properties/text_indent-expected.txt:
* platform/wincairo/css2.1/20110323/margin-applies-to-006-expected.txt:
* platform/wincairo/css2.1/t1601-c547-indent-01-d-expected.txt:
* platform/wincairo/editing/selection/mixed-editability-10-expected.txt:
* platform/wincairo/fast/css/font-weight-1-expected.txt:
* platform/wincairo/fast/text/atsui-spacing-features-expected.txt:
* platform/wincairo/fast/text/crash-complex-text-surrogate-expected.txt:
* platform/wincairo/fast/text/hyphenate-limit-lines-expected.txt:
* platform/wincairo/fast/text/international/hindi-whitespace-expected.txt:
* platform/wincairo/fast/text/midword-break-before-surrogate-pair-2-expected.txt:
* platform/wincairo/fast/text/whitespace/pre-break-word-expected.txt:
* platform/wincairo/fast/text/word-break-expected.txt:

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

6 weeks ago[Win] Unreviewed test gardening.
zalan@apple.com [Thu, 21 May 2020 02:54:03 +0000 (02:54 +0000)]
[Win] Unreviewed test gardening.

* platform/win/TestExpectations:

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

6 weeks agoDictation context should be an object identifier, not a type-punned pointer
darin@apple.com [Thu, 21 May 2020 01:59:23 +0000 (01:59 +0000)]
Dictation context should be an object identifier, not a type-punned pointer
https://bugs.webkit.org/show_bug.cgi?id=212174

Reviewed by Anders Carlsson.

Source/WebCore:

* Headers.cmake: Added DictationContext.h.
* Sources.txt: Removed DictationAlternative.cpp.
* WebCore.xcodeproj/project.pbxproj: Added DictationContext.h, removed DictationAlternative.cpp.

* dom/DocumentMarker.h: Use DictationContext instead of uint64_t.
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::timerFired): Ditto.
* editing/AlternativeTextController.h: Ditto.

* editing/DictationAlternative.h: Use DictationContext instead of uint64_t, but also
use CharacterRange rather than two "unsigned" values. Also convert into a simple
struct without constructors; don't really need those.

* editing/DictationAlternative.cpp: Removed.

* editing/DictationCommand.cpp:
(WebCore::DictationCommand::collectDictationAlternativesInRange): Updated for
changes to DictationAlternative.

* editing/DictationContext.h: Added.

* editing/Editor.h: Forward declare DictationAlternative rather than including
its header.

* editing/cocoa/AlternativeTextContextController.h: Use a pair of maps to bind NSTextAlternatives
objects to object identifiers. Remove unnecessary explicit constructor and destructor. Also removed
unnecessary use of WTF_MAKE_FAST_ALLOCATED, since this is only used as a data member of another
class. Removed unused invalidContext constant.
* editing/cocoa/AlternativeTextContextController.mm: Removed the unneeded includes.
This file treats NSTextAlternatives as an opaque Objective-C type and so doesn't need
any details of that class.
(WebCore::AlternativeTextContextController::addAlternatives): Changed to return a
DictationContext and use two maps, using HashMap::ensure to avoid double hashing.
(WebCore::AlternativeTextContextController::alternativesForContext): Added a null check.
(WebCore::AlternativeTextContextController::removeAlternativesForContext): Ditto. Also
updated to remove from both maps.
(WebCore::AlternativeTextContextController::clear): Clear both maps.

* editing/cocoa/AlternativeTextUIController.h: Since this header is used only from Objective-C,
removed use of OBJC_CLASS. Put showAlternatives inside a macOS-specific block. Use DictationContext
instead of uint64_t.
* editing/cocoa/AlternativeTextUIController.mm:
(WebCore::AlternativeTextUIController::addAlternatives): Use DictationContext instead of uint64_t.
(WebCore::AlternativeTextUIController::alternativesForContext): Ditto.
(WebCore::AlternativeTextUIController::showAlternatives): Ditto.
(WebCore::AlternativeTextUIController::handleAcceptedAlternative): Ditto.
(WebCore::AlternativeTextUIController::removeAlternatives): Ditto.

* page/AlternativeTextClient.h: Use DictationContext instead of uint64_t.

Source/WebKit:

* Scripts/webkit/messages.py: Added DictationContext to the list of types that are
not C++ classes.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<DictationAlternative>::encode): Updated for change to
DictationAlternative structure.
(IPC::ArgumentCoder<DictationAlternative>::decode): Ditto.

* UIProcess/Cocoa/PageClientImplCocoa.h: Use DictationContext instead of uint64_t.
* UIProcess/Cocoa/PageClientImplCocoa.mm:
(WebKit::PageClientImplCocoa::addDictationAlternatives): Ditto.
(WebKit::PageClientImplCocoa::removeDictationAlternatives): Ditto.
(WebKit::PageClientImplCocoa::dictationAlternatives): Ditto.
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::insertDictatedTextAsync): Ditto.
* UIProcess/PageClient.h: Ditto.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showDictationAlternativeUI): Ditto.
(WebKit::WebPageProxy::removeDictationAlternatives): Ditto.
(WebKit::WebPageProxy::dictationAlternatives): Ditto.
* UIProcess/WebPageProxy.h: Ditto.
* UIProcess/WebPageProxy.messages.in: Ditto.
* UIProcess/ios/PageClientImplIOS.h: Ditto.
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::showDictationAlternativeUI): Ditto.
* UIProcess/mac/PageClientImplMac.h: Ditto.
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::showDictationAlternativeUI): Ditto.

* UIProcess/mac/WebPageProxyMac.mm: Removed unneeded include of
DictationAlternative.h.

* WebProcess/WebCoreSupport/WebAlternativeTextClient.h: Use DictationContext
instead of uint64_t. Also marked class final and made everything private.
* WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp:
(WebKit::WebAlternativeTextClient::removeDictationAlternatives): Ditto.
(WebKit::WebAlternativeTextClient::showDictationAlternativeUI): Ditto.
(WebKit::WebAlternativeTextClient::dictationAlternatives): Ditto.

Source/WebKitLegacy/mac:

* WebCoreSupport/WebAlternativeTextClient.h: Use DictationContext instead of uint64_t.
* WebCoreSupport/WebAlternativeTextClient.mm:
(WebAlternativeTextClient::removeDictationAlternatives): Ditto.
(WebAlternativeTextClient::showDictationAlternativeUI): Ditto.
(WebAlternativeTextClient::dictationAlternatives): Ditto.

* WebView/WebHTMLView.mm: Added include of DictationAlternative.h, now needed because
it's forward declared in Editor.h.
* WebView/WebView.mm: Ditto.
(-[WebView _getWebCoreDictationAlternatives:fromTextAlternatives:]): Updated for change
to DictationAlternative.
(-[WebView _showDictationAlternativeUI:forDictationContext:]): Use DictationContext
instead of uint64_t.
(-[WebView _removeDictationAlternatives:]): Ditto.
(-[WebView _dictationAlternatives:]): Ditto.
* WebView/WebViewInternal.h: Updated for the above.

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

6 weeks ago[LFC][TFC] Preferred width computation should take border collapsing into account
zalan@apple.com [Thu, 21 May 2020 01:58:33 +0000 (01:58 +0000)]
[LFC][TFC] Preferred width computation should take border collapsing into account
https://bugs.webkit.org/show_bug.cgi?id=212141

Reviewed by Antti Koivisto.

Source/WebCore:

Test: fast/layoutformattingcontext/table-simple-border-collapse2.html

* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns):
* layout/tableformatting/TableFormattingContext.h:
(WebCore::Layout::TableFormattingContext::Geometry::Geometry):
* layout/tableformatting/TableFormattingContextGeometry.cpp:
(WebCore::Layout::TableFormattingContext::Geometry::intrinsicWidthConstraintsForCell):

LayoutTests:

* fast/layoutformattingcontext/table-simple-border-collapse2-expected.html: Added.
* fast/layoutformattingcontext/table-simple-border-collapse2.html: Added.

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

6 weeks agoRepaint issues when the login field collapses on music.apple.com
zalan@apple.com [Thu, 21 May 2020 01:44:12 +0000 (01:44 +0000)]
Repaint issues when the login field collapses on music.apple.com
https://bugs.webkit.org/show_bug.cgi?id=212101
<rdar://problem/62874369>

Reviewed by Simon Fraser.

Source/WebCore:

RenderWidgets (e.g iframe) are painted on integral pixel boundaries. When we issue the repaints on such renderers, we need to
make sure that the repaint rectangles are also snapped to integral pixel values.
Currently trunk only covers the case when the renderer itself is positioned on a subpixel position (e.g when the containing block's content box has a non-integral position value).
This patch ensures that we repaint the RenderWidgets properly when a non-direct ancestor puts the renderer on a subpixel position.

Test: fast/repaint/iframe-on-subpixel-position.html

* page/FrameView.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeVisibleRectInContainer const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::setContentsNeedDisplay):
(WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
* rendering/RenderObject.h:
* testing/Internals.cpp:
(WebCore::Internals::enableSubframeRepaintTracking): add subframe repaint tracking
(WebCore::Internals::disableSubframeRepaintTracking):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* fast/repaint/iframe-on-subpixel-position-expected.txt: Added.
* fast/repaint/iframe-on-subpixel-position.html: Added.

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

6 weeks agoWKMouseGestureRecognizer should be implemented without using UIKit internals
timothy_horton@apple.com [Thu, 21 May 2020 01:19:54 +0000 (01:19 +0000)]
WKMouseGestureRecognizer should be implemented without using UIKit internals
https://bugs.webkit.org/show_bug.cgi?id=212173
<rdar://problem/61163726>

Reviewed by Wenson Hsieh.

Source/WebKit:

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView gestureRecognizer:shouldReceiveTouch:]):
* UIProcess/ios/WKMouseGestureRecognizer.h:
* UIProcess/ios/WKMouseGestureRecognizer.mm:
(-[WKMouseGestureRecognizer _hoverEntered:withEvent:]):
(-[WKMouseGestureRecognizer initWithTarget:action:]): Deleted.
(-[WKMouseGestureRecognizer setView:]): Deleted.
(-[WKMouseGestureRecognizer _wantsHoverEvents]): Deleted.
(-[WKMouseGestureRecognizer canPreventGestureRecognizer:]): Deleted.
(-[WKMouseGestureRecognizer canBePreventedByGestureRecognizer:]): Deleted.
Reimplement WKMouseGestureRecognizer as a UIHoverGestureRecognizer subclass,
so we can decouple ourselves a bit from UIKit internals.

Source/WTF:

* wtf/PlatformHave.h:

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

6 weeks ago[iOS] Fix message filter sandbox violation
pvollan@apple.com [Thu, 21 May 2020 00:52:35 +0000 (00:52 +0000)]
[iOS] Fix message filter sandbox violation
https://bugs.webkit.org/show_bug.cgi?id=212100
<rdar://problem/63407155>

Reviewed by Brent Fulgham.

A message needs to be added to the message filter in the WebContent sandbox on iOS.

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

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

6 weeks agoOES_texture_half_float_linear unavailable on WebGL 1.0 on iOS with ANGLE
dino@apple.com [Thu, 21 May 2020 00:35:02 +0000 (00:35 +0000)]
OES_texture_half_float_linear unavailable on WebGL 1.0 on iOS with ANGLE
https://bugs.webkit.org/show_bug.cgi?id=212170

Patch by Kenneth Russell <kbr@chromium.org> on 2020-05-20
Reviewed by Dean Jackson.

Source/ThirdParty/ANGLE:

Now that FP16 luminance/alpha texture formats are correctly
emulated on ES 3.0, advertise them as filterable.

* src/libANGLE/renderer/gl/formatutilsgl.cpp:
(rx::nativegl::BuildInternalFormatInfoMap):

LayoutTests:

Remove failure expectation for oes-texture-half-float-linear.html
in the WebGL 2.0 conformance suite.

* platform/ios-simulator/webgl/2.0.0/conformance/extensions/oes-texture-half-float-linear-expected.txt: Removed.

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

6 weeks agoOES_texture_float / OES_texture_half_float unavailable in WebGL 1.0 on iOS Simulator...
commit-queue@webkit.org [Thu, 21 May 2020 00:16:47 +0000 (00:16 +0000)]
OES_texture_float / OES_texture_half_float unavailable in WebGL 1.0 on iOS Simulator with ANGLE
https://bugs.webkit.org/show_bug.cgi?id=210524

Patch by Kenneth Russell <kbr@chromium.org> on 2020-05-20
Reviewed by Dean Jackson.

Source/ThirdParty/ANGLE:

Emulate LUMINANCE, ALPHA and LUMINANCE_ALPHA floating-point
textures on top of RED / RG textures when the underlying
OES_texture_float/half_float OpenGL ES extensions are unavailable.

This makes the conformance/extensions/oes-texture{-half}-float*
tests run and pass in the iOS Simulator.

This change is being reviewed upstream in the ANGLE repository and
is only being uploaded here for testing purposes. It will be
rolled in with the next ANGLE update.

* src/libANGLE/renderer/gl/TextureGL.cpp:
(rx::TextureGL::setSwizzle):
* src/libANGLE/renderer/gl/formatutilsgl.cpp:
(rx::nativegl::BuildInternalFormatInfoMap):
(rx::nativegl::IsLUMAFormat):
(rx::nativegl::EmulateLUMAFormat):
(rx::nativegl::EmulateLUMA):
(rx::nativegl::GetNativeInternalFormat):
(rx::nativegl::GetNativeFormat):
(rx::nativegl::GetNativeType):
(rx::nativegl::GetTexImageFormat):
(rx::nativegl::GetTexSubImageFormat):

LayoutTests:

Remove expected failure for
webgl/2.0.0/conformance/extensions/oes-texture-float-expected.txt
on ios-simulator. Enable
fast/canvas/webgl/oes-texture-half-float-uint16.html on iOS.

* platform/ios-simulator/webgl/2.0.0/conformance/extensions/oes-texture-float-expected.txt: Removed.
* platform/ios/TestExpectations:

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

6 weeks agoComputed min-width/height for auto depends on box
obrufau@igalia.com [Thu, 21 May 2020 00:12:45 +0000 (00:12 +0000)]
Computed min-width/height for auto depends on box
https://bugs.webkit.org/show_bug.cgi?id=209651

Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

Update test expectations.

* web-platform-tests/css/css-flexbox/getcomputedstyle/flexbox_computedstyle_min-auto-size-expected.txt:
* web-platform-tests/css/css-grid/grid-items/grid-item-min-auto-size-001-expected.txt:

Source/WebCore:

Resolved value of min-width and min-height for auto min sizing of flex
and grid items may be 'auto'. We based this on the computed style of the
shadow including parent. Instead we should rely on whether the element
will actually be a rendered flex/grid item.

The difference matters e.g. when the parent has 'display: contents' and
thus is not a flex nor grid container, but the element can still be a
flex or grid item, depending on the grand-parent.

This patch is based on https://crrev.com/540901 from Chromium.

Tests: imported/w3c/web-platform-tests/css/css-flexbox/getcomputedstyle/flexbox_computedstyle_min-auto-size.html
       imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-min-auto-size-001.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::isFlexOrGridItem):
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):

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

6 weeks ago(r261946) [ iOS ] fast/frames/didBecomeCurrentDocumentInFrame-crash.html is failing
cdumez@apple.com [Thu, 21 May 2020 00:02:31 +0000 (00:02 +0000)]
(r261946) [ iOS ] fast/frames/didBecomeCurrentDocumentInFrame-crash.html is failing
https://bugs.webkit.org/show_bug.cgi?id=212179
<rdar://problem/63469486>

Unreviewed, add testRunner.dumpAsText() call in the test to get nicer expected
result.

* fast/frames/didBecomeCurrentDocumentInFrame-crash-expected.txt:
* fast/frames/didBecomeCurrentDocumentInFrame-crash.html:
* platform/win/fast/frames/didBecomeCurrentDocumentInFrame-crash-expected.txt: Removed.

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

6 weeks ago[iOS] Layout tests in editing/pasteboard sporadically crash
wenson_hsieh@apple.com [Wed, 20 May 2020 23:42:20 +0000 (23:42 +0000)]
[iOS] Layout tests in editing/pasteboard sporadically crash
https://bugs.webkit.org/show_bug.cgi?id=212169
<rdar://problem/63361966>

Reviewed by Tim Horton.

Add some missing entitlements.

* TestWebKitAPI/Configurations/TestWebKitAPI-iOS.entitlements:
* WebKitTestRunner/Configurations/WebKitTestRunnerApp-iOS.entitlements:

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

6 weeks agoDisable support for BeforeLoadEvent
ryanhaddad@apple.com [Wed, 20 May 2020 23:38:32 +0000 (23:38 +0000)]
Disable support for BeforeLoadEvent
https://bugs.webkit.org/show_bug.cgi?id=212140

Unreviewed test gardening.

Update baselines for Windows.

* platform/win/fast/events/event-attribute-expected.txt:
* platform/win/fast/frames/didBecomeCurrentDocumentInFrame-crash-expected.txt: Added.

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

6 weeks ago[macOS] Tests in fast/events and fast/forms are no longer crashing
mmaxfield@apple.com [Wed, 20 May 2020 23:34:50 +0000 (23:34 +0000)]
[macOS] Tests in fast/events and fast/forms are no longer crashing
https://bugs.webkit.org/show_bug.cgi?id=212164
<rdar://problem/33522420>

Unreviewed.

* platform/mac-wk1/TestExpectations:

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

6 weeks agoplatform/mac/media/media-source/media-source-change-source.html is a flaky failure
ryanhaddad@apple.com [Wed, 20 May 2020 23:30:34 +0000 (23:30 +0000)]
platform/mac/media/media-source/media-source-change-source.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=212091

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations: Mark test as flaky.

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

6 weeks agoRemove implicit URL->String conversion operators
commit-queue@webkit.org [Wed, 20 May 2020 22:59:51 +0000 (22:59 +0000)]
Remove implicit URL->String conversion operators
https://bugs.webkit.org/show_bug.cgi?id=211033

Patch by Alex Christensen <achristensen@webkit.org> on 2020-05-20
Reviewed by Darin Adler.

Source/WebCore:

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::stringValueForMSAA const):
* html/DOMURL.cpp:
(WebCore::DOMURL::create):
* html/HTMLPlugInElement.cpp:
(WebCore::pluginReplacementForType):
* html/URLUtils.h:
(WebCore::URLUtils<T>::protocol const):
(WebCore::URLUtils<T>::setUsername):
(WebCore::URLUtils<T>::setPassword):
* page/Location.cpp:
(WebCore::Location::setProtocol):
(WebCore::Location::setHost):
(WebCore::Location::setHostname):
(WebCore::Location::setPort):
(WebCore::Location::setPathname):
(WebCore::Location::setSearch):
(WebCore::Location::setHash):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::load):

Source/WebKitLegacy/mac:

* DOM/DOMHTMLBaseElement.mm:
(-[DOMHTMLBaseElement href]):

Source/WTF:

These operators have been the cause of many subtle bugs related to type inference that are hard to see in the code,
as well as performance bugs where we unnecessarily re-parse parsed URLs.
After my recent cleanup this was easier than I thought it would be.

* wtf/URL.h:
(WTF::URL::operator const String& const): Deleted.
(WTF::URL::operator StringView const): Deleted.
(WTF::URL::operator NSString * const): Deleted.

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

6 weeks agoReplace Color::getHSL() with sRGBToHSL to ensure it at least gives somewhat sensible...
weinig@apple.com [Wed, 20 May 2020 22:54:11 +0000 (22:54 +0000)]
Replace Color::getHSL() with sRGBToHSL to ensure it at least gives somewhat sensible results for ExtendedColors and reduce code duplication
https://bugs.webkit.org/show_bug.cgi?id=212143

Reviewed by Simon Fraser.

Source/WebCore:

- Updated API tests to test sRGBToHSL() rather than Color::getHSL() and extended the tests
  to include lightness tests and round tripping tests.
- Update editing/pasteboard/paste-dark-mode-color-filtered.html with extended color test cases.

Replaces Color::getHSL() with sRGBToHSL(color.toSRGBAComponentsLossy()) and adds
an optimized variant, lightness(...) that just extracts the lightness component for
callers that only needed that.

It is now required to explicitly use color.toSRGBAComponentsLossy() to indicate that
for non-SRGB colors, this will be a lossy transformation and give us an easy way to
find all these sites in the future, if we want to make a better conversion for other
color spaces.

* editing/ReplaceSelectionCommand.cpp:
(WebCore::fragmentNeedsColorTransformed):
Switch to using lightness(). This was previously broken for extended colors but now works (though
in a lossy way through sRGB). Update editing/pasteboard/paste-dark-mode-color-filtered.html with extended colors.

* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::detectContentInRange):
Switch to using sRGBToHSL(color.toSRGBAComponentsLossy()).

* page/FrameView.cpp:
(WebCore::FrameView::recalculateScrollbarOverlayStyle):
Switch to using lightness().

* platform/graphics/Color.cpp:
(WebCore::Color::getHSL const): Deleted.
* platform/graphics/Color.h:
Remove Color::getHSL().

* platform/graphics/ColorUtilities.cpp:
(WebCore::lightness):
Added optimized subset of sRGBToHSL which just computes the lightness component for callers
that only need that.

(WebCore::sRGBToHSL):
Simplify/cleanup code a little using initialize-list based std::max/std::min and structured bindings.

* platform/graphics/ColorUtilities.h:
Export functions to allow testing them directly.

Source/WebKit:

* UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _updateScrollViewBackground]):
Switch to using Color::lightness().

Tools:

* TestWebKitAPI/Tests/WebCore/ColorTests.cpp:
(TestWebKitAPI::TEST):
Update tests to use sRGBToHSL instead of Color::getHSL() and add testing of WebCore::lightness() and
round tripping. Update results for hue to be 0->1 rather than 0->6 which allows the round tripping to succeed.

LayoutTests:

* editing/pasteboard/paste-dark-mode-color-filtered-expected.txt:
* editing/pasteboard/paste-dark-mode-color-filtered.html:
Update test to include a test case that uses extended colors.

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

6 weeks agoHide password echo when screen is being captured.
megan_gardner@apple.com [Wed, 20 May 2020 22:33:59 +0000 (22:33 +0000)]
Hide password echo when screen is being captured.
https://bugs.webkit.org/show_bug.cgi?id=212060
<rdar://problem/47653578>

Reviewed by Wenson Hsieh.

Source/WebCore:

When the screen is being captured, turn off the password echo.

* editing/InsertIntoTextNodeCommand.cpp:
(WebCore::InsertIntoTextNodeCommand::doApply):
* page/EditorClient.h:
(WebCore::EditorClient::isScreenCaptured const):

Source/WebKit:

Use the UIScreen state and notification to determine if the
screen is being shared or captured. This flag is for all
capture methods, Air Play, Screen Recording, etc. If the screen is
being captured, turn off the password echo to prevent the password from
being leaked.

* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):
(-[WKContentView _screenCapturedDidChange:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setIsScreenCaptured):
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
(WebKit::WebEditorClient::isScreenCaptured const):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::isScreenCaptured const):
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::setIsScreenCaptured):

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

6 weeks ago[GTK] Implement connected and disconnected events of GAMEPAD API with libmanette
changseok@webkit.org [Wed, 20 May 2020 22:33:35 +0000 (22:33 +0000)]
[GTK] Implement connected and disconnected events of GAMEPAD API with libmanette
https://bugs.webkit.org/show_bug.cgi?id=133854

Reviewed by Carlos Garcia Campos.

This patch brings initial GAMEPAD API support to the gtk port. We use libmanette,
a simple GObject game controller library to handle gamepad connection and input.
.:

* Source/cmake/FindManette.cmake: Added to detect libmanette headers and libs installed in host system.
* Source/cmake/OptionsGTK.cmake: Added a private flag, ENABLE_GAMEPAD.
  Once libmanette is found, we expose another build flag, USE_MANETTE for other ports.

Source/WebCore:

This change aims to implement two GAMEPAD API events: 'gamepadconnected' and 'gamepaddisconnected'
on top of libmanette. Rest of API will be implemented by following patches.

No new tests since existing tests can cover this change.

* PlatformGTK.cmake: Add header & library paths for libmanette.
* SourcesGTK.txt:
* platform/gamepad/manette/GUniquePtrManette.h: Added to define a smart pointer for ManetteMonitor.
* platform/gamepad/manette/ManetteGamepad.cpp: Added. A wrapper class for ManetteDevice.
  A ManetteGamepad instance is created per a physically connected gamepad. Currently,
  it is empty but input handling login will be placed in this class.
(WebCore::ManetteGamepad::ManetteGamepad):
* platform/gamepad/manette/ManetteGamepad.h: Added.
* platform/gamepad/manette/ManetteGamepadProvider.cpp: Added. A manager class
  for ManetteGamepad instances. This class represents ManetteMonitor that
  handles connection and disconnection of gamepads. Many parts of this class implementation
  is brought from HIDGamepad.cpp
(WebCore::ManetteGamepadProvider::singleton):
(WebCore::onDeviceConnected):
(WebCore::onDeviceDisconnected):
(WebCore::ManetteGamepadProvider::ManetteGamepadProvider):
(WebCore::ManetteGamepadProvider::startMonitoringGamepads):
(WebCore::ManetteGamepadProvider::stopMonitoringGamepads):
(WebCore::ManetteGamepadProvider::deviceConnected):
(WebCore::ManetteGamepadProvider::deviceDisconnected):
(WebCore::ManetteGamepadProvider::indexForNewlyConnectedDevice):
(WebCore::ManetteGamepadProvider::connectionDelayTimerFired):
(WebCore::ManetteGamepadProvider::removeGamepadForDevice):
* platform/gamepad/manette/ManetteGamepadProvider.h: Added.

Source/WebKit:

* SourcesGTK.txt:
* UIProcess/Gamepad/UIGamepadProvider.cpp: Add a build flag to void default interface
* UIProcess/Gamepad/gtk/UIGamepadProviderGtk.cpp: Added to retrieve WebPageProxy to which
  a gamepad connects. The returned WebPageProxy handles input events from the gamepad.
(WebKit::getWebPageProxy):
(WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput):
* UIProcess/Gamepad/manette/UIGamepadProviderManette.cpp: Added.
(WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider):
(WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput):
(WebKit::UIGamepadProvider::platformStopMonitoringInput):
(WebKit::UIGamepadProvider::platformStartMonitoringInput):

Tools:

In particular, we use libmanette-0.2.4 which is the latest version and minimum
version to build in c++.

* gtk/jhbuild.modules:

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

6 weeks agoSupport operating dates in ResourceLoadStatisticsDatabaseStore
katherine_cheney@apple.com [Wed, 20 May 2020 22:14:13 +0000 (22:14 +0000)]
Support operating dates in ResourceLoadStatisticsDatabaseStore
https://bugs.webkit.org/show_bug.cgi?id=212034
<rdar://problem/63349242>

Reviewed by Brent Fulgham.

Source/WebKit:

Tests: http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-database.html
       http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed.html
       http/tests/resourceLoadStatistics/operating-dates-all-website-data-removed-database.html
       http/tests/resourceLoadStatistics/operating-dates-all-website-data-removed.html

Patch to support Operating Dates in the ResourceLoadStatisticsDatabaseStore.
Moves functions out of ResourceLoadStatisticsStore now that each store
needs its own implementation.

Adds a new function for testing which inserts an expired statistic
and makes sure the proper behavior occurs depending on additional
parameters.

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::createTableQueries):
(WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
(WebKit::ResourceLoadStatisticsDatabaseStore::checkForMissingTablesInSchema):
(WebKit::ResourceLoadStatisticsDatabaseStore::createUniqueIndices):
(WebKit::ResourceLoadStatisticsDatabaseStore::createSchema):
(WebKit::ResourceLoadStatisticsDatabaseStore::getLeastRecentOperatingDate):
(WebKit::ResourceLoadStatisticsDatabaseStore::mergeOperatingDates):
(WebKit::ResourceLoadStatisticsDatabaseStore::includeTodayAsOperatingDateIfNecessary):
(WebKit::ResourceLoadStatisticsDatabaseStore::hasStatisticsExpired const):
(WebKit::ResourceLoadStatisticsDatabaseStore::insertExpiredStatisticForTesting):
Migrated Operating Dates functions from ResourceLoadStatisticsStore and implemented
them using SQLite instead of a vector. Functionality is
identical to the original in-memory implementation.

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
(WebKit::ResourceLoadStatisticsMemoryStore::mergeOperatingDates):
(WebKit::ResourceLoadStatisticsMemoryStore::includeTodayAsOperatingDateIfNecessary):
(WebKit::ResourceLoadStatisticsMemoryStore::hasStatisticsExpired const):
(WebKit::ResourceLoadStatisticsMemoryStore::insertExpiredStatisticForTesting):
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
Migrated Operating Dates functions from ResourceLoadStatisticsStore
now that the database store does not use them.

* NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
Spelling error.

* NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
(WebKit::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore):
(WebKit::ResourceLoadStatisticsStore::updateCookieBlockingForDomains):
(WebKit::ResourceLoadStatisticsStore::statisticsEpirationTime const): Deleted.
(WebKit::ResourceLoadStatisticsStore::mergeOperatingDates): Deleted.
(WebKit::ResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary): Deleted.
(WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const): Deleted.
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
(WebKit::OperatingDate::year const):
(WebKit::OperatingDate::month const):
(WebKit::OperatingDate::monthDay const):
These functions should be public now that they are needed outside
of this file after migrating OperatingDates functions.

(WebKit::ResourceLoadStatisticsStore::parameters const):
(WebKit::ResourceLoadStatisticsStore::operatingDates const): Deleted.
(WebKit::ResourceLoadStatisticsStore::clearOperatingDates): Deleted.
Moved OperatingDates functions to the memory store. Moved
operatingDatesWindow constexpr variables to the header file so that
the database and memory stores can both use them.

* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::insertExpiredStatisticForTesting):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::insertExpiredStatisticForTesting):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetStatisticsExpiredStatistic):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::insertExpiredStatisticForTesting):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::mergeStatisticForTesting):
(WebKit::WebsiteDataStore::insertExpiredStatisticForTesting):
* UIProcess/WebsiteData/WebsiteDataStore.h:
Function to add expired statistic to the ITP store.

Tools:

Add a testing function to insert an expired statistic.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setStatisticsExpiredStatistic):
(WTR::TestRunner::statisticsCallDidSetExpiredStatisticCallback):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::setStatisticsExpiredStatistic):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
(WTR::TestInvocation::didSetExpiredStatistic):
* WebKitTestRunner/TestInvocation.h:

LayoutTests:

Add tests for memory and database stores.

* http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-database.html: Added.
* http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-expected.txt: Added.
* http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed.html: Added.
* http/tests/resourceLoadStatistics/operating-dates-all-website-data-removed-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/operating-dates-all-website-data-removed-database.html: Added.
* http/tests/resourceLoadStatistics/operating-dates-all-website-data-removed-expected.txt: Added.
* http/tests/resourceLoadStatistics/operating-dates-all-website-data-removed.html: Added.

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

6 weeks agoWeb Inspector: Left/Right arrow keys should collapse/expand details sections
nvasilyev@apple.com [Wed, 20 May 2020 22:08:13 +0000 (22:08 +0000)]
Web Inspector: Left/Right arrow keys should collapse/expand details sections
https://bugs.webkit.org/show_bug.cgi?id=212064
<rdar://problem/63384091>

Reviewed by Devin Rousso.

* UserInterface/Views/DetailsSection.js:
(WI.DetailsSection):
(WI.DetailsSection.prototype._headerElementClicked):
(WI.DetailsSection.prototype._handleHeaderElementKeyDown):
Use keydown event instead of keypress because the latter doesn't fire for arrow keys.
Drive-by: remove unused `expandedByUser`.
* UserInterface/Views/ExpandableView.js:
(WI.ExpandableView):
(WI.ExpandableView.prototype._handleDisclosureButtonKeyDown):
Computed panel items should also collapse/expand by pressing Left/Right keys.

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

6 weeks agoPotential crash in PointerCaptureController::cancelPointer()
graouts@webkit.org [Wed, 20 May 2020 21:51:57 +0000 (21:51 +0000)]
Potential crash in PointerCaptureController::cancelPointer()
https://bugs.webkit.org/show_bug.cgi?id=208347
<rdar://problem/59866247>

Reviewed by David Kilzer and Daniel Bates.

* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::cancelPointer):

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

6 weeks agoDeprecate WKBundlePageSetPolicyClient() Injected bundle C API
cdumez@apple.com [Wed, 20 May 2020 21:33:24 +0000 (21:33 +0000)]
Deprecate WKBundlePageSetPolicyClient() Injected bundle C API
https://bugs.webkit.org/show_bug.cgi?id=212166

Reviewed by Alex Christensen.

Source/WebKit:

Deprecate WKBundlePageSetPolicyClient() Injected bundle C API. Approving navigations from
the injected bundle can lead to WebProcess terminations like in <rdar://problem/60340647>
because the WebProcess is not in a position to do sandbox checks when navigating to file
URLs.

* WebProcess/InjectedBundle/API/c/WKBundlePage.h:

Tools:

* TestWebKitAPI/Tests/WebKitObjC/CustomProtocolsInvalidScheme_Bundle.cpp:
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):

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

6 weeks agoLayout Test media/video-zoom-controls.html is flaky
jacob_uphoff@apple.com [Wed, 20 May 2020 21:05:46 +0000 (21:05 +0000)]
Layout Test media/video-zoom-controls.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=183424

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

6 weeks ago[ macOS iOS ] http/tests/resourceLoadStatistics/telemetry-generation-basic-functional...
jacob_uphoff@apple.com [Wed, 20 May 2020 21:00:57 +0000 (21:00 +0000)]
[ macOS iOS ] http/tests/resourceLoadStatistics/telemetry-generation-basic-functionality-database.html is a rare flaky failure
https://bugs.webkit.org/show_bug.cgi?id=212165

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

6 weeks ago[css-grid] Fix auto repeat with multiple tracks and gutters
obrufau@igalia.com [Wed, 20 May 2020 20:24:52 +0000 (20:24 +0000)]
[css-grid] Fix auto repeat with multiple tracks and gutters
https://bugs.webkit.org/show_bug.cgi?id=182922

Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

Import WPT test.

* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-multiple-values-001-expected.html: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-multiple-values-001.html: Added.
* web-platform-tests/css/css-grid/grid-definition/w3c-import.log:

Source/WebCore:

The code that computes the number of auto repeat tracks wrongly assumes
that the second argument of the repeat() notation is a single track
function. That was true in the beginning, however specs were later on
modified to allow a <track-list>. We support a <track-list> as a second
argument since long ago but the code that computes the number of
auto-repeat tracks was never updated.

This patch modifies two places that relate to the gaps between the
auto-repeat tracks, which ensures the proper total length.

This is a port of https://crrev.com/620278 from Chromium.

Tests: fast/css-grid-layout/grid-auto-repeat-huge-grid.html
       imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-multiple-values-001.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeAutoRepeatTracksCount const):

LayoutTests:

Update test expectations.

* fast/css-grid-layout/grid-auto-repeat-huge-grid.html:

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

6 weeks agoPlumb the display's nominal refresh rate down to ScrollingTree for use in scroll...
simon.fraser@apple.com [Wed, 20 May 2020 20:23:38 +0000 (20:23 +0000)]
Plumb the display's nominal refresh rate down to ScrollingTree for use in scroll synchronization
https://bugs.webkit.org/show_bug.cgi?id=212159

Reviewed by Tim Horton.

Plumb an Optional<unsigned> down windowScreenDidChange, which contains the nominal
display refresh rate (as frames per second) if available. On macOS, we get this
from CVDisplayLinkGetNominalOutputVideoRefreshPeriod().

To read it, WebProcessPool::nominalFramesPerSecondForDisplay() makes a DisplayLink
that doesn't get any observers, but that DisplayLink will very likely get used
as soon as we schedule a rendering update.

Source/WebCore:

* page/Chrome.cpp:
(WebCore::Chrome::windowScreenDidChange):
* page/Chrome.h:
* page/Page.cpp:
(WebCore::Page::scrollingCoordinator):
(WebCore::Page::windowScreenDidChange):
* page/Page.h:
(WebCore::Page::displayNominalFramesPerSecond const):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::windowScreenDidChange):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::windowScreenDidChange):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::windowScreenDidChange):
* page/scrolling/ScrollingTree.h:
* platform/HostWindow.h:

Source/WebKit:

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::nominalFramesPerSecondForDisplay):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::windowDidChangeScreen):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::windowScreenDidChange):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.h:
* UIProcess/mac/DisplayLink.cpp:
(WebKit::DisplayLink::DisplayLink):
(WebKit::DisplayLink::nominalFramesPerSecond const):
* UIProcess/mac/DisplayLink.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::windowScreenDidChange):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView doWindowDidChangeScreen]):

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

6 weeks agoDisable support for BeforeLoadEvent
cdumez@apple.com [Wed, 20 May 2020 20:14:23 +0000 (20:14 +0000)]
Disable support for BeforeLoadEvent
https://bugs.webkit.org/show_bug.cgi?id=212140
<rdar://problem/62847577>

Reviewed by Antti Koivisto.

Source/WebCore:

Disable support for BeforeLoadEvent. Other browsers do not support it and
Chrome dropped it shortly after the fork:
- https://bugs.chromium.org/p/chromium/issues/detail?id=333318

This is a synchronous event and therefore very dangerous.

Test: fast/frames/didBecomeCurrentDocumentInFrame-crash.html

* bindings/js/WebCoreBuiltinNames.h:
* dom/BeforeLoadEvent.idl:
* dom/Node.cpp:
(WebCore::Node::dispatchBeforeLoadEvent):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setLegacyBeforeLoadEventEnabled):
(WebCore::RuntimeEnabledFeatures::legacyBeforeLoadEventEnabled const):

LayoutTests:

* fast/frames/didBecomeCurrentDocumentInFrame-crash-expected.txt: Added.
* fast/frames/didBecomeCurrentDocumentInFrame-crash.html: Added.
Add layout test coverage for crash in <rdar://problem/62847577>.

* fast/dom/HTMLLinkElement/event-while-removing-attribute-expected.txt:
* fast/dom/HTMLObjectElement/beforeload-set-text-crash-expected.txt: Removed.
* fast/dom/HTMLObjectElement/beforeload-set-text-crash.xhtml: Removed.
* fast/dom/HTMLScriptElement/async-onbeforeload-expected.txt: Removed.
* fast/dom/HTMLScriptElement/async-onbeforeload.html: Removed.
* fast/dom/HTMLScriptElement/defer-onbeforeload-expected.txt: Removed.
* fast/dom/HTMLScriptElement/defer-onbeforeload.html: Removed.
* fast/dom/HTMLScriptElement/move-in-beforeload-expected.txt: Removed.
* fast/dom/HTMLScriptElement/move-in-beforeload.html: Removed.
* fast/dom/HTMLScriptElement/remove-in-beforeload-expected.txt: Removed.
* fast/dom/HTMLScriptElement/remove-in-beforeload.html: Removed.
* fast/dom/beforeload/cached-image-before-load-expected.txt: Removed.
* fast/dom/beforeload/cached-image-before-load.html: Removed.
* fast/dom/beforeload/clear-video-poster-in-beforeload-listener-expected.txt: Removed.
* fast/dom/beforeload/clear-video-poster-in-beforeload-listener.html: Removed.
* fast/dom/beforeload/flash-before-load-expected.txt: Removed.
* fast/dom/beforeload/flash-before-load.html: Removed.
* fast/dom/beforeload/frame-before-load-expected.txt: Removed.
* fast/dom/beforeload/frame-before-load.html: Removed.
* fast/dom/beforeload/image-before-load-expected.txt: Removed.
* fast/dom/beforeload/image-before-load-innerHTML-expected.txt: Removed.
* fast/dom/beforeload/image-before-load-innerHTML.html: Removed.
* fast/dom/beforeload/image-before-load.html: Removed.
* fast/dom/beforeload/image-object-before-load-expected.txt: Removed.
* fast/dom/beforeload/image-object-before-load-innerHTML-expected.txt: Removed.
* fast/dom/beforeload/image-object-before-load-innerHTML.html: Removed.
* fast/dom/beforeload/image-object-before-load.html: Removed.
* fast/dom/beforeload/image-removed-during-before-load-expected.txt: Removed.
* fast/dom/beforeload/image-removed-during-before-load.html: Removed.
* fast/dom/beforeload/link-before-load-expected.txt: Removed.
* fast/dom/beforeload/link-before-load.html: Removed.
* fast/dom/beforeload/pi-before-load-expected.txt: Removed.
* fast/dom/beforeload/pi-before-load.xhtml: Removed.
* fast/dom/beforeload/recursive-css-pi-before-load-expected.txt: Removed.
* fast/dom/beforeload/recursive-css-pi-before-load.html: Removed.
* fast/dom/beforeload/recursive-link-before-load-expected.txt: Removed.
* fast/dom/beforeload/recursive-link-before-load.html: Removed.
* fast/dom/beforeload/recursive-xsl-pi-before-load-expected.txt: Removed.
* fast/dom/beforeload/recursive-xsl-pi-before-load.html: Removed.
* fast/dom/beforeload/remove-bad-object-in-beforeload-listener-expected.txt: Removed.
* fast/dom/beforeload/remove-bad-object-in-beforeload-listener.html: Removed.
* fast/dom/beforeload/remove-flash-in-beforeload-listener-expected.txt: Removed.
* fast/dom/beforeload/remove-flash-in-beforeload-listener.html: Removed.
* fast/dom/beforeload/remove-frame-in-beforeload-listener-expected.txt: Removed.
* fast/dom/beforeload/remove-frame-in-beforeload-listener.html: Removed.
* fast/dom/beforeload/remove-image-in-beforeload-listener-expected.txt: Removed.
* fast/dom/beforeload/remove-image-in-beforeload-listener.html: Removed.
* fast/dom/beforeload/remove-link-in-beforeload-listener-expected.txt: Removed.
* fast/dom/beforeload/remove-link-in-beforeload-listener.html: Removed.
* fast/dom/beforeload/remove-script-in-beforeload-listener-expected.txt: Removed.
* fast/dom/beforeload/remove-script-in-beforeload-listener.html: Removed.
* fast/dom/beforeload/remove-video-in-beforeload-listener-expected.txt: Removed.
* fast/dom/beforeload/remove-video-in-beforeload-listener.html: Removed.
* fast/dom/beforeload/remove-video-poster-in-beforeload-listener-expected.txt: Removed.
* fast/dom/beforeload/remove-video-poster-in-beforeload-listener.html: Removed.
* fast/dom/beforeload/resources/content.xhtml: Removed.
* fast/dom/beforeload/resources/fail.css: Removed.
* fast/dom/beforeload/resources/fail.js: Removed.
* fast/dom/beforeload/resources/pass.css: Removed.
* fast/dom/beforeload/resources/print.js: Removed.
* fast/dom/beforeload/resources/test.xsl: Removed.
* fast/dom/beforeload/script-before-load-dynamic-expected.txt: Removed.
* fast/dom/beforeload/script-before-load-dynamic.html: Removed.
* fast/dom/beforeload/script-before-load-expected.txt: Removed.
* fast/dom/beforeload/script-before-load-xhtml-expected.txt: Removed.
* fast/dom/beforeload/script-before-load-xhtml.xhtml: Removed.
* fast/dom/beforeload/script-before-load.html: Removed.
* fast/dom/beforeload/video-before-load-expected.txt: Removed.
* fast/dom/beforeload/video-before-load.html: Removed.
* fast/events/constructors/before-load-event-constructor-expected.txt: Removed.
* fast/events/constructors/before-load-event-constructor.html: Removed.
* fast/events/event-attribute-expected.txt:
* fast/events/event-handler-regions-layout-expected.txt: Removed.
* fast/events/event-handler-regions-layout.html: Removed.
* fast/frames/crash-display-none-iframe-during-onbeforeload-expected.txt:
* fast/frames/restoring-page-cache-should-not-run-scripts-via-style-update-expected.txt:
* fast/html/link-element-removal-during-beforeload-expected.txt: Removed.
* fast/html/link-element-removal-during-beforeload.html: Removed.
* fast/parser/document-write-fighting-eof-expected.txt: Removed.
* fast/parser/document-write-fighting-eof.html: Removed.
* fast/parser/document-write-partial-entity-before-load-expected.txt: Removed.
* fast/parser/document-write-partial-entity-before-load.html: Removed.
* fast/parser/remove-misnested-iframe-in-beforeload-expected.txt: Removed.
* fast/parser/remove-misnested-iframe-in-beforeload.html: Removed.
* fast/parser/remove-misnested-iframe-parent-in-beforeload-expected.txt: Removed.
* fast/parser/remove-misnested-iframe-parent-in-beforeload.html: Removed.
* fast/replaced/object-param-spaces-expected.txt: Removed.
* fast/replaced/object-param-spaces.html: Removed.
* fast/scrolling/marquee-scroll-crash-expected.txt:
* fast/tokenizer/write-before-load-expected.txt:
* http/tests/security/beforeload-iframe-client-redirect-expected.txt:
* http/tests/security/beforeload-iframe-server-redirect-expected.txt:
* http/tests/security/xssAuditor/object-embed-tag-control-char-expected.txt:
* http/tests/security/xssAuditor/object-embed-tag-control-char.html:
* http/tests/security/xssAuditor/object-embed-tag-expected.txt:
* http/tests/security/xssAuditor/object-embed-tag-null-char-expected.txt:
* http/tests/security/xssAuditor/object-embed-tag-null-char.html:
* http/tests/security/xssAuditor/object-embed-tag.html:
* http/tests/security/xssAuditor/object-src-inject.html:
* http/tests/security/xssAuditor/object-tag-expected.txt:
* http/tests/security/xssAuditor/object-tag-javascript-url-expected.txt:
* http/tests/security/xssAuditor/object-tag-javascript-url.html:
* http/tests/security/xssAuditor/object-tag.html:
* http/tests/security/xssAuditor/resources/echo-intertag.pl:
* http/tests/security/xssAuditor/resources/echo-object-src.pl:
* http/tests/security/xssAuditor/resources/utilities.js:
(notifyDoneAfterReceivingLoaded):
(notifyDoneAfterReceivingBeforeloadFromIds): Deleted.
* plugins/unsupported-plugin-with-replacement-in-iframe-crash-expected.txt:
Update existing tests accordingly.

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

6 weeks agoRenderObject::VisibleRectContext members should not be prefixed with m_
zalan@apple.com [Wed, 20 May 2020 19:59:53 +0000 (19:59 +0000)]
RenderObject::VisibleRectContext members should not be prefixed with m_
https://bugs.webkit.org/show_bug.cgi?id=212154

Reviewed by Simon Fraser.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::applyCachedClipAndScrollPosition const):
(WebCore::RenderBox::computeVisibleRectInContainer const):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::computeVisibleRectInContainer const):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::computeVisibleRectInContainer const):
* rendering/RenderObject.h:
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computeVisibleRectInContainer const):
* rendering/RenderView.cpp:
(WebCore::RenderView::computeVisibleRectInContainer const):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::computeFloatVisibleRectInContainer const):

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

6 weeks agoSource/WebCore:
mmaxfield@apple.com [Wed, 20 May 2020 19:19:39 +0000 (19:19 +0000)]
Source/WebCore:
[iPadOS] -webkit-text-size-adjust:percentage doesn't work
https://bugs.webkit.org/show_bug.cgi?id=212122
<rdar://problem/54560875>

Reviewed by Wenson Hsieh.

We've gotten many bug reports that -webkit-text-size-adjust:X% no longer works in
WebKit on iPads. We don't want to just start honoring the value, because our
testing indicates that, with desktop-class browsing on iPad, more sites work better
when we don't honor percentages. However, if Safari is using the mobile content mode,
or if a native app has local content, it should be possible to get the old behavior
of honoring percentages.

This patch adds a new Setting, idempotentModeAutosizingOnlyHonorsPercentages, which
is hooked up to the desktop-class browsing feature. When
WebPageProxy::effectiveContentModeAfterAdjustingPolicies() determines that the
WebContentMode::Mobile mode should be used, it sets the new setting, which
causes idempotent text autosizing mode to have the same behavior that WKWebViews
on iPadOS used to have: -w-t-s-a:auto and -w-t-s-a:none have no effect, but
-w-t-s-a:X% is honored. This affects both Safari and WKWebView apps.

If a native app wants the old behavior, they can set
WKWebpagePreferences.preferredContentMode = WKContentModeMobile to force the old
iPad behavior. It's expected that apps with legacy content would be doing this
anyway.

Tests: fast/text-autosizing/ios/idempotentmode/idempotent-percentage.html
       TestWebKitAPI.PreferredContentMode.IdempotentModeAutosizingOnlyHonorsPercentages

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::applyPoliciesToSettings):
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setIdempotentModeAutosizingOnlyHonorsPercentages):
(WebCore::DocumentLoader::idempotentModeAutosizingOnlyHonorsPercentages const):
* page/Settings.yaml:
* style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjustmentForTextAutosizing):
* style/StyleBuilderCustom.h:
(WebCore::Style::computeBaseSpecifiedFontSize):
* style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::updateFontForTextSizeAdjust):

Source/WebKit:
[iPadOS] -webkit-text-size-adjust:percentage doesn't work in native apps
https://bugs.webkit.org/show_bug.cgi?id=212122
<rdar://problem/54560875>

Reviewed by Wenson Hsieh.

* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::copy const):
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):

Tools:
[iPadOS] -webkit-text-size-adjust:percentage doesn't work in native apps
https://bugs.webkit.org/show_bug.cgi?id=212122
<rdar://problem/54560875>

Reviewed by Wenson Hsieh.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/idempotent-mode-autosizing-only-honors-percentages.html: Added.
* TestWebKitAPI/ios/PreferredContentMode.mm:

LayoutTests:
[iPadOS] -webkit-text-size-adjust:percentage doesn't work in native apps
https://bugs.webkit.org/show_bug.cgi?id=212122
<rdar://problem/54560875>

Reviewed by Wenson Hsieh.

Update existing idempotent autosizing tests to force desktop mode.
Also add idempotent-percentage.html which doesn't force any mode.

* fast/text-autosizing/ios/idempotentmode/css-exposure.html:
* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-after-changing-initial-scale.html:
* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidate-special-cases.html:
* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html:
* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-identity.html:
* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-reaches-stable-state.html:
* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing.html:
* fast/text-autosizing/ios/idempotentmode/idempotent-percentage-expected.txt: Added.
* fast/text-autosizing/ios/idempotentmode/idempotent-percentage.html: Added.
* fast/text-autosizing/ios/idempotentmode/line-height-boosting.html:
* fast/text-autosizing/ios/idempotentmode/viewport-change-relayout.html:

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

6 weeks agoMove the TextStream logging definition in VisibleSelection.cpp to the outside of...
changseok@webkit.org [Wed, 20 May 2020 18:49:58 +0000 (18:49 +0000)]
Move the TextStream logging definition in VisibleSelection.cpp to the outside of the TREE_DEBUGGING guard
https://bugs.webkit.org/show_bug.cgi?id=212127

Reviewed by Simon Fraser.

A linking failure occurs after r261819 where ENABLE_TREE_DEBUGGING is disabled.
The TextStream logging defining is placed inside the guard while its declaration is not since r218976.

Build fix, no functionality changed.

* editing/VisibleSelection.cpp:
(WebCore::operator<<):

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

6 weeks agoDisable support for BeforeLoadEvent
ryanhaddad@apple.com [Wed, 20 May 2020 18:48:49 +0000 (18:48 +0000)]
Disable support for BeforeLoadEvent
https://bugs.webkit.org/show_bug.cgi?id=212140

Unreviewed.

* http/tests/cache/cancel-during-revalidation-succeeded.html:
Remove <CR> characters from line endings in an attempt to get `svn-apply` work on EWS bots.

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

6 weeks agoUnreviewed WPE gardening. Also enable the imported Blink and Mozilla
zandobersek@gmail.com [Wed, 20 May 2020 18:44:57 +0000 (18:44 +0000)]
Unreviewed WPE gardening. Also enable the imported Blink and Mozilla
layout tests, along with the necessary handful of baselines and expectations.

* platform/wpe/TestExpectations:
* platform/wpe/imported/blink: Added.
* platform/wpe/imported/blink/http: Added.
* platform/wpe/imported/blink/http/tests: Added.
* platform/wpe/imported/blink/http/tests/security: Added.
* platform/wpe/imported/blink/http/tests/security/contentSecurityPolicy: Added.
* platform/wpe/imported/blink/http/tests/security/contentSecurityPolicy/object-src-applet-archive-codebase-expected.txt: Added.
* platform/wpe/imported/blink/http/tests/security/contentSecurityPolicy/object-src-applet-archive-expected.txt: Added.
* platform/wpe/imported/blink/http/tests/security/contentSecurityPolicy/object-src-applet-code-codebase-expected.txt: Added.
* platform/wpe/imported/blink/http/tests/security/contentSecurityPolicy/object-src-applet-code-expected.txt: Added.

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

6 weeks agohttps://bugs.webkit.org/show_bug.cgi?id=198195
jacob_uphoff@apple.com [Wed, 20 May 2020 18:42:29 +0000 (18:42 +0000)]
https://bugs.webkit.org/show_bug.cgi?id=198195
REGRESSION (r244353) [Mac WK2] Layout Test fast/css/sticky/sticky-left-percentage.html is a flaky ImageOnlyFailure

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

6 weeks agoREGRESSION (r261892) [ Mac Debug ] 4 API tests failing related to ResourceLoadStatistics
katherine_cheney@apple.com [Wed, 20 May 2020 18:37:47 +0000 (18:37 +0000)]
REGRESSION (r261892) [ Mac Debug ] 4 API tests failing related to ResourceLoadStatistics
https://bugs.webkit.org/show_bug.cgi?id=212153
<rdar://problem/63452541>

Reviewed by Sihui Liu.

Accidentally deleted necessary reset() call for a SQLite statement
when converting stored statements to SQLiteStatementAutoResetScope in
https://trac.webkit.org/changeset/261892/webkit.

This statement is used in a loop with multiple bind() calls so it must be reset.

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::checkForMissingTablesInSchema):

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

6 weeks agoFix for accessibility-node-memory-management.html in isolated tree mode.
andresg_22@apple.com [Wed, 20 May 2020 18:21:10 +0000 (18:21 +0000)]
Fix for accessibility-node-memory-management.html in isolated tree mode.
https://bugs.webkit.org/show_bug.cgi?id=212142

Reviewed by Chris Fleizach.

LayoutTests/accessibility/accessibility-node-memory-management.html.

- Fix in applyPendingChanges that was not removing removed nodes from
the nodes map. This was causing that some detached AXIsolatedObjects
were being returned.
- Also handle the case where pending changes can come from a detached
AXObject with invalid ID and no platform wrapper.
- updateChildren better handles the case when the notification target
is not in the isolated tree by walking up the object hierarchy until it
finds an associated object that does have a corresponding isolated object.

* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::treeForPageID):
(WebCore::AXIsolatedTree::updateChildren):
(WebCore::AXIsolatedTree::applyPendingChanges):

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

6 weeks agoREGRESSION(r260978): Web Inspector: Styles: Pressing Space no longer toggles selected...
nvasilyev@apple.com [Wed, 20 May 2020 18:01:49 +0000 (18:01 +0000)]
REGRESSION(r260978): Web Inspector: Styles: Pressing Space no longer toggles selected properties
https://bugs.webkit.org/show_bug.cgi?id=212121

Reviewed by Devin Rousso.

r260978 removed `tabIndex = -1` from the style property element so it wouldn't have a focus outline
when in the Computed panel. However, this also made style properties non-focusable in the Styles panel.

This patch sets `tabIndex = -1` on style property elements when they can be selected (e.g. in the Styles panel).
It doesn't set any tabIndex for style property elements in Computed or Changes panels.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.layout):
* UserInterface/Views/SpreadsheetStyleProperty.js:

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

6 weeks agoAdd a test to check for creation and deletion of an audio renderer without playing it
youenn@apple.com [Wed, 20 May 2020 17:59:59 +0000 (17:59 +0000)]
Add a test to check for creation and deletion of an audio renderer without playing it
https://bugs.webkit.org/show_bug.cgi?id=212138

Reviewed by Eric Carlson.

* webrtc/remoteAudio-never-played-expected.txt: Added.
* webrtc/remoteAudio-never-played.html: Added.

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

6 weeks agoUnreviewed WPE gardening. Unskipped half of pending HTTP tests,
zandobersek@gmail.com [Wed, 20 May 2020 17:53:42 +0000 (17:53 +0000)]
Unreviewed WPE gardening. Unskipped half of pending HTTP tests,
providing test baselines and text expectations as required.

* platform/wpe/TestExpectations:
* platform/wpe/http/tests/loading: 2 baselines added.
* platform/wpe/http/tests/misc: 11 baselines added.
* platform/wpe/http/tests/multipart: 2 baselines added.
* platform/wpe/http/tests/navigation: 6 baselines added.
* platform/wpe/http/tests/websocket: 6 baselines added.
* platform/wpe/http/tests/xmlhttprequest: 11 baselines added.

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

6 weeks ago[Wasm] Limit the size of Wasm function we optimize in OMG mode
msaboff@apple.com [Wed, 20 May 2020 17:48:22 +0000 (17:48 +0000)]
[Wasm] Limit the size of Wasm function we optimize in OMG mode
https://bugs.webkit.org/show_bug.cgi?id=212105

Reviewed by Filip Pizlo.

Given that memory grows O(N^2) compiling Wasm code through the OMG path,
we can run out of memory when compiling large Wasm functions.  This change adds
a limit option, webAssemblyBBQFallbackSize,  When the Wasm function size is
equal to or greater than this limit we always compile using BBQ optimization
parameters.

As part of this change, we still go through the OMG loop entry OSR code
generation path for functions that are at or above the threshold, but we
compile such functions with BBQ compilation optimization levels.
Also for Wasm functions at or above  the threashold, we don't tier up to an
OMG compiled normal entry function.  Instead we stay with the BBQ compiled version.

* runtime/OptionsList.h:
* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::AirIRGenerator):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::parseAndCompile):
* wasm/WasmCompilationMode.cpp:
(JSC::Wasm::wasmFunctionSizeCanBeOMGCompiled):
* wasm/WasmCompilationMode.h:
* wasm/WasmOperations.cpp:
(JSC::Wasm::operationWasmTriggerOSREntryNow):

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

6 weeks agohttps://bugs.webkit.org/show_bug.cgi?id=212139
jacob_uphoff@apple.com [Wed, 20 May 2020 17:44:50 +0000 (17:44 +0000)]
https://bugs.webkit.org/show_bug.cgi?id=212139
[ macOS debug ] REGRESSION: fast/layoutformattingcontext/table-basic-row-baseline-with-nested-table.html is a flaky crash

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

6 weeks agoUpdate some media logging
eric.carlson@apple.com [Wed, 20 May 2020 17:24:27 +0000 (17:24 +0000)]
Update some media logging
https://bugs.webkit.org/show_bug.cgi?id=212109
<rdar://problem/63424816>

Unreviewed, remove a change unintentionally included in r261899.

* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullScreenWindowController _interactivePinchDismissChanged:]):

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

6 weeks ago[Web Animations] Animation engine should not wake up every tick for steps timing...
graouts@webkit.org [Wed, 20 May 2020 16:29:50 +0000 (16:29 +0000)]
[Web Animations] Animation engine should not wake up every tick for steps timing functions
https://bugs.webkit.org/show_bug.cgi?id=212103
<rdar://problem/62737868>

Unreviewed. Clean up some stray FIXMEs mistakenly commited in the previous commit.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSTransitionsForElementAndProperty):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):

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

6 weeks ago[Web Animations] Animation engine should not wake up every tick for steps timing...
graouts@webkit.org [Wed, 20 May 2020 16:26:16 +0000 (16:26 +0000)]
[Web Animations] Animation engine should not wake up every tick for steps timing functions
https://bugs.webkit.org/show_bug.cgi?id=212103
<rdar://problem/62737868>

Reviewed by Simon Fraser.

Source/WebCore:

Tests: webanimations/scheduling-of-animation-with-steps-timing-function-on-effect.html
       webanimations/scheduling-of-animation-with-steps-timing-function-on-keyframe.html
       webanimations/scheduling-of-css-animation-with-explicit-steps-timing-function-on-some-keyframes.html
       webanimations/scheduling-of-css-animation-with-implicit-steps-timing-function.html

When an animation uses a steps() timing function, it will appear to animate discretely between values such
that there is only n visual changes, where n is the number of steps provided. This gives us an opportunity
to be more efficient when scheduling animations using steps() timing functions.

In WebAnimation::timeToNextTick() we now ask the associated effect for the amount of progress until the next
step. For an effect-wide steps() timing function, we can use the provided iteration progress. For animations
with a linear effect-wide timing function (the default), we have to map the provided iteration progress to
a keyframe interval, provided that interval uses a steps() timing function.

The new {Animation|Keyframe}Effect::progressUntilNextStep() method returns WTF::nullopt for any other case.

In order to test this, we add a new internals.timeToNextAnimationTick(animation) method which we use in the
two new tests.

* animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::progressUntilNextStep const):
* animation/AnimationEffect.h:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::setBlendingKeyframes):
(WebCore::KeyframeEffect::computeSomeKeyframesUseStepsTimingFunction):
(WebCore::KeyframeEffect::timingFunctionForKeyframeAtIndex const): Avoid any out-of-bounds use of the underlying data
structures by returning nullptr for cases where we don't have an explicit keyframe. We also make the function const
such that it may be called from progressUntilNextStep(), it always was const but wasn't marked as such.
(WebCore::KeyframeEffect::progressUntilNextStep const):
* animation/KeyframeEffect.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::timeToNextTick const):
* animation/WebAnimation.h:
* animation/WebAnimation.idl:
* testing/Internals.cpp:
(WebCore::Internals::timeToNextAnimationTick const):
* testing/Internals.h:
* testing/Internals.idl:

Source/WTF:

Allow Seconds to be divided or multiplied by a double with operands in any order.

* wtf/Seconds.h:
(WTF::operator*):
(WTF::operator/):

LayoutTests:

Add tests that check that an animation using a steps() timing function correctly computes the time to
the next tick accouning for the fact that it won't compute a different iteration progress until the
next step.

* webanimations/scheduling-of-animation-with-steps-timing-function-on-effect-expected.txt: Added.
* webanimations/scheduling-of-animation-with-steps-timing-function-on-effect.html: Added.
* webanimations/scheduling-of-animation-with-steps-timing-function-on-keyframe-expected.txt: Added.
* webanimations/scheduling-of-animation-with-steps-timing-function-on-keyframe.html: Added.
* webanimations/scheduling-of-css-animation-with-explicit-steps-timing-function-on-some-keyframes-expected.txt: Added.
* webanimations/scheduling-of-css-animation-with-explicit-steps-timing-function-on-some-keyframes.html: Added.
* webanimations/scheduling-of-css-animation-with-implicit-steps-timing-function-expected.txt: Added.
* webanimations/scheduling-of-css-animation-with-implicit-steps-timing-function.html: Added.

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

6 weeks ago[WPE][WebDriver] Allow subviews to create new views
lmoura@igalia.com [Wed, 20 May 2020 16:10:10 +0000 (16:10 +0000)]
[WPE][WebDriver] Allow subviews to create new views
https://bugs.webkit.org/show_bug.cgi?id=212118

Reviewed by Carlos Garcia Campos.

Required by some WebDriver tests.

* MiniBrowser/wpe/main.cpp:
(createWebView):

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

6 weeks agoFix table sizing when 'max-width' is used
noam@webkit.org [Wed, 20 May 2020 16:05:43 +0000 (16:05 +0000)]
Fix table sizing when 'max-width' is used
https://bugs.webkit.org/show_bug.cgi?id=115156

Reviewed by Zalan Bujtas.

Source/WebCore:

Based on previous patch by László Langó  <lango@inf.u-szeged.hu>

Test: fast/table/html-table-width-max-width-constrained.html

A table should always be wide enough to contain its content (preferred logical width).
This constraint should be stronger than the table style's specified min-width/width.

The behavior matches the spec, and behavior on Firefox/Chrome.

* rendering/RenderTable.cpp:
(WebCore::RenderTable::updateLogicalWidth):
        Max-width should only affect the table's max preferred width.

(WebCore::RenderTable::computePreferredLogicalWidths):
        Change the order of constraints so that content constraint is stronger than style width/max-width constraint.

LayoutTests:

Based on a previous patch by László Langó  <lango@inf.u-szeged.hu>

* fast/table/css-table-max-width-expected.txt:
* fast/table/css-table-max-width.html:
        Change in behavior, test was expecting buggy behavior.

* fast/table/html-table-width-max-width-constrained-expected.txt: Added.
* fast/table/html-table-width-max-width-constrained.html: Added.
        Test the desired behavior with content-constrained tables.

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

6 weeks agoREGRESSION(r261554): [GTK] Version 2.29.1 crashes using drag-n-drop API
carlosgc@webkit.org [Wed, 20 May 2020 15:59:59 +0000 (15:59 +0000)]
REGRESSION(r261554): [GTK] Version 2.29.1 crashes using drag-n-drop API
https://bugs.webkit.org/show_bug.cgi?id=212136

Reviewed by Adrian Perez de Castro.

* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::read): Use m_selectionData if present.

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

6 weeks ago[GStreamer] <img> tag needs to support video formats
commit-queue@webkit.org [Wed, 20 May 2020 15:52:36 +0000 (15:52 +0000)]
[GStreamer] <img> tag needs to support video formats
https://bugs.webkit.org/show_bug.cgi?id=180370

Patch by Philippe Normand <pnormand@igalia.com> on 2020-05-20
Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

GStreamer implementation of the ImageDecoder. It currently doesn't support zero-copy
rendering though due to the the NativeImagePtr requirement.

* platform/GStreamer.cmake:
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::isSupportedImageVideoOrSVGMIMEType):
* platform/graphics/ImageDecoder.cpp:
(WebCore::ImageDecoder::create):
(WebCore::ImageDecoder::supportsMediaType):
* platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: Added.
(WebCore::toSample):
(WebCore::ImageDecoderGStreamer::create):
(WebCore::ImageDecoderGStreamer::ImageDecoderGStreamer):
(WebCore::ImageDecoderGStreamer::supportsContainerType):
(WebCore::ImageDecoderGStreamer::canDecodeType):
(WebCore::ImageDecoderGStreamer::encodedDataStatus const):
(WebCore::ImageDecoderGStreamer::size const):
(WebCore::ImageDecoderGStreamer::repetitionCount const):
(WebCore::ImageDecoderGStreamer::uti const):
(WebCore::ImageDecoderGStreamer::frameOrientationAtIndex const):
(WebCore::ImageDecoderGStreamer::frameDurationAtIndex const):
(WebCore::ImageDecoderGStreamer::frameHasAlphaAtIndex const):
(WebCore::ImageDecoderGStreamer::frameBytesAtIndex const):
(WebCore::ImageDecoderGStreamer::createFrameImageAtIndex):
(WebCore::ImageDecoderGStreamer::setData):
(WebCore::ImageDecoderGStreamer::clearFrameBufferCache):
(WebCore::ImageDecoderGStreamer::sampleAtIndex const):
(WebCore::ImageDecoderGStreamer::InnerDecoder::decodebinPadAddedCallback):
(WebCore::ImageDecoderGStreamer::InnerDecoder::connectDecoderPad):
(WebCore::ImageDecoderGStreamer::handleSample):
(WebCore::ImageDecoderGStreamer::InnerDecoder::handleMessage):
(WebCore::ImageDecoderGStreamer::InnerDecoder::preparePipeline):
(WebCore::ImageDecoderGStreamer::InnerDecoder::run):
(WebCore::ImageDecoderGStreamer::InnerDecoder::encodedDataStatus const):
(WebCore::ImageDecoderGStreamer::pushEncodedData):
* platform/graphics/gstreamer/ImageDecoderGStreamer.h: Added.
* platform/graphics/gstreamer/ImageGStreamer.h:
(WebCore::ImageGStreamer::createImage):
(WebCore::ImageGStreamer::image):
(WebCore::ImageGStreamer::setCropRect):
(WebCore::ImageGStreamer::rect):
(WebCore::ImageGStreamer::hasAlpha const):
* platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
(WebCore::ImageGStreamer::ImageGStreamer):
* platform/graphics/gstreamer/MediaSampleGStreamer.h:

LayoutTests:

Update TestExpectations for tests using videos for the <img> tag.

* http/conf/flatpak-httpd.conf:
* platform/glib/TestExpectations:
* platform/gtk/TestExpectations:
* platform/wpe/TestExpectations:

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

6 weeks ago[Mac] UI processes spin when creating the "Share" context menu item
aestes@apple.com [Wed, 20 May 2020 15:43:19 +0000 (15:43 +0000)]
[Mac] UI processes spin when creating the "Share" context menu item
https://bugs.webkit.org/show_bug.cgi?id=212137
<rdar://problem/54498394>

Reviewed by Wenson Hsieh.

Source/WebCore:

Ran update-webkit-localizable-strings.

* en.lproj/Localizable.strings:

Source/WebCore/PAL:

* pal/spi/mac/NSSharingServicePickerSPI.h: Declared -getMenuWithCompletion:.

Source/WebKit:

On Mac, WebKit has been using the +[NSMenuItem standardShareMenuItemForItems:] SPI to create
the "Share" context submenu and menu item. This call performs synchronous IPC and can result
in UI process spins.

Where available, switch to using the asynchronous
-[NSSharingServicePicker getMenuWithCompletion:] SPI instead. This method only creates the
submenu, not the menu item, so when using this new method we must create the "Share" menu
item ourselves.

* UIProcess/mac/WebContextMenuProxyMac.h:
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::getStandardShareMenuItem):
(WebKit::WebContextMenuProxyMac::getShareMenuItem):
(WebKit::WebContextMenuProxyMac::getContextMenuFromItems):
(WebKit::WebContextMenuProxyMac::getContextMenuItem):
(WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
(WebKit::WebContextMenuProxyMac::createShareMenuItem): Deleted.
(WebKit::WebContextMenuProxyMac::createContextMenuFromItems): Deleted.
(WebKit::WebContextMenuProxyMac::createContextMenuItem): Deleted.

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

6 weeks ago[GTK] [l10n] Updated Ukrainian translation of WebKitGTK+
carlosgc@webkit.org [Wed, 20 May 2020 15:38:50 +0000 (15:38 +0000)]
[GTK] [l10n] Updated Ukrainian translation of WebKitGTK+
https://bugs.webkit.org/show_bug.cgi?id=209798

Patch by Yuri Chornoivan <yurchor@ukr.net> on 2020-05-20
Rubber-stamped by Carlos Garcia Campos.

* uk.po:

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

6 weeks ago[LFC][TFC] Internal table boxes should take collapsed border into account
zalan@apple.com [Wed, 20 May 2020 15:34:24 +0000 (15:34 +0000)]
[LFC][TFC] Internal table boxes should take collapsed border into account
https://bugs.webkit.org/show_bug.cgi?id=212135

Source/WebCore:

Reviewed by Antti Koivisto.

Use the collapsed border value to compute the borders for sections, rows and cells.
The collapsed border is propagated to the table box and the adjacent cell boxes.

Test: fast/layoutformattingcontext/table-simple-border-collapse.html

* layout/LayoutUnits.h:
(WebCore::Layout::operator/):
* layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp:
(WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::setUsedGeometryForRows):
(WebCore::Layout::TableFormattingContext::setUsedGeometryForSections):
(WebCore::Layout::TableFormattingContext::layoutCell):
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::setCollapsedBorder):
(WebCore::Layout::TableGrid::collapsedBorder const):

LayoutTests:

Reviewed by Antti Koivisto.

* fast/layoutformattingcontext/table-simple-border-collapse-expected.html: Added.
* fast/layoutformattingcontext/table-simple-border-collapse.html: Added.

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

6 weeks ago[FlatPak SDK] Missing ruby gems json and highline
commit-queue@webkit.org [Wed, 20 May 2020 15:20:10 +0000 (15:20 +0000)]
[FlatPak SDK] Missing ruby gems json and highline
https://bugs.webkit.org/show_bug.cgi?id=212086

Patch by Philippe Normand <pnormand@igalia.com> on 2020-05-20
Reviewed by Žan Doberšek.

Add the json and highline Ruby gems in the Flatpak SDK.

* buildstream/elements/sdk-platform.bst:
* buildstream/elements/sdk/ruby-highline.bst: Added.
* buildstream/elements/sdk/ruby-json.bst: Added.
* buildstream/project.conf:

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

6 weeks agoUnreviewed, reverting r261909.
dpino@igalia.com [Wed, 20 May 2020 14:32:08 +0000 (14:32 +0000)]
Unreviewed, reverting r261909.

Execution of LayoutTests returns syntax error in the bots (GTK, WPE)

Reverted changeset:

"[Flatpak SDK] Add bubblewrap ... wrapper"
https://bugs.webkit.org/show_bug.cgi?id=212077
https://trac.webkit.org/changeset/261909

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

6 weeks ago[Flatpak SDK] Bump rr and bst
commit-queue@webkit.org [Wed, 20 May 2020 14:24:02 +0000 (14:24 +0000)]
[Flatpak SDK] Bump rr and bst
https://bugs.webkit.org/show_bug.cgi?id=212074

Patch by Philippe Normand <pnormand@igalia.com> on 2020-05-20
Reviewed by Adrian Perez de Castro.

Update Buildstream to 1.4.3 which is their latest stable release. Also bump rr to their
latest git master commit, which makes it usable in the Flatpak sandbox.

* buildstream/Pipfile:
* buildstream/Pipfile.lock:
* buildstream/elements/sdk/rr.bst:

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

6 weeks ago[Mac] Use preferedPixelBufferFormat for AVVideoCaptureSource
youenn@apple.com [Wed, 20 May 2020 13:30:42 +0000 (13:30 +0000)]
[Mac] Use preferedPixelBufferFormat for AVVideoCaptureSource
https://bugs.webkit.org/show_bug.cgi?id=212071

Reviewed by Eric Carlson.

Source/WebCore:

Manually tested.

* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::avVideoCapturePixelBufferFormat):

Source/WTF:

* wtf/PlatformHave.h:
Add HAVE_DISPLAY_LAYER_BIPLANAR_SUPPORT macro.

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

6 weeks agoupdate-test-expectations-from-bugzilla tool not working with new EWS
clopez@igalia.com [Wed, 20 May 2020 13:29:09 +0000 (13:29 +0000)]
update-test-expectations-from-bugzilla tool not working with new EWS
https://bugs.webkit.org/show_bug.cgi?id=210975

Reviewed by Youenn Fablet.

With the new EWS, the layout test archive results are not longer
posted to bugzilla as attachment. Now we need to inspect the EWS
server to get the status of the runs for the patch id, and then
query the EWS builbot server in order to get the details of each
run to finally obtain the URL with the zip file for the results.

The tool now automatically applies platform-specific and generic
results automatically (its not longer needed to specify whether
the result its generic or not). It uses mac-wk2 results as generic.

Also now it updates the test results for tests where the result
is MISSING.

* Scripts/webkitpy/common/net/bugzilla/test_expectation_updater.py:
(configure_logging):
(argument_parser):
(TestExpectationUpdater.__init__):
(TestExpectationUpdater._platform_name):
(TestExpectationUpdater):
(TestExpectationUpdater._get_layout_tests_run):
(TestExpectationUpdater._lookup_ews_results):
(TestExpectationUpdater._tests_to_update):
(TestExpectationUpdater._update_for_generic_bot):
(TestExpectationUpdater._update_for_platform_specific_bot):
(TestExpectationUpdater.do_update):
(main):
* Scripts/webkitpy/common/net/bugzilla/test_expectation_updater_unittest.py:
(MockAttachment.__init__):
(MockAttachment.is_patch):
(MockAttachment):
(MockAttachment.is_obsolete):
(MockBugzilla):
(MockBugzilla.attachments):
(MockRequests):
(MockRequests.__init__):
(MockRequests.get):
(MockRequests.content):
(MockRequests.text):
(MockZip.__init__):
(TestExpectationUpdaterTest.test_update_test_expectations):

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

6 weeks agoUnreviewed WPE gardening. Enabling the remaining unskippable CSS3 tests
zandobersek@gmail.com [Wed, 20 May 2020 13:22:15 +0000 (13:22 +0000)]
Unreviewed WPE gardening. Enabling the remaining unskippable CSS3 tests
and providing the necessary baselines.

* platform/wpe/TestExpectations:
* platform/wpe/css3/filters: Added.
* platform/wpe/css3/filters/composited-during-animation-layertree-expected.txt: Added.
* platform/wpe/css3/filters/composited-during-transition-layertree-expected.txt: Added.
* platform/wpe/css3/filters/effect-blur-expected.txt: Added.
* platform/wpe/css3/filters/effect-blur-hw-expected.txt: Added.
* platform/wpe/css3/filters/effect-brightness-clamping-expected.txt: Added.
* platform/wpe/css3/filters/effect-brightness-clamping-hw-expected.txt: Added.
* platform/wpe/css3/filters/effect-brightness-expected.txt: Added.
* platform/wpe/css3/filters/effect-brightness-hw-expected.txt: Added.
* platform/wpe/css3/filters/effect-combined-expected.txt: Added.
* platform/wpe/css3/filters/effect-combined-hw-expected.txt: Added.
* platform/wpe/css3/filters/effect-contrast-expected.txt: Added.
* platform/wpe/css3/filters/effect-contrast-hw-expected.txt: Added.
* platform/wpe/css3/filters/effect-drop-shadow-expected.txt: Added.
* platform/wpe/css3/filters/effect-drop-shadow-hw-expected.txt: Added.
* platform/wpe/css3/filters/effect-grayscale-expected.txt: Added.
* platform/wpe/css3/filters/effect-grayscale-hw-expected.txt: Added.
* platform/wpe/css3/filters/effect-hue-rotate-expected.txt: Added.
* platform/wpe/css3/filters/effect-hue-rotate-hw-expected.txt: Added.
* platform/wpe/css3/filters/effect-invert-expected.txt: Added.
* platform/wpe/css3/filters/effect-invert-hw-expected.txt: Added.
* platform/wpe/css3/filters/effect-opacity-expected.txt: Added.
* platform/wpe/css3/filters/effect-opacity-hw-expected.txt: Added.
* platform/wpe/css3/filters/effect-reference-composite-expected.txt: Added.
* platform/wpe/css3/filters/effect-reference-composite-hw-expected.txt: Added.
* platform/wpe/css3/filters/effect-reference-expected.txt: Added.
* platform/wpe/css3/filters/effect-reference-hw-expected.txt: Added.
* platform/wpe/css3/filters/effect-reference-ordering-expected.txt: Added.
* platform/wpe/css3/filters/effect-reference-ordering-hw-expected.txt: Added.
* platform/wpe/css3/filters/effect-saturate-expected.txt: Added.
* platform/wpe/css3/filters/effect-saturate-hw-expected.txt: Added.
* platform/wpe/css3/filters/effect-sepia-expected.txt: Added.
* platform/wpe/css3/filters/effect-sepia-hw-expected.txt: Added.
* platform/wpe/css3/filters/regions-expanding-expected.txt: Added.
* platform/wpe/css3/masking: Added.
* platform/wpe/css3/masking/clip-path-circle-border-box-expected.txt: Added.
* platform/wpe/css3/masking/clip-path-circle-content-box-expected.txt: Added.
* platform/wpe/css3/masking/clip-path-circle-padding-box-expected.txt: Added.
* platform/wpe/css3/masking/mask-luminance-png-expected.txt: Added.

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

6 weeks agoUnreviewed. Fix GTK4 build with GTK 3.98.4
carlosgc@webkit.org [Wed, 20 May 2020 13:04:55 +0000 (13:04 +0000)]
Unreviewed. Fix GTK4 build with GTK 3.98.4

.:

* Source/cmake/OptionsGTK.cmake:

Source/WebCore:

* platform/gtk/GtkUtilities.cpp:
(WebCore::convertWidgetPointToScreenPoint):
* platform/gtk/GtkVersioning.h:
(gtk_widget_destroy):
* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::screenDPI):

Source/WebKit:

* PlatformGTK.cmake:
* UIProcess/API/gtk/WebKitPrintOperation.cpp:
(webkitPrintOperationRunDialog):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseAddDialog):
(webkitWebViewBaseRemoveChild):
(webkitWebViewBaseContainerForall):
(webkitWebViewBaseAddWebInspector):
(webkitWebViewBaseRemoveWebInspector):
(webkitWebViewBaseDispose):
(webkitWebViewBaseSizeAllocate):
(webkitWebViewBaseConstructed):
(webkit_web_view_base_class_init):
* UIProcess/API/gtk/WebKitWebViewBase.h: Removed.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/Inspector/gtk/RemoteWebInspectorProxyGtk.cpp:
(WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
(WebKit::RemoteWebInspectorProxy::platformSave):
* UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformCreateFrontendWindow):
(WebKit::WebInspectorProxy::platformAttach):
(WebKit::WebInspectorProxy::platformDetach):
(WebKit::WebInspectorProxy::platformSave):
* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk):

Tools:

* MiniBrowser/gtk/BrowserTab.c:
(loadChanged):
(browserTabConstructed):
* MiniBrowser/gtk/BrowserWindow.c:
(webViewClose):
(browserWindowSetupToolbarItem):
(browser_window_init):

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

6 weeks ago[GTK4] Add support for drag and drop operations
carlosgc@webkit.org [Wed, 20 May 2020 12:39:22 +0000 (12:39 +0000)]
[GTK4] Add support for drag and drop operations
https://bugs.webkit.org/show_bug.cgi?id=211779

Reviewed by Adrian Perez de Castro.

Source/WebCore:

Move the code to create a GdkTexture from an Image from CursorGtk to ImageGtk and add Image::gdkTexture().

* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:
(WebCore::Image::gdkTexture):
* platform/graphics/gtk/ImageGtk.cpp:
(WebCore::BitmapImage::gdkTexture):
* platform/gtk/CursorGtk.cpp:
(WebCore::createCustomCursor):

Source/WebKit:

* UIProcess/API/gtk/DragSource.h:
* UIProcess/API/gtk/DragSourceGtk4.cpp:
(WebKit::DragSource::begin):
* UIProcess/API/gtk/DropTarget.h:
* UIProcess/API/gtk/DropTargetGtk4.cpp:
(WebKit::DropTarget::DropTarget):
(WebKit::DropTarget::~DropTarget):
(WebKit::DropTarget::accept):
(WebKit::DropReadAsyncData::DropReadAsyncData):
(WebKit::DropTarget::loadData):
(WebKit::DropTarget::didLoadData):
(WebKit::DropTarget::enter):
(WebKit::DropTarget::update):
(WebKit::DropTarget::didPerformAction):
(WebKit::DropTarget::leave):
(WebKit::DropTarget::drop):

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

6 weeks agoRemove unused Color::getHSV function
weinig@apple.com [Wed, 20 May 2020 11:17:06 +0000 (11:17 +0000)]
Remove unused Color::getHSV function
https://bugs.webkit.org/show_bug.cgi?id=212119

Reviewed by Simon Fraser.

Source/WebCore:

* platform/graphics/Color.cpp:
(WebCore::Color::getHSV const): Deleted.
* platform/graphics/Color.h:
Remove Color::getHSV(). It was unused outside of the API test for it.

Tools:

* TestWebKitAPI/Tests/WebCore/ColorTests.cpp:
Remove tests for Color::getHSV().

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

6 weeks ago[Flatpak SDK] Add bubblewrap ... wrapper
commit-queue@webkit.org [Wed, 20 May 2020 08:37:13 +0000 (08:37 +0000)]
[Flatpak SDK] Add bubblewrap ... wrapper
https://bugs.webkit.org/show_bug.cgi?id=212077

Patch by Philippe Normand <pnormand@igalia.com> on 2020-05-20
Reviewed by Carlos Alberto Lopez Perez.

The bind-mounts are now handled through webkit-bwrap.

* flatpak/flatpakutils.py:
(WebkitFlatpak.execute_command):
(WebkitFlatpak.run_in_sandbox):
* flatpak/webkit-bwrap: Added.

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

6 weeks agoAllow calling VideoSampleObserver::videoSampleAvailable from a background thread
youenn@apple.com [Wed, 20 May 2020 07:54:05 +0000 (07:54 +0000)]
Allow calling VideoSampleObserver::videoSampleAvailable from a background thread
https://bugs.webkit.org/show_bug.cgi?id=212024

Reviewed by Eric Carlson.

Allow RealtimeMediaSource::videoSampleAvailable to be called on a background thread, typically the capture thread.
Make WebRTC remote sources and mock capture sources do that.

RealtimeMediaSource is then updating its intrinsic size from the generation thread while updating its size in the main thread.
The size() getter can be called from both threads.

Existing consumers do the following:
- media player will hop to the main thread.
- media recorder will do processing from the background thread.
- WebRTC sender will do processing from the background thread, except when sending black frames where this will still be done on the main thread.
This is ok as we ensure either we send black frames on the main thread (and we do not observe the source) or we observe the source to send.

Follow-ups will migrate the real capture sources as well as migrating media player processing out of the main thread.
Covered by existing tests.

* platform/MediaSample.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoSampleAvailable):
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::videoSampleAvailable):
(WebCore::RealtimeMediaSource::setIntrinsicSize):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac):
(WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
(WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample): Deleted.

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

6 weeks agoFix computeMarginLogicalSizeForChild to check auto margins in the right axis
obrufau@igalia.com [Wed, 20 May 2020 07:11:26 +0000 (07:11 +0000)]
Fix computeMarginLogicalSizeForChild to check auto margins in the right axis
https://bugs.webkit.org/show_bug.cgi?id=212113

Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

Import last version of this WPT test.

* web-platform-tests/css/css-grid/grid-items/grid-items-minimum-width-orthogonal-001-expected.txt:
* web-platform-tests/css/css-grid/grid-items/grid-items-minimum-width-orthogonal-001.html:

Source/WebCore:

GridLayoutFunctions::computeMarginLogicalSizeForChild checks for 'auto'
margins before retrieving the margin size, since these should be treated
as 0. However, for orthogonal grid items, it used to check the wrong axis.
So if an item had 'margin-top: auto' and 'margin-left: 5px', when asking
for the horizontal margin we could get 0px instead of 5px due to the
auto margin in the vertical axis.

Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-minimum-width-orthogonal-001.html

* rendering/GridLayoutFunctions.cpp:
(WebCore::GridLayoutFunctions::computeMarginLogicalSizeForChild):
(WebCore::GridLayoutFunctions::marginLogicalSizeForChild):

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

6 weeks agoREGRESSION (r258919): fast/events/ios/key-events-comprehensive/key-events-control...
wenson_hsieh@apple.com [Wed, 20 May 2020 05:44:29 +0000 (05:44 +0000)]
REGRESSION (r258919): fast/events/ios/key-events-comprehensive/key-events-control tests are failing
https://bugs.webkit.org/show_bug.cgi?id=212124
<rdar://problem/60893744>

Reviewed by Tim Horton.

After the changes in r258919, WKContentView's text input traits report that we're in a single line input, even
when there is no editable focused element. This prevents UIKit from allowing WebKit to handle the `CTRL + M`
key command, which is interpreted at the system level as inserting a line break in a multi-line editable area.

It seems odd to consider ourselves in a single line input when there isn't even an editable element focused
element; for now, we can fix these failing tests by just going with the default value for the text input traits'
`setIsSingleLineDocument` property, but not explicitly setting it to either `NO` or `YES` when no element is
focused.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView textInputTraits]):

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

6 weeks ago[WinCairo] ASSERT(m_eglDisplay == EGL_NO_DISPLAY) fails in ~PlatformDisplay()
Hironori.Fujii@sony.com [Wed, 20 May 2020 04:18:03 +0000 (04:18 +0000)]
[WinCairo] ASSERT(m_eglDisplay == EGL_NO_DISPLAY) fails in ~PlatformDisplay()
https://bugs.webkit.org/show_bug.cgi?id=212065

Reviewed by Don Olmstead.

Source/WebCore:

PlatformDisplay destoys m_eglDisplay by using std::atexit to
ensure they are destructed before EGL's atexit handler (Bug 157973).
However, calling eglTerminate in atexit handler causes a
crash on Windows (Bug 145832, Bug 170331).

Then, r214688 added shutDownEglDisplays() and explicitly call it
in shutDownWebKit() to destory m_eglDisplay in Windows WebKit1.
However, Windows WebKit2 may call _exit() in IPC::Connection's
WorkQueue thread. It doesn't seem a good idea that explicitly
destructing m_eglDisplay by calling shutDownEglDisplays().

Remove shutDownEglDisplays() and the assertion for Windows.

* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::~PlatformDisplay): Conditioned out the
assertion for PLATFORM(WIN).
(WebCore::PlatformDisplay::initializeEGLDisplay): Restored the
original atexit handler of r201595.
(WebCore::PlatformDisplay::shutDownEglDisplays): Deleted.
* platform/graphics/PlatformDisplay.h:

Source/WebKitLegacy/win:

* WebKitDLL.cpp:
(shutDownWebKit): Don't call PlatformDisplay::shutDownEglDisplays().

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

6 weeks ago[WebDriver][WPE] Skip windowing tests.
lmoura@igalia.com [Wed, 20 May 2020 03:31:18 +0000 (03:31 +0000)]
[WebDriver][WPE] Skip windowing tests.

These tests are related to window operations not directly supported by
WPE.

Unreviewed test gardening.

* TestExpectations.json:

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

6 weeks agoREGRESSION (r259930): Dictation marker at start of text is removed when added trailin...
darin@apple.com [Wed, 20 May 2020 03:13:49 +0000 (03:13 +0000)]
REGRESSION (r259930): Dictation marker at start of text is removed when added trailing whitespace is collapsed
https://bugs.webkit.org/show_bug.cgi?id=212093

Reviewed by Daniel Bates.

Source/WebCore:

* dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::shiftMarkers): Use int to do the math before clamping to
unsigned. This protects against underflow.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/InsertTextAlternatives.mm:
(TestWebKitAPI::TEST): Expect success rather than failure.

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

6 weeks ago[GTK][WPE] Update some expectations
lmoura@igalia.com [Wed, 20 May 2020 02:33:02 +0000 (02:33 +0000)]
[GTK][WPE] Update some expectations

Some pageoverlay tests were also failing in WPE, and one of them has
not crashed since r253467.

Also moved the webaudio/codec/aac test to glib as WPE was also
failing.

Unreviewed test gardening.

* platform/glib/TestExpectations:
* platform/gtk/TestExpectations:

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

6 weeks agoRemove almost always incorrect Color::getRGBA
weinig@apple.com [Wed, 20 May 2020 02:13:57 +0000 (02:13 +0000)]
Remove almost always incorrect Color::getRGBA
https://bugs.webkit.org/show_bug.cgi?id=212059

Reviewed by Darin Adler and Simon Fraser.

Source/WebCore:

Removes the awkward and almost always incorrect out parameter based Color::getRGBA. Most existing callsites
were updated to use Color::toSRGBAComponentsLossy() or other more ExtendedColor supporting functions (like
cachedCGColor()).

Also adds tuple-like adaptors for FloatComponents to allow it to be used
with structured bindings. For example:

    auto [r, g, b, a] = myFloatComponents;

* platform/graphics/Color.h:
* platform/graphics/Color.cpp:
(WebCore::Color::light const):
(WebCore::Color::dark const):
(WebCore::Color::isDark const):
Adopt toSRGBAComponentsLossy() to make these not return totally incorrect values.

(WebCore::Color::colorSpaceAndComponents const):
Added. Returns a std::pair<ColorSpace, FloatComponents> for functions that need
to operate on the components in a ColorSpace aware way. Used by toSRGBAComponentsLossy
and leakCGColor() for now, but will be useful going forward as well.

(WebCore::Color::toSRGBAComponentsLossy const):
Re-implement using colorSpaceAndComponents() to simplify implementation.

(WebCore::Color::getRGBA const): Deleted.

* platform/graphics/ColorUtilities.cpp:
(WebCore::FloatComponents::FloatComponents): Deleted.
(WebCore::sRGBColorToLinearComponents): Deleted.
* platform/graphics/ColorUtilities.h:
(WebCore::FloatComponents::get const):
Remove uses of the Color class to simplify inlining (Color.h already needs to know about
FloatComponents).
    - FloatComponents constructor replaced by Color::toSRGBAComponentsLossy().
    - sRGBColorToLinearComponents replaced by calling rgbToLinearComponents(color.toSRGBAComponentsLossy()).

Also adds std::tuple adaptors for FloatComponents to allow using with stuctured bindings.

* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::HistoricMemoryCategoryInfo::HistoricMemoryCategoryInfo):
Replace getRGBA with cachedCGColor.

* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::setBackgroundColor):
Replace getRGBA with cachedCGColor.

* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
(PlatformCALayerWinInternal::setBorderColor):
Replace getRGBA with cachedCGColor.

* platform/graphics/cairo/CairoUtilities.cpp:
(WebCore::setSourceRGBAFromColor):
Replace getRGBA with toSRGBAComponentsLossy.

* platform/graphics/cairo/GradientCairo.cpp:
(WebCore::addColorStopRGBA):
(WebCore::setCornerColorRGBA):
(WebCore::interpolateColorStop):
Replace getRGBA with toSRGBAComponentsLossy.

* platform/graphics/cg/ColorCG.cpp:
(WebCore::leakCGColor):
(WebCore::cachedCGColor):
Simplify implementation (and remove use of getRGBA) by using colorSpaceAndComponents().

* platform/graphics/cg/GradientCG.cpp:
(WebCore::Gradient::platformGradient):
Replace getRGBA with colorSpaceAndComponent().

* platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::drawLighting):
Replace FloatComponents constructor taking a Color (which used getRGBA) with toSRGBAComponentsLossy.

* platform/graphics/filters/FilterOperations.cpp:
(WebCore::FilterOperations::transformColor const):
(WebCore::FilterOperations::inverseTransformColor const):
Replace getRGBA with toSRGBAComponentsLossy.

* platform/graphics/gtk/ColorGtk.cpp:
(WebCore::Color::operator GdkRGBA const):
Replace getRGBA with toSRGBAComponentsLossy.

* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawBorder):
(WebCore::TextureMapperGL::drawNumber):
(WebCore::prepareFilterProgram):
(WebCore::TextureMapperGL::drawSolidColor):
Replace getRGBA with toSRGBAComponentsLossy.

* platform/graphics/win/GradientDirect2D.cpp:
(WebCore::Gradient::generateGradient):
Replace getRGBA with toSRGBAComponentsLossy.

* platform/graphics/win/GraphicsContextCGWin.cpp:
(WebCore::GraphicsContext::drawDotsForDocumentMarker):
(WebCore::setCGStrokeColor): Deleted.
(WebCore::spellingPatternColor): Deleted.
(WebCore::grammarPatternColor): Deleted.
Replace use of getRGBA with direct use of SimpleColor instead.

* rendering/TextPaintStyle.cpp:
(WebCore::textColorIsLegibleAgainstBackgroundColor):
Replace implicit FloatComponents construction taking a Color (which used getRGBA) with explicit toSRGBAComponentsLossy.

Source/WebKit:

* UIProcess/API/wpe/WebKitColor.cpp:
(webkitColorFillFromWebCoreColor):
* UIProcess/gtk/ViewGestureControllerGtk.cpp:
(WebKit::ViewGestureController::beginSwipeGesture):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::getDocumentBackgroundColor):
Replace Color::getRGBA with Color::toSRGBAComponentsLossy()

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

6 weeks agoUse an ObjectIdentifier<> for DisplayLink observer IDs
simon.fraser@apple.com [Wed, 20 May 2020 01:32:30 +0000 (01:32 +0000)]
Use an ObjectIdentifier<> for DisplayLink observer IDs
https://bugs.webkit.org/show_bug.cgi?id=212112

Reviewed by Per Arne Vollan.

Replace unsigned observerID with DisplayLinkObserverID, which is a typesafe ObjectIdentifier<>.

Use PlatformDisplayID in more places.

* Scripts/webkit/messages.py:
* Shared/DisplayLinkObserverID.h: Copied from Source/WebKit/UIProcess/mac/DisplayLink.h.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::startDisplayLink):
(WebKit::WebProcessPool::stopDisplayLink):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* UIProcess/mac/DisplayLink.cpp:
(WebKit::DisplayLink::addObserver):
(WebKit::DisplayLink::removeObserver):
* UIProcess/mac/DisplayLink.h:
* UIProcess/mac/WebProcessProxyMac.mm:
(WebKit::WebProcessProxy::startDisplayLink):
(WebKit::WebProcessProxy::stopDisplayLink):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/mac/DrawingAreaMac.cpp:
(WebKit::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):

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

6 weeks agoUpdate some media logging
eric.carlson@apple.com [Wed, 20 May 2020 01:15:40 +0000 (01:15 +0000)]
Update some media logging
https://bugs.webkit.org/show_bug.cgi?id=212109

Reviewed by Jer Noble.

No new tests, no functional change.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::insertedIntoAncestor):
(WebCore::HTMLMediaElement::didFinishInsertingNode):
(WebCore::HTMLMediaElement::removedFromAncestor):
(WebCore::HTMLMediaElement::checkPlaybackTargetCompatablity):
(WebCore::HTMLMediaElement::canPlayType const):
(WebCore::HTMLMediaElement::waitForSourceChange):
(WebCore::HTMLMediaElement::noneSupported):
(WebCore::HTMLMediaElement::mediaLoadingFailed):
(WebCore::HTMLMediaElement::fastSeek):
(WebCore::HTMLMediaElement::seek):
(WebCore::HTMLMediaElement::seekInternal):
(WebCore::HTMLMediaElement::seekTask):
(WebCore::HTMLMediaElement::finishSeek):
(WebCore::HTMLMediaElement::currentMediaTime const):
(WebCore::HTMLMediaElement::setPreload):
(WebCore::HTMLMediaElement::playInternal):
(WebCore::HTMLMediaElement::pauseInternal):
(WebCore::HTMLMediaElement::setLoop):
(WebCore::HTMLMediaElement::setControls):
(WebCore::HTMLMediaElement::setVolume):
(WebCore::HTMLMediaElement::setMuted):
(WebCore::HTMLMediaElement::hardwareMutedStateDidChange):
(WebCore::HTMLMediaElement::configureTextTrackGroup):
(WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
(WebCore::HTMLMediaElement::mediaPlayerVolumeChanged):
(WebCore::HTMLMediaElement::mediaPlayerMuteChanged):
(WebCore::HTMLMediaElement::mediaPlayerDurationChanged):
(WebCore::HTMLMediaElement::mediaPlayerRateChanged):
(WebCore::HTMLMediaElement::mediaPlayerPlaybackStateChanged):
(WebCore::HTMLMediaElement::mediaPlayerResourceNotSupported):
(WebCore::HTMLMediaElement::mediaPlayerSizeChanged):
(WebCore::HTMLMediaElement::mediaPlayerRenderingModeChanged):
(WebCore::HTMLMediaElement::mediaPlayerEngineUpdated):
(WebCore::HTMLMediaElement::mediaPlayerFirstVideoFrameAvailable):
(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
(WebCore::HTMLMediaElement::updatePlayState):
(WebCore::HTMLMediaElement::stop):
(WebCore::HTMLMediaElement::suspend):
(WebCore::HTMLMediaElement::resume):
(WebCore::HTMLMediaElement::visibilityStateChanged):
(WebCore::HTMLMediaElement::addEventListener):
(WebCore::HTMLMediaElement::removeEventListener):
(WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
(WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget):
(WebCore::HTMLMediaElement::remoteHasAvailabilityCallbacksChanged):
(WebCore::HTMLMediaElement::enterFullscreen):
(WebCore::HTMLMediaElement::exitFullscreen):
(WebCore::HTMLMediaElement::didBecomeFullscreenElement):
(WebCore::HTMLMediaElement::setClosedCaptionsVisible):
(WebCore::HTMLMediaElement::mediaCanStart):
(WebCore::HTMLMediaElement::setShouldDelayLoadEvent):
(WebCore::HTMLMediaElement::suspendPlayback):
(WebCore::HTMLMediaElement::resumeAutoplaying):
(WebCore::HTMLMediaElement::mayResumePlayback):
(WebCore::HTMLMediaElement::didReceiveRemoteControlCommand):
(WebCore::HTMLMediaElement::setBufferingPolicy):
(WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::setState):
(WebCore::PlatformMediaSession::beginInterruption):
(WebCore::PlatformMediaSession::endInterruption):
(WebCore::PlatformMediaSession::clientWillBeginAutoplaying):
(WebCore::PlatformMediaSession::clientWillBeginPlayback):
(WebCore::PlatformMediaSession::processClientWillPausePlayback):
(WebCore::PlatformMediaSession::clientWillPausePlayback):
(WebCore::PlatformMediaSession::clientWillBeDOMSuspended):
(WebCore::PlatformMediaSession::pauseSession):
(WebCore::PlatformMediaSession::stopSession):
(WebCore::PlatformMediaSession::didReceiveRemoteControlCommand):

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