WebKit.git
2 hours ago[JSC] Reenable ChakraCore/test/Math/max.js on ARMv7 and MIPS master
commit-queue@webkit.org [Mon, 21 Jun 2021 16:04:14 +0000 (16:04 +0000)]
[JSC] Reenable ChakraCore/test/Math/max.js on ARMv7 and MIPS
https://bugs.webkit.org/show_bug.cgi?id=227209

Patch by Xan Lopez <xan@igalia.com> on 2021-06-21
Reviewed by Adrian Perez de Castro.

* ChakraCore.yaml: reenable the test, should be working fine now.

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

2 hours ago[resultsdbpy] Adopt autoinstaller (Follow-up fix)
jbedard@apple.com [Mon, 21 Jun 2021 15:51:06 +0000 (15:51 +0000)]
[resultsdbpy] Adopt autoinstaller (Follow-up fix)
https://bugs.webkit.org/show_bug.cgi?id=227096
<rdar://problem/79418080>

Rubber-stamped by Aakash Jain.

* Scripts/libraries/resultsdbpy/container: Fix libraries path.
* Scripts/libraries/resultsdbpy/run: Ditto.
* Scripts/libraries/resultsdbpy/run-tests: Ditto.

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

2 hours agoRemove redundant HitTestLocation(const LayoutPoint& centerPoint, unsigned topPadding...
zalan@apple.com [Mon, 21 Jun 2021 15:08:43 +0000 (15:08 +0000)]
Remove redundant HitTestLocation(const LayoutPoint& centerPoint, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding)
https://bugs.webkit.org/show_bug.cgi?id=227186

Reviewed by Sam Weinig.

Let's use the LayoutRect based c'tor at the only callsite (Internals).

* page/EventHandler.cpp:
(WebCore::EventHandler::hitTestResultAtPoint const):
* page/EventHandler.h:
* rendering/HitTestLocation.cpp:
(WebCore::HitTestLocation::HitTestLocation):
(WebCore::rectForPoint): Deleted.
(WebCore::m_isRectBased): Deleted.
* rendering/HitTestLocation.h:
* rendering/HitTestResult.cpp:
* rendering/HitTestResult.h:
* testing/Internals.cpp:
(WebCore::Internals::nodesFromRect const):

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

7 hours ago[GLIB] REGRESSION(r278701): numerous WebRTC tests failing after libwebrtc update...
commit-queue@webkit.org [Mon, 21 Jun 2021 10:13:28 +0000 (10:13 +0000)]
[GLIB] REGRESSION(r278701): numerous WebRTC tests failing after libwebrtc update to M92
https://bugs.webkit.org/show_bug.cgi?id=227172

Patch by Philippe Normand <pnormand@igalia.com> on 2021-06-21
Reviewed by Adrian Perez de Castro.

Non-apple ports do not use the bundled libvpx library, they rely on the host libvpx instead.
LibWebRTC expects to depend on the bundled version, thus using its API. So we need to be
very careful with which libvpx version is used from the host, in order to avoid API/ABI
issues. Hence the version check should specify a version that is API/ABI compatible with
what libwebrtc expects.

This patch also re-enables data channel support, which was disabled during the update to M92
in CMake ports.

* CMakeLists.txt:

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

9 hours agoUnreviewed build fix after r279062
philn@webkit.org [Mon, 21 Jun 2021 08:36:09 +0000 (08:36 +0000)]
Unreviewed build fix after r279062

* wtf/Span.h:
(std::is_convertible_v<std::remove_pointer_t<decltype):

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

10 hours ago[Flatpak SDK] Update to FDO 20.08.13 release
commit-queue@webkit.org [Mon, 21 Jun 2021 07:53:39 +0000 (07:53 +0000)]
[Flatpak SDK] Update to FDO 20.08.13 release
https://bugs.webkit.org/show_bug.cgi?id=227176

Patch by Philippe Normand <pnormand@igalia.com> on 2021-06-21
Reviewed by Žan Doberšek.

This release contains libvpx 1.10.0 which we need since the libwebrtc bump to M92. The
current version we have has ABI incompatible with what libwebrtc expects and this issue was
hidden by r277036 which pulls in the bundled libvpx headers...

* elements/freedesktop-sdk.bst:
* patches/fdo-0001-meson-Bump-to-0.56.1.patch: Removed.

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

15 hours agoReplace Span implementation with one from libc++, which is more spec complient
weinig@apple.com [Mon, 21 Jun 2021 02:51:33 +0000 (02:51 +0000)]
Replace Span implementation with one from libc++, which is more spec complient
https://bugs.webkit.org/show_bug.cgi?id=227197

Reviewed by Darin Adler.

* wtf/Span.h:
The tcb span implementation had some SFINAE issues when converting containers
had data() and size() member functions but were not span compatible that were
causing failures. Rather than trying to fix those, this adopts a modified version
of the libc++ span implementation which is more up-to-date.

To fix MSVC compile issues, the as_bytes/as_writable_bytes functions have been
re-implemented to not work around a compile issue seen where using the dynamic_extent
specicialization from the static extent specicialization was failing to compile.

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

16 hours agoHitTestLocation::m_boundingBox should be able hold subpixel values
zalan@apple.com [Mon, 21 Jun 2021 01:19:50 +0000 (01:19 +0000)]
HitTestLocation::m_boundingBox should be able hold subpixel values
https://bugs.webkit.org/show_bug.cgi?id=227185

Reviewed by Sam Weinig.

This is in preparation for supporting non-integral area hi-testing (e.g. on 2x displays).
No functionality change yet.

* rendering/HitTestLocation.cpp:
(WebCore::rectForPoint):
* rendering/HitTestLocation.h:
(WebCore::HitTestLocation::boundingBox const):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::hitTestCulledInline):

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

18 hours ago[macOS] Rename WKVisualSearchPreviewController to WKQuickLookPreviewController
wenson_hsieh@apple.com [Sun, 20 Jun 2021 23:22:06 +0000 (23:22 +0000)]
[macOS] Rename WKVisualSearchPreviewController to WKQuickLookPreviewController
https://bugs.webkit.org/show_bug.cgi?id=227193

Reviewed by Sam Weinig.

Source/WebCore/PAL:

Fix up some compiler flags in this SPI header. Instead of using `HAVE(VK_IMAGE_ANALYSIS)` to guard SPI
declarations, use the new `HAVE(QUICKLOOK_PREVIEW_ITEM_DATA_PROVIDER)`, `HAVE(QUICKLOOK_ITEM_PREVIEW_OPTIONS)`
and `HAVE(QUICKLOOK_PREVIEW_ACTIVITY)` flags.

* pal/spi/mac/QuickLookMacSPI.h:

Source/WebKit:

Rename WKVisualSearchPreviewController to WKQuickLookPreviewController, with the intention of using this logic
to implement a new context menu action for opening images in a QuickLook preview panel. See below for more
details.

* SourcesCocoa.txt:
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::handleContextMenuLookUpImage): Deleted.

Move this into WebPageProxyMac.mm, since this is (1) only relevant to macOS, and (2) this logic now requires
WKQuickLookPreviewController.h, which WebPageProxyMac.mm already imports.

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::acceptsPreviewPanelControl):
* UIProcess/WebPageProxy.h:
* UIProcess/mac/WKQuickLookPreviewController.h: Renamed from Source/WebKit/UIProcess/mac/WKVisualSearchPreviewController.h.
* UIProcess/mac/WKQuickLookPreviewController.mm: Renamed from Source/WebKit/UIProcess/mac/WKVisualSearchPreviewController.mm.
(-[WKQuickLookPreviewController initWithPage:imageData:title:imageURL:activity:]):

Add QuickLookPreviewActivity, a flag to indicate whether or not WKQuickLookPreviewController should
start with QLPreviewActivityVisualSearch or QLPreviewActivityNone. For the time being, we only use this helper
object for visual search, so we only pass in QuickLookPreviewActivity::VisualSearch.

(-[WKQuickLookPreviewController beginControl:]):
(-[WKQuickLookPreviewController endControl:]):
(-[WKQuickLookPreviewController closePanelIfNecessary]):
(-[WKQuickLookPreviewController isControlling:]):
(-[WKQuickLookPreviewController provideDataForItem:]):
(-[WKQuickLookPreviewController numberOfPreviewItemsInPreviewPanel:]):
(-[WKQuickLookPreviewController previewPanel:previewItemAtIndex:]):
(-[WKQuickLookPreviewController previewPanel:initialActivityForItem:]):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::beginPreviewPanelControl):
(WebKit::WebPageProxy::endPreviewPanelControl):
(WebKit::WebPageProxy::closeSharedPreviewPanelIfNecessary):
(WebKit::WebPageProxy::handleContextMenuLookUpImage):
(WebKit::WebPageProxy::showImageInQuickLookPreviewPanel):
(WebKit::WebPageProxy::showImageInVisualSearchPreviewPanel): Deleted.
* WebKit.xcodeproj/project.pbxproj:

Source/WTF:

Add some compile-time flags to guard QuickLook SPI declarations.

* wtf/PlatformHave.h:

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

20 hours ago[Live Text] Mouse events should only trigger text recognition if the cursor is moving
wenson_hsieh@apple.com [Sun, 20 Jun 2021 21:31:34 +0000 (21:31 +0000)]
[Live Text] Mouse events should only trigger text recognition if the cursor is moving
https://bugs.webkit.org/show_bug.cgi?id=227181
rdar://79469827

Reviewed by Tim Horton.

Source/WebCore:

Make a slight adjustment to how we trigger the text recognition timer when hovering over images; instead of
allowing any non-synthetic mouse event to kick off the timer, limit it to only mouse events with horizontal or
vertical movement deltas.

To implement this, we remove some `ENABLE(POINTER_LOCK)` guards around PlatformMouseEvent's movement delta, and
check whether the movement delta is nonzero in EventHandler when determining whether to start the text
recognition timer.

* page/EventHandler.cpp:
(WebCore::EventHandler::updateMouseEventTargetNode):

Check for a nonzero movement delta in place of the synthetic click type; since all synthetic mouse events are
created with no horizontal or vertical delta, since new movement delta check obviates the need for checking the
synthetic click type.

Additionally, we invert the conditional here so that if any mouse events are detected over content that is not
an image, we'll immediately stop the timer; however, if the mouse event is over an image, we'll only kick off
the timer if the movement delta is additionally nonzero.

* platform/PlatformMouseEvent.h:
(WebCore::PlatformMouseEvent::globalPosition const):
(WebCore::PlatformMouseEvent::movementDelta const):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):

Source/WebKit:

Populate the `deltaX` and `deltaY` members of the platform mouse event on iOS, when using a trackpad. This
allows the adjusted logic in EventHandler to apply to iPadOS when using a trackpad as well (see WebCore
ChangeLog for more information).

* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
* UIProcess/ios/WKMouseGestureRecognizer.mm:
(-[WKMouseGestureRecognizer createMouseEventWithType:wasCancelled:]):

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

21 hours agoAdopt Span in SHA1.h
weinig@apple.com [Sun, 20 Jun 2021 20:33:15 +0000 (20:33 +0000)]
Adopt Span in SHA1.h
https://bugs.webkit.org/show_bug.cgi?id=227184

Reviewed by Chris Dumez.

Replaces overload of addBytes taking a Vector with ones taking
a Span and add overloads for Span<const std::byte> which all the
others are now implemented in terms of. This is useful since
any Span can be turned into one of type Span<const std::byte>
just by calling asBytes(existingSpan).

This leaves most of the existing overloads in place (though
simplifies them by implementing them as Span contructions),
though we should consider removing some in a separate pass.

* wtf/SHA1.cpp:
* wtf/SHA1.h:

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

22 hours agoMove rectForPoint() static function out from the HitTestLocation class
zalan@apple.com [Sun, 20 Jun 2021 19:46:09 +0000 (19:46 +0000)]
Move rectForPoint() static function out from the HitTestLocation class
https://bugs.webkit.org/show_bug.cgi?id=227182

Reviewed by Sam Weinig.

This function implicitly enlarges the hit test area which may trigger unexpected behavior.
It's better to not have it on the class's public interface.

* rendering/HitTestLocation.cpp:
(WebCore::rectForPoint):
(WebCore::HitTestLocation::rectForPoint): Deleted.
* rendering/HitTestLocation.h:
* rendering/LegacyEllipsisBox.cpp:
(WebCore::LegacyEllipsisBox::nodeAtPoint): While this may be a functionality change where we
replace the previously set area padding with 0 (actually 1px), I don't think that's what this is about.
* testing/Internals.cpp:
(WebCore::Internals::nodesFromRect const):

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

23 hours agoRemove HitTestLocation(FloatPoint) c'tor
zalan@apple.com [Sun, 20 Jun 2021 18:17:18 +0000 (18:17 +0000)]
Remove HitTestLocation(FloatPoint) c'tor
https://bugs.webkit.org/show_bug.cgi?id=227179

Reviewed by Sam Weinig.

FloatPoint are used to store pixed snapped coordinate values in the rendering code.
This is in preparation for supporting non-integral HitTestLocation intersect.

* rendering/HitTestLocation.cpp:
* rendering/HitTestLocation.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::hitTestLayerByApplyingTransform):
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::nodeAtFloatPoint):
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::nodeAtFloatPoint):
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::nodeAtFloatPoint):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::nodeAtFloatPoint):

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

24 hours agoCSS counter style improvements for Armenian, Tamil, and some CJK styles
darin@apple.com [Sun, 20 Jun 2021 17:31:15 +0000 (17:31 +0000)]
CSS counter style improvements for Armenian, Tamil, and some CJK styles
https://bugs.webkit.org/show_bug.cgi?id=227190

Reviewed by Sam Weinig.

Source/WebCore:

* css/CSSPrimitiveValueMappings.h: Added CJKDecimal and Tamil.
Also updated for name changes of Cjk to CJK.

* css/CSSValueKeywords.in: Added cjk-decimal and tamil.

* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::isPredefinedCounterStyle):
Updated since the last predefined counter style is now Tamil.

* rendering/RenderListMarker.cpp: Tweak coding style a bit, using
constexpr and auto and removing some unneeded explicit type names.
(WebCore::effectiveListMarkerType): Added Tamil. Corrected range
for Armenian, LowerArmenian, and UpperArmenian to be 1-9999.
Added CJKDecimal. Updated for name changes of Cjk to CJK.
(WebCore::listMarkerSuffix): Addded Tamil. Corrected suffix for
multiple types to be ideographic comma instead of period.
(WebCore::suffixRequiresSpace): Added. Used so we don't add a space
after all suffixes.
(WebCore::listMarkerText): Added CJKDecimal and Tamil.
(WebCore::RenderListMarker::paint): Removed all the cases for the
many list style types that just paint as text, using default instead.
Call suffixRequiresSpace and don't add a space if not needed.
(WebCore::RenderListMarker::updateContent): Removed all the cases for
the many list style types that are text based, using default instead.
(WebCore::RenderListMarker::computePreferredLogicalWidths): Removed
all the cases for the many list style types that are text based, using
default instead. Call suffixRequiresSpace and don't include the space
if not needed.
(WebCore::RenderListMarker::suffix const): Call suffixRequiresSpace
and don't include a space if not needed.
(WebCore::RenderListMarker::getRelativeMarkerRect): Removed all the
cases for the many list style types that are text based, using default
instead. Call suffixRequiresSpace and don't include the space if not
needed.

* rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<): Added CJKDecimal and Tamil. Also sorted the
list styles alphabetically.

* rendering/style/RenderStyleConstants.h: Added CJKDecimal and
Tamil and use CJK instead of Cjk in names of the other styles.

LayoutTests:

* TestExpectations: Remove failure expectations for 26 tests.

* fast/lists/w3-css3-list-styles-fallback-style-expected.txt: Expect 9999 limit instead
of 99999999 for Armenian, and success rather than failure for Tamil.
* fast/lists/w3-css3-list-styles-fallback-style.html: Ditto.

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

31 hours agoSkip shadow-root creation for input element if it is not necessary
ysuzuki@apple.com [Sun, 20 Jun 2021 10:53:42 +0000 (10:53 +0000)]
Skip shadow-root creation for input element if it is not necessary
https://bugs.webkit.org/show_bug.cgi?id=227189

Reviewed by Maciej Stachowiak.

Source/WebCore:

Test: fast/forms/checkbox-child-hidden.html

Cherry-pick Chromium optimizations[1,2] for input element and extend the coverage for more types.

Some of input element (e.g. checkbox) do not need to create a shadow-root since they do not have shadow-subtree.
This patch optimizes input element creation by skipping creation of shadow-root for these input types.

