WebKit-https.git
2 months agoAdd a runtime setting for media in the GPU process
eric.carlson@apple.com [Tue, 3 Dec 2019 22:56:46 +0000 (22:56 +0000)]
Add a runtime setting for media in the GPU process
https://bugs.webkit.org/show_bug.cgi?id=204801
<rdar://problem/57596199>

Reviewed by Jer Noble.

Source/WebCore:

* page/Settings.yaml:

Source/WebKit:

* Shared/WebPreferences.yaml:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

Source/WebKitLegacy/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences outOfProcessMediaEnabled]):
(-[WebPreferences setOutOfProcessMediaEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

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

2 months agoExperimental support for HDR media query
jer.noble@apple.com [Tue, 3 Dec 2019 22:35:42 +0000 (22:35 +0000)]
Experimental support for HDR media query
https://bugs.webkit.org/show_bug.cgi?id=204422
<rdar://problem/56799662>

Reviewed by Eric Carlson.

Follow-up to r252762 for platforms that don't have MediaToolbox.framework.

* platform/ios/PlatformScreenIOS.mm:
(WebCore::screenSupportsHighDynamicRange):
* platform/mac/PlatformScreenMac.mm:
(WebCore::collectScreenProperties):
(WebCore::screenSupportsHighDynamicRange):

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

2 months agoRegular expression hangs in Safari only
chris.reid@sony.com [Tue, 3 Dec 2019 22:07:14 +0000 (22:07 +0000)]
Regular expression hangs in Safari only
https://bugs.webkit.org/show_bug.cgi?id=202882
<rdar://problem/56236654>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/regress-202882.js: Added.

Source/WTF:

BumpPointerPool::ensureCapacityCrossPool can cause an infinite loop
if multiple large pools are deallocated and a new capacity does not
fit in the deallocated pools. BumpPointerPool should try using
more pools if the next one isn't large enough.

* wtf/BumpPointerAllocator.h:
(WTF::BumpPointerPool::ensureCapacityCrossPool):

Tools:

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/BumpPointerAllocator.cpp: Added.

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

2 months agohttps://bugs.webkit.org/show_bug.cgi?id=204804
jbedard@apple.com [Tue, 3 Dec 2019 20:34:59 +0000 (20:34 +0000)]
https://bugs.webkit.org/show_bug.cgi?id=204804
<rdar://problem/57595666>

Reviewed by Tim Horton.

* Scripts/webkitpy/port/mac.py:
(MacCatalystPort):
(MacCatalystPort._build_driver_flags): Add SDKVARIANT=iosmac to build flags.

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

2 months agoUnreviewed assertion fix for older macOS versions after r253011.
pvollan@apple.com [Tue, 3 Dec 2019 20:12:59 +0000 (20:12 +0000)]
Unreviewed assertion fix for older macOS versions after r253011.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
* UIProcess/UserMediaPermissionRequestManagerProxy.h:

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

2 months agoStart adding encoding support for DisplayList and some DisplayListItems
timothy_horton@apple.com [Tue, 3 Dec 2019 20:06:51 +0000 (20:06 +0000)]
Start adding encoding support for DisplayList and some DisplayListItems
https://bugs.webkit.org/show_bug.cgi?id=204740

* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContextStateChange::changesFromState const):
* platform/graphics/GraphicsContext.h:
Remove GraphicsContextState::NoChange, which is not needed with OptionSet
and in fact causes assertions to fire.

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

2 months ago[Web Animations] Add a runtime flag for Web Animations composite operations
commit-queue@webkit.org [Tue, 3 Dec 2019 19:28:31 +0000 (19:28 +0000)]
[Web Animations] Add a runtime flag for Web Animations composite operations
https://bugs.webkit.org/show_bug.cgi?id=204718

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

Source/WebCore:

While we support parsing and output of composite modes via KeyframeEffect::getKeyframes(), we don't support them for blending properties.
We now have a runtime flag for that feature so that we can continue working on it but not necessarily expose the feature by default.

* animation/KeyframeEffect.cpp:
(WebCore::processKeyframeLikeObject):
(WebCore::processIterableKeyframes):
(WebCore::processPropertyIndexedKeyframes):
(WebCore::KeyframeEffect::getKeyframes):
* animation/KeyframeEffect.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebAnimationsCompositeOperationsEnabled):
(WebCore::RuntimeEnabledFeatures::webAnimationsCompositeOperationsEnabled const):

Source/WebKit:

* Shared/WebPreferences.yaml:

Source/WebKitLegacy/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences webAnimationsCompositeOperationsEnabled]):
(-[WebPreferences setWebAnimationsCompositeOperationsEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKitLegacy/win:

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings):
(WebPreferences::setWebAnimationsCompositeOperationsEnabled):
(WebPreferences::webAnimationsCompositeOperationsEnabled):
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):
* DumpRenderTree/win/DumpRenderTree.cpp:
(enableExperimentalFeatures):

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

2 months agoUserMediaCaptureManager should have independent capture factories
youenn@apple.com [Tue, 3 Dec 2019 19:08:40 +0000 (19:08 +0000)]
UserMediaCaptureManager should have independent capture factories
https://bugs.webkit.org/show_bug.cgi?id=204786

Reviewed by Eric Carlson.

Refactor the code to make UserMediaCaptureManager have 3 different factories.
This allows having 3 potential active sources which are used on iOS.
We cannot test right now on iOS as audio capture in UIProcess is not yet ready.

* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::Source::Source):
(WebKit::UserMediaCaptureManager::Source::~Source):
(WebKit::UserMediaCaptureManager::UserMediaCaptureManager):
(WebKit::UserMediaCaptureManager::~UserMediaCaptureManager):
(WebKit::UserMediaCaptureManager::initialize):
(WebKit::UserMediaCaptureManager::createCaptureSource):
(WebKit::UserMediaCaptureManager::AudioFactory::setAudioCapturePageState):
(WebKit::UserMediaCaptureManager::VideoFactory::setVideoCapturePageState):
(WebKit::UserMediaCaptureManager::setAudioCapturePageState): Deleted.
(WebKit::UserMediaCaptureManager::setVideoCapturePageState): Deleted.
* WebProcess/cocoa/UserMediaCaptureManager.h:
(WebKit::UserMediaCaptureManager::AudioFactory::AudioFactory):
(WebKit::UserMediaCaptureManager::VideoFactory::VideoFactory):
(WebKit::UserMediaCaptureManager::DisplayFactory::DisplayFactory):

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

2 months agofast/events/touch/ios/passive-by-default-on-document-and-window.html is a flaky failure
wenson_hsieh@apple.com [Tue, 3 Dec 2019 18:39:36 +0000 (18:39 +0000)]
fast/events/touch/ios/passive-by-default-on-document-and-window.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=204797
<rdar://problem/57591431>

Reviewed by Tim Horton.

Fix the layout test by waiting for touchend events before finishing the test, such that passive touchend events
that were queued up via `EventDispatcher::touchEvent` have a chance to be dispatched to the page. Also, make the
test a bit more modern by replacing the UI script in the test with a call to a UIHelper method.

* fast/events/touch/ios/passive-by-default-on-document-and-window-expected.txt:
* fast/events/touch/ios/passive-by-default-on-document-and-window.html:

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

2 months agoUnreviewed. Remove build warning below since r252987.
jh718.park@samsung.com [Tue, 3 Dec 2019 18:24:48 +0000 (18:24 +0000)]
Unreviewed. Remove build warning below since r252987.
warning: unused variable ‘currentTrack’ [-Wunused-variable]

No new tests, no behavioral changes.

* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
(WebCore::LibWebRTCRtpSenderBackend::replaceTrack):

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

2 months ago[LFC][IFC] Move trailing trimmable content logic to InlineItemRun
zalan@apple.com [Tue, 3 Dec 2019 18:22:23 +0000 (18:22 +0000)]
[LFC][IFC] Move trailing trimmable content logic to InlineItemRun
https://bugs.webkit.org/show_bug.cgi?id=204798
<rdar://problem/57593248>

Reviewed by Antti Koivisto.

Trailing letter spacing/fully trimmable whitespace logic should be internal to InlineItemRun.

* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::removeTrailingTrimmableContent):
(WebCore::Layout::LineBuilder::appendTextContent):
(WebCore::Layout::LineBuilder::runContentHeight const):
(WebCore::Layout::LineBuilder::InlineItemRun::isTrimmableWhitespace const):
(WebCore::Layout::LineBuilder::InlineItemRun::hasTrailingLetterSpacing const):
(WebCore::Layout::LineBuilder::InlineItemRun::trailingLetterSpacing const):
(WebCore::Layout::LineBuilder::InlineItemRun::removeTrailingLetterSpacing):
(WebCore::Layout::shouldPreserveTrailingContent): Deleted.
* layout/inlineformatting/InlineLineBuilder.h:
(WebCore::Layout::LineBuilder::Run::style const):
(WebCore::Layout::LineBuilder::InlineItemRun::style const):

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

2 months agoPageConfiguration::pluginClient should use a smart pointer
cdumez@apple.com [Tue, 3 Dec 2019 18:17:38 +0000 (18:17 +0000)]
PageConfiguration::pluginClient should use a smart pointer
https://bugs.webkit.org/show_bug.cgi?id=204780

Reviewed by Anders Carlsson.

Source/WebCore:

* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::~Page):
* page/Page.h:
(WebCore::Page::plugInClient const):
* page/PageConfiguration.h:
* page/PlugInClient.h:

Source/WebKit:

* WebProcess/WebCoreSupport/WebPlugInClient.cpp:
* WebProcess/WebCoreSupport/WebPlugInClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_overriddenMediaType):

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

2 months agoFix MacCatalyst build.
dino@apple.com [Tue, 3 Dec 2019 18:13:08 +0000 (18:13 +0000)]
Fix MacCatalyst build.

* platform/graphics/GraphicsContext3D.h:

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

2 months agoDo not retry the EWS build due to flaky failures in layout-test
aakash_jain@apple.com [Tue, 3 Dec 2019 17:56:15 +0000 (17:56 +0000)]
Do not retry the EWS build due to flaky failures in layout-test
https://bugs.webkit.org/show_bug.cgi?id=204769

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(AnalyzeLayoutTestsResults.start): Do not retry the build due to flaky tests failures.
* BuildSlaveSupport/ews-build/steps_unittest.py:
(test_flaky_and_inconsistent_failures_without_clean_tree_failures): expected outcome changed from RETRY to SUCCESS.
(test_flaky_and_inconsistent_failures_with_clean_tree_failures): Ditto.
(test_flaky_and_consistent_failures_with_clean_tree_failures): Ditto.
(test_mildly_flaky_patch_with_some_tree_redness_and_flakiness): Ditto.

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

2 months agoPageConfiguration::alternativeTextClient should use a smart pointer
cdumez@apple.com [Tue, 3 Dec 2019 17:34:46 +0000 (17:34 +0000)]
PageConfiguration::alternativeTextClient should use a smart pointer
https://bugs.webkit.org/show_bug.cgi?id=204777

Reviewed by Anders Carlsson.

Source/WebCore:

* page/AlternativeTextClient.h:
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::~Page):
* page/Page.h:
(WebCore::Page::alternativeTextClient const):
* page/PageConfiguration.h:

Source/WebKit:

* WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
* WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp:
(WebKit::WebAlternativeTextClient::pageDestroyed): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_overriddenMediaType):

Source/WebKitLegacy/mac:

* WebCoreSupport/WebAlternativeTextClient.h:
* WebCoreSupport/WebAlternativeTextClient.mm:
(WebAlternativeTextClient::pageDestroyed): Deleted.
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):

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

2 months agoActivate the SQLite database as an on-by-default feature
katherine_cheney@apple.com [Tue, 3 Dec 2019 17:12:40 +0000 (17:12 +0000)]
Activate the SQLite database as an on-by-default feature
https://bugs.webkit.org/show_bug.cgi?id=204774
<rdar://problem/56117706>

Reviewed by Brent Fulgham.

The flag to use the ITP Database backend should be set to true by default.
* Shared/WebPreferences.yaml:

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

2 months agoStart adding encoding support for DisplayList and some DisplayListItems
timothy_horton@apple.com [Tue, 3 Dec 2019 16:50:43 +0000 (16:50 +0000)]
Start adding encoding support for DisplayList and some DisplayListItems
https://bugs.webkit.org/show_bug.cgi?id=204740

Reviewed by Simon Fraser.

To be used in a later patch.

Start encoding and decoding DisplayList, and its child items. We
currently support only a subset of the item subclasses.

* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContextStateChange::changesFromState const):
(WebCore::GraphicsContextStateChange::accumulate):
(WebCore::GraphicsContextStateChange::apply const):
* platform/graphics/GraphicsContext.h:
Adopt OptionSet for GraphicsContextState::StateChangeFlags.

* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/Pattern.h:
* platform/graphics/displaylists/DisplayList.h:
(WebCore::DisplayList::DisplayList::encode const):
(WebCore::DisplayList::DisplayList::decode):
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::Item::Item):
(WebCore::DisplayList::DrawingItem::DrawingItem):
(WebCore::DisplayList::Save::Save):
(WebCore::DisplayList::Restore::Restore):
(WebCore::DisplayList::Translate::Translate):
(WebCore::DisplayList::Rotate::Rotate):
(WebCore::DisplayList::Scale::Scale):
(WebCore::DisplayList::SetState::SetState):
(WebCore::DisplayList::DrawRect::DrawRect):
(WebCore::DisplayList::DrawPath::DrawPath):
(WebCore::DisplayList::FillRect::FillRect):
(WebCore::DisplayList::FillRectWithColor::FillRectWithColor):
(WebCore::DisplayList::FillCompositedRect::FillCompositedRect):
(WebCore::DisplayList::FillPath::FillPath):
(WebCore::DisplayList::ClearRect::ClearRect):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::Item::isStateItemType):
(WebCore::DisplayList::Save::encode const):
(WebCore::DisplayList::Save::decode):
(WebCore::DisplayList::Restore::encode const):
(WebCore::DisplayList::Restore::decode):
(WebCore::DisplayList::Translate::encode const):
(WebCore::DisplayList::Translate::decode):
(WebCore::DisplayList::Rotate::encode const):
(WebCore::DisplayList::Rotate::decode):
(WebCore::DisplayList::Scale::encode const):
(WebCore::DisplayList::Scale::decode):
(WebCore::DisplayList::ConcatenateCTM::encode const):
(WebCore::DisplayList::ConcatenateCTM::decode):
(WebCore::DisplayList::SetState::create):
(WebCore::DisplayList::SetState::encode const):
(WebCore::DisplayList::SetState::decode):
(WebCore::DisplayList::DrawRect::encode const):
(WebCore::DisplayList::DrawRect::decode):
(WebCore::DisplayList::DrawPath::encode const):
(WebCore::DisplayList::DrawPath::decode):
(WebCore::DisplayList::FillRect::encode const):
(WebCore::DisplayList::FillRect::decode):
(WebCore::DisplayList::FillRectWithColor::encode const):
(WebCore::DisplayList::FillRectWithColor::decode):
(WebCore::DisplayList::FillCompositedRect::encode const):
(WebCore::DisplayList::FillCompositedRect::decode):
(WebCore::DisplayList::FillPath::encode const):
(WebCore::DisplayList::FillPath::decode):
(WebCore::DisplayList::ClearRect::encode const):
(WebCore::DisplayList::ClearRect::decode):
(WebCore::DisplayList::Item::encode const):
(WebCore::DisplayList::Item::decode):
(WebCore::DisplayList::Item::Item): Deleted.
(WebCore::DisplayList::DrawingItem::DrawingItem): Deleted.
(WebCore::DisplayList::Save::Save): Deleted.
(WebCore::DisplayList::Restore::Restore): Deleted.
(WebCore::DisplayList::Translate::Translate): Deleted.
(WebCore::DisplayList::Rotate::Rotate): Deleted.
(WebCore::DisplayList::Scale::Scale): Deleted.
(WebCore::DisplayList::SetState::SetState): Deleted.
(WebCore::DisplayList::DrawRect::DrawRect): Deleted.
(WebCore::DisplayList::DrawPath::DrawPath): Deleted.
(WebCore::DisplayList::FillRect::FillRect): Deleted.
(WebCore::DisplayList::FillRectWithColor::FillRectWithColor): Deleted.
(WebCore::DisplayList::FillCompositedRect::FillCompositedRect): Deleted.
(WebCore::DisplayList::FillPath::FillPath): Deleted.
(WebCore::DisplayList::ClearRect::ClearRect): Deleted.
* platform/graphics/displaylists/DisplayListRecorder.h:
* platform/graphics/displaylists/DisplayListReplayer.h:
(WebCore::DisplayList::Replayer::replay):

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

2 months agoAdd support for camera rotation when capturing in UIProcess
youenn@apple.com [Tue, 3 Dec 2019 16:28:22 +0000 (16:28 +0000)]
Add support for camera rotation when capturing in UIProcess
https://bugs.webkit.org/show_bug.cgi?id=204750

Reviewed by Eric Carlson.

Source/WebKit:

Make UserMediaCaptureManagerProxy have an OrientationNotifier.
It is updated by each web page of the web process being notified of a device orientation change.
Whenever a rotation happens, UIProcess sources are now notified to correctly compute the frame rotations.

Covered by existing tests.

* UIProcess/API/C/WKPage.cpp:
(WKPageSetMockCameraOrientation):
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
(WebKit::UserMediaCaptureManagerProxy::setOrientation):
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setOrientationForMediaCapture):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::userMediaCaptureManagerProxy):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setDeviceOrientation):

Tools:

Add test runner API to set the device rotation specifically for mock camera devices.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setMockCameraOrientation):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::setMockCameraOrientation):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

LayoutTests:

* webrtc/video-rotation.html:
Capture in UIProcess on Cocoa port and make use of test runner API to simulate device rotation.

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

2 months agoLayout Test fast/layoutformattingcontext/flow-integration-basic.html is failing
pvollan@apple.com [Tue, 3 Dec 2019 15:46:56 +0000 (15:46 +0000)]
Layout Test fast/layoutformattingcontext/flow-integration-basic.html is failing
https://bugs.webkit.org/show_bug.cgi?id=204795

Unreviewed test gardening.

* platform/win/TestExpectations:

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

