WebKit-https.git
2 months agoWeb Inspector: InspectorFrontendAPIDispatcher should not ignore all exceptions
bburg@apple.com [Fri, 4 Dec 2020 21:06:17 +0000 (21:06 +0000)]
Web Inspector: InspectorFrontendAPIDispatcher should not ignore all exceptions
https://bugs.webkit.org/show_bug.cgi?id=219378

Reviewed by Devin Rousso.

Source/WebCore:

Covered by existing Web Inspector layout tests.

* bindings/js/ScriptController.h: Make evaluateInWorld public and exported.

* inspector/InspectorFrontendAPIDispatcher.h:
* inspector/InspectorFrontendAPIDispatcher.cpp:
(WebCore::InspectorFrontendAPIDispatcher::evaluateOrQueueExpression):
(WebCore::InspectorFrontendAPIDispatcher::evaluateExpression):
Evaluate and pass along the result whether it's a value or exception.

* inspector/InspectorFrontendClientLocal.h:
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::evaluationResultToBoolean):
(WebCore::InspectorFrontendClientLocal::isDebuggingEnabled):
(WebCore::InspectorFrontendClientLocal::isTimelineProfilingEnabled):
(WebCore::InspectorFrontendClientLocal::isProfilingJavaScript):
Refactor the common code to take an EvaluationResult and figure out if the value is true or falsy.

* platform/Logging.h: Add an Inspector logging channel, for logging errors.

Source/WebKit:

The underlying method used for frontend expression evaluations is
ScriptController::evaluateIgnoringExceptions. This method calls
evaluateInWorld and returns nullopt if an exception happens.

Switch to using evaluateInWorld directly and using the existing ValueOrException
type from in WebCore. Change our EvaluationResult type to use ValueOrException
in place of JSC::JSValue. ValueOrException is Expected<JSC::JSValue, ExceptionDetails>
so this is exposing more error information in addition to the JSC::JSValue.

* Platform/Logging.h: Add 'Inspector' log channel for WebKit.framework.

* WebProcess/Inspector/WebInspectorUIExtensionController.cpp:
(WebKit::WebInspectorUIExtensionController::WebInspectorUIExtensionController):
(WebKit::WebInspectorUIExtensionController::~WebInspectorUIExtensionController):
Remove unnecessary debugging code that was accidentally left in/commented out.

* WebProcess/Inspector/WebInspectorUIExtensionController.h:
(WebKit::WebInspectorUIExtensionController::parseInspectorExtensionErrorFromResult): Deleted.
(WebKit::WebInspectorUIExtensionController::parseInspectorExtensionErrorFromEvaluationResult): Added.
(WebKit::WebInspectorUIExtensionController::registerExtension):
(WebKit::WebInspectorUIExtensionController::unregisterExtension):
Adapt to using the new result type. Use the InspectorExtensionID type where possible.

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

2 months ago[LFC][Floats] FloatAvoider does not need to keep a pointer to Layout::Box around.
zalan@apple.com [Fri, 4 Dec 2020 20:53:59 +0000 (20:53 +0000)]
[LFC][Floats] FloatAvoider does not need to keep a pointer to Layout::Box around.
https://bugs.webkit.org/show_bug.cgi?id=219529

Reviewed by Antti Koivisto.

* layout/floats/FloatAvoider.cpp:
(WebCore::Layout::FloatAvoider::FloatAvoider):
* layout/floats/FloatAvoider.h:
(WebCore::Layout::FloatAvoider::isLeftAligned const):
(WebCore::Layout::FloatAvoider::isFloatingBox const):
(WebCore::Layout::FloatAvoider::layoutBox const): Deleted.
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::positionForFloat const):
(WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const):

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

2 months agoGraphicsContextGLOpenGL: m_depthBuffer and m_stencilBuffer are used only if USE(OPENG...
Hironori.Fujii@sony.com [Fri, 4 Dec 2020 20:38:37 +0000 (20:38 +0000)]
GraphicsContextGLOpenGL: m_depthBuffer and m_stencilBuffer are used only if USE(OPENGL_ES)
https://bugs.webkit.org/show_bug.cgi?id=219422

Reviewed by Don Olmstead.

* platform/graphics/opengl/GraphicsContextGLOpenGL.h:
Conditioned out m_depthBuffer and m_stencilBuffer with #if !USE(ANGLE) && USE(OPENGL_ES).
* platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp:
(WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
Removed code to generate m_depthBuffer and m_stencilBuffer because
this code is only for USE(ANGLE).
(WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL):

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

2 months agoAdd safety checks to xsltParamArrayFromParameterMap()
ddkilzer@apple.com [Fri, 4 Dec 2020 20:10:22 +0000 (20:10 +0000)]
Add safety checks to xsltParamArrayFromParameterMap()
<https://webkit.org/b/219407>
<rdar://problem/71853069>

Reviewed by Darin Adler.

Source/WebCore:

* xml/XSLTProcessorLibxslt.cpp:
(WebCore::xsltParamArrayFromParameterMap):

Source/WTF:

* wtf/PlatformHave.h:
(HAVE_LIBXSLT_FIX_FOR_RADAR_71864140): Add.

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

2 months ago[LFC][IFC] Move float constraint logic from initialConstraintsForLine to a dedicated...
zalan@apple.com [Fri, 4 Dec 2020 20:05:59 +0000 (20:05 +0000)]
[LFC][IFC] Move float constraint logic from initialConstraintsForLine to a dedicated function
https://bugs.webkit.org/show_bug.cgi?id=219526

Reviewed by Antti Koivisto.

We are going to call this new function whenever the line stretches vertically and not just once at the very beginning.

* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::floatConstraints const):
(WebCore::Layout::LineBuilder::initialConstraintsForLine const):
(WebCore::Layout::LineBuilder::initialConstraintsForLine): Deleted.
* layout/inlineformatting/InlineLineBuilder.h:
(WebCore::Layout::LineBuilder::floatingState const):

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

2 months ago[git-webkit] Use contributors.json
jbedard@apple.com [Fri, 4 Dec 2020 20:03:53 +0000 (20:03 +0000)]
[git-webkit] Use contributors.json
https://bugs.webkit.org/show_bug.cgi?id=217732
<rdar://problem/70309518>

Reviewed by Dewei Zhu.

The interaction between Git, Svn and old commits means that our canonical record of
commit authors is somewhat incomplete. contributors.json has most of the information
we are missing, we should rely on it to map non-standard author names to their canonical
names and email addresses.

Additionally, making the record of Contributors owned by the repository instead of being global
to the entire process.

* Scripts/git-webkit: Parse contributors.json and add it to a Contributor.Mapping.
* Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Bump version.
* Scripts/libraries/webkitscmpy/webkitscmpy/commit.py:
(Commit): Contributor class object no longer owns record of contributors.
* Scripts/libraries/webkitscmpy/webkitscmpy/contributor.py:
(Contributor):
(Contributor.Mapping): Dictionary mapping Contributors and their potential aliases.
(Contributor.Mapping.__init__):
(Contributor.Mapping.add): Add Contributor to mapping.
(Contributor.Mapping.create): Find or create a contributor with the specified name and email
addresses and bind it to the record of contributors.
(Contributor.from_scm_log): Leverage Contributor.Mapping provided by caller.
(Contributor.clear): Deleted.
* Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py:
(Git.__init__): Instantiate repository with existing Contributor.Mapping.
(Git.commit): Repository now owns the record of contributors.
* Scripts/libraries/webkitscmpy/webkitscmpy/local/scm.py:
(Scm.from_path): Instantiate repository with existing Contributor.Mapping.
(Scm.__init__): Ditto.
* Scripts/libraries/webkitscmpy/webkitscmpy/local/svn.py:
(Svn.__init__): Instantiate repository with existing Contributor.Mapping.
(Svn.commit): Repository now owns the record of contributors.
* Scripts/libraries/webkitscmpy/webkitscmpy/program.py:
(main): Allow caller to pass an existing record of contributors.
* Scripts/libraries/webkitscmpy/webkitscmpy/remote/scm.py:
(Scm.from_url): Instantiate repository with existing Contributor.Mapping.
(Scm.__init__): Ditto.
* Scripts/libraries/webkitscmpy/webkitscmpy/remote/svn.py:
(Svn.__init__): Instantiate repository with existing Contributor.Mapping.
(Svn.commit): Repository now owns the record of contributors.
* Scripts/libraries/webkitscmpy/webkitscmpy/scm_base.py:
(ScmBase.__init__): Instantiate repository with existing Contributor.Mapping.
* Scripts/libraries/webkitscmpy/webkitscmpy/test/commit_unittest.py:
* Scripts/libraries/webkitscmpy/webkitscmpy/test/contributor_unittest.py:
(TestContributor.test_git_log): No more global contributor record.
(TestContributor.test_git_svn_log): Ditto.
(TestContributor.test_git_no_author): Ditto.
(TestContributor.test_git_svn_no_author): Ditto.
(TestContributor.test_svn_log): Ditto.
(TestContributor.test_short_svn_log): Ditto.
(TestContributor.test_svn_patch_by_log): Ditto.
(TestContributor.test_author_mapping): Contributor record is owned by the caller of the caller
of Contributor management.
(TestContributor.test_email_mapping): Ditto.
(TestContributor.test_invalid_log): No more global contributor record.

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

2 months agoCreate API to enable/disable text interaction gestures in WKWebView
katherine_cheney@apple.com [Fri, 4 Dec 2020 19:53:50 +0000 (19:53 +0000)]
Create API to enable/disable text interaction gestures in WKWebView
https://bugs.webkit.org/show_bug.cgi?id=217784
<rdar://problem/63406241>

Reviewed by Wenson Hsieh.

Source/WebCore:

Add API to disable text selection for macOS.

* page/EventHandler.cpp:
(WebCore::EventHandler::selectClosestWordFromMouseEvent):
(WebCore::EventHandler::selectClosestContextualWordOrLinkFromMouseEvent):
(WebCore::EventHandler::handleMousePressEventDoubleClick):
(WebCore::EventHandler::handleMousePressEventTripleClick):
(WebCore::EventHandler::handleMousePressEventSingleClick):
(WebCore::EventHandler::mouseDownMayStartSelect):
Create a new function to return whether a click results in a
selection. It will always return false if text interaction is disabled.

(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::handleMouseDraggedEvent):
(WebCore::EventHandler::updateSelectionForMouseDrag):
(WebCore::EventHandler::selectCursor):
* page/EventHandler.h:
* page/Page.cpp:
(WebCore::m_textInteractionEnabled):
(WebCore::m_shouldRelaxThirdPartyCookieBlocking): Deleted.
* page/Page.h:
Store the textInteractionEnabled value in the Page so it is
accessible from the EventHandler.

(WebCore::Page::textInteractionEnabled):
(WebCore::Page::setTextInteractionEnabled):
* page/PageConfiguration.h:

Source/WebKit:

Create a new API to disable text interaction gestures in a WKWebView.
We have SPI for this for iOS, but it could be useful to other WebKit
clients and on macOS. Add the API to WKPreferences, instead of
WKWebViewConfiguration, so it can be changed on the fly.

Deprecate the SPI.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences encodeWithCoder:]):
(-[WKPreferences initWithCoder:]):
(-[WKPreferences textInteractionEnabled]):
(-[WKPreferences setTextInteractionEnabled:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration encodeWithCoder:]):
(-[WKWebViewConfiguration initWithCoder:]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _textInteractionEnabled]):
(-[WKWebViewConfiguration _setTextInteractionEnabled:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView hasSelectablePositionAtPoint:]):
(-[WKContentView pointIsNearMarkedText:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
(-[WKContentView _cascadeInteractionTintColor]):
(-[WKContentView selectForWebView:]):
(-[WKContentView selectAllForWebView:]):
Add check for textInteractionEnabled in these select*
functions because disabling text interaction should disable selection
in WKWebView.

* WebProcess/WebPage/WebPage.cpp:
Update the textInteractionEnabled value in the page when
preferences are updated.

(WebKit::WebPage::updatePreferences):

Source/WTF:

Create new WKPreference. See WebKit Changelog for details.

* Scripts/Preferences/WebPreferences.yaml:

Tools:

Add API test coverage for macOS and support for layout tests for iOS.
API tests do not support user gestures which is why iOS tests must
use WebKitTestRunner.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewDisableSelection.mm: Added.
(TEST):
(clickAndDragToSelectText):
* TestWebKitAPI/Tests/WebKitCocoa/try-text-select-with-disabled-text-interaction.html: Added.
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::cocoaResetStateToConsistentValues):
* WebKitTestRunner/TestOptions.cpp:
(WTR::TestOptions::defaults):
(WTR::TestOptions::keyTypeMapping):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::textInteractionEnabled const):

LayoutTests:

Layout test coverage for iOS.

* LayoutTests/editing/selection/ios/cannot-select-after-disabling-text-interaction-expected.txt: Added.
* LayoutTests/editing/selection/ios/cannot-select-after-disabling-text-interaction.html: Added.

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

2 months agoMore FALLBACK_PLATFORM adoption
commit-queue@webkit.org [Fri, 4 Dec 2020 19:51:39 +0000 (19:51 +0000)]
More FALLBACK_PLATFORM adoption
https://bugs.webkit.org/show_bug.cgi?id=219545

Patch by Adam Roben <aroben@apple.com> on 2020-12-04
Reviewed by Tim Horton.

PerformanceTests:

* MediaTime/Configurations/SDKVariant.xcconfig:
WK_EMPTY_$(THIS_IS_NOT_EMPTY) evaluates to the empty string, not to
NO.

Source/bmalloc:

* Configurations/SDKVariant.xcconfig:
WK_EMPTY_$(THIS_IS_NOT_EMPTY) evaluates to the empty string, not to
NO.

Source/JavaScriptCore:

* Configurations/SDKVariant.xcconfig:
WK_EMPTY_$(THIS_IS_NOT_EMPTY) evaluates to the empty string, not to
NO.

Source/ThirdParty:

* gtest/xcode/Config/SDKVariant.xcconfig:
WK_EMPTY_$(THIS_IS_NOT_EMPTY) evaluates to the empty string, not to
NO.

Source/ThirdParty/ANGLE:

* Configurations/SDKVariant.xcconfig:
WK_EMPTY_$(THIS_IS_NOT_EMPTY) evaluates to the empty string, not to
NO.

Source/ThirdParty/libwebrtc:

* Configurations/SDKVariant.xcconfig:
WK_EMPTY_$(THIS_IS_NOT_EMPTY) evaluates to the empty string, not to
NO.

Source/WebCore:

* Configurations/SDKVariant.xcconfig:
WK_EMPTY_$(THIS_IS_NOT_EMPTY) evaluates to the empty string, not to
NO.

Source/WebCore/PAL:

* Configurations/SDKVariant.xcconfig:
WK_EMPTY_$(THIS_IS_NOT_EMPTY) evaluates to the empty string, not to
NO.

Source/WebInspectorUI:

* Configurations/SDKVariant.xcconfig:
WK_EMPTY_$(THIS_IS_NOT_EMPTY) evaluates to the empty string, not to
NO.

Source/WebKit:

* Configurations/SDKVariant.xcconfig:
WK_EMPTY_$(THIS_IS_NOT_EMPTY) evaluates to the empty string, not to
NO.

Source/WebKitLegacy/mac:

* Configurations/SDKVariant.xcconfig:
WK_EMPTY_$(THIS_IS_NOT_EMPTY) evaluates to the empty string, not to
NO.

Source/WTF:

* Configurations/SDKVariant.xcconfig:
WK_EMPTY_$(THIS_IS_NOT_EMPTY) evaluates to the empty string, not to
NO.

Tools:

* DumpRenderTree/Scripts/check-xcfilelists.sh:
* TestWebKitAPI/Scripts/check-xcfilelists.sh:
* WebKitTestRunner/Scripts/check-xcfilelists.sh:
Use FALLBACK_PLATFORM if it's defined.

* ContentExtensionTester/Configurations/SDKVariant.xcconfig:
* DumpRenderTree/mac/Configurations/SDKVariant.xcconfig:
* ImageDiff/cg/Configurations/SDKVariant.xcconfig:
* MiniBrowser/Configurations/SDKVariant.xcconfig:
* MobileMiniBrowser/Configurations/SDKVariant.xcconfig:
* TestWebKitAPI/Configurations/SDKVariant.xcconfig:
* WebEditingTester/Configurations/SDKVariant.xcconfig:
* WebKitTestRunner/Configurations/SDKVariant.xcconfig:
* lldb/lldbWebKitTester/Configurations/SDKVariant.xcconfig:
WK_EMPTY_$(THIS_IS_NOT_EMPTY) evaluates to the empty string, not to
NO.

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

2 months ago[GPU Process] Share the NativeImage with GPU Process through a ShareableBitmap
said@apple.com [Fri, 4 Dec 2020 19:47:56 +0000 (19:47 +0000)]
[GPU Process] Share the NativeImage with GPU Process through a ShareableBitmap
https://bugs.webkit.org/show_bug.cgi?id=218934

Reviewed by Tim Horton.

Source/WebCore:

Delete a NativeImage constructor and a create method which were used by
the deleted IPC coders of the NativeImage.

* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/NativeImage.cpp:
(WebCore::NativeImage::create):
(WebCore::NativeImage::NativeImage):
* platform/graphics/NativeImage.h:
* platform/graphics/NativeImageReference.h: Removed.

Source/WebKit:

Instead of relying on the IPC coders to transfer the NativeImage to the
GPUP, we are going to move this logic to RemoteResourceCacheProxy and
RemoteRenderingBackend. The NativeImage will be transfered as a handle of
ShareableBitamp and a renderingResourceIdentifier.

* GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::cacheNativeImage):
* GPUProcess/graphics/RemoteRenderingBackend.h:
* GPUProcess/graphics/RemoteRenderingBackend.messages.in:
* Shared/ShareableBitmap.h:
(WebKit::ShareableBitmap::createPlatformImage):
Add this helper function and avoid adding directive code in many places.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<Ref<NativeImage>>::encode): Deleted.
(IPC::ArgumentCoder<Ref<NativeImage>>::decode): Deleted.
* Shared/WebCoreArgumentCoders.h:
* WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp:
(WebKit::ImageBufferShareableBitmapBackend::copyNativeImage const):
* WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
(WebKit::RemoteRenderingBackendProxy::cacheNativeImage):
* WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h:
* WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp:
(WebKit::createShareableBitmapFromNativeImage):
(WebKit::RemoteResourceCacheProxy::cacheNativeImage):

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

2 months ago[GTK] Gardening wheel failures and timeouts
lmoura@igalia.com [Fri, 4 Dec 2020 19:44:52 +0000 (19:44 +0000)]
[GTK] Gardening wheel failures and timeouts

Unreviewed test gardening.

* platform/gtk/TestExpectations:

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

2 months agoMake dump-as-markup.js dump newlines within text as "\n"
darin@apple.com [Fri, 4 Dec 2020 19:43:08 +0000 (19:43 +0000)]
Make dump-as-markup.js dump newlines within text as "\n"
https://bugs.webkit.org/show_bug.cgi?id=216749

Reviewed by Anders Carlsson.