Since HTMLTextFormControlElement::childShouldCreateRenderer creates renderer only for children under shadow-root,
we do not need to consider about the case appending an element to checkbox etc. They will not get renderers.

We also replace HTMLInputElement related class' override with final if they are final to make class-hierarchy more explicit
and not to miss the change that needs to be done in the derived classes.

On M1 MBP, this patch improves Speedometer2 by 0.8%.

[1]: https://chromium-review.googlesource.com/c/chromium/src/+/773180
[2]: https://chromium-review.googlesource.com/c/chromium/src/+/826426 (but this is not necessary in WebKit since HTMLTextFormControlElement::childShouldCreateRenderer does the right thing elegantly)

* dom/Element.cpp:
(WebCore::Element::ensureUserAgentShadowRoot):
(WebCore::Element::createUserAgentShadowRoot):
* dom/Element.h:
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/BaseDateAndTimeInputType.h:
(WebCore::BaseDateAndTimeInputType::BaseDateAndTimeInputType):
* html/ColorInputType.cpp:
(WebCore::ColorInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/ColorInputType.h:
* html/FileInputType.cpp:
(WebCore::FileInputType::FileInputType):
(WebCore::FileInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::create):
(WebCore::HTMLInputElement::createShadowSubtreeAndUpdateInnerTextElementEditability):
(WebCore::HTMLInputElement::updateType): It is possible that shadow root is already created for the previous InputType.
So we should use ensureUserAgentShadowRoot.
(WebCore::HTMLInputElement::initializeInputType): Since this is called at initialization time, we can use createUserAgentShadowRoot
instead of ensureUserAgentShadowRoot.
(WebCore::HTMLInputElement::didAddUserAgentShadowRoot): Deleted. Clean up the logic instead of relying on this callback.
Since HTMLInputElement can replace InputType, while we need to create shadow-subtree when InputType is replaced,
this callback could not be called since shadow-root is already created for the previous InputType. Not relying on this
callback makes the logic much simpler: explicitly create shadow-root and shadow-subtree.
* html/HTMLInputElement.h:
* html/InputType.h:
(WebCore::InputType::needsShadowSubtree const): Since this is in the critical path, we need this super optimized implementation.
Button, checkbox, hidden, image, radio, reset, and submit do not require shadow root.
* html/RangeInputType.cpp:
(WebCore::RangeInputType::RangeInputType):
(WebCore::RangeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/SearchInputType.cpp:
(WebCore::SearchInputType::SearchInputType):
(WebCore::SearchInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::TextFieldInputType):
(WebCore::TextFieldInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):

LayoutTests:

* fast/forms/checkbox-and-pseudo-expected.txt: Added.
* fast/forms/checkbox-and-pseudo.html: Added.
* fast/forms/checkbox-child-hidden-expected.html: Added.
* fast/forms/checkbox-child-hidden.html: Added.

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

32 hours ago[JSC] Add ValueOf fast path in toPrimitive
ysuzuki@apple.com [Sun, 20 Jun 2021 09:48:03 +0000 (09:48 +0000)]
[JSC] Add ValueOf fast path in toPrimitive
https://bugs.webkit.org/show_bug.cgi?id=226948

Reviewed by Ross Kirsling.

JSTests:

* microbenchmarks/valueof-via-toprimitive.js: Added.

Source/JavaScriptCore:

Add fast path for Object.prototype.valueOf function call since we
sometimes encounter this case in Speedometer2/EmberJS-Debug-TodoMVC.

                               ToT                     Patched

    value-of-call        65.7169+-0.6192     ^     45.0986+-0.0830        ^ definitely 1.4572x faster

* runtime/JSCJSValue.cpp:
(JSC::JSValue::toStringSlowCase const):
* runtime/JSObject.cpp:
(JSC::callToPrimitiveFunction):

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

34 hours agoFix speculated type in the one-argument overload of speculateNeitherDoubleNorHeapBigI...
rmorisset@apple.com [Sun, 20 Jun 2021 07:37:12 +0000 (07:37 +0000)]
Fix speculated type in the one-argument overload of speculateNeitherDoubleNorHeapBigIntNorString
https://bugs.webkit.org/show_bug.cgi?id=227119

Reviewed by Yusuke Suzuki.

Same problem as bug 226786: a missing check for HeapBigInt in the speculateNeitherDoubleNorHeapBigIntNorString function introduced in 226676.

I also rewrote the SpeculatedType for NeitherDoubleNorHeapBigIntNorString in typeFilterFor for readability. The old and the new SpeculatedType are perfectly identical, it is just a different (and in my view more readable) way of writing it.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::speculateNeitherDoubleNorHeapBigIntNorString):
* dfg/DFGUseKind.h:
(JSC::DFG::typeFilterFor):

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

40 hours agoAdopt Span in Base64.h
weinig@apple.com [Sun, 20 Jun 2021 02:05:08 +0000 (02:05 +0000)]
Adopt Span in Base64.h
https://bugs.webkit.org/show_bug.cgi?id=227132

Reviewed by Chris Dumez.

Replaces overloads taking Vectors with ones taking Spans
and add overloads for Span<const std::byte> which all the
others are now implemented in terms of. This is useful since
any Span can be turned into one of type Span<const std::byte>
just by calling asBytes(existingSpan).

This leaves most of the existing overloads in place (though
simplifies them by implementing them as Span contructions)
though we should consider removing some in a separate pass.

* wtf/Vector.h:
Add value_type typedef so that Vector<T> can be automatically
deduced as Span<T>.

* wtf/text/CString.h:
Add bytes() and bytesInludingNullTerminator() (only the former
is used in this patch, but the later will be needed shortly)
which return Span<const uint8_t> of the CString. I chose to use
an explicit function, rather than making it converible to Span
like Vector, because some callers will want the null terminator
and some will not.

* wtf/text/Base64.cpp:
* wtf/text/Base64.h:
Canonicalize all input buffers either as a Span<const std::byte> or
a StringView, making all the other overloads just forward to one of
those two (String -> StringView, everything else -> Span<const std::byte>).

Clean up the header a bit by putting all the declarations at the top of
the file.

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

45 hours agoFix CSS serialization issues affecting css-counter-styles tests
darin@apple.com [Sat, 19 Jun 2021 20:31:11 +0000 (20:31 +0000)]
Fix CSS serialization issues affecting css-counter-styles tests
https://bugs.webkit.org/show_bug.cgi?id=226708

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-counter-styles/counter-style-additive-symbols-syntax-expected.txt:
* web-platform-tests/css/css-counter-styles/counter-style-symbols-syntax-expected.txt:
* web-platform-tests/css/css-syntax/url-whitespace-consumption-expected.txt:
Updated to reflect progressions.

Source/WebCore:

Fix two serialization isssues affecting css-counter-styles tests:

1) URLs were serializing the full resolved URL, rather than the
   partial URL string from the style sheet.
2) Items in additive-symbols that had both an integer and a string
   would incorrectly serialize with a comma within the item.

* css/CSSCrossfadeValue.cpp:
(WebCore::CSSCrossfadeValue::valueWithStylesResolved): Added.
Calls resolveImageStyles on the image values.
* css/CSSCrossfadeValue.h: Updated for the above.

* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::CSSCursorImageValue): Changed the hot spot
to use std::optional instead of a separate boolean.
(WebCore::CSSCursorImageValue::create): Moved this out of the header
because it's not better for inlining to have it there.
(WebCore::CSSCursorImageValue::customCSSText const): Updated for the
m_hotSpot changes.
(WebCore::CSSCursorImageValue::updateCursorElement): Removed unneeded
check of hasFragmentIdentifier, which is already done by the
SVGURIReference::targetElementFromIRIString function. Updated to use
m_originalSpecifiedURLString, and added a FIXME about the strange way
this just keeps accumulating more and more clients in a set, but did
not change that behavior.
(WebCore::CSSCursorImageValue::cursorElementRemoved): Added a FIXME.
(WebCore::CSSCursorImageValue::cursorElementChanged): Updated for the
change to m_hotSpot and addded some FIXME.
(WebCore::CSSCursorImageValue::equals const): Updated for the m_hotSpot
change; much simpler since std::optional does the right thing.
(WebCore::CSSCursorImageValue::valueWithStylesResolved): Added.
Calls resolveImageStyles on the image value.
* css/CSSCursorImageValue.h: Updated for the above changes.

* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::valueWithStylesResolved): Added.
Calls resolveImageStyles on the image value and also calls
createFilterOperations.
* css/CSSFilterImageValue.h: Updated for the above.

* css/CSSGradientValue.cpp:
(WebCore::CSSGradientValue::valueWithStylesResolved): Renamed from
gradientWithStylesResolved.
* css/CSSGradientValue.h: Updated for the above.

* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::valueWithStylesResolved): Renamed from
imageSetWithStylesResolved. Optimized the case where the resolved
version is not different to re-use the original CSSImageSetValue.
* css/CSSImageSetValue.h: Updated for the above.

* css/CSSImageValue.cpp:
(WebCore::operator==): Added. Check if two ResolvedURL are equal.
(WebCore::makeResolvedURL): Added. Make a ResolvedURL from an
existing URL without the original specified string.
(WebCore::CSSImageValue::CSSImageValue): Take ResolvedURL instead
of a URL. Also updated to use std::optional instead of a separate
m_accessedImage boolean.
(WebCore::CSSImageValue::create): Added an overload that takes
ResolvedURL argument and also moved here from the header since we
don't get any benefit from inlining.
(WebCore::CSSImageValue::isPending const): Updates since m_cachedImage
is now a std::optional, and the std::nullopt case is used for this.
(WebCore::CSSImageValue::reresolvedURL const): Added. Used so we can
share code between the following functions.
(WebCore::CSSImageValue::valueWithStylesResolved): Added. Computes
the fully resolved URL and makes a new image value if needed that
always uses it. Also points the new value at the old one so we can
update m_cachedImage in both.
(WebCore::CSSImageValue::loadImage): Use the new reresolvedURL function.
Also update m_cachedImage in any underlying objects.
(WebCore::CSSImageValue::traverseSubresources): Updated for change
to m_cachedImage.
(WebCore::CSSImageValue::equals const): Updated for change to use
ResolvedURL.
(WebCore::CSSImageValue::customCSSText const): Ditto. This is the
only place where we use specifiedURLString.
(WebCore::CSSImageValue::createDeprecatedCSSOMWrapper const): Updated
for change from m_url.
(WebCore::CSSImageValue::knownToBeOpaque const): Updated for change
to m_cachedImage.
* css/CSSImageValue.h: Added ResolvedURL, new create
overloads. Replaced url() function with location() function, which
returns a string. Note that this always returns the resolved string,
only customCSSText returns the original string. Replaced m_url with
m_location, eliminated m_accessedImage and made m_cachedImage use
std::optional instead. Added m_unresolvedValue.

* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::completeURL const): Deleted unused function.
* css/StyleSheetContents.h: Ditto.

* css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::completeURL const): Updated to return
ResolvedURL instead of a URL.
* css/parser/CSSParserContext.h: Ditto.

* css/parser/CSSParserIdioms.cpp:
(WebCore::completeURL): Deleted unused function.
* css/parser/CSSParserIdioms.h: Ditto.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeCursor): Use std::optional for the hot spot.
(WebCore::consumeCounterStyleAdditiveSymbols): Put the integer/symbol
pair into a separate space-separated list instead of appending both
to the top level command-separated list. Also removed support for
non-standard "image without symbol" and "symbol without image".
Neither the specification nor the web platform tests currently call
for that.

* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeImage): Call the new
overload of CSSImageValue::create, passing a ResolvedURL.

* css/parser/CSSPropertyParserWorkerSafe.cpp:
(WebCore::CSSPropertyParserHelpersWorkerSafe::consumeFontFaceSrcURI):
Update for the change to completeURL and refactor a bit. Later we could
make the same kind of fix for CSSFontFaceSrcValue that we did in this
patch for CSSImageValue, but did not try that for now.

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::addCursor): Updated to take a std::optional for
the hot spot.
* rendering/style/RenderStyle.h: Ditto.

* rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::imageURL): Updated for CSSImageValue::imageURL.

* style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueContent): Call
resolveImageStyles consistently.

* style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::resolveImageStyles): Call the new
valueWithStylesResolved function on all the different image value
types. This unifies the approach across all 6 classes.
(WebCore::Style::BuilderState::createStyleImage): Tweaked style.

LayoutTests:

* fast/css/parse-border-image-repeat-null-crash-expected.txt: Update to reflect correct
path; the path is not really relevant to what was being tested here either way.

* fast/css/uri-token-parsing-expected.txt: Updated to expect behavior that is sensible
and also matches Firefox.
* fast/css/uri-token-parsing.html: Ditto.

* fast/fast/css/url-with-multi-byte-unicode-escape-expected.txt: Updated to expect that
URL is still encoded as UTF-8, not yet re-URL-encoded as it will be for loading. The
one that will be used for loading can still be seen in computed style. The test still
covers correclty parsig this URL.
* fast/fast/css/url-with-multi-byte-unicode-escape.html: Ditto.

* fast/filter-image/parse-filter-image-expected.txt: Updated to no longer test addition
of trailing slashes to peculiar URLs that are made by using filenames as host names.
Now this checks URLs that just contain filenames, which makes more logical sense, and
no trailing slash addition is expected.
* fast/filter-image/parse-filter-image.html: Ditto.

* fast/innerHTML/innerHTML-uri-resolution.html: Updated test to use computed style so
it no longer depends on WebKit-only behavior to run correctly.

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

2 days ago[Revert r278576] Put the Baseline JIT prologue and op_loop_hint code in JIT thunks.
mark.lam@apple.com [Sat, 19 Jun 2021 08:25:14 +0000 (08:25 +0000)]
[Revert r278576] Put the Baseline JIT prologue and op_loop_hint code in JIT thunks.
https://bugs.webkit.org/show_bug.cgi?id=226375

Not reviewed.

Suspect regresses Speedometer2.

* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::untagReturnAddress):
(JSC::AbstractMacroAssembler::untagReturnAddressWithoutExtraValidation): Deleted.
* assembler/MacroAssemblerARM64E.h:
(JSC::MacroAssemblerARM64E::untagReturnAddress):
(JSC::MacroAssemblerARM64E::untagReturnAddressWithoutExtraValidation): Deleted.
* assembler/MacroAssemblerARMv7.h:
* assembler/MacroAssemblerMIPS.h:
* bytecode/CodeBlock.h:
(JSC::CodeBlock::addressOfNumParameters):
(JSC::CodeBlock::offsetOfNumParameters):
(JSC::CodeBlock::offsetOfInstructionsRawPointer):
(JSC::CodeBlock::offsetOfNumCalleeLocals): Deleted.
(JSC::CodeBlock::offsetOfNumVars): Deleted.
(JSC::CodeBlock::offsetOfArgumentValueProfiles): Deleted.
(JSC::CodeBlock::offsetOfShouldAlwaysBeInlined): Deleted.
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::emitSaveCalleeSavesFor):
(JSC::AssemblyHelpers::emitSaveCalleeSavesForBaselineJIT): Deleted.
(JSC::AssemblyHelpers::emitRestoreCalleeSavesForBaselineJIT): Deleted.
* jit/JIT.cpp:
(JSC::JIT::compileAndLinkWithoutFinalizing):
(JSC::JIT::privateCompileExceptionHandlers):
(JSC::prologueGeneratorSelector): Deleted.
(JSC::JIT::prologueGenerator): Deleted.
(JSC::JIT::arityFixupPrologueGenerator): Deleted.
* jit/JIT.h:
* jit/JITInlines.h:
(JSC::JIT::emitNakedNearCall):
* jit/JITOpcodes.cpp:
(JSC::JIT::op_ret_handlerGenerator):
(JSC::JIT::emit_op_enter):
(JSC::JIT::op_enter_handlerGenerator):
(JSC::JIT::emit_op_loop_hint):
(JSC::JIT::emitSlow_op_loop_hint):
(JSC::JIT::op_enter_Generator): Deleted.
(JSC::JIT::op_enter_canBeOptimized_Generator): Deleted.
(JSC::JIT::op_enter_cannotBeOptimized_Generator): Deleted.
(JSC::JIT::op_loop_hint_Generator): Deleted.
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_enter):
* jit/ThunkGenerators.cpp:
(JSC::popThunkStackPreservesAndHandleExceptionGenerator):

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

2 days agoUnreviewed, reverting r278699.
commit-queue@webkit.org [Sat, 19 Jun 2021 07:19:27 +0000 (07:19 +0000)]
Unreviewed, reverting r278699.
https://bugs.webkit.org/show_bug.cgi?id=227174

Regressed JetStream2/WSL

Reverted changeset:

"[JSC] Remove useDataICInOptimizingJIT option"
https://bugs.webkit.org/show_bug.cgi?id=226862
https://trac.webkit.org/changeset/278699

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

2 days ago[WebIDL] Assigning a value outside the float range to a 'float' attribute should...
cdumez@apple.com [Sat, 19 Jun 2021 02:16:19 +0000 (02:16 +0000)]
[WebIDL] Assigning a value outside the float range to a 'float' attribute should throw a TypeError
https://bugs.webkit.org/show_bug.cgi?id=227146

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Rebaseline WPT test that is now fully passing.

* web-platform-tests/webaudio/the-audio-api/the-pannernode-interface/pannernode-setposition-throws-expected.txt:

Source/WebCore:

Assigning a value outside the float range to a 'float' attribute should throw a TypeError, as per:
- https://heycam.github.io/webidl/#es-float

Blink follows the specification but WebKit was just casting the double to a float. This patch
addresses this issue.

This patch also makes sure that values outside the float range properly get resolved to -Infinity
or Infinity if the attribute is of type 'unrestricted float', as per:
- https://heycam.github.io/webidl/#es-unrestricted-float

No new tests, updated existing tests.

* bindings/js/JSDOMConvertNumbers.h:
(WebCore::Converter<IDLFloat>::convert):
(WebCore::Converter<IDLUnrestrictedFloat>::convert):
* testing/TypeConversions.h:
(WebCore::TypeConversions::testFloat const):
(WebCore::TypeConversions::setTestFloat):
(WebCore::TypeConversions::testUnrestrictedFloat const):
(WebCore::TypeConversions::setTestUnrestrictedFloat):
* testing/TypeConversions.idl:

LayoutTests:

Add layout test coverage.

* js/dom/webidl-type-mapping-expected.txt:
* js/dom/webidl-type-mapping.html:

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

2 days ago[Curl] Add curl option CURLOPT_NOSIGNAL to omit numerous sigaction calls
commit-queue@webkit.org [Fri, 18 Jun 2021 20:41:38 +0000 (20:41 +0000)]
[Curl] Add curl option CURLOPT_NOSIGNAL to omit numerous sigaction calls
https://bugs.webkit.org/show_bug.cgi?id=227118

Patch by Soujyu TANAKA <soujyu.tanaka@access-company.com> on 2021-06-18
Reviewed by Fujii Hironori.

As we increase file handles registered by curl_multi_add_handle(),
number of times of sigaction executions in Curl grows rapidly. That can
cause unignorable download speed drop.

With a curl option CURLOPT_NOSIGNAL enabled, Curl doesn't use the
syscall to ignore SIGPIPE signals. It's safe as long as we configure to
prevent SIGPIPE from being triggered.

No new tests.

* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::CurlHandle):

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

2 days agoClear state after process crash so that we know to re-issue sandbox extensions
bfulgham@apple.com [Fri, 18 Jun 2021 20:36:37 +0000 (20:36 +0000)]
Clear state after process crash so that we know to re-issue sandbox extensions
https://bugs.webkit.org/show_bug.cgi?id=227103
<rdar://problem/77588760>

Reviewed by Tim Horton.

Follow-up patch that corrects a problem when switching between processes (for example, when
a provisional load moves to a committed load.) The parameters for the new process would fail
to pass the necessary sandbox extensions for the <attachment> element if they had been vended
to the provisional load. Instead, we should be checking if the new process has been given
the necessary extensions.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters): Use the new process, not the process state we are
copying from when deciding whether we need to extend sandbox powers to the new process.

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

2 days ago[css-logical] Fix cssom "set a CSS declaration" for logical properties
obrufau@igalia.com [Fri, 18 Jun 2021 19:44:30 +0000 (19:44 +0000)]
[css-logical] Fix cssom "set a CSS declaration" for logical properties
https://bugs.webkit.org/show_bug.cgi?id=226461

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

This test is now passing.

* web-platform-tests/css/cssom/cssstyledeclaration-setter-logical-expected.txt:

Source/WebCore:

Test: imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-setter-logical.html

Before this patch, setting a value to a property already in the list of
declarations, would just update its value, without reordering.

The problem was that the order is important when there is a mix of
logical and physical properties:

  el.style.paddingTop = "1px";
  el.style.paddingBlockStart = "2px";
  el.style.cssText; // "padding-top: 1px; padding-block-start: 2px"
  el.style.paddingTop = "3px";
  el.style.cssText; // "padding-top: 3px; padding-block-start: 2px"
  getComputedStyle(el).paddingTop; // "2px" -- no effect!

Therefore, this patch implements this part of the spec:
> If there are CSS declarations in declarations whose property name is
> in the same logical property group as property, but has a different
> mapping logic, target declaration must be at an index after all of
> those CSS declarations.

This change is based on this Chromium CL:
https://chromium-review.googlesource.com/c/chromium/src/+/2575081/

* css/CSSProperty.h:
* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::canUpdateInPlace const):
(WebCore::MutableStyleProperties::setProperty):
* css/StyleProperties.h:
* css/makeprop.pl:

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

2 days ago[iOS] Fullscreen video playback gets stuck after interacting with the playback controls
peng.liu6@apple.com [Fri, 18 Jun 2021 19:15:40 +0000 (19:15 +0000)]
[iOS] Fullscreen video playback gets stuck after interacting with the playback controls
https://bugs.webkit.org/show_bug.cgi?id=227047

Reviewed by Eric Carlson.

When we scrub a playing video, the video element may enter a temporarily stalled
state - the player is still playing, but it does not have enough data. In WebKit,
the `rate` of the player will be 0. But we cannot set the rate of `WebAVPlayerController`
to 0 in this case, because AVKit will believe the video playback is paused when
its rate is 0. In r261587, we defined a magic rate (0.00000001f) for this case.

Unfortunately, with the changes in r275956, `WebAVPlayerController` will
align its `defaultPlaybackRate` with `rate` when `rate` is not 0. Under stress
tests, e.g., keep scrubbing a video, a video element will eventually enter a state
in which both `defaultPlaybackRate` and `rate` are the magic rate. And the video
appears to be stuck for users.

To fix the issue, this patch removes the magic rate and defines a new state: `stalled`.
A video will be in the stalled state when it is playing but does not have enough data.
WebKit will only change the rate of `WebAVPlayerController` when the video
is not stalled.

To avoid potential problems due to the conversions between "float" and "double"
back and forth, this patch updates the types of `playbackRate` and `defaultPlaybackRate`.

Source/WebCore:

* platform/cocoa/PlaybackSessionModel.h:
(WebCore::PlaybackSessionModelClient::rateChanged):
* platform/cocoa/PlaybackSessionModelMediaElement.h:
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::updateForEventName):
(WebCore::PlaybackSessionModelMediaElement::setDefaultPlaybackRate):
(WebCore::PlaybackSessionModelMediaElement::setPlaybackRate):
(WebCore::PlaybackSessionModelMediaElement::defaultPlaybackRate const):
(WebCore::PlaybackSessionModelMediaElement::playbackRate const):
* platform/ios/PlaybackSessionInterfaceAVKit.h:
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
(WebCore::PlaybackSessionInterfaceAVKit::rateChanged):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::rateChanged):
(VideoFullscreenControllerContext::setDefaultPlaybackRate):
(VideoFullscreenControllerContext::setPlaybackRate):
(VideoFullscreenControllerContext::isStalled const):
(VideoFullscreenControllerContext::defaultPlaybackRate const):
(VideoFullscreenControllerContext::playbackRate const):
* platform/mac/PlaybackSessionInterfaceMac.h:
* platform/mac/PlaybackSessionInterfaceMac.mm:
(WebCore::PlaybackSessionInterfaceMac::rateChanged):
* platform/mac/VideoFullscreenInterfaceMac.h:
* platform/mac/VideoFullscreenInterfaceMac.mm:
(WebCore::VideoFullscreenInterfaceMac::rateChanged):

Source/WebKit:

* Scripts/webkit/messages.py:
(headers_for_type):
* UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
* UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
* UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
(WebKit::PlaybackSessionModelContext::setDefaultPlaybackRate):
(WebKit::PlaybackSessionModelContext::setPlaybackRate):
(WebKit::PlaybackSessionModelContext::rateChanged):
(WebKit::PlaybackSessionManagerProxy::rateChanged):
(WebKit::PlaybackSessionManagerProxy::setDefaultPlaybackRate):
(WebKit::PlaybackSessionManagerProxy::setPlaybackRate):
* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
* WebProcess/cocoa/PlaybackSessionManager.h:
* WebProcess/cocoa/PlaybackSessionManager.mm:
(WebKit::PlaybackSessionInterfaceContext::rateChanged):
(WebKit::PlaybackSessionManager::rateChanged):

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

2 days agoAdd a new pattern to B3ReduceStrength based on Bug 226984
commit-queue@webkit.org [Fri, 18 Jun 2021 18:25:50 +0000 (18:25 +0000)]
Add a new pattern to B3ReduceStrength based on Bug 226984
https://bugs.webkit.org/show_bug.cgi?id=227138

Patch by Yijia Huang <yijia_huang@apple.com> on 2021-06-18
Reviewed by Filip Pizlo.

In the previous patch bug 226984, a new pattern could be introduced to
B3ReduceStrength.cpp for further optimization, which is that:

dest = (src >> shiftAmount) & mask

is equivalent to

src >> shiftAmount

under these constraints:

1. shiftAmount >= 0
2. mask has a binary format in contiguous ones starting from the
   least significant bit.
3. shiftAmount + bitCount(mask) == maxBitWidth

For instance (32-bit):

(src >> 12) & 0x000fffff == src >> 12

This reduction is more beneficial than UBFX in this case.

// B3 IR
Int @0 = ArgumentReg(%0)
Int @1 = 12
Int @2 = ZShr(@0, @1)
Int @3 = 0x000fffff
Int @4 = BitAnd(@2, @3))
Void@5 = Return(@4, Terminal)

w/o the pattern:
// Old optimized AIR
Ubfx %0, $12, $20, %0, @4
Ret  %0,               @5

w/ the pattern:
// New optimized AIR
Urshift %0, $12, %0, @3
Ret32   %0,          @6

* b3/B3ReduceStrength.cpp:
* b3/testb3.h:
* b3/testb3_2.cpp:
(testBitAndZeroShiftRightImmMask32):
(testBitAndZeroShiftRightImmMask64):
(addBitTests):

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

3 days ago[DFG] Untyped branches should eliminate checks based on results from the AbstractInte...
rmorisset@apple.com [Fri, 18 Jun 2021 17:17:45 +0000 (17:17 +0000)]
[DFG] Untyped branches should eliminate checks based on results from the AbstractInterpreter
https://bugs.webkit.org/show_bug.cgi?id=227159

Reviewed by Filip Pizlo.

We currently emit a ton of code for Untyped branches, as we use branchIfTruthy which does not know anything about the abstract interpreter.
Even worse: we call branchIfTruthy after emitting some fast paths, and branchIfTruthy replicates these fast paths (Int32 and Booleans).
While I plan to reduce the number of Untyped branches in some separate patches, there is a very long tail of predicted types visible in benchmarks, so I expect some of them to remain no matter what, justifying making the code emitted in that case more reasonable.

The implementation in this patch is fairly straightforward, as it follows very closely branchOnValue() from AssemblyHelpers (which was previously called through branchIfTruthy).

It was tested on the JSC stress tests, as well as on JetStream2.

On JetStream2, it reduced the average number of bytes emitted for Branch by the DFG from 30.1 to 27.5 (highly significant, it only changes by about 0.1 between runs).
Since only about 1.5k branches are untyped out of 34k in that benchmark, it means that this patch reduces the amount of code emitted for untyped branches by about 50 bytes on average.

* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::branchDoubleZeroOrNaN):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::emitUntypedBranch):
(JSC::DFG::SpeculativeJIT::emitBranch):

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

3 days ago[iOS 14-Simulator WK2] editing/deleting/smart-delete-paragraph-004.html is a flaky...
ryanhaddad@apple.com [Fri, 18 Jun 2021 16:45:42 +0000 (16:45 +0000)]
[iOS 14-Simulator WK2] editing/deleting/smart-delete-paragraph-004.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=226906

Unreviewed test gardening.

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

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

3 days ago[MSE][GStreamer] Soundcloud serves MP4 audio with empty tfdt boxes
commit-queue@webkit.org [Fri, 18 Jun 2021 16:21:07 +0000 (16:21 +0000)]
[MSE][GStreamer] Soundcloud serves MP4 audio with empty tfdt boxes
https://bugs.webkit.org/show_bug.cgi?id=191419

Patch by Philippe Normand <pnormand@igalia.com> on 2021-06-18
Reviewed by Michael Catanzaro.

Source/WebCore:

When MSE is used the player receives broken audio fragments, perhaps because the server
expects the client to repair them. Not much we can do about this on GStreamer side though,
so behave as a Chrome UserAgent and then MSE is not used, the player receives an MP3 stream.

* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresChromeBrowser):

Tools:

* TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:
(TestWebKitAPI::TEST): Add a test for the soundcloud quirk.

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

3 days agoUnreviewed test gardening.
commit-queue@webkit.org [Fri, 18 Jun 2021 16:13:39 +0000 (16:13 +0000)]
Unreviewed test gardening.
https://bugs.webkit.org/show_bug.cgi?id=227168

Updated glib baseline/expectations.

Patch by Eleni Maria Stea <estea@igalia.com> on 2021-06-18

* platform/glib/TestExpectations:
* platform/glib/imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/margin-003-expected.txt: Removed.

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

3 days ago[WPE] Rework touch-based gesture controller
commit-queue@webkit.org [Fri, 18 Jun 2021 14:01:49 +0000 (14:01 +0000)]
[WPE] Rework touch-based gesture controller
https://bugs.webkit.org/show_bug.cgi?id=226456

Patch by Zan Dobersek <zdobersek@igalia.com> on 2021-06-18
Reviewed by Alejandro G. Castro.

Rename WPE's ScrollGestureController to TouchGestureController since now
it also handles production of touch-based click events.

TouchGestureController now internally manages all the related state,
tracking the touch interaction and determining whether it progresses
into a scrolling gesture or whether, upon finishing, it should be
translated into a simple click event.

In PageClientImpl, any unhandled event is pushed into
TouchGestureController and a variant of different outcomes is returned.
No-event result is ignored, and click or axis events are dispatched as
appropriate.

In WPEView, where the touch events arrive into the engine, we keep the
shortcut where touch events are piped directly into the controller if
said controller is already gesturing scrolling behavior. In that case
the touch events are not dispatched into the engine, with the exception
of touch-up events which are, to provide matching closure for the
touch-down events.

* SourcesWPE.txt:
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::doneWithTouchEvent):
* UIProcess/API/wpe/TouchGestureController.cpp: Renamed from Source/WebKit/UIProcess/API/wpe/ScrollGestureController.cpp.
(WebKit::TouchGestureController::handleEvent):
* UIProcess/API/wpe/TouchGestureController.h: Renamed from Source/WebKit/UIProcess/API/wpe/ScrollGestureController.h.
(WebKit::TouchGestureController::gesturedEvent const):
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::View::View):
(WKWPE::m_backend):
* UIProcess/API/wpe/WPEView.h:
(WKWPE::View::touchGestureController const):
(WKWPE::View::scrollGestureController const): Deleted.

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

3 days ago[LFC][WPE] Build failure with GCC 8.x
clopez@igalia.com [Fri, 18 Jun 2021 13:37:53 +0000 (13:37 +0000)]
[LFC][WPE] Build failure with GCC 8.x
https://bugs.webkit.org/show_bug.cgi?id=227166

Reviewed by Alan Bujtas.

The build fails with the error: converting to 'std::in_place_t' from initializer list
would use explicit constructor 'constexpr std::in_place_t::in_place_t()'

No new tests, is a build fix.

* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::prepareLayoutState):

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

3 days agoIgnore clangd's directory with index files
svillar@igalia.com [Fri, 18 Jun 2021 10:58:18 +0000 (10:58 +0000)]
Ignore clangd's directory with index files
https://bugs.webkit.org/show_bug.cgi?id=227162

Reviewed by Žan Doberšek.

clangd stores its indexes in a .cache directory. Let git ignore it.

* .gitignore:

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

3 days ago[GStreamer] imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-MediaEle...
commit-queue@webkit.org [Fri, 18 Jun 2021 10:35:40 +0000 (10:35 +0000)]
[GStreamer] imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-srcObject.https.html is failing since r273645
https://bugs.webkit.org/show_bug.cgi?id=223508

Patch by Philippe Normand <pnormand@igalia.com> on 2021-06-18
Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