2 months agoThe test webanimations/accelerated-animation-removal-upon-transition-completion.html...
pvollan@apple.com [Tue, 3 Dec 2019 15:42:34 +0000 (15:42 +0000)]
The test webanimations/accelerated-animation-removal-upon-transition-completion.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=204794

Unreviewed test gardening.

* platform/win/TestExpectations:

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

2 months ago[LFC][Integration] Rename RenderBlockFlowLineLayout and move it to LayoutIntegration...
antti@apple.com [Tue, 3 Dec 2019 15:41:43 +0000 (15:41 +0000)]
[LFC][Integration] Rename RenderBlockFlowLineLayout and move it to LayoutIntegration namespace
https://bugs.webkit.org/show_bug.cgi?id=204791

Reviewed by Sam Weinig.

Layout::RenderBlockFlowLineLayout -> LayoutIntegration::LineLayout

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/integration/LayoutIntegrationLineLayout.cpp: Renamed from Source/WebCore/layout/integration/RenderBlockFlowLineLayout.cpp.
(WebCore::LayoutIntegration::LineLayout::LineLayout):
(WebCore::LayoutIntegration::LineLayout::canUseFor):
(WebCore::LayoutIntegration::LineLayout::layout):
(WebCore::LayoutIntegration::LineLayout::prepareRootGeometryForLayout):
(WebCore::LayoutIntegration::LineLayout::displayInlineContent const):
(WebCore::LayoutIntegration::LineLayout::paint):
(WebCore::LayoutIntegration::LineLayout::textBoxesFor const):
(WebCore::LayoutIntegration::LineLayout::elementBoxFor const):
(WebCore::LayoutIntegration::LineLayout::rootLayoutBox const):
* layout/integration/RenderBlockFlowLineLayout.h: Removed.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutInlineChildren):
(WebCore::RenderBlockFlow::paintInlineChildren):
(WebCore::RenderBlockFlow::invalidateLineLayoutPath):
(WebCore::RenderBlockFlow::layoutLFCLines):
* rendering/RenderBlockFlow.h:
(WebCore::RenderBlockFlow::hasLayoutFormattingContextLineLayout const):
(WebCore::RenderBlockFlow::layoutFormattingContextLineLayout const):
(WebCore::RenderBlockFlow::layoutFormattingContextLineLayout):
(WebCore::RenderBlockFlow::hasLFCLineLayout const): Deleted.
(WebCore::RenderBlockFlow::lfcLineLayout const): Deleted.
(WebCore::RenderBlockFlow::lfcLineLayout): Deleted.
* rendering/line/LineLayoutTraversal.cpp:
(WebCore::LineLayoutTraversal::firstTextBoxFor):
(WebCore::LineLayoutTraversal::elementBoxFor):

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

2 months ago[LFC][Integration] Shorten feature flag name
antti@apple.com [Tue, 3 Dec 2019 15:20:46 +0000 (15:20 +0000)]
[LFC][Integration] Shorten feature flag name
https://bugs.webkit.org/show_bug.cgi?id=204788

Reviewed by Sam Weinig.

Source/WebCore:

LayoutFormattingContextRenderTreeIntegrationEnabled -> LayoutFormattingContextIntegrationEnabled

* layout/integration/RenderBlockFlowLineLayout.cpp:
(WebCore::Layout::RenderBlockFlowLineLayout::canUseFor):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setLayoutFormattingContextIntegrationEnabled):
(WebCore::RuntimeEnabledFeatures::layoutFormattingContextIntegrationEnabled const):
(WebCore::RuntimeEnabledFeatures::setLayoutFormattingContextRenderTreeIntegrationEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::layoutFormattingContextRenderTreeIntegrationEnabled const): Deleted.

Source/WebKit:

* Shared/WebPreferences.yaml:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

LayoutTests:

* fast/layoutformattingcontext/flow-integration-basic.html:

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

2 months agoMediaRecorderPrivateWriter should not be destroyed until finishing its writing task...
youenn@apple.com [Tue, 3 Dec 2019 15:01:15 +0000 (15:01 +0000)]
MediaRecorderPrivateWriter should not be destroyed until finishing its writing task completion handler is called
https://bugs.webkit.org/show_bug.cgi?id=204789
<rdar://problem/57561143>

Reviewed by Eric Carlson.

When stopping the recorder, we might stop recording the private writer without calling fetchData.
In that case, we do not wait for the writing completion handler.
Fix this by using the semaphore at the end of stopRecording.
Covered by existing test.

* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
(WebCore::MediaRecorderPrivateWriter::stopRecording):
(WebCore::MediaRecorderPrivateWriter::fetchData):

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

2 months ago[LFC][IFC] TextUtil::width should not overflow when word/letter-spacing is larger...
zalan@apple.com [Tue, 3 Dec 2019 14:52:48 +0000 (14:52 +0000)]
[LFC][IFC] TextUtil::width should not overflow when word/letter-spacing is larger than LayoutUnit::max
https://bugs.webkit.org/show_bug.cgi?id=204782
<rdar://problem/57580285>

Reviewed by Antti Koivisto.

LayoutUnit width = font.width(run) and width -= (font.spaceWidth() + font.wordSpacing()) could produce a negative width value.

* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::InlineItemRun::removeTrailingLetterSpacing):
* layout/inlineformatting/text/TextUtil.cpp:
(WebCore::Layout::TextUtil::width):
(WebCore::Layout::TextUtil::fixedPitchWidth):

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

2 months ago[LFC][IFC] Try to fit content on the current line when the line has trimmable trailin...
zalan@apple.com [Tue, 3 Dec 2019 14:49:53 +0000 (14:49 +0000)]
[LFC][IFC] Try to fit content on the current line when the line has trimmable trailing content
https://bugs.webkit.org/show_bug.cgi?id=204781
<rdar://problem/57580138>

Reviewed by Antti Koivisto.

Let's expand the available space when the line has trailing trimmable whitespace and we try to fit some empty inline containers.
"text content <span style="padding: 1px"></span>" <- the <span></span> runs should fit after trimming the trailing whitespace.

* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::LineBreaker::breakingContextForInlineContent):
(WebCore::Layout::LineBreaker::Content::hasNonContentRunsOnly const):
* layout/inlineformatting/InlineLineBreaker.h:
* layout/inlineformatting/LineLayoutContext.cpp:
(WebCore::Layout::LineLayoutContext::processUncommittedContent):

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

2 months agoExpose WKWebView API to stop ongoing capture
youenn@apple.com [Tue, 3 Dec 2019 14:45:21 +0000 (14:45 +0000)]
Expose WKWebView API to stop ongoing capture
https://bugs.webkit.org/show_bug.cgi?id=204787

Reviewed by Eric Carlson.

Source/WebKit:

Covered by API test.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _stopMediaCapture]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

Tools:

* TestWebKitAPI/Tests/WebKit/GetUserMedia.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/getUserMedia.html:

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

2 months agoUnreviewed, fix build warning.
calvaris@igalia.com [Tue, 3 Dec 2019 13:37:01 +0000 (13:37 +0000)]
Unreviewed, fix build warning.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
durationMediaTime should be marked as override.

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

2 months ago[WPE] Some WebGL 1.0.3 conformance tests are marked as failing but have been consiste...
commit-queue@webkit.org [Tue, 3 Dec 2019 12:32:01 +0000 (12:32 +0000)]
[WPE] Some WebGL 1.0.3 conformance tests are marked as failing but have been consistently passing
https://bugs.webkit.org/show_bug.cgi?id=204790

Patch by Chris Lord <clord@igalia.com> on 2019-12-03
Reviewed by Alejandro G. Castro.

* platform/wpe/TestExpectations:

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

2 months agoUnreviewed, rolling out r253020.
Hironori.Fujii@sony.com [Tue, 3 Dec 2019 11:25:49 +0000 (11:25 +0000)]
Unreviewed, rolling out r253020.

It breaks WinCairo bots.

Reverted changeset:

"[MSVC] Add /experimental:newLambdaProcessor switch for better
C++ conformance"
https://bugs.webkit.org/show_bug.cgi?id=204443
https://trac.webkit.org/changeset/253020

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

2 months ago[Cocoa] Run camera capture in UIProcess by default in layout tests
youenn@apple.com [Tue, 3 Dec 2019 11:11:44 +0000 (11:11 +0000)]
[Cocoa] Run camera capture in UIProcess by default in layout tests
https://bugs.webkit.org/show_bug.cgi?id=204512

Reviewed by Eric Carlson.

Source/WebCore:

Remove no longer useful internals API once we are moving capture to UIProcess.

* platform/mediastream/RealtimeMediaSourceFactory.h:
* testing/Internals.cpp:
(WebCore::Internals::Internals):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::willCreateMediaStream):
Do not send sandbox extensions in case capture happens in UIProcess.
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::Source::~Source):
(WebKit::UserMediaCaptureManager::createCaptureSource):
Register/unregister sources as active/unactive sources to the factory.

Tools:

By defaut, enable capture in UIProcess on Cocoa side.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):

LayoutTests:

Update tests to remove use of the removed internals API and disable
camera capture in UIProcess for two tests that exihibit shortcomings of our current UIProcess camera capture support.

* fast/mediastream/constraint-intrinsic-size.html:
* fast/mediastream/media-stream-page-muted.html:
* fast/mediastream/mediastreamtrack-video-clone.html:
* fast/mediastream/mock-media-source-expected.txt:
* fast/mediastream/mock-media-source.html:
* fast/mediastream/overconstrainederror-constraint.html:
* webrtc/video-rotation.html:

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

2 months ago[LFC][Integration] Setup root box properties
antti@apple.com [Tue, 3 Dec 2019 10:51:46 +0000 (10:51 +0000)]
[LFC][Integration] Setup root box properties
https://bugs.webkit.org/show_bug.cgi?id=204743

Reviewed by Zalan Bujtas.

Source/WebCore:

Test: fast/layoutformattingcontext/flow-integration-basic.html

Line layout needs to know about flow borders and padding so that boxes are offset correctly.

* CMakeLists.txt:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::layout):
(WebCore::Layout::LayoutContext::layoutWithPreparedRootGeometry):

Split setup and layout into separate functions.

* layout/LayoutContext.h:
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::displayBoxForLayoutRoot):
* layout/LayoutState.h:
* layout/displaytree/DisplayPainter.cpp:
(WebCore::Display::paintInlineContent):
(WebCore::Display::Painter::paint):
(WebCore::Display::Painter::paintInlineFlow):

Avoid accessing tree root box properties when painting (since margins are not set up).

* layout/integration/RenderBlockFlowLineLayout.cpp: Renamed from Source/WebCore/layout/RenderBlockFlowLineLayout.cpp.

Moved to integration subdirectory.

(WebCore::Layout::RenderBlockFlowLineLayout::layout):

Drop the content size paramater, the caller is responsible of setting up the root display box.

(WebCore::Layout::RenderBlockFlowLineLayout::prepareRootDisplayBoxForLayout):

Setup padding and borders.

(WebCore::Layout::RenderBlockFlowLineLayout::displayInlineContent const):
(WebCore::Layout::RenderBlockFlowLineLayout::rootLayoutBox const):
* layout/integration/RenderBlockFlowLineLayout.h: Renamed from Source/WebCore/layout/RenderBlockFlowLineLayout.h.
(WebCore::Layout::RenderBlockFlowLineLayout::contentLogicalHeight const):

Use a member to pass content height.

* layout/layouttree/LayoutTreeBuilder.h:
(WebCore::Layout::LayoutTreeContent::layoutBoxForRenderer const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutLFCLines):

LayoutTests:

* fast/layoutformattingcontext/flow-integration-basic.html: Added.
* platform/mac/fast/layoutformattingcontext/flow-integration-basic-expected.txt: Added.

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

2 months agoImplement createImageBitmap(OffscreenCanvas)
commit-queue@webkit.org [Tue, 3 Dec 2019 10:30:55 +0000 (10:30 +0000)]
Implement createImageBitmap(OffscreenCanvas)
https://bugs.webkit.org/show_bug.cgi?id=183440

Patch by Zan Dobersek <zdobersek@igalia.com> on 2019-12-03
Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt:
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-serializable-expected.txt:
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-transfer-expected.txt:
* web-platform-tests/offscreen-canvas/convert-to-blob/offscreencanvas.convert.to.blob.w-expected.txt:
* web-platform-tests/offscreen-canvas/the-offscreen-canvas/offscreencanvas.transfer.to.imagebitmap.w-expected.txt:

Source/WebCore:

No new tests. Covered by existing tests.

* html/ImageBitmap.cpp:
(WebCore::ImageBitmap::createPromise):
* html/ImageBitmap.h:
* page/WindowOrWorkerGlobalScope.idl:

LayoutTests:

* platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:

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

2 months agoWebDriver: handle elements of type file in send keys command
carlosgc@webkit.org [Tue, 3 Dec 2019 10:03:32 +0000 (10:03 +0000)]
WebDriver: handle elements of type file in send keys command
https://bugs.webkit.org/show_bug.cgi?id=188514

Reviewed by Brian Burg.

Source/WebCore:

Export symbols now used by WebKit::WebAutomationSessionProxy.

* html/HTMLInputElement.h:

Source/WebDriver:

Handle the case of inpout element being a file upload in send keys command.

* Capabilities.h: Add strictFileInteractability.
* Session.cpp:
(WebDriver::Session::elementIsFileUpload): Helper to check if the given element is a file upload and whether
it's multiple or not.
(WebDriver::Session::parseElementIsFileUploadResult): Parse the result of elementIsFileUpload().
(WebDriver::Session::elementClick): If the element is a file upload, fail with invalid argument error.
(WebDriver::Session::setInputFileUploadFiles): Send setFilesForInputFileUpload message to the browser with the
selected files.
(WebDriver::Session::elementSendKeys): If the element is a file upload, call setInputFileUploadFiles()
instead. Also handle the strictFileInteractability capability to decide whether to focus and check
interactability on the input element or not.
* Session.h:
* WebDriverService.cpp:
(WebDriver::WebDriverService::parseCapabilities const): Handle strictFileInteractability.
(WebDriver::WebDriverService::validatedCapabilities const): Ditto.
(WebDriver::WebDriverService::matchCapabilities const): Ditto.
(WebDriver::WebDriverService::createSession): Ditto.

Source/WebKit:

Add setFilesForInputFileUpload method to Automation. It's like setFilesToSelectForFileUpload, but it works
differently, so I'm keeping both to not break safaridriver. The new one simply sends the file list to the web
process to be set on the input element, instead of saving the file list, wait for the driver to trigger the open
panel, intercept and complete the open panel request and send a dismiss open panel event to the driver.

* UIProcess/Automation/Automation.json: Add setFilesForInputFileUpload.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::setFilesForInputFileUpload): Send SetFilesForInputFileUpload message to the web process.
* UIProcess/Automation/WebAutomationSession.h:
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::setFilesForInputFileUpload): Create a FileList with the received paths and
call HTMLInputElement::setFiles() on the given element.
* WebProcess/Automation/WebAutomationSessionProxy.h:
* WebProcess/Automation/WebAutomationSessionProxy.messages.in: Add SetFilesForInputFileUpload message.

WebDriverTests:

Remove expectations for tests that are now passing.

* TestExpectations.json:

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

2 months agoWebDriver: most of the clear tests are failing
carlosgc@webkit.org [Tue, 3 Dec 2019 09:32:14 +0000 (09:32 +0000)]
WebDriver: most of the clear tests are failing
https://bugs.webkit.org/show_bug.cgi?id=180404

Reviewed by Brian Burg.

Source/WebDriver:

Implement the element clear command following the spec.
https://w3c.github.io/webdriver/#element-clear

* Session.cpp:
(WebDriver::Session::elementIsEditable): Helper function to check if the element is editable.
(WebDriver::Session::elementClear): Check if the element is editable and interactable before executing the clear atom.
* Session.h:

Source/WebKit:

Update the FormElementClear atom to follow the spec.

* UIProcess/Automation/atoms/FormElementClear.js:
(isEditable):
(isResettableElementEmpty):

WebDriverTests:

Remove expectations for tests that are now passing.

* TestExpectations.json:

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

2 months ago[PSON] Tooltips from previous page shown on new page
carlosgc@webkit.org [Tue, 3 Dec 2019 09:30:19 +0000 (09:30 +0000)]
[PSON] Tooltips from previous page shown on new page
https://bugs.webkit.org/show_bug.cgi?id=204735

Reviewed by Chris Dumez.

Source/WebCore:

Remove Chrome::setToolTip() that is always called after Chrome::mouseDidMoveOverElement() and add the
tooltip text and direction as parameters of Chrome::mouseDidMoveOverElement().

* loader/EmptyClients.h:
* page/Chrome.cpp:
(WebCore::Chrome::mouseDidMoveOverElement):
(WebCore::Chrome::getToolTip):
* page/Chrome.h:
* page/ChromeClient.h:
* page/EventHandler.cpp:
(WebCore::EventHandler::mouseMoved):

Source/WebKit:

The problem is that WebPage (in the web process) is caching the tooltip text to avoid sending IPC messages when
the tooltip didn't change. When a new web process is used for the same web view, the tooltip text doesn't really
change (it's always null) until a new one is set. The setToolTip message is always sent right after the
MouseDidMoveOverElement, and they both depend on the same hit test result, so we can include the tooltip text as
part of the WebHitTestResultData struct passed to MouseDidMoveOverElement and remove the SetToolTip
message. Since the UI process is already caching the tooltip, we can simply notify the page client when it changes.

* Shared/WebHitTestResultData.cpp:
(WebKit::WebHitTestResultData::WebHitTestResultData): Initialize toolTipText.
(WebKit::WebHitTestResultData::encode const): Encode toolTipText.
(WebKit::WebHitTestResultData::decode): Decode toolTipText.
* Shared/WebHitTestResultData.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::mouseDidMoveOverElement): Call setToolTip() after notifying the UI client about the mouse move.
(WebKit::WebPageProxy::setToolTip): Return early if tooltip didn't change.
(WebKit::WebPageProxy::resetState): Use setToolTip() to ensure the page client is notified about the change.
* UIProcess/WebPageProxy.messages.in: Remove SetToolTip message.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::mouseDidMoveOverElement): Pass tooltip text to WebHitTestResultData constructor.
* WebProcess/WebCoreSupport/WebChromeClient.h:

Source/WebKitLegacy/mac:

Update to the new ChromeClient API.

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::mouseDidMoveOverElement):
(WebChromeClient::setToolTip):