* editing/deleting/5115601-expected.txt:
* editing/deleting/5206311-2-expected.txt:
* editing/deleting/delete-3959464-fix-expected.txt:
* editing/deleting/delete-4038408-fix-expected.txt:
* editing/deleting/delete-across-editable-content-boundaries-2-expected.txt:
* editing/deleting/delete-across-editable-content-boundaries-3-expected.txt:
* editing/deleting/delete-at-paragraph-boundaries-001-expected.txt:
* editing/deleting/delete-br-011-expected.txt:
* editing/deleting/delete-br-012-expected.txt:
* editing/deleting/delete-br-in-last-table-cell-expected.txt:
* editing/deleting/delete-image-followed-by-two-br-expected.txt:
* editing/deleting/delete-line-break-between-paragraphs-with-same-style-expected.txt:
* editing/deleting/delete-mixed-editable-content-001-expected.txt:
* editing/deleting/delete-table-cell-contents-expected.txt:
* editing/deleting/delete-uneditable-style-expected.txt:
* editing/deleting/forward-delete-empty-table-cell-expected.txt:
* editing/deleting/merge-div-from-span-with-style-expected.txt:
* editing/deleting/merge-div-with-inline-style-expected.txt:
* editing/deleting/merge-paragraph-contatining-noneditable-expected.txt:
* editing/deleting/merge-paragraph-from-address-expected.txt:
* editing/deleting/merge-paragraph-from-h6-expected.txt:
* editing/deleting/merge-paragraph-from-h6-with-style-2-expected.txt:
* editing/deleting/merge-paragraph-from-h6-with-style-expected.txt:
* editing/deleting/merge-paragraph-from-listing-expected.txt:
* editing/deleting/merge-paragraph-from-p-with-style-2-expected.txt:
* editing/deleting/merge-paragraph-from-p-with-style-3-expected.txt:
* editing/deleting/merge-paragraph-from-p-with-style-expected.txt:
* editing/deleting/merge-paragraph-from-span-with-multiple-text-decoration-expected.txt:
* editing/deleting/merge-paragraph-from-span-with-style-expected.txt:
* editing/deleting/merge-paragraph-into-blockquote-expected.txt:
* editing/deleting/merge-paragraph-into-h1-expected.txt:
* editing/deleting/merge-paragraph-into-h1-with-dir-2-expected.txt:
* editing/deleting/merge-paragraph-into-h1-with-dir-expected.txt:
* editing/deleting/merge-paragraph-into-h1-with-style-expected.txt:
* editing/deleting/merge-paragraph-into-pre-expected.txt:
* editing/deleting/merge-paragraph-with-style-from-rule-expected.txt:
* editing/deleting/merge-paragraphs-with-transparent-background-expected.txt:
* editing/deleting/paragraph-in-preserveNewline-expected.txt:
* editing/deleting/whitespace-pre-1-expected.txt:
* editing/execCommand/change-list-type-expected.txt:
* editing/execCommand/contenteditable-justify-next-paragraph-expected.txt:
* editing/execCommand/crash-indenting-list-item-expected.txt:
* editing/execCommand/crash-on-enter-in-contentEditable-list-expected.txt:
* editing/execCommand/delete-line-and-insert-text-in-font-inside-blockquote-expected.txt:
* editing/execCommand/delete-selection-has-style-expected.txt:
* editing/execCommand/format-block-contenteditable-false-expected.txt:
* editing/execCommand/format-block-expected.txt:
* editing/execCommand/format-block-from-range-selection-expected.txt:
* editing/execCommand/format-block-multiple-paragraphs-expected.txt:
* editing/execCommand/format-block-multiple-paragraphs-in-pre-expected.txt:
* editing/execCommand/format-block-table-expected.txt:
* editing/execCommand/format-block-with-braces-expected.txt:
* editing/execCommand/indent-images-2-expected.txt:
* editing/execCommand/indent-images-3-expected.txt:
* editing/execCommand/indent-pre-expected.txt:
* editing/execCommand/indent-pre-list-expected.txt:
* editing/execCommand/indent-pre-paragraphs-expected.txt:
* editing/execCommand/insert-list-in-noneditable-list-parent-expected.txt:
* editing/execCommand/insert-list-nested-with-orphaned-expected.txt:
* editing/execCommand/insert-nested-lists-in-table-expected.txt:
* editing/execCommand/insert-nested-lists-with-pre-expected.txt:
* editing/execCommand/insert-paragraph-twice-at-end-of-block-styled-listitem-expected.txt:
* editing/execCommand/insert-paragraph-twice-at-end-of-custom-listitem-expected.txt:
* editing/execCommand/insert-unordered-list-in-shadow-tree-expected.txt:
* editing/execCommand/outdent-selection-expected.txt:
* editing/execCommand/overtype-expected.txt:
* editing/execCommand/remove-format-textdecoration-in-iframe-expected.txt:
* editing/execCommand/remove-formatting-expected.txt:
* editing/execCommand/remove-list-from-multi-list-items-expected.txt:
* editing/execCommand/switch-list-type-with-inner-list-expected.txt:
* editing/execCommand/switch-list-type-with-orphaned-li-expected.txt:
* editing/find/find-and-replace-at-editing-boundary-expected.txt:
* editing/find/find-and-replace-basic-expected.txt:
* editing/find/find-and-replace-in-subframes-expected.txt:
* editing/find/find-and-replace-no-matches-expected.txt:
* editing/find/find-and-replace-noneditable-matches-expected.txt:
* editing/inserting/insert-3786362-fix-expected.txt:
* editing/inserting/insert-3907422-fix-expected.txt:
* editing/inserting/insert-div-021-expected.txt:
* editing/inserting/insert-paragraph-after-tab-span-and-text-expected.txt:
* editing/inserting/insert-paragraph-before-space-expected.txt:
* editing/inserting/insert-paragraph-between-text-expected.txt:
* editing/inserting/insert-paragraph-in-designmode-document-expected.txt:
* editing/inserting/insert-paragraph-separator-at-break-expected.txt:
* editing/inserting/insert-paragraph-with-font-and-background-color-expected.txt:
* editing/mac/selection/double-click-and-drag-over-anchor-to-select-expected.txt:
* editing/pasteboard/avoid-copying-body-with-background-expected.txt:
* editing/pasteboard/block-wrappers-necessary-expected.txt:
* editing/pasteboard/cleanup-on-move-expected.txt:
* editing/pasteboard/copy-image-with-alt-text-expected.txt:
* editing/pasteboard/copy-null-characters-expected.txt:
* editing/pasteboard/copy-paste-across-shadow-boundaries-with-style-2-expected.txt:
* editing/pasteboard/copy-paste-bidi-expected.txt:
* editing/pasteboard/copy-paste-content-starting-and-ending-canvas-expected.txt:
* editing/pasteboard/copy-paste-converts-fixed-expected.txt:
* editing/pasteboard/copy-paste-converts-sticky-expected.txt:
* editing/pasteboard/copy-paste-doesnt-convert-sticky-and-fixed-during-partial-copy-expected.txt:
* editing/pasteboard/copy-paste-inserts-clearing-div-expected.txt:
* editing/pasteboard/copy-paste-with-important-rules-expected.txt:
* editing/pasteboard/copy-paste-wraps-position-absolute-expected.txt:
* editing/pasteboard/copy-text-with-backgroundcolor-expected.txt:
* editing/pasteboard/display-block-on-spans-expected.txt:
* editing/pasteboard/drag-drop-list-expected.txt:
* editing/pasteboard/drag-list-item-expected.txt:
* editing/pasteboard/insert-text-decoration-expected.txt:
* editing/pasteboard/interchange-newline-3-expected.txt:
* editing/pasteboard/interchange-newline-4-expected.txt:
* editing/pasteboard/line-feed-between-br-and-b-should-not-reorder-pasted-content-expected.txt:
* editing/pasteboard/nested-blocks-with-text-area-expected.txt:
* editing/pasteboard/nested-blocks-with-text-field-expected.txt:
* editing/pasteboard/paste-4039777-fix-expected.txt:
* editing/pasteboard/paste-at-end-of-node-followed-by-inline-element-expected.txt:
* editing/pasteboard/paste-before-tab-span-expected.txt:
* editing/pasteboard/paste-blockquote-into-blockquote-3-expected.txt:
* editing/pasteboard/paste-delete-insertion-position-skip-paragraph-expected.txt:
* editing/pasteboard/paste-list-001-expected.txt:
* editing/pasteboard/paste-noscript-xhtml-expected.txt:
* editing/pasteboard/paste-table-001-expected.txt:
* editing/pasteboard/paste-table-cells-expected.txt:
* editing/pasteboard/paste-table-with-unrendered-text-nodes-expected.txt:
* editing/pasteboard/paste-text-001-expected.txt:
* editing/pasteboard/paste-text-005-expected.txt:
* editing/pasteboard/paste-text-006-expected.txt:
* editing/pasteboard/paste-text-007-expected.txt:
* editing/pasteboard/paste-text-010-expected.txt:
* editing/pasteboard/paste-text-011-expected.txt:
* editing/pasteboard/paste-text-015-expected.txt:
* editing/pasteboard/paste-text-017-expected.txt:
* editing/pasteboard/paste-text-018-expected.txt:
* editing/pasteboard/paste-text-at-tabspan-001-expected.txt:
* editing/pasteboard/paste-text-at-tabspan-002-expected.txt:
* editing/pasteboard/paste-text-with-style-expected.txt:
* editing/pasteboard/pasting-into-h6-should-not-nest-h6-expected.txt:
* editing/pasteboard/pasting-into-p-should-not-nest-p-expected.txt:
* editing/pasteboard/simplfiying-markup-should-not-strip-content-expected.txt:
* editing/pasteboard/style-from-rules-expected.txt:
* editing/pasteboard/testcase-9507-expected.txt:
* editing/selection/4895428-1-expected.txt:
* editing/selection/4895428-4-expected.txt:
* editing/selection/dump-as-markup-expected.txt:
* editing/selection/dump-as-markup-form-text-expected.txt:
* editing/selection/extend-selection-backward-at-beginning-of-line-by-sentence-granularity-expected.txt:
* editing/selection/home-inside-noneditable-table-expected.txt:
* editing/selection/modify-backward-inline-block-containers-expected.txt:
* editing/selection/move-between-lines-of-different-editabilities-expected.txt:
* editing/selection/move-by-line-006-expected.txt:
* editing/selection/move-selection-backward-at-beginning-of-line-by-sentence-granularity-expected.txt:
* editing/selection/move-up-into-wrapped-line-expected.txt:
* editing/selection/shift-click-includes-existing-selection-expected.txt:
* editing/selection/user-select-all-with-shift-expected.txt:
* editing/spelling/text-replacement-after-typing-to-word-expected.txt:
* editing/spelling/text-replacement-first-word-second-line-expected.txt:
* editing/style/apply-font-size-to-multiple-nodes-expected.txt:
* editing/unsupported-content/table-delete-001-expected.txt:
* editing/unsupported-content/table-delete-003-expected.txt:
* fast/dom/HTMLMeterElement/meter-element-markup-expected.txt:
* fast/events/5056619-expected.txt:
* fast/parser/attributes-on-close-script-expected.txt:
* fast/parser/document-write-svg-cdata-expected.txt:
* fast/parser/foster-parent-under-template-expected.txt:
* fast/parser/math-options-crash-expected.txt:
* fast/parser/object-with-textarea-fallback-expected.txt:
* fast/parser/residual-style-dom-expected.txt:
* fast/parser/style-in-create-contextual-fragment-expected.txt:
* fast/parser/style-in-create-contextual-fragment-head-expected.txt:
* fast/table/table-create-tbody-existing-tbody-expected.txt:
* fast/table/table-create-tbody-expected.txt:
* fast/table/table-create-tbody-multiple-tbody-expected.txt:
* platform/gtk/editing/deleting/delete-emoji-1-expected.txt:
* platform/gtk/editing/deleting/delete-emoji-expected.txt:
* platform/ios-wk1/editing/deleting/delete-emoji-expected.txt:
* platform/ios-wk2/editing/execCommand/indent-pre-expected.txt:
* platform/ios/editing/deleting/delete-3959464-fix-expected.txt:
* platform/ios/editing/deleting/delete-across-editable-content-boundaries-2-expected.txt:
* platform/ios/editing/deleting/delete-across-editable-content-boundaries-3-expected.txt:
* platform/ios/editing/deleting/delete-emoji-1-expected.txt:
* platform/ios/editing/deleting/delete-emoji-2-expected.txt:
* platform/ios/editing/deleting/delete-emoji-3-expected.txt:
* platform/ios/editing/deleting/delete-emoji-4-expected.txt:
* platform/ios/editing/deleting/delete-emoji-5-expected.txt:
* platform/ios/editing/deleting/delete-emoji-6-expected.txt:
* platform/ios/editing/deleting/delete-emoji-7-expected.txt:
* platform/ios/editing/deleting/delete-emoji-8-expected.txt:
* platform/ios/editing/deleting/delete-emoji-9-expected.txt:
* platform/ios/editing/deleting/delete-emoji-expected.txt:
* platform/ios/editing/execCommand/delete-line-and-insert-text-in-font-inside-blockquote-expected.txt:
* platform/ios/editing/pasteboard/paste-text-001-expected.txt:
* platform/ios/editing/pasteboard/paste-text-010-expected.txt:
* platform/ios/editing/pasteboard/paste-text-at-tabspan-001-expected.txt:
* platform/mac/editing/caret/emoji-expected.txt:
* platform/mac/editing/deleting/delete-emoji-1-expected.txt:
* platform/mac/editing/deleting/delete-emoji-2-expected.txt:
* platform/mac/editing/deleting/delete-emoji-3-expected.txt:
* platform/mac/editing/deleting/delete-emoji-4-expected.txt:
* platform/mac/editing/deleting/delete-emoji-5-expected.txt:
* platform/mac/editing/deleting/delete-emoji-6-expected.txt:
* platform/mac/editing/deleting/delete-emoji-7-expected.txt:
* platform/mac/editing/deleting/delete-emoji-8-expected.txt:
* platform/mac/editing/deleting/delete-emoji-9-expected.txt:
* platform/mac/editing/deleting/delete-emoji-expected.txt:
* platform/win/editing/deleting/delete-br-011-expected.txt:
* platform/win/editing/execCommand/indent-pre-expected.txt:
* platform/wincairo/editing/deleting/delete-emoji-1-expected.txt:
* platform/wincairo/editing/deleting/delete-emoji-2-expected.txt:
* platform/wincairo/editing/deleting/delete-emoji-3-expected.txt:
* platform/wincairo/editing/deleting/delete-emoji-4-expected.txt:
* platform/wincairo/editing/deleting/delete-emoji-5-expected.txt:
* platform/wincairo/editing/deleting/delete-emoji-6-expected.txt:
* platform/wincairo/editing/deleting/delete-emoji-7-expected.txt:
* platform/wincairo/editing/deleting/delete-emoji-8-expected.txt:
* platform/wincairo/editing/deleting/delete-emoji-9-expected.txt:
* platform/wincairo/editing/deleting/delete-emoji-expected.txt:
* platform/wincairo/editing/execCommand/indent-pre-expected.txt:
Updated to expect "\n".

* resources/dump-as-markup.js:
(Markup._getMarkupForTextNode): Convert newlines into "\n".

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

2 months ago[macOS] Deny mach-lookup to the service 'com.apple.print.normalizerd' in the WebConte...
pvollan@apple.com [Fri, 4 Dec 2020 19:21:39 +0000 (19:21 +0000)]
[macOS] Deny mach-lookup to the service 'com.apple.print.normalizerd' in the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=219541
<rdar://problem/68878604>

Reviewed by Darin Adler.

On macOS, deny mach-lookup to the service 'com.apple.print.normalizerd' in the WebContent process, since there are no
reports of this being used.

No new tests, since the result will depend on the macOS version.

* WebProcess/com.apple.WebProcess.sb.in:

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

2 months ago[iOS] Provide a context menu action to perform accessibility image extraction
drousso@apple.com [Fri, 4 Dec 2020 18:56:48 +0000 (18:56 +0000)]
[iOS] Provide a context menu action to perform accessibility image extraction
https://bugs.webkit.org/show_bug.cgi?id=219524
<rdar://problem/69969613>

Reviewed by Wenson Hsieh.

* UIProcess/API/Cocoa/_WKElementAction.h:
* UIProcess/API/Cocoa/_WKElementAction.mm:
(+[_WKElementAction _elementActionWithType:customTitle:assistant:]):
(+[_WKElementAction imageForElementActionType:]):
(elementActionTypeToUIActionIdentifier):
(uiActionIdentifierToElementActionType):
Add a new `_WKElementActionTypeImageExtraction` enum type with a default icon and title.

* UIProcess/ios/WKActionSheetAssistant.h:
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
(-[WKActionSheetAssistant defaultActionsForImageSheet:]):
(-[WKActionSheetAssistant handleElementActionWithType:element:needsInteraction:]):
If the `WKActionSheetAssistantDelegate` allows it, add a `_WKElementActionTypeImageExtraction`
action for images (including those inside links). Call out to the `WKActionSheetAssistantDelegate`
when handling the action.

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

2 months ago[MSE] Move track buffer management from SourceBuffer to SourceBufferPrivate
peng.liu6@apple.com [Fri, 4 Dec 2020 18:12:18 +0000 (18:12 +0000)]
[MSE] Move track buffer management from SourceBuffer to SourceBufferPrivate
https://bugs.webkit.org/show_bug.cgi?id=219332

Reviewed by Daniel Bates.

Source/WebCore:

Currently, the `SourceBuffer` class deals with both the DOM related tasks (providing
Javascript interfaces, firing events, handling object properties, etc.) and track
buffer management. This patch moves the track buffer management from `SourceBuffer`
to `SourceBufferPrivate`. The purpose of this change is to support running the track
buffer management in the GPU process so that the callbacks from a media parser regarding
a new sample is parsed does not need to cross the process boundary (`SourceBufferPrivate`
will run in the GPU process). We have to update the interface `SourceBufferPrivateClient`
accordingly.

When running the track buffer management in the `SourceBuffer` class, we can get
some information related to `MediaSource` directly, such as `isSeeking`, `duration`,
and `currentMediaTime`. However, after moving it to `SourceBufferPrivate`, we have to
get the information from the corresponding `MediaSourcePrivate`. This patch includes
some changes for that.

No new tests because this patch does not want to introduce any behavior change.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::seekToTime):
(WebCore::MediaSource::completeSeek):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::SourceBuffer):
(WebCore::SourceBuffer::~SourceBuffer):
(WebCore::SourceBuffer::buffered const):
(WebCore::SourceBuffer::timestampOffset const):
(WebCore::SourceBuffer::setTimestampOffset):
(WebCore::SourceBuffer::setAppendWindowStart):
(WebCore::SourceBuffer::setAppendWindowEnd):
(WebCore::SourceBuffer::resetParserState):
(WebCore::SourceBuffer::abort):
(WebCore::SourceBuffer::changeType):
(WebCore::SourceBuffer::highestPresentationTimestamp const):
(WebCore::SourceBuffer::readyStateChanged):
(WebCore::SourceBuffer::removedFromMediaSource):
(WebCore::SourceBuffer::seekToTime):
(WebCore::SourceBuffer::appendBufferInternal):
(WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
(WebCore::SourceBuffer::removeTimerFired):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
(WebCore::SourceBuffer::validateInitializationSegment):
(WebCore::SourceBuffer::sourceBufferPrivateAppendError):
(WebCore::SourceBuffer::appendError):
(WebCore::SourceBuffer::trySignalAllSamplesEnqueued):
(WebCore::SourceBuffer::sourceBufferPrivateDidParseSample):
(WebCore::SourceBuffer::sourceBufferPrivateDurationChanged):
(WebCore::SourceBuffer::sourceBufferPrivateDidDropSample):
(WebCore::SourceBuffer::sourceBufferPrivateStreamEndedWithDecodeError):
(WebCore::SourceBuffer::extraMemoryCost const):
(WebCore::SourceBuffer::bufferedSamplesForTrackID):
(WebCore::SourceBuffer::setMode):
(WebCore::SourceBuffer::setShouldGenerateTimestamps):
(WebCore::SourceBuffer::isBufferedDirty const):
(WebCore::SourceBuffer::setBufferedDirty):
(): Deleted.
(WebCore::SourceBuffer::TrackBuffer::TrackBuffer): Deleted.
(WebCore::SourceBuffer::TrackBuffer::enqueueDiscontinuityBoundary): Deleted.
(WebCore::SourceBuffer::sourceBufferPrivateFastSeekTimeForMediaTime): Deleted.
(WebCore::decodeTimeComparator): Deleted.
(WebCore::removeSamplesFromTrackBuffer): Deleted.
(WebCore::SourceBuffer::removeCodedFrames): Deleted.
(WebCore::SourceBuffer::evictCodedFrames): Deleted.
(WebCore::SampleLessThanComparator::operator()): Deleted.
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Deleted.
(WebCore::SourceBuffer::sourceBufferPrivateReenqueSamples): Deleted.
(WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples): Deleted.
(WebCore::SourceBuffer::provideMediaData): Deleted.
(WebCore::SourceBuffer::updateMinimumUpcomingPresentationTime): Deleted.
(WebCore::SourceBuffer::resetMinimumUpcomingPresentationTime): Deleted.
(WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued): Deleted.
(WebCore::SourceBuffer::reenqueueMediaForTime): Deleted.
(WebCore::SourceBuffer::didDropSample): Deleted.
(WebCore::SourceBuffer::updateBufferedFromTrackBuffers): Deleted.
* Modules/mediasource/SourceBuffer.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/MediaSourcePrivate.h:
(WebCore::MediaSourcePrivate::setIsSeeking):
(WebCore::MediaSourcePrivate::isSeeking const):
* platform/graphics/SourceBufferPrivate.cpp: Added.
(WebCore::SourceBufferPrivate::TrackBuffer::TrackBuffer):
(WebCore::enqueueDiscontinuityBoundary):
(WebCore::SourceBufferPrivate::SourceBufferPrivate):
(WebCore::SourceBufferPrivate::resetTimestampOffsetInTrackBuffers):
(WebCore::SourceBufferPrivate::resetTrackBuffers):
(WebCore::SourceBufferPrivate::highestPresentationTimestamp const):
(WebCore::SourceBufferPrivate::updateBufferedFromTrackBuffers):
(WebCore::SourceBufferPrivate::reenqueSamples):
(WebCore::SourceBufferPrivate::seekToTime):
(WebCore::SourceBufferPrivate::clearTrackBuffers):
(WebCore::SourceBufferPrivate::bufferedSamplesForTrackID):
(WebCore::SourceBufferPrivate::fastSeekTimeForMediaTime):
(WebCore::SourceBufferPrivate::updateMinimumUpcomingPresentationTime):
(WebCore::SourceBufferPrivate::trySignalAllSamplesInTrackEnqueued):
(WebCore::SourceBufferPrivate::provideMediaData):
(WebCore::SourceBufferPrivate::reenqueueMediaForTime):
(WebCore::SourceBufferPrivate::reenqueueMediaIfNeeded):
(WebCore::decodeTimeComparator):
(WebCore::removeSamplesFromTrackBuffer):
(WebCore::SourceBufferPrivate::removeCodedFrames):
(WebCore::SourceBufferPrivate::evictCodedFrames):
(WebCore::SourceBufferPrivate::totalTrackBufferSizeInBytes const):
(WebCore::SourceBufferPrivate::addTrackBuffer):
(WebCore::SourceBufferPrivate::updateTrackIds):
(WebCore::SourceBufferPrivate::setAllTrackBuffersNeedRandomAccess):
(WebCore::SourceBufferPrivate::didReceiveInitializationSegment):
(WebCore::SourceBufferPrivate::validateInitializationSegment):
(WebCore::SourceBufferPrivate::didReceiveSample):
* platform/graphics/SourceBufferPrivate.h:
(WebCore::SourceBufferPrivate::setActive):
(WebCore::SourceBufferPrivate::setClient):
(WebCore::SourceBufferPrivate::setIsAttached):
(WebCore::SourceBufferPrivate::setCurrentTimeFudgeFactor):
(WebCore::SourceBufferPrivate::setAppendWindowStart):
(WebCore::SourceBufferPrivate::setAppendWindowEnd):
(WebCore::SourceBufferPrivate::bufferFull const):
(WebCore::SourceBufferPrivate::buffered const):
(WebCore::SourceBufferPrivate::isBufferedDirty const):
(WebCore::SourceBufferPrivate::setBufferedDirty):
(WebCore::SourceBufferPrivate::timestampOffset const):
(WebCore::SourceBufferPrivate::setTimestampOffset):
(WebCore::SourceBufferPrivate::startChangingType):
(WebCore::SourceBufferPrivate::setShouldGenerateTimestamps):
(WebCore::SourceBufferPrivate::setMode):
(WebCore::SourceBufferPrivate::setGroupStartTimestamp):
(WebCore::SourceBufferPrivate::setGroupStartTimestampToEndTimestamp):
(WebCore::SourceBufferPrivate::isActive const):
(WebCore::SourceBufferPrivate::isSeeking const):
(WebCore::SourceBufferPrivate::currentMediaTime const):
(WebCore::SourceBufferPrivate::duration const):
(WebCore::SourceBufferPrivate::flush):
(WebCore::SourceBufferPrivate::enqueueSample):
(WebCore::SourceBufferPrivate::allSamplesInTrackEnqueued):
(WebCore::SourceBufferPrivate::isReadyForMoreSamples):
(WebCore::SourceBufferPrivate::notifyClientWhenReadyForMoreSamples):
(WebCore::SourceBufferPrivate::canSetMinimumUpcomingPresentationTime const):
(WebCore::SourceBufferPrivate::setMinimumUpcomingPresentationTime):
(WebCore::SourceBufferPrivate::clearMinimumUpcomingPresentationTime):
* platform/graphics/SourceBufferPrivateClient.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::duration const):
(WebCore::MediaSourcePrivateAVFObjC::currentMediaTime const):
(WebCore::MediaSourcePrivateAVFObjC::duration): Deleted.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didParseInitializationData):
(WebCore::SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::removedFromMediaSource):
(WebCore::SourceBufferPrivateAVFObjC::setActive):
(WebCore::SourceBufferPrivateAVFObjC::isActive const):
(WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples):
(WebCore::SourceBufferPrivateAVFObjC::isSeeking const):
(WebCore::SourceBufferPrivateAVFObjC::currentMediaTime const):
(WebCore::SourceBufferPrivateAVFObjC::duration const):
(WebCore::SourceBufferPrivateAVFObjC::setVideoLayer):
(WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession):
(WebCore::SourceBufferPrivateAVFObjC::setClient): Deleted.
(WebCore::SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime): Deleted.
* platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp:
(WebCore::MediaSourcePrivateGStreamer::duration const):
(WebCore::MediaSourcePrivateGStreamer::currentMediaTime const):
* platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h:
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::append):
(WebCore::SourceBufferPrivateGStreamer::removedFromMediaSource):
(WebCore::SourceBufferPrivateGStreamer::notifyReadyForMoreSamples):
(WebCore::SourceBufferPrivateGStreamer::setActive):
(WebCore::SourceBufferPrivateGStreamer::isActive const):
(WebCore::SourceBufferPrivateGStreamer::didReceiveInitializationSegment):
(WebCore::SourceBufferPrivateGStreamer::didReceiveSample):
(WebCore::SourceBufferPrivateGStreamer::didReceiveAllPendingSamples):
(WebCore::SourceBufferPrivateGStreamer::appendParsingFailed):
(WebCore::SourceBufferPrivateGStreamer::isSeeking const):
(WebCore::SourceBufferPrivateGStreamer::currentMediaTime const):
(WebCore::SourceBufferPrivateGStreamer::duration const):
(WebCore::SourceBufferPrivateGStreamer::setClient): Deleted.
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
* platform/mock/mediasource/MockMediaPlayerMediaSource.h:
* platform/mock/mediasource/MockMediaSourcePrivate.cpp:
(WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate):
(WebCore::MockMediaSourcePrivate::currentMediaTime const):
(WebCore::MockMediaSourcePrivate::logChannel const):
(WebCore::MockMediaSourcePrivate::mediaSourceLogger const): Deleted.
(WebCore::MockMediaSourcePrivate::mediaSourceLogIdentifier): Deleted.
* platform/mock/mediasource/MockMediaSourcePrivate.h:
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockSourceBufferPrivate::MockSourceBufferPrivate):
(WebCore::MockSourceBufferPrivate::didReceiveInitializationSegment):
(WebCore::MockSourceBufferPrivate::didReceiveSample):
(WebCore::MockSourceBufferPrivate::setActive):
(WebCore::MockSourceBufferPrivate::isActive const):
(WebCore::MockSourceBufferPrivate::isSeeking const):
(WebCore::MockSourceBufferPrivate::currentMediaTime const):
(WebCore::MockSourceBufferPrivate::duration const):
(WebCore::MockSourceBufferPrivate::logChannel const):
(WebCore::MockSourceBufferPrivate::setClient): Deleted.
(WebCore::MockSourceBufferPrivate::fastSeekTimeForMediaTime): Deleted.
(WebCore::MockSourceBufferPrivate::sourceBufferLogger const): Deleted.
(WebCore::MockSourceBufferPrivate::sourceBufferLogIdentifier): Deleted.
* platform/mock/mediasource/MockSourceBufferPrivate.h:

Source/WebKit:

Update `SourceBufferPrivateRemote` and `RemoteSourceBufferProxy` because of
the changes on `SourceBufferPrivate` and `SourceBufferPrivateClient`.

* GPUProcess/media/RemoteSourceBufferProxy.cpp:
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateAppendError):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateDurationChanged):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateDidParseSample):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateDidDropSample):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateStreamEndedWithDecodeError):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateHasAudio const):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateHasVideo const):
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateDidReceiveSample): Deleted.
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateReenqueSamples): Deleted.
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateDidBecomeReadyForMoreSamples): Deleted.
(WebKit::RemoteSourceBufferProxy::sourceBufferPrivateFastSeekTimeForMediaTime): Deleted.
* GPUProcess/media/RemoteSourceBufferProxy.h:
* WebProcess/GPU/media/SourceBufferPrivateRemote.cpp:
(WebKit::SourceBufferPrivateRemote::setClient): Deleted.
* WebProcess/GPU/media/SourceBufferPrivateRemote.h:

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

2 months ago[LFC][IFC] Only shrink the line with the float when it is intrusive
zalan@apple.com [Fri, 4 Dec 2020 17:57:24 +0000 (17:57 +0000)]
[LFC][IFC] Only shrink the line with the float when it is intrusive
https://bugs.webkit.org/show_bug.cgi?id=219525

Reviewed by Antti Koivisto.

Source/WebCore:

In this patch we check if the positioned float box actually intersects the line and shrink the available width accordingly.

* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::layoutInlineContent):
(WebCore::Layout::LineBuilder::computedIntrinsicWidth):
(WebCore::Layout::LineBuilder::initialize):
(WebCore::Layout::LineBuilder::placeInlineContent):
(WebCore::Layout::LineBuilder::close):
(WebCore::Layout::LineBuilder::initialConstraintsForLine):
(WebCore::Layout::LineBuilder::handleFloatContent):
(WebCore::Layout::LineBuilder::handleInlineContent):
(WebCore::Layout::LineBuilder::rebuildLineForTrailingSoftHyphen):
(WebCore::Layout::LineBuilder::constraintsForLine): Deleted.
* layout/inlineformatting/InlineLineBuilder.h:

LayoutTests:

* platform/mac-wk2/TestExpectations:

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

2 months agoFollowup rebase for fast/forms/listbox-width-change.html and fast/forms/search/search...
tsavell@apple.com [Fri, 4 Dec 2020 16:50:34 +0000 (16:50 +0000)]
Followup rebase for fast/forms/listbox-width-change.html and fast/forms/search/search-size-with-decorations.html
https://bugs.webkit.org/show_bug.cgi?id=218359

Unreviewed test gardening.

* platform/mac-catalina/fast/forms/listbox-width-change-expected.txt:
* platform/mac-catalina/fast/forms/search/search-size-with-decorations-expected.txt:

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

2 months ago[GStreamer] Unreviewed micro gardening
aboya@igalia.com [Fri, 4 Dec 2020 16:45:00 +0000 (16:45 +0000)]
[GStreamer] Unreviewed micro gardening
https://bugs.webkit.org/show_bug.cgi?id=214031

imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video-poster-shown-preload-auto.html
is now passing, likely due to r269407.

* platform/glib/TestExpectations:

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

2 months ago[JIT] Value profile stores wrong value in BaselineJIT for some operations
ticaiolima@gmail.com [Fri, 4 Dec 2020 15:54:44 +0000 (15:54 +0000)]
[JIT] Value profile stores wrong value in BaselineJIT for some operations
https://bugs.webkit.org/show_bug.cgi?id=219535

Reviewed by Mark Lam.

This patch is a follow up from r270423 to fix 32-bits baseline JIT
code from `op_iterator_next`. It's also fixing wrong profile value for
`op_get_prototype_of`.

* jit/JITCall32_64.cpp:
(JSC::JIT::emit_op_iterator_next):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_get_prototype_of):

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

2 months agoGPU Process WindowServer blocking prevents CGL
commit-queue@webkit.org [Fri, 4 Dec 2020 15:43:41 +0000 (15:43 +0000)]
GPU Process WindowServer blocking prevents CGL
https://bugs.webkit.org/show_bug.cgi?id=219431
<rdar://problem/71893390>

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2020-12-04
Reviewed by Per Arne Vollan.

Mark the GPU process as NSSupportsAutomaticGraphicsSwitching.
This allows CGL to work in cases when WindowServer connection
is blocked.

No new tests, makes the future WebGL in GPU process work.

* GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-OSX.plist:

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

2 months ago[LFC][IFC] Float positioning needs to happen while building the line
zalan@apple.com [Fri, 4 Dec 2020 13:48:09 +0000 (13:48 +0000)]
[LFC][IFC] Float positioning needs to happen while building the line
https://bugs.webkit.org/show_bug.cgi?id=219523

Reviewed by Antti Koivisto.

This patch is in preparation for cases when the float may fit the line and we assume it's intrusive but due to e.g. "clear"
it is not intersecting the line at all.
In order to figure out whether the float boxes intersect the current line, we need to compute their position as we find them.
In this patch the float positioning logic is moved over to LineBuilder (from the line post-processing) and floats are added
to the FloatingState as we encounter them while building the line.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::lineLayout):
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const):
(WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::LineBuilder):
(WebCore::Layout::LineBuilder::layoutInlineContent):
(WebCore::Layout::LineBuilder::computedIntrinsicWidth):
(WebCore::Layout::LineBuilder::initialize):
(WebCore::Layout::LineBuilder::constraintsForLine):
(WebCore::Layout::LineBuilder::handleFloatContent):
* layout/inlineformatting/InlineLineBuilder.h:
(WebCore::Layout::LineBuilder::formattingState):
(WebCore::Layout::LineBuilder::floatingState):

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

2 months agoWeb process assert when loading slack
zalan@apple.com [Fri, 4 Dec 2020 13:35:23 +0000 (13:35 +0000)]
Web process assert when loading slack
https://bugs.webkit.org/show_bug.cgi?id=219079
<rdar://problem/71814675>

Reviewed by Antti Koivisto.

Source/WebCore:

While some display types do not make too much sense on replaced elements, Box::isInlineLevelBox should
return true for all of them.

Test: fast/inline/inline-flex-on-replaced-crash.html

* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isInlineLevelBox const):

LayoutTests:

* fast/inline/inline-flex-on-replaced-crash-expected.txt: Added.
* fast/inline/inline-flex-on-replaced-crash.html: Added.

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

2 months ago[LFC][IFC] Decouple inline content and float handling in LineBuilder
zalan@apple.com [Fri, 4 Dec 2020 12:26:38 +0000 (12:26 +0000)]
[LFC][IFC] Decouple inline content and float handling in LineBuilder
https://bugs.webkit.org/show_bug.cgi?id=219522

Reviewed by Antti Koivisto.

The line candidate content is either a list of inline runs or an individual float box. Let's process them separately.

This is in preparation for adding support for "vertically stretchy" lines vs. intrusive floats where the line height
may change as we add new inline level boxes and we need to probe against existing floats.

* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineCandidate::InlineContent::continuousContent const):
(WebCore::Layout::LineCandidate::InlineContent::isEmpty const):
(WebCore::Layout::LineBuilder::placeInlineContent):
(WebCore::Layout::LineBuilder::handleFloatContent):
(WebCore::Layout::LineBuilder::handleInlineContent):
(WebCore::Layout::LineCandidate::InlineContent::operator() const): Deleted.
(WebCore::Layout::LineBuilder::handleFloatOrInlineContent): Deleted.
* layout/inlineformatting/InlineLineBuilder.h:

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

2 months agoWebGL2: Null pointer dereference in std::string implementation in gl::Shader::getTran...
commit-queue@webkit.org [Fri, 4 Dec 2020 09:41:08 +0000 (09:41 +0000)]
WebGL2: Null pointer dereference in std::string implementation in gl::Shader::getTransformFeedbackVaryingMappedName
https://bugs.webkit.org/show_bug.cgi?id=218602

Patch by Rob Buis <rbuis@igalia.com> on 2020-12-04
Reviewed by Dean Jackson.

Source/ThirdParty/ANGLE:

Skip varying if field is not found since in this
case we have no match for the varying parameter name.

* src/libANGLE/Shader.cpp:
(gl::Shader::getTransformFeedbackVaryingMappedName):

LayoutTests:

Add test that triggers the Shader::getTransformFeedbackVaryingMappedName
field code.

* fast/canvas/webgl/webgl-transformed-varying-name-crash-expected.txt: Added.
* fast/canvas/webgl/webgl-transformed-varying-name-crash.html: Added.

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

2 months agoOnly the first wheel event in a gesture should be cancelable
simon.fraser@apple.com [Fri, 4 Dec 2020 07:10:03 +0000 (07:10 +0000)]
Only the first wheel event in a gesture should be cancelable
https://bugs.webkit.org/show_bug.cgi?id=218764
<rdar://problem/71248946>

Reviewed by Tim Horton.

Source/WebCore:

Implement the WebKit2 version of r270312, where only the first wheel event in a gesture is
cancelable.

When scrolling over an element with handlers, we do event handling on the main thread,
so we can take the compute value of EventHandler's Optional<WheelScrollGestureState>
from the first event and send it back to the scrolling thread.

However, the scrolling thread needs to block until this first event comes back from
the main thread. To achieve this, EventDispatcher::wheelEvent() now dispaches
main thread scrolls from the scrolling thread (not the dispatcher thread), and
waits on m_waitingForBeganEventCondition with a 50ms timeout for that first event to
come back.

In the normal case, main thread handling dispatches the event back to the scrolling
thread for scrolling via handleWheelEventAfterMainThread(), and then calls
wheelEventWasProcessedByMainThread() to signal the condition. If for some reason
handleWheelEventAfterMainThread() doesn't get called (e.g. nothing was scrollable),
then wheelEventWasProcessedByMainThread() still gets called to signal.

If m_waitingForBeganEventCondition times out, then the scrolling thread falls back
to non-blocking behaviour (as if the first event was not canceled).

Finally, when we know the gesture will become non-blocking, we transition to running
the scroll from the scrolling thread, which requires that we set up latching, hence
the changes in ScrollingTreeLatchingController.

Tested by existing tests in fast/events/wheel.

* page/EventHandler.cpp:
(WebCore::EventHandler::wheelEventWasProcessedByMainThread):
(WebCore::EventHandler::handleWheelEventInScrollableArea):
* page/WheelEventTestMonitor.cpp:
(WebCore::operator<<):
* page/WheelEventTestMonitor.h:
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::processWheelEventForScrolling):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::determineWheelEventProcessing):
(WebCore::ScrollingTree::setGestureState):
(WebCore::ScrollingTree::gestureState):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::willSendEventToMainThread):
(WebCore::ScrollingTree::waitForEventToBeProcessedByMainThread):
* page/scrolling/ScrollingTreeLatchingController.cpp:
(WebCore::ScrollingTreeLatchingController::receivedWheelEvent):
(WebCore::ScrollingTreeLatchingController::nodeDidHandleEvent):
* page/scrolling/ScrollingTreeLatchingController.h:
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::handleWheelEventAfterMainThread):
(WebCore::ThreadedScrollingTree::wheelEventWasProcessedByMainThread):
(WebCore::ThreadedScrollingTree::willSendEventToMainThread):
(WebCore::ThreadedScrollingTree::waitForEventToBeProcessedByMainThread):
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::handleWheelEventForScrolling): Need to track deferral
for WheelEventTestMonitor.
(WebCore::ScrollingCoordinatorMac::wheelEventWasProcessedByMainThread): This is now synchronous
to the scrolling thread so no need for the deferrer.
(WebCore::nextDeferIdentifier): Deleted.
* page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
(WebCore::ScrollingCoordinatorNicosia::wheelEventWasProcessedByMainThread):
* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::handleWheelEvent):

Source/WebKit:

In EventDispatcher::wheelEvent(), all wheel events now bounce through the scrolling
thread, even those destined for main thread scrolling. This allows the scrolling thread
to wait on a condition for the event to come back to the scrolling thread via
handleWheelEventAfterMainThread(), since we have to know whether content called
preventDefault() on the first event before sending subsequent events.

* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::wheelEvent):

LayoutTests:

* fast/scrolling/mac/rubberband-overflow-in-wheel-region-root-jiggle.html: Make more robust.
* platform/mac-wk2/fast/events/wheel/wheel-events-become-non-cancelable-expected.txt: Test now passes in WK2.

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

2 months ago[GTK] Gardening anchor download failures after r270422
lmoura@igalia.com [Fri, 4 Dec 2020 06:45:17 +0000 (06:45 +0000)]
[GTK] Gardening anchor download failures after r270422

Unreviewed test gardening.

* platform/gtk/TestExpectations:

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

2 months ago"done" checkpoint of iterator_next stores the wrong register in the value profile...
sbarati@apple.com [Fri, 4 Dec 2020 04:08:46 +0000 (04:08 +0000)]
"done" checkpoint of iterator_next stores the wrong register in the value profile in baseline JIT
https://bugs.webkit.org/show_bug.cgi?id=219501

Reviewed by Keith Miller.

* jit/JIT.h:
* jit/JITCall.cpp:
(JSC::JIT::emit_op_iterator_next):
* jit/JITInlines.h:
(JSC::JIT::emitValueProfilingSite):
(JSC::JIT::emitValueProfilingSiteIfProfiledOpcode):

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

2 months agoSource/WebKit:
commit-queue@webkit.org [Fri, 4 Dec 2020 03:30:34 +0000 (03:30 +0000)]
Source/WebKit:
Introduce new download API
https://bugs.webkit.org/show_bug.cgi?id=217747

Patch by Alex Christensen <achristensen@webkit.org> on 2020-12-03
Reviewed by Brady Eidson.

Safari currently uses _WKDownload, which has evolved strangely over the last decade.
In order to make a nicer interface, we need to learn from those lessons and take a step back.
I did that, and here's what I came up with: WKDownload and WKDownloadDelegate!

Notable changes include:
1.  The delegate now lives on the download object instead of the process pool.
2.  WKDownload does not conform to NSCopying because we have NSMapTable instead of NSDictionary.
3.  publishProgressAtURL is gone.  That will be reimplemented in the UI process of the client that used it.
4.  cancel has a completion handler to get the resume data instead of waiting for didCancel then getting it from the download object.
5.  didFailWithError also gives you the resume data, so there is no way to get it from the download object.  That's more about a fail/cancel
    event than a property of the download.
6.  wasUserInitiated is gone.  Instead, WKNavigationDelegate has a callback that links a navigation action (where _isUserInitiated is exposed) to the download.
7.  redirectChain is also gone.  That can also be gotten from the link to the navigation and the download delegate's redirect callback.
8.  _downloadDidStart is gone.  Instead, we have completion handlers that expose a WKDownload once it's started.  There's no need to
    reference the download object before then anyways.  Note: that's when the download "starts" which is before it receives the response,
    so there will be no server delay in the difference between download object availabilities.
9.  didReceiveServerRedirectToURL now gives you the option of continuing or cancelling.  This reflects the amount of control the
    WKNavigationDelegate has.
10. decideDestinationWithSuggestedFilename and didReceiveResponse have been merged, since they actually happen at the same time and
    NSURLResponse has suggestedFilename API.  allowOverwrite is also gone.  It wasn't used, and not really needed.
11. didCreateDestination is gone.  That callback time wasn't really necessary.  If you need to know when it's created, wait until the first
    didWriteData callback.  The destination has definitely been created by then.
12. shouldDecodeSourceDataOfMIMEType is gone.  It's actually not called since we adopted NSURLSession, and we should remove the related dead code.
13. originatingFrame is gone.  On _WKDownload it was actually a non-null WKFrameInfo that often contained no information.  When information was there,
    the information access has been replaced by didBecomeDownload which links the WKNavigationResponse which has frame info on it.

I wrote API tests for everything I could think of.

* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::resumeDownload):
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
(WebKit::Download::resume):
(WebKit::Download::platformCancelNetworkLoad):
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::suggestedFilename const):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::resumeDownload):
(WebKit::NetworkProcess::findPendingDownloadLocation):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
* Scripts/webkit/messages.py:
* Shared/API/Cocoa/WebKit.h:
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* Sources.txt:
* SourcesCocoa.txt:
* UIProcess/API/APIDownloadClient.h:
(API::DownloadClient::legacyDidStart):
(API::DownloadClient::didFail):
(API::DownloadClient::didStart): Deleted.
* UIProcess/API/APINavigationAction.h:
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::navigationResponseDidBecomeDownload):
(API::NavigationClient::navigationActionDidBecomeDownload):
(API::NavigationClient::contextMenuDidCreateDownload):
* UIProcess/API/APIPolicyClient.h:
(API::PolicyClient::decidePolicyForNavigationAction):
(API::PolicyClient::decidePolicyForNewWindowAction):
* UIProcess/API/C/WKContext.cpp:
(WKContextSetDownloadClient): Deleted.
* UIProcess/API/C/WKContext.h:
* UIProcess/API/C/WKContextDownloadClient.h: Removed.
* UIProcess/API/C/WKDownload.cpp: Removed.
* UIProcess/API/C/WKDownloadClient.h: Added.
* UIProcess/API/C/WKDownloadRef.cpp: Added.
(WKDownloadGetTypeID):
(WKDownloadCopyRequest):
(WKDownloadCancel):
(WKDownloadGetOriginatingPage):
(WKDownloadGetWasUserInitiated):
(WKDownloadSetClient):
* UIProcess/API/C/WKDownloadRef.h: Renamed from Source/WebKit/UIProcess/API/C/WKDownload.h.
* UIProcess/API/C/WKNavigationActionRef.cpp:
(WKNavigationActionGetDownloadAttribute):
(WKNavigationActionShouldPerformDownload): Deleted.
* UIProcess/API/C/WKNavigationActionRef.h:
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPagePolicyClient):
(WKPageSetPageNavigationClient):
* UIProcess/API/C/WKPageNavigationClient.h:
* UIProcess/API/Cocoa/WKDownload.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKDownload.h.
* UIProcess/API/Cocoa/WKDownload.mm: Added.
(-[WKDownload cancel:]):
(-[WKDownload originalRequest]):
(-[WKDownload delegate]):
(-[WKDownload setDelegate:]):
(-[WKDownload dealloc]):
(-[WKDownload _apiObject]):
* UIProcess/API/Cocoa/WKDownloadDelegate.h: Added.
* UIProcess/API/Cocoa/WKDownloadInternal.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKDownloadInternal.h.
* UIProcess/API/Cocoa/WKNavigationAction.h:
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(-[WKNavigationAction downloadAttribute]):
(-[WKNavigationAction _shouldPerformDownload]):
* UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
* UIProcess/API/Cocoa/WKNavigationDelegate.h:
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _downloadURLRequest:websiteDataStore:originatingWebView:]):
(-[WKProcessPool _resumeDownloadFromData:websiteDataStore:path:originatingWebView:]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView downloadRequest:completionHandler:]):
(-[WKWebView resumeDownloadWithData:completionHandler:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKDownload.h:
* UIProcess/API/Cocoa/_WKDownload.mm:
(-[_WKDownload initWithDownload2:]):
(+[_WKDownload downloadWithDownload:]):
(-[_WKDownload cancel]):
(-[_WKDownload publishProgressAtURL:]):
(-[_WKDownload request]):
(-[_WKDownload originatingWebView]):
(-[_WKDownload redirectChain]):
(-[_WKDownload wasUserInitiated]):
(-[_WKDownload resumeData]):
(-[_WKDownload originatingFrame]):
(-[_WKDownload _apiObject]):
(-[_WKDownload dealloc]): Deleted.
* UIProcess/API/Cocoa/_WKDownloadDelegate.h:
* UIProcess/API/Cocoa/_WKDownloadInternal.h:
* UIProcess/API/glib/WebKitDownloadClient.cpp:
* UIProcess/Cocoa/LegacyDownloadClient.h:
* UIProcess/Cocoa/LegacyDownloadClient.mm:
(WebKit::LegacyDownloadClient::legacyDidStart):
(WebKit::LegacyDownloadClient::didReceiveResponse):
(WebKit::LegacyDownloadClient::didReceiveData):
(WebKit::LegacyDownloadClient::didReceiveAuthenticationChallenge):
(WebKit::LegacyDownloadClient::didCreateDestination):
(WebKit::LegacyDownloadClient::processDidCrash):
(WebKit::LegacyDownloadClient::decideDestinationWithSuggestedFilename):
(WebKit::LegacyDownloadClient::didFinish):
(WebKit::LegacyDownloadClient::didFail):
(WebKit::LegacyDownloadClient::legacyDidCancel):
(WebKit::LegacyDownloadClient::willSendRequest):
(WebKit::LegacyDownloadClient::didStart): Deleted.
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
(WebKit::NavigationState::NavigationClient::navigationActionDidBecomeDownload):
(WebKit::NavigationState::NavigationClient::navigationResponseDidBecomeDownload):
(WebKit::NavigationState::NavigationClient::contextMenuDidCreateDownload):
* UIProcess/Cocoa/WebProcessProxyCocoa.mm:
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::~DownloadProxy):
(WebKit::DownloadProxy::didStart):
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
(WebKit::DownloadProxy::didFail):
(WebKit::DownloadProxy::setClient):
* UIProcess/Downloads/DownloadProxy.h:
(WebKit::DownloadProxy::setDidStartCallback):
(WebKit::DownloadProxy::setSuggestedFilename):
* UIProcess/Network/NetworkProcessProxy.cpp:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponseShared):
(WebKit::WebPageProxy::resumeDownload):
(WebKit::WebPageProxy::downloadRequest):
(WebKit::WebPageProxy::contextMenuItemSelected):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::receivedPolicyDecision):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::resumeDownload):
* UIProcess/WebProcessPool.h:
* WebKit.xcodeproj/project.pbxproj:

Tools:
Introduce new download SPI
https://bugs.webkit.org/show_bug.cgi?id=217747

Patch by Alex Christensen <achristensen@webkit.org> on 2020-12-03
Reviewed by Brady Eidson.