Per spec, prevent seeks, playback rate changes and preload state updates on media elements backed by
the GStreamer MediaStream source element.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::seek):
(WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
(WebCore::MediaPlayerPrivateGStreamer::setPreload):
(WebCore::MediaPlayerPrivateGStreamer::maxMediaTimeSeekable const):

LayoutTests:

Unflag and add glib baseline for test now passing.

* platform/glib/TestExpectations:
* platform/glib/imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-srcObject.https-expected.txt: Added.

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

3 days ago[WebRTC][GStreamer] fast/mediastream/MediaStream-video-element-remove-track.html...
philn@webkit.org [Fri, 18 Jun 2021 08:29:09 +0000 (08:29 +0000)]
[WebRTC][GStreamer] fast/mediastream/MediaStream-video-element-remove-track.html is failing
https://bugs.webkit.org/show_bug.cgi?id=191886

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

Trigger source pad removal in the mediastream source element when a track has been removed.

* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(WebKitMediaStreamObserver::didRemoveTrack):

LayoutTests:

* platform/glib/TestExpectations: Unflag test now passing.

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

3 days ago[SOUP] Add Timing-Allow-Origin checks to NetworkDataTaskSoup
carlosgc@webkit.org [Fri, 18 Jun 2021 08:05:25 +0000 (08:05 +0000)]
[SOUP] Add Timing-Allow-Origin checks to NetworkDataTaskSoup
https://bugs.webkit.org/show_bug.cgi?id=227008
<rdar://problem/79384792>

Reviewed by Adrian Perez de Castro.

Source/WebKit:

Add missing TAO checks to Soup backend.

* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::create):
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
(WebKit::NetworkDataTaskSoup::didSendRequest):
(WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
* NetworkProcess/soup/NetworkDataTaskSoup.h:

LayoutTests:

* platform/glib/TestExpectations:

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

3 days ago[GTK][WPE] Unreviewed test gardening. Update baselines after r278974.
dpino@igalia.com [Fri, 18 Jun 2021 05:35:58 +0000 (05:35 +0000)]
[GTK][WPE] Unreviewed test gardening. Update baselines after r278974.

There are GTK and WPE tests that have the same text baseline but the
corresponding PNG image is different. In this case, I have preferred
to keep a specific text baseline for each port, instead of
promoting the text baseline to GLIB.

* platform/gtk/svg/text/foreignObject-repaint-expected.txt: Copied from LayoutTests/platform/glib/svg/text/foreignObject-repaint-expected.txt.
* platform/gtk/svg/text/foreignObject-text-clipping-bug-expected.png:
* platform/gtk/svg/text/foreignObject-text-clipping-bug-expected.txt:
* platform/gtk/svg/text/text-align-01-b-expected.png:
* platform/gtk/svg/text/text-align-01-b-expected.txt:
* platform/gtk/svg/text/text-align-02-b-expected.png:
* platform/gtk/svg/text/text-align-02-b-expected.txt:
* platform/gtk/svg/text/text-align-03-b-expected.png:
* platform/gtk/svg/text/text-align-03-b-expected.txt:
* platform/gtk/svg/text/text-align-04-b-expected.png:
* platform/gtk/svg/text/text-align-04-b-expected.txt:
* platform/gtk/svg/text/text-align-05-b-expected.png:
* platform/gtk/svg/text/text-align-05-b-expected.txt:
* platform/gtk/svg/text/text-align-06-b-expected.png:
* platform/gtk/svg/text/text-align-06-b-expected.txt:
* platform/gtk/svg/text/text-deco-01-b-expected.png:
* platform/gtk/svg/text/text-deco-01-b-expected.txt:
* platform/gtk/svg/text/text-fonts-01-t-expected.png:
* platform/gtk/svg/text/text-fonts-01-t-expected.txt:
* platform/gtk/svg/text/text-fonts-02-t-expected.png:
* platform/gtk/svg/text/text-fonts-02-t-expected.txt: Copied from LayoutTests/platform/glib/svg/text/text-fonts-02-t-expected.txt.
* platform/gtk/svg/text/text-intro-05-t-expected.png:
* platform/gtk/svg/text/text-intro-05-t-expected.txt: Copied from LayoutTests/platform/glib/svg/text/text-intro-05-t-expected.txt.
* platform/gtk/svg/text/text-path-01-b-expected.png:
* platform/gtk/svg/text/text-path-01-b-expected.txt:
* platform/gtk/svg/text/text-spacing-01-b-expected.png:
* platform/gtk/svg/text/text-spacing-01-b-expected.txt:
* platform/gtk/svg/text/text-text-01-b-expected.png:
* platform/gtk/svg/text/text-text-01-b-expected.txt: Copied from LayoutTests/platform/glib/svg/text/text-text-01-b-expected.txt.
* platform/gtk/svg/text/text-text-03-b-expected.png:
* platform/gtk/svg/text/text-text-03-b-expected.txt: Copied from LayoutTests/platform/glib/svg/text/text-text-03-b-expected.txt.
* platform/gtk/svg/text/text-text-05-t-expected.png:
* platform/gtk/svg/text/text-text-05-t-expected.txt: Copied from LayoutTests/platform/glib/svg/text/text-text-05-t-expected.txt.
* platform/gtk/svg/text/text-text-07-t-expected.png:
* platform/gtk/svg/text/text-text-07-t-expected.txt:
* platform/gtk/svg/text/text-text-08-b-expected.png:
* platform/gtk/svg/text/text-text-08-b-expected.txt:
* platform/gtk/svg/text/text-tref-01-b-expected.png:
* platform/gtk/svg/text/text-tref-01-b-expected.txt:
* platform/gtk/svg/text/text-tselect-01-b-expected.png:
* platform/gtk/svg/text/text-tselect-01-b-expected.txt:
* platform/gtk/svg/text/text-tspan-01-b-expected.png:
* platform/gtk/svg/text/text-tspan-01-b-expected.txt:
* platform/gtk/svg/text/text-ws-01-t-expected.png:
* platform/gtk/svg/text/text-ws-01-t-expected.txt: Copied from LayoutTests/platform/glib/svg/text/text-ws-01-t-expected.txt.
* platform/gtk/svg/text/text-ws-02-t-expected.png:
* platform/gtk/svg/text/text-ws-02-t-expected.txt: Copied from LayoutTests/platform/glib/svg/text/text-ws-02-t-expected.txt.
* platform/gtk/svg/text/textPathBoundsBug-expected.txt: Copied from LayoutTests/platform/glib/svg/text/textPathBoundsBug-expected.txt.
* platform/wpe/svg/text/foreignObject-repaint-expected.png: Added.
* platform/wpe/svg/text/foreignObject-repaint-expected.txt: Renamed from LayoutTests/platform/glib/svg/text/foreignObject-repaint-expected.txt.
* platform/wpe/svg/text/foreignObject-text-clipping-bug-expected.png: Added.
* platform/wpe/svg/text/foreignObject-text-clipping-bug-expected.txt:
* platform/wpe/svg/text/text-align-01-b-expected.png: Added.
* platform/wpe/svg/text/text-align-01-b-expected.txt:
* platform/wpe/svg/text/text-align-02-b-expected.png: Added.
* platform/wpe/svg/text/text-align-02-b-expected.txt:
* platform/wpe/svg/text/text-align-03-b-expected.png: Added.
* platform/wpe/svg/text/text-align-03-b-expected.txt:
* platform/wpe/svg/text/text-align-04-b-expected.png: Added.
* platform/wpe/svg/text/text-align-04-b-expected.txt:
* platform/wpe/svg/text/text-align-05-b-expected.png: Added.
* platform/wpe/svg/text/text-align-05-b-expected.txt:
* platform/wpe/svg/text/text-align-06-b-expected.png: Added.
* platform/wpe/svg/text/text-align-06-b-expected.txt:
* platform/wpe/svg/text/text-deco-01-b-expected.png: Added.
* platform/wpe/svg/text/text-deco-01-b-expected.txt:
* platform/wpe/svg/text/text-fonts-01-t-expected.png: Added.
* platform/wpe/svg/text/text-fonts-01-t-expected.txt:
* platform/wpe/svg/text/text-fonts-02-t-expected.png: Added.
* platform/wpe/svg/text/text-fonts-02-t-expected.txt: Renamed from LayoutTests/platform/glib/svg/text/text-fonts-02-t-expected.txt.
* platform/wpe/svg/text/text-intro-05-t-expected.png: Added.
* platform/wpe/svg/text/text-intro-05-t-expected.txt: Renamed from LayoutTests/platform/glib/svg/text/text-intro-05-t-expected.txt.
* platform/wpe/svg/text/text-path-01-b-expected.png: Added.
* platform/wpe/svg/text/text-path-01-b-expected.txt:
* platform/wpe/svg/text/text-spacing-01-b-expected.png: Added.
* platform/wpe/svg/text/text-spacing-01-b-expected.txt:
* platform/wpe/svg/text/text-text-01-b-expected.png: Added.
* platform/wpe/svg/text/text-text-01-b-expected.txt: Renamed from LayoutTests/platform/glib/svg/text/text-text-01-b-expected.txt.
* platform/wpe/svg/text/text-text-03-b-expected.png: Added.
* platform/wpe/svg/text/text-text-03-b-expected.txt: Renamed from LayoutTests/platform/glib/svg/text/text-text-03-b-expected.txt.
* platform/wpe/svg/text/text-text-05-t-expected.png: Added.
* platform/wpe/svg/text/text-text-05-t-expected.txt: Renamed from LayoutTests/platform/glib/svg/text/text-text-05-t-expected.txt.
* platform/wpe/svg/text/text-text-07-t-expected.png: Added.
* platform/wpe/svg/text/text-text-07-t-expected.txt:
* platform/wpe/svg/text/text-text-08-b-expected.png: Added.
* platform/wpe/svg/text/text-text-08-b-expected.txt:
* platform/wpe/svg/text/text-tref-01-b-expected.png: Added.
* platform/wpe/svg/text/text-tref-01-b-expected.txt: Copied from LayoutTests/platform/gtk/svg/text/text-tref-01-b-expected.txt.
* platform/wpe/svg/text/text-tselect-01-b-expected.png: Added.
* platform/wpe/svg/text/text-tselect-01-b-expected.txt:
* platform/wpe/svg/text/text-tspan-01-b-expected.png: Added.
* platform/wpe/svg/text/text-tspan-01-b-expected.txt:
* platform/wpe/svg/text/text-ws-01-t-expected.png: Added.
* platform/wpe/svg/text/text-ws-01-t-expected.txt: Renamed from LayoutTests/platform/glib/svg/text/text-ws-01-t-expected.txt.
* platform/wpe/svg/text/text-ws-02-t-expected.png: Added.
* platform/wpe/svg/text/text-ws-02-t-expected.txt: Renamed from LayoutTests/platform/glib/svg/text/text-ws-02-t-expected.txt.
* platform/wpe/svg/text/textPathBoundsBug-expected.png: Added.
* platform/wpe/svg/text/textPathBoundsBug-expected.txt: Renamed from LayoutTests/platform/glib/svg/text/textPathBoundsBug-expected.txt.
* platform/wpe/tables/mozilla/bugs/bug106795-expected.png: Added.
* platform/wpe/tables/mozilla/bugs/bug82946-2-expected.png: Added.

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

3 days ago[Cocoa] Disable hardware decoding in the WebProcess
said@apple.com [Fri, 18 Jun 2021 04:09:24 +0000 (04:09 +0000)]
[Cocoa] Disable hardware decoding in the WebProcess
https://bugs.webkit.org/show_bug.cgi?id=226869
<rdar://77548905>

Reviewed by Per Arne Vollan and Simon Fraser.

Source/WebCore:

Pass kCGImageSourceEnableRestrictedDecoding : kCFBooleanTrue when decoding
an image frame.

Test: fast/images/heic-as-background-image.html

* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::createImageSourceOptions):

Source/WebCore/PAL:

SoftLink
1. VTRestrictVideoDecoders from VideoToolbox
2. FigPhotoSupportsHEVCHWDecode from MediaToobox

* PAL.xcodeproj/project.pbxproj:
* pal/cf/VideoToolboxSoftLink.cpp:
* pal/cf/VideoToolboxSoftLink.h:
* pal/cocoa/MediaToolboxSoftLink.cpp:
* pal/cocoa/MediaToolboxSoftLink.h:
* pal/spi/cg/ImageIOSPI.h:
* pal/spi/cocoa/VideoToolboxSPI.h: Added.

Source/WebKit:

Restrict video decoders and disable hardware image decoders.

A temp extension is created for the service "com.apple.trustd.agent" to
allow temporarily calling FigPhotoSupportsHEVCHWDecode(). This function
needs access this service but we have recently closed access to it.

FigPhotoSupportsHEVCHWDecode() sets a local static variable by using the
service "com.apple.trustd.agent" when it is called for the first time.
Our purpose of calling it in this context is to initialize the static
variable only. And this is why we do not use its return value.

This solution is fragile. If MediaToolbox is changed such that it needs
'com.apple.trustd.agent' while decoding an image, the decoding will fail.

* 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):
(WebKit::restrictImageAndVideoDecoders):
(WebKit::WebProcess::initializeSandbox):

Source/WTF:

Add have macros for using:
1. kCGImageSourceEnableRestrictedDecoding
2. VTRestrictVideoDecoders()

* wtf/PlatformHave.h:

LayoutTests:

Add a reference test for rendering the HEIF images.

* TestExpectations:
* fast/images/heic-as-background-image-expected.html: Added.
* fast/images/heic-as-background-image.html: Added.
* fast/images/resources/green-400x400.heic: Added.
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:

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

3 days agoRename numberOfPACBits to maxNumberOfAllowedPACBits.
mark.lam@apple.com [Fri, 18 Jun 2021 02:06:58 +0000 (02:06 +0000)]
Rename numberOfPACBits to maxNumberOfAllowedPACBits.
https://bugs.webkit.org/show_bug.cgi?id=227156

Reviewed by Saam Barati.

Source/JavaScriptCore:

Just renaming the constant to better describe what it represents.  There are no
behavior changes.

* assembler/MacroAssemblerARM64E.h:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::cageWithoutUntagging):
(JSC::AssemblyHelpers::cageConditionallyAndUntag):
* llint/LowLevelInterpreter64.asm:

Source/WTF:

* wtf/CagedPtr.h:

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

3 days agoDefine MacroAssemblerARM64E::numberOfPACBits based on OS_CONSTANT(EFFECTIVE_ADDRESS_W...
mark.lam@apple.com [Fri, 18 Jun 2021 01:44:42 +0000 (01:44 +0000)]
Define MacroAssemblerARM64E::numberOfPACBits based on OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH).
https://bugs.webkit.org/show_bug.cgi?id=227147
rdar://78785309

Reviewed by Saam Barati.

Source/bmalloc:

For OS(DARWIN), define BOS_EFFECTIVE_ADDRESS_WIDTH in terms of MACH_VM_MAX_ADDRESS,
which is provided by the SDK.  This ensures that it is correct for each target
OS(DARWIN) platform.

* bmalloc/Algorithm.h:
(bmalloc::clzConstexpr):
(bmalloc::getMSBSetConstexpr):
* bmalloc/BPlatform.h:
* bmalloc/Gigacage.h:
* bmalloc/ObjectTypeTable.h:
* bmalloc/Packed.h:

Source/JavaScriptCore:

* assembler/MacroAssemblerARM64E.h:
* bytecode/CodeOrigin.h:
* runtime/JSString.h:
* runtime/OptionsList.h:

Source/WTF:

For OS(DARWIN), define OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH) in terms of
MACH_VM_MAX_ADDRESS, which is provided by the SDK.  This ensures that it is
correct for each target OS(DARWIN) platform.

Also update an assertion in WTFAssertions.cpp to verify that address bits are
less than 48.  The purpose of this assertion is to ensure that our 64-bit NaN
boxing encoding for JSValues will work.  Hence, we should use the encoding limit
for pointers of 48 bits.  It no longer makes sense to assert based on
OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH), because OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH)
is defined in terms of MACH_VM_MAX_ADDRESS.

* wtf/CagedPtr.h:
* wtf/CompactPointerTuple.h:
* wtf/PlatformOS.h:
* wtf/WTFAssertions.cpp:
* wtf/threads/Signals.cpp:

Tools:

* TestWebKitAPI/Tests/WTF/Packed.cpp:

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

3 days ago[Win] WTF.ParseInteger and WTF.ParseIntegerAllowingTrailingJunk are failing
Hironori.Fujii@sony.com [Fri, 18 Jun 2021 01:27:53 +0000 (01:27 +0000)]
[Win] WTF.ParseInteger and WTF.ParseIntegerAllowingTrailingJunk are failing
https://bugs.webkit.org/show_bug.cgi?id=227090