Source/WebKitLegacy/win:

Update to the new ChromeClient API.

* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::mouseDidMoveOverElement):
* WebCoreSupport/WebChromeClient.h:

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

2 months agoUnreviewed. Focus the location bar on CTRL+l in GTK MiniBrowser
carlosgc@webkit.org [Tue, 3 Dec 2019 09:28:17 +0000 (09:28 +0000)]
Unreviewed. Focus the location bar on CTRL+l in GTK MiniBrowser

* MiniBrowser/gtk/BrowserWindow.c:
(focusLocationBar):
(browser_window_init):

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

2 months agoPropertySlot should not have Customs have a PropertyOffset of zero
sbarati@apple.com [Tue, 3 Dec 2019 07:55:25 +0000 (07:55 +0000)]
PropertySlot should not have Customs have a PropertyOffset of zero
https://bugs.webkit.org/show_bug.cgi?id=204566
<rdar://problem/57466781>

Reviewed by Keith Miller.

JSTests:

* stress/cacheable-custom-accessor-should-not-have-property-offset.js: Added.

Source/JavaScriptCore:

We used to say that PropertyOffset of a cacheable custom was always zero. We
did this because we were using "invalidOffset" to indicate things aren't
cacheable. This patch refactors PropertySlot to not look at PropertyOffset
for cacheability, but instead just uses the cacheability bit. With that
change, we now say that customs always have the invalid PropertyOffset. This
fixes a bug where we used to watch for property changes at the offset inside
an AccessCase. We were doing this for the zero property offset for all
customs. This could trigger a crash inside startWatchingPropertyForReplacements
because the prototype Structure was a dictionary. We allow dictionaries to
be property holders of customs as long as the property is a custom and has
DontDelete property attribute, since DontDelete proves the custom will never
change.

* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* runtime/PropertySlot.h:
(JSC::PropertySlot::PropertySlot):
(JSC::PropertySlot::isCacheable const):
(JSC::PropertySlot::setValue):
(JSC::PropertySlot::setCustom):
(JSC::PropertySlot::setCacheableCustom):
(JSC::PropertySlot::setCustomGetterSetter):
(JSC::PropertySlot::setGetterSlot):
(JSC::PropertySlot::setCacheableGetterSlot):
(JSC::PropertySlot::setUndefined):

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

2 months agoCross-thread version StorageQuotaManager
sihui_liu@apple.com [Tue, 3 Dec 2019 06:53:42 +0000 (06:53 +0000)]
Cross-thread version StorageQuotaManager
https://bugs.webkit.org/show_bug.cgi?id=203971
<rdar://problem/57290349>

Reviewed by Chris Dumez.

Source/WebCore:

Implement a lock-based StorageQuotaManager so that quota check can be done on different threads.
If space request is made on a background thread, it needs to hold a lock until it is finished, so no request
from different threads can be performed at the same time.
If space request is made on the main thread, we will dispatch it to a background thread and schedule a calllback
to the main thread when result is available, so the main thread will not be blocked.

Covered by existing quota related tests.

* Headers.cmake:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::create):
(WebCore::IDBServer::IDBServer::IDBServer):
(WebCore::IDBServer::IDBServer::didPerformCloseAndDeleteDatabases):
(WebCore::IDBServer::IDBServer::requestSpace):
(WebCore::IDBServer::IDBServer::diskUsage):
(WebCore::IDBServer::IDBServer::QuotaUser::QuotaUser): Deleted.
(WebCore::IDBServer::IDBServer::QuotaUser::~QuotaUser): Deleted.
(WebCore::IDBServer::IDBServer::QuotaUser::resetSpaceUsed): Deleted.
(WebCore::IDBServer::IDBServer::QuotaUser::computeSpaceUsed): Deleted.
(WebCore::IDBServer::IDBServer::QuotaUser::increaseSpaceUsed): Deleted.
(WebCore::IDBServer::IDBServer::QuotaUser::decreaseSpaceUsed): Deleted.
(WebCore::IDBServer::IDBServer::QuotaUser::whenInitialized): Deleted.
(WebCore::IDBServer::IDBServer::QuotaUser::initializeSpaceUsed): Deleted.
(WebCore::IDBServer::IDBServer::ensureQuotaUser): Deleted.
(WebCore::IDBServer::IDBServer::startComputingSpaceUsedForOrigin): Deleted.
(WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin): Deleted.
(WebCore::IDBServer::IDBServer::finishComputingSpaceUsedForOrigin): Deleted.
(WebCore::IDBServer::IDBServer::resetSpaceUsed): Deleted.
(WebCore::IDBServer::IDBServer::increaseSpaceUsed): Deleted.
(WebCore::IDBServer::IDBServer::decreaseSpaceUsed): Deleted.
(WebCore::IDBServer::IDBServer::increasePotentialSpaceUsed): Deleted.
(WebCore::IDBServer::IDBServer::decreasePotentialSpaceUsed): Deleted.
* Modules/indexeddb/server/IDBServer.h:
(WebCore::IDBServer::IDBServer::initializeQuotaUser): Deleted.
(): Deleted.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
(WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::didOpenBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::performCreateObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformCreateObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::performRenameObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::createIndex):
(WebCore::IDBServer::UniqueIDBDatabase::performCreateIndex):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformCreateIndex):
(WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
(WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
(WebCore::IDBServer::UniqueIDBDatabase::performRenameIndex):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameIndex):
(WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformPutOrAdd):
(WebCore::IDBServer::UniqueIDBDatabase::getRecord):
(WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
(WebCore::IDBServer::UniqueIDBDatabase::performGetRecord):
(WebCore::IDBServer::UniqueIDBDatabase::performGetAllRecords):
(WebCore::IDBServer::UniqueIDBDatabase::getCount):
(WebCore::IDBServer::UniqueIDBDatabase::deleteRecord):
(WebCore::IDBServer::UniqueIDBDatabase::openCursor):
(WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
(WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::requestSpace): Deleted.
(WebCore::IDBServer::UniqueIDBDatabase::waitForRequestSpaceCompletion): Deleted.
(WebCore::IDBServer::UniqueIDBDatabase::startSpaceIncreaseTask): Deleted.
(WebCore::IDBServer::UniqueIDBDatabase::finishSpaceIncreaseTask): Deleted.
(WebCore::IDBServer::UniqueIDBDatabase::createObjectStoreAfterQuotaCheck): Deleted.
(WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStoreAfterQuotaCheck): Deleted.
(WebCore::IDBServer::UniqueIDBDatabase::renameObjectStoreAfterQuotaCheck): Deleted.
(WebCore::IDBServer::UniqueIDBDatabase::clearObjectStoreAfetQuotaCheck): Deleted.
(WebCore::IDBServer::UniqueIDBDatabase::createIndexAfterQuotaCheck): Deleted.
(WebCore::IDBServer::UniqueIDBDatabase::deleteIndexAfterQuotaCheck): Deleted.
(WebCore::IDBServer::UniqueIDBDatabase::renameIndexAfterQuotaCheck): Deleted.
(WebCore::IDBServer::UniqueIDBDatabase::putOrAddAfterQuotaCheck): Deleted.
(WebCore::IDBServer::UniqueIDBDatabase::getRecordAfterQuotaCheck): Deleted.
(WebCore::IDBServer::UniqueIDBDatabase::getAllRecordsAfterQuotaCheck): Deleted.
(WebCore::IDBServer::UniqueIDBDatabase::getCountAfterQuotaCheck): Deleted.
(WebCore::IDBServer::UniqueIDBDatabase::deleteRecordAfterQuotaCheck): Deleted.
(WebCore::IDBServer::UniqueIDBDatabase::openCursorAfterQuotaCheck): Deleted.
(WebCore::IDBServer::UniqueIDBDatabase::iterateCursorAfterQuotaCheck): Deleted.
(WebCore::IDBServer::UniqueIDBDatabase::commitTransactionAfterQuotaCheck): Deleted.
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::abortTransactionWithoutCallback):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::abort):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::putOrAdd):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::getAllRecords):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::getCount):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteRecord):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::openCursor):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::quotaManager):
(WebCore::storageQuotaManagerSpaceRequester):
(WebCore::InProcessIDBServer::InProcessIDBServer):
(WebCore::storageQuotaManagerGetter): Deleted.
* Modules/indexeddb/shared/InProcessIDBServer.h:
* WebCore.xcodeproj/project.pbxproj:
* storage/StorageQuotaManager.cpp:
(WebCore::StorageQuotaManager::create):
(WebCore::StorageQuotaManager::StorageQuotaManager):
(WebCore::StorageQuotaManager::requestSpaceOnMainThread):
(WebCore::StorageQuotaManager::requestSpaceOnBackgroundThread):
(WebCore::StorageQuotaManager::tryGrantRequest):
(WebCore::StorageQuotaManager::updateQuotaBasedOnUsage):
(WebCore::StorageQuotaManager::resetQuotaUpdatedBasedOnUsageForTesting):
(WebCore::StorageQuotaManager::resetQuotaForTesting):
(WebCore::StorageQuotaManager::~StorageQuotaManager): Deleted.
(WebCore::StorageQuotaManager::spaceUsage const): Deleted.
(WebCore::StorageQuotaManager::updateQuotaBasedOnSpaceUsage): Deleted.
(WebCore::StorageQuotaManager::initializeUsersIfNeeded): Deleted.
(WebCore::StorageQuotaManager::askUserToInitialize): Deleted.
(WebCore::StorageQuotaManager::addUser): Deleted.
(WebCore::StorageQuotaManager::shouldAskForMoreSpace const): Deleted.
(WebCore::StorageQuotaManager::removeUser): Deleted.
(WebCore::StorageQuotaManager::requestSpace): Deleted.
(WebCore::StorageQuotaManager::askForMoreSpace): Deleted.
(WebCore::StorageQuotaManager::processPendingRequests): Deleted.
* storage/StorageQuotaManager.h:
(WebCore::StorageQuotaManager::defaultThirdPartyQuotaFromPerOriginQuota):
(WebCore::StorageQuotaManager::StorageQuotaManager): Deleted.
(WebCore::StorageQuotaManager::resetQuota): Deleted.
(WebCore::StorageQuotaManager::state const): Deleted.
* storage/StorageQuotaUser.h: Removed.

Source/WebKit:

* NetworkProcess/NetworkProcess.cpp: Introduce class SessionStorageQuotaManager to manage all
StorageQuotaManagers of the same session.
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::addWebsiteDataStore):
(WebKit::NetworkProcess::addSessionStorageQuotaManager):
(WebKit::NetworkProcess::removeSessionStorageQuotaManager):
(WebKit::NetworkProcess::destroySession):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::createIDBServer):
(WebKit::NetworkProcess::addIndexedDatabaseSession):
(WebKit::NetworkProcess::setSessionStorageQuotaManagerIDBRootPath):
(WebKit::NetworkProcess::updateQuotaBasedOnSpaceUsageForTesting):
(WebKit::NetworkProcess::resetQuota):
(WebKit::NetworkProcess::storageQuotaManager):
(WebKit::NetworkProcess::initializeStorageQuota): Deleted.
(WebKit::NetworkProcess::clearStorageQuota): Deleted.
(): Deleted.
(WebKit::NetworkProcess::initializeQuotaUsers): Deleted.
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::SessionStorageQuotaManager::SessionStorageQuotaManager):
(WebKit::NetworkProcess::SessionStorageQuotaManager::defaultQuota const):
(WebKit::NetworkProcess::SessionStorageQuotaManager::ensureOriginStorageQuotaManager):
(WebKit::NetworkProcess::SessionStorageQuotaManager::existingStorageQuotaManagers):
(WebKit::NetworkProcess::SessionStorageQuotaManager::cacheRootPath const):
(WebKit::NetworkProcess::SessionStorageQuotaManager::setIDBRootPath):
(WebKit::NetworkProcess::SessionStorageQuotaManager::idbRootPath const):
(WebKit::NetworkProcess::StorageQuotaManagers::defaultQuota const): Deleted.
(WebKit::NetworkProcess::StorageQuotaManagers::setDefaultQuotas): Deleted.
(WebKit::NetworkProcess::StorageQuotaManagers::managersPerOrigin): Deleted.
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::getDirectorySize):
(WebKit::CacheStorage::Engine::diskUsage): static function to get the disk usage of CacheStorage given
CacheStorage root directory.
(WebKit::CacheStorage::Engine::requestSpace):
(WebKit::CacheStorage::Engine::readCachesFromDisk):
(WebKit::CacheStorage::Engine::writeSizeFile):
(WebKit::CacheStorage::Engine::readSizeFile):
(WebKit::CacheStorage::Engine::initializeQuotaUser): Deleted.
* NetworkProcess/cache/CacheStorageEngine.h:
* NetworkProcess/cache/CacheStorageEngineCache.cpp:
(WebKit::CacheStorage::Cache::put):
(WebKit::CacheStorage::Cache::remove):
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::create):
(WebKit::CacheStorage::Caches::Caches):
(WebKit::CacheStorage::Caches::~Caches):
(WebKit::CacheStorage::Caches::updateSizeFile):
(WebKit::CacheStorage::Caches::initializeSize):
(WebKit::CacheStorage::Caches::clear):
(WebKit::CacheStorage::Caches::requestSpace):
(WebKit::CacheStorage::Caches::writeRecord):
(WebKit::CacheStorage::Caches::removeRecord):
(WebKit::CacheStorage::Caches::whenInitialized): Deleted.
(WebKit::CacheStorage::Caches::resetSpaceUsed): Deleted.
* NetworkProcess/cache/CacheStorageEngineCaches.h:
* Shared/WebsiteDataStoreParameters.cpp:
(WebKit::WebsiteDataStoreParameters::encode const):
(WebKit::WebsiteDataStoreParameters::decode):
* Shared/WebsiteDataStoreParameters.h: Add a cacheStorageDirectory parameter so we know the direcotry of
CacheStorage when we start using WebsiteDataStore.
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreResetQuota):
* UIProcess/API/C/WKWebsiteDataStoreRef.h: Add a C API for reseting quota in TestRunner.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::resetQuota):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::parameters):
(WebKit::WebsiteDataStore::resetQuota):
* UIProcess/WebsiteData/WebsiteDataStore.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/StorageQuotaManager.cpp: Removed as we have a different StorageQuotaManager
implementation now.
* WebKitTestRunner/TestController.cpp: reset StorageQuotaManager's quota between tests.
(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::resetQuota):
* WebKitTestRunner/TestController.h:

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

2 months agorun-jsc should exit with the same signal or exit status that the `jsc` shell does
sbarati@apple.com [Tue, 3 Dec 2019 05:07:15 +0000 (05:07 +0000)]
run-jsc should exit with the same signal or exit status that the `jsc` shell does
https://bugs.webkit.org/show_bug.cgi?id=204778

Reviewed by Keith Miller.

* Scripts/run-jsc:

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

2 months ago[MSVC] Add /experimental:newLambdaProcessor switch for better C++ conformance
Hironori.Fujii@sony.com [Tue, 3 Dec 2019 02:06:48 +0000 (02:06 +0000)]
[MSVC] Add /experimental:newLambdaProcessor switch for better C++ conformance
https://bugs.webkit.org/show_bug.cgi?id=204443

Reviewed by Alex Christensen.

.:

MSVC has a bug of lambda capture of 'this'. It has caused
compilation errors repeatedly.

* Source/cmake/OptionsMSVC.cmake: Added /experimental:newLambdaProcessor switch.

Source/WebCore:

* dom/DocumentStorageAccess.cpp:
(WebCore::DocumentStorageAccess::requestStorageAccess): Reverted MSVC workaround of r252726.

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

2 months ago[JSC] Put some destructible objects to IsoSubspace
ysuzuki@apple.com [Tue, 3 Dec 2019 01:47:31 +0000 (01:47 +0000)]
[JSC] Put some destructible objects to IsoSubspace
https://bugs.webkit.org/show_bug.cgi?id=204771

Reviewed by Mark Lam.

This patch puts DateInstance, ErrorInstance, and Intl objects in IsoSubspace.
By using specific IsoHeapCellType, we can use JSNonFinalObject as base-classes of
them instead of using JSDestructibleObject. We also introduce STATIC_ASSERT_ISO_SUBSPACE_SHARABLE
to ensure that derived class of some IsoSubspace'ed one is intentional and safe.

* runtime/ArrayConstructor.h:
* runtime/AsyncFunctionConstructor.h:
* runtime/AsyncGeneratorFunctionConstructor.h:
* runtime/BigIntConstructor.h:
* runtime/BooleanConstructor.h:
* runtime/DateConstructor.h:
* runtime/DateInstance.cpp:
(JSC::DateInstance::destroy): Deleted.
* runtime/DateInstance.h:
* runtime/ErrorConstructor.h:
* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::destroy): Deleted.
* runtime/ErrorInstance.h:
(JSC::ErrorInstance::destroy):
(JSC::ErrorInstance::subspaceFor):
* runtime/FunctionConstructor.h:
* runtime/FunctionPrototype.h:
* runtime/GeneratorFunctionConstructor.h:
* runtime/IntlCollator.cpp:
(JSC::IntlCollator::IntlCollator):
(JSC::IntlCollator::destroy): Deleted.
* runtime/IntlCollator.h:
* runtime/IntlCollatorConstructor.h:
* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::IntlDateTimeFormat):
(JSC::IntlDateTimeFormat::destroy): Deleted.
* runtime/IntlDateTimeFormat.h:
* runtime/IntlDateTimeFormatConstructor.h:
* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::IntlNumberFormat):
(JSC::IntlNumberFormat::destroy): Deleted.
* runtime/IntlNumberFormat.h:
* runtime/IntlNumberFormatConstructor.h:
* runtime/IntlPluralRules.cpp:
(JSC::IntlPluralRules::IntlPluralRules):
(JSC::IntlPluralRules::destroy): Deleted.
* runtime/IntlPluralRules.h:
* runtime/IntlPluralRulesConstructor.h:
* runtime/JSArrayBufferConstructor.h:
* runtime/JSCell.h:
* runtime/JSObject.h:
* runtime/JSTypedArrayConstructors.h:
* runtime/JSTypedArrayViewConstructor.h:
* runtime/MapConstructor.h:
* runtime/NativeErrorConstructor.h:
* runtime/NullGetterFunction.h:
* runtime/NullSetterFunction.h:
* runtime/NumberConstructor.h:
* runtime/ObjectConstructor.h:
* runtime/ProxyConstructor.h:
* runtime/RegExpConstructor.h:
* runtime/SetConstructor.h:
* runtime/StringConstructor.h:
* runtime/SymbolConstructor.h:
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
* runtime/WeakMapConstructor.h:
* runtime/WeakObjectRefConstructor.h:
* runtime/WeakSetConstructor.h:
* tools/JSDollarVM.cpp:
* wasm/js/JSWebAssemblyCompileError.h:
* wasm/js/JSWebAssemblyLinkError.h:
* wasm/js/JSWebAssemblyRuntimeError.h:
* wasm/js/WebAssemblyCompileErrorConstructor.h:
* wasm/js/WebAssemblyInstanceConstructor.h:
* wasm/js/WebAssemblyLinkErrorConstructor.h:
* wasm/js/WebAssemblyMemoryConstructor.h:
* wasm/js/WebAssemblyModuleConstructor.h:
* wasm/js/WebAssemblyRuntimeErrorConstructor.h:
* wasm/js/WebAssemblyTableConstructor.h:

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