* TestWebKitAPI/SourcesCocoa.txt:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/DownloadDecideDestinationCrash.cpp:
(TestWebKitAPI::decidePolicyForNavigationResponse):
(TestWebKitAPI::decideDestinationWithSuggestedFilename):
(TestWebKitAPI::navigationResponseDidBecomeDownload):
(TestWebKitAPI::setPagePolicyClient):
(TestWebKitAPI::TEST):
(TestWebKitAPI::decidePolicyForNavigationAction): Deleted.
(TestWebKitAPI::setContextDownloadClient): Deleted.
* TestWebKitAPI/Tests/WebKit/mac/ContextMenuDownload.mm:
(TestWebKitAPI::decideDestinationWithSuggestedFilename):
(TestWebKitAPI::contextMenuDidCreateDownload):
(TestWebKitAPI::TEST):
(TestWebKitAPI::decideDestinationWithSuggestedFilenameContainingSlashes):
(TestWebKitAPI::contextMenuDidCreateDownloadWithSuggestedFilenameContainingSlashes):
* TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm:
(-[BecomeDownloadDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
* TestWebKitAPI/Tests/WebKitCocoa/Download.mm:
(-[ConvertResponseToDownloadNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
(-[TestDownloadNavigationResponseFromMemoryCacheDelegate webView:didFailProvisionalNavigation:withError:]):
(-[TestDownloadNavigationResponseFromMemoryCacheDelegate webView:didFinishNavigation:]):
(TEST):
(downloadTestServer):
(checkResumedDownloadContents):
(simpleDownloadTestServer):
(checkFileContents):
(tempFileThatDoesNotExist):
(-[DownloadTestSchemeDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
(TestWebKitAPI::mutateFile):
* TestWebKitAPI/Tests/WebKitCocoa/DownloadProgress.mm:
(-[DownloadProgressTestRunner webView:decidePolicyForNavigationResponse:decisionHandler:]):
* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
(-[PSONNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
* TestWebKitAPI/Tests/WebKitCocoa/QuickLook.mm:
(TEST):
* TestWebKitAPI/cocoa/TestDownloadDelegate.h:
* TestWebKitAPI/cocoa/TestDownloadDelegate.mm:
(-[TestDownloadDelegate download:willPerformHTTPRedirection:newRequest:decisionHandler:]):
(-[TestDownloadDelegate download:decideDestinationWithResponse:suggestedFilename:completionHandler:]):
(-[TestDownloadDelegate download:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
(-[TestDownloadDelegate download:didReceiveAuthenticationChallenge:completionHandler:]):
(-[TestDownloadDelegate downloadDidFinish:]):
(-[TestDownloadDelegate download:didFailWithError:resumeData:]):
(-[TestDownloadDelegate webView:navigationResponse:didBecomeDownload:]):
(-[TestDownloadDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
(-[TestDownloadDelegate waitForDownloadDidFinish]):
(-[TestDownloadDelegate takeCallbackRecord]):
(-[TestDownloadDelegate _downloadDidStart:]): Deleted.
(-[TestDownloadDelegate _download:didReceiveServerRedirectToURL:]): Deleted.
(-[TestDownloadDelegate _download:didReceiveResponse:]): Deleted.
(-[TestDownloadDelegate _download:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]): Deleted.
(-[TestDownloadDelegate _download:decideDestinationWithSuggestedFilename:completionHandler:]): Deleted.
(-[TestDownloadDelegate _downloadDidFinish:]): Deleted.
(-[TestDownloadDelegate _download:didFailWithError:]): Deleted.
(-[TestDownloadDelegate _downloadDidCancel:]): Deleted.
(-[TestDownloadDelegate _download:didReceiveAuthenticationChallenge:completionHandler:]): Deleted.
(-[TestDownloadDelegate _download:didCreateDestination:]): Deleted.
* TestWebKitAPI/cocoa/TestLegacyDownloadDelegate.h: Copied from Tools/TestWebKitAPI/cocoa/TestDownloadDelegate.h.
* TestWebKitAPI/cocoa/TestLegacyDownloadDelegate.mm: Copied from Tools/TestWebKitAPI/cocoa/TestDownloadDelegate.mm.
(-[TestLegacyDownloadDelegate _downloadDidStart:]):
(-[TestLegacyDownloadDelegate _download:didReceiveServerRedirectToURL:]):
(-[TestLegacyDownloadDelegate _download:didReceiveResponse:]):
(-[TestLegacyDownloadDelegate _download:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
(-[TestLegacyDownloadDelegate _download:decideDestinationWithSuggestedFilename:completionHandler:]):
(-[TestLegacyDownloadDelegate _downloadDidFinish:]):
(-[TestLegacyDownloadDelegate _download:didFailWithError:]):
(-[TestLegacyDownloadDelegate _downloadDidCancel:]):
(-[TestLegacyDownloadDelegate _download:didReceiveAuthenticationChallenge:completionHandler:]):
(-[TestLegacyDownloadDelegate _download:didCreateDestination:]):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::navigationDidBecomeDownloadShared):
(WTR::TestController::navigationActionDidBecomeDownload):
(WTR::TestController::navigationResponseDidBecomeDownload):
(WTR::TestController::createOtherPage):
(WTR::TestController::createWebViewWithOptions):
(WTR::TestController::decideDestinationWithSuggestedFilename):
(WTR::TestController::downloadDidFinish):
(WTR::TestController::downloadDidFail):
(WTR::TestController::downloadDidReceiveServerRedirectToURL):
(WTR::TestController::downloadDidStart):
(WTR::TestController::decidePolicyForNavigationAction):
(WTR::TestController::downloadDidCancel): Deleted.
* WebKitTestRunner/TestController.h:

LayoutTests:
Introduce new download API
https://bugs.webkit.org/show_bug.cgi?id=217747

Patch by Alex Christensen <achristensen@webkit.org> on 2020-12-03
Reviewed by Brady Eidson.

* fast/dom/HTMLAnchorElement/anchor-download-expected.txt:
* fast/dom/HTMLAnchorElement/anchor-download-user-triggered-synthetic-click-expected.txt:
* fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download-async-delegate-expected.txt:
* fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download-expected.txt:
* fast/dom/HTMLAnchorElement/anchor-nodownload-set-expected.txt:
Now that NetworkDataTaskBlob::suggestedFilename doesn't suggest "unknown"
the capitalization has changed to "Unknown" from NSURLResponse's suggestedFilename.

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

2 months agoIssue logging in to Microsoft Teams if logged into other Microsoft accounts and navig...
katherine_cheney@apple.com [Fri, 4 Dec 2020 01:32:23 +0000 (01:32 +0000)]
Issue logging in to Microsoft Teams if logged into other Microsoft accounts and navigating directly to teams.microsoft.com
https://bugs.webkit.org/show_bug.cgi?id=219505
<rdar://problem/71391657>

Reviewed by Alex Christensen.

This is a temporary quirk to assist a high-traffic website while they
complete the large task of migrating away from login flows that
require third party cookies. This quirk will be removed when the site
is updated.

No new tests, site specific quirk.

In https://bugs.webkit.org/show_bug.cgi?id=218778 we added a quirk to
call the Storage Access API on behalf of microsoft.com when logging
into Microsoft Teams. This patch covers a final edge case where a user
was logged into other Microsoft accounts prior to the fix. In this
case, if the user tries to go straight to teams.microsoft.com, an endless
redirect loop will occur because the site has login credentials from a previous
Microsoft login but does not have 3rd party cookie access to authenticate the
login on teams.microsoft.com. The solution is to redirect the user to
the login page for Teams on microsoft.com where the previous fix added
a Storage Access prompt.

* loader/DocumentLoader.cpp:
(WebCore::microsoftTeamsRedirectURL):
(WebCore::DocumentLoader::responseReceived):
* page/Quirks.cpp:
(WebCore::Quirks::isMicrosoftTeamsRedirectURL):
* page/Quirks.h:

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

2 months agoAdopt FALLBACK_PLATFORM
commit-queue@webkit.org [Fri, 4 Dec 2020 01:22:19 +0000 (01:22 +0000)]
Adopt FALLBACK_PLATFORM
https://bugs.webkit.org/show_bug.cgi?id=219504

Patch by Adam Roben <aroben@apple.com> on 2020-12-03
Reviewed by Tim Horton.

PerformanceTests:

* MediaTime/Configurations/SDKVariant.xcconfig: Use FALLBACK_PLATFORM
it if it's defined, otherwise use PLATFORM_NAME as before.

Source/bmalloc:

* Configurations/SDKVariant.xcconfig: Use FALLBACK_PLATFORM it if it's
defined, otherwise use PLATFORM_NAME as before.

Source/JavaScriptCore:

* Configurations/SDKVariant.xcconfig:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Scripts/check-xcfilelists.sh:
Use FALLBACK_PLATFORM it if it's defined, otherwise use PLATFORM_NAME
as before.

Source/ThirdParty:

* gtest/xcode/Config/SDKVariant.xcconfig: Use FALLBACK_PLATFORM it if
it's defined, otherwise use PLATFORM_NAME as before.

Source/ThirdParty/ANGLE:

* Configurations/SDKVariant.xcconfig: Use FALLBACK_PLATFORM it if it's
defined, otherwise use PLATFORM_NAME as before.

Source/ThirdParty/libwebrtc:

* Configurations/SDKVariant.xcconfig: Use FALLBACK_PLATFORM it if it's
defined, otherwise use PLATFORM_NAME as before.

Source/WebCore:

* Configurations/SDKVariant.xcconfig:
* Scripts/check-xcfilelists.sh:
Use FALLBACK_PLATFORM it if it's defined, otherwise use PLATFORM_NAME
as before.

Source/WebCore/PAL:

* Configurations/SDKVariant.xcconfig: Use FALLBACK_PLATFORM it if it's
defined, otherwise use PLATFORM_NAME as before.

Source/WebInspectorUI:

* Configurations/SDKVariant.xcconfig: Use FALLBACK_PLATFORM it if it's
defined, otherwise use PLATFORM_NAME as before.

Source/WebKit:

* Configurations/SDKVariant.xcconfig:
* Scripts/check-xcfilelists.sh:
Use FALLBACK_PLATFORM it if it's defined, otherwise use PLATFORM_NAME
as before.

Source/WebKitLegacy:

* scripts/check-xcfilelists.sh: Use FALLBACK_PLATFORM it if it's
defined, otherwise use PLATFORM_NAME as before.

Source/WebKitLegacy/mac:

* Configurations/SDKVariant.xcconfig:
* Configurations/WebKitLegacy.xcconfig:
Use FALLBACK_PLATFORM it if it's defined, otherwise use PLATFORM_NAME
as before.

Source/WTF:

* Configurations/SDKVariant.xcconfig: Use FALLBACK_PLATFORM it if it's
defined, otherwise use PLATFORM_NAME as before.

Tools:

* ContentExtensionTester/Configurations/SDKVariant.xcconfig:
* DumpRenderTree/mac/Configurations/SDKVariant.xcconfig:
* ImageDiff/cg/Configurations/SDKVariant.xcconfig:
* MiniBrowser/Configurations/SDKVariant.xcconfig:
* MobileMiniBrowser/Configurations/SDKVariant.xcconfig:
* TestWebKitAPI/Configurations/SDKVariant.xcconfig:
* WebEditingTester/Configurations/SDKVariant.xcconfig:
* WebKitTestRunner/Configurations/SDKVariant.xcconfig:
* lldb/lldbWebKitTester/Configurations/SDKVariant.xcconfig:
Use FALLBACK_PLATFORM it if it's defined, otherwise use PLATFORM_NAME
as before.

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

2 months agoDrop unimplemented suspension functions on GPUConnectionToWebProcess and WebAuthnConn...
cdumez@apple.com [Fri, 4 Dec 2020 00:38:18 +0000 (00:38 +0000)]
Drop unimplemented suspension functions on GPUConnectionToWebProcess and WebAuthnConnectionToWebProcess
https://bugs.webkit.org/show_bug.cgi?id=219513

Reviewed by Tim Horton.

These functions are never called and have no implementation. This is just bad copy/paste from
NetworkConnectionToWebProcess.

* GPUProcess/GPUConnectionToWebProcess.h:
* WebAuthnProcess/WebAuthnConnectionToWebProcess.h:

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

2 months ago[macOS] Only extend access to the AppleSNBFBUserClient IOKit class if the GPU Process...
bfulgham@apple.com [Fri, 4 Dec 2020 00:31:23 +0000 (00:31 +0000)]
[macOS] Only extend access to the AppleSNBFBUserClient IOKit class if the GPU Process is not used
https://bugs.webkit.org/show_bug.cgi?id=219014
<rdar://problem/70463873>

Reviewed by Per Arne Vollan.

Instead of globally extending access to the AppleSNBFBUserClient IOKit class,
only extend it when the GPU process is not in use.

* UIProcess/WebPageProxy.cpp:
(WebKit::gpuIOKitClasses): Add 'AppleSNBFBUserClient' as a dynamically-extended
IOKit class.
* WebProcess/com.apple.WebProcess.sb.in: Only allow 'AppleSNBFBUserClient' if it
was dynamically extended.

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

2 months ago[GPU Process] Disconnect NativeImages from RemoteResourceCacheProxy when RemoteRender...
said@apple.com [Fri, 4 Dec 2020 00:24:28 +0000 (00:24 +0000)]
[GPU Process] Disconnect NativeImages from RemoteResourceCacheProxy when RemoteRenderingBackendProxy is destroyed
https://bugs.webkit.org/show_bug.cgi?id=219417

Reviewed by Tim Horton.

Source/WebCore:

Allow multiple observers for a single NativeImage. The NativeImage is
usually a frame of a CachedImage. The CachedImage can be referenced by
multiple pages and every page has its RemoteRenderingBackendProxy which
is a superclass of NativeImage::Observer.s

* platform/graphics/NativeImage.cpp:
(WebCore::NativeImage::~NativeImage):
* platform/graphics/NativeImage.h:
(WebCore::NativeImage::addObserver):
(WebCore::NativeImage::removeObserver):
(WebCore::NativeImage::setObserver): Deleted.
(): Deleted.

Source/WebKit:

If the WebPage is destroyed before destroying the CachedImages, a crash
may happen. The NativeImage will try to release itself from its observer,
which is RemoteResourceCacheProxy, after it has been freed.

* WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp:
(WebKit::RemoteResourceCacheProxy::~RemoteResourceCacheProxy):
(WebKit::RemoteResourceCacheProxy::cacheNativeImage):
* WebProcess/GPU/graphics/RemoteResourceCacheProxy.h:

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

2 months agoUse red color for sync wheel event handler debug overlay text
simon.fraser@apple.com [Fri, 4 Dec 2020 00:07:04 +0000 (00:07 +0000)]
Use red color for sync wheel event handler debug overlay text
https://bugs.webkit.org/show_bug.cgi?id=219514

Reviewed by Tim Horton.

Use red for the "sync" wheel event handler debug overlay text.

* rendering/RenderLayerBacking.cpp:
(WebCore::patternForEventListenerRegionType):

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

2 months agoBad IPC from the WebProcess should not terminate the GPUProcess
cdumez@apple.com [Fri, 4 Dec 2020 00:02:09 +0000 (00:02 +0000)]
Bad IPC from the WebProcess should not terminate the GPUProcess
https://bugs.webkit.org/show_bug.cgi?id=219511

Reviewed by Simon Fraser.

Bad IPC from the WebProcess should not terminate the GPUProcess. The GPUProcess is shared by all
WebProcesses and it is not acceptable for a single bad WebProcess to negatively impact other
WebProcesses. Instead, we should terminate the bad WebProcess, like the NetworkProcess already
does on bad IPC.

* GPUProcess/GPUConnectionToWebProcess.cpp:
(WebKit::GPUConnectionToWebProcess::didReceiveInvalidMessage):
* Shared/ProcessTerminationReason.h:
* UIProcess/API/C/WKAPICast.h:
(WebKit::toAPI):
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::wkProcessTerminationReason):
* UIProcess/GPU/GPUProcessProxy.cpp:
(WebKit::GPUProcessProxy::terminateWebProcess):
* UIProcess/GPU/GPUProcessProxy.h:
* UIProcess/GPU/GPUProcessProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::shouldReloadAfterProcessTermination):

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

2 months agoSerialize NFA to disk before converting it to a DFA when compiling a WKContentRuleList
commit-queue@webkit.org [Fri, 4 Dec 2020 00:01:23 +0000 (00:01 +0000)]
Serialize NFA to disk before converting it to a DFA when compiling a WKContentRuleList
https://bugs.webkit.org/show_bug.cgi?id=219452

Patch by Alex Christensen <achristensen@webkit.org> on 2020-12-03
Reviewed by Geoffrey Garen.

Source/WebCore:

This decreases maximum memory use by about 50% because the NFA and DFA never need to be in memory at the same time.
I'll have to do some tuning and on-device measurement, but this may allow us to increase maxRuleCount.

* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* contentextensions/CombinedURLFilters.cpp:
(WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
* contentextensions/CombinedURLFilters.h:
* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileToBytecode):
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionError.cpp:
(WebCore::ContentExtensions::contentExtensionErrorCategory):
* contentextensions/ContentExtensionError.h:
* contentextensions/ContentExtensionsDebugging.h:
* contentextensions/DFA.cpp:
(WebCore::ContentExtensions::DFA::shrinkToFit): Deleted.
* contentextensions/DFA.h:
* contentextensions/ImmutableNFA.h:
(WebCore::ContentExtensions::ImmutableNFA::clear):
(WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator* const): Deleted.
(WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator-> const): Deleted.
(WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator== const): Deleted.
(WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator!= const): Deleted.
(WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator++): Deleted.
(WebCore::ContentExtensions::ImmutableNFA::IterableConstTargets::begin const): Deleted.
(WebCore::ContentExtensions::ImmutableNFA::IterableConstTargets::end const): Deleted.
(WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator== const): Deleted.
(WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator!= const): Deleted.
(WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator++): Deleted.
(WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::first const): Deleted.
(WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::last const): Deleted.
(WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::data const): Deleted.
(WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::range const): Deleted.
(WebCore::ContentExtensions::ImmutableNFA::IterableConstRange::begin const): Deleted.
(WebCore::ContentExtensions::ImmutableNFA::IterableConstRange::end const): Deleted.
(WebCore::ContentExtensions::ImmutableNFA::IterableConstRange::debugPrint const): Deleted.
(WebCore::ContentExtensions::ImmutableNFA::transitionsForNode const): Deleted.
(WebCore::ContentExtensions::ImmutableNFA::root const): Deleted.
(WebCore::ContentExtensions::ImmutableNFA::finalize): Deleted.
* contentextensions/ImmutableNFANodeBuilder.h:
* contentextensions/NFAToDFA.cpp:
(WebCore::ContentExtensions::epsilonClosureExcludingSelf):
(WebCore::ContentExtensions::resolveEpsilonClosures):
(WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetSource::NodeIdSetToUniqueNodeIdSetSource):
(WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::translate):
(WebCore::ContentExtensions::createCombinedTransition):
(WebCore::ContentExtensions::getOrCreateDFANode):
(WebCore::ContentExtensions::NFAToDFA::convert):
* contentextensions/NFAToDFA.h:
* contentextensions/SerializedNFA.cpp: Added.
(WebCore::ContentExtensions::writeAllToFile):
(WebCore::ContentExtensions::SerializedNFA::serialize):
(WebCore::ContentExtensions::SerializedNFA::SerializedNFA):
(WebCore::ContentExtensions::SerializedNFA::pointerAtOffsetInFile const):
(WebCore::ContentExtensions::SerializedNFA::nodes const const):
(WebCore::ContentExtensions::SerializedNFA::transitions const const):
(WebCore::ContentExtensions::SerializedNFA::targets const const):
(WebCore::ContentExtensions::SerializedNFA::epsilonTransitionsTargets const const):
(WebCore::ContentExtensions::SerializedNFA::actions const const):
* contentextensions/SerializedNFA.h: Copied from Source/WebCore/contentextensions/ImmutableNFA.h.
(WebCore::ContentExtensions::SerializedNFA::Range::Range):
(WebCore::ContentExtensions::SerializedNFA::Range::begin const):
(WebCore::ContentExtensions::SerializedNFA::Range::end const):
(WebCore::ContentExtensions::SerializedNFA::Range::size const):
(WebCore::ContentExtensions::SerializedNFA::Range::operator[] const):
(WebCore::ContentExtensions::SerializedNFA::root const):
(WebCore::ContentExtensions::SerializedNFA::ConstTargetIterator::operator* const):
(WebCore::ContentExtensions::SerializedNFA::ConstTargetIterator::operator-> const):
(WebCore::ContentExtensions::SerializedNFA::ConstTargetIterator::operator== const):
(WebCore::ContentExtensions::SerializedNFA::ConstTargetIterator::operator!= const):
(WebCore::ContentExtensions::SerializedNFA::ConstTargetIterator::operator++):
(WebCore::ContentExtensions::SerializedNFA::IterableConstTargets::begin const):
(WebCore::ContentExtensions::SerializedNFA::IterableConstTargets::end const):
(WebCore::ContentExtensions::SerializedNFA::ConstRangeIterator::operator== const):
(WebCore::ContentExtensions::SerializedNFA::ConstRangeIterator::operator!= const):
(WebCore::ContentExtensions::SerializedNFA::ConstRangeIterator::operator++):
(WebCore::ContentExtensions::SerializedNFA::ConstRangeIterator::first const):
(WebCore::ContentExtensions::SerializedNFA::ConstRangeIterator::last const):
(WebCore::ContentExtensions::SerializedNFA::ConstRangeIterator::data const):
(WebCore::ContentExtensions::SerializedNFA::ConstRangeIterator::range const):
(WebCore::ContentExtensions::SerializedNFA::IterableConstRange::begin const):
(WebCore::ContentExtensions::SerializedNFA::IterableConstRange::end const):
(WebCore::ContentExtensions::SerializedNFA::IterableConstRange::debugPrint const):
(WebCore::ContentExtensions::SerializedNFA::transitionsForNode const):

Source/WebKit:

* UIProcess/API/Cocoa/WKContentRuleListStore.mm:
(-[WKContentRuleListStore _compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:]):
* UIProcess/API/Cocoa/WKContentRuleListStorePrivate.h:
Remove NS_RELEASES_ARGUMENT because it was incorrect and unnecessary because the WTF::String is copied to a background thread.

Tools:

Update syntax of existing tests, which cover behavior quite well.

* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::createNFAs):
(TestWebKitAPI::TEST_F):
* TestWebKitAPI/Tests/WebCore/DFAHelpers.h:
(TestWebKitAPI::createNFAs):
(TestWebKitAPI::buildDFAFromPatterns):

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

2 months agoMake sure the GPUConnectionToWebProcess gets destroyed when the connection to the...
cdumez@apple.com [Thu, 3 Dec 2020 23:54:52 +0000 (23:54 +0000)]
Make sure the GPUConnectionToWebProcess gets destroyed when the connection to the WebProcess gets severed
https://bugs.webkit.org/show_bug.cgi?id=219508

Reviewed by Geoffrey Garen.

Make sure the GPUConnectionToWebProcess gets destroyed when the connection to the WebProcess gets severed
(WebProcess exited normally or crashed). This is similar to what we do in the NetworkProcess for
NetworkConnectionToWebProcess.

* GPUProcess/GPUConnectionToWebProcess.cpp:
(WebKit::GPUConnectionToWebProcess::didClose):

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

2 months ago[webkitscmpy] Incorrect identifier on remote SVN branches
jbedard@apple.com [Thu, 3 Dec 2020 23:34:41 +0000 (23:34 +0000)]
[webkitscmpy] Incorrect identifier on remote SVN branches
https://bugs.webkit.org/show_bug.cgi?id=219509
<rdar://problem/71953465>

Reviewed by Stephanie Lewis.

Request reconstructed from packet inspection of requests sent by the svn binary.

* Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Bump version.
* Scripts/libraries/webkitscmpy/webkitscmpy/remote/svn.py:
(Svn._cache_revisions): Clarify that revisions should only come from the specified branch.

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

2 months ago[JSC] not using std::make_pair for workaround of (possibly) ASan bug
ysuzuki@apple.com [Thu, 3 Dec 2020 23:20:14 +0000 (23:20 +0000)]
[JSC] not using std::make_pair for workaround of (possibly) ASan bug
https://bugs.webkit.org/show_bug.cgi?id=219502
<rdar://71642789>

Reviewed by Robin Morisset.

We are getting ASan crash in LayoutTests/fast/canvas/webgl/array-unit-tests.html after r269574.
However, this is inside std::make_pair, and it looks like a bug in ASan.
To workaround this for now, we avoid using std::make_pair and instead just using C++ uniform initialization.

* runtime/JSArrayBufferPrototype.cpp:

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

2 months agoASSERTION FAILED: isMainThread() in WTF::Optional<IntSize> &WebCore::surfaceMaximumSize()
timothy_horton@apple.com [Thu, 3 Dec 2020 23:15:05 +0000 (23:15 +0000)]
ASSERTION FAILED: isMainThread() in WTF::Optional<IntSize> &WebCore::surfaceMaximumSize()
https://bugs.webkit.org/show_bug.cgi?id=219492

Reviewed by Ryosuke Niwa.

No new tests; fixes a failing test.

* platform/graphics/cocoa/IOSurface.mm:
(WebCore::surfaceMaximumSize):
(WebCore::IOSurface::setMaximumSize):
(WebCore::IOSurface::maximumSize):
maximumSize() is used off the main thread, so wrap it in a WTF::Atomic.

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

2 months agoGet rid of LayoutTests/platform/mac-bigsur
tsavell@apple.com [Thu, 3 Dec 2020 23:09:48 +0000 (23:09 +0000)]
Get rid of LayoutTests/platform/mac-bigsur
https://bugs.webkit.org/show_bug.cgi?id=218359

Unreviewed test gardening.

* platform/mac-bigsur/editing/pasteboard/pasting-tabs-expected.txt: Removed.
* platform/mac-bigsur/editing/selection/select-from-textfield-outwards-expected.txt: Removed.
* platform/mac-bigsur/editing/selection/vertical-rl-rtl-extend-line-backward-br-expected.txt: Removed.
* platform/mac-bigsur/editing/selection/vertical-rl-rtl-extend-line-backward-br-mixed-expected.txt: Removed.
* platform/mac-bigsur/editing/selection/vertical-rl-rtl-extend-line-backward-p-expected.txt: Removed.
* platform/mac-bigsur/editing/selection/vertical-rl-rtl-extend-line-backward-p-mixed-expected.txt: Removed.
* platform/mac-bigsur/editing/selection/vertical-rl-rtl-extend-line-forward-br-expected.txt: Removed.
* platform/mac-bigsur/editing/selection/vertical-rl-rtl-extend-line-forward-br-mixed-expected.txt: Removed.
* platform/mac-bigsur/editing/selection/vertical-rl-rtl-extend-line-forward-p-expected.txt: Removed.
* platform/mac-bigsur/editing/selection/vertical-rl-rtl-extend-line-forward-p-mixed-expected.txt: Removed.
* platform/mac-bigsur/fast/css/apple-system-control-colors-expected.txt: Removed.
* platform/mac-bigsur/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset-expected.txt: Removed.
* platform/mac-bigsur/fast/forms/basic-textareas-quirks-expected.txt: Removed.
* platform/mac-bigsur/fast/forms/box-shadow-override-expected.txt: Removed.
* platform/mac-bigsur/fast/forms/form-element-geometry-expected.txt: Removed.
* platform/mac-bigsur/fast/forms/hidpi-textfield-background-bleeding-expected.html: Removed.
* platform/mac-bigsur/fast/forms/input-appearance-preventDefault-expected.txt: Removed.
* platform/mac-bigsur/fast/forms/input-appearance-spinbutton-up-expected.txt: Removed.
* platform/mac-bigsur/fast/forms/input-placeholder-visibility-1-expected.txt: Removed.
* platform/mac-bigsur/fast/forms/input-placeholder-visibility-3-expected.txt: Removed.
* platform/mac-bigsur/fast/forms/input-table-expected.txt: Removed.
* platform/mac-bigsur/fast/forms/input-value-expected.txt: Removed.
* platform/mac-bigsur/fast/forms/listbox-width-change-expected.txt: Removed.
* platform/mac-bigsur/fast/forms/number/number-appearance-spinbutton-disabled-readonly-expected.txt: Removed.
* platform/mac-bigsur/fast/forms/search-rtl-expected.txt: Removed.
* platform/mac-bigsur/fast/forms/search/search-size-with-decorations-expected.txt: Removed.
* platform/mac-bigsur/fast/forms/search/search-zoom-computed-style-height-expected.txt: Removed.
* platform/mac-bigsur/fast/forms/select-visual-hebrew-expected.txt: Removed.
* platform/mac-bigsur/fast/forms/textAreaLineHeight-expected.txt: Removed.
* platform/mac-bigsur/fast/forms/textarea-placeholder-visibility-1-expected.txt: Removed.
* platform/mac-bigsur/fast/forms/textarea-placeholder-visibility-2-expected.txt: Removed.
* platform/mac-bigsur/fast/forms/visual-hebrew-text-field-expected.txt: Removed.
* platform/mac-bigsur/fast/parser/entity-comment-in-textarea-expected.txt: Removed.
* platform/mac-bigsur/fast/parser/open-comment-in-textarea-expected.txt: Removed.
* platform/mac-bigsur/fast/text/backslash-to-yen-sign-euc-expected.txt: Removed.
* platform/mac-bigsur/fast/text/drawBidiText-expected.txt: Removed.
* platform/mac-bigsur/fast/text/international/danda-space-expected.txt: Removed.
* platform/mac-bigsur/fast/text/international/system-language/system-font-punctuation-expected.txt: Removed.
* platform/mac-bigsur/fast/text/justify-ideograph-leading-expansion-expected.txt: Removed.
* platform/mac-bigsur/fast/text/vertical-rl-rtl-linebreak-expected.txt: Removed.
* platform/mac-bigsur/fast/text/vertical-rl-rtl-linebreak-mixed-expected.txt: Removed.
* platform/mac-catalina/fast/forms/listbox-width-change-expected.txt:
* platform/mac-catalina/fast/forms/search/search-size-with-decorations-expected.txt:
* platform/mac/editing/pasteboard/pasting-tabs-expected.txt:
* platform/mac/editing/selection/select-from-textfield-outwards-expected.txt:
* platform/mac/editing/selection/vertical-rl-rtl-extend-line-backward-br-expected.txt:
* platform/mac/editing/selection/vertical-rl-rtl-extend-line-backward-br-mixed-expected.txt:
* platform/mac/editing/selection/vertical-rl-rtl-extend-line-backward-p-expected.txt:
* platform/mac/editing/selection/vertical-rl-rtl-extend-line-backward-p-mixed-expected.txt:
* platform/mac/editing/selection/vertical-rl-rtl-extend-line-forward-br-expected.txt:
* platform/mac/editing/selection/vertical-rl-rtl-extend-line-forward-br-mixed-expected.txt:
* platform/mac/editing/selection/vertical-rl-rtl-extend-line-forward-p-expected.txt:
* platform/mac/editing/selection/vertical-rl-rtl-extend-line-forward-p-mixed-expected.txt:
* platform/mac/fast/css/apple-system-control-colors-expected.txt:
* platform/mac/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset-expected.txt:
* platform/mac/fast/forms/basic-textareas-quirks-expected.txt:
* platform/mac/fast/forms/box-shadow-override-expected.txt:
* platform/mac/fast/forms/form-element-geometry-expected.txt:
* platform/mac/fast/forms/input-appearance-preventDefault-expected.txt:
* platform/mac/fast/forms/input-appearance-spinbutton-up-expected.txt:
* platform/mac/fast/forms/input-placeholder-visibility-1-expected.txt:
* platform/mac/fast/forms/input-placeholder-visibility-3-expected.txt:
* platform/mac/fast/forms/input-table-expected.txt:
* platform/mac/fast/forms/input-value-expected.txt:
* platform/mac/fast/forms/listbox-width-change-expected.txt:
* platform/mac/fast/forms/number/number-appearance-spinbutton-disabled-readonly-expected.txt:
* platform/mac/fast/forms/search-rtl-expected.txt:
* platform/mac/fast/forms/search/search-size-with-decorations-expected.txt:
* platform/mac/fast/forms/select-visual-hebrew-expected.txt:
* platform/mac/fast/forms/textAreaLineHeight-expected.txt:
* platform/mac/fast/forms/textarea-placeholder-visibility-1-expected.txt:
* platform/mac/fast/forms/textarea-placeholder-visibility-2-expected.txt:
* platform/mac/fast/forms/visual-hebrew-text-field-expected.txt:
* platform/mac/fast/parser/entity-comment-in-textarea-expected.txt:
* platform/mac/fast/parser/open-comment-in-textarea-expected.txt:
* platform/mac/fast/text/backslash-to-yen-sign-euc-expected.txt:
* platform/mac/fast/text/drawBidiText-expected.txt:
* platform/mac/fast/text/international/danda-space-expected.txt:
* platform/mac/fast/text/international/system-language/system-font-punctuation-expected.txt:
* platform/mac/fast/text/justify-ideograph-leading-expansion-expected.txt:
* platform/mac/fast/text/vertical-rl-rtl-linebreak-expected.txt:
* platform/mac/fast/text/vertical-rl-rtl-linebreak-mixed-expected.txt:

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

2 months agoCrash when trying to suspend an OfflineAudioContext with a bad buffer
cdumez@apple.com [Thu, 3 Dec 2020 22:24:17 +0000 (22:24 +0000)]
Crash when trying to suspend an OfflineAudioContext with a bad buffer
https://bugs.webkit.org/show_bug.cgi?id=219496

Reviewed by Geoffrey Garen.

Source/WebCore:

Test: webaudio/OfflineAudioContext-bad-buffer-suspend-crash.html

* Modules/webaudio/OfflineAudioContext.cpp:
(WebCore::OfflineAudioContext::startOfflineRendering):
Throw a NotSupportedError for consistency with Blink.

(WebCore::OfflineAudioContext::suspendOfflineRendering):
Use length() instead of dereferencing the potentially null renderTarget to get
the length.

LayoutTests:

Add layout test coverage.

* webaudio/OfflineAudioContext-bad-buffer-suspend-crash-expected.txt: Added.
* webaudio/OfflineAudioContext-bad-buffer-suspend-crash.html: Added.

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

2 months agoRefactor macros for low power mode code
cdumez@apple.com [Thu, 3 Dec 2020 21:14:53 +0000 (21:14 +0000)]
Refactor macros for low power mode code
https://bugs.webkit.org/show_bug.cgi?id=219497

Reviewed by Geoffrey Garen.

Source/WebCore:

Use HAVE(APPLE_LOW_POWER_MODE_SUPPORT) instead of PLATFORM(IOS_FAMILY), which is equivalent.

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/LowPowerModeNotifier.h:
* platform/cocoa/LowPowerModeNotifier.mm: Renamed from Source/WebCore/platform/ios/LowPowerModeNotifierIOS.mm.
(-[WebLowPowerModeObserver initWithNotifier:]):
(-[WebLowPowerModeObserver dealloc]):
(-[WebLowPowerModeObserver _didReceiveLowPowerModeChange]):
(WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
(WebCore::LowPowerModeNotifier::~LowPowerModeNotifier):
(WebCore::LowPowerModeNotifier::isLowPowerModeEnabled const):
(WebCore::LowPowerModeNotifier::notifyLowPowerModeChanged):
(WebCore::notifyLowPowerModeChanged):

Source/WTF:

Add new HAVE_APPLE_LOW_POWER_MODE_SUPPORT macro, enabled on iOS_FAMILY.

* wtf/PlatformHave.h:

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

2 months ago[GStreamer] Fix video losing size at the end of the stream
aboya@igalia.com [Thu, 3 Dec 2020 21:12:34 +0000 (21:12 +0000)]
[GStreamer] Fix video losing size at the end of the stream
https://bugs.webkit.org/show_bug.cgi?id=219493

Reviewed by Xabier Rodriguez-Calvar.

LayoutTests/imported/w3c:

Added a test reproducing the bug that gets fixed with the patch.

* web-platform-tests/html/semantics/embedded-content/the-video-element/video_size_preserved_after_ended-expected.txt: Added.
* web-platform-tests/html/semantics/embedded-content/the-video-element/video_size_preserved_after_ended.html: Added.
* web-platform-tests/media/test-1s.mp4: Added.
* web-platform-tests/media/test-1s.webm: Added.

Source/WebCore:

Our port for long had an issue where at the end of the video the
tracks would be erased, causing the video to lose its size and by
extension its aspect ratio.

In absence of a size, WebKit uses the default video size defined by
the spec of 300x150 (2:1 aspect ratio). This causes a video element
that doesn't have a size set through CSS to shrink to that size at the
end of playback, and also for black bars to appear on wider content
(e.g. 16:9 video) when watched in full screen mode.

This patch fixes the problem by not removing the tracks after an end
of stream, and instead reusing them with different pads the next time
the video is played.

Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video_size_preserved_after_ended.html

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::setPad):
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:

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

2 months ago[iOS][FCR] Add new look for buttons in their default state
akeerthi@apple.com [Thu, 3 Dec 2020 20:47:15 +0000 (20:47 +0000)]
[iOS][FCR] Add new look for buttons in their default state
https://bugs.webkit.org/show_bug.cgi?id=219446
<rdar://problem/71904353>

Reviewed by Wenson Hsieh.

Controls with a button-like appearance include <button> and <input>
elements with the following type attributes: “button”, “submit”,
“reset”, and “file”. All of these have the same default appearance,
with the exception of "submit", which has a darker background and
lighter text color than the others.

Note that styles for additional states (pressed, disabled) will be
added once final specifications are obtained.

* css/formControlsIOS.css:
(input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]::-webkit-file-upload-button, button):
(input:matches([type="button"], [type="reset"]), input[type="file"]::-webkit-file-upload-button, button):
(input[type="submit"]):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintPushButtonDecorations):

The old button appearance painted a gradient over the button background.
This gradient is no longer necessary under the new design.

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

2 months agoJIT::emit_op_iterator_next fast path passes in the wrong identifier to the "done...
sbarati@apple.com [Thu, 3 Dec 2020 20:28:49 +0000 (20:28 +0000)]
JIT::emit_op_iterator_next fast path passes in the wrong identifier to the "done" JITGetByIdGenerator
https://bugs.webkit.org/show_bug.cgi?id=219499

Reviewed by Keith Miller.

The reason nothing was failing here is that the slow path which calls into C
code to do repatching of the IC was using the right "done" identifier. The
fast path only checks if the identifier is "length", so the code sidestepped
itself being wrong in any way. However, it's good form to use the correct
identifier.

* jit/JITCall.cpp:
(JSC::JIT::emit_op_iterator_next):

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

2 months agoGraphicsContextGLOpenGL: Rename IOSurfaceTextureTarget to drawingBufferTextureTarget
Hironori.Fujii@sony.com [Thu, 3 Dec 2020 19:58:07 +0000 (19:58 +0000)]
GraphicsContextGLOpenGL: Rename IOSurfaceTextureTarget to drawingBufferTextureTarget
https://bugs.webkit.org/show_bug.cgi?id=219475

Reviewed by Don Olmstead.

Cocoa port has IOSurfaceTextureTarget method to switch a buffer
target type. Non-Cocoa ports also need a similar method.

Rename IOSurfaceTextureTarget, IOSurfaceTextureTargetQuery and
EGLIOSurfaceTextureTarget to drawingBufferTextureTarget,
drawingBufferTextureTargetQuery and EGLDrawingBufferTextureTarget.

* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLOpenGL::reshapeFBOs):
* platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
(WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
(WebCore::GraphicsContextGLOpenGL::drawingBufferTextureTarget):
(WebCore::GraphicsContextGLOpenGL::drawingBufferTextureTargetQuery):
(WebCore::GraphicsContextGLOpenGL::EGLDrawingBufferTextureTarget):
(WebCore::GraphicsContextGLOpenGL::reshapeDisplayBufferBacking):
(WebCore::GraphicsContextGLOpenGL::bindDisplayBufferBacking):
(WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTarget): Deleted.
(WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTargetQuery): Deleted.
(WebCore::GraphicsContextGLOpenGL::EGLIOSurfaceTextureTarget): Deleted.
* platform/graphics/cv/GraphicsContextGLCVANGLE.cpp:
(WebCore::GraphicsContextGLCVANGLE::initializeUVContextObjects):
(WebCore::GraphicsContextGLCVANGLE::attachIOSurfaceToTexture):
(WebCore::GraphicsContextGLCVANGLE::copyPixelBufferToTexture):
* platform/graphics/opengl/GraphicsContextGLOpenGL.h:

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

2 months agoGraphicsContextGL has a couple non-robust getters and other small API problems preven...
commit-queue@webkit.org [Thu, 3 Dec 2020 19:29:34 +0000 (19:29 +0000)]
GraphicsContextGL has a couple non-robust getters and other small API problems preventing GPU process implementation
https://bugs.webkit.org/show_bug.cgi?id=219486

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2020-12-03
Reviewed by Dean Jackson.

Changes GraphicsContextGL and ExtensionsGL to not have duplicate names
and have the correct function signatures.

Changes few remaining GraphicsContextGL getters to use robust GCGLSpan
form.

Changes few robust getters to GCGLSpan form and moves them from
ExtensionsGL to GraphicsContextGL.

Changes GraphicsContextGLOpenGL::getActiveUniforms to return the result
vector instead of taking it as non-const reference. This way the out
vector does not need to be transferred to the GPU process, when the
code is implemented. The call site is also more natural.

Requests GL_EXT_occlusion_query_boolean so that WebGL 2.0 occlusion
queries work when called with gl::GetQueryObjectuivRobustANGLE.

Removes use of mapBufferRange and related functions, changes them to a single
getBufferSubData. If the mapping ever is useful, the more complex
form of API can be added back.

Changes the getInternalformativ call site to check erros similar to other
generic error checking: first clear the errors and then after the call
check if there are new errors. This is slightly less efficient than
using the domain knowledge that the function never returns -1 in the slot.
Current single-value-as-return-value pattern cannot express this. In the
future, GPU process context cannot / will not support passing non-default
in-arrays. In the future, the generic error checking pattern will possibly
be improved, circumventing the need for the -1 domain knowledge case.

Removes getVertexAttrib*v, they are not used.

Removes getAttachedShaders, it is not used.

Removes the vendor-based workarounds from ANGLE ExtensionsGL, it was not
used.

No new tests, a refactor.

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getBufferSubData):
(WebCore::WebGL2RenderingContext::getInternalformatParameter):
(WebCore::WebGL2RenderingContext::vertexAttribI4uiv):
(WebCore::WebGL2RenderingContext::getQueryParameter):
(WebCore::WebGL2RenderingContext::bindSampler):
(WebCore::WebGL2RenderingContext::getSamplerParameter):
(WebCore::WebGL2RenderingContext::clientWaitSync):
(WebCore::WebGL2RenderingContext::deleteTransformFeedback):
(WebCore::WebGL2RenderingContext::beginTransformFeedback):
(WebCore::WebGL2RenderingContext::endTransformFeedback):
(WebCore::WebGL2RenderingContext::transformFeedbackVaryings):
(WebCore::WebGL2RenderingContext::getActiveUniforms):
(WebCore::WebGL2RenderingContext::readPixels):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::readPixels):
* html/canvas/WebGLSync.cpp:
(WebCore::WebGLSync::updateCache):
* platform/graphics/ExtensionsGL.h:
* platform/graphics/GraphicsContextGL.h:
(WebCore::GraphicsContextGL::getInternalformati):
* platform/graphics/GraphicsTypesGL.h:
* platform/graphics/angle/ExtensionsGLANGLE.cpp:
(WebCore::ExtensionsGLANGLE::ExtensionsGLANGLE):
(WebCore::ExtensionsGLANGLE::getGraphicsResetStatusARB):
(WebCore::ExtensionsGLANGLE::getTranslatedShaderSourceANGLE):
(WebCore::ExtensionsGLANGLE::blitFramebufferANGLE):
(WebCore::ExtensionsGLANGLE::renderbufferStorageMultisampleANGLE):
(WebCore::ExtensionsGLANGLE::drawArraysInstancedANGLE):
(WebCore::ExtensionsGLANGLE::drawElementsInstancedANGLE):
(WebCore::ExtensionsGLANGLE::vertexAttribDivisorANGLE):
(WebCore::ExtensionsGLANGLE::getUniformuivRobustANGLE):
(WebCore::ExtensionsGLANGLE::getTexLevelParameterivRobustANGLE):
(WebCore::ExtensionsGLANGLE::getTexLevelParameterfvRobustANGLE):
(WebCore::ExtensionsGLANGLE::getnUniformfvRobustANGLE):
(WebCore::ExtensionsGLANGLE::getnUniformivRobustANGLE):
(WebCore::ExtensionsGLANGLE::getnUniformuivRobustANGLE):
* platform/graphics/angle/ExtensionsGLANGLE.h:
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLOpenGL::readnPixels):
(WebCore::GraphicsContextGLOpenGL::readnPixelsImpl):
(WebCore::GraphicsContextGLOpenGL::getBufferSubData):
(WebCore::GraphicsContextGLOpenGL::getInternalformativ):
(WebCore::GraphicsContextGLOpenGL::getActiveUniforms):
(WebCore::GraphicsContextGLOpenGL::getQueryObjectui):
(WebCore::GraphicsContextGLOpenGL::getSamplerParameterf):
(WebCore::GraphicsContextGLOpenGL::getSamplerParameteri):
(WebCore::GraphicsContextGLOpenGL::getSynci):
* platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
(WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
* platform/graphics/opengl/ExtensionsGLOpenGL.cpp:
(WebCore::ExtensionsGLOpenGL::blitFramebufferANGLE):
(WebCore::ExtensionsGLOpenGL::renderbufferStorageMultisampleANGLE):
(WebCore::ExtensionsGLOpenGL::drawArraysInstancedANGLE):
(WebCore::ExtensionsGLOpenGL::drawElementsInstancedANGLE):
(WebCore::ExtensionsGLOpenGL::vertexAttribDivisorANGLE):
* platform/graphics/opengl/ExtensionsGLOpenGL.h:
* platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp:
* platform/graphics/opengl/ExtensionsGLOpenGLCommon.h:
* platform/graphics/opengl/ExtensionsGLOpenGLES.cpp:
(WebCore::ExtensionsGLOpenGLES::blitFramebufferANGLE):
(WebCore::ExtensionsGLOpenGLES::renderbufferStorageMultisampleANGLE):
(WebCore::ExtensionsGLOpenGLES::drawArraysInstancedANGLE):
(WebCore::ExtensionsGLOpenGLES::drawElementsInstancedANGLE):
(WebCore::ExtensionsGLOpenGLES::vertexAttribDivisorANGLE):
* platform/graphics/opengl/ExtensionsGLOpenGLES.h:
* platform/graphics/opengl/GraphicsContextGLOpenGL.h:
* platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp:
(WebCore::GraphicsContextGLOpenGL::readnPixels):
* platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:
(WebCore::GraphicsContextGLOpenGL::reshape):
(WebCore::GraphicsContextGLOpenGL::blendFunc):
(WebCore::GraphicsContextGLOpenGL::compileShader):
(WebCore::GraphicsContextGLOpenGL::getActiveAttribImpl):
(WebCore::GraphicsContextGLOpenGL::getActiveAttrib):
(WebCore::GraphicsContextGLOpenGL::getActiveUniformImpl):
(WebCore::GraphicsContextGLOpenGL::getActiveUniform):
(WebCore::GraphicsContextGLOpenGL::originalSymbolName):
(WebCore::GraphicsContextGLOpenGL::mappedSymbolName):
(WebCore::GraphicsContextGLOpenGL::deleteVertexArray):
(WebCore::GraphicsContextGLOpenGL::isVertexArray):
(WebCore::GraphicsContextGLOpenGL::getNonBuiltInActiveSymbolCount):
(WebCore::GraphicsContextGLOpenGL::getUnmangledInfoLog):
(WebCore::GraphicsContextGLOpenGL::getProgramInfoLog):
(WebCore::GraphicsContextGLOpenGL::getShaderi):
(WebCore::GraphicsContextGLOpenGL::getShaderInfoLog):
(WebCore::GraphicsContextGLOpenGL::getShaderSource):
(WebCore::GraphicsContextGLOpenGL::drawArraysInstanced):
(WebCore::GraphicsContextGLOpenGL::drawElementsInstanced):
(WebCore::GraphicsContextGLOpenGL::vertexAttribDivisor):
(WebCore::GraphicsContextGLOpenGL::getBufferSubData):
(WebCore::GraphicsContextGLOpenGL::getInternalformativ):
(WebCore::GraphicsContextGLOpenGL::getQueryObjectui):
(WebCore::GraphicsContextGLOpenGL::getSamplerParameterf):
(WebCore::GraphicsContextGLOpenGL::getSamplerParameteri):
(WebCore::GraphicsContextGLOpenGL::getSynci):
(WebCore::GraphicsContextGLOpenGL::getActiveUniforms):
(WebCore::GraphicsContextGLOpenGL::getUniformBlockIndex):
(WebCore::GraphicsContextGLOpenGL::getActiveUniformBlockName):
(WebCore::GraphicsContextGLOpenGL::uniformBlockBinding):
(WebCore::GraphicsContextGLOpenGL::readnPixels):
* platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp:
(WebCore::GraphicsContextGLOpenGL::readnPixels):
(WebCore::GraphicsContextGLOpenGL::reshapeFBOs):

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

2 months ago[iOS][FCR] Add new look for search fields
akeerthi@apple.com [Thu, 3 Dec 2020 19:07:26 +0000 (19:07 +0000)]
[iOS][FCR] Add new look for search fields
https://bugs.webkit.org/show_bug.cgi?id=219443
<rdar://problem/71902666>

Reviewed by Wenson Hsieh.

Source/WebCore:

Tests: fast/forms/ios/form-control-refresh/search/background-color.html
       fast/forms/ios/form-control-refresh/search/border.html
       fast/forms/ios/form-control-refresh/search/font-size.html
       fast/forms/ios/form-control-refresh/search/results-attribute.html
       fast/forms/ios/form-control-refresh/search/width-height.html

* css/formControlsIOS.css:
(input[type="search"]):

Unlike traditional text fields, the new appearance has no border and a
filled background.

(input[type="search"]::-webkit-search-decoration,):

The new appearance has a magnifying glass glyph in the search field.
On macOS, the glyph changes depending on the value of the "results"
attribute. However, on iOS, the glyph should always be shown.
Consequently, "-webkit-search-decoration", "-webkit-search-results-decoration",
and "-webkit-search-results-button" all specify the same glyph.

* rendering/RenderThemeIOS.mm:
(WebCore::canAdjustBorderRadiusForAppearance):

The old search field forced a pill-like appearance. This is no longer
required under the new appearance.

(WebCore::RenderThemeIOS::adjustRoundBorderRadius):

LayoutTests:

Added tests to verify the stylability of search fields with the new appearance.

* fast/forms/ios/form-control-refresh/search/background-color-expected-mismatch.html: Added.
* fast/forms/ios/form-control-refresh/search/background-color.html: Added.
* fast/forms/ios/form-control-refresh/search/border-expected-mismatch.html: Added.
* fast/forms/ios/form-control-refresh/search/border.html: Added.
* fast/forms/ios/form-control-refresh/search/font-size-expected-mismatch.html: Added.
* fast/forms/ios/form-control-refresh/search/font-size.html: Added.
* fast/forms/ios/form-control-refresh/search/results-attribute-expected.html: Added.
* fast/forms/ios/form-control-refresh/search/results-attribute.html: Added.
* fast/forms/ios/form-control-refresh/search/width-height-expected-mismatch.html: Added.
* fast/forms/ios/form-control-refresh/search/width-height.html: Added.

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

2 months ago[iOS][FCR] Add new look for controls with text entry
akeerthi@apple.com [Thu, 3 Dec 2020 19:01:33 +0000 (19:01 +0000)]
[iOS][FCR] Add new look for controls with text entry
https://bugs.webkit.org/show_bug.cgi?id=219362
rdar://problem/71813850

Reviewed by Wenson Hsieh.

Controls with text entry include <textarea> and the following <input>
types: "email", "password", "search", "tel", "text", and "url".
Additionally, <input> without a specified type is also a control with
text entry, since the default behavior matches <input type="text">.

* css/formControlsIOS.css:
(textarea, input): Updated border and font to match new look.
* css/html.css:

Removed input[type="range"] and input:matches([type="password"], [type="search"])
from the rule-set containing the selector "input", since "input" encompasses
"range", "password", and "search".

This change aligns with the user-agent stylesheets in Chrome and Firefox.

* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintTextFieldDecorations):

The previous appearance painted a gradient inside the control. However,
the new appearance does not have any decorations.

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

2 months ago[macOS WK1] imported/w3c/web-platform-tests/css/css-scroll-snap/scroll-target-padding...
ryanhaddad@apple.com [Thu, 3 Dec 2020 18:59:05 +0000 (18:59 +0000)]
[macOS WK1] imported/w3c/web-platform-tests/css/css-scroll-snap/scroll-target-padding-003.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=219498

Unreviewed test gardening.

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

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

2 months ago(r270171) [ iOS ] http/wpt/mediarecorder/set-srcObject-MediaStream-Blob.html is failing
youenn@apple.com [Thu, 3 Dec 2020 18:41:48 +0000 (18:41 +0000)]
(r270171) [ iOS ] http/wpt/mediarecorder/set-srcObject-MediaStream-Blob.html is failing
https://bugs.webkit.org/show_bug.cgi?id=219439
<rdar://problem/71900353>

Reviewed by Darin Adler.

* http/wpt/mediarecorder/set-srcObject-MediaStream-Blob.html:
Remove the audio track to allow both video elements to play concurrently on iOS.
Tested by running the test on iOS simulator.

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

2 months agoRemove GraphicsContextGLOpenGL::setRenderbufferStorageFromDrawable declaration
Hironori.Fujii@sony.com [Thu, 3 Dec 2020 17:24:50 +0000 (17:24 +0000)]
Remove GraphicsContextGLOpenGL::setRenderbufferStorageFromDrawable declaration
https://bugs.webkit.org/show_bug.cgi?id=219463

Reviewed by Alex Christensen.

Source/WebCore:

r268198 removed the definition.

* platform/graphics/opengl/GraphicsContextGLOpenGL.h:
* platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp:
(WebCore::GraphicsContextGLOpenGL::reshapeFBOs):
Removed a dead code of USE(OPENGL_ES) in PLATFORM(COCOA).

Source/WTF:

* wtf/Platform.h: Removed checking whether USE_ANGLE, USE_OPENGL,
and USE_OPENGL_ES are exclusive because Cocoa ports no longer use
USE_OPENGL and USE_OPENGL_ES, and they are not exclusive on
non-Cocoa ports.

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

2 months agoMediaSessionHelper::setSharedHelper() hangs when "media in the GPU process" is enabled
jer.noble@apple.com [Thu, 3 Dec 2020 17:15:41 +0000 (17:15 +0000)]
MediaSessionHelper::setSharedHelper() hangs when "media in the GPU process" is enabled
https://bugs.webkit.org/show_bug.cgi?id=219466
<rdar://problem/71566601>

Reviewed by Chris Dumez.

The WebProcess will attempt to set a RemoteMediaSessionHelper as the sharedHelper, but calling
MediaSessionHelper::setSharedHelper() will cause a MediaSessionHelperIOS to be created, which in
turn tries to talk to AVSystemController.sharedAVSystemController, which fails due to sandbox
restrictions.

Refactor sharedHelperInstance() to not create a MediaSessionHelperIOS by default, which allows
setSharedHelper to assign a new helper without creating one by default.

* platform/audio/ios/MediaSessionHelperIOS.mm:
(sharedHelperInstance):
(MediaSessionHelper::sharedHelper):
(MediaSessionHelper::resetSharedHelper):
(MediaSessionHelper::setSharedHelper):

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

2 months agoFix for crash handling NSAccessibilityInsertionPointLineNumberAttribute for text...
andresg_22@apple.com [Thu, 3 Dec 2020 14:08:10 +0000 (14:08 +0000)]
Fix for crash handling NSAccessibilityInsertionPointLineNumberAttribute for text fields in isolated tree mode.
https://bugs.webkit.org/show_bug.cgi?id=219477

Reviewed by Chris Fleizach.

Tests:
accessibility/content-editable-as-textarea.html
accessibility/mac/content-editable-range-properties.html

- Implemented AXIsolatedObject::selectionStart/End, selectedText, visiblePositionForIndex.
- Handler of the NSAccessibilityInsertionPointLineNumberAttribute
request now dispatches to the main thread the calls that involve
VisiblePositions.
- This change fixes the above mentioned layout tests in isolated tree mode.

* accessibility/AccessibilityObjectInterface.h:
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::selectionStart const):
(WebCore::AXIsolatedObject::selectionEnd const):
(WebCore::AXIsolatedObject::selectedText const):
(WebCore::AXIsolatedObject::visiblePositionForIndex const):
* accessibility/isolatedtree/AXIsolatedObject.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

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

2 months agoGPU Process: Sandbox violations under IOSurface::maximumSize in the Web Content process
timothy_horton@apple.com [Thu, 3 Dec 2020 11:09:49 +0000 (11:09 +0000)]
GPU Process: Sandbox violations under IOSurface::maximumSize in the Web Content process
https://bugs.webkit.org/show_bug.cgi?id=219484
<rdar://problem/71603808>

Reviewed by Ryosuke Niwa.

Source/WebCore:

* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::computeMaximumSurfaceSize):
(WebCore::surfaceMaximumSize):
(WebCore::IOSurface::setMaximumSize):
(WebCore::IOSurface::maximumSize):
Make it possible to externally override IOSurface::maximumSize.

Source/WebKit:

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
Fetch the maximum allowed size of an IOSurface on the current hardware
in the UI process, and push it to the Web Content process on creation.

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

2 months ago[WTF] Avoid JSONValue::create with raw string falling to bool overload
lmoura@igalia.com [Thu, 3 Dec 2020 10:30:16 +0000 (10:30 +0000)]
[WTF] Avoid JSONValue::create with raw string falling to bool overload
https://bugs.webkit.org/show_bug.cgi?id=219483

Reviewed by Adrian Perez de Castro.

Source/JavaScriptCore:

* inspector/InjectedScriptBase.cpp:
(Inspector::InjectedScriptBase::makeAsyncCall): Convert to WTF::String when creating the value.

Source/WebCore:

Covered by existing tests.

* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::setAttachedWindow): Convert to WTF::String when creating the value.

Source/WebDriver:

Avoid accidental conversion of "selected" to bool that would make the
getElementAttribute javascriptcode to fail with "attributeName.toLowerCase
is undefined"

* Session.cpp:
(WebDriver::Session::isElementSelected): Convert to WTF::String when creating the value.

Source/WTF:

r269757 removed the const char* overload for Value::create() and replaced
them with makeString() versions. While this worked most of the time, one
could still call Value::create(raw_string) and it would end up calling the
bool overload. This could cause side effects like making a number of
WebDriver tests to fail with wrong types in the executed javascript code.

To avoid these accidental conversions, this commit added an overload to
delete all implicit conversions of Value::create().

* wtf/JSONValues.h: Delete implicit overloads for Value::create(T).

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

2 months agoMove code from AxisScrollSnapOffsets to ScrollSnapOffsetsInfo
commit-queue@webkit.org [Thu, 3 Dec 2020 09:50:39 +0000 (09:50 +0000)]
Move code from AxisScrollSnapOffsets to ScrollSnapOffsetsInfo
https://bugs.webkit.org/show_bug.cgi?id=219345

Patch by Martin Robinson <mrobinson@igalia.com> on 2020-12-03
Reviewed by Daniel Bates.

Source/WebCore:

No new tests. This should not modify behavior.

* Headers.cmake: Remove AxisScrollSnapOffsets.h from header list.
* Sources.txt: Update source list.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* page/FrameView.cpp: Update includes.
* page/scrolling/AxisScrollSnapOffsets.h: Removed.
* page/scrolling/ScrollSnapOffsetsInfo.cpp: Renamed from Source/WebCore/page/scrolling/AxisScrollSnapOffsets.cpp.
(WebCore::indicesOfNearestSnapOffsetRanges): Added from AxisScrollSnapOffsets.
(WebCore::indicesOfNearestSnapOffsets): Ditto.
(WebCore::closestSnapOffset): Ditto.
(WebCore::computeScrollSnapPortOrAreaRect): Ditto.
(WebCore::computeScrollSnapAlignOffset): Ditto.
(WebCore::operator<<): Ditto.
(WebCore::computeAxisProximitySnapOffsetRanges): Ditto.
(WebCore::updateSnapOffsetsForScrollableArea): Ditto.
* page/scrolling/ScrollSnapOffsetsInfo.h: Added functions from AxisScrollSnapOffsets.h and surrounded
this header in conditional compilation so it can be included unconditionally.
* page/scrolling/ScrollingCoordinator.h: Updated includes.
* page/scrolling/ScrollingMomentumCalculator.h: Ditto.
* platform/cocoa/ScrollSnapAnimatorState.h: Ditto.
* rendering/RenderLayer.cpp: Ditto.

Source/WebKit:

* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: Remove AxisScrollSnapOffsets.h include.
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: Ditto.

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

2 months agoDetermine the WheelScrollGestureState on the main thread before passing it to Scrolli...
simon.fraser@apple.com [Thu, 3 Dec 2020 07:58:44 +0000 (07:58 +0000)]
Determine the WheelScrollGestureState on the main thread before passing it to ScrollingCoordinator
https://bugs.webkit.org/show_bug.cgi?id=219481

Reviewed by Tim Horton.

Fixing webkit.org/b/218764 requires that we store state for a given series of wheel events
related to whether the "begin" event had preventDefault() called on it (i.e. was canceled).
Previously code was designed to propagate OptionSet<EventHandling> around, and use it to compute
WheelScrollGestureState in both EventHandler and ScrollingTree code. However, we can
compute WheelScrollGestureState just once in EventHandler, and pass it to ScrollingCoordinator.

To achieve this, add a bottleneck in the form of EventHandler::handleWheelEventInScrollableArea()
and before calling the ScrollableArea function (implementation of which can call ScrollingCoordinator),
compute WheelScrollGestureState from OptionSet<EventHandling>. This required making
handleWheelEventInAppropriateEnclosingBox() a member function.

* page/EventHandler.cpp:
(WebCore::EventHandler::processWheelEventForScrolling):
(WebCore::EventHandler::handleWheelEvent):
(WebCore::handleWheelEventPhaseInScrollableArea):
(WebCore::didScrollInScrollableArea):
(WebCore::EventHandler::handleWheelEventInAppropriateEnclosingBox):
(WebCore::EventHandler::handleWheelEventInScrollableArea):
(WebCore::EventHandler::updateWheelGestureState):
(WebCore::EventHandler::defaultWheelEventHandler):
(WebCore::handleWheelEventInAppropriateEnclosingBox): Deleted.
* page/EventHandler.h:
* page/FrameView.cpp:
(WebCore::FrameView::handleWheelEventForScrolling):
* page/FrameView.h:
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::wheelEvent):
(WebCore::EventHandler::processWheelEventForScrolling):
(WebCore::EventHandler::wheelEventWasProcessedByMainThread):
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::handleWheelEventForScrolling):
(WebCore::ScrollingCoordinator::wheelEventWasProcessedByMainThread):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::handleWheelEventAfterMainThread):
(WebCore::ThreadedScrollingTree::wheelEventWasProcessedByMainThread):
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::handleWheelEventForScrolling):
(WebCore::ScrollingCoordinatorMac::wheelEventWasProcessedByMainThread):
* page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
(WebCore::ScrollingCoordinatorNicosia::handleWheelEventForScrolling):
(WebCore::ScrollingCoordinatorNicosia::wheelEventWasProcessedByMainThread):
* page/scrolling/nicosia/ScrollingCoordinatorNicosia.h:
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::handleWheelEventForScrolling):
* platform/ScrollableArea.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::handleWheelEventForScrolling):
* rendering/RenderLayer.h:

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

