WebKit-https.git
2 years agoWTF's internal std::optional implementation should abort() on bad optional access
fred.wang@free.fr [Fri, 6 Jul 2018 11:49:39 +0000 (11:49 +0000)]
WTF's internal std::optional implementation should abort() on bad optional access
https://bugs.webkit.org/show_bug.cgi?id=186536

Patch by Frederic Wang <fwang@igalia.com> on 2018-07-06
Reviewed by Michael Catanzaro.

Currently, some ports built with recent compilers will cause the program to abort when one
tries to access the value of an unset std:optional (i.e. std::nullopt) as specified by C++17.
However, most ports still use WTF's internal std::optional implementation, which does not
verify illegal access. Hence it's not possible for developers working on these ports to
detect issues like bugs #186189, #186535, #186752, #186753, #187139, #187145, #187243 or
#187382.
WTF's version of std::optional was introduced in bug #164199 but it was not possible to
verify the availability of the value inside constexpr member functions because the assert
might involve asm declarations. This commit introduces a new ASSERT_UNDER_CONSTEXPR_CONTEXT
macro (a simplified version of ASSERT that can be used in constexpr context) and uses it in
WTF's implementation of std::optional.

* wtf/Assertions.h: Define ASSERT_UNDER_CONSTEXPR_CONTEXT as a version of ASSERT that can be
used in constexpr context (in particular avoids asm declarations).
* wtf/Optional.h:
(std::optional::operator ->): Add an assert to ensure the optional value is available.
(std::optional::operator *): Ditto.
(std::optional::value const): Ditto.
(std::optional::value): Ditto.
(std::optional<T::value const): Ditto.

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

2 years ago[GTK][WPE] REGRESSION(r233111): Test /webkit/WebKitUserContentManager/script-message...
carlosgc@webkit.org [Fri, 6 Jul 2018 10:51:33 +0000 (10:51 +0000)]
[GTK][WPE] REGRESSION(r233111): Test /webkit/WebKitUserContentManager/script-message-received fails
https://bugs.webkit.org/show_bug.cgi?id=187383

Reviewed by Žan Doberšek.

This is actually a problem in the test itself. The problem is that we run js, connect to message-received and
quite the main loop when the message is received, which happens before the run js operation has been
completed. The test finishes early and since r233111 an IPC message is still pending (I guess the run js
callback) and the web page is still protected. Just adding a run loop operation before finishing the test would
fix it. We should wait for the js run to complete, instead of the message.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitUserContentManager.cpp:
(UserScriptMessageTest::scriptMessageReceived):
(UserScriptMessageTest::waitUntilMessageReceived):
(UserScriptMessageTest::runJavaScriptFinished):
(UserScriptMessageTest::postMessageAndWaitUntilReceived):

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

2 years ago[GTK][WPE] REGRESSION(r233239): proxy settings not applied after r233239
commit-queue@webkit.org [Fri, 6 Jul 2018 10:38:46 +0000 (10:38 +0000)]
[GTK][WPE] REGRESSION(r233239): proxy settings not applied after r233239
https://bugs.webkit.org/show_bug.cgi?id=187381

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2018-07-06
Reviewed by Yusuke Suzuki.

This is because the static variable for proxy settings was replaced by a NeverDestroyed, but the function is not
returning a reference, but a copy. This is causing several unit tests to fail.

* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::proxySettings):

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

2 years ago[Crash] Illegal use of uninitialized std::optional value in WebCore::AnimationBase...
commit-queue@webkit.org [Fri, 6 Jul 2018 10:10:50 +0000 (10:10 +0000)]
[Crash] Illegal use of uninitialized std::optional value in WebCore::AnimationBase::updateStateMachine
https://bugs.webkit.org/show_bug.cgi?id=187382

Patch by Frederic Wang <fwang@igalia.com> on 2018-07-06
Reviewed by Carlos Garcia Campos.

WebCore::AnimationBase::updateStateMachine has two potential places where the use of an
uninitialized std:optional value is possible and one of them is hit when using Google drive.
Since that old animation code is going to be removed soon, we just quickly patch this issue
via value_or() so that we can restore the ASSERT added in bug 186536.

No new tests, code is going to be removed soon.

* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::updateStateMachine): Use value_or(0) to avoid potential crashes.

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

2 years agoRename HTMLTreeBuilder::didCreateCustomOrCallbackElement
commit-queue@webkit.org [Fri, 6 Jul 2018 07:48:51 +0000 (07:48 +0000)]
Rename HTMLTreeBuilder::didCreateCustomOrCallbackElement
https://bugs.webkit.org/show_bug.cgi?id=187317

Patch by Frederic Wang <fwang@igalia.com> on 2018-07-06
Reviewed by Ryosuke Niwa.

This function is called with a new custom element or the fallback HTMLUnknownElement element
so we rename it didCreateCustomOrFallbackElement.

No new tests, behavior unchanged.

* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::didCreateCustomOrFallbackElement):
(WebCore::HTMLTreeBuilder::didCreateCustomOrCallbackElement): Deleted.
* html/parser/HTMLTreeBuilder.h:

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

2 years agoREGRESSION(r233496): macOS Sierra hits debug assertions in TrackListBase::suspend
rniwa@webkit.org [Fri, 6 Jul 2018 07:37:50 +0000 (07:37 +0000)]
REGRESSION(r233496): macOS Sierra hits debug assertions in TrackListBase::suspend
https://bugs.webkit.org/show_bug.cgi?id=187378
<rdar://problem/41878885>

Reviewed by Eric Carlson.

These assertions were wrong since inline debugger, alert, etc... can suspend active DOM objects without
calling canSuspendForDocumentSuspension. Fixed the bug by removing the assertion and instead suspending
and resuming the generic event queue.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::suspend):
(WebCore::MediaSource::resume):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::suspend):
(WebCore::SourceBuffer::resume):
* Modules/mediasource/SourceBufferList.cpp:
(WebCore::SourceBufferList::suspend):
(WebCore::SourceBufferList::resume):
* html/track/TrackListBase.cpp:
(WebCore::TrackListBase::suspend):
(WebCore::TrackListBase::resume):

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

2 years agoUnreviewed GTK gardening. Remove platform expectations for imported/w3c/web-platform...
carlosgc@webkit.org [Fri, 6 Jul 2018 06:28:44 +0000 (06:28 +0000)]
Unreviewed GTK gardening. Remove platform expectations for imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/animate-no-browsing-context.html

Since r233512 we are getting the same results as other ports.

* platform/gtk/imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/animate-no-browsing-context-expected.txt: Removed.

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

2 years agoMeasurementSet should merge last four segments into two if values are identical.
dewei_zhu@apple.com [Fri, 6 Jul 2018 05:57:48 +0000 (05:57 +0000)]
MeasurementSet should merge last four segments into two if values are identical.
https://bugs.webkit.org/show_bug.cgi?id=187311

Reviewed by Ryosuke Niwa.

If last four segments has the same value, MeasurmentSet should merge them.

* public/v3/models/measurement-set.js: Added the logic to conditionally merge last segments.
(MeasurementSet.prototype.fetchSegmentation):
* unit-tests/measurement-set-tests.js: Added a unit test for this change.

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

2 years agoREGRESSION (r230843): Flash doesn't work; Produces blue box on page
youenn@apple.com [Fri, 6 Jul 2018 05:50:17 +0000 (05:50 +0000)]
REGRESSION (r230843): Flash doesn't work; Produces blue box on page
https://bugs.webkit.org/show_bug.cgi?id=187346
<rdar://problem/41773974>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Introduce clearPagesPluginData used by WebProcess when a plugin policy changes.
Add a new internals API to get the plugin count as navigator.plugin is filtering plugins.

Test: http/tests/plugins/plugin-allow-then-reload.html

* plugins/PluginData.h:
* plugins/PluginInfoProvider.cpp:
(WebCore::PluginInfoProvider::clearPagesPluginData):
* plugins/PluginInfoProvider.h:
* testing/Internals.cpp:
(WebCore::Internals::pluginCount):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

Reset page plugins when the load client policies are updated.
This will ensure that pages will rebuild their plugin lists based on the new policies.

* WebProcess/Plugins/WebPluginInfoProvider.cpp:
(WebKit::WebPluginInfoProvider::setPluginLoadClientPolicy):
(WebKit::WebPluginInfoProvider::clearPluginClientPolicies):

Tools:

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::setBlockAllPlugins):
When not blocked, set the load policy to allow once.
* WebKitTestRunner/TestController.h:

LayoutTests:

Skip new test on WK1 since it does not have the ability to block plugins.

* http/tests/plugins/plugin-allow-then-reload-expected.txt: Added.
* http/tests/plugins/plugin-allow-then-reload.html: Added.
* platform/mac-wk1/TestExpectations:

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

2 years agoIndexedDB operations in a Page fail after a StorageProcess crash.
beidson@apple.com [Fri, 6 Jul 2018 05:48:35 +0000 (05:48 +0000)]
IndexedDB operations in a Page fail after a StorageProcess crash.
<rdar://problem/41626526> and https://bugs.webkit.org/show_bug.cgi?id=187123

Reviewed by Alex Christensen.

Source/WebCore:

Test: storage/indexeddb/modern/opendatabase-after-storage-crash.html

When the connection to a StorageProcess goes away, explicitly tell all of the WebPages
in the WebProcess about it.

This puts Documents/Workers in an error mode where requests fail instead of timeout.
It also clears the Page's connection so *new* Documents and Workers will get a fresh
new connection that works.

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::callResultFunctionLater):
(WebCore::IDBClient::IDBConnectionToServer::deleteDatabase):
(WebCore::IDBClient::IDBConnectionToServer::openDatabase):
(WebCore::IDBClient::IDBConnectionToServer::createObjectStore):
(WebCore::IDBClient::IDBConnectionToServer::deleteObjectStore):
(WebCore::IDBClient::IDBConnectionToServer::renameObjectStore):
(WebCore::IDBClient::IDBConnectionToServer::clearObjectStore):
(WebCore::IDBClient::IDBConnectionToServer::createIndex):
(WebCore::IDBClient::IDBConnectionToServer::deleteIndex):
(WebCore::IDBClient::IDBConnectionToServer::renameIndex):
(WebCore::IDBClient::IDBConnectionToServer::putOrAdd):
(WebCore::IDBClient::IDBConnectionToServer::getRecord):
(WebCore::IDBClient::IDBConnectionToServer::getAllRecords):
(WebCore::IDBClient::IDBConnectionToServer::getCount):
(WebCore::IDBClient::IDBConnectionToServer::deleteRecord):
(WebCore::IDBClient::IDBConnectionToServer::openCursor):
(WebCore::IDBClient::IDBConnectionToServer::iterateCursor):
(WebCore::IDBClient::IDBConnectionToServer::establishTransaction):
(WebCore::IDBClient::IDBConnectionToServer::commitTransaction):
(WebCore::IDBClient::IDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
(WebCore::IDBClient::IDBConnectionToServer::abortTransaction):
(WebCore::IDBClient::IDBConnectionToServer::didFireVersionChangeEvent):
(WebCore::IDBClient::IDBConnectionToServer::confirmDidCloseFromServer):
(WebCore::IDBClient::IDBConnectionToServer::connectionToServerLost):
(WebCore::IDBClient::IDBConnectionToServer::openDBRequestCancelled):
(WebCore::IDBClient::IDBConnectionToServer::databaseConnectionPendingClose):
(WebCore::IDBClient::IDBConnectionToServer::databaseConnectionClosed):
(WebCore::IDBClient::IDBConnectionToServer::abortOpenAndUpgradeNeeded):
(WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
* Modules/indexeddb/client/IDBConnectionToServer.h:

* Modules/indexeddb/shared/IDBError.h:
(WebCore::IDBError::serverConnectionLostError):

* page/Page.cpp:
(WebCore::Page::setSessionID):
(WebCore::Page::idbConnection):
(WebCore::Page::optionalIDBConnection):
(WebCore::Page::clearIDBConnection):
* page/Page.h:

Source/WebKit:

When the connection to a StorageProcess goes away, explicitly tell all of the WebPages
in the WebProcess about it.

This puts Documents/Workers in an error mode where requests fail instead of timeout.
It also clears the Page's connection so *new* Documents and Workers will get a fresh
new connection that works.

* UIProcess/API/C/WKContext.cpp:
(WKContextTerminateStorageProcess):

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _terminateStorageProcess]):

* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::terminateForTesting):
* UIProcess/Storage/StorageProcessProxy.h:

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::terminateStorageProcessForTesting):
(WebKit::WebProcessPool::terminateStorageProcess): Deleted.
* UIProcess/WebProcessPool.h:

* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::didClose):
* WebProcess/Storage/WebToStorageProcessConnection.h:
(WebKit::WebToStorageProcessConnection::existingIDBConnectionToServerForIdentifier):

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::webToStorageProcessConnectionClosed):

LayoutTests:

* storage/indexeddb/modern/opendatabase-after-storage-crash.html: Added.

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

2 years agoAddress two possible causes of missing tiles in iOS Safari, and add logging to gather...
simon.fraser@apple.com [Fri, 6 Jul 2018 04:56:40 +0000 (04:56 +0000)]
Address two possible causes of missing tiles in iOS Safari, and add logging to gather more data about other possible causes
https://bugs.webkit.org/show_bug.cgi?id=187376
rdar://problem/40941118

Reviewed by Tim Horton.

We have continual reports of users experiencing missing tiles in MobileSafari, where loading a page
shows the tiles at the top, but we don't render new tiles as the user scrolls down. This is consistent
with failing to dispatch visible content rect updates via -[WKWebView _updateVisibleContentRects].

This patch addresses two possible (but unlikely) causes. First, it resets _currentlyAdjustingScrollViewInsetsForKeyboard
after a web process crash. Second, it catches exceptions thrown by [webView _updateVisibleContentRects]
and resets _hasScheduledVisibleRectUpdate.

This patch also adds release logging that fires if over 1s has elapsed between scheduling
a visible content rect update and trying to re-schedule, and logging for all reasons that
-_updateVisibleContentRects returns early.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _processDidExit]):
(-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
(-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
(-[WKWebView _updateVisibleContentRects]):

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

2 years agoYoutube video pages crash after a couple of minutes
rniwa@webkit.org [Fri, 6 Jul 2018 03:20:20 +0000 (03:20 +0000)]
Youtube video pages crash after a couple of minutes
https://bugs.webkit.org/show_bug.cgi?id=187316

Reviewed by Antti Koivisto.

Source/WebCore:

The crash was caused by HTMLMediaElement::stopWithoutDestroyingMediaPlayer invoking updatePlaybackControlsManager,
which traverses all media players across different documents including the one in the main frame while its iframe
is getting removed (to update the Touch Bar's media control).

Fixed the bug by making this code async in both stopWithoutDestroyingMediaPlayer and ~HTMLMediaElement. To do this,
this patch moves the timer to update the playback controls manager from HTMLMediaElement to Page since scheduling
a timer owned by HTMLMediaElement in its destructor wouldn't work as the timer would get destructed immediately.

Also replaced the call to clientWillPausePlayback by a call to stopSession in stopWithoutDestroyingMediaPlayer
since the former also updates the layout synchronously via updateNowPlayingInfo; the latter function schedules
a timer via scheduleUpdateNowPlayingInfo instead.

Test: media/remove-video-best-media-element-in-main-frame-crash.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement): Call scheduleUpdatePlaybackControlsManager now that timer has been
moved to Page.
(WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager): Made this return a RefPtr instead of
a raw pointer while we're at it.
(WebCore::HTMLMediaElement::clearMediaPlayer): Call scheduleUpdatePlaybackControlsManager.
(WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto. Also invoke stopSession instead of
clientWillPausePlayback on MediaSession since clientWillPausePlayback will synchronously try to update the layout.
(WebCore::HTMLMediaElement::contextDestroyed):
(WebCore::HTMLMediaElement::stop):
(WebCore::HTMLMediaElement::schedulePlaybackControlsManagerUpdate): Renamed from scheduleUpdatePlaybackControlsManager.
(WebCore::HTMLMediaElement::updatePlaybackControlsManager): Moved to Page::playbackControlsManagerUpdateTimerFired.
* html/HTMLMediaElement.h:
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::schedulePlaybackControlsManagerUpdate): Added.
(WebCore::Page::playbackControlsManagerUpdateTimerFired): Moved from HTMLMediaElement::updatePlaybackControlsManager.
* page/Page.h:
* testing/Internals.cpp:
(WebCore::Internals::bestMediaElementForShowingPlaybackControlsManager):
* testing/Internals.h:

LayoutTests:

Added a regression test to remove an iframe with a video while there is a main content
which is eligible to be shown in the Touch Bar.

* media/remove-video-best-media-element-in-main-frame-crash-expected.txt: Added.
* media/remove-video-best-media-element-in-main-frame-crash.html: Added.

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

2 years agoREGRESSION(r233496): Crash in WebCore::VideoTrack::clearClient()
rniwa@webkit.org [Fri, 6 Jul 2018 02:32:52 +0000 (02:32 +0000)]
REGRESSION(r233496): Crash in WebCore::VideoTrack::clearClient()
https://bugs.webkit.org/show_bug.cgi?id=187377

Reviewed by Simon Fraser.

Clear m_client of an audio track or a video track before removing it from the list
since TrackListBase::m_inbandTracks may hold the last ref to the track.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::removeAudioTrack):
(WebCore::HTMLMediaElement::removeVideoTrack):

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

2 years agoREGRESSION(r233495) [cairo] drawGlyphsShadow should use the fast path for zero blur...
Hironori.Fujii@sony.com [Fri, 6 Jul 2018 01:56:48 +0000 (01:56 +0000)]
REGRESSION(r233495) [cairo] drawGlyphsShadow should use the fast path for zero blur-radius
https://bugs.webkit.org/show_bug.cgi?id=187336

Reviewed by Carlos Garcia Campos.

Source/WebCore:

drawGlyphsShadow has a fast path to draw a shadow without a shadow
layer. Since r233495, it is not used for zero blur-radius shadow.

In Bug 187244, I changed ShadowState::isRequired not to check
blur-radius is zero. This is not a right fix.

This change reverts r233495.

No new tests (Covered by existing tests).

* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::ShadowState::isRequired const): Return false if
'blur' is zero.
(WebCore::Cairo::fillRectWithRoundedHole): Use
ShadowState::isVisible instead of ShadowState::isRequired to check
a shadow should be drawn.

LayoutTests:

* platform/gtk/TestExpectations: Unmarked fast/text/multiple-text-shadow-overflow-layout-rect.html.

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

2 years ago[mac-wk1] Layout Test editing/selection/navigation-clears-editor-state.html is a...
sbarati@apple.com [Fri, 6 Jul 2018 01:35:31 +0000 (01:35 +0000)]
[mac-wk1] Layout Test editing/selection/navigation-clears-editor-state.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=187309

Reviewed by Mark Lam.

Try to make this test less flaky by making percents threshold of freed
objects smaller.

* editing/selection/navigation-clears-editor-state-expected.txt:
* editing/selection/navigation-clears-editor-state.html:

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

2 years agoLayout Test http/tests/workers/service/basic-messageport.html is flaky
youenn@apple.com [Fri, 6 Jul 2018 00:43:20 +0000 (00:43 +0000)]
Layout Test http/tests/workers/service/basic-messageport.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=182630

Reviewed by Alex Christensen.

Test is flaky due to a race between serviceWorkerClient.postMessage and MessagePort.postMessage.
Both are going through UIProcess but MessagePort events are grabbed asynchronously.
Fixed the test to not expect order between these two message exchange channels.

* http/tests/workers/service/basic-messageport-expected.txt:
* http/tests/workers/service/resources/basic-messageport.js:
(channel.port1.onmessage):
(then):
* platform/mac-wk2/TestExpectations:

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

2 years agoiPad: Scrolling with hardware keyboard while SELECT popover is visible scrolls the...
commit-queue@webkit.org [Fri, 6 Jul 2018 00:40:22 +0000 (00:40 +0000)]
iPad: Scrolling with hardware keyboard while SELECT popover is visible scrolls the page, detaches popover
https://bugs.webkit.org/show_bug.cgi?id=187363
<rdar://problem/41106306>

Patch by Olivia Barnett <obarnett@apple.com> on 2018-07-05
Reviewed by Tim Horton.

Added extra check to prevent keyboard scrolling when the select box is open.

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

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

2 years agoRename and flip the meaning of defaultAppearance to be useDarkAppearance.
timothy@apple.com [Fri, 6 Jul 2018 00:38:10 +0000 (00:38 +0000)]
Rename and flip the meaning of defaultAppearance to be useDarkAppearance.
https://bugs.webkit.org/show_bug.cgi?id=187369
rdar://problem/41870420

Reviewed by Tim Horton.

Source/WebCore:

* Modules/mediasession/WebMediaSessionManager.cpp:
(WebCore::WebMediaSessionManager::showPlaybackTargetPicker):
* css/MediaQueryEvaluator.cpp:
(WebCore::prefersDarkInterfaceEvaluate):
* css/StyleColor.h:
* dom/Document.cpp:
(WebCore::Document::useDarkAppearance const):
(WebCore::Document::styleColorOptions const):
(WebCore::Document::useDefaultAppearance const): Deleted.
* dom/Document.h:
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::paint):
* page/Page.cpp:
(WebCore::Page::useDarkAppearance const):
(WebCore::Page::defaultAppearance const): Deleted.
* page/Page.h:
(WebCore::Page::setUseDarkAppearance):
(WebCore::Page::setDefaultAppearance): Deleted.
* platform/Theme.h:
* platform/graphics/MediaPlaybackTargetPicker.h:
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
(WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
* platform/mac/DragImageMac.mm:
(WebCore::createDragImageForLink):
* platform/mac/LocalDefaultSystemAppearance.h:
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
* platform/mac/ThemeMac.h:
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::paint):
* platform/mock/MediaPlaybackTargetPickerMock.cpp:
(WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker):
* platform/mock/MediaPlaybackTargetPickerMock.h:
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::resolveStyleForMarkedText):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintContents):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::paintContents):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::documentViewFor const):
(WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const):
(WebCore::RenderThemeMac::supportsSelectionForegroundColors const):
(WebCore::RenderThemeMac::platformActiveSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformActiveListBoxSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformActiveTextSearchHighlightColor const):
(WebCore::RenderThemeMac::colorCache const):
(WebCore::RenderThemeMac::systemColor const):
(WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
(WebCore::RenderThemeMac::paintSliderThumb):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::draw):

Source/WebKit:

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _effectiveAppearanceIsDark]):
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _setUseSystemAppearance:]):
(-[WKWebView effectiveAppearanceDidChange]):
(-[WKWebView _defaultAppearance]): Deleted.
* UIProcess/API/mac/WKView.mm:
(-[WKView _effectiveAppearanceIsDark]):
(-[WKView effectiveAppearanceDidChange]):
(-[WKView _setUseSystemAppearance:]):
(-[WKView _defaultAppearance]): Deleted.
(-[WKView _setDefaultAppearance:]): Deleted.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::effectiveAppearanceIsDark):
(WebKit::WebViewImpl::setUseDarkAppearance):
(WebKit::WebViewImpl::useDefaultAppearance): Deleted.
(WebKit::WebViewImpl::setDefaultAppearance): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::setUseDarkAppearance):
(WebKit::WebPageProxy::showPlaybackTargetPicker):
(WebKit::WebPageProxy::setDefaultAppearance): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::useDarkAppearance const):
(WebKit::WebPageProxy::defaultAppearance const): Deleted.
* UIProcess/mac/WKPrintingView.mm:
(-[WKPrintingView drawRect:]):
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::renderedImage):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::paintControlForLayerInContext):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_credentialsMessenger):
(WebKit::WebPage::drawRect):
(WebKit::WebPage::setUseDarkAppearance):
(WebKit::WebPage::setDefaultAppearance): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Source/WebKitLegacy/mac:

* WebView/WebMediaPlaybackTargetPicker.mm:
(WebMediaPlaybackTargetPicker::showPlaybackTargetPicker):
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView _effectiveAppearanceIsDark]):
(-[WebView _updateDefaultAppearance]):
(-[WebView _defaultAppearance]): Deleted.

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

2 years agoLayoutTest imported/w3c/web-platform-tests/IndexedDB/interfaces.any.worker.html is...
david_fenton@apple.com [Fri, 6 Jul 2018 00:25:04 +0000 (00:25 +0000)]
LayoutTest imported/w3c/web-platform-tests/IndexedDB/interfaces.any.worker.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=187372

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years agoBuild fix (r233547): Disable IsoHeaps when Gigacage is off
ddkilzer@apple.com [Fri, 6 Jul 2018 00:19:57 +0000 (00:19 +0000)]
Build fix (r233547): Disable IsoHeaps when Gigacage is off
<https://webkit.org/b/187160>