2 months agoWeb Inspector: Provide UI to convert between sRGB and p3 color spaces
nvasilyev@apple.com [Tue, 3 Dec 2019 01:46:11 +0000 (01:46 +0000)]
Web Inspector: Provide UI to convert between sRGB and p3 color spaces
https://bugs.webkit.org/show_bug.cgi?id=203534
<rdar://problem/56688523>

Reviewed by Devin Rousso.

Source/WebInspectorUI:

Add context menus:
- "Convert to sRGB" and "Clamp to sRGB" for p3 colors, such as `color(display-p3 0 1 0)`.
- "Convert to Display-P3" for sRGB colors, such as `rgb(0, 255, 0)`.

Shift-clicking the color swatch of sRGB colors now goes through the color function syntax as well.
Shift-clicking the color swatch of Display-P3 colors converts the color to sRGB when it can be lossless.
When the convertion cannot be lossless, Web Inspector beeps.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Utilities.js:
* UserInterface/Models/Color.js:
(WI.Color):
Introduce `_normalizedRGB` property, which stores rgb values from 0 to 1.
Previously, `_rgba` stored values from 0 to 1 for color function format, and from 0 to 255 otherwise.
That required format checks before every `rgb` value access and resulted in silent errors when
the values were in the wrong format.

Store alpha as a separate property to simplify format conversion. Previously, alpha was duplicated between `_rgba` and `_hsla`.

(WI.Color.displayP3toSRGB):
(WI.Color.srgbToDisplayP3): Added.
(WI.Color.prototype.nextFormat):
(WI.Color.prototype.get rgb):
(WI.Color.prototype.get hsl):
(WI.Color.prototype.get normalizedRGB):
(WI.Color.prototype.get rgba):
(WI.Color.prototype.get hsla):
(WI.Color.prototype.get normalizedRGBA):
(WI.Color.prototype.get gamut):
(WI.Color.prototype.set gamut):
(WI.Color.prototype.copy):
(WI.Color.prototype.isKeyword):
(WI.Color.prototype.isOutsideSRGB): Added.
(WI.Color.prototype.canBeSerializedAsShortHEX):
(WI.Color.prototype._toKeywordString):
(WI.Color.prototype._toShortHEXString):
(WI.Color.prototype._toHEXString):
(WI.Color.prototype._toShortHEXAlphaString):
(WI.Color.prototype._toHEXAlphaString):
(WI.Color.prototype._toRGBString):
(WI.Color.prototype._toRGBAString):
(WI.Color.prototype._toFunctionString):
Limit the values to 4 decimals.

(WI.Color.prototype._toHSLString):
(WI.Color.prototype._toHSLAString):
(WI.Color.prototype._hslToRGB):
* UserInterface/Views/ColorPicker.js:
(WI.ColorPicker.prototype._updateColor):
(WI.ColorPicker.prototype._updateOpacitySlider):
* UserInterface/Views/ColorSquare.css:
(.color-square > .svg-root):
(.color-square > .svg-root > .srgb-edge):
(.color-square > .srgb-label):
(.color-square > .srgb-label:hover):
(.color-square > .srgb-label:hover + .svg-root > .srgb-edge):
(@media (-webkit-device-pixel-ratio: 1)):
(.color-square > .srgb-edge):
* UserInterface/Views/ColorSquare.js:
(WI.ColorSquare.prototype.set tintedColor):
(WI.ColorSquare.prototype._drawSRGBOutline):
(WI.ColorSquare):

* UserInterface/Views/InlineSwatch.js:
(WI.InlineSwatch):
(WI.InlineSwatch.prototype._updateSwatch):
(WI.InlineSwatch.prototype._allowShiftClickColor): Added.
(WI.InlineSwatch.prototype._handleContextMenuEvent):

LayoutTests:

* inspector/model/color-expected.txt:
* inspector/model/color.html:

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

2 months agoCrash when animating an enum attribute for multiple instances of an SVG element
commit-queue@webkit.org [Tue, 3 Dec 2019 00:38:16 +0000 (00:38 +0000)]
Crash when animating an enum attribute for multiple instances of an SVG element
https://bugs.webkit.org/show_bug.cgi?id=204766

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-12-02
Reviewed by Simon Fraser.

Source/WebCore:

Test: svg/animations/animated-enum-lengthAdjust-instances.svg

All instances of SVG animated properties have to share a single animVal
such that once its value is progressed, all the instances will see the
change. This was not happening for SVGAnimatedDecoratedProperty. To do
that we need to:

-- Make SVGDecoratedProperty be RefCounted.
-- Change the type of SVGAnimatedDecoratedProperty::m_baseVal to
   Ref<SVGDecoratedProperty<DecorationType>>.
-- Change the type of SVGAnimatedDecoratedProperty::m_animVal to
   RefPtr<SVGDecoratedProperty<DecorationType>>. The master property
   creates it and all the instances hold references to the same pointer.
-- Override the virtual methods instanceStartAnimation() and
   instanceStopAnimation() of SVGAnimatedDecoratedProperty.

* svg/properties/SVGAnimatedDecoratedProperty.h:
(WebCore::SVGAnimatedDecoratedProperty::create):
(WebCore::SVGAnimatedDecoratedProperty::SVGAnimatedDecoratedProperty):
(WebCore::SVGAnimatedDecoratedProperty::animVal const):
(WebCore::SVGAnimatedDecoratedProperty::currentValue const):
* svg/properties/SVGDecoratedEnumeration.h:
(WebCore::SVGDecoratedEnumeration::create):
* svg/properties/SVGDecoratedProperty.h:

LayoutTests:

* svg/animations/animated-enum-lengthAdjust-instances-expected.txt: Added.
* svg/animations/animated-enum-lengthAdjust-instances.svg: Added.

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

2 months agoFix the macCatalyst build.
timothy_horton@apple.com [Tue, 3 Dec 2019 00:33:07 +0000 (00:33 +0000)]
Fix the macCatalyst build.

* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayer::drawLayerContents):

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

2 months agoOnly check each use...FuzzerAgent() option in VM constructor if any of the options...
mark.lam@apple.com [Tue, 3 Dec 2019 00:20:49 +0000 (00:20 +0000)]
Only check each use...FuzzerAgent() option in VM constructor if any of the options are enabled.
https://bugs.webkit.org/show_bug.cgi?id=204763

Reviewed by Keith Miller.

We know that we'll never use fuzzer agents in deployment.  Hence, we shouldn't
spend time checking for them in the normal use case.  This probably doesn't matter
much for Web processes, but for clients of JSC that repeatedly spawn and kill VMs,
it might matter more.  We might want to eventually widen this idiom to include
other debugging / development options, but for now, I'm only covering the fuzzer
agent options.

* runtime/Options.cpp:
(JSC::computeIfUsingFuzzerAgent):
(JSC::Options::initialize):
* runtime/Options.h:
(JSC::Options::isUsingFuzzerAgent):
* runtime/OptionsList.h:
(JSC::OptionRange::operator bool const):
* runtime/VM.cpp:
(JSC::VM::VM):

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

2 months agoRevert - [EWS] Do not retry layout-tests build if the flaky test failures are also...
aakash_jain@apple.com [Mon, 2 Dec 2019 23:21:46 +0000 (23:21 +0000)]
Revert - [EWS] Do not retry layout-tests build if the flaky test failures are also present in clean tree run
https://bugs.webkit.org/show_bug.cgi?id=204704

Reverting this, a more generic fix for handling flakiness would be made in Bug 204769.

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

2 months ago[LFC] Fix ASSERT while running fast/block/block-parent-with-zero-width-child.html
zalan@apple.com [Mon, 2 Dec 2019 23:03:15 +0000 (23:03 +0000)]
[LFC] Fix ASSERT while running fast/block/block-parent-with-zero-width-child.html
https://bugs.webkit.org/show_bug.cgi?id=204768

Reviewed by Antti Koivisto.

1. FormattingState::displayInlineContent() returns nullptr in case of empty inline content.
2. Typo in InlineItemRun::moveHorizontally

* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const):
* layout/inlineformatting/InlineLineBuilder.h:
(WebCore::Layout::LineBuilder::InlineItemRun::moveHorizontally):

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

2 months agoUnreviewed WinCairo build fix following r252989.
ross.kirsling@sony.com [Mon, 2 Dec 2019 23:02:06 +0000 (23:02 +0000)]
Unreviewed WinCairo build fix following r252989.

* include/CMakeLists.txt:

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

2 months ago[iOS] Create sandbox extension for "com.apple.tccd"
pvollan@apple.com [Mon, 2 Dec 2019 23:00:24 +0000 (23:00 +0000)]
[iOS] Create sandbox extension for "com.apple.tccd"
https://bugs.webkit.org/show_bug.cgi?id=204367
<rdar://problem/57330176>

Reviewed by Eric Carlson.

When camera or microphone access has been granted by the user, have the UI process create a sandbox extension
for "com.apple.tccd", and send it to the WebContent process. Also make sure the extension is created only once
for each WebContent process. Add telemetry to the tccd rule in the sandbox.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::userMediaAccessWasGranted):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

2 months ago[JSC] Remove BytecodeCacheVersion.h
tzagallo@apple.com [Mon, 2 Dec 2019 22:45:25 +0000 (22:45 +0000)]
[JSC] Remove BytecodeCacheVersion.h
https://bugs.webkit.org/show_bug.cgi?id=204760

Reviewed by Mark Lam.

Having that as a phony make target causes a lot of unnecessary rebuilds. That was a workaround
the fact that we only need a new cache version when we rebuild CachedTypes.cpp, but there was
no straightforward way to get the current timestamp as an integer at that point. Instead, we now
just use a constexpr function that hashes __TIMESTAMP__.

* CMakeLists.txt:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* runtime/CachedTypes.cpp:
(JSC::jscBytecodeCacheVersion):
(JSC::GenericCacheEntry::isUpToDate const):

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

2 months agoAdd helper methods for description and equality to text manipulation SPI
commit-queue@webkit.org [Mon, 2 Dec 2019 22:30:59 +0000 (22:30 +0000)]
Add helper methods for description and equality to text manipulation SPI
https://bugs.webkit.org/show_bug.cgi?id=204758
<rdar://problem/57438200>

Patch by Louie Livon-Bemel <llivonbemel@apple.com> on 2019-12-02
Reviewed by Wenson Hsieh.

Source/WebKit:

I originally added some category methods to _WKTextManipulationItem and _WKTextManipulationToken within Safari
to make working with these classes easier. However it makes more sense to just move these methods into
the main class. One method is for checking if two instances are equal (including identifiers) and optionally
checking if the content itself is equal. The other methods are for debug descriptions for lldb, and a
method to get a description that preserves privacy; when logging the instance, the content of the webpage
should be redacted.

Tests: Tests are added as API tests.

* UIProcess/API/Cocoa/_WKTextManipulationItem.h:
    - Assume everything is non-null unless otherwise specified.
    - Allow the identifier to be nil, but not the array of tokens.
    - Add a method to check the equality to another item, optionally including a check for the content of each
      token being equal.
    - Add a -debugDescription method that includes the content of tokens for use in lldb. This NSObject
      declaration is marked optional, so redeclare it here.
    - No need to add a -description declaration since it exists on NSObject already.
* UIProcess/API/Cocoa/_WKTextManipulationItem.mm:
(-[_WKTextManipulationItem isEqual:]):
    The standard NSObject equality check should call our method with equal content.
(-[_WKTextManipulationItem isEqualToTextManipulationItem:includingContentEquality:]):
    - If the other item is nil, the identifiers aren't equal or the number of tokens are mismatched, these
      items aren't equal.
    - Just to be safe, only iterate the smaller of the token arrays so we don't crash.
    - Check if each token is equal, passing along the `includingContentEquality` parameter.
(-[_WKTextManipulationItem description]):
    The general description should not include the webpage content.
(-[_WKTextManipulationItem debugDescription]):
    Include the webpage content, since this is for lldb.
(-[_WKTextManipulationItem _descriptionPreservingPrivacy:]):
    Include the standard description format, and each token on its own line. If we're including the content
    then use `token.debugDescription`.
* UIProcess/API/Cocoa/_WKTextManipulationToken.h:
    - Also assume everything is non-null.
    - Identifier and Content can be nil.
    - Declare a -debugDescription method.
    - Declare a method to check equality, with or without the content.
* UIProcess/API/Cocoa/_WKTextManipulationToken.mm:
(isEqualOrBothNil):
    Helper that checks equality but considers two nil values to be equal as well.
(-[_WKTextManipulationToken isEqual:]):
    The standard NSObject equality check should call our method with equal content.
(-[_WKTextManipulationToken isEqualToTextManipulationToken:includingContentEquality:]):
    Check that the exclusions are equal, the identifiers are equal (considering two nils to be equal), and the
    content if necessary.
(-[_WKTextManipulationToken description]):
(-[_WKTextManipulationToken debugDescription]):
(-[_WKTextManipulationToken _descriptionPreservingPrivacy:]):
    If we're preserving privacy, log the content length rather than the content string itself.

Tools:

Add tests for the new methods. Most are equality tests for various situations, and are moved over from the
Safari unit tests I had for the category methods that had the same purpose.

* TestWebKitAPI/Tests/WebKitCocoa/TextManipulation.mm:
(TestWebKitAPI::TEST):
    - Add test to make sure the content isn't included in the regular -description, but the identifier is. And
      That -debugDescription does include the contents.
    - Add many tests equality for various situations, testing both with and without content equality.
(TestWebKitAPI::createTextManipulationToken):
    Add a helper for creating a token in one line.

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

2 months agomozilla-tests.yaml/js1_5/Array/regress-101964.js is frequently failing on JSC EWS...
mark.lam@apple.com [Mon, 2 Dec 2019 22:16:42 +0000 (22:16 +0000)]
mozilla-tests.yaml/js1_5/Array/regress-101964.js is frequently failing on JSC EWS bots.
https://bugs.webkit.org/show_bug.cgi?id=200789
<rdar://problem/54361916>

Reviewed by Keith Miller.

JSTests:

The prevailing theory is that this test is being pre-empted and not getting the
CPU time it needs to complete.  As a result, the wall clock time period for
running the test exceeds the expected time.  This patch tests this theory by
changing the time measurement to use CPU time instead.

* mozilla/js1_5/Array/regress-101964.js:

Source/JavaScriptCore:

* tools/JSDollarVM.cpp:
(JSC::functionCurrentCPUTime):
(JSC::JSDollarVM::finishCreation):

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

2 months ago[JSC] Put JSGenerator, JSAsyncGenerator, and JSPromise in IsoSubspace
ysuzuki@apple.com [Mon, 2 Dec 2019 21:51:44 +0000 (21:51 +0000)]
[JSC] Put JSGenerator, JSAsyncGenerator, and JSPromise in IsoSubspace
https://bugs.webkit.org/show_bug.cgi?id=204764

Reviewed by Mark Lam.

Put more things in IsoSubspace. They are defined by using JSInternalObjectImpl mechanism.

    - JSGenerator
    - JSAsyncGenerator
    - JSPromise

* runtime/JSAsyncGenerator.h:
* runtime/JSGenerator.h:
* runtime/JSPromise.h:
(JSC::JSPromise::subspaceFor):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

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

2 months agoDocument::setWindowAttributeEventListener should check `m_domWindow::frame()`
ysuzuki@apple.com [Mon, 2 Dec 2019 20:32:54 +0000 (20:32 +0000)]
Document::setWindowAttributeEventListener should check `m_domWindow::frame()`
https://bugs.webkit.org/show_bug.cgi?id=204759
<rdar://problem/50098787>

Reviewed by Mark Lam.

JSLazyEventListener::create assumes that `m_domWindow::frame()` exists.
But this check was removed at r196888 accidentally.
This patch adds this check back to fix the crash.

* dom/Document.cpp:
(WebCore::Document::setWindowAttributeEventListener):

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

2 months ago[iOS] Introduce a gesture recognizer that can be used to defer recognition of other...
wenson_hsieh@apple.com [Mon, 2 Dec 2019 20:21:13 +0000 (20:21 +0000)]
[iOS] Introduce a gesture recognizer that can be used to defer recognition of other gestures
https://bugs.webkit.org/show_bug.cgi?id=204748
<rdar://problem/38670692>

Reviewed by Tim Horton.

Introduces WKDeferringGestureRecognizer, which is similar to UIKit's _UIRelationshipGestureRecognizer. In a
future patch, this will be added to WKContentView to prevent platform gestures (pinching, panning, single/double
taps, etc.) from recognizing when dispatching a preventable touch event to the page.

Additionally renames a member variable on WKContentView, in preparation for making touch gesture recognition
asynchronous. No new tests, since there is no change in behavior yet.

* SourcesCocoa.txt:

Add the new file.

* UIProcess/ios/WKContentViewInteraction.h:

Add a couple of (currently unused) deferring gesture recognizers. These will be added to WKContentView in a
future patch. There are two deferring gestures here (one for "immediately resettable" gestures and another for
gestures for which the reset is "deferred" -- i.e., multi-tap gestures); this prevents a single deferring
gesture from connecting the entire gesture subgraph under WKWebView through failure dependencies. This would
result in various usability issues, such as being unable to perform a pan gesture to scroll WKScrollView if a
tap was recognized within the last 300 ms, since all gestures would need to wait until every double and triple-
tap gesture under WKWebView has failed.

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