2 months agoRemove m_reversedOrderIteratorForHitTesting
commit-queue@webkit.org [Thu, 3 Dec 2020 07:38:58 +0000 (07:38 +0000)]
Remove m_reversedOrderIteratorForHitTesting
https://bugs.webkit.org/show_bug.cgi?id=218554

Patch by Rob Buis <rbuis@igalia.com> on 2020-12-02
Reviewed by Zalan Bujtas.

Remove m_reversedOrderIteratorForHitTesting as
determining it at hit test time should not be very expensive.

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::hitTestChildren):
(WebCore::RenderFlexibleBox::layoutFlexItems):
* rendering/RenderFlexibleBox.h:

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

2 months agoMany different assertion failures on the GPU process bot after r270366
timothy_horton@apple.com [Thu, 3 Dec 2020 05:06:54 +0000 (05:06 +0000)]
Many different assertion failures on the GPU process bot after r270366
https://bugs.webkit.org/show_bug.cgi?id=219467

Reviewed by Simon Fraser.

Source/WebKit:

* WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::supportsGPUProcessRendering):
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::updatePreferences):
* WebProcess/WebPage/WebPage.h:
Disable DOM rendering in the GPU process if the DrawingArea doesn't support it.
Currently only RemoteLayerTreeDrawingArea does.