* bmalloc/PerThread.cpp: Add #if !HAVE_PTHREAD_MACHDEP_H/#endif
around variables only used when that macro is 0.  Include what
you use: Cache.h and Heap.h.
* bmalloc/PerThread.h: Include <memory> for std::once_flag.

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

2 years agoUnreviewed, rolling out r233539.
commit-queue@webkit.org [Thu, 5 Jul 2018 23:24:53 +0000 (23:24 +0000)]
Unreviewed, rolling out r233539.
https://bugs.webkit.org/show_bug.cgi?id=187368

Changes made for youtube crashes has caused 15 api failures
(Requested by Truitt on #webkit).

Reverted changeset:

"Youtube video pages crash after a couple of minutes"
https://bugs.webkit.org/show_bug.cgi?id=187316
https://trac.webkit.org/changeset/233539

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

2 years agoREGRESSION: ASSERT under WebAutomationSessionProxy::computeElementLayout when element...
bburg@apple.com [Thu, 5 Jul 2018 23:17:40 +0000 (23:17 +0000)]
REGRESSION: ASSERT under WebAutomationSessionProxy::computeElementLayout when elementInViewClientCenterPoint returns nullopt
https://bugs.webkit.org/show_bug.cgi?id=187367
<rdar://problem/41861346>

Reviewed by Timothy Hatcher.

* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::computeElementLayout):
There's no reason to unwrap this optional, as the IPC argument type is std::optional<IntPoint>.

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

2 years agoDisable IsoHeaps when Gigacage is off
msaboff@apple.com [Thu, 5 Jul 2018 23:12:04 +0000 (23:12 +0000)]
Disable IsoHeaps when Gigacage is off
https://bugs.webkit.org/show_bug.cgi?id=187160

Reviewed by Saam Barati.

Updated determineMallocFallbackState to base enabling of Iso Heaps on Gigacage
being enabled.  We do this because if Gigacage is disabled, it may be due to lack
of address space.

To work around a compiler issue uncovered by the change above, I added explicit
instantiation of PerThread's static variables.  Defined the same explicit
instantiated static variables with export scope in the new file PerThread.cpp
to eliminate separate variables allocations in each linked framework / library.

* CMakeLists.txt:
* bmalloc.xcodeproj/project.pbxproj:
* bmalloc/IsoTLS.cpp:
(bmalloc::IsoTLS::determineMallocFallbackState):
* bmalloc/PerThread.cpp: Added.
* bmalloc/PerThread.h:

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

2 years agoUpstream hover gesture implementation
timothy_horton@apple.com [Thu, 5 Jul 2018 22:28:17 +0000 (22:28 +0000)]
Upstream hover gesture implementation
https://bugs.webkit.org/show_bug.cgi?id=187366

Reviewed by Wenson Hsieh.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView _hoverGestureRecognizerChanged:]):

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

2 years agoUpdate Element API to use qualifiedName instead of name/localName where applicable
cdumez@apple.com [Thu, 5 Jul 2018 22:20:39 +0000 (22:20 +0000)]
Update Element API to use qualifiedName instead of name/localName where applicable
https://bugs.webkit.org/show_bug.cgi?id=187347

Reviewed by Darin Adler.

Update Element API to use qualifiedName instead of name/localName where applicable. Naming
is now consistent with the IDL and the specification:
- https://dom.spec.whatwg.org/#element

Our implementation properly deals with qualified names already, even though the parameters
were named localName.

* dom/Element.cpp:
(WebCore::Element::getAttribute const):
(WebCore::Element::toggleAttribute):
(WebCore::Element::setAttribute):
(WebCore::Element::removeAttribute):
(WebCore::Element::getAttributeNode):
(WebCore::Element::hasAttribute const):
* dom/Element.h:

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

2 years agoFix some -Wdocumentation warnings in WebKit
timothy_horton@apple.com [Thu, 5 Jul 2018 22:20:08 +0000 (22:20 +0000)]
Fix some -Wdocumentation warnings in WebKit
https://bugs.webkit.org/show_bug.cgi?id=187318

Reviewed by Dan Bernstein.

Fix most of the -Wdocumentation warnings in WebKit. The remaining
ones are slightly mysterious, so we can't turn the warning on yet.

* Configurations/BaseTarget.xcconfig:
Define U_HIDE_DEPRECATED_API. It's defined in all other WebKit projects,
and the doc comments in the deprecated ICU API have some errors.

* UIProcess/API/Cocoa/WKUIDelegate.h:
* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.h:
Adjust comments or parameter names to be consistent with each other.

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

2 years agoVersioning.
kocsen_chung@apple.com [Thu, 5 Jul 2018 21:51:25 +0000 (21:51 +0000)]
Versioning.

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

2 years agoUnreviewed, rolling out r233417 and r233418.
commit-queue@webkit.org [Thu, 5 Jul 2018 21:46:35 +0000 (21:46 +0000)]
Unreviewed, rolling out r233417 and r233418.
https://bugs.webkit.org/show_bug.cgi?id=187364

Introduced an occasional crash on Google Drive (Requested by
rniwa on #webkit).

Reverted changesets:

"WTF's internal std::optional implementation should abort() on
bad optional access"
https://bugs.webkit.org/show_bug.cgi?id=186536
https://trac.webkit.org/changeset/233417

"WTF's internal std::optional implementation should abort() on
bad optional access"
https://bugs.webkit.org/show_bug.cgi?id=186536
https://trac.webkit.org/changeset/233418

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

2 years agoProgramExecutable may be collected as we checkSyntax on it
sbarati@apple.com [Thu, 5 Jul 2018 21:35:09 +0000 (21:35 +0000)]
ProgramExecutable may be collected as we checkSyntax on it
https://bugs.webkit.org/show_bug.cgi?id=187359
<rdar://problem/41832135>

Reviewed by Mark Lam.

The bug was we were passing in a reference to the SourceCode field on ProgramExecutable as
the ProgramExecutable itself may be collected. The fix here is to make a copy
of the field instead of passing in a reference inside of ParserError::toErrorObject.

No new tests here as this was already caught by our iOS JSC testers.

* parser/ParserError.h:
(JSC::ParserError::toErrorObject):

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

2 years agoYoutube video pages crash after a couple of minutes
rniwa@webkit.org [Thu, 5 Jul 2018 21:02:47 +0000 (21:02 +0000)]
Youtube video pages crash after a couple of minutes
https://bugs.webkit.org/show_bug.cgi?id=187316

Reviewed by Antti Koivisto.

Source/WebCore:

The crash was caused by HTMLMediaElement::stopWithoutDestroyingMediaPlayer invoking updatePlaybackControlsManager,
which traverses all media players across different documents including the one in the main frame while its iframe
is getting removed (to update the Touch Bar's media control).

Fixed the bug by making this code async in both stopWithoutDestroyingMediaPlayer and ~HTMLMediaElement. To do this,
this patch moves the timer to update the playback controls manager from HTMLMediaElement to Page since scheduling
a timer owned by HTMLMediaElement in its destructor wouldn't work as the timer would get destructed immediately.

Also replaced the call to clientWillPausePlayback by a call to stopSession in stopWithoutDestroyingMediaPlayer
since the former also updates the layout synchronously via updateNowPlayingInfo; the latter function schedules
a timer via scheduleUpdateNowPlayingInfo instead.

Test: media/remove-video-best-media-element-in-main-frame-crash.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement): Call scheduleUpdatePlaybackControlsManager now that timer has been
moved to Page.
(WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager): Made this return a RefPtr instead of
a raw pointer while we're at it.
(WebCore::HTMLMediaElement::clearMediaPlayer): Call scheduleUpdatePlaybackControlsManager.
(WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto. Also invoke stopSession instead of
clientWillPausePlayback on MediaSession since clientWillPausePlayback will synchronously try to update the layout.
(WebCore::HTMLMediaElement::contextDestroyed):
(WebCore::HTMLMediaElement::stop):
(WebCore::HTMLMediaElement::scheduleUpdatePlaybackControlsManager):
(WebCore::HTMLMediaElement::updatePlaybackControlsManager): Moved to Page::schedulePlaybackControlsManagerUpdate.
* html/HTMLMediaElement.h:
* page/Page.cpp:
(WebCore::Page::schedulePlaybackControlsManagerUpdate): Added.
* page/Page.h:
* testing/Internals.cpp:
(WebCore::Internals::bestMediaElementForShowingPlaybackControlsManager):
* testing/Internals.h:

Source/WebKitLegacy/mac:

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

LayoutTests:

Added a regression test to remove an iframe with a video while there is a main content
which is eligible to be shown in the Touch Bar.

* media/remove-video-best-media-element-in-main-frame-crash-expected.txt: Added.
* media/remove-video-best-media-element-in-main-frame-crash.html: Added.

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

2 years agoRegression(r232886): WebsiteDataStore objects may get destroyed on a background thread
cdumez@apple.com [Thu, 5 Jul 2018 20:41:48 +0000 (20:41 +0000)]
Regression(r232886): WebsiteDataStore objects may get destroyed on a background thread
https://bugs.webkit.org/show_bug.cgi?id=187356
<rdar://problem/41854555>

Reviewed by Geoffrey Garen.

As of r232886, CallbackAggregators in WebsiteDataStore hold a Ref<> to their WebsiteDataStore. This
is an issue because CallbackAggregator objects can get destroyed on a background thread and may be
the last ones holding a ref to the data store. When this happens, the WebsiteDataStore would get
destroyed on a background store and potentially cause crashes. Note that even if the callback
aggregator would not be the last one to hold a ref to the store, it still would not be safe to deref
the store on the background thread since WebsiteDataStore is not ThreadSafeRefCounted.

To address the issue, this patch updates the CallbackAggregators' destructor to deref their data
store member on the main thread. Note that we could also have WebsiteDataStore subclass
ThreadSafeRefCounted<T, DestructionThread::Main> but the data store technically does not need to
be ThreadSafeRefCounted at the moment.

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
(WebKit::WebsiteDataStore::~WebsiteDataStore):
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::WebsiteDataStore::removeData):

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

2 years agoDo not assume that hypen's width can be computed using the simplified text measure...
zalan@apple.com [Thu, 5 Jul 2018 20:28:54 +0000 (20:28 +0000)]
Do not assume that hypen's width can be computed using the simplified text measure codepath.
https://bugs.webkit.org/show_bug.cgi?id=187352
<rdar://problem/40821283>

Reviewed by Simon Fraser.

Source/WebCore:

Just because the text content is qualified for simplified text measure, it does not necessarily mean the hyphen is simple enough as well.

Test: fast/text/hyphen-is-complex-crash.html

* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator):
* rendering/SimpleLineLayoutTextFragmentIterator.h:

LayoutTests:

* fast/text/hyphen-is-complex-crash-expected.txt: Added.
* fast/text/hyphen-is-complex-crash.html: Added.

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

2 years ago[macOS] REGRESSION: Development WebContent service has restricted entitlements, rende...
mitz@apple.com [Thu, 5 Jul 2018 19:45:27 +0000 (19:45 +0000)]
[macOS] REGRESSION: Development WebContent service has restricted entitlements, rendering it useless for development
https://bugs.webkit.org/show_bug.cgi?id=187355

Reviewed by Anders Carlsson.

* Configurations/WebContentService.Development.xcconfig: Set WK_USE_RESTRICTED_ENTITLEMENTS
  to NO for the Development service.

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

2 years agoVideo sometimes flickers when playing to AppleTV
eric.carlson@apple.com [Thu, 5 Jul 2018 19:42:29 +0000 (19:42 +0000)]
Video sometimes flickers when playing to AppleTV
https://bugs.webkit.org/show_bug.cgi?id=187193
<rdar://problem/40153865>

Unreviewed, fix a broken API test.

* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::setCategory): None should set the category to AVAudioSessionCategoryAmbient,
because it signals that WebKit is not playing audio so we want allow other apps to play.

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

2 years agoUse ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) in ScrollAnimatorMac.mm
pvollan@apple.com [Thu, 5 Jul 2018 19:39:44 +0000 (19:39 +0000)]
Use ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) in ScrollAnimatorMac.mm
https://bugs.webkit.org/show_bug.cgi?id=187334

Reviewed by Alex Christensen.

Use ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) instead of __MAC_OS_X_VERSION_MIN_REQUIRED when deciding
to use NSTimer or NSAnimation for scrollbar animation.