Reviewed by Yusuke Suzuki.

Source/WTF:

ArithmeticOperations::sub unexpectedly reported an overflow for
the result of std::numeric_limits<ResultType>::min() in MSVC code path.
For example, Checked<int, RecordOverflow>(INT_MIN + 1) - 1 was reported an overflow.

In the case of calculating (lhs - rhs), and lhs < 0 and rhs > 0,
the original code reported an overflow if (rhs > max() + lhs).
Mathematically, this condition checks (lhs - rhs < -max()).
It should use min() instead of max() in this case. It should be
(lhs - rhs < min()) mathematically.

* wtf/CheckedArithmetic.h:

Tools:

* TestWebKitAPI/Tests/WTF/CheckedArithmeticOperations.cpp:
(TestWebKitAPI::AllowMixedSignednessTest::run):

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

3 days agoAdd support for IDBCursor.request
cdumez@apple.com [Fri, 18 Jun 2021 00:26:11 +0000 (00:26 +0000)]
Add support for IDBCursor.request
https://bugs.webkit.org/show_bug.cgi?id=227152

Reviewed by Geoffrey Garen.

LayoutTests/imported/w3c:

Rebaseline some WPT tests now that they are passing.

* web-platform-tests/IndexedDB/idbcursor-request.any-expected.txt:
* web-platform-tests/IndexedDB/idbcursor-request.any.worker-expected.txt:
* web-platform-tests/IndexedDB/idlharness.any-expected.txt:
* web-platform-tests/IndexedDB/idlharness.any.worker-expected.txt:

Source/WebCore:

Add support for IDBCursor.request:
- https://w3c.github.io/IndexedDB/#dom-idbcursor-request

Both Blink and Gecko already support this.

No new tests, rebaselined existing tests.

* Modules/indexeddb/IDBCursor.idl:

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

3 days agoAdd assertion in RunLoop::dispatch
achristensen@apple.com [Fri, 18 Jun 2021 00:00:29 +0000 (00:00 +0000)]
Add assertion in RunLoop::dispatch
https://bugs.webkit.org/show_bug.cgi?id=227154
<rdar://79243769>

Reviewed by Geoff Garen.

This should help us find what is scheduling null functions.

* wtf/RunLoop.cpp:
(WTF::RunLoop::dispatch):
(WTF::RunLoop::dispatchAfter):

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

3 days agoSkip WebXR tests on iOS
commit-queue@webkit.org [Thu, 17 Jun 2021 23:39:50 +0000 (23:39 +0000)]
Skip WebXR tests on iOS
https://bugs.webkit.org/show_bug.cgi?id=227151

Patch by Ada Chan <ada.chan@apple.com> on 2021-06-17
Reviewed by Tim Horton.

* platform/ios/TestExpectations:

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

3 days agoUnreviewed, reverting r279011.
commit-queue@webkit.org [Thu, 17 Jun 2021 23:21:40 +0000 (23:21 +0000)]
Unreviewed, reverting r279011.
https://bugs.webkit.org/show_bug.cgi?id=227153

broke ios build

Reverted changeset:

"[Mac] libwebrtc CMBaseClass objects need alignment fixup"
https://bugs.webkit.org/show_bug.cgi?id=227137
https://trac.webkit.org/changeset/279011

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

3 days agoEnable some more release logging in for ephemeral sessions
cdumez@apple.com [Thu, 17 Jun 2021 22:40:07 +0000 (22:40 +0000)]
Enable some more release logging in for ephemeral sessions
https://bugs.webkit.org/show_bug.cgi?id=227142

Reviewed by Eric Carlson.

Enable some more release logging in for ephemeral sessions, to faciliate debugging.

Source/WebCore:

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::SWServer):

Source/WebKit:

* GPUProcess/GPUConnectionToWebProcess.cpp:
(WebKit::GPUConnectionToWebProcess::isAlwaysOnLoggingAllowed const): Deleted.
* GPUProcess/GPUConnectionToWebProcess.h:
(WebKit::GPUConnectionToWebProcess::sessionID const):
* GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
(WebKit::RemoteMediaPlayerManagerProxy::logger):
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::insertObservedDomain):
(WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const):
(WebKit::ResourceLoadStatisticsDatabaseStore::domainID const):
(WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList):
(WebKit::ResourceLoadStatisticsDatabaseStore::populateFromMemoryStore):
(WebKit::ResourceLoadStatisticsDatabaseStore::mergeStatistic):
(WebKit::ResourceLoadStatisticsDatabaseStore::mergeStatistics):
(WebKit::ResourceLoadStatisticsDatabaseStore::incrementRecordsDeletedCountForDomains):
(WebKit::ResourceLoadStatisticsDatabaseStore::recursivelyFindNonPrevalentDomainsThatRedirectedToThisDomain):
(WebKit::ResourceLoadStatisticsDatabaseStore::markAsPrevalentIfHasRedirectedToPrevalent):
(WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess):
(WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
(WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess):
(WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccessInternal):
(WebKit::ResourceLoadStatisticsDatabaseStore::grandfatherDataForDomains):
(WebKit::ResourceLoadStatisticsDatabaseStore::ensurePrevalentResourcesForDebugMode):
(WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation):
(WebKit::ResourceLoadStatisticsDatabaseStore::logCrossSiteLoadWithLinkDecoration):
(WebKit::ResourceLoadStatisticsDatabaseStore::clearTopFrameUniqueRedirectsToSinceSameSiteStrictEnforcement):
(WebKit::ResourceLoadStatisticsDatabaseStore::setUserInteraction):
(WebKit::ResourceLoadStatisticsDatabaseStore::logUserInteraction):
(WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction):
(WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):
(WebKit::ResourceLoadStatisticsDatabaseStore::setPrevalentResource):
(WebKit::ResourceLoadStatisticsDatabaseStore::setDomainsAsPrevalent):
(WebKit::ResourceLoadStatisticsDatabaseStore::predicateValueForDomain const):
(WebKit::ResourceLoadStatisticsDatabaseStore::clearPrevalentResource):
(WebKit::ResourceLoadStatisticsDatabaseStore::setGrandfathered):
(WebKit::ResourceLoadStatisticsDatabaseStore::setIsScheduledForAllButCookieDataRemoval):
(WebKit::ResourceLoadStatisticsDatabaseStore::getMostRecentlyUpdatedTimestamp const):
(WebKit::ResourceLoadStatisticsDatabaseStore::setSubframeUnderTopFrameDomain):
(WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUnderTopFrameDomain):
(WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectTo):
(WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectFrom):
(WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectTo):
(WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectFrom):
(WebKit::ResourceLoadStatisticsDatabaseStore::ensureResourceStatisticsForRegistrableDomain):
(WebKit::ResourceLoadStatisticsDatabaseStore::removeDataForDomain):
(WebKit::ResourceLoadStatisticsDatabaseStore::cookieAccess):
(WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt):
(WebKit::ResourceLoadStatisticsDatabaseStore::clearGrandfathering):
(WebKit::ResourceLoadStatisticsDatabaseStore::pruneStatisticsIfNeeded):
(WebKit::ResourceLoadStatisticsDatabaseStore::updateLastSeen):
(WebKit::ResourceLoadStatisticsDatabaseStore::setLastSeen):
(WebKit::ResourceLoadStatisticsDatabaseStore::setVeryPrevalentResource):
(WebKit::ResourceLoadStatisticsDatabaseStore::updateDataRecordsRemoved):
(WebKit::ResourceLoadStatisticsDatabaseStore::isCorrectSubStatisticsCount):
(WebKit::ResourceLoadStatisticsDatabaseStore::getDomainStringFromDomainID const):
(WebKit::ResourceLoadStatisticsDatabaseStore::appendSubStatisticList const):
(WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString const):
(WebKit::ResourceLoadStatisticsDatabaseStore::domainIDExistsInDatabase):
(WebKit::ResourceLoadStatisticsDatabaseStore::updateOperatingDatesParameters):
(WebKit::ResourceLoadStatisticsDatabaseStore::includeTodayAsOperatingDateIfNecessary):
(WebKit::ResourceLoadStatisticsDatabaseStore::insertExpiredStatisticForTesting):
(WebKit::ResourceLoadStatisticsDatabaseStore::findPrivateClickMeasurement):
(WebKit::ResourceLoadStatisticsDatabaseStore::insertPrivateClickMeasurement):
(WebKit::ResourceLoadStatisticsDatabaseStore::markAllUnattributedPrivateClickMeasurementAsExpiredForTesting):
(WebKit::ResourceLoadStatisticsDatabaseStore::removeUnattributed):
(WebKit::ResourceLoadStatisticsDatabaseStore::allAttributedPrivateClickMeasurement):
(WebKit::ResourceLoadStatisticsDatabaseStore::clearPrivateClickMeasurement):
(WebKit::ResourceLoadStatisticsDatabaseStore::clearExpiredPrivateClickMeasurement):
(WebKit::ResourceLoadStatisticsDatabaseStore::privateClickMeasurementToString):
(WebKit::ResourceLoadStatisticsDatabaseStore::clearSentAttribution):
(WebKit::ResourceLoadStatisticsDatabaseStore::markAttributedPrivateClickMeasurementsAsExpiredForTesting):
* UIProcess/API/Cocoa/WKWebView.mm:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::getNetworkProcessConnection):
* WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
(WebKit::WebURLSchemeTaskProxy::startLoading):
(WebKit::WebURLSchemeTaskProxy::stopLoading):
(WebKit::WebURLSchemeTaskProxy::didPerformRedirection):
(WebKit::WebURLSchemeTaskProxy::didReceiveResponse):
(WebKit::WebURLSchemeTaskProxy::didReceiveData):
(WebKit::WebURLSchemeTaskProxy::didComplete):

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

3 days ago[Metal ANGLE] Shaders with reserved metal keywords do not translate, nor do shaders...
kpiddington@apple.com [Thu, 17 Jun 2021 22:35:36 +0000 (22:35 +0000)]
[Metal ANGLE] Shaders with reserved metal keywords do not translate, nor do shaders with struct and variable names that are the same except prefixed by an underscore
https://bugs.webkit.org/show_bug.cgi?id=226660

Source/ThirdParty/ANGLE:

Fix keyword translation problem by correcting symbol space. This avoids renaming structs unnecessarily

Reviewed by Dean Jackson.

* src/compiler/translator/TranslatorMetalDirect/RewriteKeywords.cpp:
(sh::Rewriter::createRenamed):

LayoutTests:

Reviewed by Dean Jackson.

* fast/canvas/webgl/shader-with-reserved-keyword-expected.txt: Added.
* fast/canvas/webgl/shader-with-reserved-keyword.html: Added.

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

3 days agoResync DOM WPT tests from upstream
cdumez@apple.com [Thu, 17 Jun 2021 22:20:37 +0000 (22:20 +0000)]
Resync DOM WPT tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=227144

Reviewed by Geoffrey Garen.

LayoutTests/imported/w3c:

Resync DOM WPT tests from upstream ec5c1fc86b65142e7b.