Tools:

* CISupport/build-webkit-org/config.json:
Revert r270366; macOS UI-side compositing is in way too sad
of a state, the world is not ready for this yet.

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

2 months agoGPU Process: Temporarily disable Web Fonts when DOM rendering in the GPU process...
timothy_horton@apple.com [Thu, 3 Dec 2020 04:59:45 +0000 (04:59 +0000)]
GPU Process: Temporarily disable Web Fonts when DOM rendering in the GPU process is enabled
https://bugs.webkit.org/show_bug.cgi?id=219479

Reviewed by Simon Fraser.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
Web fonts don't work in the GPU process yet, so disable them.
Unstyled text is better than no text.

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

2 months agoGraphicsContextGL: Remove unused platformTexture and platformGraphicsContextGL interface
Hironori.Fujii@sony.com [Thu, 3 Dec 2020 04:06:02 +0000 (04:06 +0000)]
GraphicsContextGL: Remove unused platformTexture and platformGraphicsContextGL interface
https://bugs.webkit.org/show_bug.cgi?id=219461

Reviewed by Daniel Bates.

* platform/graphics/GraphicsContextGL.h:
* platform/graphics/opengl/GraphicsContextGLOpenGL.h:
* platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp:
(WebCore::GraphicsContextGLOpenGL::platformGraphicsContextGL): Deleted.
(WebCore::GraphicsContextGLOpenGL::platformTexture const): Deleted.
* platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp:
(WebCore::GraphicsContextGLOpenGL::platformGraphicsContextGL const): Deleted.
(WebCore::GraphicsContextGLOpenGL::platformTexture const): Deleted.

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

2 months ago[WPE] Unreviewed test gardening. Gardened several flaky timeout failures.
dpino@igalia.com [Thu, 3 Dec 2020 02:56:08 +0000 (02:56 +0000)]
[WPE] Unreviewed test gardening. Gardened several flaky timeout failures.

* platform/wpe/TestExpectations:

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

2 months ago[macOS] WebContent sandbox; remove AppleIntelMEUserClient
bfulgham@apple.com [Thu, 3 Dec 2020 01:40:53 +0000 (01:40 +0000)]
[macOS] WebContent sandbox; remove AppleIntelMEUserClient
https://bugs.webkit.org/show_bug.cgi?id=219012
<rdar://problem/70462796>

Reviewed by Eric Carlson.

Source/WebKit:

Instead of globally extending access to the AppleIntelMEUserClient IOKit class,
only extend it when the GPU process is not in use.

* UIProcess/WebPageProxy.cpp:
(WebKit::gpuIOKitClasses): Add 'AppleIntelMEUserClient' as a dynamically-extended
IOKit class.
* WebProcess/com.apple.WebProcess.sb.in: Only allow 'AppleIntelMEUserClient' if it
was dynamically extended.

Tools:

Update the various sandboxes to allow the UIProcess to extend IOKit classes
to child processes on macOS. We already do this on iOS.

* MiniBrowser/MiniBrowser.entitlements:
* TestWebKitAPI/Configurations/TestWebKitAPI-macOS-internal.entitlements:
* TestWebKitAPI/Configurations/TestWebKitAPI-macOS.entitlements:
* WebKitTestRunner/Configurations/WebKitTestRunner.entitlements:

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

2 months ago[WPE] Unreviewed test gardening. Gardened several flaky failures.
dpino@igalia.com [Thu, 3 Dec 2020 01:08:16 +0000 (01:08 +0000)]
[WPE] Unreviewed test gardening. Gardened several flaky failures.

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

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

2 months ago[macOS Debug] imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script...
ryanhaddad@apple.com [Thu, 3 Dec 2020 01:06:03 +0000 (01:06 +0000)]
[macOS Debug] imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/moving-between-documents/before-prepare-* tests are flaky
https://bugs.webkit.org/show_bug.cgi?id=219464

Unreviewed test gardening.

* platform/mac/TestExpectations: Mark tests as flaky.

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

2 months ago[webkitcorepy] Allow caller of autoinstall to specify CA file
jbedard@apple.com [Thu, 3 Dec 2020 00:55:40 +0000 (00:55 +0000)]
[webkitcorepy] Allow caller of autoinstall to specify CA file
https://bugs.webkit.org/show_bug.cgi?id=219433
<rdar://problem/71869247>

Reviewed by Dewei Zhu.

* Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py:
(AutoInstall):
(AutoInstall._request): Allow user to specify CA cert file.
(AutoInstall.set_index): Allow caller to specify CA cert file.

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

2 months agoaarch64 llint does not build with JIT disabled
commit-queue@webkit.org [Thu, 3 Dec 2020 00:42:58 +0000 (00:42 +0000)]
aarch64 llint does not build with JIT disabled
https://bugs.webkit.org/show_bug.cgi?id=219288
<rdar://problem/71855960>

Source/JavaScriptCore:

Patch by Michael Catanzaro <mcatanzaro@gnome.org> on 2020-12-02
Reviewed by Darin Adler.

* assembler/ARM64Assembler.h: Rename USE(JUMP_ISLANDS) to ENABLE(JUMP_ISLANDS).
(JSC::ARM64Assembler::replaceWithJump):
(JSC::ARM64Assembler::linkJumpOrCall):
* assembler/AbstractMacroAssembler.h: Rename USE(JUMP_ISLANDS) to ENABLE(JUMP_ISLANDS).
(JSC::AbstractMacroAssembler::prepareForAtomicRepatchNearCallConcurrently):
* assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::copyCompactAndLinkCode): Guard JIT-specific code with ENABLE(JIT).
* jit/ExecutableAllocator.cpp: Rename USE(JUMP_ISLANDS) to ENABLE(JUMP_ISLANDS).
(JSC::initializeJITPageReservation):
* jit/ExecutableAllocator.h: Rename USE(JUMP_ISLANDS) to ENABLE(JUMP_ISLANDS).

Source/WTF:

Rename USE(JUMP_ISLANDS) to ENABLE(JUMP_ISLANDS), and make it depend on ENABLE(JIT). We need
it to depend on ENABLE(JIT) to fix the build, but this is awkward to do otherwise, because
USE macros are defined in PlatformUse.h before ENABLE macros in PlatformEnable.h. But it
makes sense, since USE macros should be used for "a particular third-party library or
optional OS service," and jump islands are neither, so ENABLE is more suitable anyway.

Patch by Michael Catanzaro <mcatanzaro@gnome.org> on 2020-12-02
Reviewed by Darin Adler.

* wtf/PlatformEnable.h:
* wtf/PlatformUse.h:

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

2 months ago[iOS macOS] imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-perfect-negotiat...
ryanhaddad@apple.com [Thu, 3 Dec 2020 00:29:47 +0000 (00:29 +0000)]
[iOS macOS] imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-perfect-negotiation.https.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=219460

Unreviewed test gardening.

* platform/ios/TestExpectations: Mark test as flaky.
* platform/mac/TestExpectations: Ditto.

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

2 months ago[ iOS ] Update expectations for http/wpt/service-workers/skipFetchEvent.https.html...
tsavell@apple.com [Wed, 2 Dec 2020 23:15:33 +0000 (23:15 +0000)]
[ iOS ] Update expectations for http/wpt/service-workers/skipFetchEvent.https.html which is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=208581

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

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

2 months ago[ iOS ] fast/canvas/canvas-overflow-hidden-animation.html is a flaky failure
tsavell@apple.com [Wed, 2 Dec 2020 23:11:34 +0000 (23:11 +0000)]
[ iOS ] fast/canvas/canvas-overflow-hidden-animation.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=219438

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

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

2 months agoiframe with `sandbox=allow-top-navigation-by-user-activation` can navigate top frame...
cdumez@apple.com [Wed, 2 Dec 2020 23:01:29 +0000 (23:01 +0000)]
iframe with `sandbox=allow-top-navigation-by-user-activation` can navigate top frame when the user interacts with an iframe from another origin
https://bugs.webkit.org/show_bug.cgi?id=219413
<rdar://problem/64887657>

Reviewed by Geoffrey Garen.

Source/WebCore:

An iframe with `sandbox=allow-top-navigation-by-user-activation` can navigate the top frame when the user
interacts with an frame from another origin. This is not strict enough and does not match the behavior of
Chrome.

In Chrome, the user activation is only valid for the purpose of navigation if the user interacted with either:
- The iframe triggering the navigation
- A descendant iframe of the iframe triggering the navigation
- A frame from the same origin as the iframe triggering the navigation

This patch aligns our behavior with Chrome's.

Test: http/tests/security/block-top-level-navigations-by-sandboxed-iframe-with-propagated-user-gesture.html

* dom/Document.cpp:
(WebCore::Document::canNavigateInternal):
* dom/UserGestureIndicator.cpp:
(WebCore::UserGestureToken::UserGestureToken):
(WebCore::UserGestureToken::isValidForDocument const):
(WebCore::UserGestureIndicator::processingUserGesture):
* dom/UserGestureIndicator.h:
(WebCore::UserGestureToken::create):

LayoutTests:

Add layout test coverage.

* http/tests/security/block-top-level-navigations-by-sandboxed-iframe-with-propagated-user-gesture-expected.txt: Added.
* http/tests/security/block-top-level-navigations-by-sandboxed-iframe-with-propagated-user-gesture.html: Added.
* http/tests/security/resources/navigate-top-level-frame-to-failure-page-via-message-handler.html: Added.

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

2 months ago%TypedArray%#slice shouldn't care about source buffer detachment if there's nothing...
ross.kirsling@sony.com [Wed, 2 Dec 2020 22:57:13 +0000 (22:57 +0000)]
%TypedArray%#slice shouldn't care about source buffer detachment if there's nothing to copy
https://bugs.webkit.org/show_bug.cgi?id=219451

Reviewed by Yusuke Suzuki.

JSTests:

* test262/expectations.yaml:
Mark four test cases as passing.

Source/JavaScriptCore:

From https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice:
  13. Let A be ? TypedArraySpeciesCreate(O, « 𝔽(count) »).
  14. If count > 0, then
    a. If IsDetachedBuffer(O.[[ViewedArrayBuffer]]) is true, throw a TypeError exception.
    ...
  15. Return A.

We had step 14.a raised above 14; this patch fixes the ordering.

* runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::genericTypedArrayViewProtoFuncSlice):

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

2 months ago[macOS] imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interf...
ryanhaddad@apple.com [Wed, 2 Dec 2020 22:15:47 +0000 (22:15 +0000)]
[macOS] imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interface/ctor-audiobuffer.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=219455

Unreviewed test gardening.

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

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

2 months agoUnreviewed test gardening, skip two webgl tests that are frequently timing out on...
ryanhaddad@apple.com [Wed, 2 Dec 2020 22:15:22 +0000 (22:15 +0000)]
Unreviewed test gardening, skip two webgl tests that are frequently timing out on macOS.

* platform/mac-wk1/TestExpectations:
* platform/mac/TestExpectations:

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

2 months agoBlock suspicious top level navigations by iframes even if sandbox=allow-top-navigatio...
cdumez@apple.com [Wed, 2 Dec 2020 21:55:06 +0000 (21:55 +0000)]
Block suspicious top level navigations by iframes even if sandbox=allow-top-navigation is specified
https://bugs.webkit.org/show_bug.cgi?id=219408
<rdar://problem/71049726>

Reviewed by Geoffrey Garen.

Source/WebCore:

Block suspicious top level navigations by iframes even if sandbox=allow-top-navigation is specified,
when the parent of the sandboxed iframe is not first-party.

Test: http/tests/security/block-top-level-navigations-by-third-party-sandboxed-iframe.html

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

LayoutTests:

Add layout test coverage.

* http/tests/security/block-top-level-navigations-by-third-party-sandboxed-iframe-expected.txt: Added.
* http/tests/security/block-top-level-navigations-by-third-party-sandboxed-iframe.html: Added.
* http/tests/security/resources/navigate-top-level-frame-to-failure-page-via-sandboxed-iframe.html: Added.

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

2 months agoEnable UI-side compositing on the GPU Process layout tests bot
timothy_horton@apple.com [Wed, 2 Dec 2020 21:39:41 +0000 (21:39 +0000)]
Enable UI-side compositing on the GPU Process layout tests bot
https://bugs.webkit.org/show_bug.cgi?id=219450

Reviewed by Simon Fraser.

* CISupport/build-webkit-org/config.json:
GPU Process without UI-side compositing is not a valid configuration.

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

2 months ago[webkitscmpy] Json encode Contributor
jbedard@apple.com [Wed, 2 Dec 2020 21:03:17 +0000 (21:03 +0000)]
[webkitscmpy] Json encode Contributor
https://bugs.webkit.org/show_bug.cgi?id=217932
<rdar://problem/70462473>

Reviewed by Dewei Zhu.

* Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Bump version.
* Scripts/libraries/webkitscmpy/webkitscmpy/commit.py:
(Commit.Encoder.default): Use Json encoding for Contributor.
* Scripts/libraries/webkitscmpy/webkitscmpy/contributor.py:
(Contributor.Encoder): Encode Contributor object as dictionary.
* Scripts/libraries/webkitscmpy/webkitscmpy/test/commit_unittest.py:
* Scripts/libraries/webkitscmpy/webkitscmpy/test/contributor_unittest.py:
(TestContributor.test_json_encode):
(TestContributor.test_json_decode):
* Scripts/libraries/webkitscmpy/webkitscmpy/test/find_unittest.py:

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

2 months agoUnreviewed, fix the iOS build after r270362
wenson_hsieh@apple.com [Wed, 2 Dec 2020 20:33:27 +0000 (20:33 +0000)]
Unreviewed, fix the iOS build after r270362

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

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

2 months agoUnreviewed, reverting r270339.
tsavell@apple.com [Wed, 2 Dec 2020 20:16:05 +0000 (20:16 +0000)]
Unreviewed, reverting r270339.

introduced a constantly failing test.

Reverted changeset:

"Toggling pointer-events on body does not re-enable scrolling
on child"
https://bugs.webkit.org/show_bug.cgi?id=218533
https://trac.webkit.org/changeset/270339

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

2 months agoCreate and draw app highlights
megan_gardner@apple.com [Wed, 2 Dec 2020 20:09:26 +0000 (20:09 +0000)]
Create and draw app highlights
https://bugs.webkit.org/show_bug.cgi?id=219365

Reviewed by Wenson Hsieh.

Source/WebCore:

Create a separate highlight register for app highlights so that there is a clear separation
with no risk of web content accessing the wrong highlights. Extend rendering to include the
app highlights with the current default settings.

* Modules/highlight/Highlight.h:
* Modules/highlight/HighlightRegister.cpp:
(WebCore::HighlightRegister::appHighlightKey):
(WebCore::HighlightRegister::addAppHighlight):
* Modules/highlight/HighlightRegister.h:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSValueKeywords.in:
* dom/Document.cpp:
(WebCore::Document::appHighlightRegister):
(WebCore::Document::collectRageDataFromRegister):
(WebCore::Document::updateHighlightPositions):
* dom/Document.h:
* dom/StaticRange.h:
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
* rendering/HighlightData.cpp:
(WebCore::rendererAfterOffset):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::resolveStyleForMarkedText):
(WebCore::InlineTextBox::collectMarkedTextsForHighlights const):
* rendering/MarkedText.h:
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::platformAppHighlightColor const):
* rendering/RenderTheme.h:
* rendering/RenderThemeIOS.mm:
(WebCore::cssValueIDSelectorList):
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformAppHighlightColor const):
(WebCore::RenderThemeMac::systemColor const):

Source/WebKit:

Handle the creation of App Highlights from selections when the context menu item is selected.
This patch will add the highlights to the Document's app Highlight register, and handle drawing
them in InlineTextBox. Later patches will handle the persistent storage and repopulation of app
highlights on launch or reload of a page.

* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::createAppHighlightInSelectedRange):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::contextMenuItemSelected):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView createHighlightInCurrentGroupWithRange:]):
(-[WKContentView createHighlightInNewGroupWithRange:]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::createAppHighlightInSelectedRange):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

* TestWebKitAPI/Tests/WebCore/MarkedText.cpp:
(WebCore::operator<<):

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

2 months agoRemove unused JSC ARMv7 worker from EWS
clopez@igalia.com [Wed, 2 Dec 2020 20:07:40 +0000 (20:07 +0000)]
Remove unused JSC ARMv7 worker from EWS
https://bugs.webkit.org/show_bug.cgi?id=219444

Reviewed by Aakash Jain.

Worker igalia-jsc32-armv7-ews-03 is unused and there isn't any
plan to use it on the near future.

* CISupport/ews-build/config.json:

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

2 months ago[WPE] webgl/1.0.3/conformance/rendering/multisample-corruption.html is also timing out
lmoura@igalia.com [Wed, 2 Dec 2020 19:35:34 +0000 (19:35 +0000)]
[WPE] webgl/1.0.3/conformance/rendering/multisample-corruption.html is also timing out