No new tests. No change in behavior.

* platform/mac/ScrollAnimatorMac.mm:
(-[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]):
(-[WebScrollbarPartAnimation startAnimation]):
(-[WebScrollbarPartAnimation setCurrentProgress:setCurrentProgress:]):

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

2 years ago[WK1] editing/spelling/markers.html times out on High Sierra after r233439
wenson_hsieh@apple.com [Thu, 5 Jul 2018 19:28:01 +0000 (19:28 +0000)]
[WK1] editing/spelling/markers.html times out on High Sierra after r233439
https://bugs.webkit.org/show_bug.cgi?id=187351

Reviewed by Tim Horton.

This is currently timing out on High Sierra, because the `verifyUnexpectedMarkers` portion of the
test fails to actually make use of the override spell checking results. Fix this by passing the
results when calling the function.

* editing/spelling/markers.html:

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

2 years agoDon't invert text color for selections in light mode.
timothy@apple.com [Thu, 5 Jul 2018 19:11:39 +0000 (19:11 +0000)]
Don't invert text color for selections in light mode.
https://bugs.webkit.org/show_bug.cgi?id=187349
rdar://problem/41297946

Reviewed by Tim Horton.

Fix color caching in RenderTheme so we don't cache a dark mode color
for a light appearance, or vise versa. Use the new color caching
in RenderThemeMac, and clear the color caches in purgeCaches.

Allow supportsSelectionForegroundColors to conditionalize on StyleColor::Options.
Return true only in dark mode.

* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::activeSelectionBackgroundColor const):
(WebCore::RenderTheme::inactiveSelectionBackgroundColor const):
(WebCore::RenderTheme::activeSelectionForegroundColor const):
(WebCore::RenderTheme::inactiveSelectionForegroundColor const):
(WebCore::RenderTheme::activeListBoxSelectionBackgroundColor const):
(WebCore::RenderTheme::inactiveListBoxSelectionBackgroundColor const):
(WebCore::RenderTheme::activeListBoxSelectionForegroundColor const):
(WebCore::RenderTheme::inactiveListBoxSelectionForegroundColor const):
(WebCore::RenderTheme::purgeCaches):
(WebCore::RenderTheme::platformColorsDidChange):
(WebCore::RenderTheme::activeTextSearchHighlightColor const):
(WebCore::RenderTheme::inactiveTextSearchHighlightColor const):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::supportsSelectionForegroundColors const):
(WebCore::RenderTheme::supportsListBoxSelectionForegroundColors const):
(WebCore::RenderTheme::colorCache const):
(WebCore::RenderTheme::purgeCaches): Deleted.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::purgeCaches):
(WebCore::RenderThemeMac::supportsSelectionForegroundColors const):
(WebCore::RenderThemeMac::platformActiveSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformColorsDidChange):
(WebCore::RenderThemeMac::colorCache const):
(WebCore::RenderThemeMac::systemColor const):

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

2 years ago[ews-build] Bindings-tests-EWS should output result in json
aakash_jain@apple.com [Thu, 5 Jul 2018 18:36:25 +0000 (18:36 +0000)]
[ews-build] Bindings-tests-EWS should output result in json
https://bugs.webkit.org/show_bug.cgi?id=187330

Reviewed by David Kilzer.

* BuildSlaveSupport/ews-build/steps.py:
(RunBindingsTests):  Passed --json-output parameter to run-bindings-tests.
* BuildSlaveSupport/ews-build/steps_unittest.py: Updated unit-tests.

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

2 years agoSimpleLineLayout::FlowContents wastes 54KB of Vector capacity on nytimes.com
zalan@apple.com [Thu, 5 Jul 2018 18:18:22 +0000 (18:18 +0000)]
SimpleLineLayout::FlowContents wastes 54KB of Vector capacity on nytimes.com
https://bugs.webkit.org/show_bug.cgi?id=186709
<rdar://problem/41173793>

Reviewed by Simon Fraser.

The size of the m_segments vector in SimpleLineLayoutFlowContents is alway pre-computed and don't change after the initial append.

Not testable.

* rendering/SimpleLineLayoutFlowContents.h:

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

2 years ago[ews-build] WebKitPy-Tests-EWS should output result in json
aakash_jain@apple.com [Thu, 5 Jul 2018 17:49:14 +0000 (17:49 +0000)]
[ews-build] WebKitPy-Tests-EWS should output result in json
https://bugs.webkit.org/show_bug.cgi?id=187331

Follow-up fix to r233527. Extracting jsonFileName as a variable and re-using it.

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

2 years ago[ews-build] WebKitPy-Tests-EWS should output result in json
aakash_jain@apple.com [Thu, 5 Jul 2018 17:25:06 +0000 (17:25 +0000)]
[ews-build] WebKitPy-Tests-EWS should output result in json
https://bugs.webkit.org/show_bug.cgi?id=187331

Reviewed by David Kilzer.

* BuildSlaveSupport/ews-build/steps.py:
(RunWebKitPyTests): Passed --json-output parameter to test-webkitpy.
* BuildSlaveSupport/ews-build/steps_unittest.py: Updated unit-tests.

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

2 years agoAX: setValue on text controls should send out key events
n_wang@apple.com [Thu, 5 Jul 2018 17:20:24 +0000 (17:20 +0000)]
AX: setValue on text controls should send out key events
https://bugs.webkit.org/show_bug.cgi?id=186690
<rdar://problem/41169985>

Reviewed by Chris Fleizach.

Source/WebCore:

Use Editor's insertText function when the text control element is being
focused, so that the InputEvent will be dispatched properly.

Test: accessibility/mac/set-value-editable-dispatch-events.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::setValue):

LayoutTests:

* accessibility/mac/set-value-editable-dispatch-events-expected.txt: Added.
* accessibility/mac/set-value-editable-dispatch-events.html: Added.

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

2 years agoLayout Test svg/animations/animateMotion-additive-2c.svg and svg/animations/animateMo...
commit-queue@webkit.org [Thu, 5 Jul 2018 17:07:16 +0000 (17:07 +0000)]
Layout Test svg/animations/animateMotion-additive-2c.svg and svg/animations/animateMotion-additive-2d.svg is flaky
https://bugs.webkit.org/show_bug.cgi?id=187345

Unreviewed test gardening.

Patch by Truitt Savell <tsavell@apple.com> on 2018-07-05

* platform/mac-wk2/TestExpectations:

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

2 years agoASSERT(m_dictionaryStack.size() == 1) assertion hit in ~KeyedDecoderCF() when decodin...
cdumez@apple.com [Thu, 5 Jul 2018 16:05:26 +0000 (16:05 +0000)]
ASSERT(m_dictionaryStack.size() == 1) assertion hit in ~KeyedDecoderCF() when decoding fails
https://bugs.webkit.org/show_bug.cgi?id=187152

Reviewed by Brent Fulgham.

Whenever a call to KeyedDecoderCF::beginArrayElement() succeeds (returns true), it
appends an item to m_dictionaryStack which is expected to get popped later on via
a matching call to KeyedDecoderCF::endArrayElement(). The ASSERT(m_dictionaryStack.size() == 1)
assertion in the destructor protects against a begin / end mismatch.

However, there was a bug in KeyedDecoder::decodeObjects(), which would cause us to return early
after a call to beginArrayElement() when the lambda function call returns false, causing us
not to call the matching endArrayElement() in this case. This patch addresses the issue by
calling endArrayElement() before returning early.

This bug was uncovered by r233309 which slightly changed the ITP encoding / decoding format.
Because empty HashCountedSets are now expected to be encoded as empty array, decoding of old
data fails and we hit the buggy code path.

* platform/KeyedCoding.h:
(WebCore::KeyedDecoder::decodeObjects):

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

2 years agoMove CSSParserContext to a file of its own
antti@apple.com [Thu, 5 Jul 2018 15:46:25 +0000 (15:46 +0000)]
Move CSSParserContext to a file of its own
https://bugs.webkit.org/show_bug.cgi?id=187342

Reviewed by Zalan Bujtas.

Move it out from CSSParserMode.h and CSSParser.cpp.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* contentextensions/ContentExtensionParser.cpp:
* css/PropertySetCSSStyleDeclaration.h:
* css/StyleProperties.h:
* css/StyleSheetContents.h:
* css/parser/CSSDeferredParser.h:
* css/parser/CSSParser.cpp:
(WebCore::strictCSSParserContext): Deleted.
(WebCore::CSSParserContext::CSSParserContext): Deleted.
(WebCore::operator==): Deleted.
* css/parser/CSSParser.h:
* css/parser/CSSParserContext.cpp: Added.
(WebCore::strictCSSParserContext):
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):

Also add the missing textAutosizingEnabled bit.

* css/parser/CSSParserContext.h: Copied from Source/WebCore/css/parser/CSSParserMode.h.
(WebCore::CSSParserContextHash::hash):

Also add the missing bits to the hash function.

(WebCore::isQuirksModeBehavior): Deleted.
(WebCore::isUASheetBehavior): Deleted.
(WebCore::isUnitLessValueParsingEnabledForMode): Deleted.
(WebCore::isCSSViewportParsingEnabledForMode): Deleted.
(WebCore::strictToCSSParserMode): Deleted.
(WebCore::isStrictParserMode): Deleted.
* css/parser/CSSParserIdioms.h:
* css/parser/CSSParserImpl.h:
* css/parser/CSSParserMode.h:
(WebCore::CSSParserContext::completeURL const): Deleted.
(WebCore::operator!=): Deleted.
(WebCore::CSSParserContextHash::hash): Deleted.
(WebCore::CSSParserContextHash::equal): Deleted.
(WTF::HashTraits<WebCore::CSSParserContext>::constructDeletedValue): Deleted.
(WTF::HashTraits<WebCore::CSSParserContext>::isDeletedValue): Deleted.
(WTF::HashTraits<WebCore::CSSParserContext>::emptyValue): Deleted.
* css/parser/CSSPropertyParserHelpers.h:
* css/parser/CSSSelectorParser.cpp:
* css/parser/CSSVariableParser.cpp:

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

2 years ago[Web Animations] The ready promise should initially be resolved
graouts@webkit.org [Thu, 5 Jul 2018 14:56:13 +0000 (14:56 +0000)]
[Web Animations] The ready promise should initially be resolved
https://bugs.webkit.org/show_bug.cgi?id=187341
<rdar://problem/41844711>

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark WPT progressions.

* web-platform-tests/web-animations/interfaces/Animation/finish-expected.txt:
* web-platform-tests/web-animations/timing-model/animations/current-time-expected.txt:
* web-platform-tests/web-animations/timing-model/animations/set-the-animation-start-time-expected.txt:

Source/WebCore:

The Web Animations spec mandates that the ready promise is initially resolved.

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::WebAnimation):

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

2 years ago[GTK] Remove soup/DownloadSoupErrors.h
commit-queue@webkit.org [Thu, 5 Jul 2018 14:18:02 +0000 (14:18 +0000)]
[GTK] Remove soup/DownloadSoupErrors.h
https://bugs.webkit.org/show_bug.cgi?id=187339

This header is not used anymore.

Patch by Rob Buis <rbuis@igalia.com> on 2018-07-05
Reviewed by Frédéric Wang.

* NetworkProcess/Downloads/soup/DownloadSoupErrors.h: Removed.
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
* PlatformGTK.cmake:

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

2 years ago[Flatpak] Add gst-libav to dependencies
philn@webkit.org [Thu, 5 Jul 2018 13:43:30 +0000 (13:43 +0000)]
[Flatpak] Add gst-libav to dependencies
https://bugs.webkit.org/show_bug.cgi?id=187340

Reviewed by Žan Doberšek.

* flatpak/org.webkit.WebKit.yaml: Use tarballs instead of git
clones because the FFMPeg git server doesn't support shallow
clones.

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

2 years ago[GTK][WPE] Add --host option to WebDriver process
carlosgc@webkit.org [Thu, 5 Jul 2018 12:41:08 +0000 (12:41 +0000)]
[GTK][WPE] Add --host option to WebDriver process
https://bugs.webkit.org/show_bug.cgi?id=187288

Reviewed by Žan Doberšek.

We currently allow to pass a port number and the server always listens for connections on localhost. We should
allow to optionally pass a host IP address to be able to use WebDriver remotely.