Rename _canSendTouchEventsAsynchronously to _touchEventsCanPreventNativeGestures in preparation for adding a
codepath for fully asynchronous touch event dispatch; we also flip the conditional in any places where
_canSendTouchEventsAsynchronously was previously set or read.

(-[WKContentView _webTouchEvent:preventsNativeGestures:]):
(-[WKContentView scrollViewWillStartPanOrPinchGesture]):
(-[WKContentView gestureRecognizer:shouldIgnoreWebTouchWithEvent:]):
(-[WKContentView gestureRecognizer:isInterruptingMomentumScrollingWithEvent:]):
(-[WKContentView deferringGestureRecognizer:shouldDeferGesturesWithEvent:]):
(-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]):

Implement WKDeferringGestureRecognizerDelegate.

(-[WKContentView shouldIgnoreWebTouch]): Deleted.

Drive-by fix: remove this unnecessary method implementation, and the related FIXME.

* UIProcess/ios/WKDeferringGestureRecognizer.h: Added.
* UIProcess/ios/WKDeferringGestureRecognizer.mm: Added.
(-[WKDeferringGestureRecognizer initWithDeferringGestureDelegate:]):
(-[WKDeferringGestureRecognizer deferringGestureDelegate]):
(-[WKDeferringGestureRecognizer touchesBegan:withEvent:]):

Unless the touch is interrupts momentum scrolling, WKDeferringGestureRecognizer should transition to Possible
state when starting a touch. Later, -setDefaultPrevented: is invoked, which will either transition the deferring
gesture recognizer to Failed state (thereby allowing native gestures to begin), or Ended state (preventing other
native gestures).

(-[WKDeferringGestureRecognizer touchesCancelled:withEvent:]):
(-[WKDeferringGestureRecognizer setDefaultPrevented:]):
(-[WKDeferringGestureRecognizer canBePreventedByGestureRecognizer:]):

Return NO here to prevent certain platform gestures (e.g. scroll view panning) from causing the deferring
gesture to Failed state, when these gestures attempt to transition from Possible to Began state.

(-[WKDeferringGestureRecognizer shouldDeferGestureRecognizer:]):
* WebKit.xcodeproj/project.pbxproj:

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

2 months ago[LFC][IFC] Adjust trailing runs horizontally while trimming content
zalan@apple.com [Mon, 2 Dec 2019 20:16:07 +0000 (20:16 +0000)]
[LFC][IFC] Adjust trailing runs horizontally while trimming content
https://bugs.webkit.org/show_bug.cgi?id=204749
<rdar://problem/57559163>

Reviewed by Antti Koivisto.

When trailing content is getting trimmed, we also need to adjust subsequent trailing runs e.g. <span>   </span> <- the [container end]'s run should be adjusted.

* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::removeTrailingTrimmableContent):
(WebCore::Layout::LineBuilder::appendTextContent): there's nothing to trim when the spacing is zero or negative.
* layout/inlineformatting/InlineLineBuilder.h:
(WebCore::Layout::LineBuilder::InlineItemRun::moveHorizontally):

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

2 months ago[LFC][IFC] LineBuilder::InlineItemRun objects don't have vertical geometry
zalan@apple.com [Mon, 2 Dec 2019 20:10:14 +0000 (20:10 +0000)]
[LFC][IFC] LineBuilder::InlineItemRun objects don't have vertical geometry
https://bugs.webkit.org/show_bug.cgi?id=204752
<rdar://problem/57560643>

Reviewed by Antti Koivisto.

Height and vertical position are computed when the InlineItemRun objects are merged and transformed into LineBuilder::Run objects.

* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::ContinousContent::append):
(WebCore::Layout::LineBuilder::ContinousContent::close):
(WebCore::Layout::LineBuilder::Run::Run):
(WebCore::Layout::LineBuilder::appendNonBreakableSpace):
(WebCore::Layout::LineBuilder::appendInlineContainerStart):
(WebCore::Layout::LineBuilder::appendInlineContainerEnd):
(WebCore::Layout::LineBuilder::appendTextContent):
(WebCore::Layout::LineBuilder::appendNonReplacedInlineBox):
(WebCore::Layout::LineBuilder::appendLineBreak):
(WebCore::Layout::LineBuilder::isVisuallyNonEmpty const):
(WebCore::Layout::LineBuilder::InlineItemRun::InlineItemRun):
(WebCore::Layout::LineBuilder::InlineItemRun::setCollapsesToZeroAdvanceWidth):
(WebCore::Layout::LineBuilder::InlineItemRun::removeTrailingLetterSpacing):
* layout/inlineformatting/InlineLineBuilder.h:
(WebCore::Layout::LineBuilder::InlineItemRun::logicalLeft const):
(WebCore::Layout::LineBuilder::InlineItemRun::logicalWidth const):
(WebCore::Layout::LineBuilder::InlineItemRun::logicalRect const): Deleted.

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

2 months agoRemove the confusing Value struct used for calc results
simon.fraser@apple.com [Mon, 2 Dec 2019 20:03:10 +0000 (20:03 +0000)]
Remove the confusing Value struct used for calc results
https://bugs.webkit.org/show_bug.cgi?id=204751

Reviewed by Tim Horton.

Replace the Value* argument with a RefPtr<CSSCalcExpressionNode>&. Value just made things more
confusing.

* css/CSSCalculationValue.cpp:
(WebCore::CSSCalcExpressionNodeParser::parseCalc):
(WebCore::CSSCalcExpressionNodeParser::parseValue):
(WebCore::CSSCalcExpressionNodeParser::parseValueTerm):
(WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression):
(WebCore::CSSCalcExpressionNodeParser::parseAdditiveValueExpression):
(WebCore::CSSCalcExpressionNodeParser::parseMinMaxExpression):
(WebCore::CSSCalcExpressionNodeParser::parseValueExpression):

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

2 months ago[LFC][IFC] TrimmableContent only needs to keep track of the first trimmable run index
zalan@apple.com [Mon, 2 Dec 2019 19:52:10 +0000 (19:52 +0000)]
[LFC][IFC] TrimmableContent only needs to keep track of the first trimmable run index
https://bugs.webkit.org/show_bug.cgi?id=204747
<rdar://problem/57557732>

Reviewed by Antti Koivisto.

Every run after the first trimmable run should either also be trimmable (more whitespace) or skippable (</span>).

* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::removeTrailingTrimmableContent):
(WebCore::Layout::LineBuilder::TrimmableContent::append):
* layout/inlineformatting/InlineLineBuilder.h:
(WebCore::Layout::LineBuilder::TrimmableContent::firstRunIndex):
(WebCore::Layout::LineBuilder::TrimmableContent::isEmpty const):
(WebCore::Layout::LineBuilder::TrimmableContent::clear):
(WebCore::Layout::LineBuilder::TrimmableContent::runIndexes): Deleted.

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

2 months agoWeb Inspector: Console: the saved result value is still shown after page reload
drousso@apple.com [Mon, 2 Dec 2019 19:22:21 +0000 (19:22 +0000)]
Web Inspector: Console: the saved result value is still shown after page reload
https://bugs.webkit.org/show_bug.cgi?id=204532

Reviewed by Brian Burg.

Add additional plumbing to remove any `.console-saved-variable` elements whenever a new
session is created, as well as reset the base of the property path to `this`.

* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype._sessionStarted):
(WI.LogContentView.prototype._logCleared):

* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype.clearSavedVariableState): Added.
(WI.ConsoleMessageView.prototype.removeEventListeners): Deleted.

* UserInterface/Views/ObjectTreeView.js:
(WI.ObjectTreeView.prototype.resetPropertyPath): Added.

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

2 months agoIncorrect association of the URL object with the value port
commit-queue@webkit.org [Mon, 2 Dec 2019 18:56:49 +0000 (18:56 +0000)]
Incorrect association of the URL object with the value port
https://bugs.webkit.org/show_bug.cgi?id=204414

Patch by Alex Christensen <achristensen@webkit.org> on 2019-12-02
Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

* web-platform-tests/url/url-setters-expected.txt:

Source/WebCore:

Setting a port should clear the port if it's not a numerical value.
We now match the behavior of Chrome, Firefox, and the URL specification.
Covered by a newly passing WPT!

* html/URLUtils.h:
(WebCore::URLUtils<T>::setPort):

LayoutTests:

* fast/dom/DOMURL/set-href-attribute-port-expected.txt:
* fast/dom/DOMURL/set-href-attribute-port.html:
* fast/dom/HTMLAnchorElement/set-href-attribute-port-expected.txt:
* fast/dom/HTMLAnchorElement/set-href-attribute-port.html:

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

2 months agoClean up ANGLE header post-process script
dino@apple.com [Mon, 2 Dec 2019 18:37:25 +0000 (18:37 +0000)]
Clean up ANGLE header post-process script
https://bugs.webkit.org/show_bug.cgi?id=204711

Reviewed by Tim Horton.

Since `sed` on macOS requires the in-place argument to have a zero-length string
to avoid making backups, this script was attempting to pass ''. However, this was
being evaluated, creating a bunch of files with \'\' suffixes. Fix this by using
an array when expanding the arguments.

Also fix a typo where the character "3" was being printed.

Lastly, only print out the basename of the header file being converted.

* adjust-angle-include-paths.sh:

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

2 months agoBuild ANGLE as a dynamic library
dino@apple.com [Mon, 2 Dec 2019 18:36:07 +0000 (18:36 +0000)]
Build ANGLE as a dynamic library
https://bugs.webkit.org/show_bug.cgi?id=204708
rdar://57349384

Reviewed by Tim Horton.

Source/ThirdParty/ANGLE:

Modify ANGLE to build as a dynamic library. My (not thorough) testing suggests
this will reduce the in-flight binary size on Apple's build systems by at least
a factor of 10 (it was over 1G). Building release for x86_64-only:
    - Previously: libANGLE.a -- 306 MB
    - Now: libANGLE.dylib -- 6.7 MB

In order to do this, some symbols needed to be exported from the
"sh" namespace (which are used in ANGLEWebKitBridge, but not when
ANGLE's rendering backend is active).

While here, I turned on some more build options, like ARC.

* ANGLE.xcodeproj/project.pbxproj: Link with IOKit and IOSurface frameworks, and
product a dylib product.
* Configurations/ANGLE.xcconfig: Update the configuration for a dynamic library.
* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/Version.xcconfig: Added.
* Configurations/WebKitTargetConditionals.xcconfig: Added.

* include/GLSLANG/ShaderLang.h: Add ANGLE_EXPORT to some functions to make
sure they will be visible in the exported library.
* include/GLSLANG/ShaderVars.h:
* src/libANGLE/renderer/gl/cgl/DisplayCGL.mm: Change reinterpret_cast to a normal
C cast so it can be annotated with __bridge.
(rx::DisplayCGL::isValidNativeWindow const):
* src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm: Ditto.
(rx::WindowSurfaceCGL::WindowSurfaceCGL):
(rx::WindowSurfaceCGL::~WindowSurfaceCGL):
* src/libANGLE/renderer/gl/eagl/DisplayEAGL.mm: Ditto.
* src/libANGLE/renderer/gl/eagl/WindowSurfaceEAGL.mm: Ditto.

Source/WebCore:

Weak link against libANGLE.dylib rather than strong link to libANGLE.a.

* Configurations/WebCore.xcconfig:
* Configurations/WebCoreTestSupport.xcconfig:
* platform/graphics/ANGLEWebKitBridge.cpp: Early returns if the library was not loaded.
(WebCore::ANGLEWebKitBridge::ANGLEWebKitBridge):
(WebCore::ANGLEWebKitBridge::cleanupCompilers):
(WebCore::ANGLEWebKitBridge::compileShaderSource):
(WebCore::ANGLEWebKitBridge::angleAvailable): Static method to detect
if the library was loaded.
* platform/graphics/ANGLEWebKitBridge.h:
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm: Early return if ANGLE was not
loaded.
(WebCore::GraphicsContext3D::GraphicsContext3D):

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

2 months agoREGRESSION (r195080): prepare-ChangeLog does not emit function list for file paths...
dbates@webkit.org [Mon, 2 Dec 2019 18:32:49 +0000 (18:32 +0000)]
REGRESSION (r195080): prepare-ChangeLog does not emit function list for file paths that contain a space
https://bugs.webkit.org/show_bug.cgi?id=204236

Reviewed by Brian Burg.

Revert the filename escape logic added in <http://trac.webkit.org/changeset/195080> as it broke
function list generation in file paths that contain space characters. Function list generation
broke because the escaping was performed after line range dictionaries were built up keyed off
the unescaped file path. Subsequent code would try to query these dictionaries to build up the
changed function list using the escaped file path and never a match. The escaping logic was not
necessary to fix the originally reported bug. All that was needed was to use the three-argument
open() call that took a mode. So, remove the escape logic.

* Scripts/prepare-ChangeLog:
(actuallyGenerateFunctionLists):

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

2 months agoUpdate expectations for two tests after https://trac.webkit.org/changeset/252363...
tsavell@apple.com [Mon, 2 Dec 2019 18:26:49 +0000 (18:26 +0000)]
Update expectations for two tests after https://trac.webkit.org/changeset/252363/webkit
https://bugs.webkit.org/show_bug.cgi?id=204756
https://bugs.webkit.org/show_bug.cgi?id=204757

Unreviewed test gardening.

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

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

2 months agoUpdate ANGLE
achristensen@apple.com [Mon, 2 Dec 2019 18:25:21 +0000 (18:25 +0000)]
Update ANGLE
https://bugs.webkit.org/show_bug.cgi?id=204595

Patch by James Darpinian <jdarpinian@chromium.org> on 2019-12-02
Reviewed by Alex Christensen.

* ANGLE.plist: Updated commit hash.
* ANGLE.xcodeproj/project.pbxproj: Changes mirroring gn changes upstream.
* Compiler.cmake: Changes mirroring gn changes upstream.
* GLESv2.cmake: Changes mirroring gn changes upstream.
* CMakeLists.txt: Changes mirroring gn changes upstream.

* Many other files added/removed/changed from upstream.

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

2 months ago[AppleWin] WebKitQuartzCoreAdditions.dll isn't compiled since r248444
Hironori.Fujii@sony.com [Mon, 2 Dec 2019 17:42:40 +0000 (17:42 +0000)]
[AppleWin] WebKitQuartzCoreAdditions.dll isn't compiled since r248444
https://bugs.webkit.org/show_bug.cgi?id=204695

Reviewed by Alex Christensen.

* CMakeLists.txt: Replaced APPLE with USE_CA in the condition of
building WebKitQuartzCoreAdditions.

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

2 months agoSimplify RealtimeOutgoingAudioSource and RealtimeOutgoingVideooSource observeSource...
youenn@apple.com [Mon, 2 Dec 2019 17:26:29 +0000 (17:26 +0000)]
Simplify RealtimeOutgoingAudioSource and RealtimeOutgoingVideooSource observeSource/unobserveSource pattern
https://bugs.webkit.org/show_bug.cgi?id=204570

Reviewed by Eric Carlson.

Previously, the outgoing source was observing/unobserving its track if sinks were added/removed.
We made LibWebRTCRTCRtpSenderBackend stopping the observing in its destructor.
This makes things complex and we are not always unobserving fast enough for all outgoing sources.

To make it simpler, the outgoing source is no longer handling the observing/unobserving of its track.
Instead, its LibWebRTCRtpSenderBackend is handling it directly.
Observing starts when LibWebRTCRtpSenderBackend gets the track and unobserving happens either on LibWebRTCRtpSenderBackend destruction
or when the LibWebRTCRtpSenderBackend is no longer interested in the track.
This is slight less optimal as we might observe the track even if the source has no sink but this should not happen often in practice.

Removed some unneeded methods.

Covered by existing tests no longer failing a debug ASSERTION.

* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
(WebCore::LibWebRTCRtpSenderBackend::LibWebRTCRtpSenderBackend):
(WebCore::LibWebRTCRtpSenderBackend::~LibWebRTCRtpSenderBackend):
(WebCore::LibWebRTCRtpSenderBackend::startSource):
(WebCore::LibWebRTCRtpSenderBackend::stopSource):
(WebCore::LibWebRTCRtpSenderBackend::replaceTrack):
(WebCore::LibWebRTCRtpSenderBackend::audioSource):
(WebCore::LibWebRTCRtpSenderBackend::videoSource):
(WebCore::LibWebRTCRtpSenderBackend::hasSource const):
(WebCore::LibWebRTCRtpSenderBackend::setSource):
(WebCore::LibWebRTCRtpSenderBackend::takeSource):
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
* platform/mediastream/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::~RealtimeOutgoingAudioSource):
(WebCore::RealtimeOutgoingAudioSource::observeSource):
(WebCore::RealtimeOutgoingAudioSource::setSource):
(WebCore::RealtimeOutgoingAudioSource::AddSink):
(WebCore::RealtimeOutgoingAudioSource::RemoveSink):
* platform/mediastream/RealtimeOutgoingAudioSource.h:
(WebCore::RealtimeOutgoingAudioSource::start):
* platform/mediastream/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::~RealtimeOutgoingVideoSource):
(WebCore::RealtimeOutgoingVideoSource::observeSource):
(WebCore::RealtimeOutgoingVideoSource::setSource):
(WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink):
(WebCore::RealtimeOutgoingVideoSource::RemoveSink):
* platform/mediastream/RealtimeOutgoingVideoSource.h:
(WebCore::RealtimeOutgoingVideoSource::start):
* platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
(WebCore::RealtimeOutgoingAudioSourceCocoa::~RealtimeOutgoingAudioSourceCocoa): Deleted.

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

2 months agoSWServer::scriptFetchFinished does not need a Connection as parameter
youenn@apple.com [Mon, 2 Dec 2019 17:25:26 +0000 (17:25 +0000)]
SWServer::scriptFetchFinished does not need a Connection as parameter
https://bugs.webkit.org/show_bug.cgi?id=204641

Reviewed by Chris Dumez.

No change of behavior, removing an unused parameter.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::Connection::finishFetchingScriptInServer):
(WebCore::SWServer::startScriptFetch):
(WebCore::SWServer::didResolveRegistrationPromise):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):
* workers/service/server/SWServerJobQueue.h:

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

2 months agoService Worker should correctly set its document first party for cookies URL
youenn@apple.com [Mon, 2 Dec 2019 17:10:36 +0000 (17:10 +0000)]
Service Worker should correctly set its document first party for cookies URL
https://bugs.webkit.org/show_bug.cgi?id=204742