Unreviewed test gardening.

* platform/wpe/TestExpectations:

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

2 months ago[webkitscmpy] Provide switch to exclude commit message
jbedard@apple.com [Wed, 2 Dec 2020 19:29:59 +0000 (19:29 +0000)]
[webkitscmpy] Provide switch to exclude commit message
https://bugs.webkit.org/show_bug.cgi?id=219409
<rdar://problem/71866445>

Rubber-stamped by Aakash Jain.

* Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Bump version.
* Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py:
(Git.commit): Pass --format-short if the user is opting out of the commit message.
(Git.find): Add include_log flag, pass to commit(...) function.
* Scripts/libraries/webkitscmpy/webkitscmpy/local/svn.py:
(Svn.commit): Skip network call to retrieve commit message if include_log is false.
* Scripts/libraries/webkitscmpy/webkitscmpy/program.py:
(Find.parser): Add --log and --no-log flags.
(Find.main): Allow user to skip network call to retrieve commit message.
* Scripts/libraries/webkitscmpy/webkitscmpy/remote/svn.py:
(Svn.info): Support case were SVN cannot determine the author.
(Svn.commit): Skip network call to retrieve commit message if include_log is false.
* Scripts/libraries/webkitscmpy/webkitscmpy/scm_base.py:
(ScmBase.commit): Add include_log flag.
(ScmBase.find): Add include_log flag, pass to commit(...) function.
* Scripts/libraries/webkitscmpy/webkitscmpy/test/find_unittest.py:
(TestFind.test_no_log_svn):
(TestFind.test_no_log_git):
* Scripts/libraries/webkitscmpy/webkitscmpy/test/git_unittest.py:
(TestGit.test_no_log):
* Scripts/libraries/webkitscmpy/webkitscmpy/test/svn_unittest.py:
(TestLocalSvn.test_no_log):
(TestRemoteSvn.test_no_log):

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

2 months ago[iOS] Silence sandbox warning for unneeded sysctl-read of "hw.tbfrequency_compat"
bfulgham@apple.com [Wed, 2 Dec 2020 19:10:48 +0000 (19:10 +0000)]
[iOS] Silence sandbox warning for unneeded sysctl-read of "hw.tbfrequency_compat"
https://bugs.webkit.org/show_bug.cgi?id=219414
<rdar://problem/71740719>

Reviewed by Per Arne Vollan.

Silence a spurious log generated when our sandbox denies access to the unused sysctl
"hw.tbfrequency_compat". I have confirmed with the framework that attempts to read this
value, and they confirm they don't need the value, and actually are not using the result
anywhere in their framework.

Let's silence this report.

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

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

2 months agoFix crash with performance.measure() with negative duration
commit-queue@webkit.org [Wed, 2 Dec 2020 19:07:32 +0000 (19:07 +0000)]
Fix crash with performance.measure() with negative duration
https://bugs.webkit.org/show_bug.cgi?id=219418

Patch by Julian Gonzalez <julian_a_gonzalez@apple.com> on 2020-12-02
Reviewed by Alex Christensen.

Source/WebCore:

In PerformanceUserTiming::measure(), the wrong variable is used
to look up the exception to return if an invalid duration
value is provided.

Updated user-timing-apis test to catch this crash.

* page/PerformanceUserTiming.cpp:
(WebCore::PerformanceUserTiming::measure):

LayoutTests:

Add a test to verify that an Exception is thrown when
passing a negative duration to performance.measure(),
instead of a crash occurring.

* performance-api/resources/user-timing-api.js:
* performance-api/user-timing-apis-expected.txt:

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

2 months ago[build.webkit.org] Add unit-tests based on new buildbot
aakash_jain@apple.com [Wed, 2 Dec 2020 19:05:10 +0000 (19:05 +0000)]
[build.webkit.org] Add unit-tests based on new buildbot
https://bugs.webkit.org/show_bug.cgi?id=219363

Reviewed by Jonathan Bedard.

* CISupport/build-webkit-org/loadConfig_unittest.py: Drive-by fix to import loadConfig when running through runUnittests.py
* CISupport/build-webkit-org/htdigestparser.py: Adding python 3 compatibality.
* CISupport/build-webkit-org/htdigestparser_unittest.py: Adding python 3 compatibality.
* CISupport/build-webkit-org/steps_unittest.py: Added unit-tests for various steps.
(ExpectMasterShellCommand):
(BuildStepMixinAdditions):
(TestStepNameShouldBeValidIdentifier):
(TestStepNameShouldBeValidIdentifier.test_step_names_are_valid):
(TestRunBindingsTests):
(TestRunBindingsTests.test_success):
(TestRunBindingsTests.test_failure):
(TestKillOldProcesses):
(TestKillOldProcesses.test_success):
(TestKillOldProcesses.test_failure):
(TestCleanBuildIfScheduled):
(TestCleanBuildIfScheduled.test_success):
(TestCleanBuildIfScheduled.test_failure):
(TestCleanBuildIfScheduled.test_skip):
(TestInstallGtkDependencies):
(TestInstallGtkDependencies.test_success):
(TestInstallGtkDependencies.test_failure):
(TestInstallWpeDependencies):
(TestInstallWpeDependencies.test_success):
(TestInstallWpeDependencies.test_failure):
(TestCompileWebKit):
(TestCompileWebKit.test_success):
(TestCompileWebKit.test_success_gtk):
(TestCompileWebKit.test_success_wpe):
(TestCompileWebKit.test_failure):
(TestCompileJSCOnly):
(TestCompileJSCOnly.test_success):
(TestCompileJSCOnly.test_failure):

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

2 months agoEntire image elements are sometimes selected after ending a image extraction interaction
wenson_hsieh@apple.com [Wed, 2 Dec 2020 18:56:09 +0000 (18:56 +0000)]
Entire image elements are sometimes selected after ending a image extraction interaction
https://bugs.webkit.org/show_bug.cgi?id=219435
<rdar://problem/71897557>

Reviewed by Megan Gardner.

If the image extraction interaction is currently active, regular text interactions may need to defer to these
image extraction interactions. See WebKitAdditions changes for more details.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView hasSelectablePositionAtPoint:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):

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

2 months agoFix for accessibility layout tests involving ranges in isolated tree mode.
andresg_22@apple.com [Wed, 2 Dec 2020 18:47:18 +0000 (18:47 +0000)]
Fix for accessibility layout tests involving ranges in isolated tree mode.
https://bugs.webkit.org/show_bug.cgi?id=219436

Reviewed by Chris Fleizach.

Tests:
accessibility/mac/bounds-for-range.html
accessibility/misspelling-range.html

- Implementation of AXIsolatedObject::boundsForRange and misspellingRange.
- Fix for bug in stringForRange that wasn't isolatedCopying the returned
string. Also this method should not dispatch the call to the main thread
since the caller needs to do so because it is passing a SimpleRange as a
parameter.
- Implementation of AXIsolatedObject::lineForPosition. Other methods
that take or return VisiblePositions and VisiblePositionRanges need also
to be implemented.

* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::stringForRange const):
(WebCore::AXIsolatedObject::boundsForRange const):
(WebCore::AXIsolatedObject::misspellingRange const):
(WebCore::AXIsolatedObject::lineForPosition const):
* accessibility/isolatedtree/AXIsolatedObject.h:

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

2 months agoRe-landing r270129, r270194, and r270258.
dino@apple.com [Wed, 2 Dec 2020 18:36:01 +0000 (18:36 +0000)]
Re-landing r270129, r270194, and r270258.

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

2 months agoContext menu should be shown after a long timeout following image extraction
wenson_hsieh@apple.com [Wed, 2 Dec 2020 17:30:05 +0000 (17:30 +0000)]
Context menu should be shown after a long timeout following image extraction
https://bugs.webkit.org/show_bug.cgi?id=219415
<rdar://problem/71872600>

Reviewed by Andy Estes.

Ensures that the context menu can still be shown when triggering an image extraction gesture. To do this, we
add a new long press gesture recognizer with a much longer delay. See WebKitAdditions patch for more details.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView _doAfterPendingImageExtraction:]):
(-[WKContentView _invokeAllActionsToPerformAfterPendingImageExtraction]):

Drive-by fix: move a couple of methods out of WebKitAdditions and into non-internal source.

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

2 months ago[webkitscmpy] Handle adding, modifying and deleting files on branches
jbedard@apple.com [Wed, 2 Dec 2020 17:05:39 +0000 (17:05 +0000)]
[webkitscmpy] Handle adding, modifying and deleting files on branches
https://bugs.webkit.org/show_bug.cgi?id=219432
<rdar://problem/71894089>

Rubber-stamped by Aakash Jain.

 Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py: Bump version.
* Scripts/libraries/webkitscmpy/webkitscmpy/local/svn.py:
(Svn._branch_for): Support branch detection when files are added or deleted.
* Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/svn.py:
(Svn.__init__):
* Scripts/libraries/webkitscmpy/webkitscmpy/mocks/remote/svn.py:
(Svn.request):
* Scripts/libraries/webkitscmpy/webkitscmpy/remote/svn.py:
(Svn._branch_for): Support branch detection when files are deleted.

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

2 months agoSwitch EWS workers for JSC-ARMv7-32bits build and test queues to a new machine.
clopez@igalia.com [Wed, 2 Dec 2020 16:39:03 +0000 (16:39 +0000)]
Switch EWS workers for JSC-ARMv7-32bits build and test queues to a new machine.
https://bugs.webkit.org/show_bug.cgi?id=219189

Reviewed by Aakash Jain.

This switches the workers for the JSC-ARMv7-32bits-Build-EWS and
JSC-ARMv7-32bits-Test-EWS queues to a new ARM server that will run
things faster than the previous combination of cross-builder + RPis

Since now the tets run natively there is no need for passing the
"--remote-config-file" switch to the run-javascriptcore-tests script.

However "--memory-limited" is still needed because the issues with
failures on memory intensive tests happen on all Linux machines.
So the check to pass this flag is generalized like we do for all
Linux ports on the build.webkit.org buildbot config.

* CISupport/ews-build/config.json:
* CISupport/ews-build/steps.py:
(RunJavaScriptCoreTests.start):
* CISupport/ews-build/steps_unittest.py:
(TestRunJavaScriptCoreTests.test_remote_success):
(TestRunJavaScriptCoreTests.test_dfg_air_and_stress_test_failure):
(TestReRunJavaScriptCoreTests.test_remote_success):

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

2 months agoOptimize padding in EventHandler and platform event classes
simon.fraser@apple.com [Wed, 2 Dec 2020 16:05:56 +0000 (16:05 +0000)]
Optimize padding in EventHandler and platform event classes
https://bugs.webkit.org/show_bug.cgi?id=219420

Reviewed by Ryosuke Niwa.

Organize the member variables in EventHandler a bit better, to minimize padding
and avoid redundant #ifdefs. This shrinks it from 632 bytes to 576 bytes.

Minimize padding in the Platform*Event classes.

* page/EventHandler.h:
* platform/PlatformEvent.h:
(WebCore::PlatformEvent::PlatformEvent):
* platform/PlatformKeyboardEvent.h:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
* platform/PlatformMouseEvent.h:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::m_wheelTicksY):
(WebCore::PlatformWheelEvent::m_granularity): Deleted.

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

2 months agoREGRESSION: [iOS] imported/w3c/web-platform-tests/css/css-ui/appearance-revert-001...
akeerthi@apple.com [Wed, 2 Dec 2020 15:46:24 +0000 (15:46 +0000)]
REGRESSION: [iOS] imported/w3c/web-platform-tests/css/css-ui/appearance-revert-001.tentative.html is a flaky image failure
https://bugs.webkit.org/show_bug.cgi?id=219410
<rdar://problem/71868276>

Reviewed by Wenson Hsieh.

The flaky failure started appearing after r270065, which introduced a
new look for progress bars when the iOSFormControlRefresh setting is
enabled. Animated indeterminate progress bars were added as part of the
new appearance.

However, since the setting is disabled by default, there should have
been no effect on existing tests. r270065 omitted an early return in
RenderThemeIOS::animationRepeatIntervalForProgressBar, which would
lead to the existing progress bar being repainted 30 times per second.
This repainting is the likely cause of the flaky image failure.

Furthermore, this test uses a determinate progress bar, so repainting
due to animation should never occur, regardless of whether or not the
iOSFormControlRefresh setting is enabled. To fix the incorrect behavior,
a change was made to RenderProgress::updateAnimationState.

* rendering/RenderProgress.cpp:
(WebCore::RenderProgress::updateAnimationState):

Only indeterminate progress bars have an animation.

* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::animationRepeatIntervalForProgressBar const):

Use the original value if the iOSFormControlRefresh setting is disabled.

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

2 months agoAdd Tetsuharu Ohzeki to contributors.json
commit-queue@webkit.org [Wed, 2 Dec 2020 14:44:42 +0000 (14:44 +0000)]
Add Tetsuharu Ohzeki to contributors.json
https://bugs.webkit.org/show_bug.cgi?id=219429

Patch by Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> on 2020-12-02
Reviewed by Jonathan Bedard.

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

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

2 months ago[WASM-References] Add support for active mods in element section
commit-queue@webkit.org [Wed, 2 Dec 2020 10:43:22 +0000 (10:43 +0000)]
[WASM-References] Add support for active mods in element section
https://bugs.webkit.org/show_bug.cgi?id=219192

Patch by Dmitry Bezhetskov <dbezhetskov@igalia.com> on 2020-12-02
Reviewed by Yusuke Suzuki.

JSTests:

Fix builder dsl to produce the right element section.
It produces correct wasm code for the previous spec and for the ref-types spec because the core spec is binary compatible with the ref-types.
https://webassembly.github.io/reference-types/core/binary/modules.html#element-section.
Added basic tests for the element section.

* wasm/Builder.js:
(export.default.Builder.prototype._registerSectionBuilders.const.section.in.WASM.description.section.switch.section.case.string_appeared_here.this.section):
* wasm/Builder_WebAssemblyBinary.js:
(const.emitters.Element):
* wasm/references-spec-tests/ref_null.js:
(module):
* wasm/references/element_active_mod.js: Added.
(module):
(basicTest):
(refNullExternInElemsSection):
* wasm/references/element_parsing.js:
* wasm/references/multitable.js:

Source/JavaScriptCore:

Adjust wasm parser to parse new form of element section.
https://webassembly.github.io/reference-types/core/binary/modules.html#element-section.

* wasm/WasmEntryPlan.cpp:
(JSC::Wasm::EntryPlan::prepare):
* wasm/WasmFormat.h:
(JSC::Wasm::Element::Element):
(JSC::Wasm::Element::active const):
* wasm/WasmSectionParser.cpp:
(JSC::Wasm::SectionParser::parseElement):
(JSC::Wasm::SectionParser::validateElementTableIdx):
(JSC::Wasm::SectionParser::parseI32InitExpr):
(JSC::Wasm::SectionParser::parseElemKind):
(JSC::Wasm::SectionParser::parseIndexCountForElemSection):
(JSC::Wasm::SectionParser::parseFuncIdxFromRefExpForElemSection):
(JSC::Wasm::SectionParser::parseFuncIdxForElemSection):
* wasm/WasmSectionParser.h:
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::evaluate):

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

2 months ago[GLIB] Add some WPE-specific baselines
lmoura@igalia.com [Wed, 2 Dec 2020 04:56:48 +0000 (04:56 +0000)]
[GLIB] Add some WPE-specific baselines

Unreviewed test gardening.

These tests started failing by small amounts after some layout commits

* platform/glib/TestExpectations:
* platform/gtk/TestExpectations:
* platform/gtk/fast/css/named-images-expected.txt: Copied from LayoutTests/platform/glib/fast/css/named-images-expected.txt.
* platform/gtk/fast/dom/HTMLMeterElement/meter-element-repaint-on-update-value-expected.txt: Copied from LayoutTests/platform/glib/fast/dom/HTMLMeterElement/meter-element-repaint-on-update-value-expected.txt.
* platform/gtk/fast/dom/HTMLProgressElement/indeterminate-progress-001-expected.txt: Copied from LayoutTests/platform/glib/fast/dom/HTMLProgressElement/indeterminate-progress-001-expected.txt.
* platform/gtk/svg/transforms/svg-css-transforms-clip-path-expected.txt: Copied from LayoutTests/platform/glib/svg/transforms/svg-css-transforms-clip-path-expected.txt.
* platform/gtk/svg/transforms/svg-css-transforms-expected.txt: Copied from LayoutTests/platform/glib/svg/transforms/svg-css-transforms-expected.txt.
* platform/gtk/transforms/3d/general/perspective-units-expected.txt: Copied from LayoutTests/platform/glib/transforms/3d/general/perspective-units-expected.txt.
* platform/wpe/TestExpectations:
* platform/wpe/fast/css/named-images-expected.txt: Renamed from LayoutTests/platform/glib/fast/css/named-images-expected.txt.
* platform/wpe/fast/dom/HTMLMeterElement/meter-element-repaint-on-update-value-expected.txt: Renamed from LayoutTests/platform/glib/fast/dom/HTMLMeterElement/meter-element-repaint-on-update-value-expected.txt.
* platform/wpe/fast/dom/HTMLProgressElement/indeterminate-progress-001-expected.txt: Renamed from LayoutTests/platform/glib/fast/dom/HTMLProgressElement/indeterminate-progress-001-expected.txt.
* platform/wpe/svg/transforms/svg-css-transforms-clip-path-expected.txt: Renamed from LayoutTests/platform/glib/svg/transforms/svg-css-transforms-clip-path-expected.txt.
* platform/wpe/svg/transforms/svg-css-transforms-expected.txt: Copied from LayoutTests/platform/glib/svg/transforms/svg-css-transforms-expected.txt.
* platform/wpe/transforms/3d/general/perspective-units-expected.txt: Renamed from LayoutTests/platform/glib/transforms/3d/general/perspective-units-expected.txt.
* platform/wpe/transforms/svg-vs-css-expected.txt: Renamed from LayoutTests/platform/glib/svg/transforms/svg-css-transforms-expected.txt.

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

2 months agoGPU Process: IOSurfaces should not be mapped into the Web Content Process
timothy_horton@apple.com [Wed, 2 Dec 2020 04:23:11 +0000 (04:23 +0000)]
GPU Process: IOSurfaces should not be mapped into the Web Content Process
https://bugs.webkit.org/show_bug.cgi?id=219368

Reviewed by Said Abou-Hallawa.

Source/WebCore:

* platform/graphics/ConcreteImageBuffer.h:
* platform/graphics/ImageBuffer.h:
* platform/graphics/ImageBufferBackend.h:
* platform/graphics/cg/ImageBufferIOSurfaceBackend.h:
Make it possible to determine if an image buffer's backend is capable of mapping the backing store in-process or not.

Source/WebKit:

Since the Web Content process sandbox will eventually not have access to IOKit,
it will not be able to map/lock/use IOSurfaces. Thankfully, all it really needs
to be able to do is carry a reference to the surface from the GPU process to the
UI process (where it is mapped and applied as layer contents).

* GPUProcess/graphics/PlatformRemoteImageBuffer.h:
* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::encode const):
(WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/GPU/graphics/PlatformImageBufferShareableBackend.h:
* WebProcess/GPU/graphics/PlatformRemoteImageBufferProxy.h:
(isType):
* WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
(WebKit::RemoteRenderingBackendProxy::reestablishGPUProcessConnection):
(WebKit::RemoteRenderingBackendProxy::createImageBuffer):
(WebKit::RemoteRenderingBackendProxy::imageBufferBackendWasCreated):
(WebKit::RemoteRenderingBackendProxy::didFlush):

* WebProcess/GPU/graphics/cocoa/ImageBufferShareableIOSurfaceBackend.cpp:
(WebKit::ImageBufferShareableIOSurfaceBackend::create):
(WebKit::ImageBufferShareableIOSurfaceBackend::createImageBufferBackendHandle const):
(WebKit::ImageBufferShareableIOSurfaceBackend::context const):
(WebKit::ImageBufferShareableIOSurfaceBackend::copyNativeImage const):
(WebKit::ImageBufferShareableIOSurfaceBackend::copyImage const):
(WebKit::ImageBufferShareableIOSurfaceBackend::draw):
(WebKit::ImageBufferShareableIOSurfaceBackend::drawPattern):
(WebKit::ImageBufferShareableIOSurfaceBackend::toDataURL const):
(WebKit::ImageBufferShareableIOSurfaceBackend::toData const):
(WebKit::ImageBufferShareableIOSurfaceBackend::toBGRAData const):
(WebKit::ImageBufferShareableIOSurfaceBackend::getImageData const):
(WebKit::ImageBufferShareableIOSurfaceBackend::putImageData):
* WebProcess/GPU/graphics/cocoa/ImageBufferShareableIOSurfaceBackend.h:
* WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.cpp: Copied from Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableIOSurfaceBackend.cpp.
(WebKit::ImageBufferShareableMappedIOSurfaceBackend::create):
(WebKit::ImageBufferShareableMappedIOSurfaceBackend::createImageBufferBackendHandle const):
* WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.h: Copied from Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableIOSurfaceBackend.h.
Rename ImageBufferShareableIOSurfaceBackend to ImageBufferShareableMappedIOSurfaceBackend.
Readd ImageBufferShareableIOSurfaceBackend, the unmapped variant. The mapped variant is only used:
- in the GPU process
- in the Web Content process when DOM rendering in the GPU process is disabled

The unmapped variant cannot perform most ImageBufferBackend duties, except creating an ImageBufferBackendHandle,
which it does by cloning the existing handle. It explicitly does *not* map the IOSurface in the
process, and is meant for use in Web Content processes that do not have access to IOSurface.

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

2 months ago[GLIB] Gardening wheel timeouts
lmoura@igalia.com [Wed, 2 Dec 2020 03:47:24 +0000 (03:47 +0000)]
[GLIB] Gardening wheel timeouts

Unreviewed test gardening.

* platform/glib/TestExpectations:

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