* HTTPServer.h:
* WebDriverService.cpp:
(WebDriver::printUsageStatement): Update usage to include --host option.
(WebDriver::WebDriverService::run): Parse --host option and pass it to HTTPServer::listen().
* soup/HTTPServerSoup.cpp:
(WebDriver::soupServerListen): Helper to call soup_server_listen_local(), soup_server_listen_all() or
soup_server_listen() depending on the given host.
(WebDriver::HTTPServer::listen): Use soupServerListen() helper.

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

2 years ago[WebVR] Fix VRDisplayEvent implementation
svillar@igalia.com [Thu, 5 Jul 2018 11:42:00 +0000 (11:42 +0000)]
[WebVR] Fix VRDisplayEvent implementation
https://bugs.webkit.org/show_bug.cgi?id=187337

Reviewed by Žan Doberšek.

VRDisplayEvent implementation had two issues. First there were no attributes storing the
VRDisplay the event refers to. Secondly the VRDisplayEventReason is not mandatory so it
should be handled via an optional.

* Modules/webvr/VRDisplayEvent.cpp:
(WebCore::VRDisplayEvent::VRDisplayEvent):
(WebCore::VRDisplayEvent::display const): Deleted.
(WebCore::VRDisplayEvent::reason const): Deleted.
* Modules/webvr/VRDisplayEvent.h:

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

2 years ago[WPE][GTK]: Call gtk platform 'gtk' by default as this is what PortFactory expects
commit-queue@webkit.org [Thu, 5 Jul 2018 08:07:41 +0000 (08:07 +0000)]
[WPE][GTK]: Call gtk platform 'gtk' by default as this is what PortFactory expects
https://bugs.webkit.org/show_bug.cgi?id=187322

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-07-05
Reviewed by Žan Doberšek.

* flatpak/flatpakutils.py:
(WebkitFlatpak.__init__):

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

2 years agoUnreviewed, rolling out r233511.
zandobersek@gmail.com [Thu, 5 Jul 2018 07:40:00 +0000 (07:40 +0000)]
Unreviewed, rolling out r233511.

Proper fix provided in bug #187322

Reverted changeset:

"Unreviewed. Fixing a call in flatpakutils.py to
PortFactory.get(),"
https://trac.webkit.org/changeset/233511

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

2 years agoREGRESSION(r233325): [GTK] Broke 40 animations tests
carlosgc@webkit.org [Thu, 5 Jul 2018 06:54:12 +0000 (06:54 +0000)]
REGRESSION(r233325): [GTK] Broke 40 animations tests
https://bugs.webkit.org/show_bug.cgi?id=187264

Reviewed by Žan Doberšek.

Source/WebCore:

This is because DocumentAnimationScheduler uses DisplayRefreshMonitor, that is only used by GTK port when
accelerated compositing is enabled. Add a GTK display refresh monitor implementation to be used as the default.

* PlatformGTK.cmake: Add new file to compilation.
* platform/graphics/DisplayRefreshMonitor.cpp:
(WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor): Create DisplayRefreshMonitorGtk in GTK.
* platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp: Added.
(WebCore::DisplayRefreshMonitorGtk::DisplayRefreshMonitorGtk):
(WebCore::DisplayRefreshMonitorGtk::~DisplayRefreshMonitorGtk):
(WebCore::onFrameClockUpdate):
(WebCore::DisplayRefreshMonitorGtk::requestRefreshCallback):
(WebCore::DisplayRefreshMonitorGtk::displayLinkFired):
* platform/graphics/gtk/DisplayRefreshMonitorGtk.h: Added.
(WebCore::DisplayRefreshMonitorGtk::create):

Source/WebKit:

Use a different PlatformDisplayID for compositing in the GTK port. This way, when entering AC a window screen
changed is emitted and the GTK default display refresh monitor is destroyed, ensuring the one created by the
threaded compositor is used.

* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::create): Remove unused WebPage parameter and add PlatformDisplayID.
(WebKit::ThreadedCompositor::ThreadedCompositor): Create the display refresh monitor with the given displayID.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
(WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor): Pass the given displayID to the parent constructor.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h:
(WebKit::ThreadedDisplayRefreshMonitor::create): Add PlatformDisplayID parameter.
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Use compositingDisplayID when
creating the threaded compositor and notify about the window screen change.
(WebKit::ThreadedCoordinatedLayerTreeHost::setIsDiscardable): Use primaryDisplayID when leaving AC and
compositingDisplayID when re-entering.

LayoutTests:

Remove expectations for tests that are passing now.

* platform/gtk/TestExpectations:

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

2 years agoUnreviewed. Fixing a call in flatpakutils.py to PortFactory.get(),
zandobersek@gmail.com [Thu, 5 Jul 2018 05:48:27 +0000 (05:48 +0000)]
Unreviewed. Fixing a call in flatpakutils.py to PortFactory.get(),
enforcing the passed platform argument to always be lowercase, as is
expected from the PortFactory code.

* flatpak/flatpakutils.py:
(WebkitFlatpak.clean_args):

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

2 years agoReparse user stylesheets when _useSystemAppearance changes
antti@apple.com [Thu, 5 Jul 2018 03:50:56 +0000 (03:50 +0000)]
Reparse user stylesheets when _useSystemAppearance changes
https://bugs.webkit.org/show_bug.cgi?id=187312
<rdar://problem/38565834>

Reviewed by Tim Horton.

Source/WebCore:

This setting may affect user stylesheet parsing. Reparse if it changes.

Test: fast/media/use-system-appearance-user-stylesheet-parsing.html

* page/Page.cpp:
(WebCore::Page::setUseSystemAppearance):
* page/Page.h:
(WebCore::Page::setUseSystemAppearance): Deleted.
* testing/Internals.cpp:
(WebCore::Internals::setUseSystemAppearance):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* fast/media/use-system-appearance-user-stylesheet-parsing-expected.txt: Added.
* fast/media/use-system-appearance-user-stylesheet-parsing.html: Added.

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

2 years agoRealtimeIncomingVideoSources: Call stop() directly in the destructor
commit-queue@webkit.org [Wed, 4 Jul 2018 20:12:37 +0000 (20:12 +0000)]
RealtimeIncomingVideoSources: Call stop() directly in the destructor
https://bugs.webkit.org/show_bug.cgi?id=187303

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-07-04
Reviewed by Youenn Fablet.

Avoiding to call stopProducingData when we are not actually producing data.

This fixes tests that will run once the WPE/GTK PeerConnection implementation is merged.

* platform/mediastream/RealtimeIncomingVideoSource.h:
(WebCore::RealtimeIncomingVideoSource::~RealtimeIncomingVideoSource):

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

2 years ago[GTK][WPE] Stop pushing the StreamCollection as event in GStreamerMediaStreamSource
commit-queue@webkit.org [Wed, 4 Jul 2018 20:08:19 +0000 (20:08 +0000)]
[GTK][WPE] Stop pushing the StreamCollection as event in GStreamerMediaStreamSource
https://bugs.webkit.org/show_bug.cgi?id=187304

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-07-04
Reviewed by Philippe Normand.

We let parsebin build the StreamCollection for us and pass extra metadata through the
`TAG_EVENT` pushing the collection ourself is not bringing anything but adds extra work in the
MediaPlayerGStreamer duplicating the STREAM_COLLECTION message for no good reason.

MediaStream layout tests already test that code path.

* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(WebCore::webkitMediaStreamSrcPadProbeCb):

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

2 years agoUnreviewed GTK test gardening.
aboya@igalia.com [Wed, 4 Jul 2018 18:45:20 +0000 (18:45 +0000)]
Unreviewed GTK test gardening.
https://bugs.webkit.org/show_bug.cgi?id=187328

* platform/gtk/TestExpectations:
* platform/wpe/TestExpectations:

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

2 years ago[libwebrtc] Allow IP mismatch for local connections on localhost
commit-queue@webkit.org [Wed, 4 Jul 2018 15:47:22 +0000 (15:47 +0000)]
[libwebrtc] Allow IP mismatch for local connections on localhost
https://bugs.webkit.org/show_bug.cgi?id=187302

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-07-04
Reviewed by Youenn Fablet.

The rest of the code allows it, but there was an unecessary assert

* Source/webrtc/p2p/base/tcpport.cc:

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

2 years agoFunctionTraits: Make cCallArity() constant on 32-bits.
guijemont@igalia.com [Wed, 4 Jul 2018 12:54:48 +0000 (12:54 +0000)]
FunctionTraits: Make cCallArity() constant on 32-bits.
https://bugs.webkit.org/show_bug.cgi?id=187292

Reviewed by Yusuke Suzuki.

On X86, in Source/JavaScriptCore/jit/CCallHelpers.h we have a
static_assert that uses cCallArity(), so it needs to be constant to
avoid a compilation error. This is achieved by changing an ASSERT into
a static_assert.

* wtf/FunctionTraits.h:
(WTF::slotsForCCallArgument):

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

2 years ago[WebIDL] Remove custom bindings for HTMLDocument
fred.wang@free.fr [Wed, 4 Jul 2018 09:49:28 +0000 (09:49 +0000)]
[WebIDL] Remove custom bindings for HTMLDocument
https://bugs.webkit.org/show_bug.cgi?id=173444

Unreviewed, add missing bugzilla link for FIXME comments.

Patch by Frederic Wang <fwang@igalia.com> on 2018-07-04

* dom/Document.cpp:
(WebCore::Document::closeForBindings):
(WebCore::Document::write):
(WebCore::Document::writeln):

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

2 years agoA WKWebView in a UIViewController that is presented modally and uses a file picker...
commit-queue@webkit.org [Wed, 4 Jul 2018 09:43:07 +0000 (09:43 +0000)]
A WKWebView in a UIViewController that is presented modally and uses a file picker will be incorrectly dismissed by the system
https://bugs.webkit.org/show_bug.cgi?id=185257
<rdar://problem/40819252>

Patch by Olivia Barnett <obarnett@apple.com> on 2018-07-04
Reviewed by Tim Horton.

Call to dismiss the presented modal was being called on the parent and not the child, which caused the file picker to be incorrectly dismissed along with the modal. A test for this bug-fix could not be completed without additional tools as TestWebKitAPI is not a UI application.

* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _dismissDisplayAnimated:]):

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

2 years agoIntroduce PLATFORM(IOSMAC)
timothy_horton@apple.com [Wed, 4 Jul 2018 09:06:10 +0000 (09:06 +0000)]
Introduce PLATFORM(IOSMAC)
https://bugs.webkit.org/show_bug.cgi?id=187315

Reviewed by Dan Bernstein.

Source/bmalloc:

* Configurations/Base.xcconfig:

Source/JavaScriptCore:

* Configurations/Base.xcconfig:
* Configurations/FeatureDefines.xcconfig:

Source/ThirdParty/ANGLE:

* Configurations/Base.xcconfig:

Source/WebCore:

* Configurations/Base.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/WebCore.xcconfig:
* Modules/geolocation/ios/GeolocationPositionIOS.mm:
(WebCore::GeolocationPosition::GeolocationPosition):
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::platformReleaseMemory):
* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::setCategory):
(WebCore::AudioSession::routingContextUID const):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::registerItemToPasteboard):
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderRegistrationInfoList itemProvider]):

Source/WebCore/PAL:

* Configurations/Base.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* pal/cf/CoreMediaSoftLink.cpp:
* pal/cf/CoreMediaSoftLink.h:
* pal/spi/mac/AVFoundationSPI.h:

Source/WebInspectorUI:

* Configurations/Base.xcconfig:

Source/WebKit:

* Configurations/Base.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/NetworkService.xcconfig:
* Configurations/WebContentService.xcconfig:
* Configurations/WebKit.xcconfig:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::sourceApplicationAuditData const):
* NetworkProcess/ios/NetworkProcessIOS.mm:
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::initializeProcessName):
(WebKit::overrideSystemProxies):
* Platform/mac/LayerHostingContext.mm:
(WebKit::LayerHostingContext::createForExternalHostingProcess):
* Platform/spi/ios/UIKitSPI.h:
* Shared/ios/ChildProcessIOS.mm:
(WebKit::ChildProcess::initializeSandbox):
* Shared/ios/InteractionInformationAtPosition.h:
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode const):
(WebKit::InteractionInformationAtPosition::decode):
* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::setApplicationIsDaemon):
(WebKit::enableSandboxStyleFileQuarantine):
* Shared/mac/CodeSigning.mm:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _webViewPrintFormatter]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::updateLayerTree):
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(-[WKRemoteView initWithFrame:contextID:]):
* UIProcess/_WKWebViewPrintFormatter.mm:
* UIProcess/_WKWebViewPrintFormatterInternal.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _didExitStableState]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView canPerformActionForWebView:withSender:]):
(-[WKContentView _defineForWebView:]):
(-[WKContentView setSelectedTextRange:]):
(-[WKContentView closestPositionToPoint:]):
(-[WKContentView _updateChangedSelection:]):
* UIProcess/ios/WKLegacyPDFView.mm:
* UIProcess/ios/WKPDFView.mm:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::selectWithGesture):
(WebKit::WebPage::getPositionInformation):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::initializeSandbox):
* config.h:

Source/WebKitLegacy/ios:

* Misc/WebGeolocationCoreLocationProvider.mm:
(-[WebGeolocationCoreLocationProvider requestGeolocationAuthorization]):

Source/WebKitLegacy/mac:

* Configurations/Base.xcconfig:
* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* Configurations/Base.xcconfig:
* wtf/FeatureDefines.h:
* wtf/Platform.h:

Tools:

* TestWebKitAPI/Configurations/Base.xcconfig:
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

2 years ago[Web Animations] Make WPT test at timing-model/timelines/timelines.html pass reliably
graouts@webkit.org [Wed, 4 Jul 2018 07:58:30 +0000 (07:58 +0000)]
[Web Animations] Make WPT test at timing-model/timelines/timelines.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=186508
<rdar://problem/41000260>

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Record WPT test progressions.

* web-platform-tests/web-animations/interfaces/Animation/finished-expected.txt:
* web-platform-tests/web-animations/timing-model/timelines/timelines-expected.txt:

Source/WebCore:

The remaining failing assertion in this test assumes that the ready promise for an animation is fired
prior to requestAnimationFrame callbacks being fired in the current event loop such that registering
the requestAnimationFrame() call within the ready promise has its callback fired with the same timeline
time. To ensure that is true, we perform a microtask checkpoint as soon as we're done running pending
tasks, which will resolve the ready promise for any play-pending animations.

* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::updateAnimations):

LayoutTests:

We're now passing this test reliably.

* TestExpectations:

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

2 years ago50 failing WebDriver tests after r233417
commit-queue@webkit.org [Wed, 4 Jul 2018 07:43:20 +0000 (07:43 +0000)]
50 failing WebDriver tests after r233417
https://bugs.webkit.org/show_bug.cgi?id=187263

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2018-07-04
Reviewed by Frédéric Wang.

A std::optional value is used while being std::nullopt. This is because the wrong input source is used when
transitioning keyboard input states.

* UIProcess/Automation/SimulatedInputDispatcher.cpp:
(WebKit::SimulatedInputDispatcher::transitionInputSourceToState):

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

2 years agoWebKit.ResponsivenessTimerCrash sometimes fails.
beidson@apple.com [Wed, 4 Jul 2018 03:45:50 +0000 (03:45 +0000)]
WebKit.ResponsivenessTimerCrash sometimes fails.
https://bugs.webkit.org/show_bug.cgi?id=187314

Reviewed by Tim Horton.

Actually unregister observers from objects we're about to destroy before destroying them.

* TestWebKitAPI/Tests/WebKit/ResponsivenessTimerCrash.mm:
(-[ResponsivenessTimerObserver observeValueForKeyPath:ofObject:change:context:]):

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

2 years agoRemove quarantine for Webex plugin
youenn@apple.com [Wed, 4 Jul 2018 03:32:06 +0000 (03:32 +0000)]
Remove quarantine for Webex plugin
https://bugs.webkit.org/show_bug.cgi?id=187050
rdar://problem/41478189

Reviewed by Brent Fulgham.

Update the Plugin Info.plist to not do quarantine of downloaded files by default.
Update PluginProcess implementation to reenable quarantine for all plug-ins except cisco webex plug-in.

* Platform/spi/mac/QuarantineSPI.h: Add qtn_proc_init.
* PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
* PluginProcess/PluginProcess.h:
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::shouldOverrideQuarantine):
* Shared/ChildProcess.h:
(WebKit::ChildProcess::shouldOverrideQuarantine):
* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::initializeSandbox):

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

2 years agoNullptr crash accessing Document in GenericEventQueue::dispatchOneEvent()
rniwa@webkit.org [Wed, 4 Jul 2018 03:31:29 +0000 (03:31 +0000)]
Nullptr crash accessing Document in GenericEventQueue::dispatchOneEvent()
https://bugs.webkit.org/show_bug.cgi?id=187284

Reviewed by Eric Carlson.

Source/WebCore:

The null pointer crash was caused by some GenericEventQueue dispatching an event in a stopped document,
which does not have a valid script execution context because some uses of GenericEventQueue in media code
was not closing the queue upon stopping of all active DOM objects.

Fixed all uses of GenericEventQueue which did not suspend or stop the queue with active DOM objects.
Made SourceBufferList and TrackListBase (along with AudioTrackList, TextTrackList, and VideoTrackList)
inherit from ActiveDOMObject instead of ContextDestructionObserver to do this.

Also fixed a bug that media elements inside a template element (and other cases where the document doesn't
have a browsing context) were scheduling events since this would hit the newly added debug assertion in
GenericEventQueue::dispatchOneEvent.

Test: media/track/video-track-addition-and-frame-removal.html

* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::suspend): Assert that we never try to suspend when the document has
this object alive since canSuspendForDocumentSuspension always returns false.
(WebCore::WebKitMediaKeySession::resume): Ditto.
(WebCore::WebKitMediaKeySession::stop): Stop the event queue to avoid the crash.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::removeSourceBuffer): Don't do any work to update tracks when the active DOM
objects are stopped since this MediaSource and the related media objects are about to be destructed.
(WebCore::MediaSource::suspend): Assert that m_asyncEventQueue is empty as canSuspendForDocumentSuspension
returns false whenever the queue is not empty.
(WebCore::MediaSource::resume): Ditto.
* Modules/mediasource/MediaSource.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::suspend): Ditto.
(WebCore::SourceBuffer::resume): Ditto.
(WebCore::SourceBuffer::stop): Stop the event queue to avoid the crash.
* Modules/mediasource/SourceBuffer.h:
* Modules/mediasource/SourceBufferList.cpp:
(WebCore::SourceBufferList): Made this an active DOM object.
(WebCore::SourceBufferList::SourceBufferList):
(WebCore::SourceBufferList::canSuspendForDocumentSuspension const): Added. Return false when there are
pending events to match other media code.
(WebCore::SourceBufferList::suspend): Added. Assert that the event queue is empty here.
(WebCore::SourceBufferList::resume): Ditto.
(WebCore::SourceBufferList::stop): Added. Stop the event queue to avoid the crash.
(WebCore::SourceBufferList::activeDOMObjectName const): Added.
* Modules/mediasource/SourceBufferList.h:
(WebCore::SourceBufferList): Made this an active DOM object.
* Modules/mediasource/SourceBufferList.idl:
* dom/Document.h:
(WebCore::Document::hasBrowsingContext const): Added.
* dom/GenericEventQueue.cpp:
(WebCore::GenericEventQueue::dispatchOneEvent): Added an assertion to catch when an event is dispatched
inside a stopped document, which is never correct and causes this crash down the line.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::playInternal): Exit early when the document doesn't have a browsing context;
e.g. when the media element is inside a template element.
(WebCore::HTMLMediaElement::pauseInternal): Ditto.
(WebCore::HTMLMediaElement::sourceWasAdded): Ditto.
* html/track/AudioTrackList.cpp:
(AudioTrackList::activeDOMObjectName const): Added.
* html/track/AudioTrackList.h:
* html/track/AudioTrackList.idl:
* html/track/TextTrackList.cpp::
(TextTrackList::activeDOMObjectName const): Added.
* html/track/TextTrackList.h:
* html/track/TextTrackList.idl:
* html/track/TrackListBase.cpp:
(WebCore::TrackListBase): Made this an active DOM object.
(WebCore::TrackListBase::TrackListBase):
(WebCore::TrackListBase::canSuspendForDocumentSuspension const): Added. Return false when there are pending events
to match other media code.
(WebCore::TrackListBase::suspend): Added. Assert that the event queue is empty here.
(WebCore::TrackListBase::resume): Ditto.
(WebCore::TrackListBase::stop): Added. Stop the event queue to avoid the crash.
* html/track/TrackListBase.h:
* html/track/VideoTrackList.cpp:
(VideoTrackList::activeDOMObjectName const): Added.
* html/track/VideoTrackList.h:
* html/track/VideoTrackList.idl:

LayoutTests:

Added a regression test which reliably hits the newly added debug assertion.

* media/track/video-track-addition-and-frame-removal-expected.txt: Added.
* media/track/video-track-addition-and-frame-removal.html: Added.

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

2 years ago[cairo] Doesn't paint box-shadow with zero blur-radius
Hironori.Fujii@sony.com [Wed, 4 Jul 2018 03:18:55 +0000 (03:18 +0000)]
[cairo] Doesn't paint box-shadow with zero blur-radius
https://bugs.webkit.org/show_bug.cgi?id=187244

Reviewed by Žan Doberšek.

Source/WebCore:

Cairo::ShadowState::isRequired() returned false if blur-radius is
zero.

No new tests (Covered by existing tests).

* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::ShadowState::isRequired const): Do not check blur
is zero.

LayoutTests:

* platform/gtk/fast/box-shadow/inset-expected.png: Updated.

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

2 years agoupdate-webkitgtk-flatpak fails if running with python2
Hironori.Fujii@sony.com [Wed, 4 Jul 2018 03:14:42 +0000 (03:14 +0000)]
update-webkitgtk-flatpak fails if running with python2
https://bugs.webkit.org/show_bug.cgi?id=187240

Reviewed by Michael Catanzaro.

urllib.urlretrieve of Python2 sends invalid requests. Use
urllib2.urlopen instead.

* flatpak/flatpakutils.py: Import urllib2.urlopen for Python2,
urllib.request.urlopen for Python3.
(FlatpakRepo.repo_file): Copy the content of urlopen result to the
temporary file.

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

2 years agoAdd a release assert to diagnose infinite recursions in removeAllEventListeners()
rniwa@webkit.org [Wed, 4 Jul 2018 02:33:07 +0000 (02:33 +0000)]
Add a release assert to diagnose infinite recursions in removeAllEventListeners()
https://bugs.webkit.org/show_bug.cgi?id=187287

Reviewed by Keith Miller.

Assert that we never re-enter removeAllEventListeners per thread.

* dom/EventTarget.cpp:
(WebCore::EventTarget::removeAllEventListeners):
* platform/ThreadGlobalData.h:
(WebCore::ThreadGlobalData::ThreadGlobalData::isInRemoveAllEventListeners const):
(WebCore::ThreadGlobalData::ThreadGlobalData::setIsInRemoveAllEventListeners):

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

2 years agoCrash in WebKit::CacheStorage::Cache::toRecordInformation when running http/tests...
youenn@apple.com [Wed, 4 Jul 2018 01:56:08 +0000 (01:56 +0000)]
Crash in  WebKit::CacheStorage::Cache::toRecordInformation when running http/tests/cache-storage/cache-persistency.https.html
https://bugs.webkit.org/show_bug.cgi?id=187243

Reviewed by Chris Dumez.

Source/WebKit:

In case a caches object has an engine, it uses the engine to get the salt.
In case engine/caches are non persistent, no salt was set for the engine, hence the crashes.
Add an empty salt whenever initializing a non-persistent engine to remove the crash.

Covered by updated expectations for two tests.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::initialize):

LayoutTests:

* TestExpectations:

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

2 years agoFix regression introduced in r233335
youenn@apple.com [Wed, 4 Jul 2018 00:24:50 +0000 (00:24 +0000)]
Fix regression introduced in r233335
https://bugs.webkit.org/show_bug.cgi?id=187282

Reviewed by Chris Dumez.

When checking for navigation loads, we need to return whether the request URL matches the service worker URL.
Before this patch, if the request URL was not matching the service worker URL, we were using the origin/referrer
which should only be used for subresource loads.

Covered by imported/w3c/web-platform-tests/service-workers/service-worker/claim-with-redirect.https.html
being no longer flaky.

* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::isValidFetch):

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

2 years agoperformance-api/performance-observer-no-document-leak.html is flaky
cdumez@apple.com [Wed, 4 Jul 2018 00:11:45 +0000 (00:11 +0000)]
performance-api/performance-observer-no-document-leak.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=186938
<rdar://problem/41379336>

Reviewed by Simon Fraser.

Source/WebCore:

Add internals API to get the identifier of a document and to ask if the document with
a given identifier is still alive. This is helpful to write tests for document leaking
fixes.

* testing/Internals.cpp:
(WebCore::Internals::documentIdentifier const):
(WebCore::Internals::isDocumentAlive const):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Update test to stop relying on internals.numberOfLiveDocuments() and instead rely on the new
internals.documentIdentifier() / internals.isDocumentAlive(documentIdentifier) API in order
to address the flakiness. Relying on the number of live documents to check if a particular
document was destroyed is unreliable and flaky given that WebKit constructs documents for
various reasons.

* TestExpectations:
* performance-api/performance-observer-no-document-leak-expected.txt:
* performance-api/performance-observer-no-document-leak.html:

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

2 years agoImprove window.event compliance: Should not be set when target is in shadow tree
cdumez@apple.com [Wed, 4 Jul 2018 00:06:32 +0000 (00:06 +0000)]
Improve window.event compliance: Should not be set when target is in shadow tree
https://bugs.webkit.org/show_bug.cgi?id=186266

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Re-sync dom/events web-platform-tests from 59d4a411a8e to gain test coverage.

* web-platform-tests/dom/events/Event-returnValue-expected.txt:
* web-platform-tests/dom/events/Event-returnValue.html:
* web-platform-tests/dom/events/event-global-expected.txt: Added.
* web-platform-tests/dom/events/event-global-extra.window.js: Added.
(async_test.t.frame.onload.t.step_func_done):
* web-platform-tests/dom/events/event-global.html: Added.
* web-platform-tests/dom/events/event-global.worker-expected.txt: Added.
* web-platform-tests/dom/events/event-global.worker.html: Added.
* web-platform-tests/dom/events/event-global.worker.js: Added.
* web-platform-tests/dom/events/relatedTarget.window.js: Added.
(test):
(test.t.input.oninput.t.step_func):
* web-platform-tests/dom/events/resources/event-global-extra-frame.html: Added.
* web-platform-tests/dom/events/resources/w3c-import.log: Added.
* web-platform-tests/dom/events/w3c-import.log:

Source/WebCore:

Stop exposing window.event to Shadow DOM by not setting window.event if the event's target
is a Node inside a shadow tree. This is as per the latest DOM specification:
- https://github.com/whatwg/dom/pull/407

This aligns our behavior with Blink as well:
- https://bugs.chromium.org/p/chromium/issues/detail?id=779461

Tests: imported/w3c/web-platform-tests/dom/events/event-global.html
       imported/w3c/web-platform-tests/dom/events/event-global.worker.html

* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):

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

2 years agoMake CallbackMap::invalidate() safe to re-enter
cdumez@apple.com [Wed, 4 Jul 2018 00:05:39 +0000 (00:05 +0000)]
Make CallbackMap::invalidate() safe to re-enter
https://bugs.webkit.org/show_bug.cgi?id=187298
<rdar://problem/41057167>

Reviewed by Geoffrey Garen.

Source/WebKit:

Made it safe to re-enter CallbackMap::invalidate(), GenericCallback::performCallbackWithReturnValue(),
GenericCallback::invalidate() & invalidateCallbackMap() since those execute client blocks which may
re-enter WebKit.

* UIProcess/GenericCallback.h:
(WebKit::GenericCallback::performCallbackWithReturnValue):
(WebKit::invalidateCallbackMap):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/WebContentProcessDidTerminate.mm:
(TEST):

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

2 years ago[Cocoa] Disable vnode guard related simulated crashes for WKTR / DRT and WebSQL
cdumez@apple.com [Tue, 3 Jul 2018 23:54:46 +0000 (23:54 +0000)]
[Cocoa] Disable vnode guard related simulated crashes for WKTR / DRT and WebSQL
https://bugs.webkit.org/show_bug.cgi?id=187270
<rdar://problem/40674034>

Reviewed by Geoffrey Garen.

Source/WebCore:

Disable vnode guard related simulated crashes for WebSQL by setting the expected
environment variable, if not already set by WKTR / DRT.

* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::initialize):
(WebCore::DatabaseManager::platformInitialize):
* Modules/webdatabase/DatabaseManager.h:
* Modules/webdatabase/cocoa/DatabaseManagerCocoa.mm: Added.
(WebCore::DatabaseManager::paltformInitialize):
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/FileSystem.h:
* platform/posix/FileSystemPOSIX.cpp:
(WebCore::FileSystem::realPath):
* platform/win/FileSystemWin.cpp:
(WebCore::FileSystem::realPath):

Tools:

Disable vnode guard related simulated crashes for WKTR / DRT by setting the
expected environment variable in the test driver.

* Scripts/webkitpy/port/driver.py:
(Driver._setup_environ_for_driver):

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

2 years agoRe-enabling canvas tests for canvas/philip/tests/initial.reset.gradient.html
commit-queue@webkit.org [Tue, 3 Jul 2018 22:57:23 +0000 (22:57 +0000)]
Re-enabling canvas tests for canvas/philip/tests/initial.reset.gradient.html
https://bugs.webkit.org/show_bug.cgi?id=187307

Unreviewed test gardening.

Patch by Truitt Savell <tsavell@apple.com> on 2018-07-03

* platform/mac/TestExpectations:

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

2 years agoDon't allow autoplay when the element is suspended
eric.carlson@apple.com [Tue, 3 Jul 2018 22:57:14 +0000 (22:57 +0000)]
Don't allow autoplay when the element is suspended
https://bugs.webkit.org/show_bug.cgi?id=187299
<rdar://problem/41044691>

Reviewed by Youenn Fablet.

Block autoplay when a media element is suspended. Add more release logging to the methods
that handle autoplay attempts to help diagnose future media playback problems.

* html/HTMLMediaElement.cpp:
(WebCore::convertEnumerationToString): Convert PlaybackWithoutUserGesture to a string.
(WebCore::HTMLMediaElement::dispatchPlayPauseEventsIfNeedsQuirks): Add logging.
(WebCore::HTMLMediaElement::hardwareMutedStateDidChange): Ditto.
(WebCore::HTMLMediaElement::handleAutoplayEvent): Ditto.
(WebCore::HTMLMediaElement::userDidInterfereWithAutoplay): Ditto.
(WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture): Ditto.
* html/HTMLMediaElement.h:
(WTF::LogArgument<WebCore::HTMLMediaElement::PlaybackWithoutUserGesture>::toString):

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted const): Playback is not permitted when the
element is suspended.
* html/MediaElementSession.h:

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

2 years ago[iOS] Clean up sandbox warnings found during Public Beta
bfulgham@apple.com [Tue, 3 Jul 2018 22:44:54 +0000 (22:44 +0000)]
[iOS] Clean up sandbox warnings found during Public Beta
https://bugs.webkit.org/show_bug.cgi?id=187308
<rdar://problem/41203914>

Reviewed by Eric Carlson.

I made our sandbox overly restrictive during our iOS 12.0 development cycle, and have found a number of missing items.

This patch adds the missing IOKit properties, and removes a duplicate call to (play-media).

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

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

2 years agore-enable some canvas tests that are now consistently passing
commit-queue@webkit.org [Tue, 3 Jul 2018 22:41:53 +0000 (22:41 +0000)]
re-enable some canvas tests that are now consistently passing
https://bugs.webkit.org/show_bug.cgi?id=187305

Unreviewed test gardening.

Patch by Truitt Savell <tsavell@apple.com> on 2018-07-03

* platform/mac/TestExpectations:

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

2 years ago[LFC] Generate anonymous inline box for text content.
zalan@apple.com [Tue, 3 Jul 2018 22:28:41 +0000 (22:28 +0000)]
[LFC] Generate anonymous inline box for text content.
https://bugs.webkit.org/show_bug.cgi?id=187301

Reviewed by Antti Koivisto.

Always have a inline container for text content (and no dedicated text renderer).

* layout/layouttree/LayoutInlineBox.cpp:
(WebCore::Layout::InlineBox::InlineBox):
* layout/layouttree/LayoutInlineBox.h:
(WebCore::Layout::InlineBox::setContent):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createSubTree):

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

2 years ago[Curl] Embed certificate information into ResourceResponse.
Basuke.Suzuki@sony.com [Tue, 3 Jul 2018 21:38:22 +0000 (21:38 +0000)]
[Curl] Embed certificate information into ResourceResponse.
https://bugs.webkit.org/show_bug.cgi?id=187102

Reviewed by Youenn Fablet.

Source/WebCore:

No new tests but tested internally.

Collect certificate information from the communication and put them into
ResourceResponse for the sake of advanced security checking and information
providing to the user.

* platform/Curl.cmake:
* platform/network/curl/CertificateInfo.cpp: Copied from Source/WebCore/platform/network/curl/CertificateInfo.h.
(WebCore::CertificateInfo::CertificateInfo):
(WebCore::CertificateInfo::isolatedCopy const):
(WebCore::CertificateInfo::makeCertificate):
* platform/network/curl/CertificateInfo.h:
(WebCore::CertificateInfo::verificationError const):
(WebCore::CertificateInfo::certificateChain const):
(WebCore::operator==):
(WebCore::CertificateInfo::CertificateInfo): Deleted.
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::didReceiveHeader):
(WebCore::CurlRequest::didCompleteTransfer):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::getCertificateInfo const):
(WebCore::CurlRequest::getNetworkLoadMetrics const):
(WebCore::CurlRequest::getNetworkLoadMetrics): Deleted.
* platform/network/curl/CurlResourceHandleDelegate.cpp:
(WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
(WebCore::CurlResourceHandleDelegate::curlDidComplete):
* platform/network/curl/CurlSSLHandle.cpp:
(WebCore::CurlSSLHandle::setHostAllowsAnyHTTPSCertificate):
(WebCore::CurlSSLHandle::canIgnoredHTTPSCertificate):
* platform/network/curl/CurlSSLHandle.h:
* platform/network/curl/CurlSSLVerifier.cpp:
(WebCore::CurlSSLVerifier::CurlSSLVerifier):
(WebCore::CurlSSLVerifier::verifyCallback):
(WebCore::StackOfX509::StackOfX509): For RAII. Used in pemDataFromCtx().
(WebCore::StackOfX509::~StackOfX509): Ditto.
(WebCore::StackOfX509::count): Ditto.
(WebCore::StackOfX509::item): Ditto.
(WebCore::BIOHolder::BIOHolder): Ditto.
(WebCore::BIOHolder::~BIOHolder): Ditto.
(WebCore::BIOHolder::write): Ditto.
(WebCore::BIOHolder::asCertificate): Ditto.
(WebCore::pemDataFromCtx): Become simple static function.
(WebCore::convertToSSLCertificateFlags): Ditto.
(WebCore::CurlSSLVerifier::certVerifyCallback): Deleted.
(WebCore::CurlSSLVerifier::getPemDataFromCtx): Deleted.
(WebCore::CurlSSLVerifier::convertToSSLCertificateFlags): Deleted.
* platform/network/curl/CurlSSLVerifier.h:
(WebCore::CurlSSLVerifier::verificationError):
(WebCore::CurlSSLVerifier::certificateChain const):
* platform/network/curl/ResourceError.h:
* platform/network/curl/ResourceErrorCurl.cpp:
(WebCore::ResourceError::isSSLConnectError const):
(WebCore::ResourceError::isSSLCertVerificationError const):
(WebCore::ResourceError::hasSSLConnectError const): Deleted.
* platform/network/curl/ResourceResponse.h:
* platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::setCertificateInfo):
(WebCore::ResourceResponse::setDeprecatedNetworkLoadMetrics):

Source/WebKit:

* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::curlDidComplete):.

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

2 years ago[iOS WK2] We fail to make surfaces volatile when suspending, increasing memory impact
simon.fraser@apple.com [Tue, 3 Jul 2018 21:04:13 +0000 (21:04 +0000)]
[iOS WK2] We fail to make surfaces volatile when suspending, increasing memory impact
https://bugs.webkit.org/show_bug.cgi?id=187285
rdar://problem/41732391

Reviewed by Tim Horton.

The "Mach port as layer contents" code path used in iOS WK2 relies on replacing the
Mach port layer contents with the actual IOSurface on suspension (otherwise the
live Mach port will keep the surface in use). However, we were never hitting this
RemoteLayerTreeHost::mapAllIOSurfaceBackingStore() code path on iOS 11 and later
because UIKit stopped firing the notification we relied on.

To fix this, use the _UIApplicationDidFinishSuspensionSnapshotNotification notification
which is fired on UIApp.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ApplicationStateTracker.mm:
(WebKit::ApplicationStateTracker::ApplicationStateTracker):

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