Reviewed by Chris Dumez.

Source/WebCore:

Test: http/wpt/service-workers/third-party-cookie.html

* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::createPageForServiceWorker):
Set document first party cookie for URL to the top origin.

LayoutTests:

* http/wpt/service-workers/resources/set-cookie.py: Added.
* http/wpt/service-workers/resources/third-party-cookie-iframe.html: Added.
* http/wpt/service-workers/resources/third-party-worker.js:
* http/wpt/service-workers/third-party-cookie-expected.txt: Added.
* http/wpt/service-workers/third-party-cookie.html: Added.

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

2 months agoResponsivenessTimer mistakenly restarts immediately
yoshiaki.jitsukawa@sony.com [Mon, 2 Dec 2019 16:54:27 +0000 (16:54 +0000)]
ResponsivenessTimer mistakenly restarts immediately
https://bugs.webkit.org/show_bug.cgi?id=204659

Reviewed by Chris Dumez.

* UIProcess/ResponsivenessTimer.cpp:
(WebKit::ResponsivenessTimer::timerFired):
Give startOneShot() a positive number timeout.

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

2 months agoDon't do range checking for calc() at parse time
simon.fraser@apple.com [Mon, 2 Dec 2019 16:32:12 +0000 (16:32 +0000)]
Don't do range checking for calc() at parse time
https://bugs.webkit.org/show_bug.cgi?id=204737

Reviewed by Antti Koivisto.
LayoutTests/imported/w3c:

* web-platform-tests/css/css-text-decor/parsing/text-shadow-computed-expected.txt:
* web-platform-tests/css/css-values/calc-numbers-expected.txt:
* web-platform-tests/css/css-values/getComputedStyle-border-radius-001-expected.txt:
* web-platform-tests/css/css-values/getComputedStyle-border-radius-003-expected.txt:
* web-platform-tests/css/css-values/minmax-number-serialize-expected.txt:

Source/WebCore:

As specified in https://drafts.csswg.org/css-values-4/#calc-range, we should not do range checking for calc
at parse time; the specified value can be a calc which results in a negative values; values are clamped
at used value time (i.e. when building RenderStyle).

So CSSCalculationValue doesn't need to have isInt(), isPositive(), isNegative(), and CSSCalcExpressionNode
doesn't have to keep track of whether its value is an integer.

Also do some cleanup of CSSPrimitiveValue, using categories to answer more isFoo type questions, and adding
isZero(), isPositive() and isNegative() that return Optional<bool> for cases where parse-time range checking
occurs.

Tested by existing tests.

* css/CSSCalculationValue.cpp:
(WebCore::CSSCalcOperationNode::createSimplified):
(WebCore::CSSCalcExpressionNodeParser::parseValue):
(WebCore::createBlendHalf):
(WebCore::createCSS):
(WebCore::CSSCalcValue::isCalcFunction):
(WebCore::isIntegerResult): Deleted.
* css/CSSCalculationValue.h:
(WebCore::CSSCalcExpressionNode::equals const):
(WebCore::CSSCalcExpressionNode::category const):
(WebCore::CSSCalcExpressionNode::CSSCalcExpressionNode):
(WebCore::CSSCalcExpressionNode::isInteger const): Deleted.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::zoomAdjustedPixelValueForLength):
(WebCore::percentageOrZoomAdjustedValue):
(WebCore::autoOrZoomAdjustedValue):
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor): I missed the Q unit here when I added it.
(WebCore::CSSPrimitiveValue::isZero const):
(WebCore::CSSPrimitiveValue::isPositive const):
(WebCore::CSSPrimitiveValue::isNegative const):
(WebCore::CSSPrimitiveValue::canonicalUnitTypeForCategory): Deleted.
* css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::isAngle const): Deleted.
* css/CSSUnits.cpp:
(WebCore::unitCategory):
(WebCore::canonicalUnitTypeForCategory):
(WebCore::canonicalUnitType):
* css/CSSUnits.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeColumnWidth):
(WebCore::consumePerspective):
(WebCore::consumeWebkitAspectRatio):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::CalcParser::CalcParser):
(WebCore::CSSPropertyParserHelpers::CalcParser::consumeInteger):
(WebCore::CSSPropertyParserHelpers::consumeNumber):
(WebCore::CSSPropertyParserHelpers::consumeSingleShadow): This parsing is a little tricky. The blur radius value is optional,
but we need to distinguish between failing to parse it, and its value being negative, so an explicit check for calc is the easiest way
to handlel that.
(WebCore::CSSPropertyParserHelpers::CalcParser::consumePositiveIntegerRaw): Deleted. It was unused.
(WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw): Deleted.
* css/parser/CSSPropertyParserHelpers.h:

LayoutTests:

Update tests that assumed calc range-checked at parse time.

* fast/css/column-width-calculated-value-expected.txt:
* fast/css/column-width-calculated-value.html:
* fast/css/flex-shrink-calculated-value-expected.txt:
* fast/css/flex-shrink-calculated-value.html:
* fast/css/negative-calc-values-expected.txt:
* fast/css/negative-calc-values.html:
* fast/css/text-shadow-calc-value-expected.txt:
* fast/css/text-shadow-calc-value.html:
* fast/shapes/parsing/parsing-shape-image-threshold-expected.txt:
* fast/shapes/parsing/parsing-shape-image-threshold.html:

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

2 months ago[GTK] Fix some warnings
commit-queue@webkit.org [Mon, 2 Dec 2019 15:36:08 +0000 (15:36 +0000)]
[GTK] Fix some warnings
https://bugs.webkit.org/show_bug.cgi?id=204739

Patch by Rob Buis <rbuis@igalia.com> on 2019-12-02
Reviewed by Frédéric Wang.

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::connectionToServerLost):
* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::alignContentVertically):

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

2 months agoRemove MediaStreamTrack event queue
youenn@apple.com [Mon, 2 Dec 2019 13:20:51 +0000 (13:20 +0000)]
Remove MediaStreamTrack event queue
https://bugs.webkit.org/show_bug.cgi?id=204603

Reviewed by Eric Carlson.

Small refactoring to remove the track event queue and use ActiveDOMObject::queueTaskToDispatchEvent instead.
Updated some #include as some include fixes were needed.
No change of behavior.

* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::trackMutedChanged):
* Modules/mediastream/MediaStreamTrack.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/mediastream/MediaStreamPrivate.h:

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

2 months ago[GTK][PSON] Crash in NetworkProcessProxy::openNetworkProcessConnection
carlosgc@webkit.org [Mon, 2 Dec 2019 09:40:33 +0000 (09:40 +0000)]
[GTK][PSON] Crash in NetworkProcessProxy::openNetworkProcessConnection
https://bugs.webkit.org/show_bug.cgi?id=204703

Reviewed by Michael Catanzaro.

Stop sending a message to all web process to prefetch DNS for a hostname. All web processes then send a messaage
to their network process to prefetch the DNS. Instead, send a message directly to the network process.

* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/API/glib/WebKitWebContext.cpp:
(webkit_web_context_prefetch_dns):
* WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp:

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

2 months ago[LFC][Render tree] Support LFC in LineLayoutTraversal
antti@apple.com [Mon, 2 Dec 2019 09:28:57 +0000 (09:28 +0000)]
[LFC][Render tree] Support LFC in LineLayoutTraversal
https://bugs.webkit.org/show_bug.cgi?id=204727

Reviewed by Zalan Bujtas.

Add support for traversing LFC inline layout to TextBoxIterator and ElementBoxIterator.
This makes render tree dumps and TextIterator work with LFC layout.

* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
* layout/RenderBlockFlowLineLayout.cpp:
(WebCore::Layout::RenderBlockFlowLineLayout::layout):
(WebCore::Layout::RenderBlockFlowLineLayout::inlineResults const):
(WebCore::Layout::RenderBlockFlowLineLayout::textBoxesFor const):
(WebCore::Layout::RenderBlockFlowLineLayout::elementBoxFor const):
* layout/RenderBlockFlowLineLayout.h:
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const):
* layout/displaytree/DisplayPainter.cpp:
(WebCore::Display::paintInlineContent):
* layout/displaytree/DisplayRun.h:
(WebCore::Display::Run::layoutBox const):

Replace style with layout box weak pointer. This allows finding runs for a given box.

(WebCore::Display::Run::style const):

Get style from the layout box.

(WebCore::Display::Run::Run):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
(WebCore::Layout::InlineFormattingContext::invalidateFormattingState):
* layout/inlineformatting/InlineFormattingContextQuirks.cpp:
(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::results const):
(WebCore::Layout::InlineFormattingState::clearResults):
(WebCore::Layout::InlineFormattingState::ensureResults):
(WebCore::Layout::InlineFormattingState::displayRuns const): Deleted.
(WebCore::Layout::InlineFormattingState::displayRuns): Deleted.
(WebCore::Layout::InlineFormattingState::lineBoxes const): Deleted.
(WebCore::Layout::InlineFormattingState::lineBoxes): Deleted.
(WebCore::Layout::InlineFormattingState::addLineBox): Deleted.
(WebCore::Layout::InlineFormattingState::lineBoxForRun const): Deleted.
(WebCore::Layout::InlineFormattingState::addDisplayRun): Deleted.
(WebCore::Layout::InlineFormattingState::resetDisplayRuns): Deleted.
* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::alignContentVertically):
(WebCore::Layout::LineBuilder::adjustBaselineAndLineHeight):
* layout/displaytree/DisplayInlineContent.h: Copied from Source/WebCore/layout/RenderBlockFlowLineLayout.h.
(WebCore::Display::InlineContent::lineBoxForRun const):

Factor into a struct. Make it refcounted for safe access from line layout iterators.

(WebCore::Layout::outputInlineRuns):
* rendering/line/LineLayoutTraversal.cpp:
(WebCore::LineLayoutTraversal::TextBoxIterator::TextBoxIterator):
(WebCore::LineLayoutTraversal::flowForText):
(WebCore::LineLayoutTraversal::firstTextBoxFor):
(WebCore::LineLayoutTraversal::firstTextBoxInTextOrderFor):
(WebCore::LineLayoutTraversal::ElementBoxIterator::ElementBoxIterator):
(WebCore::LineLayoutTraversal::elementBoxFor):
* rendering/line/LineLayoutTraversal.h:
* rendering/line/LineLayoutTraversalDisplayRunPath.h: Added.
(WebCore::LineLayoutTraversal::linePosition):
(WebCore::LineLayoutTraversal::DisplayRunPath::DisplayRunPath):

New path for traversing display runs.

(WebCore::LineLayoutTraversal::DisplayRunPath::rect const):
(WebCore::LineLayoutTraversal::DisplayRunPath::logicalRect const):
(WebCore::LineLayoutTraversal::DisplayRunPath::isLeftToRightDirection const):
(WebCore::LineLayoutTraversal::DisplayRunPath::dirOverride const):
(WebCore::LineLayoutTraversal::DisplayRunPath::isLineBreak const):
(WebCore::LineLayoutTraversal::DisplayRunPath::hasHyphen const):
(WebCore::LineLayoutTraversal::DisplayRunPath::text const):
(WebCore::LineLayoutTraversal::DisplayRunPath::localStartOffset const):
(WebCore::LineLayoutTraversal::DisplayRunPath::localEndOffset const):
(WebCore::LineLayoutTraversal::DisplayRunPath::length const):
(WebCore::LineLayoutTraversal::DisplayRunPath::isLastOnLine const):
(WebCore::LineLayoutTraversal::DisplayRunPath::isLast const):
(WebCore::LineLayoutTraversal::DisplayRunPath::traverseNextTextBoxInVisualOrder):
(WebCore::LineLayoutTraversal::DisplayRunPath::traverseNextTextBoxInTextOrder):
(WebCore::LineLayoutTraversal::DisplayRunPath::operator== const):
(WebCore::LineLayoutTraversal::DisplayRunPath::atEnd const):
(WebCore::LineLayoutTraversal::DisplayRunPath::displayRuns const):
(WebCore::LineLayoutTraversal::DisplayRunPath::firstRun const):
(WebCore::LineLayoutTraversal::DisplayRunPath::run const):

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

2 months agoAdd FuzzerAgent that reads predictions from a file
commit-queue@webkit.org [Mon, 2 Dec 2019 06:44:16 +0000 (06:44 +0000)]
Add FuzzerAgent that reads predictions from a file
https://bugs.webkit.org/show_bug.cgi?id=203898

Patch by Tuomas Karkkainen <tuomas.webkit@apple.com> on 2019-12-01
Reviewed by Mark Lam.

This patch adds a FuzzerAgent that reads predictions from a file. The predictions in the file are
correlated with the prediction sites using the name of the JavaScript source file, the opcode, and
start and end offsets in the source. There is also a separate FuzzerAgent that can be used to create
the prediction files.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* runtime/FileBasedFuzzerAgent.cpp: Added.
* runtime/FileBasedFuzzerAgent.h: Copied from Source/JavaScriptCore/runtime/RandomizingFuzzerAgent.cpp.
* runtime/FileBasedFuzzerAgentBase.cpp: Added.
* runtime/FileBasedFuzzerAgentBase.h: Copied from Source/JavaScriptCore/runtime/RandomizingFuzzerAgent.cpp.
* runtime/FuzzerPredictions.cpp: Added.
* runtime/FuzzerPredictions.h: Copied from Source/JavaScriptCore/runtime/RandomizingFuzzerAgent.cpp.
* runtime/Options.cpp:
* runtime/OptionsList.h:
* runtime/PredictionFileCreatingFuzzerAgent.cpp: Copied from Source/JavaScriptCore/runtime/RandomizingFuzzerAgent.cpp.
* runtime/PredictionFileCreatingFuzzerAgent.h: Copied from Source/JavaScriptCore/runtime/RandomizingFuzzerAgent.cpp.
* runtime/RandomizingFuzzerAgent.cpp:
* runtime/VM.cpp:

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

2 months agoDisable LocalCurrentGraphicsContext when doing DisplayList recording
timothy_horton@apple.com [Mon, 2 Dec 2019 03:32:26 +0000 (03:32 +0000)]
Disable LocalCurrentGraphicsContext when doing DisplayList recording
https://bugs.webkit.org/show_bug.cgi?id=204721

Reviewed by Simon Fraser.

* platform/mac/LocalCurrentGraphicsContext.mm:
(WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext):
Since we don't have a platform context, we can't set the global
graphics context. This means that anything depending on this downstream
will break and need to be implemented a different way in
the DisplayList case.

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

2 months ago[Win] Retrieve all following WM_CHAR events at the beginning of processing WM_KEYDOWN...
Hironori.Fujii@sony.com [Mon, 2 Dec 2019 03:19:14 +0000 (03:19 +0000)]
[Win] Retrieve all following WM_CHAR events at the beginning of processing WM_KEYDOWN event
https://bugs.webkit.org/show_bug.cgi?id=204694

Reviewed by Ross Kirsling.

Source/WebKit:

In Windows ports, WM_KEYDOWN dispatches keydown event, and
WM_CHAR dispatches keypress event. If a keydown event is canceled
by calling preventDefault, the following corresponding keypress
events shouldn't be dispatched.

WebKit1 implemented it by removing WM_CHAR events if the keydown
event is consumed. However, WebKit2 can't do so because WebKit2
processes key events asynchronously. Thus, retrieve all following
WM_CHAR events, and dispatch them after processing the keydown
and if it is not consumed.

In addition to that, retrieving following WM_CHAR events is needed
to fix Bug 204672 because the events are needed for 'key' property
of keydown KeyboardEvent for dead key combination.

Gecko and Chromium also implements 'key' property in the same approach.

Test: Covered by existing fast/events/inputText-never-fired-on-keydown-cancel.html and fast/events/keydown-keypress-preventDefault.html

* Shared/NativeWebKeyboardEvent.h: Added m_pendingCharEvents as Vector<MSG>.
(WebKit::NativeWebKeyboardEvent::pendingCharEvents const):
* Shared/win/NativeWebKeyboardEventWin.cpp:
(WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveEvent):
* UIProcess/WebPageProxy.h:
* UIProcess/win/WebPageProxyWin.cpp:
(WebKit::WebPageProxy::dispatchPendingCharEvents):
* UIProcess/win/WebView.cpp:
(WebKit::WebView::onKeyEvent):

Source/WebKitLegacy/win:

* WebView.cpp:
(WebView::keyDown): Added a variable pendingCharEvents of
Vector<MSG> to preserve following WM_CHAR events. Dispatch them if
the WM_KEYDOWN isn't consumed.

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

2 months ago[JSC][MIPS] CallFrame is being clobbered on InternalFunction execution
ticaiolima@gmail.com [Mon, 2 Dec 2019 02:57:43 +0000 (02:57 +0000)]
[JSC][MIPS] CallFrame is being clobbered on InternalFunction execution
https://bugs.webkit.org/show_bug.cgi?id=203739

Reviewed by Saam Barati.

JSTests:

* stress/has-instance-exception-check.js:
* stress/regress-176485.js:

Source/JavaScriptCore:

MIPS calling conventions requires that we have stack space reserved
for 4 (16-bytes) arguments ($a0-$a3). The caller doesn't use
this space, but callee can still use it in case where they need to save
arguments or even reuse to another allocation. Since we were not
allocationg it during `makeHostFunctionCall`, the caller frame slot
was being clobberred by `callGenericTypedArrayView` execution,
resulting in a corrupted call frame stack. This patch is adjusting
this convention into ThunkGenerator and on  `makeHostFunctionCall`.

* jit/ThunkGenerators.cpp:
(JSC::nativeForGenerator):
* llint/LowLevelInterpreter32_64.asm:

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

2 months agoImplement GetByVal inline caching for 32-bit JITs
ticaiolima@gmail.com [Mon, 2 Dec 2019 02:54:11 +0000 (02:54 +0000)]
Implement GetByVal inline caching for 32-bit JITs
https://bugs.webkit.org/show_bug.cgi?id=204082

Reviewed by Saam Barati.

We are adding 32-bit support for GetByVal cases added on r252684.
This requires changes on some of the IC code generated to properly
support JSVALUE32_64. The major difference from JSVALUE64 is the
usage of tagGPR to inspect value types and store results.

* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateWithGuard):
(JSC::AccessCase::generateImpl):
* bytecode/GetterSetterAccessCase.cpp:
(JSC::GetterSetterAccessCase::emitDOMJITGetter):
* bytecode/PolymorphicAccess.cpp:
(JSC::PolymorphicAccess::regenerate):
* bytecode/StructureStubInfo.h:

Since a generator can't have `thisGPR` and `propertyGPR` at se same time,
we created a new `union` to share `thisTagGPR` and `propertyTagGPR`,
matching the approach we have for `JITInlineCacheGenerator::patch.u`.

(JSC::StructureStubInfo::propertyRegs const):
(JSC::StructureStubInfo::baseRegs const):

To simplify scratch register allocation, we added `baseRegs()` and
`propertyRegs()` to `StructureStubInfo`, so we can easily retrive
payload and tag GPRs for those operands, keeping them locked.

* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* jit/JITInlineCacheGenerator.cpp:
(JSC::JITByIdGenerator::JITByIdGenerator):
(JSC::JITGetByIdWithThisGenerator::JITGetByIdWithThisGenerator):
(JSC::JITInstanceOfGenerator::JITInstanceOfGenerator):
(JSC::JITGetByValGenerator::JITGetByValGenerator):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::emitSlow_op_get_by_val):

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

2 months ago[CMake] Ninja can't build WebKitQuartzCoreAdditions of AppleWin port
Hironori.Fujii@sony.com [Mon, 2 Dec 2019 02:18:46 +0000 (02:18 +0000)]
[CMake] Ninja can't build WebKitQuartzCoreAdditions of AppleWin port
https://bugs.webkit.org/show_bug.cgi?id=204696

Reviewed by Don Olmstead.

It seems unnecessary to explicitly add Windows SDK to link_directories.

* WebKitQuartzCoreAdditions/CMakeLists.txt: Removed link_directories for Windows SDK.

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

2 months ago[LFC][IFC] Trim trailing letter spacing.
zalan@apple.com [Sun, 1 Dec 2019 23:14:38 +0000 (23:14 +0000)]
[LFC][IFC] Trim trailing letter spacing.
https://bugs.webkit.org/show_bug.cgi?id=204731
<rdar://problem/57545763>

Reviewed by Antti Koivisto.

Refactor trailing trimmable content to support partial, non-whitespace trimmable content e.g. letter spacing.
https://drafts.csswg.org/css-text-3/#letter-spacing-property -> UAs therefore must not append letter spacing to the right or trailing edge of a line.

* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::LineBreaker::breakingContextForInlineContent):
(WebCore::Layout::LineBreaker::Content::append):
(WebCore::Layout::LineBreaker::Content::reset):
(WebCore::Layout::LineBreaker::Content::TrailingTrimmableContent::reset):
(WebCore::Layout::LineBreaker::Content::hasNonWhitespaceOrInlineBox const): Deleted.
(WebCore::Layout::LineBreaker::Content::trailingTrimmableWidth const): Deleted.
* layout/inlineformatting/InlineLineBreaker.h:
(WebCore::Layout::LineBreaker::Content::isEmpty const):
(WebCore::Layout::LineBreaker::Content::nonTrimmableWidth const):
(WebCore::Layout::LineBreaker::Content::hasTrailingTrimmableContent const):
(WebCore::Layout::LineBreaker::Content::isTrailingContentFullyTrimmable const):
* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::removeTrailingTrimmableContent):
(WebCore::Layout::LineBuilder::appendTextContent):
(WebCore::Layout::LineBuilder::TrimmableContent::append):
(WebCore::Layout::LineBuilder::InlineItemRun::removeTrailingLetterSpacing):
* layout/inlineformatting/InlineLineBuilder.h:
(WebCore::Layout::LineBuilder::isTrailingContentFullyTrimmable const):
(WebCore::Layout::LineBuilder::TrimmableContent::isTrailingContentFullyTrimmable const):
(WebCore::Layout::LineBuilder::TrimmableContent::clear):
* layout/inlineformatting/LineLayoutContext.cpp:
(WebCore::Layout::LineLayoutContext::processUncommittedContent):

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

2 months agoRename CSSCalcPrimitiveValue to CSSCalcPrimitiveValueNode, and CSSCalcOperation to...
simon.fraser@apple.com [Sun, 1 Dec 2019 21:58:36 +0000 (21:58 +0000)]
Rename CSSCalcPrimitiveValue to CSSCalcPrimitiveValueNode, and CSSCalcOperation to CSSCalcOperationNode
https://bugs.webkit.org/show_bug.cgi?id=204730

Reviewed by Dean Jackson.

Pure rename. These are both subclasses of CSSCalcExpressionNode, so are better with Node in the name.

* css/CSSCalculationValue.cpp:
(WebCore::CSSCalcPrimitiveValueNode::createCalcExpression const):
(WebCore::CSSCalcPrimitiveValueNode::doubleValue const):
(WebCore::CSSCalcPrimitiveValueNode::computeLengthPx const):
(WebCore::CSSCalcPrimitiveValueNode::collectDirectComputationalDependencies const):
(WebCore::CSSCalcPrimitiveValueNode::collectDirectRootComputationalDependencies const):
(WebCore::CSSCalcPrimitiveValueNode::equals const):
(WebCore::CSSCalcPrimitiveValueNode::dump const):
(WebCore::CSSCalcOperationNode::create):
(WebCore::CSSCalcOperationNode::createMinOrMax):
(WebCore::CSSCalcOperationNode::createSimplified):
(WebCore::CSSCalcOperationNode::primitiveType const):
(WebCore::CSSCalcOperationNode::createCalcExpression const):
(WebCore::CSSCalcOperationNode::doubleValue const):
(WebCore::CSSCalcOperationNode::computeLengthPx const):
(WebCore::CSSCalcOperationNode::collectDirectComputationalDependencies const):
(WebCore::CSSCalcOperationNode::collectDirectRootComputationalDependencies const):
(WebCore::CSSCalcOperationNode::buildCssText):
(WebCore::CSSCalcOperationNode::customCSSText const):
(WebCore::CSSCalcOperationNode::dump const):
(WebCore::CSSCalcOperationNode::equals const):
(WebCore::CSSCalcOperationNode::evaluateOperator):
(WebCore::CSSCalcExpressionNodeParser::parseValue):
(WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression):
(WebCore::CSSCalcExpressionNodeParser::parseAdditiveValueExpression):
(WebCore::CSSCalcExpressionNodeParser::parseMinMaxExpression):
(WebCore::createBlendHalf):
(WebCore::createCSS):
(WebCore::CSSCalcPrimitiveValue::createCalcExpression const): Deleted.
(WebCore::CSSCalcPrimitiveValue::doubleValue const): Deleted.
(WebCore::CSSCalcPrimitiveValue::computeLengthPx const): Deleted.
(WebCore::CSSCalcPrimitiveValue::collectDirectComputationalDependencies const): Deleted.
(WebCore::CSSCalcPrimitiveValue::collectDirectRootComputationalDependencies const): Deleted.
(WebCore::CSSCalcPrimitiveValue::equals const): Deleted.
(WebCore::CSSCalcPrimitiveValue::dump const): Deleted.
(WebCore::CSSCalcOperation::create): Deleted.
(WebCore::CSSCalcOperation::createMinOrMax): Deleted.
(WebCore::CSSCalcOperation::createSimplified): Deleted.
(WebCore::CSSCalcOperation::primitiveType const): Deleted.
(WebCore::CSSCalcOperation::createCalcExpression const): Deleted.
(WebCore::CSSCalcOperation::doubleValue const): Deleted.
(WebCore::CSSCalcOperation::computeLengthPx const): Deleted.
(WebCore::CSSCalcOperation::collectDirectComputationalDependencies const): Deleted.
(WebCore::CSSCalcOperation::collectDirectRootComputationalDependencies const): Deleted.
(WebCore::CSSCalcOperation::buildCssText): Deleted.
(WebCore::CSSCalcOperation::customCSSText const): Deleted.
(WebCore::CSSCalcOperation::dump const): Deleted.
(WebCore::CSSCalcOperation::equals const): Deleted.
(WebCore::CSSCalcOperation::evaluateOperator): Deleted.

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

2 months agoAdd a Calc log channel, and support type traits for calc-related classes
simon.fraser@apple.com [Sun, 1 Dec 2019 21:58:33 +0000 (21:58 +0000)]
Add a Calc log channel, and support type traits for calc-related classes
https://bugs.webkit.org/show_bug.cgi?id=204729

Reviewed by Dean Jackson.

Add type traits support for CalculationValue and CSSCalculationValue classes.

Add a Calc logging channel and dump post-parsing values, and in some error cases.s

* css/CSSCalculationValue.cpp:
(WebCore::operator<<):
(WebCore::prettyPrintNode):
(WebCore::prettyPrintNodes):
(WebCore::CSSCalcPrimitiveValue::dump const):
(WebCore::CSSCalcOperation::create):
(WebCore::CSSCalcOperation::createMinOrMax):
(WebCore::CSSCalcOperation::dump const):
(WebCore::CSSCalcExpressionNodeParser::parseCalc):
(WebCore::createCSS):
(WebCore::CSSCalcValue::dump const):
(WebCore::CSSCalcValue::create):
* css/CSSCalculationValue.h:
* platform/CalculationValue.cpp:
(WebCore::CalcExpressionNumber::operator== const):
(WebCore::CalcExpressionOperation::operator== const):
(WebCore::CalcExpressionLength::operator== const):
(WebCore::CalcExpressionBlendLength::CalcExpressionBlendLength):
(WebCore::CalcExpressionBlendLength::operator== const):
* platform/CalculationValue.h:
(WebCore::toCalcExpressionNumber): Deleted.
(WebCore::toCalcExpressionLength): Deleted.
(WebCore::toCalcExpressionOperation): Deleted.
(WebCore::toCalcExpressionBlendLength): Deleted.
* platform/Logging.h:

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

2 months ago[Web Animations] Rebaseline some WPT expectations
graouts@webkit.org [Sun, 1 Dec 2019 17:51:43 +0000 (17:51 +0000)]
[Web Animations] Rebaseline some WPT expectations
https://bugs.webkit.org/show_bug.cgi?id=204724

Unreviewed test gardening.

* web-platform-tests/css/css-animations/event-order.tentative-expected.txt:
* web-platform-tests/web-animations/interfaces/Animation/style-change-events-expected.txt:

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

2 months agoRegression (r252893): loader/stateobjects/pushstate-size.html is crashing on mac...
antti@apple.com [Sun, 1 Dec 2019 15:49:44 +0000 (15:49 +0000)]
Regression (r252893): loader/stateobjects/pushstate-size.html is crashing on mac debug
https://bugs.webkit.org/show_bug.cgi?id=204725

Unreviewed followup to r252893.

* rendering/RenderElement.h:

Increase bitfield size to fit the enum.

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

2 months ago[LFC][IFC] Add support for word-spacing property
zalan@apple.com [Sun, 1 Dec 2019 15:27:07 +0000 (15:27 +0000)]
[LFC][IFC] Add support for word-spacing property
https://bugs.webkit.org/show_bug.cgi?id=204723
<rdar://problem/57541871>

Reviewed by Antti Koivisto.

* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::TrimmableContent::append):
* layout/inlineformatting/LineLayoutContext.cpp:
(WebCore::Layout::inlineItemWidth):

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

2 months ago[Web Animations] Implement Animation.commitStyles()
graouts@webkit.org [Sun, 1 Dec 2019 09:22:48 +0000 (09:22 +0000)]
[Web Animations] Implement Animation.commitStyles()
https://bugs.webkit.org/show_bug.cgi?id=202193
<rdar://problem/55697790>

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

WPT test for Animation.commitStyles() now has 11 more PASS results.

* web-platform-tests/web-animations/interfaces/Animation/commitStyles-expected.txt:

Source/WebCore:

We implement the Animation.commitStyles() method following the spec to the letter. We fail a few tests still because we don't support animation
composite operations and because of rounding errors when blending opacity styles.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/KeyframeEffectStack.cpp:
(WebCore::KeyframeEffectStack::ensureEffectsAreSorted): Remove the animation sorting logic since it's now made available in WebAnimationUtilities.h.
* animation/KeyframeEffectStack.h:
(WebCore::KeyframeEffectStack::cssAnimationNames const): New function needed to call compareAnimationsByCompositeOrder() in WebAnimation::commitStyles().
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::commitStyles): Implement the spec steps as specified in https://drafts.csswg.org/web-animations-1/#commit-computed-styles. We use
a CSSStyleDeclaration to copy the content of the existing inline "style" attribute, add the animated values and then serialize it into the "style" attribute.
Even though it would have been more convenient to use StyledElement::setInlineStyleProperty(), we do this to ensure mutation observers get notified of such
a change.
* animation/WebAnimationUtilities.cpp: Added.
(WebCore::compareAnimationsByCompositeOrder): Copied the animation sorting logic previously implemented in KeyframeEffectStack::ensureEffectsAreSorted().
* animation/WebAnimationUtilities.h:

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

2 months agoMake CompositeOperator and BlendMode encodable
timothy_horton@apple.com [Sun, 1 Dec 2019 06:10:25 +0000 (06:10 +0000)]
Make CompositeOperator and BlendMode encodable
https://bugs.webkit.org/show_bug.cgi?id=204722

Reviewed by Eric Carlson.

Source/WebCore:

Make CompositeOperator an `enum class`, and fix the fallout.
Add EnumTraits for CompositeOperator and BlendMode, so that they can be encoded.

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator CompositeOperator const):
* dom/Document.cpp:
(WebCore::Document::compositeOperatorForBackgroundColor const):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::HTMLImageElement):
(WebCore::HTMLImageElement::parseAttribute):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawTextInternal):
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::State::State):
(WebCore::CanvasRenderingContext2DBase::setGlobalCompositeOperation):
(WebCore::CanvasRenderingContext2DBase::isFullCanvasCompositeMode):
(WebCore::CanvasRenderingContext2DBase::fillInternal):
(WebCore::CanvasRenderingContext2DBase::strokeInternal):
(WebCore::CanvasRenderingContext2DBase::clearRect):
(WebCore::CanvasRenderingContext2DBase::fillRect):
(WebCore::CanvasRenderingContext2DBase::strokeRect):
(WebCore::CanvasRenderingContext2DBase::drawImage):
(WebCore::CanvasRenderingContext2DBase::drawImageFromRect):
(WebCore::CanvasRenderingContext2DBase::fullCanvasCompositedDrawImage):
* inspector/InspectorOverlay.cpp:
(WebCore::drawOutlinedQuadWithClip):
* platform/graphics/CrossfadeGeneratedImage.cpp:
(WebCore::CrossfadeGeneratedImage::drawCrossfade):
* platform/graphics/GraphicsContext.h:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::dumpProperties const):
* platform/graphics/GraphicsTypes.cpp:
(WebCore::parseCompositeAndBlendOperator):
(WebCore::compositeOperatorName):
* platform/graphics/GraphicsTypes.h:
* platform/graphics/Image.cpp:
(WebCore::Image::fillWithSolidColor):
* platform/graphics/ImagePaintingOptions.h:
* platform/graphics/ShadowBlur.cpp:
(WebCore::ShadowBlur::blurAndColorShadowBuffer):
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::drawNativeImage):
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/CairoUtilities.cpp:
(WebCore::toCairoCompositeOperator):
* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::GraphicsContext3D::paintToCanvas):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::selectCGBlendMode):
* platform/graphics/filters/FEBlend.cpp:
(WebCore::FEBlend::platformApplySoftware):
(WebCore::FEBlend::externalRepresentation const):
* platform/graphics/filters/FEComposite.cpp:
(WebCore::FEComposite::platformApplySoftware):
* platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::platformApplySoftware):
* platform/graphics/filters/SourceAlpha.cpp:
(WebCore::SourceAlpha::platformApplySoftware):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::paint):
* platform/graphics/nicosia/NicosiaPaintingEngineBasic.cpp:
(Nicosia::PaintingEngineBasic::paint):
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
(Nicosia::paintLayer):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
* platform/graphics/win/Direct2DOperations.cpp:
(WebCore::Direct2D::State::setCompositeOperation):
* platform/graphics/win/Direct2DOperations.h:
* platform/graphics/win/ImageCGWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize):
* platform/graphics/win/ImageCairoWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paintMask):
* rendering/InlineFlowBox.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintMaskImages):
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderBoxModelObject.h:
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::paintReplaced):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect):
* rendering/RenderLayerBacking.cpp:
(WebCore::supportsDirectlyCompositedBoxDecorations):
* rendering/RenderTreeAsText.cpp:
* rendering/RenderView.cpp:
(WebCore::RenderView::paintBoxDecorations):
* rendering/style/FillLayer.cpp:
(WebCore::FillLayer::FillLayer):
(WebCore::FillLayer::hasOpaqueImage const):
* rendering/style/FillLayer.h:
(WebCore::FillLayer::initialFillComposite):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::nativeImage):
(WebCore::SVGImage::draw):

Source/WebKit:

* UIProcess/cairo/BackingStoreCairo.cpp:
(WebKit::BackingStore::incorporateUpdate):
* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::paint):
(WebKit::PluginProxy::update):
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::drawRect):

Source/WebKitLegacy/win:

* FullscreenVideoController.cpp:
(FullscreenVideoController::draw):
* WebView.cpp:
(WebView::paintWithDirect2D):
(WebView::paintIntoBackingStore):

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

2 months agotest262-runner should dump YAML with correct encoding
ross.kirsling@sony.com [Sun, 1 Dec 2019 04:20:38 +0000 (04:20 +0000)]
test262-runner should dump YAML with correct encoding
https://bugs.webkit.org/show_bug.cgi?id=204493

Reviewed by Saam Barati.

JSTests:

* test262/expectations.yaml:
Fix double-encoding of test failure output.

Tools:

Even though we spit out correctly-encoded output to the terminal, Perl's YAML module insists upon *re*-encoding
to UTF-8 when dumping to file. This works out in the end because an analogous double-decode occurs when loading
from file. Still, it's really annoying that expectations.yaml has garbled (i.e. double-encoded) text.

We shouldn't modify libraries directly, but we can copy-paste DumpFile/LoadFile into Runner.pm and tweak!

* Scripts/test262/Runner.pm:
(DumpFile):
(LoadFile):
Add custom versions of DumpFile/LoadFile which do not execute `binmode $OUT, ':utf8';`.

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