* resources/resource-files.json:
* web-platform-tests/dom/*: Updated.
* web-platform-tests/interfaces/dom.idl:

LayoutTests:

* TestExpectations:
* tests-options.json:

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

3 days agoClear state after process crash so that we know to re-issue sandbox extensions
bfulgham@apple.com [Thu, 17 Jun 2021 22:14:17 +0000 (22:14 +0000)]
Clear state after process crash so that we know to re-issue sandbox extensions
https://bugs.webkit.org/show_bug.cgi?id=227103
<rdar://problem/77588760>

Reviewed by Per Arne Vollan.

We dynamically extend access to certain mach services when the ATTACHMENT_ELEMENT feature
is enabled. If a process with this feature activated crashes and WebKit relaunches it, we
don't grant the new process the same extensions because we believe they were already
previously sent.

This patch clears the state after a process crash so that it properly handles the restart case.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::shutDown): Clear state.
(WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch): Clear state.

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

3 days agoMake microbenchmarks/delete-property-from-prototype-chain not time out on debug builds
sbarati@apple.com [Thu, 17 Jun 2021 22:12:53 +0000 (22:12 +0000)]
Make microbenchmarks/delete-property-from-prototype-chain not time out on debug builds
https://bugs.webkit.org/show_bug.cgi?id=227148

Reviewed by Mark Lam.

* microbenchmarks/delete-property-from-prototype-chain.js:

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

3 days ago[resultsdbpy] Adopt autoinstaller
jbedard@apple.com [Thu, 17 Jun 2021 22:03:03 +0000 (22:03 +0000)]
[resultsdbpy] Adopt autoinstaller
https://bugs.webkit.org/show_bug.cgi?id=227096
<rdar://problem/79418080>

Rubber-stamped by Aakash Jain.

* Scripts/libraries/resultsdbpy/container: Moved from insdie library.
* Scripts/libraries/resultsdbpy/resultsdbpy/__init__.py: Register required libraries.
* Scripts/libraries/resultsdbpy/resultsdbpy/container: Moved to containing folder.
* Scripts/libraries/resultsdbpy/resultsdbpy/example/main.py:
* Scripts/libraries/resultsdbpy/resultsdbpy/run: Moved to containing folder.
* Scripts/libraries/resultsdbpy/resultsdbpy/view/view_routes_unittest.py: Use specific imports
* Scripts/libraries/resultsdbpy/run: Moved from insdie library.
* Scripts/libraries/resultsdbpy/run-tests: Use autoinstalled libraries.
* Scripts/libraries/resultsdbpy/setup.py: Bump version.

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

3 days ago[Mac] libwebrtc CMBaseClass objects need alignment fixup
eric.carlson@apple.com [Thu, 17 Jun 2021 22:01:55 +0000 (22:01 +0000)]
[Mac] libwebrtc CMBaseClass objects need alignment fixup
https://bugs.webkit.org/show_bug.cgi?id=227137

Reviewed by Youenn Fablet.

* Source/webrtc/sdk/WebKit/WebKitVP8Decoder.cpp:
(webrtc::createWebKitVP8Decoder): Add padding to the CMBaseClass object on x86_64
so function pointers are naturally aligned. Add static_asserts to ensure alignment
and sizes are correct.
* Source/webrtc/sdk/WebKit/WebKitVP9Decoder.cpp:
(webrtc::createWebKitVP9Decoder): Ditto.

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

3 days agoCrash in WebCore::SlotAssignment::assignedNodesForSlot
rniwa@webkit.org [Thu, 17 Jun 2021 21:55:22 +0000 (21:55 +0000)]
Crash in WebCore::SlotAssignment::assignedNodesForSlot
https://bugs.webkit.org/show_bug.cgi?id=224408
<rdar://problem/76805764>

Reviewed by Michael Catanzaro.

Source/WebCore:

Like webkit.org/b/225684, the release assertion failure was caused by RenderTreeUpdater::tearDownRenderers
traversing the slot element for which we're currently calling Element::insertedIntoAncestor but had not yet
called SlotAssignment::addSlotElementByName.

Fixed the bug by returning early in SlotAssignment::assignedNodesForSlot when this condition holds,
which is when the shadow root is connected to a document and HTMLSlotElement is in the middle of
HTMLSlotElement::insertedIntoAncestor.

It's not the most elegant solution but staying safe for now.

Test: fast/shadow-dom/insert-slot-child-of-shadow-host-render-tree-invalidation-crash.html

* dom/SlotAssignment.cpp:
(WebCore::SlotAssignment::assignedNodesForSlot):
* html/HTMLSlotElement.cpp:
(WebCore::HTMLSlotElement::insertedIntoAncestor):
* html/HTMLSlotElement.h:
(WebCore::HTMLSlotElement::isInInsertedIntoAncestor): Added.

LayoutTests:

Added a regression test.

* fast/shadow-dom/insert-slot-child-of-shadow-host-render-tree-invalidation-crash-expected.txt: Added.
* fast/shadow-dom/insert-slot-child-of-shadow-host-render-tree-invalidation-crash.html: Added.

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

3 days ago[webkitcorepy] Retry downloads in Autoinstall
jbedard@apple.com [Thu, 17 Jun 2021 21:27:17 +0000 (21:27 +0000)]
[webkitcorepy] Retry downloads in Autoinstall
https://bugs.webkit.org/show_bug.cgi?id=227134
<rdar://problem/79462182>

Reviewed by Aakash Jain.

* Scripts/libraries/webkitcorepy/setup.py: Bump version.
* Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py: Ditto.
* Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py:
(Package.Archive.download): Retry failed downloads
(AutoInstall): Allow for a single retry by default

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

3 days agoReimplement JSC::CachePayload without FileSystem::unmapViewOfFile and FileSystem...
Hironori.Fujii@sony.com [Thu, 17 Jun 2021 21:12:45 +0000 (21:12 +0000)]
Reimplement JSC::CachePayload without FileSystem::unmapViewOfFile and FileSystem::MappedFileData::leakHandle
https://bugs.webkit.org/show_bug.cgi?id=227014

Reviewed by Yusuke Suzuki.

r247542 (Bug 199759) added FileSystem::unmapViewOfFile and
FileSystem::MappedFileData::leakHandle for JSC::CachePayload to
get the mapped address and to free the address.

However, Bug 227011 is going to add a file mapping handle to
FileSystem::MappedFileData for Windows port to create a
SharedMemory from a MappedFileData. Destruction of MappedFileData
should be done only by MappedFileData dtor.

* runtime/CachePayload.cpp:
(JSC::CachePayload::makeMappedPayload):
(JSC::CachePayload::makeMallocPayload):
(JSC::CachePayload::makeEmptyPayload):
(JSC::CachePayload::CachePayload):
(JSC::CachePayload::data const):
(JSC::CachePayload::size const):
(JSC::CachePayload::~CachePayload): Deleted.
(JSC::CachePayload::operator=): Deleted.
(JSC::CachePayload::freeData): Deleted.
* runtime/CachePayload.h: Use Variant for data.
(JSC::CachePayload::data const): Deleted.
(JSC::CachePayload::size const): Deleted.
(JSC::CachePayload::CachePayload): Deleted.

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

3 days agoRemove Mac-specific CPUTime functions
nham@apple.com [Thu, 17 Jun 2021 20:49:31 +0000 (20:49 +0000)]
Remove Mac-specific CPUTime functions
https://bugs.webkit.org/show_bug.cgi?id=227109

Reviewed by Yusuke Suzuki.

Source/WebKit:

Permit calling thread_selfusage, since it is used by clock_gettime(CLOCK_THREAD_CPUTIME_ID, tp).

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

Source/WTF:

There's no reason for the Mac-specific CPU time functions to exist, since getrusage and
clock_gettime work fine on Mac. It's actually slightly more efficient to use the POSIX calls
since getrusage returns CPU time for both current and terminated threads in a single
syscall, while using task_info requires two syscalls to do the same thing.

* WTF.xcodeproj/project.pbxproj:
* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformPlayStation.cmake:
* wtf/PlatformWPE.cmake:
* wtf/cocoa/CPUTimeCocoa.cpp: Removed.
* wtf/posix/CPUTimePOSIX.cpp: Renamed from Source/WTF/wtf/unix/CPUTimeUnix.cpp.

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

3 days agoTrying to take empty snapshots of the view should not cause crashes
cdumez@apple.com [Thu, 17 Jun 2021 20:48:44 +0000 (20:48 +0000)]
Trying to take empty snapshots of the view should not cause crashes
https://bugs.webkit.org/show_bug.cgi?id=227133

Reviewed by Tim Horton.

Source/WebKit:

Trying to take empty snapshots of the view should not cause crashes. We would previously
see crashes because:
1. We would end up doing divisions by zero
2. We would hit the ASSERT(size) in SharedMemory::allocate().

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):

Tools:

Add API test coverage.

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

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

3 days ago[iOS 15] Add iOS 15 simulator/device to bot watchers' dashboard
commit-queue@webkit.org [Thu, 17 Jun 2021 20:07:14 +0000 (20:07 +0000)]
[iOS 15] Add iOS 15 simulator/device to bot watchers' dashboard
https://bugs.webkit.org/show_bug.cgi?id=226779

Patch by W.D. Xiong <w_xiong@apple.com> on 2021-06-17
Reviewed by Jonathan Bedard.

* CISupport/build-webkit-org/public_html/dashboard/Images/IOS15.png: Added.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS15Simulator.png: Added.
* CISupport/build-webkit-org/public_html/dashboard/Scripts/Dashboard.js: Added references to iOS 15 device + simulator, shifted ordering down
* CISupport/build-webkit-org/public_html/dashboard/Styles/Main.css: Added references to iOS 15 device + simulator
(table.queue-grid tr.platform.ios-simulator-15 img.logo):
(table.queue-grid tr.platform.ios-15 img.logo):

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

3 days agoStorage Access quirks should prompt up to twice if a user does not allow storage...
katherine_cheney@apple.com [Thu, 17 Jun 2021 20:03:07 +0000 (20:03 +0000)]
Storage Access quirks should prompt up to twice if a user does not allow storage access
https://bugs.webkit.org/show_bug.cgi?id=227099
<rdar://problem/79409843>

Reviewed by John Wilander.

Source/WebCore:

Remove hasDeniedCrossPageStorageAccess functions. They are not needed
now that we are aligning storage access quirks with non-quirks by
using maxNumberOfTimesExplicitlyDeniedStorageAccess.

* dom/DocumentStorageAccess.cpp:
(WebCore::DocumentStorageAccess::requestStorageAccessQuickCheck):
(WebCore::DocumentStorageAccess::requestStorageAccessForNonDocumentQuirk):
* dom/DocumentStorageAccess.h:
* dom/Element.cpp:
(WebCore::Element::dispatchMouseEvent):
* dom/Element.h:
* loader/ResourceLoadObserver.h:
(WebCore::ResourceLoadObserver::hasHadUserInteraction const):
(WebCore::ResourceLoadObserver::setHasDeniedCrossPageStorageAccess): Deleted.
(WebCore::ResourceLoadObserver::hasDeniedCrossPageStorageAccess const): Deleted.
* page/Quirks.cpp:
(WebCore::isStorageAccessQuirkDomainAndElement):
(WebCore::Quirks::requestStorageAccessAndHandleClick const):
(WebCore::Quirks::triggerOptionalStorageAccessQuirk const):
(WebCore::hasDeniedCrossPageStorageAccess): Deleted.
* page/Quirks.h:

Source/WebKit:

We should allow storage access prompts twice per document for quirks
just like for non-quirk cases. Previously we were only presenting
the quirk prompt once per web content process if the user denied. This
patch removes this code and utilizes maxNumberOfTimesExplicitlyDeniedStorageAccess
instead.

* WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
(WebKit::WebResourceLoadObserver::hasDeniedCrossPageStorageAccess const): Deleted.
(WebKit::WebResourceLoadObserver::setHasDeniedCrossPageStorageAccess): Deleted.
* WebProcess/WebCoreSupport/WebResourceLoadObserver.h:

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

3 days agoAdopt WKHoverGestureRecognizer
timothy_horton@apple.com [Thu, 17 Jun 2021 20:00:49 +0000 (20:00 +0000)]
Adopt WKHoverGestureRecognizer
https://bugs.webkit.org/show_bug.cgi?id=227116
<rdar://79442027>

Reviewed by Wenson Hsieh.

* wtf/PlatformEnableCocoa.h:

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

3 days agoREGRESSION (r277067): Incorrect text color for default-button appearance
akeerthi@apple.com [Thu, 17 Jun 2021 18:57:04 +0000 (18:57 +0000)]
REGRESSION (r277067): Incorrect text color for default-button appearance
https://bugs.webkit.org/show_bug.cgi?id=227129
<rdar://problem/79032808>

Reviewed by Tim Horton.

Buttons styled with '-webkit-appearance: default-button' currently rely
on the CSS value 'activebuttontext' for their text color. r277067
updated the color to use system colors, for consistency with the rest
of the platform.

In macOS Monterey, the 'activebuttontext' color and the default button
text color are not equivalent. 'Active' buttons no longer use
NSBackgroundStyleEmphasized, while default buttons still do.
Consequently, default buttons are rendered with an incorrect text color.

To fix, use the correct system color for the text color of default
buttons. To avoid changing the behavior of platforms other than
macOS, the 'activebuttontext' color remains the default text color
specified in RenderTheme.

* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::defaultButtonTextColor const):
(WebCore::RenderTheme::platformDefaultButtonTextColor const):
* rendering/RenderTheme.h:
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformDefaultButtonTextColor const):
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle):

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

3 days ago[watchOS 8] Add watchOS 8 simulator/device to bot watchers' dashboard
commit-queue@webkit.org [Thu, 17 Jun 2021 18:43:54 +0000 (18:43 +0000)]
[watchOS 8] Add watchOS 8 simulator/device to bot watchers' dashboard
https://bugs.webkit.org/show_bug.cgi?id=226781

Patch by W.D. Xiong <w_xiong@apple.com> on 2021-06-17
Reviewed by Jonathan Bedard.

* CISupport/build-webkit-org/public_html/dashboard/Images/WatchOS8.png: Added.
* CISupport/build-webkit-org/public_html/dashboard/Images/WatchOSSimulator8.png: Added.
* CISupport/build-webkit-org/public_html/dashboard/Scripts/Dashboard.js: Added references for watchOS 8 device + simulator; shifted order down for Windows platforms to make room
* CISupport/build-webkit-org/public_html/dashboard/Styles/Main.css: Added references for watchOS 8 device + simulator
(table.queue-grid tr.platform.watchos-simulator-8 img.logo):
(table.queue-grid tr.platform.watchos-8 img.logo):

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

3 days ago[tvOS 15] Add tvOS 15 simulator/device to bot watchers' dashboard
commit-queue@webkit.org [Thu, 17 Jun 2021 18:41:34 +0000 (18:41 +0000)]
[tvOS 15] Add tvOS 15 simulator/device to bot watchers' dashboard
https://bugs.webkit.org/show_bug.cgi?id=226782

Patch by W.D. Xiong <w_xiong@apple.com> on 2021-06-17
Reviewed by Jonathan Bedard.

* CISupport/build-webkit-org/public_html/dashboard/Images/TvOS15.png: Added.
* CISupport/build-webkit-org/public_html/dashboard/Images/TvOS15Simulator.png: Added.
* CISupport/build-webkit-org/public_html/dashboard/Scripts/Dashboard.js: Added references to tvOS 15 device + simulator
* CISupport/build-webkit-org/public_html/dashboard/Styles/Main.css: Added references to tvOS 15 device + simulator
(table.queue-grid tr.platform.tvos-simulator-15 img.logo):
(table.queue-grid tr.platform.tvos-15 img.logo):

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

3 days ago[Monterey] Add Seed 1 to bot watchers' dashboard
commit-queue@webkit.org [Thu, 17 Jun 2021 18:38:43 +0000 (18:38 +0000)]
[Monterey] Add Seed 1 to bot watchers' dashboard
https://bugs.webkit.org/show_bug.cgi?id=226747

Patch by W.D. Xiong <w_xiong@apple.com> on 2021-06-17
Reviewed by Jonathan Bedard.

* CISupport/build-webkit-org/public_html/dashboard/Images/Monterey.png: Added.
* CISupport/build-webkit-org/public_html/dashboard/Scripts/Dashboard.js: Added Monterey
* CISupport/build-webkit-org/public_html/dashboard/Styles/Main.css: Added Monterey
(table.queue-grid tr.platform.macos-monterey img.logo):

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

3 days ago[Win] Exception running layout tests
pvollan@apple.com [Thu, 17 Jun 2021 18:24:51 +0000 (18:24 +0000)]
[Win] Exception running layout tests
https://bugs.webkit.org/show_bug.cgi?id=227114

Reviewed by Jonathan Bedard.

Catch exception and print warning message.

* Scripts/libraries/webkitcorepy/webkitcorepy/task_pool.py:
(TaskPool.__exit__):

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

3 days agoAdopt WKHoverGestureRecognizer
timothy_horton@apple.com [Thu, 17 Jun 2021 18:18:44 +0000 (18:18 +0000)]
Adopt WKHoverGestureRecognizer
https://bugs.webkit.org/show_bug.cgi?id=227116
<rdar://79442027>

Reviewed by Wenson Hsieh.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setUpInteraction]):
(-[WKContentView cleanUpInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView gestureRecognizer:shouldReceiveTouch:]):
(-[WKContentView gestureRecognizer:shouldReceivePress:]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView setUpHoverGestureRecognizer]):
(-[WKContentView hoverGestureRecognizerChanged:]):
Plumb mouse events from WKHoverGestureRecognizer to the page.

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

4 days agoFix crashes in ContentRuleListStore::lookupContentRuleList
achristensen@apple.com [Thu, 17 Jun 2021 17:17:36 +0000 (17:17 +0000)]
Fix crashes in ContentRuleListStore::lookupContentRuleList
https://bugs.webkit.org/show_bug.cgi?id=227100
<rdar://78816611>

Reviewed by Chris Dumez.

To be extra careful, instead of just assuming that moveFile will always succeed,
when moveFile fails, try to delete the legacy path (which has a ContentExtension- instead of ContentRuleList- prefix)
and fail the lookup.  This will only happen in Safari, which was the only client of _WKUserContentExtensionStore.
The legacy file is not useful to us because in r275078 I incremented CurrentContentRuleListFileVersion so the bytes on disk
need to be recompiled anyways.  Safari already has logic to recompile it.  This was just an attempt to use what we have and
not leave anything behind.

Also, to be extra careful, try deleting a file before moving a file on top of it.

* UIProcess/API/APIContentRuleListStore.cpp:
compiledToFile:
(API::ContentRuleListStore::lookupContentRuleList):

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

4 days agoAdd a new pattern to instruction selector to utilize UBFX supported by ARM64
commit-queue@webkit.org [Thu, 17 Jun 2021 17:16:54 +0000 (17:16 +0000)]
Add a new pattern to instruction selector to utilize UBFX supported by ARM64
https://bugs.webkit.org/show_bug.cgi?id=226984

Patch by Yijia Huang <yijia_huang@apple.com> on 2021-06-17
Reviewed by Filip Pizlo.

UBFX, supported by ARM64, copies adjacent bits from the source register into
the least significant bits of a destination register in zero extension. The
instruction selector can utilize this to lowering certain patterns in B3 IR
before further Air optimization.

ubfx dest, src, lsb, width
   tmp, tmp, imm, imm

This is equivalent to "dest = (src >> lsb) & ((1 << width) - 1)". Since wasm
introduces constant folding, then the pattern would be:

dest = (src >> lsb) & mask

where the mask should have a binary format in contiguous ones starting from
the least significant bit. For example:

0b00111111

To make the pattern matching in instruction selection beneficial to JIT, these
constraints should be introduced:

1. lsb >= 0
2. width > 0
3. lsb + width <= bit field limit (32 or 64)

Given:
// B3 IR
Int @0 = ArgumentReg(%0)
Int @1 = lsb
Int @2 = 0b0011
Int @3 = ZShr(@0, @1)
Int @4 = BitAnd(@3, @2)
Void@5 = Return(@4, Terminal)

w/o UBFX Pattern:
// Old optimized AIR
Urshift %x0, lsb, %x0, @3
And  0b0011, %x0, %x0, @4
Ret     %x0,           @5

w/ UBFX Pattern:
// New optimized AIR
Ubfx %x0, lsb, 2, %x0, @4
Ret  %x0,              @5

Note:
Suppose a 32-bit version of (src >> 20) & 0x0FFF, it is equivalent to src >> 20.
In this case, Logical Shift Right should be utilized instead when:

lsb + width == bit field limit (32 or 64)

This case/pattern should be added and upadated in the future patch.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::ubfx32):
(JSC::MacroAssemblerARM64::ubfx64):
* assembler/testmasm.cpp:
(JSC::testUbfx32):
(JSC::testUbfx64):
* b3/B3LowerToAir.cpp:
* b3/air/AirOpcode.opcodes:
* b3/testb3.h:
* b3/testb3_2.cpp:
(testUbfx64PatternMatch):
(testUbfx32PatternMatch):
(addBitTests):

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

4 days agoRemove empty header WebTypesInternal.h
achristensen@apple.com [Thu, 17 Jun 2021 17:05:13 +0000 (17:05 +0000)]
Remove empty header WebTypesInternal.h
https://bugs.webkit.org/show_bug.cgi?id=227094

Reviewed by Fujii Hironori.

Source/WebKitLegacy:

* WebKitLegacy.xcodeproj/project.pbxproj:

Source/WebKitLegacy/mac:

* DefaultDelegates/WebDefaultUIDelegate.mm:
* History/WebBackForwardList.mm:
* History/WebHistory.mm:
* History/WebHistoryItem.mm:
* Misc/WebDownload.mm:
* Misc/WebElementDictionary.mm:
* Misc/WebNSDataExtras.h:
* Misc/WebTypesInternal.h: Removed.
* Plugins/WebBasePluginPackage.mm:
* Plugins/WebNetscapePluginPackage.mm:
* WebView/WebArchive.mm:
* WebView/WebDelegateImplementationCaching.h:
* WebView/WebHTMLRepresentation.mm:
* WebView/WebHTMLView.mm:
* WebView/WebPDFDocumentExtras.mm:
* WebView/WebPDFRepresentation.mm:
* WebView/WebTextCompletionController.mm:
* WebView/WebTextIterator.mm:
* WebView/WebViewData.h:
* WebView/WebViewInternal.h:

Tools:

* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
* DumpRenderTree/mac/DumpRenderTreePasteboard.h:
* DumpRenderTree/mac/DumpRenderTreePasteboard.mm:
* DumpRenderTree/mac/TextInputControllerMac.m:

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

4 days agoWKScriptMessageHandlerWithReply should raise an exception if replyHandler is called...
achristensen@apple.com [Thu, 17 Jun 2021 16:52:19 +0000 (16:52 +0000)]
WKScriptMessageHandlerWithReply should raise an exception if replyHandler is called twice
https://bugs.webkit.org/show_bug.cgi?id=226863

Reviewed by Chris Dumez.

Source/WebKit:

We currently dereference null inside CompletionHandlerWithFinalizer.
This makes it more obvious what is going on.
Related to rdar://78865409 but not solving it.

* UIProcess/API/Cocoa/WKUserContentController.mm:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm:
(-[AsyncScriptMessageHandler userContentController:didReceiveScriptMessage:replyHandler:]):

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

4 days ago[JSC] Work around apparent miscompilation on ARM/GCC >=8.4
angelos@igalia.com [Thu, 17 Jun 2021 16:36:37 +0000 (16:36 +0000)]
[JSC] Work around apparent miscompilation on ARM/GCC >=8.4
https://bugs.webkit.org/show_bug.cgi?id=227125

Reviewed by Filip Pizlo.

This seems to be a GCC miscompilation, revealed by
https://bugs.webkit.org/show_bug.cgi?id=227078.  Introduce a
workaround for the GCC versions that seem to be affected.

* jit/RegisterSet.h:

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

4 days ago[Mac EWS] TestWebKitAPI.WebKit.AudioBufferSize is flaky timing out on EWS
eric.carlson@apple.com [Thu, 17 Jun 2021 16:34:20 +0000 (16:34 +0000)]
[Mac EWS] TestWebKitAPI.WebKit.AudioBufferSize is flaky timing out on EWS
https://bugs.webkit.org/show_bug.cgi?id=227046
<rdar://problem/79360787>

Unreviewed, fix broken test.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Add audio-buffer-size.html
to the Copy Resources step so tests can use it.

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

4 days ago[ews] Improve build summary about finding flaky test in ReRunWebKitTests
aakash_jain@apple.com [Thu, 17 Jun 2021 16:04:15 +0000 (16:04 +0000)]
[ews] Improve build summary about finding flaky test in ReRunWebKitTests
https://bugs.webkit.org/show_bug.cgi?id=227123

Reviewed by Jonathan Bedard.

* CISupport/ews-build/steps.py:
(ReRunWebKitTests.evaluateCommand):
* CISupport/ews-build/steps_unittest.py:

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

4 days ago[GTK] Unexpected timeout in http/tests/media/video-play-stall-seek.html
eocanha@igalia.com [Thu, 17 Jun 2021 15:57:59 +0000 (15:57 +0000)]
[GTK] Unexpected timeout in http/tests/media/video-play-stall-seek.html
https://bugs.webkit.org/show_bug.cgi?id=196198

Reviewed by Philippe Normand.

Source/WebCore:

Increased default GstDowloadBuffer size to prevent a race condition. To do that, we need
to set the buffer-size of GstUriDecodebin (that will set the GstMultiQueue size, so we use
the default value that would be used if no changes had been made, and also leaves
GstDownloadBuffer size untouched, which wouldn't happen if no buffer-size had been set)
and then set the desired max-size-bytes on GstDownloadBuffer.

The race condition was that some times the player private readyState went up to
HAVE_ENOUGH_DATA and then back to HAVE_CURRENT_DATA (triggering the expected waiting event),
and some others times went directly to HAVE_CURRENT_DATA (no waiting event, test stalled).
Increasing the buffer size gave more time for the double transition to happen.

Still, these changes weren't enough to get the test passing, as with these changes the
multiqueue sucked all the data, downloadbuffer fell to a low percentage and updateStates()
paused the pipeline for rebuffering. The pipeline won't ever be unpaused because at that
point WebKitWebSrc has reached EOS (no more file to download, a side effect of the current
libsoup behaviour) and the buffering won't ever go up again (and trigger the unpause).

This was solved by setting the downloadbuffer high-percent property to 0 when a seek
is done after EOS has been received by WebKitWebSrc. This effectively forces the
downloadbuffer to report 100% buffered, which unpauses the pipeline and lets the playback
continue after seek.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::doSeek): Set high-percent when seeking after WebKitWebSrc EOS.
(WebCore::MediaPlayerPrivateGStreamer::sourceSetup): Manually set buffer-size to its default value.
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Receive the custom EOS message from WebKitWebSrc and remember it.
(WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback): Manully set max-size-bytes to a higher than default value.
(WebCore::MediaPlayerPrivateGStreamer::downloadBufferFileCreatedCallback): Don't clean the reference to the downloadbuffer, as it'll be needed later.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Added m_hasWebKitWebSrcSentEOS to remember the EOS condition.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcCreate): Notify the EOS condition using the bus, so the player private can handle it.
(CachedResourceStreamingClient::loadFailed): Extra useful logs.
(CachedResourceStreamingClient::loadFinished): Ditto.

LayoutTests:

Make test more stable and don't expect NETWORK_LOADING, because some network implementations,
like libsoup, just report end-of-stream and finish the download.

* http/tests/media/video-play-stall-seek-expected.txt: Removed NETWORK_LOADING expectation.
* http/tests/media/video-play-stall-seek.html: Stabilize the test by not listening to waiting events once the relevant one has been handled, and by pausing the video after the test has finished. Also re

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

4 days agoREGRESSION (r278536): Wrong comment character used in coverage.xcconfig
ddkilzer@apple.com [Thu, 17 Jun 2021 15:53:44 +0000 (15:53 +0000)]
REGRESSION (r278536): Wrong comment character used in coverage.xcconfig

* coverage/coverage.xcconfig:
- Change '#' to '//' to fix the comment.

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

4 days agoUnreviewed GStreamer mediastream gardening
philn@webkit.org [Thu, 17 Jun 2021 14:53:37 +0000 (14:53 +0000)]
Unreviewed GStreamer mediastream gardening

* platform/glib/TestExpectations: Unflag fast/mediastream/media-stream-renders-first-frame.html
* platform/wpe/TestExpectations: Move getDisplayMedia expectations to glib file.

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

4 days ago[css-logical] Implement logical property groups
obrufau@igalia.com [Thu, 17 Jun 2021 13:13:49 +0000 (13:13 +0000)]
[css-logical] Implement logical property groups
https://bugs.webkit.org/show_bug.cgi?id=226878

Reviewed by Antti Koivisto.

Source/WebCore:

In order to have proper CSSOM support for logical properties, we will
need to determine whether two properties belong to the same logical
property group but with a different mapping logic.

Before this patch, we only knew the physical properties belonging to the
same logical property group as a given logical property. But given a
physical property, we didn't know if there were logical properties that
could map to it.

Therefore this patch changes CSSProperties.json so that both logical and
physical properties specify their logical property group.

The code for resolving a logical property into its physical equivalent
is now automatically generated.

The CSSOM fix will be done in a follow-up (bug 226461).

This patch introduces no behavior changes.

* css/CSSProperties.json:
* css/CSSProperty.cpp:
* css/makeprop.pl:
(nameToId):
(addProperty):
* platform/RectEdges.h:
(WebCore::RectEdges::before):
(WebCore::RectEdges::after):
(WebCore::RectEdges::start):
(WebCore::RectEdges::end):
(WebCore::RectEdges::before const):
(WebCore::RectEdges::after const):
(WebCore::RectEdges::start const):
(WebCore::RectEdges::end const):
* platform/text/WritingMode.h:
(WebCore::mapLogicalAxisToPhysicalAxis):

Tools:

Add validator for new codegen property "logical-property-group",
replacing the old "direction-aware-property".

* Scripts/webkitpy/style/checkers/jsonchecker.py:
(JSONCSSPropertiesChecker.validate_logical_property_group):
(JSONCSSPropertiesChecker.check_codegen_properties):

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

4 days agoUnreviewed GStreamer mediastream gardening
philn@webkit.org [Thu, 17 Jun 2021 13:05:46 +0000 (13:05 +0000)]
Unreviewed GStreamer mediastream gardening

* platform/glib/TestExpectations: Unflag 3 tests consistently passing.

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

4 days ago[GStreamer] Refactor MediaPlayerPrivateGStreamer::notifyPlayerOf*
eocanha@igalia.com [Thu, 17 Jun 2021 12:59:03 +0000 (12:59 +0000)]
[GStreamer] Refactor MediaPlayerPrivateGStreamer::notifyPlayerOf*
https://bugs.webkit.org/show_bug.cgi?id=204686

Unreviewed WPE/GTK debug build fix.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfTrack): Removed assert left there from a previous version of the patch.

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

4 days agoFix RTCDataChannelInit::decode
youenn@apple.com [Thu, 17 Jun 2021 12:38:18 +0000 (12:38 +0000)]
Fix RTCDataChannelInit::decode
https://bugs.webkit.org/show_bug.cgi?id=226968
Source/WebCore:

Reviewed by Eric Carlson.

Test: imported/w3c/web-platform-tests/webrtc-extensions/transfer-datachannel-service-worker.https.html

* platform/mediastream/RTCDataChannelHandler.h:
(WebCore::RTCDataChannelInit::decode):
Make sure to use optionals of optionals.

LayoutTests:

<rdar://problem/79300038>

Reviewed by Eric Carlson.

* http/wpt/webrtc/transfer-datachannel-service-worker.https-expected.txt: Added.
* http/wpt/webrtc/transfer-datachannel-service-worker.https.html: Added.
* http/wpt/webrtc/transfer-datachannel-service-worker.js: Added.
(onmessage):
* platform/mac-wk1/TestExpectations:

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

4 days ago[GStreamer] Refactor MediaPlayerPrivateGStreamer::notifyPlayerOf*
eocanha@igalia.com [Thu, 17 Jun 2021 12:00:47 +0000 (12:00 +0000)]
[GStreamer] Refactor MediaPlayerPrivateGStreamer::notifyPlayerOf*
https://bugs.webkit.org/show_bug.cgi?id=204686

Reviewed by Philippe Normand.

Refactored the notifyPlayerOf{Audio,Video,Text} family of methods into a single notifyPlayerOfTrack() one.
Some Variant variables are needed in order to make several incompatible types work together and to auto-detect the type of track as an enum.

Covered by existing tests.

* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
(WebCore::InbandTextTrackPrivateGStreamer::create): Added method with a signature similar to the ones used by {Audio,Video}TrackPrivateGStreamer, so that it fits into the notifyPlayerOfTrack() template code.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfTrack): Template method that unifies the old notifyPlayerOf{Audio,Video,Text}() implementations.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Deleted. Refactored into notifyPlayerOfTrack().
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::audioChangedCallback): Call the new notifyPlayerOfTrack() refactored implementation.
(WebCore::MediaPlayerPrivateGStreamer::textChangedCallback): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::videoChangedCallback): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::purgeInvalidAudioTracks): Deleted. Now implemented directly inside notifyPlayerOfTrack().
(WebCore::MediaPlayerPrivateGStreamer::purgeInvalidVideoTracks): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks): Ditto.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Deleted notifyPlayerOf{Audio,Video,Text}(), added notifyPlayerOfTrack(), deleted purgeInvalid{Audio,Video,Text}Tracks().

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

4 days ago[macOS] Close open connections
pvollan@apple.com [Thu, 17 Jun 2021 10:50:40 +0000 (10:50 +0000)]
[macOS] Close open connections
https://bugs.webkit.org/show_bug.cgi?id=227068

Reviewed by Brent Fulgham.

On macOS, close open connections in initializeSandboxParameters.

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

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

4 days agoUnreviewed, reverting r278978.
commit-queue@webkit.org [Thu, 17 Jun 2021 09:49:00 +0000 (09:49 +0000)]
Unreviewed, reverting r278978.
https://bugs.webkit.org/show_bug.cgi?id=227115

The patch seems to be breaking the Debian and Ubuntu builds.

Reverted changeset:

"[GStreamer] Refactor
MediaPlayerPrivateGStreamer::notifyPlayerOf*"
https://bugs.webkit.org/show_bug.cgi?id=204686
https://trac.webkit.org/changeset/278978

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

4 days ago[GStreamer] Refactor MediaPlayerPrivateGStreamer::notifyPlayerOf*
eocanha@igalia.com [Thu, 17 Jun 2021 09:18:02 +0000 (09:18 +0000)]
[GStreamer] Refactor MediaPlayerPrivateGStreamer::notifyPlayerOf*
https://bugs.webkit.org/show_bug.cgi?id=204686

Reviewed by Philippe Normand.

Refactored the notifyPlayerOf{Audio,Video,Text} family of methods into a single notifyPlayerOfTrack() one.
Some Variant variables are needed in order to make several incompatible types work together and to auto-detect the type of track as an enum.

Covered by existing tests.

* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
(WebCore::InbandTextTrackPrivateGStreamer::create): Added method with a signature similar to the ones used by {Audio,Video}TrackPrivateGStreamer, so that it fits into the notifyPlayerOfTrack() template code.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfTrack): Template method that unifies the old notifyPlayerOf{Audio,Video,Text}() implementations.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Deleted. Refactored into notifyPlayerOfTrack().
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::audioChangedCallback): Call the new notifyPlayerOfTrack() refactored implementation.
(WebCore::MediaPlayerPrivateGStreamer::textChangedCallback): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::videoChangedCallback): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::purgeInvalidAudioTracks): Deleted. Now implemented directly inside notifyPlayerOfTrack().
(WebCore::MediaPlayerPrivateGStreamer::purgeInvalidVideoTracks): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks): Ditto.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Deleted notifyPlayerOf{Audio,Video,Text}(), added notifyPlayerOfTrack(), deleted purgeInvalid{Audio,Video,Text}Tracks().

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

4 days ago[GLIB] Pass a GTlsCertificate to soup_server_new()
carlosgc@webkit.org [Thu, 17 Jun 2021 08:38:46 +0000 (08:38 +0000)]
[GLIB] Pass a GTlsCertificate to soup_server_new()
https://bugs.webkit.org/show_bug.cgi?id=227023

Reviewed by Michael Catanzaro.

Instead of using soup_server_set_ssl_cert_file() that will be removed from libsoup soon.

* TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.cpp:
(WebKitTestServer::WebKitTestServer):

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

4 days ago[Win] TestWTF.WTF_WeakPtr.WeakHashMapIterators is crashing
Hironori.Fujii@sony.com [Thu, 17 Jun 2021 07:00:58 +0000 (07:00 +0000)]
[Win] TestWTF.WTF_WeakPtr.WeakHashMapIterators is crashing
https://bugs.webkit.org/show_bug.cgi?id=227102

Reviewed by Ryosuke Niwa.

A heap corruption was detected while a Derived class object was
destroyed as a Base class object.

* TestWebKitAPI/Tests/WTF/WeakPtr.cpp:
(TestWebKitAPI::Base::~Base): Made Base class dtor virtual.
(TestWebKitAPI::Derived::~Derived):

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

4 days agoMake FontFaceSet::Iterator's bounds check more robust
mmaxfield@apple.com [Thu, 17 Jun 2021 06:19:31 +0000 (06:19 +0000)]
Make FontFaceSet::Iterator's bounds check more robust
https://bugs.webkit.org/show_bug.cgi?id=227048
<rdar://problem/78871890>

Reviewed by Simon Fraser.

We were checking for one specific bad value, when we should have been checking for all bad values.

* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::Iterator::next):

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

4 days agoDocument's execCommand() / queryCommand*() should throw an exception on non-HTML...
cdumez@apple.com [Thu, 17 Jun 2021 05:39:51 +0000 (05:39 +0000)]
Document's execCommand() / queryCommand*() should throw an exception on non-HTML/XHTML documents
https://bugs.webkit.org/show_bug.cgi?id=227016

Reviewed by Darin Adler.

Source/WebCore:

Update Document's execCommand() / queryCommand*() to throw an InvalidStateError when the document
is not an HTML/XHTML document. This matches Blink's behavior. Firefox is even stricter and throws
for all non HTML documents (including XHTML).

Test: fast/dom/Document/document-execcommand.html

* dom/Document.cpp:
(WebCore::Document::execCommand):
(WebCore::Document::queryCommandEnabled):
(WebCore::Document::queryCommandIndeterm):
(WebCore::Document::queryCommandState):
(WebCore::Document::queryCommandSupported):
(WebCore::Document::queryCommandValue):
* dom/Document.h:

Source/WebKitLegacy/mac:

Update ObjC bindings since the WebCore API now returns ExceptionOr<> types.

* DOM/DOMDocument.mm:
(-[DOMDocument execCommand:userInterface:value:]):
(-[DOMDocument queryCommandEnabled:]):
(-[DOMDocument queryCommandIndeterm:]):
(-[DOMDocument queryCommandState:]):
(-[DOMDocument queryCommandSupported:]):
(-[DOMDocument queryCommandValue:]):

LayoutTests:

* fast/dom/Document/document-execcommand-expected.txt: Added.
* fast/dom/Document/document-execcommand.html: Added.
Add layout test coverage.

* editing/pasteboard/createMarkup-assert-expected.txt: Removed.
* editing/pasteboard/createMarkup-assert.xml: Removed.
* platform/mac/svg/text/foreignObject-repaint-expected.txt:
* platform/mac/svg/text/foreignObject-text-clipping-bug-expected.txt:
* platform/mac/svg/text/text-align-01-b-expected.txt:
* platform/mac/svg/text/text-align-02-b-expected.txt:
* platform/mac/svg/text/text-align-03-b-expected.txt:
* platform/mac/svg/text/text-align-04-b-expected.txt:
* platform/mac/svg/text/text-align-05-b-expected.txt:
* platform/mac/svg/text/text-align-06-b-expected.txt:
* platform/mac/svg/text/text-deco-01-b-expected.txt:
* platform/mac/svg/text/text-fonts-01-t-expected.txt:
* platform/mac/svg/text/text-fonts-02-t-expected.txt:
* platform/mac/svg/text/text-intro-05-t-expected.txt:
* platform/mac/svg/text/text-path-01-b-expected.txt:
* platform/mac/svg/text/text-spacing-01-b-expected.txt:
* platform/mac/svg/text/text-text-01-b-expected.txt:
* platform/mac/svg/text/text-text-03-b-expected.txt:
* platform/mac/svg/text/text-text-04-t-expected.txt:
* platform/mac/svg/text/text-text-05-t-expected.txt:
* platform/mac/svg/text/text-text-07-t-expected.txt:
* platform/mac/svg/text/text-text-08-b-expected.txt:
* platform/mac/svg/text/text-tref-01-b-expected.txt:
* platform/mac/svg/text/text-tselect-01-b-expected.txt:
* platform/mac/svg/text/text-tselect-02-f-expected.txt:
* platform/mac/svg/text/text-tspan-01-b-expected.txt:
* svg/custom/bug78838-expected.txt:
* svg/custom/bug79798-expected.txt:
* svg/custom/delete-modified-text-in-defs-crash.svg:
* svg/custom/layout-loop-expected.txt:
* svg/text/text-positioning-remove-child-crash.svg:
Rebaseline / update existing tests due to behavior change.

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

4 days agoPasskeys don't work in Simulator
commit-queue@webkit.org [Thu, 17 Jun 2021 03:45:18 +0000 (03:45 +0000)]
Passkeys don't work in Simulator
https://bugs.webkit.org/show_bug.cgi?id=227076
<rdar://79366832>

Patch by Garrett Davidson <garrett_davidson@apple.com> on 2021-06-16
Reviewed by Brent Fulgham.

Simulator does not support LAAccessControlOperationUseKeySign, so
-evaluateAccessControl:... returns an error. However, this check isn't actually necessary in
the simulator when using passkeys, so just skip it.

Tested registration and assertion in an app in Simulator.

* UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
(WebKit::LocalConnection::verifyUser):

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

4 days ago[JSC] Disable JITCage on macOS until we evaluate performance throughly
ysuzuki@apple.com [Thu, 17 Jun 2021 03:26:28 +0000 (03:26 +0000)]
[JSC] Disable JITCage on macOS until we evaluate performance throughly
https://bugs.webkit.org/show_bug.cgi?id=227104

Reviewed by Mark Lam.

This patch disables JITCage on macOS until we evaluate performance throughly.

* wtf/PlatformEnable.h:

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

4 days ago[JSC] Optimize JSON.parse with small data by changing Identifier pool mechanism
ysuzuki@apple.com [Thu, 17 Jun 2021 03:09:57 +0000 (03:09 +0000)]
[JSC] Optimize JSON.parse with small data by changing Identifier pool mechanism
https://bugs.webkit.org/show_bug.cgi?id=227101

Reviewed by Mark Lam.

Found that std::array<Identifier, 128> pool in LiteralParser is too costly for construction and destruction
if JSON.parse is invoked for small data. This patch changes this pool mechanism so that we do not waste effort
allocating null Identifiers to pre-populate the recent identifiers pool. Instead, we now use a m_recentIdentifiersIndex
uint8_t array to indicate whether there's a cached recent identifier for each given first character.

We also use KeywordLookup.h's COMPARE_XCHARS to perform "true" / "false" / "null" lexing in JSON parser.
Roughly 20% improvement in microbenchmark. And roughly 2-3% improvement in Speedometer2/Flight-TodoMVC.

                                    ToT                     Patched

    flight-todomvc-json       67.8755+-1.1202     ^     56.7114+-0.5048        ^ definitely 1.1969x faster

* runtime/Identifier.cpp:
(JSC::Identifier::add):
(JSC::Identifier::add8):
* runtime/Identifier.h:
(JSC::Identifier::Identifier):
(JSC::Identifier::add):
* runtime/IdentifierInlines.h:
(JSC::Identifier::add):
(JSC::Identifier::fromString):
* runtime/LiteralParser.cpp:
(JSC::compare3Chars):
(JSC::compare4Chars):
(JSC::LiteralParser<CharType>::makeIdentifier):
(JSC::LiteralParser<CharType>::Lexer::lex):
* runtime/LiteralParser.h:

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

4 days agotakeSnapshotWithConfiguration() should wait for the next flush before it does callSna...
said@apple.com [Thu, 17 Jun 2021 00:46:41 +0000 (00:46 +0000)]
takeSnapshotWithConfiguration() should wait for the next flush before it does callSnapshotRect()
https://bugs.webkit.org/show_bug.cgi?id=226257
<rdar://76411685>

Reviewed by Simon Fraser and Tim Horton.

Source/WebCore/PAL:

* pal/spi/cocoa/QuartzCoreSPI.h:

Source/WebKit:

This will ensure the latest IOSurfaces are pushed to backboardd before
taking the snapshot. Also we need create an implicit transaction to ensure
a commit will happen.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):

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

4 days agoMake RenderLayer::hitTestLayer not assume its renderer is a RenderBox
heycam@apple.com [Thu, 17 Jun 2021 00:27:58 +0000 (00:27 +0000)]
Make RenderLayer::hitTestLayer not assume its renderer is a RenderBox
https://bugs.webkit.org/show_bug.cgi?id=227004
<rdar://79265788>

Reviewed by Simon Fraser.

Source/WebCore:

An inline box might have a clip-path on it, so we can't assume that
the layer's renderer is a RenderBox. Avoid the assertion by hit testing
incorrectly for now.

Test: css3/masking/clip-path-hit-test-on-inline-iframe-parent.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::hitTestLayer):

LayoutTests:

* css3/masking/clip-path-hit-test-on-inline-iframe-parent-expected.txt: Added.
* css3/masking/clip-path-hit-test-on-inline-iframe-parent.html: Added.

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

4 days agoClean up how platform images are handled in the bot watchers' dashboard
jbedard@apple.com [Wed, 16 Jun 2021 23:39:14 +0000 (23:39 +0000)]
Clean up how platform images are handled in the bot watchers' dashboard
https://bugs.webkit.org/show_bug.cgi?id=226989

Patch by W.D. Xiong.

Renamed the _@2x.png files to _.png and removed old platforms that don't have queues anymore. Also renamed WatchOSSimulator7 to WatchOS7Simulator

* CISupport/build-webkit-org/public_html/dashboard/Images/BigSur.png: Replaced with Tools/CISupport/build-webkit-org/public_html/dashboard/Images/BigSur@2x.png.
* CISupport/build-webkit-org/public_html/dashboard/Images/BigSur@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/Catalina.png: Replaced with Tools/CISupport/build-webkit-org/public_html/dashboard/Images/Catalina@2x.png.
* CISupport/build-webkit-org/public_html/dashboard/Images/Catalina@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/ElCapitan.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/ElCapitan@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/GTK.png: Replaced with Tools/CISupport/build-webkit-org/public_html/dashboard/Images/GTK@2x.png.
* CISupport/build-webkit-org/public_html/dashboard/Images/GTK@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/HighSierra.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/HighSierra@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS10.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS10@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS10Simulator.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS10Simulator@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS11.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS11@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS11Simulator.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS11Simulator@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS12.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS12@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS12Simulator.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS12Simulator@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS13.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS13@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS13Simulator.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS13Simulator@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS14.png: Replaced with Tools/CISupport/build-webkit-org/public_html/dashboard/Images/IOS14@2x.png.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS14@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS14Simulator.png: Replaced with Tools/CISupport/build-webkit-org/public_html/dashboard/Images/IOS14Simulator@2x.png.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS14Simulator@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS9.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS9@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS9Simulator.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOS9Simulator@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOSDevice.png: Replaced with Tools/CISupport/build-webkit-org/public_html/dashboard/Images/IOSDevice@2x.png.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOSDevice@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOSSimulator.png: Replaced with Tools/CISupport/build-webkit-org/public_html/dashboard/Images/IOSSimulator@2x.png.
* CISupport/build-webkit-org/public_html/dashboard/Images/IOSSimulator@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/Mavericks.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/Mavericks@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/Mojave.png: Replaced with Tools/CISupport/build-webkit-org/public_html/dashboard/Images/Mojave@2x.png.
* CISupport/build-webkit-org/public_html/dashboard/Images/Mojave@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/MountainLion.png: Replaced with Tools/CISupport/build-webkit-org/public_html/dashboard/Images/MountainLion@2x.png.
* CISupport/build-webkit-org/public_html/dashboard/Images/MountainLion@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/PlatformRing.png: Replaced with Tools/CISupport/build-webkit-org/public_html/dashboard/Images/PlatformRing@2x.png.
* CISupport/build-webkit-org/public_html/dashboard/Images/PlatformRing@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/Sierra.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/Sierra@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/SquirrelFish.png: Replaced with Tools/CISupport/build-webkit-org/public_html/dashboard/Images/SquirrelFish@2x.png.
* CISupport/build-webkit-org/public_html/dashboard/Images/SquirrelFish@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/TvOS13.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/TvOS13@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/TvOS13Simulator.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/TvOS13Simulator@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/TvOS14.png: Replaced with Tools/CISupport/build-webkit-org/public_html/dashboard/Images/TvOS14@2x.png.
* CISupport/build-webkit-org/public_html/dashboard/Images/TvOS14@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/TvOS14Simulator.png: Replaced with Tools/CISupport/build-webkit-org/public_html/dashboard/Images/TvOS14Simulator@2x.png.
* CISupport/build-webkit-org/public_html/dashboard/Images/TvOS14Simulator@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/WPE.png: Replaced with Tools/CISupport/build-webkit-org/public_html/dashboard/Images/WPE@2x.png.
* CISupport/build-webkit-org/public_html/dashboard/Images/WPE@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/WatchOS6.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/WatchOS6@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/WatchOS7.png: Replaced with Tools/CISupport/build-webkit-org/public_html/dashboard/Images/WatchOS7@2x.png.
* CISupport/build-webkit-org/public_html/dashboard/Images/WatchOS7@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/WatchOS7Simulator.png: Copied from Tools/CISupport/build-webkit-org/public_html/dashboard/Images/WatchOSSimulator7@2x.png.
* CISupport/build-webkit-org/public_html/dashboard/Images/WatchOSSimulator6.png: Replaced with Tools/CISupport/build-webkit-org/public_html/dashboard/Images/WatchOSSimulator6@2x.png.
* CISupport/build-webkit-org/public_html/dashboard/Images/WatchOSSimulator6@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/WatchOSSimulator7.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/WatchOSSimulator7@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/Windows10.png: Replaced with Tools/CISupport/build-webkit-org/public_html/dashboard/Images/Windows10@2x.png.
* CISupport/build-webkit-org/public_html/dashboard/Images/Windows10@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/Windows7.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/Windows7@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/Windows8.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/Windows8@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/WindowsXP.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/WindowsXP@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/Yosemite.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Images/Yosemite@2x.png: Removed.
* CISupport/build-webkit-org/public_html/dashboard/Styles/Main.css: Applied above changes
(table.queue-grid td.logo img.ring):
(table.queue-grid tr.platform.ios-simulator-14 img.logo):
(table.queue-grid tr.platform.ios-14 img.logo):
(table.queue-grid tr.platform.tvos-simulator-14 img.logo):
(table.queue-grid tr.platform.tvos-14 img.logo):
(table.queue-grid tr.platform.watchos-simulator-7 img.logo):
(table.queue-grid tr.platform.watchos-7 img.logo):
(table.queue-grid tr.platform.macos-catalina img.logo):
(table.queue-grid tr.platform.macos-bigsur img.logo):
(table.queue-grid tr.platform.wincairo-windows-10 img.logo):
(table.queue-grid tr.platform.windows-10 img.logo):
(table.queue-grid tr.platform.windows-7 img.logo):
(table.queue-grid tr.platform.linux-gtk img.logo):
(table.queue-grid tr.platform.linux-wpe img.logo):
(table.queue-grid tr.platform.linux-jsconly img.logo):

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

4 days agoAdopt com.apple.security.cs.jit-write-allowlist on internal builds.
mark.lam@apple.com [Wed, 16 Jun 2021 23:37:01 +0000 (23:37 +0000)]
Adopt com.apple.security.cs.jit-write-allowlist on internal builds.
https://bugs.webkit.org/show_bug.cgi?id=222148
rdar://74284026

Reviewed by Per Arne Vollan.

Source/JavaScriptCore:

This will prevent various pthread permissions switching APIs from working.
We only want to adopt this for internal builds where we use the fast permission
switching macro instead.  We can't adopt it for open source builds, where we
still rely on the pthread API.

* Scripts/process-entitlements.sh:

Source/WebKit:

* Scripts/process-entitlements.sh:

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

4 days ago[GLIB] Unreviewed test gardening. Skip another WebGL 2 test.
commit-queue@webkit.org [Wed, 16 Jun 2021 23:26:13 +0000 (23:26 +0000)]
[GLIB] Unreviewed test gardening. Skip another WebGL 2 test.
https://bugs.webkit.org/show_bug.cgi?id=227093

Patch by Arcady Goldmints-Orlov <agoldmints@igalia.com> on 2021-06-16

* platform/glib/TestExpectations:

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

4 days agoProtect Element before calling dispatchMouseEvent() on it
cdumez@apple.com [Wed, 16 Jun 2021 23:09:07 +0000 (23:09 +0000)]
Protect Element before calling dispatchMouseEvent() on it
https://bugs.webkit.org/show_bug.cgi?id=226767
<rdar://problem/79009112>

Reviewed by Ryosuke Niwa.

* page/EventHandler.cpp:
(WebCore::EventHandler::updateMouseEventTargetNode):
(WebCore::EventHandler::dispatchMouseEvent):
* page/PointerLockController.cpp:
(WebCore::PointerLockController::dispatchLockedMouseEvent):
* page/Quirks.cpp:
(WebCore::Quirks::triggerOptionalStorageAccessQuirk const):

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

4 days ago[webkitscmpy] Support branch queries in mock git log
jbedard@apple.com [Wed, 16 Jun 2021 22:41:35 +0000 (22:41 +0000)]
[webkitscmpy] Support branch queries in mock git log
https://bugs.webkit.org/show_bug.cgi?id=225889
<rdar://problem/78122705>

Reviewed by Stephanie Lewis.

* Scripts/libraries/webkitscmpy/setup.py: Bump version.
* Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
* Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py: Add support for branches in
`git log` commands.
* Scripts/libraries/webkitscmpy/webkitscmpy/test/git_unittest.py:
(TestGit.test_log):
(TestGit.test_branch_log):

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

4 days agoResync FileAPI tests from upstream WPT
cdumez@apple.com [Wed, 16 Jun 2021 22:39:29 +0000 (22:39 +0000)]
Resync FileAPI tests from upstream WPT
https://bugs.webkit.org/show_bug.cgi?id=227089

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Resync FileAPI tests from upstream WPT b5949c67c948bc452e3.

* web-platform-tests/FileAPI/*: Updated.

LayoutTests:

* tests-options.json:

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