2 years agoClean up the layer volatility code and logging
simon.fraser@apple.com [Tue, 3 Jul 2018 21:04:10 +0000 (21:04 +0000)]
Clean up the layer volatility code and logging
https://bugs.webkit.org/show_bug.cgi?id=187286

Reviewed by Tim Horton.
Source/WebCore:

Export a function.

* platform/graphics/cocoa/IOSurface.h:

Source/WebKit:

Fix the layer volatility logging so it doesn't say "succeeded" when it actually failed
and gave up.

Use a couple of lambda functions in RemoteLayerBackingStore::setBufferVolatility() to
make the code easier to read.

* Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::setBufferVolatility):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::callVolatilityCompletionHandlers):
(WebKit::WebPage::layerVolatilityTimerFired):
(WebKit::WebPage::markLayersVolatile):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::markLayersVolatile):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::markAllLayersVolatile):
* WebProcess/WebProcess.h:

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

2 years agoVideo sometimes flickers when playing to AppleTV
eric.carlson@apple.com [Tue, 3 Jul 2018 21:02:10 +0000 (21:02 +0000)]
Video sometimes flickers when playing to AppleTV
https://bugs.webkit.org/show_bug.cgi?id=187193
<rdar://problem/40153865>

Unreviewed, fix test broken by r233435.

* TestWebKitAPI/Tests/WebKitLegacy/ios/AudioSessionCategoryIOS.mm:
(TestWebKitAPI::waitUntilAudioSessionCategoryIsEqualTo): Poll for a change in audio session
category because it doesn't necessarily happen synchronously.
(TestWebKitAPI::TEST):

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

2 years agoUnreviewed, add myself as a WebKit committer.
tsaunier@gnome.org [Tue, 3 Jul 2018 20:53:25 +0000 (20:53 +0000)]
Unreviewed, add myself as a WebKit committer.

And canonicalize the file as suggested by `check-webkit-style`

* Scripts/webkitpy/common/config/contributors.json:

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

2 years agoUnreviewed, rolling out r233112.
commit-queue@webkit.org [Tue, 3 Jul 2018 20:50:04 +0000 (20:50 +0000)]
Unreviewed, rolling out r233112.
https://bugs.webkit.org/show_bug.cgi?id=187300

this revision is causing crashes on iOS 11 simulator
(Requested by Truitt on #webkit).

Reverted changeset:

"[Fullscreen] Restore ASSERT_NOT_REACHED() checks in exit
fullscreen handler after r231924"
https://bugs.webkit.org/show_bug.cgi?id=186945
https://trac.webkit.org/changeset/233112

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

2 years agoImplement support for Element.toggleAttribute
cdumez@apple.com [Tue, 3 Jul 2018 20:46:38 +0000 (20:46 +0000)]
Implement support for Element.toggleAttribute
https://bugs.webkit.org/show_bug.cgi?id=186883

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Import WPT test coverage from:
https://github.com/web-platform-tests/wpt/commit/c3db018b96681af3c73ec331ecc01d38e48b8b10

* web-platform-tests/dom/nodes/attributes-expected.txt:
* web-platform-tests/dom/nodes/attributes.html:

Source/WebCore:

Implement support for Element.toggleAttribute as per:
- https://github.com/whatwg/dom/issues/461
- https://dom.spec.whatwg.org/#dom-element-toggleattribute

This was already implemented in Blink:
- https://bugs.chromium.org/p/chromium/issues/detail?id=854960

Edge expressed public support:
- https://github.com/whatwg/dom/issues/461#issuecomment-398206390

Gecko is working on it:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1469592

* dom/Element.cpp:
(WebCore::Element::toggleAttribute):
* dom/Element.h:
* dom/Element.idl:

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

2 years agocheck-webkit-style: Run the tool without SVN client.
Basuke.Suzuki@sony.com [Tue, 3 Jul 2018 20:44:59 +0000 (20:44 +0000)]
check-webkit-style: Run the tool without SVN client.
https://bugs.webkit.org/show_bug.cgi?id=187294

Reviewed by Daniel Bates.

When invoking check-webkit-style without SVN client, the exception was raised and terminated.
Using Git repository is acceptable workflow according to the wording on:
<https://webkit.org/getting-the-code/#checking-out-with-git>
and using Subversion is considered optional by following link:
<https://webkit.org/webkit-on-windows/#installing-developer-tools>.
This patch makes it so that people with only a Git checkout of WebKit that commit using
the commit-queue (or another machine with an SVN checkout) can run check-webkit-style.

* Scripts/webkitpy/common/checkout/scm/svn.py:
(SVN.in_working_directory):

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

2 years ago[32-bit JSC tests] ASSERTION FAILED: !getDirect(offset) || !JSValue::encode(getDirect...
mark.lam@apple.com [Tue, 3 Jul 2018 19:25:54 +0000 (19:25 +0000)]
[32-bit JSC tests] ASSERTION FAILED: !getDirect(offset) || !JSValue::encode(getDirect(offset)).
https://bugs.webkit.org/show_bug.cgi?id=187255
<rdar://problem/41785257>

Reviewed by Saam Barati.

The 32-bit JIT::emit_op_create_this() needs to initialize uninitialized properties
too: basically, do what the 64-bit code is doing.  At present, this change only
serves to pacify an assertion.  It is not needed for correctness because the
concurrent GC is not used on 32-bit builds.

This issue is already covered by the slowMicrobenchmarks/rest-parameter-allocation-elimination.js
test.

* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_create_this):

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

2 years agoRemove old JSCTestsFactory
aakash_jain@apple.com [Tue, 3 Jul 2018 19:12:14 +0000 (19:12 +0000)]
Remove old JSCTestsFactory

Follow-up fix to r233471.

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

2 years ago[ews-build] Add support for JSC-Tests-EWS
aakash_jain@apple.com [Tue, 3 Jul 2018 18:59:28 +0000 (18:59 +0000)]
[ews-build] Add support for JSC-Tests-EWS
https://bugs.webkit.org/show_bug.cgi?id=187201

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/factories.py:
(JSCTestsFactory): Added JSCTestsFactory.
* BuildSlaveSupport/ews-build/steps.py:
(CompileJSCOnly): Command to compile JSC.
* BuildSlaveSupport/ews-build/steps_unittest.py: Updated unit-tests.
* BuildSlaveSupport/ews-build/config.json: Changed platform to jsc-only. This matches with build.webkit.org configuration.

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

2 years ago[LFC] Add test-list file for regression testing
zalan@apple.com [Tue, 3 Jul 2018 18:51:33 +0000 (18:51 +0000)]
[LFC] Add test-list file for regression testing
https://bugs.webkit.org/show_bug.cgi?id=187296

Reviewed by Antti Koivisto.

run-webkit-tests --test-list=./Tools/LayoutReloaded/misc/LFC-passing-tests.txt

* LayoutReloaded/misc/LFC-passing-tests.txt: Added.

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

2 years ago[LFC] Implement minimum/maximum content width logic.
zalan@apple.com [Tue, 3 Jul 2018 18:29:35 +0000 (18:29 +0000)]
[LFC] Implement minimum/maximum content width logic.
https://bugs.webkit.org/show_bug.cgi?id=187241

Reviewed by Antti Koivisto.

Compute the minimum/maximum content width if needed and cache the values on the formatting state.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
(WebCore::Layout::shrinkToFitWidth): Deleted.
* layout/FormattingState.cpp:
(WebCore::Layout::FormattingState::FormattingState):
* layout/FormattingState.h:
(WebCore::Layout::FormattingState::setMinimumMaximumContentWidth):
(WebCore::Layout::FormattingState::clearMinimumMaximumContentWidth):
(WebCore::Layout::FormattingState::minimumMaximumContentWidth const):
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::establishedFormattingState):
* layout/LayoutContext.h:
* layout/Verification.cpp:
(WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::createFormattingState const):
(WebCore::Layout::BlockFormattingContext::minimumMaximumContentWidth const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::minimumMaximumContentWidthNeedsChildrenWidth):
(WebCore::Layout::BlockFormattingContext::Geometry::minimumMaximumContentWidth):
* layout/blockformatting/BlockFormattingState.cpp:
(WebCore::Layout::BlockFormattingState::BlockFormattingState):
* layout/blockformatting/BlockFormattingState.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::createFormattingState const):
(WebCore::Layout::InlineFormattingContext::minimumMaximumContentWidth const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::InlineFormattingState):
* layout/inlineformatting/InlineFormattingState.h:
* page/FrameViewLayoutContext.cpp:

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

2 years agoResource Load Statistics: Make WebsiteDataStore::getAllStorageAccessEntries() call...
wilander@apple.com [Tue, 3 Jul 2018 18:25:36 +0000 (18:25 +0000)]
Resource Load Statistics: Make WebsiteDataStore::getAllStorageAccessEntries() call the right network process instead of iterating over the process pools
https://bugs.webkit.org/show_bug.cgi?id=187277
<rdar://problem/41745510>

Reviewed by Chris Dumez.

Source/WebKit:

Existing tests use this code. The change is for correctness.

* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _getAllStorageAccessEntriesFor:completionHandler:]):
    Now receives a WKWebView from its caller and gets the page ID from it.
(-[WKWebsiteDataStore _getAllStorageAccessEntries:]): Deleted.
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::getAllStorageAccessEntries):
    Now gets a page ID from its caller and gets the right network process
    through it.
* UIProcess/WebsiteData/WebsiteDataStore.h:

Tools:

* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::getAllStorageAccessEntries):

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

2 years ago[JSC] Move slowDownAndWasteMemory function to JSArrayBufferView
utatane.tea@gmail.com [Tue, 3 Jul 2018 17:50:12 +0000 (17:50 +0000)]
[JSC] Move slowDownAndWasteMemory function to JSArrayBufferView
https://bugs.webkit.org/show_bug.cgi?id=187290

Reviewed by Saam Barati.

slowDownAndWasteMemory is just overridden by typed arrays. Since they are limited,
we do not need to add this function to MethodTable: just dispatching it in JSArrayBufferView
is fine. And slowDownAndWasteMemory only requires the sizeof(element), which can be
easily calculated from JSType.
This patch removes slowDownAndWasteMemory from MethodTable, and moves it to JSArrayBufferView.

* runtime/ClassInfo.h:
* runtime/JSArrayBufferView.cpp:
(JSC::elementSize):
(JSC::JSArrayBufferView::slowDownAndWasteMemory):
* runtime/JSArrayBufferView.h:
* runtime/JSArrayBufferViewInlines.h:
(JSC::JSArrayBufferView::possiblySharedBuffer):
* runtime/JSCell.cpp:
(JSC::JSCell::slowDownAndWasteMemory): Deleted.
* runtime/JSCell.h:
* runtime/JSDataView.cpp:
(JSC::JSDataView::slowDownAndWasteMemory): Deleted.
* runtime/JSDataView.h:
* runtime/JSGenericTypedArrayView.h:
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::slowDownAndWasteMemory): Deleted.

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

2 years agoUnreviewed, rolling out r233461.
jbedard@apple.com [Tue, 3 Jul 2018 16:50:57 +0000 (16:50 +0000)]
Unreviewed, rolling out r233461.

Assertions triggered during iOS 11 debug layout and API tests

Reverted changeset:

"[iOS] Add assert to catch improper use of WebCore::Timer in
UI Process"
https://bugs.webkit.org/show_bug.cgi?id=185330
https://trac.webkit.org/changeset/233461

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

2 years agoUpdate com.cmbchina.CMBSecurity.sb to make it functional
youenn@apple.com [Tue, 3 Jul 2018 16:20:00 +0000 (16:20 +0000)]
Update com.cmbchina.CMBSecurity.sb to make it functional
https://bugs.webkit.org/show_bug.cgi?id=187278

Reviewed by Brent Fulgham.

* Resources/PlugInSandboxProfiles/com.cmbchina.CMBSecurity.sb:

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

2 years agoUpdate Fullscreen anti-phishing alert text
jer.noble@apple.com [Tue, 3 Jul 2018 16:15:55 +0000 (16:15 +0000)]
Update Fullscreen anti-phishing alert text
https://bugs.webkit.org/show_bug.cgi?id=187199
<rdar://problem/41162543>

Reviewed by Brent Fulgham.

Source/WebCore:

* English.lproj/Localizable.strings:

Source/WebKit:

* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(-[WKFullScreenViewController _showPhishingAlert]):

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