2 months ago[LFC] Expand tests coverage (2648 new tests -> 3980).
zalan@apple.com [Sun, 1 Dec 2019 01:09:13 +0000 (01:09 +0000)]
[LFC] Expand tests coverage (2648 new tests -> 3980).

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

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

2 months agoReimplement some PlatformCALayer methods using GraphicsContext instead of CGContextRef
timothy_horton@apple.com [Sun, 1 Dec 2019 01:06:49 +0000 (01:06 +0000)]
Reimplement some PlatformCALayer methods using GraphicsContext instead of CGContextRef
https://bugs.webkit.org/show_bug.cgi?id=204698

Reviewed by Sam Weinig.

Source/WebCore:

In order to make PlatformCALayer-level DisplayList recording possible,
reimplement a few methods in terms of WebCore::GraphicsContext instead
of CGContextRef directly. Namely, collectRectsToPaint, drawLayerContents,
and drawRepaintIndicator.

In the drawLayerContents case, there are operations (like setting the
AppKit global graphics context) that cannot be done without a platform
context. In those cases, we skip that operation if we don't have a
platform context.

Anything depending on this downstream will break and need to be
implemented a different way in the DisplayList case.

* platform/graphics/GraphicsContext.h:
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::PlatformCALayer::drawRepaintIndicator):
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::platformCALayerPaintContents):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayer::collectRectsToPaint):
(WebCore::PlatformCALayer::drawLayerContents):
(WebCore::PlatformCALayerCocoa::enumerateRectsBeingDrawn):
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayer::collectRectsToPaint):
* platform/graphics/mac/WebLayer.mm:
(-[WebLayer drawInContext:]):

Source/WebKit:

* Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::drawInContext):
(WebKit::RemoteLayerBackingStore::enumerateRectsBeingDrawn):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::enumerateRectsBeingDrawn):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:

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

2 months agoSimplify CoreAudioCaptureSource suspension logic
youenn@apple.com [Sat, 30 Nov 2019 19:08:09 +0000 (19:08 +0000)]
Simplify CoreAudioCaptureSource suspension logic
https://bugs.webkit.org/show_bug.cgi?id=201720

Reviewed by Eric Carlson.

Instead of going through the source to suspend/resume the audio unit,
we directly go to the shared unit, which nows notifies the clients that they are muted or unmuted.

To simplify things, we no longer schedule tasks to resume/suspend/reconfigure.
All of these orders are started from the main thread synchronously.

No observable change of behavior.

* platform/mediastream/mac/BaseAudioSharedUnit.cpp:
(WebCore::BaseAudioSharedUnit::startProducingData):
(WebCore::BaseAudioSharedUnit::reconfigure):
(WebCore::BaseAudioSharedUnit::resume):
(WebCore::BaseAudioSharedUnit::suspend):
* platform/mediastream/mac/BaseAudioSharedUnit.h:
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSourceFactory::beginInterruption):
(WebCore::CoreAudioCaptureSourceFactory::endInterruption):
(WebCore::CoreAudioCaptureSourceFactory::scheduleReconfiguration):
(WebCore::CoreAudioCaptureSource::initializeToStartProducingData):
(WebCore::CoreAudioCaptureSource::startProducingData):
(WebCore::CoreAudioCaptureSource::stopProducingData):
(WebCore::CoreAudioCaptureSource::settingsDidChange):
(WebCore::CoreAudioCaptureSource::scheduleReconfiguration): Deleted.
(WebCore::CoreAudioCaptureSource::beginInterruption): Deleted.
(WebCore::CoreAudioCaptureSource::endInterruption): Deleted.
* platform/mediastream/mac/CoreAudioCaptureSource.h:

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

2 months agoUpdate RealtimeOutgoingAudioSourceCocoa::m_writeCount when sampleRate changes
youenn@apple.com [Sat, 30 Nov 2019 19:07:31 +0000 (19:07 +0000)]
Update RealtimeOutgoingAudioSourceCocoa::m_writeCount when sampleRate changes
https://bugs.webkit.org/show_bug.cgi?id=204606

Reviewed by Eric Carlson.

Source/WebCore:

Update m_writeCount to make sure our high/low buffer computation is done right.

Test: webrtc/audio-samplerate-change.html

* platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
(WebCore::RealtimeOutgoingAudioSourceCocoa::audioSamplesAvailable):

LayoutTests:

* webrtc/audio-samplerate-change-expected.txt: Added.
* webrtc/audio-samplerate-change.html: Added.

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

2 months agoMove path implementation functions in LineLayoutTraversal to *Path classes
antti@apple.com [Sat, 30 Nov 2019 16:30:54 +0000 (16:30 +0000)]
Move path implementation functions in LineLayoutTraversal to *Path classes
https://bugs.webkit.org/show_bug.cgi?id=204714

Reviewed by Sam Weinig.

Simplify LineLayoutTraversal and make it easier to extend.

- Turn SimplePath and ComplexPath structs into classes
- Move them to separate files
- Make path implementation functions class members, called via generic lambdas
- Instead of inheriting Box/TextBox to iterators, make it a member variable.
- Move the path variant to Box, avoiding use of templates.

* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderTreeAsText.cpp:
(WebCore::writeTextBox):
* rendering/line/LineLayoutTraversal.cpp:
(WebCore::LineLayoutTraversal::TextBoxIterator::TextBoxIterator):
(WebCore::LineLayoutTraversal::TextBoxIterator::traverseNextInVisualOrder):
(WebCore::LineLayoutTraversal::TextBoxIterator::traverseNextInTextOrder):
(WebCore::LineLayoutTraversal::TextBoxIterator::operator== const):
(WebCore::LineLayoutTraversal::TextBoxIterator::atEnd const):
(WebCore::LineLayoutTraversal::ElementBoxIterator::ElementBoxIterator):
(WebCore::LineLayoutTraversal::ElementBoxIterator::atEnd const):
(WebCore::LineLayoutTraversal::TextBoxIterator::ComplexPath::nextInlineTextBoxInTextOrder const): Deleted.
* rendering/line/LineLayoutTraversal.h:
(WebCore::LineLayoutTraversal::TextBoxIterator::TextBoxIterator):
(WebCore::LineLayoutTraversal::TextBoxIterator::operator* const):
(WebCore::LineLayoutTraversal::TextBoxIterator::operator-> const):
(WebCore::LineLayoutTraversal::ElementBoxIterator::ElementBoxIterator):
(WebCore::LineLayoutTraversal::ElementBoxIterator::operator* const):
(WebCore::LineLayoutTraversal::ElementBoxIterator::operator-> const):
(WebCore::LineLayoutTraversal::Box::Box):
(WebCore::LineLayoutTraversal::Box::rect const):
(WebCore::LineLayoutTraversal::Box::logicalRect const):
(WebCore::LineLayoutTraversal::Box::isLeftToRightDirection const):
(WebCore::LineLayoutTraversal::Box::dirOverride const):
(WebCore::LineLayoutTraversal::Box::isLineBreak const):
(WebCore::LineLayoutTraversal::TextBox::hasHyphen const):
(WebCore::LineLayoutTraversal::TextBox::TextBox):
(WebCore::LineLayoutTraversal::TextBox::text const):
(WebCore::LineLayoutTraversal::TextBox::localStartOffset const):
(WebCore::LineLayoutTraversal::TextBox::localEndOffset const):
(WebCore::LineLayoutTraversal::TextBox::length const):
(WebCore::LineLayoutTraversal::TextBox::isLastOnLine const):
(WebCore::LineLayoutTraversal::TextBox::isLast const):
(): Deleted.
(WebCore::LineLayoutTraversal::Box<Iterator>::rect const): Deleted.
(WebCore::LineLayoutTraversal::Box<Iterator>::logicalRect const): Deleted.
(WebCore::LineLayoutTraversal::Box<Iterator>::isLeftToRightDirection const): Deleted.
(WebCore::LineLayoutTraversal::Box<Iterator>::dirOverride const): Deleted.
(WebCore::LineLayoutTraversal::Box<Iterator>::isLineBreak const): Deleted.
(WebCore::LineLayoutTraversal::Box<Iterator>::iterator const): Deleted.
(WebCore::LineLayoutTraversal::TextBox<Iterator>::hasHyphen const): Deleted.
(WebCore::LineLayoutTraversal::TextBox<Iterator>::text const): Deleted.
(WebCore::LineLayoutTraversal::TextBox<Iterator>::localStartOffset const): Deleted.
(WebCore::LineLayoutTraversal::TextBox<Iterator>::localEndOffset const): Deleted.
(WebCore::LineLayoutTraversal::TextBox<Iterator>::length const): Deleted.
(WebCore::LineLayoutTraversal::TextBox<Iterator>::isLastOnLine const): Deleted.
(WebCore::LineLayoutTraversal::TextBox<Iterator>::isLast const): Deleted.
* rendering/line/LineLayoutTraversalComplexPath.h: Added.
(WebCore::LineLayoutTraversal::ComplexPath::ComplexPath):
(WebCore::LineLayoutTraversal::ComplexPath::rect const):
(WebCore::LineLayoutTraversal::ComplexPath::logicalRect const):
(WebCore::LineLayoutTraversal::ComplexPath::isLeftToRightDirection const):
(WebCore::LineLayoutTraversal::ComplexPath::dirOverride const):
(WebCore::LineLayoutTraversal::ComplexPath::isLineBreak const):
(WebCore::LineLayoutTraversal::ComplexPath::hasHyphen const):
(WebCore::LineLayoutTraversal::ComplexPath::text const):
(WebCore::LineLayoutTraversal::ComplexPath::localStartOffset const):
(WebCore::LineLayoutTraversal::ComplexPath::localEndOffset const):
(WebCore::LineLayoutTraversal::ComplexPath::length const):
(WebCore::LineLayoutTraversal::ComplexPath::isLastOnLine const):
(WebCore::LineLayoutTraversal::ComplexPath::isLast const):
(WebCore::LineLayoutTraversal::ComplexPath::traverseNextTextBoxInVisualOrder):
(WebCore::LineLayoutTraversal::ComplexPath::traverseNextTextBoxInTextOrder):
(WebCore::LineLayoutTraversal::ComplexPath::operator== const):
(WebCore::LineLayoutTraversal::ComplexPath::atEnd const):
(WebCore::LineLayoutTraversal::ComplexPath::inlineTextBox const):
(WebCore::LineLayoutTraversal::ComplexPath::nextInlineTextBoxInTextOrder const):
* rendering/line/LineLayoutTraversalSimplePath.h: Added.
(WebCore::LineLayoutTraversal::SimplePath::SimplePath):
(WebCore::LineLayoutTraversal::SimplePath::rect const):
(WebCore::LineLayoutTraversal::SimplePath::logicalRect const):
(WebCore::LineLayoutTraversal::SimplePath::isLeftToRightDirection const):
(WebCore::LineLayoutTraversal::SimplePath::dirOverride const):
(WebCore::LineLayoutTraversal::SimplePath::isLineBreak const):
(WebCore::LineLayoutTraversal::SimplePath::hasHyphen const):
(WebCore::LineLayoutTraversal::SimplePath::text const):
(WebCore::LineLayoutTraversal::SimplePath::localStartOffset const):
(WebCore::LineLayoutTraversal::SimplePath::localEndOffset const):
(WebCore::LineLayoutTraversal::SimplePath::length const):
(WebCore::LineLayoutTraversal::SimplePath::isLastOnLine const):
(WebCore::LineLayoutTraversal::SimplePath::isLast const):
(WebCore::LineLayoutTraversal::SimplePath::traverseNextTextBoxInVisualOrder):
(WebCore::LineLayoutTraversal::SimplePath::traverseNextTextBoxInTextOrder):
(WebCore::LineLayoutTraversal::SimplePath::operator== const):
(WebCore::LineLayoutTraversal::SimplePath::atEnd const):

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

2 months ago[LFC][IFC] Add support for hyphenate-limit-lines
zalan@apple.com [Sat, 30 Nov 2019 15:16:22 +0000 (15:16 +0000)]
[LFC][IFC] Add support for hyphenate-limit-lines
https://bugs.webkit.org/show_bug.cgi?id=204712
<rdar://problem/57536727>

Reviewed by Antti Koivisto.

Source/WebCore:

Now IFC (hyphenation)feature matches SLL.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::lineLayout):
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const):
* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::LineBreaker::wordBreakingBehavior const):
(WebCore::Layout::LineBreaker::tryBreakingTextRun const):
* layout/inlineformatting/InlineLineBreaker.h:
(WebCore::Layout::LineBreaker::setHyphenationDisabled):
* layout/inlineformatting/LineLayoutContext.cpp:
(WebCore::Layout::LineLayoutContext::LineLayoutContext):
(WebCore::Layout::LineLayoutContext::layoutLine):
(WebCore::Layout::LineLayoutContext::close):
(WebCore::Layout::LineLayoutContext::processUncommittedContent):
* layout/inlineformatting/LineLayoutContext.h:

Tools:

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

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

2 months ago[Web Animations] Forward-filling animations should not schedule updates while filling
graouts@webkit.org [Sat, 30 Nov 2019 13:15:48 +0000 (13:15 +0000)]
[Web Animations] Forward-filling animations should not schedule updates while filling
https://bugs.webkit.org/show_bug.cgi?id=204697
<rdar://problem/57534005>

Reviewed by Dean Jackson.

Source/WebCore:

Tests: webanimations/no-scheduling-while-filling-accelerated.html
       webanimations/no-scheduling-while-filling-non-accelerated.html

For two different reasons, we would continuously schedule updates for animations in their "after" phase, ie. when they would have "fill: forwards"
and be finished.

In the case of non-accelerated animations, that was because we would also schedule an immedate update in DocumentTimeline::scheduleNextTick() provided
we had relevant animations that weren't accelerated. But since animations in their "after" phase are still considered relevant, which means that they
would override the base style with an animated value, this caused the unnecessary scheduled updates.

To address this, we run WebAnimation::timeToNextTick() in DocumentTimeline::scheduleNextTick() for all relevant animations and we teach that function
to schedule an immediate update only during the "active" phase, and to schedule a timed update only in the "before" phase computing the delay until
the animation enters the "active" phase.

While performing this work, we found a couple of other issues that weren't apparent until we had this more efficient scheduling in place.

First, we would not allow any additional calls to DocumentTimeline::scheduleAnimationResolution() to actually schedule an update while we were in the
process of updating animations. While this wasn't a problem before because the mere presence of relevant animations would cause an upadte, we now had
to allow any animation changing timing properties as promises would resolve and events would be dispatched during the animation update to cause further
animation updates to be scheduled. So we moved the "m_animationResolutionScheduled" flag reset earlier in DocumentTimeline::updateAnimationsAndSendEvents()
before we actually run the animation update procedure.

Following that change, we also had to make sure that timing changes made through the evaluation of the pending play and pause tasks would _not_ cause
animations to be scheduled, which meant that an animation that became non-pending (ie. its first tick occured) would always schedule one immediate
animation update. So now we have an extra "silent" flag to WebAnimation::timingDidChange() which is only set to true when called from either
WebAnimation::runPendingPlayTask() or WebAnimation::runPendingPauseTask().

Finally, one existing test showed that calling KeyframeEffect::setKeyframes() while running animations didn't cause an animation update to be scheduled
since a call to WebAnimation::effectTimingDidChange() was lacking. This is now addressed.

As for accelerated animations, the extraneous animation scheduling occured because we would get in a state where we would record an "accelerated action"
to stop the accelerated animation but the accelerated animation had already completed and the renderer for the target element was no longer composited.
This meant that KeyframeEffect::applyPendingAcceleratedActions() would not perform any work and the pending accelerated action would remain in the
DocumentTimeline queue and cause an update to be scheduled to try again, endlessly.

To address that, we first check in KeyframeEffect::addPendingAcceleratedAction() if the recorded action differs from the last recorded action, avoiding
unnecessary work, and in KeyframeEffect::applyPendingAcceleratedActions(), if our last recorded action was "Stop" and the renderer was not composited,
we discard all pending accelerated actions.

* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::updateAnimationsAndSendEvents):
(WebCore::DocumentTimeline::scheduleNextTick):
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::setKeyframes):
(WebCore::KeyframeEffect::addPendingAcceleratedAction):
(WebCore::KeyframeEffect::applyPendingAcceleratedActions):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::timingDidChange):
(WebCore::WebAnimation::runPendingPlayTask):
(WebCore::WebAnimation::runPendingPauseTask):
(WebCore::WebAnimation::timeToNextTick const):
* animation/WebAnimation.h:

LayoutTests:

Adding tests checking that we don't schedule animation updates while filling for accelerated and non-accelerated animations alike.

* webanimations/no-scheduling-while-filling-accelerated-expected.txt: Added.
* webanimations/no-scheduling-while-filling-accelerated.html: Added.
* webanimations/no-scheduling-while-filling-non-accelerated-expected.txt: Added.
* webanimations/no-scheduling-while-filling-non-accelerated.html: Added.

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

2 months agoMockAudioSharedUnit should reset its last render time on start/stop/reconfigure
youenn@apple.com [Sat, 30 Nov 2019 12:32:56 +0000 (12:32 +0000)]
MockAudioSharedUnit should reset its last render time on start/stop/reconfigure
https://bugs.webkit.org/show_bug.cgi?id=204600
<rdar://problem/57438874>

Reviewed by Eric Carlson.

MockAudioSharedUnit was not resetting its last render time on stop/start/reconfigure.
If stopping for a long time and then restarting, the unit would flood the audio pipe with lots of data
and confuse the pipe.
Remove some member variables inherited from MockRealtimeAudioSource which are no longer needed.

Covered by imported/w3c/web-platform-tests/webrtc/RTCRtpReceiver-getSynchronizationSources.https.html being no longer flaky.

* platform/mediastream/mac/MockAudioSharedUnit.h:
* platform/mediastream/mac/MockAudioSharedUnit.mm:
(WebCore::MockAudioSharedUnit::reconfigureAudioUnit):
(WebCore::MockAudioSharedUnit::startInternal):

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

2 months agoUnreviewed, follow-up to r252938, now fixing the MSE/EME build
philn@webkit.org [Sat, 30 Nov 2019 10:40:13 +0000 (10:40 +0000)]
Unreviewed, follow-up to r252938, now fixing the MSE/EME build

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
supportsKeySystem needs to be public because it's referenced from
the MSE MediaPlayerPrivate sub-class.

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