WebKit-https.git
4 months agoExtended Color: Experiment with strongly typed ColorComponents
weinig@apple.com [Sat, 13 Jun 2020 16:42:58 +0000 (16:42 +0000)]
Extended Color: Experiment with strongly typed ColorComponents
https://bugs.webkit.org/show_bug.cgi?id=212396

Reviewed by Darin Adler.

Source/WebCore:

Adds simple explicit types for sRGBA, LinearSRGBA, DisplayP3,
LinearDisplayP3, XYZA and HSLA colors. Conversion to/from
ColorComponents<float> is easy but explicit to make conversions
easier to spot.

The goal is to add type clarity (you know when you are dealing
with an sRGB color vs. a DisplayP3 color) and make dealing with
the colors nicer (color.red rather than color[0]). It also allows
us to simplify the naming of functions that convert between color
types as now only the output type needs to be in the function name.

* Headers.cmake:
Add new header, ColorTypes.h

* WebCore.xcodeproj/project.pbxproj:
Add new header, ColorTypes.h

* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::parseHSLParameters):
Switch from hslToSRGB({ ... }) to toSRGBA(HSLAColor { ... })

* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::detectContentInRange):
Update to use toHSLA() and HSLA<float> making the code a bit more readable.

* platform/graphics/Color.cpp:
(WebCore::Color::lightened const):
(WebCore::Color::darkened const):
(WebCore::Color::isDark const):
(WebCore::Color::lightness const):
(WebCore::Color::luminance const):
(WebCore::Color::colorSpaceAndComponents const):
(WebCore::Color::toSRGBASimpleColorLossy const):
(WebCore::Color::toSRGBALossy const):
(WebCore::Color::toSRGBAComponentsLossy const): Deleted.
* platform/graphics/Color.h:
Renames toSRGBAComponentsLossy() to toSRGBALossy() which now returns
a SRGBA<float>.

* platform/graphics/ColorMatrix.h:
(WebCore::ColorMatrix::transformColorComponents const): Deleted.
Remove transformColorComponents, keeping just transformedColorComponents
to simplify the interface. With late conversion to ColorComponents, the
latter is more straightforward to use in most cases anyway.

* platform/graphics/ColorUtilities.cpp:
(WebCore::linearToRGBColorComponent):
(WebCore::rgbToLinearColorComponent):
(WebCore::toLinearSRGBA):
(WebCore::toSRGBA):
(WebCore::toLinearDisplayP3):
(WebCore::toDisplayP3):
(WebCore::toXYZ):
(WebCore::lightness):
(WebCore::luminance):
(WebCore::contrastRatio):
(WebCore::toHSLA):
(WebCore::premultiplied):
(WebCore::rgbToLinearComponents): Deleted.
(WebCore::linearToRGBComponents): Deleted.
(WebCore::xyzToLinearSRGB): Deleted.
(WebCore::linearSRGBToXYZ): Deleted.
(WebCore::XYZToLinearP3): Deleted.
(WebCore::linearP3ToXYZ): Deleted.
(WebCore::p3ToSRGB): Deleted.
(WebCore::sRGBToP3): Deleted.
(WebCore::sRGBToHSL): Deleted.
(WebCore::hslToSRGB): Deleted.
* platform/graphics/ColorUtilities.h:
Rename / rework conversion and utility functions to operate on explicit Color
types. In doing so, simplify the names of the conversion functions so only name
the output type. For instance:

    ColorComponents<float> p3ToSRGB(const ColorComponents<float>&);

is now

    SRGBA<float> toSRGBA(const DisplayP3<float>&);

as the input type is implicit in the call. A little duplication was needed
for linearToRGBColorComponent/rgbToLinearColorComponent (as it was used for
both sRGB and DisplayP3 linearization), but mostly things stay the same.

* platform/graphics/ExtendedColor.cpp:
(WebCore::ExtendedColor::toSRGBALossy const):
(WebCore::ExtendedColor::toSRGBAComponentsLossy const): Deleted.
* platform/graphics/ExtendedColor.h:
Renamed toSRGBAComponentsLossy() to toSRGBALossy() and have it
return a SRGBA<float>.

* platform/graphics/SimpleColor.h:
(WebCore::SimpleColor::asSRGBA const):
(WebCore::makeSimpleColor):
(WebCore::SimpleColor::asSRGBFloatComponents const): Deleted.
Rename asSRGBFloatComponents() to asSRGBA<T>() and have it
return a SRGBA<float>. Replace makeSimpleColor taking FloatComponents
with one taking a SRGBA<float>, making it much clearer that this
is only valid for sRGB.

* platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::drawLighting):
Rework to support seperate types for SRGB<float> and LinearSRGBA<float>.

* platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::drawLighting):
* platform/graphics/filters/FilterOperation.cpp:
(WebCore::BasicColorMatrixFilterOperation::transformColor const):
(WebCore::BasicComponentTransferFilterOperation::transformColor const):
(WebCore::InvertLightnessFilterOperation::transformColor const):
(WebCore::InvertLightnessFilterOperation::inverseTransformColor const):
* platform/graphics/filters/FilterOperation.h:
(WebCore::FilterOperation::transformColor const):
(WebCore::FilterOperation::inverseTransformColor const):
* platform/graphics/filters/FilterOperations.cpp:
(WebCore::FilterOperations::transformColor const):
(WebCore::FilterOperations::inverseTransformColor const):
Use SRGBA<float> rather than ColorComponents<float> to make it clear
that the filters only work on sRGB colors right now.

* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::disabledTextColor const):
* rendering/TextPaintStyle.cpp:
(WebCore::textColorIsLegibleAgainstBackgroundColor):
* platform/graphics/cairo/CairoUtilities.cpp:
(WebCore::setSourceRGBAFromColor):
* platform/graphics/cairo/GradientCairo.cpp:
(WebCore::addColorStopRGBA):
(WebCore::setCornerColorRGBA):
(WebCore::interpolateColorStop):
* platform/graphics/gtk/ColorGtk.cpp:
(WebCore::Color::operator GdkRGBA const):
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawBorder):
(WebCore::TextureMapperGL::drawNumber):
(WebCore::prepareFilterProgram):
(WebCore::TextureMapperGL::drawSolidColor):
(WebCore::TextureMapperGL::clearColor):
* platform/graphics/win/ColorDirect2D.cpp:
(WebCore::Color::operator D2D1_COLOR_F const):
(WebCore::Color::operator D2D1_VECTOR_4F const):
* platform/graphics/win/GradientDirect2D.cpp:
(WebCore::Gradient::generateGradient):
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::colorWithGlobalAlpha const):
Update to call toSRGBALossy() rather than toSRGBAComponentsLossy().

Source/WebKit:

* UIProcess/API/wpe/WebKitColor.cpp:
(webkitColorFillFromWebCoreColor):
* UIProcess/gtk/ViewGestureControllerGtk.cpp:
(WebKit::ViewGestureController::beginSwipeGesture):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::getDocumentBackgroundColor):
Update to call toSRGBALossy() rather than toSRGBAComponentsLossy().

Tools:

* TestWebKitAPI/Tests/WebCore/ColorTests.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebCore/ExtendedColorTests.cpp:
(TestWebKitAPI::TEST):
Update for changed names (e.g. toSRGBAComponentsLossy() -> toSRGBALossy())
and use of explicit types.

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

4 months agoRemove FileError.h
commit-queue@webkit.org [Sat, 13 Jun 2020 16:24:15 +0000 (16:24 +0000)]
Remove FileError.h
https://bugs.webkit.org/show_bug.cgi?id=213119

Patch by Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> on 2020-06-13
Reviewed by Chris Dumez.

Source/WebCore:

* Headers.cmake:
* Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp:
(WebCore::ClipboardItemBindingsDataSource::ClipboardItemTypeLoader::didFail):
* Modules/async-clipboard/ClipboardItemBindingsDataSource.h:
* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::createMessageQueue):
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::didFail):
(WebCore::WebSocketChannel::abortOutgoingFrameQueue):
* Modules/websockets/WebSocketChannel.h:
* WebCore.xcodeproj/project.pbxproj:
* fileapi/BlobLoader.h:
(WebCore::BlobLoader::didFail):
* fileapi/FileError.h: Removed.
* fileapi/FileReader.cpp:
(WebCore::FileReader::didFail):
* fileapi/FileReader.h:
* fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::start):
(WebCore::FileReaderLoader::cancel):
(WebCore::FileReaderLoader::cleanup):
(WebCore::FileReaderLoader::didReceiveResponse):
(WebCore::FileReaderLoader::didReceiveData):
(WebCore::FileReaderLoader::didFail):
(WebCore::FileReaderLoader::failed):
(WebCore::FileReaderLoader::toErrorCode):
(WebCore::FileReaderLoader::httpStatusCodeToErrorCode):
(WebCore::FileReaderLoader::arrayBufferResult const):
(WebCore::FileReaderLoader::stringResult):
* fileapi/FileReaderLoader.h:
(WebCore::FileReaderLoader::errorCode const):
* fileapi/FileReaderLoaderClient.h:
* fileapi/FileReaderSync.cpp:
(WebCore::FileReaderSync::startLoading):
* fileapi/FileReaderSync.h:
* fileapi/NetworkSendQueue.cpp:
(WebCore::NetworkSendQueue::processMessages):
* fileapi/NetworkSendQueue.h:
* html/ImageBitmap.cpp:

Source/WebKit:

* WebProcess/Network/WebSocketChannel.cpp:
(WebKit::WebSocketChannel::createMessageQueue):

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

4 months agoUnreviewed, fix configuration setting of WPE Debug (Tests JS) bot
dpino@igalia.com [Sat, 13 Jun 2020 08:43:28 +0000 (08:43 +0000)]
Unreviewed, fix configuration setting of WPE Debug (Tests JS) bot
https://bugs.webkit.org/show_bug.cgi?id=213164

The bot was meant to run as Debug.

* BuildSlaveSupport/build.webkit.org-config/config.json:

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

4 months agoAutomation.computeElementLayout should return iframe-relative element rects (when...
bburg@apple.com [Sat, 13 Jun 2020 06:22:51 +0000 (06:22 +0000)]
Automation.computeElementLayout should return iframe-relative element rects (when coordinate system is 'Page')
https://bugs.webkit.org/show_bug.cgi?id=213139
<rdar://problem/55042445>

Reviewed by Devin Rousso.

Automation.computeElementLayout has two coordinate systems it can use, LayoutViewport (used for hit testing)
and Page (used for Get Element Rect). Since Get Element Rect expects coordinates relative to the current
browsing context, make the mode simpler by reporting the bounds from Element::boundingClientRect() which
are frame-relative.

Covered by existing WPT suite. The semantics of this command are under review, as
the remote end steps seem to describe a different result than what the non-normative text does.

* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::computeElementLayout):

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

4 months agoREGRESSION(r261985): Unable to respond to large comments on Bugzilla with always...
simon.fraser@apple.com [Sat, 13 Jun 2020 06:13:12 +0000 (06:13 +0000)]
REGRESSION(r261985): Unable to respond to large comments on Bugzilla with always-on scrollbars
https://bugs.webkit.org/show_bug.cgi?id=213135
<rdar://problem/64302086>

Reviewed by Tim Horton.
Source/WebCore:

The combination of programmatic scrolls (e.g. anchor click, reveal selection) and user scrolling
could result in a mismatch between the main thread and scrolling thread scroll positions, resulting
in missing tiles and offset cursor handling.

This happened if a programmatic scroll occurred and 'scrolledSinceLastCommit' was true for
the equivalent scrolling node at the start of a rendering update. synchronizeStateFromScrollingTree()
would take the scrolling thread's notion of the scroll position, clobbering the position resulting
from the programmatic scroll.

To fix this, call commitTreeStateIfNeeded() before synchronizeStateFromScrollingTree() to ensure that
any programmatic scrolls have been pushed to the scrolling tree before we fetch its state.

Some infrastructure is needed for testing; getting into the state where a programmatic
scroll and 'scrolledSinceLastCommit' happened in the same event loop cycle required adding
internals.scrollBySimulatingWheelEvent(), which just pokes the scrolling tree directly
without the complexities of wheel events dispatched via the UI process.

Test: scrollingcoordinator/mac/reveal-selection-tile-coverage.html

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::scrollBySimulatingWheelEventForTesting):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::scrollBySimulatingWheelEventForTesting):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::scrollBySimulatingWheelEventForTesting):
* page/scrolling/ScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::willStartRenderingUpdate):
* testing/Internals.cpp:
(WebCore::Internals::scrollBySimulatingWheelEvent):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Test that does a fake user scroll then a programmatic scroll from a timer (i.e. outside
the rendering update), then dumps tile caches to check that coverage rects match the
right scroll position.

* scrollingcoordinator/mac/reveal-selection-tile-coverage-expected.txt: Added.
* scrollingcoordinator/mac/reveal-selection-tile-coverage.html: Added.

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

4 months agoThe ||= operator (and similar ones) should produce valid bytecode even if the right...
rmorisset@apple.com [Sat, 13 Jun 2020 03:09:21 +0000 (03:09 +0000)]
The ||= operator (and similar ones) should produce valid bytecode even if the right side is a static error
https://bugs.webkit.org/show_bug.cgi?id=213154

Reviewed by Devin Rousso.

JSTests:

* stress/bytecode-for-rmw-with-invalid-right-side.js: Added.
(catch):

Source/JavaScriptCore:

There were two minor issues here that interacted:
- emitThrowReferenceError did not take an optional `dst` argument like everything else, and instead always returned a new temporary.
  As a result, the various functions that sometimes did "return emitThrowReferenceError(..);" could return a different RegisterID than the one
  provided to them through `dst`, breaking the invariant stated at the top of the file.
- ShortCircuitReadModifyResolveNode::emitBytecode used the result of such a function, unnecessarily, and (correctly) relied on the invariant being upheld.
The combination of these led to the bytecode trying to do a move of a temporary that was only defined in one of the predecessors of the basic block it was on,
which was caught by validateBytecode.

I fixed both issues, and verified that either fix is enough to stop the bug.
I fixed the first because other code may depend on that invariant in more subtle ways.
I fixed the second because it was just unnecessary complexity and made the code misleading.

I also reworded the comment at the top of NodesCodegen.cpp based on Keith's explanation and Mark's advice to make it less cryptic.

* bytecompiler/NodesCodegen.cpp:
(JSC::ThrowableExpressionData::emitThrowReferenceError):
(JSC::PostfixNode::emitBytecode):
(JSC::DeleteBracketNode::emitBytecode):
(JSC::DeleteDotNode::emitBytecode):
(JSC::PrefixNode::emitBytecode):
(JSC::ShortCircuitReadModifyResolveNode::emitBytecode):
(JSC::AssignErrorNode::emitBytecode):
* parser/Nodes.h:

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

4 months ago[IPC hardening] Check enum values in IPC::Decoder::decodeEnum() an IPC::Encoder:...
ddkilzer@apple.com [Sat, 13 Jun 2020 02:55:27 +0000 (02:55 +0000)]
[IPC hardening] Check enum values in IPC::Decoder::decodeEnum() an IPC::Encoder::encodeEnum()
<https://webkit.org/b/211988>
<rdar://problem/63137695>

Reviewed by Darin Adler.

Replace decodeEnum() with decode() and encodeEnum() with
operator<<().

Source/ThirdParty/libwebrtc:

* Source/webrtc/sdk/WebKit/WebKitEncoder.h:
(webrtc::WebKitEncodedFrameInfo::decode):
(webrtc::WebKitEncodedFrameInfo::encode const):

Source/WebCore:

* Modules/applicationmanifest/ApplicationManifest.h:
(WebCore::ApplicationManifest::decode):
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::encode const):
(WebCore::IDBKeyData::decode):
* Modules/indexeddb/shared/IDBCursorInfo.h:
(WebCore::IDBCursorInfo::encode const):
(WebCore::IDBCursorInfo::decode):
* Modules/indexeddb/shared/IDBError.h:
(WebCore::IDBError::encode const):
(WebCore::IDBError::decode):
* Modules/indexeddb/shared/IDBGetAllRecordsData.h:
(WebCore::IDBGetAllRecordsData::encode const):
(WebCore::IDBGetAllRecordsData::decode):
* Modules/indexeddb/shared/IDBGetRecordData.h:
(WebCore::IDBGetRecordData::encode const):
(WebCore::IDBGetRecordData::decode):
* Modules/indexeddb/shared/IDBIterateCursorData.h:
(WebCore::IDBIterateCursorData::encode const):
(WebCore::IDBIterateCursorData::decode):
* Modules/indexeddb/shared/IDBRequestData.h:
(WebCore::IDBRequestData::encode const):
(WebCore::IDBRequestData::decode):
* Modules/indexeddb/shared/IDBResultData.h:
(WebCore::IDBResultData::encode const):
(WebCore::IDBResultData::decode):
* Modules/indexeddb/shared/IDBTransactionInfo.h:
(WebCore::IDBTransactionInfo::encode const):
(WebCore::IDBTransactionInfo::decode):
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
(WebCore::PublicKeyCredentialCreationOptions::Parameters::decode):
(WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode):
* Modules/webauthn/PublicKeyCredentialDescriptor.h:
(WebCore::PublicKeyCredentialDescriptor::decode):
* dom/ExceptionData.h:
(WebCore::ExceptionData::encode const):
(WebCore::ExceptionData::decode):
* html/DataListSuggestionInformation.h:
(WebCore::DataListSuggestionInformation::encode const):
(WebCore::DataListSuggestionInformation::decode):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::encode const):
(WebCore::SecurityOrigin::decode):
* platform/ContextMenuItem.h:
(WTF::EnumTraits<WebCore::ContextMenuAction>):
- Add missing ContextMenuItemTagPasteAsPlainText that was added
  in r261800.
* platform/LinkIcon.h:
(WebCore::LinkIcon::encode const):
(WebCore::LinkIcon::decode):
* platform/PasteboardItemInfo.h:
(WebCore::PasteboardItemInfo::encode const):
(WebCore::PasteboardItemInfo::decode):
* platform/ScreenProperties.h:
(WebCore::ScreenData::encode const):
(WebCore::ScreenData::decode):
* platform/graphics/InbandGenericCue.h:
(WebCore::GenericCueData::encode const):
* platform/graphics/Path.h:
(WebCore::Path::encode const):
(WebCore::Path::decode):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::SetState::encode const):
(WebCore::DisplayList::SetState::decode):
(WebCore::DisplayList::DrawTiledScaledImage::encode const):
(WebCore::DisplayList::DrawTiledScaledImage::decode):
* platform/mediastream/CaptureDevice.h:
(WebCore::CaptureDevice::encode const):
* platform/mediastream/MediaConstraints.h:
(WebCore::MediaConstraint::encode const):
(WebCore::MediaConstraint::decode):
* platform/mediastream/MediaStreamRequest.h:
(WebCore::MediaStreamRequest::encode const):
(WebCore::MediaStreamRequest::decode):
* platform/mediastream/RealtimeMediaSourceCapabilities.h:
(WebCore::CapabilityValueOrRange::encode const):
(WebCore::CapabilityValueOrRange::decode):
(WebCore::RealtimeMediaSourceCapabilities::encode const):
(WebCore::RealtimeMediaSourceCapabilities::decode):
* platform/mediastream/RealtimeMediaSourceSettings.h:
(WebCore::RealtimeMediaSourceSettings::encode const):
(WebCore::RealtimeMediaSourceSettings::decode):
* platform/mock/MockMediaDevice.h:
(WebCore::MockDisplayProperties::encode const):
* platform/network/HTTPHeaderMap.h:
(WebCore::HTTPHeaderMap::CommonHeader::encode const):
(WebCore::HTTPHeaderMap::CommonHeader::decode):
* testing/MockWebAuthenticationConfiguration.h:
(WebCore::MockWebAuthenticationConfiguration::HidConfiguration::decode):
(WebCore::MockWebAuthenticationConfiguration::NfcConfiguration::decode):
* workers/service/ServiceWorkerContextData.h:
(WebCore::ServiceWorkerContextData::decode):
* workers/service/ServiceWorkerJobData.h:
(WebCore::ServiceWorkerJobData::encode const):
(WebCore::ServiceWorkerJobData::decode):

Source/WebKit:

* GPUProcess/media/TextTrackPrivateRemoteConfiguration.h:
(WebKit::TextTrackPrivateRemoteConfiguration::encode const):
* GPUProcess/media/TrackPrivateRemoteConfiguration.h:
(WebKit::TrackPrivateRemoteConfiguration::encode const):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* Platform/IPC/Decoder.h:
(IPC::Decoder::decode):
(IPC::Decoder::operator>>):
- Make use of std::underlying_type_t<>.
(IPC::Decoder::decodeEnum): Delete.
- Replace with calls to decode().
* Platform/IPC/Encoder.h:
(IPC::Encoder::operator<<):
(IPC::Encoder::encode):
- Make use of WTF::enumToUnderlyingType<>.
(IPC::Encoder::encodeEnum): Delete.
- Replace with calls to operator<<().
* Shared/Cocoa/ArgumentCodersCocoa.mm:
(IPC::decodeObject):
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::encode):
(IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode):
(IPC::ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::encode):
(IPC::ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::decode):
* Shared/ContextMenuContextData.cpp:
(WebKit::ContextMenuContextData::encode const):
(WebKit::ContextMenuContextData::decode):
* Shared/FocusedElementInformation.cpp:
(WebKit::FocusedElementInformation::encode const):
(WebKit::FocusedElementInformation::decode):
* Shared/LoadParameters.cpp:
(WebKit::LoadParameters::encode const):
(WebKit::LoadParameters::decode):
* Shared/NavigationActionData.cpp:
(WebKit::NavigationActionData::encode const):
(WebKit::NavigationActionData::decode):
* Shared/PlatformPopupMenuData.cpp:
(WebKit::PlatformPopupMenuData::encode const):
(WebKit::PlatformPopupMenuData::decode):
* Shared/Plugins/PluginProcessCreationParameters.cpp:
(WebKit::PluginProcessCreationParameters::encode const):
(WebKit::PluginProcessCreationParameters::decode):
* Shared/PrintInfo.cpp:
(WebKit::PrintInfo::encode const):
(WebKit::PrintInfo::decode):
* Shared/RTCPacketOptions.cpp:
(WebKit::RTCPacketOptions::encode const):
(WebKit::RTCPacketOptions::decode):
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode const):
(WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateNode>::encode):
(ArgumentCoder<RequestedScrollData>::encode):
(ArgumentCoder<RequestedScrollData>::decode):
(WebKit::RemoteScrollingCoordinatorTransaction::decode):
* Shared/SessionState.cpp:
(WebKit::HTTPBody::Element::encode const):
(WebKit::HTTPBody::Element::decode):
(WebKit::PageState::encode const):
(WebKit::PageState::decode):
* Shared/TouchBarMenuItemData.cpp:
(WebKit::TouchBarMenuItemData::encode const):
(WebKit::TouchBarMenuItemData::decode):
* Shared/UserData.cpp:
(WebKit::UserData::encode):
(WebKit::UserData::decode):
* Shared/WebContextMenuItemData.cpp:
(WebKit::WebContextMenuItemData::encode const):
(WebKit::WebContextMenuItemData::decode):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<LinearTimingFunction>::encode):
(IPC::ArgumentCoder<CubicBezierTimingFunction>::encode):
(IPC::ArgumentCoder<CubicBezierTimingFunction>::decode):
(IPC::ArgumentCoder<StepsTimingFunction>::encode):
(IPC::ArgumentCoder<SpringTimingFunction>::encode):
(IPC::ArgumentCoder<PluginInfo>::encode):
(IPC::ArgumentCoder<PluginInfo>::decode):
(IPC::ArgumentCoder<ProtectionSpace>::encode):
(IPC::ArgumentCoder<ProtectionSpace>::decode):
(IPC::ArgumentCoder<Credential>::encode):
(IPC::ArgumentCoder<Credential>::decode):
(IPC::ArgumentCoder<Cursor>::encode):
(IPC::ArgumentCoder<Cursor>::decode):
(IPC::ArgumentCoder<ResourceError>::encode):
(IPC::ArgumentCoder<ResourceError>::decode):
(IPC::ArgumentCoder<DragData>::encode):
(IPC::ArgumentCoder<DragData>::decode):
(IPC::ArgumentCoder<CompositionUnderline>::encode):
(IPC::ArgumentCoder<CompositionUnderline>::decode):
(IPC::ArgumentCoder<FileChooserSettings>::encode):
(IPC::ArgumentCoder<FileChooserSettings>::decode):
(IPC::ArgumentCoder<TextCheckingRequestData>::encode):
(IPC::ArgumentCoder<TextCheckingRequestData>::decode):
(IPC::ArgumentCoder<TextCheckingResult>::encode):
(IPC::ArgumentCoder<TextCheckingResult>::decode):
(IPC::ArgumentCoder<UserStyleSheet>::encode):
(IPC::ArgumentCoder<UserStyleSheet>::decode):
(IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
(IPC::ArgumentCoder<ScrollableAreaParameters>::decode):
(IPC::ArgumentCoder<FilterOperation>::encode):
(IPC::decodeFilterOperation):
(IPC::ArgumentCoder<FontAttributes>::encode):
(IPC::ArgumentCoder<FontAttributes>::decode):
(IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::encode):
(IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::decode):
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPopupItem.cpp:
(WebKit::WebPopupItem::encode const):
(WebKit::WebPopupItem::decode):
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebsiteData/WebsiteData.cpp:
(WebKit::WebsiteData::Entry::encode const):
(WebKit::WebsiteData::Entry::decode):
* Shared/curl/WebCoreArgumentCodersCurl.cpp:
(IPC::ArgumentCoder<ResourceError>::encodePlatformData):
(IPC::ArgumentCoder<ResourceError>::decodePlatformData):
(IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
(IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData):
* Shared/glib/InputMethodState.cpp:
(WebKit::InputMethodState::encode const):
(WebKit::InputMethodState::decode):
* Shared/glib/UserMessage.cpp:
(WebKit::UserMessage::encode const):
(WebKit::UserMessage::decode):
* Shared/mac/ColorSpaceData.mm:
(WebKit::ColorSpaceData::encode const):
(WebKit::ColorSpaceData::decode):
* Shared/mac/SecItemRequestData.cpp:
(WebKit::SecItemRequestData::encode const):
(WebKit::SecItemRequestData::decode):
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<WebCore::ResourceRequest>::encodePlatformData):
(IPC::ArgumentCoder<WebCore::ResourceRequest>::decodePlatformData):
(IPC::ArgumentCoder<WebCore::CertificateInfo>::encode):
(IPC::ArgumentCoder<WebCore::CertificateInfo>::decode):
* Shared/soup/WebCoreArgumentCodersSoup.cpp:
(IPC::ArgumentCoder<SoupNetworkProxySettings>::encode):
(IPC::ArgumentCoder<SoupNetworkProxySettings>::decode):
* WebProcess/GPU/media/RemoteMediaPlayerState.h:
(WebKit::RemoteMediaPlayerState::encode const):
(WebKit::RemoteMediaPlayerState::decode):
* WebProcess/Network/NetworkProcessConnectionInfo.h:
(WebKit::NetworkProcessConnectionInfo::decode):
* WebProcess/Plugins/Plugin.cpp:
(WebKit::Plugin::Parameters::encode const):
(WebKit::Plugin::Parameters::decode):
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
(WebKit::PlatformCAAnimationRemote::KeyframeValue::encode const):
(WebKit::PlatformCAAnimationRemote::KeyframeValue::decode):
(WebKit::PlatformCAAnimationRemote::Properties::encode const):
(WebKit::PlatformCAAnimationRemote::Properties::decode):

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

4 months ago[iPadOS] Focusing selects and color inputs should not bring up the software keyboard
wenson_hsieh@apple.com [Sat, 13 Jun 2020 02:01:44 +0000 (02:01 +0000)]
[iPadOS] Focusing selects and color inputs should not bring up the software keyboard
https://bugs.webkit.org/show_bug.cgi?id=213149
<rdar://problem/64312450>

Reviewed by Darin Adler.

Source/WebKit:

After <trac.webkit.org/r261658>, we now opt into bringing up the software keyboard when focusing color inputs
and select elements. This is due to the changes in `-_shouldShowAutomaticKeyboardUIIgnoringInputMode`, which
were intended to make us return `NO` for date and time inputs, but also unintentionally makes us return `YES`
on iPadOS.

This patch fixes the bug by returning `!WebKit::currentUserInterfaceIdiomIsPad()` instead, and additionally
preserves the existing behavior of now showing a color picker for `<input type="color" readonly>` on iPhone.

Test: fast/forms/ios/ipad/select-should-not-bring-up-software-keyboard.html

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView becomeFirstResponderForWebView]):
(-[WKContentView resignFirstResponderForWebView]):
(-[WKContentView _shouldShowAutomaticKeyboardUIIgnoringInputMode]):
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):

LayoutTests:

Add a new layout test.

* fast/forms/ios/ipad/select-should-not-bring-up-software-keyboard-expected.txt: Added.
* fast/forms/ios/ipad/select-should-not-bring-up-software-keyboard.html: Added.

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

4 months ago[JSC] el(Greek) characters' upper-case conversion is locale-sensitive
ysuzuki@apple.com [Sat, 13 Jun 2020 01:15:20 +0000 (01:15 +0000)]
[JSC] el(Greek) characters' upper-case conversion is locale-sensitive
https://bugs.webkit.org/show_bug.cgi?id=213155
<rdar://problem/55018467>

Reviewed by Darin Adler.

JSTests:

* stress/intl-el-case.js: Added.
(shouldBe):

Source/JavaScriptCore:

CLDR defines 4 locales which has language-sensitive case conversions. "az", "el", "lt", and "tr", where,

    az = Azerbaijani
    el = Greek
    lt = Lithuanian
    tr = Turkish

We can ensure it easily like this.

    1. Download CLDR data
    2. `ls common/transforms/*Upper.xml`

        common/transforms/az-Upper.xml
        common/transforms/el-Upper.xml
        common/transforms/lt-Upper.xml
        common/transforms/tr-Upper.xml

And ECMA-402 String.prototype.{toLocaleLowerCase,toLocaleUpperCase} requires these locales are listed as `availableLocales`.

    > 7. Let availableLocales be a List with language tags that includes the languages for which the Unicode Character
    >    Database contains language sensitive case mappings. Implementations may add additional language tags if they
    >    support case mapping for additional locales.

    https://tc39.es/ecma402/#sup-string.prototype.tolocalelowercase

This patch adds "el" to our maintained availableLocales list. Previously we only had "az", "lt", and "tr".

* runtime/StringPrototype.cpp:
(JSC::toLocaleCase):
(JSC::stringProtoFuncToLocaleUpperCase):

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

4 months agoTests expecting a crash should use a signal handler in the JSC CLI process
keith_miller@apple.com [Sat, 13 Jun 2020 00:22:31 +0000 (00:22 +0000)]
Tests expecting a crash should use a signal handler in the JSC CLI process
https://bugs.webkit.org/show_bug.cgi?id=212479

Reviewed by Yusuke Suzuki.

JSTests:

* stress/ensure-crash.js:
* stress/incorrect-put-could-generate-invalid-ic-but-still-not-causing-bad-behavior-bad-transition-debug.js:
* stress/incorrect-put-could-generate-invalid-ic-but-still-not-causing-bad-behavior-bad-transition.js:
* stress/incorrect-put-could-generate-invalid-ic-but-still-not-causing-bad-behavior-debug.js: Removed.
* stress/incorrect-put-could-generate-invalid-ic-but-still-not-causing-bad-behavior.js:
* stress/incorrect-put-could-generate-invalid-ic-involving-dictionary-flatten-debug.js:

Source/JavaScriptCore:

Have the -s option use WTF::Signals and make sure it adds breakpoint catching
as well.

* jsc.cpp:
(printUsageStatement):
(CommandLine::parseArguments):
* tools/SigillCrashAnalyzer.cpp:
(JSC::installCrashHandler):

Source/WTF:

Add signals for floating point exceptions and breakpoints. There's a
note for breakpoints that explains how using them in the same process
as lldb will cause badness. Fortunately, the only place I plan on using
the breakpoint handler is to check for tests where crashing is expected.

* wtf/threads/Signals.cpp:
(WTF::fromMachException):
(WTF::toMachMask):
* wtf/threads/Signals.h:
(WTF::toSystemSignal):
(WTF::fromSystemSignal):

Tools:

Crashing tests should now exit with status zero.

* Scripts/run-jsc-stress-tests:
* Scripts/webkitruby/jsc-stress-test-writer-default.rb:
* Scripts/webkitruby/jsc-stress-test-writer-playstation.rb:
* Scripts/webkitruby/jsc-stress-test-writer-ruby.rb:

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

4 months agoRe-write accessibility/form-control-value-settable.html so that it can pass in both...
andresg_22@apple.com [Fri, 12 Jun 2020 23:55:42 +0000 (23:55 +0000)]
Re-write accessibility/form-control-value-settable.html so that it can pass in both isolated tree mode on and off.
https://bugs.webkit.org/show_bug.cgi?id=213150

Reviewed by Chris Fleizach.

In isolated tree mode, it is necessary to setTimeout after setting the
focus so that the isolated tree can be updated.

* accessibility/form-control-value-settable.html:
* platform/gtk/accessibility/form-control-value-settable-expected.txt:
* platform/mac/accessibility/form-control-value-settable-expected.txt:

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

4 months agoMake API tests tolerant of our relatively new use of WebPageProxy::preconnectTo
achristensen@apple.com [Fri, 12 Jun 2020 23:32:15 +0000 (23:32 +0000)]
Make API tests tolerant of our relatively new use of WebPageProxy::preconnectTo
https://bugs.webkit.org/show_bug.cgi?id=213144

Reviewed by Geofferey Garen.

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
(WebKit::NetworkSessionCocoa::taskServerConnectionSucceeded):
(WebKit::NetworkSessionCocoa::taskReceivedBytes): Deleted.
Fix our logic that remembers successful client certificate connections.
If a task completes with no error (like a preconnect task does), consider that a successful connection.

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::preconnectTo):
Remove the check to not preconnect to loopback addresses.
This was making our tests different than the real internet and prevented me from landing a perfectly good test
in https://bugs.webkit.org/show_bug.cgi?id=213109

Tools:

Most changes are straightforward moving to HTTPServer, which is more tolerant of different numbers of connections except these two:

The ResourceLoadDelegate.Challenge API test was checking the output of _WKResourceLoadDelegate.didReceiveChallenge
by using a server trust challenge.  Now that preconnecting happens, the server trust evaluation would happen with a
PreconnectTask, not the main resource load.  The WKNavigationDelegate still gets the challenge and there is no problem
here, but in order to continue to test _WKResourceLoadDelegate.didReceiveChallenge I use a basic authentication challenge
instead of a server trust evaluation.

The WebKit.FastServerTrust API test now has two failed attempts (one from the preconnect attempt, one from the main resource load attempt),
but only when _strictTrustEvaluate is not available.

* TestWebKitAPI/TCPServer.cpp:
(TestWebKitAPI::TCPServer::TCPServer):
* TestWebKitAPI/TCPServer.h:
* TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:
(TEST):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadDelegate.mm:
* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:
* TestWebKitAPI/cocoa/HTTPServer.h:
* TestWebKitAPI/cocoa/HTTPServer.mm:
(TestWebKitAPI::HTTPServer::respondWithChallengeThenOK):

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

4 months ago[iOS] Preferences are not being observed if the process pool is being created after...
pvollan@apple.com [Fri, 12 Jun 2020 22:38:27 +0000 (22:38 +0000)]
[iOS] Preferences are not being observed if the process pool is being created after activation
https://bugs.webkit.org/show_bug.cgi?id=213145

Reviewed by Brent Fulgham.

If the app is creating the Web process pool after being activated, preferences will not be observed until the app is being backgrounded
and then foregrounded again, since the preference observer is initialized when handling the app activation notification.

No new tests, since an API test would make sense in this case, but API tests aren't run on iOS.

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):

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

4 months agoAsyncGenerator should await "return" completions
shvaikalesh@gmail.com [Fri, 12 Jun 2020 22:13:19 +0000 (22:13 +0000)]
AsyncGenerator should await "return" completions
https://bugs.webkit.org/show_bug.cgi?id=212774

Reviewed by Ross Kirsling.

JSTests:

With this change, async generator stress tests now pass in Chrome and Firefox (tested manually).

* stress/async-iteration-yield-star-interface.js:
* stress/async-iteration-yield-star.js:
* test262/expectations.yaml: Mark 8 test cases as passing.

Source/JavaScriptCore:

This patch fixes 2 spec discrepancies, observable with async generators if the
value of "return" completion is a Promise, aligning JSC with V8 and SpiderMonkey.

* builtins/AsyncGeneratorPrototype.js:
(onFulfilled):
This change implements step 8 of AsyncGeneratorYield [1], that is executed after
step 15 of AsyncGeneratorResumeNext [2] (implemented as @doAsyncGeneratorBodyCall).
We are safe to rely on [[AsyncGeneratorState]] being "suspendedYield" (set in
step 6 of AsyncGeneratorYield [1]) instead of adding extra field to AsyncGenerator:
AsyncGeneratorResumeNext [2] does not overwrite "suspendedYield" state.
This change fixes most of test262 cases.

[1]: https://tc39.es/ecma262/#sec-asyncgeneratoryield
[2]: https://tc39.es/ecma262/#sec-asyncgeneratorresumenext

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitDelegateYield):
This change implements step 7.c.iii.1 of yield* runtime semantics [3], that is
observable only if [[Value]] has userland "then" getter. Awaited result is discarded.
This change fixes async-generator/yield-star-return-then-getter-ticks.js test262 case.

[3]: https://tc39.es/ecma262/#sec-generator-function-definitions-runtime-semantics-evaluation

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

4 months agoStop allowing pages served over HTTPS with "Cache-Control: no-store" into the back...
cdumez@apple.com [Fri, 12 Jun 2020 22:05:26 +0000 (22:05 +0000)]
Stop allowing pages served over HTTPS with "Cache-Control: no-store" into the back/forward cache
https://bugs.webkit.org/show_bug.cgi?id=213147
<rdar://problem/64249683>

Reviewed by Geoffrey Garen.

Source/WebCore:

Stop allowing pages served over HTTPS with "Cache-Control: no-store" into the back/forward cache.
This is a revert of r250437 due to push back from Web developers.

No new tests, updated existing tests.

* history/BackForwardCache.cpp:
(WebCore::canCacheFrame):

LayoutTests:

Update layout test coverage.

* http/tests/navigation/https-in-page-cache-expected.txt:
* http/tests/navigation/resources/https-in-page-cache-1.php:

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

4 months agoUnreviewed, reverting r262904.
lawrence.j@apple.com [Fri, 12 Jun 2020 21:58:25 +0000 (21:58 +0000)]
Unreviewed, reverting r262904.

This commit broke a test on Mac wk1 Debug.

Reverted changeset:

"[Cocoa] Build callOnMainThread on WTF::RunLoop rather than on
a timer"
https://bugs.webkit.org/show_bug.cgi?id=213063
https://trac.webkit.org/changeset/262904

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

4 months agoREGRESSION: [ Mac wk1 Debug ] media/remoteplayback-target-availability.html is flaky...
lawrence.j@apple.com [Fri, 12 Jun 2020 21:03:05 +0000 (21:03 +0000)]
REGRESSION: [ Mac wk1 Debug ] media/remoteplayback-target-availability.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=213146

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

4 months ago[buildbot] [GTK][WPE] Move WebDriver test to own bot
dpino@igalia.com [Fri, 12 Jun 2020 21:02:23 +0000 (21:02 +0000)]
[buildbot] [GTK][WPE] Move WebDriver test to own bot
https://bugs.webkit.org/show_bug.cgi?id=212527

Reviewed by Carlos Alberto Lopez Perez.

Move 'webdriver-test' step from GTK Release and GTK Debug test bots
to separated bots.

For bots that require a Wayland display (WPE and GTK Wayland),
'webdriver-test' step is run on the corresponding general test bot,
since it's not possible at the moment to run tests that require a
Wayland display in a bot set as a container.

* BuildSlaveSupport/build.webkit.org-config/config.json:
* BuildSlaveSupport/build.webkit.org-config/factories.py:
(TestFactory.__init__):
(TestWebDriverFactory):
(TestWebDriverFactory.__init__):
* BuildSlaveSupport/build.webkit.org-config/steps_unittest.py:

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

4 months agoUnreviewed, address Darin's feedback on r262890.
ross.kirsling@sony.com [Fri, 12 Jun 2020 20:56:24 +0000 (20:56 +0000)]
Unreviewed, address Darin's feedback on r262890.

* runtime/IntlObject.cpp:
(JSC::addScriptlessLocaleIfNeeded):
Use != instead of < for clarity.

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

4 months agoBuild is broken with EVENT_LOOP_TYPE=GLib
aperez@igalia.com [Fri, 12 Jun 2020 20:52:02 +0000 (20:52 +0000)]
Build is broken with EVENT_LOOP_TYPE=GLib
https://bugs.webkit.org/show_bug.cgi?id=212987

Reviewed by Konstantin Tokarev.

.:

* Source/cmake/OptionsJSCOnly.cmake: Add gio-unix as a required component of the GLib
package, as it is needed for the remote inspector support with EVENT_LOOP_TYPE=GLib.

Source/JavaScriptCore:

* PlatformJSCOnly.cmake: Add sources needed to support the remote inspector to
JavaScriptCore_SOURCES.

Source/WTF:

* wtf/CurrentTime.cpp: Make sure that <time.h> is included to get clock_gettime() and
friends defined when USE_GLIB is disabled.
* wtf/PlatformJSCOnly.cmake: Use FileSystemGLib instead of FileSystemPOSIX when
EVENT_LOOP_TYPE=GLib is set, add missing sources needed when ENABLE_REMOTE_INSPECTOR
is set.
* wtf/glib/RunLoopSourcePriority.h: Use the same list of priorities for WPE and JSCOnly.

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

4 months agoStop to use ActiveDOMObject::setPendingActivity() for Modules/fetch
commit-queue@webkit.org [Fri, 12 Jun 2020 20:36:26 +0000 (20:36 +0000)]
Stop to use ActiveDOMObject::setPendingActivity() for Modules/fetch
https://bugs.webkit.org/show_bug.cgi?id=213037

Patch by Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> on 2020-06-12
Reviewed by Youenn Fablet.

By ActiveDOMObject's comments,
these methods should be replaced with using makePendingActivity().

`JSFetchRequest`/`JSFetchResponse` (as derived class of `JSDOMWrapper`) hold
`FetchRequest`/`FetchResponse`, and they have `FetchBodyOwner`
as a base class and keep alive it. We can replace
`setPendingActivity()` calling from `FetchBodyOwner`.

* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::loadBlob):
(WebCore::FetchBodyOwner::finishBlobLoading):
(WebCore::FetchBodyOwner::virtualHasPendingActivity const):
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchBodySource.cpp:
(WebCore::FetchBodySource::setActive):
(WebCore::FetchBodySource::setInactive):
* Modules/fetch/FetchBodySource.h:

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

4 months ago[Curl] Implement functions to use ResourceLoadStatistics.
commit-queue@webkit.org [Fri, 12 Jun 2020 19:47:15 +0000 (19:47 +0000)]
[Curl] Implement functions to use ResourceLoadStatistics.
https://bugs.webkit.org/show_bug.cgi?id=207692

Patch by Takashi Komori <Takashi.Komori@sony.com> on 2020-06-12
Reviewed by Don Olmstead.

Implement functions which are required to implement ResourceLoadStatistics for Curl port.

Source/WebCore:

Tests: http/tests/resourceLoadStatistics/

* CMakeLists.txt:
* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::openDatabase):
(WebCore::CookieJarDB::setCookie):
(WebCore::CookieJarDB::allDomains):
(WebCore::CookieJarDB::deleteCookiesForHostname):
* platform/network/curl/CookieJarDB.h:
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
(WebCore::NetworkStorageSession::setCookies):
(WebCore::NetworkStorageSession::deleteCookiesForHostnames):
(WebCore::NetworkStorageSession::getHostnamesWithCookies):

Source/WebKit:

In NetworkDataTaskCurl.cpp we check if we should block cookies and block if needed.

Tests: http/tests/resourceLoadStatistics/

* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::create):
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
(WebKit::NetworkDataTaskCurl::createCurlRequest):
(WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
(WebKit::NetworkDataTaskCurl::blockCookies):
(WebKit::NetworkDataTaskCurl::unblockCookies):
(WebKit::NetworkDataTaskCurl::shouldBlockCookies):
(WebKit::NetworkDataTaskCurl::isThirdPartyRequest):
* NetworkProcess/curl/NetworkDataTaskCurl.h:
* NetworkProcess/curl/NetworkSessionCurl.cpp:
(WebKit::NetworkSessionCurl::NetworkSessionCurl):
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreGetAllStorageAccessEntries):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::parameters):

Tools:

Tests: http/tests/resourceLoadStatistics/

* WebKitTestRunner/TestController.cpp:
(WTR::GetAllStorageAccessEntriesCallbackContext::GetAllStorageAccessEntriesCallbackContext):
(WTR::getAllStorageAccessEntriesCallback):
(WTR::TestController::getAllStorageAccessEntries):

LayoutTests:

Tests: http/tests/resourceLoadStatistics/

* platform/wincairo-wk1/TestExpectations:
* platform/wincairo/TestExpectations:

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

4 months agoIn isolated tree mode 2, AXIsolatedObject::setChildrenIDs should be called only on...
andresg_22@apple.com [Fri, 12 Jun 2020 19:24:56 +0000 (19:24 +0000)]
In isolated tree mode 2, AXIsolatedObject::setChildrenIDs should be called only on secondary thread.
https://bugs.webkit.org/show_bug.cgi?id=213124

Reviewed by Chris Fleizach.

Covered by existing tests.

- AXIsolatedTree::createSubtree was calling AXIsolatedObject::setChildrenIDs
which should be called only on the secondary thread. Now it is queueing
the children update under lock.
- The unsigned int range for object IDs was being overrun for large
number of objects like in the case of the sample page in <rdar://problem/59331146>.
Increased the size of AXID to size_t.
- Better handle the case of invalid object IDs, although this needs
more work, since we should never encounter this case.

* accessibility/AccessibilityObjectInterface.h: AXID are now size_t instead of unsigned ints.
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::AXIsolatedObject):
(WebCore::AXIsolatedObject::setChildrenIDs): Inlined in header.
* accessibility/isolatedtree/AXIsolatedObject.h:
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::createSubtree):

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

4 months ago[ Mojave wk2 Release ] js/dom/unhandled-promise-rejection-console-no-report.html...
ysuzuki@apple.com [Fri, 12 Jun 2020 18:53:37 +0000 (18:53 +0000)]
[ Mojave wk2 Release ] js/dom/unhandled-promise-rejection-console-no-report.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=212851

Reviewed by Darin Adler.

This test is wrong since both onunhandledrejection and setTimeout are driven by macro-tasks.
There is no ordering between them so they have race condition, and this race condition makes this
the test flaky. We should fix the test. This patch removes the dependency to setTimeout.

* js/dom/unhandled-promise-rejection-console-no-report-expected.txt:
* js/dom/unhandled-promise-rejection-console-no-report.html:

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

4 months agoFileInputType should use WeakPtr for FileListCreator lambdas
aestes@apple.com [Fri, 12 Jun 2020 18:40:25 +0000 (18:40 +0000)]
FileInputType should use WeakPtr for FileListCreator lambdas
https://bugs.webkit.org/show_bug.cgi?id=213130
<rdar://problem/64276591>

Reviewed by David Kilzer.

FileInputType::filesChosen was passing a completion handler to FileListCreator::create that
captured |this|. If the FileListCreator instance still existed when |this| was destroyed,
FileInputType::~FileInputType would clear the captured |this| by calling
FileListCreator::clear. This can be simplified by having the FileListCreator completion
handler capture a WeakPtr to |this|.

Also, when FileInputType::allowsDirectories is false, m_fileListCreator would not be
properly cleared after creating the file list. The FileListCreator completion handler would
set m_fileListCreator to nullptr, but would be executed *before* FileListCreator::create
returned and set m_fileListCreator to the newly-created FileListCreator object. Fixed this
by having FileListCreator::create execute the completion handler immediately and return
nullptr in cases where a FileListCreator does not need to be created for directory
resolution.

Covered by existing tests.

* html/FileInputType.cpp:
(WebCore::FileInputType::~FileInputType):
(WebCore::FileInputType::filesChosen):
* html/FileInputType.h:
* html/FileListCreator.cpp:
(WebCore::createFileList):
(WebCore::FileListCreator::create):
(WebCore::FileListCreator::FileListCreator):
(WebCore::FileListCreator::createFileList):
* html/FileListCreator.h:
(WebCore::FileListCreator::create): Deleted.

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

4 months agoDouble tap to zoom out doesn't work after upgrading to iOS 13
graouts@webkit.org [Fri, 12 Jun 2020 18:24:02 +0000 (18:24 +0000)]
Double tap to zoom out doesn't work after upgrading to iOS 13
https://bugs.webkit.org/show_bug.cgi?id=205158
<rdar://problem/205158>

Unreviewed. Make the test that was previously added into a test that can be run on iPad instead
of having to be skipped.

* fast/events/ios/fast-click-double-tap-to-zoom-in-on-text-and-then-again-to-zoom-out.html:
* platform/ipad/TestExpectations:

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

4 months agoREGRESSION (r262618): Very slow typing in a github issue
antti@apple.com [Fri, 12 Jun 2020 18:22:31 +0000 (18:22 +0000)]
REGRESSION (r262618): Very slow typing in a github issue
https://bugs.webkit.org/show_bug.cgi?id=213137
<rdar://problem/64214117>

Reviewed by Darin Adler.

Source/WebCore:

Test: fast/media/media-query-keyframes-resolution-count.html

If a stylesheet had multiple media queries and one of them forced static resolution
(by containing @keyframes rule for example) we would end up reseting the style multiple
times and forcing unneeded style resolutions.

* style/RuleSet.cpp:
(WebCore::Style::RuleSet::evaluteDynamicMediaQueryRules):

We can't bail out from the loop. Even though the result is known we still need to loop to
save the evaluation result for all media queries.

LayoutTests:

* fast/media/media-query-keyframes-resolution-count-expected.txt: Added.
* fast/media/media-query-keyframes-resolution-count.html: Added.

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

4 months agoDouble tap to zoom out doesn't work after upgrading to iOS 13
graouts@webkit.org [Fri, 12 Jun 2020 18:03:48 +0000 (18:03 +0000)]
Double tap to zoom out doesn't work after upgrading to iOS 13
https://bugs.webkit.org/show_bug.cgi?id=205158
<rdar://problem/205158>

Reviewed by Wenson Hsieh.

Source/WebKit:

Test: fast/events/ios/fast-click-double-tap-to-zoom-in-on-text-and-then-again-to-zoom-out.html

In order to determine whether a significant zoom to happen, we should use the current page scale
factor and not the initial page scale factor.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:nodeIsRootLevel:]):

LayoutTests:

Add a test that double taps to zoom in and then double taps to zoom out. This test would fail to zoom
out prior to this source change. This test is skipped on iPad since desktop-class browsing mode has
heuristics that would prevent the second double-tap to zoom out.

* fast/events/ios/fast-click-double-tap-to-zoom-in-on-text-and-then-again-to-zoom-out-expected.txt: Added.
* fast/events/ios/fast-click-double-tap-to-zoom-in-on-text-and-then-again-to-zoom-out.html: Added.
* platform/ipad/TestExpectations:

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

4 months agoSupport building test runners for watchOS and tvOS
jbedard@apple.com [Fri, 12 Jun 2020 17:40:32 +0000 (17:40 +0000)]
Support building test runners for watchOS and tvOS
https://bugs.webkit.org/show_bug.cgi?id=213128
<rdar://problem/64298006>

Reviewed by Tim Horton.

* DumpRenderTree/mac/Configurations/Base.xcconfig: Link against framework stubs.
* DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig: Apply iOS rules to all embedded sdks.
* WebKitTestRunner/Configurations/Base.xcconfig: Link against framework stubs.
* WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig: Apply iOS rules to all embedded sdks.
* WebKitTestRunner/Configurations/WebKitTestRunnerApp.xcconfig: Use watchOS entitlements for tvOS.

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

4 months agoTestWebKitAPI: Build for watchOS and tvOS
jbedard@apple.com [Fri, 12 Jun 2020 17:39:49 +0000 (17:39 +0000)]
TestWebKitAPI: Build for watchOS and tvOS
https://bugs.webkit.org/show_bug.cgi?id=213127
<rdar://problem/64297979>

Reviewed by Tim Horton.

* TestWebKitAPI/Configurations/Base.xcconfig: Link against framework stubs.
* TestWebKitAPI/Configurations/InjectedBundle.xcconfig: Apply iOS rules to all embedded sdks.
* TestWebKitAPI/Configurations/TestWTF.xcconfig: Ditto.
* TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig: Link against framework stubs.
* TestWebKitAPI/Configurations/WebProcessPlugIn.xcconfig: Apply iOS rules to all embedded sdks.
* TestWebKitAPI/config.h: WatchOS uses SSL.

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

4 months agoWeb Inspector: modify initial content localized string for Inspector Bootstrap Script
drousso@apple.com [Fri, 12 Jun 2020 17:29:30 +0000 (17:29 +0000)]
Web Inspector: modify initial content localized string for Inspector Bootstrap Script
https://bugs.webkit.org/show_bug.cgi?id=213134

Reviewed by Timothy Hatcher.

* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.async createBootstrapScript):

* Localizations/en.lproj/localizedStrings.js:

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

4 months agoREGRESSION: (r262397): [ Mac wk2 ] inspector/canvas/create-context-webgpu.html is...
lawrence.j@apple.com [Fri, 12 Jun 2020 16:30:17 +0000 (16:30 +0000)]
REGRESSION: (r262397): [ Mac wk2 ] inspector/canvas/create-context-webgpu.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=213123

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

4 months ago[GTK][WPE] Remove some duplicated entries and add missing bug info
lmoura@igalia.com [Fri, 12 Jun 2020 16:20:52 +0000 (16:20 +0000)]
[GTK][WPE] Remove some duplicated entries and add missing bug info

Unreviewed test gardening

Unified the unsuported tests entries for GTK and WPE and added some
entries for the skipped top level tests.

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

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

4 months agoLayoutTests/imported/w3c:
commit-queue@webkit.org [Fri, 12 Jun 2020 16:14:44 +0000 (16:14 +0000)]
LayoutTests/imported/w3c:
Change FileReader.error to DOMException from obsoleted FileError
https://bugs.webkit.org/show_bug.cgi?id=213117

Patch by Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> on 2020-06-12
Reviewed by Chris Dumez.

* web-platform-tests/FileAPI/historical.https-expected.txt:
  FileError should not be exposed.

Source/WebCore:
FileReader.error should be DOMException now
https://bugs.webkit.org/show_bug.cgi?id=213117

Patch by Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> on 2020-06-12
Reviewed by Chris Dumez.

By the [lastest spec](https://w3c.github.io/FileAPI/),
`FileReader.error` should return `DOMException`
and this remove obsoleted `FileError` from exposed interfaces.

Internally, our codebase still depends on `fileapi/FileError.h`
in everywhere. I'll plan to create a patch to refactor them.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.order:
* WebCore.xcodeproj/project.pbxproj:
* fileapi/FileError.idl: Removed.
* fileapi/FileReader.cpp:
(WebCore::FileReader::abort):
(WebCore::FileReader::didFail):
* fileapi/FileReader.h:
* fileapi/FileReader.idl:
* fileapi/FileReaderSync.cpp:
(WebCore::FileReaderSync::errorCodeToException):
* fileapi/FileReaderSync.h:

LayoutTests:
Change FileReader.error to DOMException from obsoleted FileError
https://bugs.webkit.org/show_bug.cgi?id=213117

Patch by Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> on 2020-06-12
Reviewed by Chris Dumez.

By the [lastest spec](https://w3c.github.io/FileAPI/),
`FileReader.error` should return `DOMException`
and this change remove `FileError` from exposed interfaces.

* fast/files/file-reader-abort-expected.txt:
* fast/files/file-reader-abort-using-open-panel-expected.txt:
* fast/files/read-blob-async-expected.txt:
* fast/files/read-file-async-expected.txt:
* fast/files/workers/worker-read-blob-async-expected.txt:
* fast/files/workers/worker-read-file-async-expected.txt:
  Update to `DOMException` error code from `FileError` error code.
* platform/mac-wk1/imported/w3c/web-platform-tests/FileAPI/historical.https-expected.txt:
  FileError should not be exposed.

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

4 months agoUnreviewed, reverting r262942.
commit-queue@webkit.org [Fri, 12 Jun 2020 16:09:05 +0000 (16:09 +0000)]
Unreviewed, reverting r262942.
https://bugs.webkit.org/show_bug.cgi?id=213132

Broke gst-libav due to dav1d ABI bump

Reverted changeset:

"[Flatpak SDK] Add libavif"
https://bugs.webkit.org/show_bug.cgi?id=212964
https://trac.webkit.org/changeset/262942

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

4 months ago[LFC][TFC] Add support for min/max-width
zalan@apple.com [Fri, 12 Jun 2020 15:55:03 +0000 (15:55 +0000)]
[LFC][TFC] Add support for min/max-width
https://bugs.webkit.org/show_bug.cgi?id=213111

Reviewed by Antti Koivisto.

Source/WebCore:

Apply min/max-width to constrain the available width for the table content.

Test: fast/layoutformattingcontext/table-min-max-width-simple.html

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::computedWidthAndMargin):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp:
(WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox):

LayoutTests:

* fast/layoutformattingcontext/table-min-max-width-simple-expected.html: Added.
* fast/layoutformattingcontext/table-min-max-width-simple.html: Added.

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

4 months agoAdd WKUserScript initializer SPI with alternative names
commit-queue@webkit.org [Fri, 12 Jun 2020 15:48:54 +0000 (15:48 +0000)]
Add WKUserScript initializer SPI with alternative names
https://bugs.webkit.org/show_bug.cgi?id=213096

Patch by Alex Christensen <achristensen@webkit.org> on 2020-06-12
Reviewed by Youenn Fablet.

And deprecate the existing ones so we can remove them soon.

* UIProcess/API/Cocoa/WKUserScript.mm:
(-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:includeMatchPatternStrings:excludeMatchPatternStrings:associatedURL:contentWorld:deferRunningUntilNotification:]):
* UIProcess/API/Cocoa/WKUserScriptPrivate.h:

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

4 months ago[JSC] Add sampling-profiler code-origin lookup test
ysuzuki@apple.com [Fri, 12 Jun 2020 15:45:58 +0000 (15:45 +0000)]
[JSC] Add sampling-profiler code-origin lookup test
https://bugs.webkit.org/show_bug.cgi?id=213108
<rdar://problem/52044072>

Reviewed by Saam Barati.

This is fixed by r262920. This patch just adds a test additionally.
We are keeping CallSiteIndex valid until corresponding JIT stub is destroyed.
This fixes SamplingProfiler too since SamplingProfiler also collects CallSiteIndex and gets corresponding CodeOrigin.
Since SamplingProfiler does this CallSiteIndex => CodeOrigin before running GC finalizer, validity of CallSiteIndex
should be kept correctly.

* stress/sampling-profiler-code-origin.js: Added.
(let.oThrow.get f):
(foo):
(return.get f):
(f):

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

4 months ago[WebDriver][WPE] Add remaining WPE failures to expectations.
lmoura@igalia.com [Fri, 12 Jun 2020 15:43:58 +0000 (15:43 +0000)]
[WebDriver][WPE] Add remaining WPE failures to expectations.

Unreviewed test gardening.

* TestExpectations.json:

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

4 months agoUnreviewed. Fix GTK4 build
carlosgc@webkit.org [Fri, 12 Jun 2020 15:19:28 +0000 (15:19 +0000)]
Unreviewed. Fix GTK4 build

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseSynthesizeKeyEvent):

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

4 months agoRelative font size values (em) within CSS animations compound
antti@apple.com [Fri, 12 Jun 2020 14:40:37 +0000 (14:40 +0000)]
Relative font size values (em) within CSS animations compound
https://bugs.webkit.org/show_bug.cgi?id=194749
<rdar://problem/48171898>

Reviewed by Antoine Quint.

Source/WebCore:

The em unit should be relative to the font size of the parent style when resolving 'font-size' property.
We weren't passing the parent style when resolving keyframes.

Test case by Scott Kellum.

Test: animations/keyframe-em-unit.html

* style/StyleResolver.cpp:
(WebCore::Style::Resolver::styleForKeyframe):
* style/StyleResolver.h:
(WebCore::Style::Resolver::overrideDocumentElementStyle const):
(WebCore::Style::Resolver::setOverrideDocumentElementStyle):
(WebCore::Style::Resolver::setParentElementStyleForKeyframes):

Add a way to pass the parent element style directly to the style resolver.
This should really be passed via the animation system like other context but that requires
lots of refactoring.

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

Pass it.

LayoutTests:

* animations/keyframe-em-unit-expected.html: Added.
* animations/keyframe-em-unit.html: Added.

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

4 months agoDocument.currentScript does not work for SVGScriptElements
weinig@apple.com [Fri, 12 Jun 2020 14:28:43 +0000 (14:28 +0000)]
Document.currentScript does not work for SVGScriptElements
https://bugs.webkit.org/show_bug.cgi?id=213104

Reviewed by Yusuke Suzuki.

LayoutTests/imported/w3c:

* web-platform-tests/html/dom/documents/dom-tree-accessors/Document.currentScript-expected.txt:
Update test results after making currentScript work with SVGScriptElements.

* web-platform-tests/content-security-policy/nonce-hiding/svgscript-nonces-hidden-meta.tentative.sub-expected.txt:
* web-platform-tests/content-security-policy/nonce-hiding/svgscript-nonces-hidden.tentative-expected.txt:
Update results. Not passing, but getting further.

Source/WebCore:

Updates results for existing tests.

* WebCore.xcodeproj/project.pbxproj:
Add CurrentScriptIncrementer.h to the Xcode project as it was missing.

* dom/CurrentScriptIncrementer.h:
(WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer):
(WebCore::CurrentScriptIncrementer::~CurrentScriptIncrementer):
Re-work using ScriptElement, removing the HTMLScriptElement checks. Also changes
scriptType check to explicitly check that against classic scripts, as they are
the only supported type, and if any types other than modules are added in the
future, we would not want this to change behavior.

* dom/Document.cpp:
(WebCore::Document::pushCurrentScript):
* dom/Document.h:
(WebCore::Document::currentScript const):
Use an Element, rather than an HTMLScriptElement for currentScript/currentScriptStack
so that either an HTMLScriptElement or an SVGScriptElement can be stored. Using a
ScriptElement would be possible, but would complicate the implementation unnecessarily
by requiring currentScript to have an additional checks before extracting the Element.
Variant<RefPtr<HTMLScriptElement>, RefPtr<SVGScriptElement>> could also have been used
but also would unnecessarily complicated the interface and caused more memory to be used.

* dom/Document.idl:
Update interface to use Element rather HTMLScriptElement with a comment explaining why we
are not using HTMLOrSVGScriptElement but retaining the same observable behavior.

* dom/ScriptElement.cpp:
(WebCore::ScriptElement::executeClassicScript):
(WebCore::ScriptElement::executeModuleScript):
Pass *this directly to CurrentScriptIncrementer to simplify implementation.

Source/WebKit:

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
(webkit_dom_document_get_current_script):
Update to account for change in Document::currentScript() now returning an
Element* that can be either an HTMLScriptElement or an SVGScriptElement. To
keep API compatibility, only return non-null for HTMLScriptElements.

Source/WebKitLegacy/mac:

* DOM/DOMDocument.mm:
(-[DOMDocument currentScript]):
Update to account for change in Document::currentScript() now returning an
Element* that can be either an HTMLScriptElement or an SVGScriptElement. To
keep API compatibility, only return non-null for HTMLScriptElements.

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

4 months agoUnreviewed. Fix GTK WebDriver tests after r262938
carlosgc@webkit.org [Fri, 12 Jun 2020 13:21:47 +0000 (13:21 +0000)]
Unreviewed. Fix GTK WebDriver tests after r262938

Ensure a valid title for backforward items in MiniBrowser, using the URL when the title is empty.

* MiniBrowser/gtk/BrowserWindow.c:
(browserWindowCreateBackForwardMenu):

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

4 months ago[Flatpak SDK] Update GTK4 to 3.98.5
philn@webkit.org [Fri, 12 Jun 2020 09:54:53 +0000 (09:54 +0000)]
[Flatpak SDK] Update GTK4 to 3.98.5

Rubber-stamped by Carlos Alberto Lopez Perez.

* buildstream/elements/sdk/gtk.bst:

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

4 months ago[Flatpak SDK] Add libavif
commit-queue@webkit.org [Fri, 12 Jun 2020 09:24:09 +0000 (09:24 +0000)]
[Flatpak SDK] Add libavif
https://bugs.webkit.org/show_bug.cgi?id=212964

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

* buildstream/elements/freedesktop-sdk.bst:
* buildstream/elements/sdk-platform.bst:
* buildstream/elements/sdk/libavif.bst: Added.
* buildstream/patches/fdo/0001-dav1d-Bump-to-0.7.0.patch: Added.

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

4 months ago[Flatpak SDK] Add libkate
commit-queue@webkit.org [Fri, 12 Jun 2020 09:22:24 +0000 (09:22 +0000)]
[Flatpak SDK] Add libkate
https://bugs.webkit.org/show_bug.cgi?id=212865

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

The GStreamer kate decoder is required for some media/track tests being re-enabled in bug
120665.

* buildstream/elements/sdk-platform.bst:
* buildstream/elements/sdk/gst-plugins-bad.bst:
* buildstream/elements/sdk/libkate.bst: Added.

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

4 months ago[GTK] Add an internal API to run javascript without forced user gestures
cturner@igalia.com [Fri, 12 Jun 2020 08:49:27 +0000 (08:49 +0000)]
[GTK] Add an internal API to run javascript without forced user gestures
https://bugs.webkit.org/show_bug.cgi?id=212969

Reviewed by Carlos Garcia Campos.

To be used by tests in a follow-up commit.

* UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewRunJavaScriptWithParams): Factor out the glue to run
JavaScript in the page.
(webkitWebViewRunJavascriptWithoutForcedUserGestures): Add a new
internal API for use by tests.
(webkit_web_view_run_javascript): Modified to use factored out
glue.
* UIProcess/API/glib/WebKitWebViewInternal.h: Added. Place to keep
API test-specific internal APIs.

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

4 months ago[GTK4] Get MiniBrowser ready for GTK4
carlosgc@webkit.org [Fri, 12 Jun 2020 08:42:50 +0000 (08:42 +0000)]
[GTK4] Get MiniBrowser ready for GTK4
https://bugs.webkit.org/show_bug.cgi?id=210276

Reviewed by Adrian Perez de Castro.

.:

Bump GTK4 required version.

* Source/cmake/OptionsGTK.cmake:

Tools:

Port MiniBrowser to GTK4. BrowserSearchBar has been renamed as BrowserSearchBox, because in GTK GtkSearchBar is
final class, so we derive from GtkBox and to be used as contents of a GtkSearchBar.

* MiniBrowser/gtk/BrowserCellRendererVariant.c:
(browserCellRendererVariantCellRendererSnapshot):
(browser_cell_renderer_variant_class_init):
* MiniBrowser/gtk/BrowserCellRendererVariant.h:
* MiniBrowser/gtk/BrowserSearchBar.c: Removed.
* MiniBrowser/gtk/BrowserSearchBox.c: Added.
(setFailedStyleForEntry):
(doSearch):
(searchNext):
(searchPrevious):
(searchEntryMenuIconPressedCallback):
(searchEntryClearIconReleasedCallback):
(searchEntryChangedCallback):
(searchEntryActivatedCallback):
(searchPreviousButtonCallback):
(searchNextButtonCallback):
(searchMenuCheckButtonToggledCallback):
(findControllerFailedToFindTextCallback):
(findControllerFoundTextCallback):
(browserSearchBoxFinalize):
(browserSearchBoxDispose):
(browserSearchBoxSizeAllocate):
(browser_search_box_class_init):
(browser_search_box_new):
(browser_search_box_get_entry):
* MiniBrowser/gtk/BrowserSearchBox.h: Renamed from Tools/MiniBrowser/gtk/BrowserSearchBar.h.
* MiniBrowser/gtk/BrowserSettingsDialog.c:
(browser_settings_dialog_init):
(browser_settings_dialog_new):
* MiniBrowser/gtk/BrowserSettingsDialog.h:
* MiniBrowser/gtk/BrowserTab.c:
(loadChanged):
(createInfoBarQuestionMessage):
(tlsErrorsDialogResponse):
(loadFailedWithTLSerrors):
(permissionRequestDialogResponse):
(decidePermissionRequest):
(colorChooserRequestFinished):
(runColorChooserCallback):
(tabCloseClicked):
(browserTabConstructed):
(browserTabIsSearchBarOpen):
(browser_tab_start_search):
(browser_tab_stop_search):
(browser_tab_enter_fullscreen):
(browser_tab_leave_fullscreen):
* MiniBrowser/gtk/BrowserWindow.c:
(settingsCallback):
(resetEntryProgress):
(webViewLoadProgressChanged):
(browserWindowCreateBackForwardMenu):
(browserWindowUpdateNavigationMenu):
(navigationButtonPressed):
(navigationButtonPressCallback):
(scrollEventCallback):
(webViewIsLoadingChanged):
(searchCallback):
(insertImageDialogResponse):
(insertImageCommandCallback):
(insertLinkDialogResponse):
(insertLinkCommandCallback):
(typingAttributesChanged):
(browserWindowSaveSession):
(browserWindowFinalize):
(browserWindowDispose):
(addToolbarButton):
(browserWindowSwitchTab):
(browserWindowTabAddedOrRemoved):
(browserWindowBuildPopoverMenu):
(browserWindowCloseRequest):
(browserWindowDeleteEvent):
(browser_window_class_init):
(browser_window_append_view):
(browser_window_set_background_color):
* MiniBrowser/gtk/CMakeLists.txt:

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

4 months ago[GTK] MiniBrowser: stop using GtkToolbar
carlosgc@webkit.org [Fri, 12 Jun 2020 08:28:10 +0000 (08:28 +0000)]
[GTK] MiniBrowser: stop using GtkToolbar
https://bugs.webkit.org/show_bug.cgi?id=212898

Reviewed by Adrian Perez de Castro.

GtkToolbar iss no longer available in GTK4, use a GtkBox with buttons instead. Also use symbolic icons and move
some of the actions to a gear menu.

* MiniBrowser/gtk/BrowserWindow.c:
(browserWindowHistoryItemActivated):
(browserWindowCreateBackForwardMenu):
(browserWindowUpdateNavigationMenu):
(navigationButtonPressCallback):
(browserWindowCanZoomDefault):
(browserWindowUpdateZoomActions):
(webViewIsLoadingChanged):
(addToolbarButton):
(browserWindowBuildPopoverMenu):
(resetStatusText): Deleted.
(browserWindowHistoryItemSelected): Deleted.
(browserWindowSetupEditorToolbarItem): Deleted.

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

4 months ago[GTK] MiniBrowser: stop using GtkToolbar for the search bar
carlosgc@webkit.org [Fri, 12 Jun 2020 08:25:58 +0000 (08:25 +0000)]
[GTK] MiniBrowser: stop using GtkToolbar for the search bar
https://bugs.webkit.org/show_bug.cgi?id=212817

Reviewed by Adrian Perez de Castro.

Use a GtkSearchBar instead, because GtkToolbar is no longer available in GTK4. Also use a GtkPopover for the
options menu instead of the GtkMenu.

* MiniBrowser/gtk/BrowserSearchBar.c:
(setFailedStyleForEntry):
(doSearch):
(searchEntryMenuIconPressedCallback):
(searchEntryChangedCallback):
(searchMenuCheckButtonToggledCallback):
(browserSearchBarFinalize):
(browser_search_bar_new):
(browser_search_bar_open):
(browser_search_bar_close):
(browser_search_bar_is_open):
(searchCloseButtonClickedCallback): Deleted.
(searchEntryClearIconReleasedCallback): Deleted.
* MiniBrowser/gtk/BrowserSearchBar.h:
* MiniBrowser/gtk/BrowserTab.c:
(browser_tab_start_search):
(browser_tab_stop_search):

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

4 months ago[GTK4] Make WebDriver work
carlosgc@webkit.org [Fri, 12 Jun 2020 08:19:58 +0000 (08:19 +0000)]
[GTK4] Make WebDriver work
https://bugs.webkit.org/show_bug.cgi?id=212316

Reviewed by Adrian Perez de Castro.

Source/WebCore:

Add helper gtk definitions to avoid ifdefs and implement currentScreenMonitor() for GTK4.

* platform/gtk/GtkVersioning.h:
(gtk_window_move):
(gtk_window_minimize):
(gtk_window_unminimize):
* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::currentScreenMonitor):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
(WebCore::getCurrentScreenMonitor): Deleted.

Source/WebKit:

Fix UIClient::setWindowFrame to wait for surface size-changed signal after resizing the window and implement
maximize, minimize and restore windows for GTK4.

* UIProcess/API/glib/WebKitUIClient.cpp:
* UIProcess/API/gtk/WebKitWebViewGtk.cpp:
(surfaceStateChangedCallback):
(webkitWebViewMonitorWindowState):
(webkitWebViewMaximizeWindow):
(webkitWebViewMinimizeWindow):
(webkitWebViewRestoreWindow):

Tools:

Stop connecting to WebKitWebView::close signal twice for newaly created windows.

* MiniBrowser/gtk/BrowserWindow.c:
(webViewCreate):

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

4 months agoAdd dependencies for Migrate Headers and Generate Export Files build phases
krollin@apple.com [Fri, 12 Jun 2020 07:01:36 +0000 (07:01 +0000)]
Add dependencies for Migrate Headers and Generate Export Files build phases
https://bugs.webkit.org/show_bug.cgi?id=213072
<rdar://problem/64249345>

Reviewed by Tim Horton.

These build phases have incomplete specifications for the files they
consume and produce, which can lead to incorrect builds. Address this
by:

- Adding the WebCore/PrivateHeaders directory (which contains the
  headers being migrated) as input to the Migrate Headers build phase
- Touching a timestamp file when re-exporting any headers in the
  Migrate Headers build phase
- Adding the timestamp file as an output of the Migrate Headers build
  phase
- Adding the timestamp file as an input of the Generate Export Files
  build phase
- Adding other files that Generate Export Files consumes to the list
  of input files

In this way, if any exported headers are changed, both Migrate Headers
and Generate Export Files will be run.

Source/WebKitLegacy:

* WebKitLegacy.xcodeproj/project.pbxproj:

Source/WebKitLegacy/mac:

* MigrateHeaders.make:

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

4 months ago[GTK] Gardening, update test expectations after r262932
dpino@igalia.com [Fri, 12 Jun 2020 06:17:48 +0000 (06:17 +0000)]
[GTK] Gardening, update test expectations after r262932
https://bugs.webkit.org/show_bug.cgi?id=213115

Unreviewed test gardening.

* platform/glib/TestExpectations:

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

4 months ago[IPC] Add WTF::EnumTraits<> for every enum type used in IPC
ddkilzer@apple.com [Fri, 12 Jun 2020 06:02:42 +0000 (06:02 +0000)]
[IPC] Add WTF::EnumTraits<> for every enum type used in IPC
<https://webkit.org/b/213093>

Reviewed by Darin Adler.

Summary:
- Change underlying type of enum class to `bool` when there are
  only two values.  In some cases, reorder the two values so the
  mapping to 0 and 1 makes more sense.  Converting every enum to
  an enum class is not a goal of this patch, so some two-value
  enums stil have WTF::EnumTraits<> defined as noted below.
- Add WTF::EnumTraits<> for the remaining enum types that are
  used by IPC::Encoder::encodeEnum() and
  IPC::Decoder::decodeEnum() so that WTF::isValidEnum<>() checks
  may be added next.
- Add #include <WebCore/LibWebRTCEnumTraits.h> as needed.

Source/WebCore:

* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
- Add LibWebRTCEnumTraits.h to project. Keep these definitions
  separate from the libwebrtc project cut down on changes to
  re-merge after updating.

* platform/mediastream/libwebrtc/LibWebRTCEnumTraits.h: Add.

* Modules/applepay/ApplePaySessionPaymentRequest.h:
* Modules/indexeddb/IDBTransactionMode.h:
* Modules/indexeddb/IndexedDB.h:
(WTF::EnumTraits<WebCore::IndexedDB::IndexRecordType>):
- Remove after changing enum class to bool.
* Modules/indexeddb/shared/IDBGetRecordData.h:
* Modules/indexeddb/shared/IDBResultData.h:
* WebCore.xcodeproj/project.pbxproj:
* dom/ExceptionCode.h:
* editing/CompositionUnderline.h:
* html/Autofill.h:
* html/DataListSuggestionInformation.h:
* html/EnterKeyHint.h:
* html/LinkIconType.h:
* loader/FrameLoaderTypes.h:
- Alphabetize WTF::EnumTraits<> definitions.
* loader/ResourceLoaderOptions.h:
* page/SecurityOrigin.h:
* page/UserStyleSheetTypes.h:
(WTF::EnumTraits<WebCore::UserStyleLevel>):
- Define this since UserStyleLevel is not an enum class.
* page/scrolling/ScrollingCoordinatorTypes.h:
* platform/ContextMenuItem.h:
* platform/Cursor.h:
* platform/DragData.h:
* platform/FileChooser.h:
* platform/PopupMenuStyle.h:
* platform/ScreenProperties.h:
* platform/ScrollTypes.h:
* platform/SerializedPlatformDataCueValue.h:
(WebCore::SerializedPlatformDataCueValue::PlatformType):
- Convert from enum to enum class.
* platform/UserInterfaceLayoutDirection.h:
* platform/animation/TimingFunction.h:
* platform/graphics/GraphicsContext.h:
* platform/graphics/GraphicsLayer.h:
* platform/graphics/GraphicsTypes.h:
- Alphabetize WTF::EnumTraits<> definitions.
* platform/graphics/Image.h:
* platform/graphics/Path.h:
* platform/graphics/ca/PlatformCAAnimation.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/filters/FilterOperation.h:
* platform/mediastream/MediaConstraints.h:
* platform/mediastream/MediaStreamRequest.h:
(WTF::EnumTraits<WebCore::MediaStreamRequest::Type>):
- Fix EnumTraits definition (missing "::Type").
* platform/mediastream/RealtimeMediaSourceCapabilities.h:
* platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:
* platform/network/CredentialBase.h:
* platform/network/ProtectionSpaceBase.h:
* platform/network/ResourceErrorBase.h:
* platform/network/soup/SoupNetworkProxySettings.h:
* platform/text/TextChecking.h:
(WTF::EnumTraits<WebCore::TextCheckingProcessType):
- Define this since TextCheckingProcessType is not an enum class.
* platform/text/WritingMode.h:
* rendering/Pagination.h:
* workers/service/ServiceWorkerJobType.h:

Source/WebKit:

* GPUProcess/GPUConnectionToWebProcess.h:
* GPUProcess/GPUProcess.h:
* NetworkProcess/NetworkLoadParameters.h:
* Shared/API/APIObject.h:
* Shared/ContextMenuContextData.h:
* Shared/DrawingAreaInfo.h:
* Shared/FocusedElementInformation.h:
* Shared/PrintInfo.h:
(WTF::EnumTraits<WebKit::PrintInfo::PrintMode>):
- Define this since PrintMode is not an enum class.
* Shared/RTCPacketOptions.cpp:
* Shared/SessionState.h:
* Shared/TouchBarMenuItemData.h:
* Shared/WebEvent.h:
* Shared/WebPopupItem.cpp:
(WebKit::WebPopupItem::WebPopupItem):
- Fix reference to WebPopupItem::Type enum.
* Shared/WebPopupItem.h:
(WebKit::WebPopupItem::Type):
- Convert from enum to enum class.
* Shared/WebsiteData/WebsiteDataType.h:
* Shared/glib/InputMethodState.h:
* Shared/glib/UserMessage.h:
* Shared/mac/ColorSpaceData.mm:
* Shared/mac/SecItemRequestData.h:
* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::populate):
- Fix reference to WebPopupItem::Type enum.
* WebProcess/Plugins/Plugin.cpp:
* WebProcess/WebCoreSupport/WebPopupMenu.cpp:
(WebKit::WebPopupMenu::populateItems):
- Fix reference to WebPopupItem::Type enum.
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h:

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

4 months agoLinear Scan uses the wrong Interval for spills for tmps with roles of early def or...
sbarati@apple.com [Fri, 12 Jun 2020 00:29:30 +0000 (00:29 +0000)]
Linear Scan uses the wrong Interval for spills for tmps with roles of early def or late use
https://bugs.webkit.org/show_bug.cgi?id=213055
<rdar://problem/59874018>

Reviewed by Yusuke Suzuki.

There was a bug in linear scan when computing the live range interval for
spill tmps that had early defs or late uses.  When linear scan spills a
tmp, it creates a new tmp that it loads to and stores from, and replaces the old tmp
with the new tmp, and emits stores/loads around pertinent instructions. The live
interval for such tmps is small by nature, it's contained in the interval for the
instruction itself. However, we'd build this interval purely based off the
original tmp's arg timing. So, for example, let's consider a program like this:

RandoInsn: LateUse:Tmp1, Use:Tmp2, [early = N, late = N+1]
Let's say that Tmp1's last use is RandoInsn, and it had a def before
RandoInsn, therefore, its live range will be something like:
[J where J < N, N+1]

and now imagine we spilled Tmp1 for some reason, and rewrote the
program to be:
Move Addr(spill for Tmp1), TmpSpill
RandoInsn: LateUse:TmpSpill, Use:Tmp2, [early = N, late = N+1]

We used to incorrectly mark the live range for TmpSpill to just be [N+1, N+2).
However, the bug here is that we neglected that TmpSpill actually had an earlier
def at [N, N+1). So, the live range for TmpSpill was wrong. This could incorrectly
lead us to allocate Tmp2 and TmpSpill to the same register, since their live
ranges may not intersect if Tmp2 dies at RandoInsn.

We also had the symmetric bug for EarlyDefs: we wouldn't account for the
store-spill that'd happen after something like RandoInsn.

The fix is to account for the loads/stores of spill tmps when assigning
them a live range.

This patch contains a standalone test in testair. It also fixes crashes we had when
running B3O1 tests using typed arrays on arm64e since we had patchpoints that utilized
LateUse for signing and auth.

* b3/B3Procedure.h:
* b3/air/AirAllocateRegistersAndStackByLinearScan.cpp:
* b3/air/testair.cpp:

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

4 months agoSkip wasm-js2 test on memory limited devices
sbarati@apple.com [Fri, 12 Jun 2020 00:09:31 +0000 (00:09 +0000)]
Skip wasm-js2 test on memory limited devices
https://bugs.webkit.org/show_bug.cgi?id=213099

Reviewed by Yusuke Suzuki.

* Scripts/run-jsc-stress-tests:

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

4 months agoRe-enable download resume tests
commit-queue@webkit.org [Thu, 11 Jun 2020 23:51:24 +0000 (23:51 +0000)]
Re-enable download resume tests
https://bugs.webkit.org/show_bug.cgi?id=213098
<rdar://problem/63512518>

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

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:]):

Source/WTF:

Workaround is no longer needed because underlying bug has been fixed.

* wtf/PlatformHave.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/Download.mm:

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

4 months agoFix comment after blocklist transition
bdakin@apple.com [Thu, 11 Jun 2020 23:43:44 +0000 (23:43 +0000)]
Fix comment after blocklist transition
https://bugs.webkit.org/show_bug.cgi?id=213100

Reviewed by Wenson Hsieh.

* platform/mac/PasteboardMac.mm:
(WebCore::cocoaTypeFromHTMLClipboardType):

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

4 months agoReplace uses of black/white list with block/allow list
sbarati@apple.com [Thu, 11 Jun 2020 22:47:21 +0000 (22:47 +0000)]
Replace uses of black/white list with block/allow list
https://bugs.webkit.org/show_bug.cgi?id=213084

Reviewed by Keith Miller.

We should be using racially neutral names in our code. From Chromium style guide:

"Terms such as 'blacklist' and 'whitelist' reinforce the notion that
black==bad and white==good."

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* b3/air/AirLowerAfterRegAlloc.cpp:
(JSC::B3::Air::lowerAfterRegAlloc):
* dfg/DFGDriver.cpp:
(JSC::DFG::ensureGlobalDFGAllowlist):
(JSC::DFG::compileImpl):
(JSC::DFG::ensureGlobalDFGWhitelist): Deleted.
* dfg/DFGTierUpCheckInjectionPhase.cpp:
(JSC::DFG::ensureGlobalFTLAllowlist):
(JSC::DFG::TierUpCheckInjectionPhase::run):
(JSC::DFG::ensureGlobalFTLWhitelist): Deleted.
* heap/MachineStackMarker.cpp:
* inspector/scripts/codegen/objc_generator.py:
(ObjCGenerator.should_generate_types_for_domain):
(ObjCGenerator.should_generate_commands_for_domain):
(ObjCGenerator.should_generate_events_for_domain):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::ensureGlobalJITAllowlist):
(JSC::LLInt::shouldJIT):
(JSC::LLInt::ensureGlobalJITWhitelist): Deleted.
* runtime/OptionsList.h:
* tools/FunctionAllowlist.cpp: Copied from Source/JavaScriptCore/tools/FunctionWhitelist.cpp.
(JSC::FunctionAllowlist::FunctionAllowlist):
(JSC::FunctionAllowlist::contains const):
(JSC::FunctionWhitelist::FunctionWhitelist): Deleted.
(JSC::FunctionWhitelist::contains const): Deleted.
* tools/FunctionAllowlist.h: Copied from Source/JavaScriptCore/tools/FunctionWhitelist.h.
* tools/FunctionWhitelist.cpp: Removed.
* tools/FunctionWhitelist.h: Removed.

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

4 months agoUnreviewed, reverting r262696.
commit-queue@webkit.org [Thu, 11 Jun 2020 22:31:14 +0000 (22:31 +0000)]
Unreviewed, reverting r262696.
https://bugs.webkit.org/show_bug.cgi?id=213097

It broke running JSC tests on watchOS

Reverted changeset:

"Allow run-jsc-stress-tests still run if some of the remote
hosts are not available"
https://bugs.webkit.org/show_bug.cgi?id=201426
https://trac.webkit.org/changeset/262696

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

4 months agoREGRESSION (r262879): 3 TestWebKitAPI.TextManipulation tests are failing
sihui_liu@apple.com [Thu, 11 Jun 2020 22:11:53 +0000 (22:11 +0000)]
REGRESSION (r262879): 3 TestWebKitAPI.TextManipulation tests are failing
https://bugs.webkit.org/show_bug.cgi?id=213079
<rdar://problem/64256870>

Reviewed by Wenson Hsieh.

Update a few tests after behavior change in r262879. From r262879, we no longer use visible positions of element
to calculate range to observe. Instead, we use the first and end position in the element to decide the range. In
previous implementation, the range can be extended to outside of the element, like some visible positon before
or after the element.

TextManipulation.StartTextManipulationFindNewlyDisplayedParagraph: Different elements would make separate ranges
because we create range with the boundaries of element. We can consider merging adjacent ranges later.
TextManipulation.StartTextManipulationFindSameParagraphWithNewContent: The newly observing range only includes
the newly inserted element now.
TextManipulation.InsertingContentIntoAlreadyManipulatedContentDoesNotCreateTextManipulationItem: The p element
is not manipulated as it is the common ancestor of manipulated elements. And we want to make sure the newly
inserted element is child of a manipulated element.

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

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

4 months agoREGRESSION (r262776): Flaky crash under -[WebCoreResourceHandleAsOperationQueueDelega...
commit-queue@webkit.org [Thu, 11 Jun 2020 21:05:39 +0000 (21:05 +0000)]
REGRESSION (r262776): Flaky crash under -[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]
https://bugs.webkit.org/show_bug.cgi?id=213059

Patch by Rob Buis <rbuis@igalia.com> on 2020-06-11
Reviewed by Alex Christensen.

My r262776 patch did not null check m_handle and it can cause crashes
in some cases, so add the check.

* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):

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

4 months agoWebKit: Make UIGestureRecognizer build for watchOS and tvOS
jbedard@apple.com [Thu, 11 Jun 2020 21:02:52 +0000 (21:02 +0000)]
WebKit: Make UIGestureRecognizer build for watchOS and tvOS
https://bugs.webkit.org/show_bug.cgi?id=213038
<rdar://problem/64217654>

Reviewed by Tim Horton.

* wtf/PlatformHave.h: Enable HAVE(UI_GESTURE_RECOGNIZER_MODIFIER_FLAGS) for watchOS and tvOS.

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

4 months agoReplace instances of whitelist in WebCore with allowlist
bdakin@apple.com [Thu, 11 Jun 2020 20:47:21 +0000 (20:47 +0000)]
Replace instances of whitelist in WebCore with allowlist
https://bugs.webkit.org/show_bug.cgi?id=213068

Reviewed by Tim Horton.

Source/WebCore:

* Modules/webdatabase/DatabaseAuthorizer.cpp:
(WebCore::DatabaseAuthorizer::DatabaseAuthorizer):
(WebCore::DatabaseAuthorizer::addAllowedFunctions):
(WebCore::DatabaseAuthorizer::allowFunction):
(WebCore::DatabaseAuthorizer::addWhitelistedFunctions): Deleted.
* Modules/webdatabase/DatabaseAuthorizer.h:
* dom/ExtensionStyleSheets.cpp:
(WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const):
* loader/CrossOriginAccessControl.cpp:
(WebCore::isOnAccessControlSimpleRequestMethodAllowlist):
(WebCore::isSimpleCrossOriginAccessRequest):
(WebCore::isOnAccessControlSimpleRequestMethodWhitelist): Deleted.
* loader/CrossOriginAccessControl.h:
* loader/CrossOriginPreflightResultCache.cpp:
(WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginMethod const):
* loader/appcache/ApplicationCache.cpp:
(WebCore::ApplicationCache::setOnlineAllowlist):
(WebCore::ApplicationCache::isURLInOnlineAllowlist):
(WebCore::ApplicationCache::setOnlineWhitelist): Deleted.
(WebCore::ApplicationCache::isURLInOnlineWhitelist): Deleted.
* loader/appcache/ApplicationCache.h:
(WebCore::ApplicationCache::onlineAllowlist const):
(WebCore::ApplicationCache::onlineWhitelist const): Deleted.
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::shouldLoadResourceFromApplicationCache):
(WebCore::ApplicationCacheHost::getApplicationCacheFallbackResource):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
(WebCore::ApplicationCacheStorage::openDatabase):
(WebCore::ApplicationCacheStorage::store):
(WebCore::ApplicationCacheStorage::loadCache):
* loader/appcache/ManifestParser.cpp:
(WebCore::parseManifest):
* loader/appcache/ManifestParser.h:
* page/Frame.cpp:
(WebCore::Frame::injectUserScriptImmediately):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::canRequest const):
(WebCore::SecurityOrigin::canDisplay const):
* page/SecurityPolicy.cpp:
(WebCore::SecurityPolicy::isAccessAllowed):
(WebCore::SecurityPolicy::addOriginAccessAllowlistEntry):
(WebCore::SecurityPolicy::removeOriginAccessAllowlistEntry):
(WebCore::SecurityPolicy::resetOriginAccessAllowlists):
(WebCore::SecurityPolicy::isAccessWhiteListed): Deleted.
(WebCore::SecurityPolicy::addOriginAccessWhitelistEntry): Deleted.
(WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry): Deleted.
(WebCore::SecurityPolicy::resetOriginAccessWhitelists): Deleted.
* page/SecurityPolicy.h:
* page/UserContentURLPattern.cpp:
(WebCore::UserContentURLPattern::matchesPatterns):
* page/UserContentURLPattern.h:
* page/UserScript.h:
(WebCore::UserScript::UserScript):
(WebCore::UserScript::allowlist const):
(WebCore::UserScript::encode const):
(WebCore::UserScript::decode):
(WebCore::UserScript::whitelist const): Deleted.
* page/UserStyleSheet.h:
(WebCore::UserStyleSheet::UserStyleSheet):
(WebCore::UserStyleSheet::allowlist const):
(WebCore::UserStyleSheet::whitelist const): Deleted.
* platform/graphics/FontCache.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::fontAllowlist):
(WebCore::FontCache::setFontAllowlist):
(WebCore::platformFontLookupWithFamily):
(WebCore::fontWhitelist): Deleted.
(WebCore::FontCache::setFontWhitelist): Deleted.
* platform/network/HTTPParsers.cpp:
(WebCore::isValidAcceptHeaderValue):
* rendering/FloatingObjects.h:
* style/ElementRuleCollector.cpp:
(WebCore::Style::ElementRuleCollector::transferMatchedRules):
* style/ElementRuleCollector.h:
* style/PropertyCascade.cpp:
(WebCore::Style::PropertyCascade::addMatch):
* style/RuleData.cpp:
(WebCore::Style::determinePropertyAllowlistType):
(WebCore::Style::RuleData::RuleData):
(WebCore::Style::determinePropertyWhitelistType): Deleted.
* style/RuleData.h:
(WebCore::Style::RuleData::propertyAllowlistType const):
(WebCore::Style::RuleData::propertyWhitelistType const): Deleted.

Source/WebKit:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::addOriginAccessWhitelistEntry):
(WebKit::NetworkConnectionToWebProcess::removeOriginAccessWhitelistEntry):
(WebKit::NetworkConnectionToWebProcess::resetOriginAccessWhitelists):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<UserStyleSheet>::encode):
(IPC::ArgumentCoder<UserStyleSheet>::decode):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::addOriginAccessWhitelistEntry):
(WebKit::InjectedBundle::removeOriginAccessWhitelistEntry):
(WebKit::InjectedBundle::resetOriginAccessWhitelists):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(+[WebView _addOriginAccessWhitelistEntryWithSourceOrigin:destinationProtocol:destinationHost:allowDestinationSubdomains:]):
(+[WebView _removeOriginAccessWhitelistEntryWithSourceOrigin:destinationProtocol:destinationHost:allowDestinationSubdomains:]):
(+[WebView _resetOriginAccessWhitelists]):
(+[WebView _setFontWhitelist:]):

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

4 months ago[JSC] Return DisposableCallSiteIndex when destroying GCAwareJITStubRoutineWithExcepti...
ysuzuki@apple.com [Thu, 11 Jun 2020 20:11:34 +0000 (20:11 +0000)]
[JSC] Return DisposableCallSiteIndex when destroying GCAwareJITStubRoutineWithExceptionHandler
https://bugs.webkit.org/show_bug.cgi?id=213069
<rdar://problem/64205186>

Reviewed by Saam Barati.

JSTests:

* stress/dont-dispose-callsiteindex-while-executing.js: Added.
(emptyFunction):
(foo.bar.set catch):
(foo.bar):
(foo):

Source/JavaScriptCore:

Inside GCAwareJITStubRoutineWithExceptionHandler::observeZeroRefCount, we are returning DisposableCallSiteIndex to freelist.
However, GCAwareJITStubRoutineWithExceptionHandler::observeZeroRefCount can be called even if the code of GCAwareJITStubRoutineWithExceptionHandler is
on the stack. Let's consider the following scenario.

    1. Execute GCAwareJITStubRoutineWithExceptionHandler's code. Set CallSiteIndex to the stack.
    2. Execute more code. (1)'s GCAwareJITStubRoutineWithExceptionHandler's code is on the stack.
    3. (1)'s GCAwareJITStubRoutineWithExceptionHandler's refcount becomes zero.
    4. CallSiteIndex of GCAwareJITStubRoutineWithExceptionHandler is returned.
    5. Execute StackVisitor to construct frames. But we cannot find CodeOrigin corresponding to CallSiteIndex stored in (1) since it is already returned.

DisposableCallSiteIndex should be returned after ensuring that GCAwareJITStubRoutineWithExceptionHandler's code is not on the stack. Detecting this is the functionality
what GCAwareJITStubRoutineWithExceptionHandler can offer. It is destroyed after ensuring that GCAwareJITStubRoutineWithExceptionHandler's code is not on the stack.

This patch delays DisposableCallSiteIndex returning until we destroy owner GCAwareJITStubRoutineWithExceptionHandler. But it is possible that CodeBlock* corresponding to
GCAwareJITStubRoutineWithExceptionHandler is already destroyed. To avoid this condition, we extract CodeOrigins vector as Ref<DFG::CodeOriginPool> and keep it alive from
GCAwareJITStubRoutineWithExceptionHandler too. And since CodeOrigin addition / removal happens only from the main thread after finishing the compilation, and
GCAwareJITStubRoutineWithExceptionHandler's destructor is called from the Heap's finalizer, which must be executed from the main thread, we can just modify it without a lock.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::newExceptionHandlingCallSiteIndex):
(JSC::CodeBlock::codeOrigins):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::codeOrigin):
* dfg/DFGCodeOriginPool.cpp: Added.
(JSC::DFG::CodeOriginPool::addCodeOrigin):
(JSC::DFG::CodeOriginPool::addUniqueCallSiteIndex):
(JSC::DFG::CodeOriginPool::lastCallSite const):
(JSC::DFG::CodeOriginPool::addDisposableCallSiteIndex):
(JSC::DFG::CodeOriginPool::removeDisposableCallSiteIndex):
(JSC::DFG::CodeOriginPool::shrinkToFit):
* dfg/DFGCodeOriginPool.h: Added.
(JSC::DFG::CodeOriginPool::create):
(JSC::DFG::CodeOriginPool::get):
(JSC::DFG::CodeOriginPool::size const):
* dfg/DFGCommonData.cpp:
(JSC::DFG::CommonData::shrinkToFit):
(JSC::DFG::CommonData::addCodeOrigin): Deleted.
(JSC::DFG::CommonData::addUniqueCallSiteIndex): Deleted.
(JSC::DFG::CommonData::lastCallSite const): Deleted.
(JSC::DFG::CommonData::addDisposableCallSiteIndex): Deleted.
(JSC::DFG::CommonData::removeDisposableCallSiteIndex): Deleted.
* dfg/DFGCommonData.h:
(JSC::DFG::CommonData::CommonData):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::exceptionCheck):
* dfg/DFGJITCompiler.h:
(JSC::DFG::JITCompiler::addCallSite):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compilePutById):
(JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
(JSC::FTL::DFG::LowerDFGToB3::compileDelBy):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileDirectCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileTailCall):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToB3::compileCallEval):
(JSC::FTL::DFG::LowerDFGToB3::compileInById):
(JSC::FTL::DFG::LowerDFGToB3::compileInstanceOf):
(JSC::FTL::DFG::LowerDFGToB3::compileLogShadowChickenTail):
(JSC::FTL::DFG::LowerDFGToB3::getById):
(JSC::FTL::DFG::LowerDFGToB3::getByIdWithThis):
(JSC::FTL::DFG::LowerDFGToB3::lazySlowPath):
(JSC::FTL::DFG::LowerDFGToB3::callPreflight):
* ftl/FTLSlowPathCall.cpp:
(JSC::FTL::callSiteIndexForCodeOrigin):
* jit/GCAwareJITStubRoutine.cpp:
(JSC::GCAwareJITStubRoutineWithExceptionHandler::GCAwareJITStubRoutineWithExceptionHandler):
(JSC::GCAwareJITStubRoutineWithExceptionHandler::~GCAwareJITStubRoutineWithExceptionHandler):
(JSC::GCAwareJITStubRoutineWithExceptionHandler::aboutToDie):
(JSC::GCAwareJITStubRoutineWithExceptionHandler::observeZeroRefCount):
* jit/GCAwareJITStubRoutine.h:

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

4 months agoUnreviewed, reverting r262909.
ryanhaddad@apple.com [Thu, 11 Jun 2020 19:56:57 +0000 (19:56 +0000)]
Unreviewed, reverting r262909.

This test causes macOS WK1 tests to intermittently exit early

Reverted changeset:

"Release Assert @
WebCore::RenderTreeBuilder::RenderTreeBuilder"
https://bugs.webkit.org/show_bug.cgi?id=212714
https://trac.webkit.org/changeset/262909

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

4 months ago[iOS] nullptr deref in FileInputType::iconLoaded when the input's type attribute...
aestes@apple.com [Thu, 11 Jun 2020 19:43:02 +0000 (19:43 +0000)]
[iOS] nullptr deref in FileInputType::iconLoaded when the input's type attribute is modified by a change event listener
https://bugs.webkit.org/show_bug.cgi?id=208244
<rdar://problem/41855350>

Reviewed by Wenson Hsieh.

Source/WebCore:

When an <input> element's type attribute changes, its existing InputType is detached from
the HTMLInputElement by nulling InputType::m_element. When FileInputType::filesChosen is
called, it dispatches the input and change events, which can run arbitrary JavaScript that
might modify the element's type attribute. If this happens, FileInputType::m_element will be
null after returning from FileInputType::setFiles and if there is an icon will be
dereferenced by FileInputType::iconLoaded.

Fixed this by checking for a non-null m_element before calling iconLoaded. While here, also
fixed a bug where we sometimes checked the length of m_fileList before FileListCreator had
finished setting m_fileList. This bug resulted in missing file icons whenever an
<input type=file> had the webkitdirectory attribute.

Tests: fast/forms/file/file-input-type-detached-on-change.html
       fast/forms/file/file-input-webkitdirectory-icon.html

* html/FileInputType.cpp:
(WebCore::FileInputType::filesChosen):

Tools:

* DumpRenderTree/TestRunner.cpp:
(SetOpenPanelFilesMediaIconCallback):
(TestRunner::staticFunctions):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setOpenPanelFilesMediaIcon):

LayoutTests:

* fast/forms/file/file-input-type-detached-on-change-expected.txt: Added.
* fast/forms/file/file-input-type-detached-on-change.html: Added.
* fast/forms/file/file-input-webkitdirectory-icon-expected.html: Added.
* fast/forms/file/file-input-webkitdirectory-icon.html: Added.
* fast/forms/file/file-reset-in-change-using-open-panel-with-icon.html:
* fast/forms/file/open-file-panel-crash.html:
* fast/forms/file/resources/file-icon-bytes.js: Added.

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

4 months agoWebKit: Guard requestDocumentContext with HAVE(UI_WK_DOCUMENT_CONTEXT)
jbedard@apple.com [Thu, 11 Jun 2020 19:41:59 +0000 (19:41 +0000)]
WebKit: Guard requestDocumentContext with HAVE(UI_WK_DOCUMENT_CONTEXT)
https://bugs.webkit.org/show_bug.cgi?id=213076
<rdar://problem/64254698>

Reviewed by Tim Horton.

No new tests, behavior unchanged.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/ios/WKWebViewTestingIOS.mm:
(-[WKWebView _requestDocumentContext:completionHandler:]): Guard requestDocumentContext with HAVE(UI_WK_DOCUMENT_CONTEXT).
(-[WKWebView _adjustSelectionWithDelta:completionHandler:]): Ditto.

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

4 months agoWebKit: Add UIKit SPI for watchOS and tvOS
jbedard@apple.com [Thu, 11 Jun 2020 18:58:15 +0000 (18:58 +0000)]
WebKit: Add UIKit SPI for watchOS and tvOS
https://bugs.webkit.org/show_bug.cgi?id=213077
<rdar://problem/64255131>

Reviewed by Tim Horton.

No new tests, behavior unchanged.

* Platform/spi/ios/UIKitSPI.h:

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

4 months agoRemove references to "slave" in WebCore
bdakin@apple.com [Thu, 11 Jun 2020 18:55:20 +0000 (18:55 +0000)]
Remove references to "slave" in WebCore
https://bugs.webkit.org/show_bug.cgi?id=213085

Reviewed by Wenson Hsieh.

This feature is referred to as a mediagroup in html, so let's use that terminology here as
well.
* html/MediaController.cpp:
(WebCore::MediaController::buffered const):
(WebCore::MediaController::seekable const):
(WebCore::MediaController::played):
(WebCore::MediaController::duration const):
(WebCore::MediaController::setCurrentTime):
(WebCore::MediaController::play):
(WebCore::MediaController::updateReadyState):
(WebCore::MediaController::updatePlaybackState):
(WebCore::MediaController::isBlocked const):
(WebCore::MediaController::hasEnded const):

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

4 months ago[IPC] Adopt enum class for DragSourceAction
ddkilzer@apple.com [Thu, 11 Jun 2020 18:54:13 +0000 (18:54 +0000)]
[IPC] Adopt enum class for DragSourceAction
<https://webkit.org/b/212885>
<rdar://problem/64094134>

Reviewed by Darin Adler.

Source/WebCore:

Summary:
- Convert DragSourceAction to enum class.
- Remove DragSourceActionNone by using Optional<> and
  OptionSet<> (as dictated by how the code used the value).
- Remove DragSourceActionAny and replace (as needed) with
  anyDragSourceAction(). (Some--but not all--uses were removed.)
- Add both WTF::EnumTraits<> and WTF::OptionSetTraits<> for
  DragSourceAction since both Optional<> and OptionSet<> are
  used with IPC.

* loader/EmptyClients.cpp:
* page/DragActions.h:
(WebCore::DragSourceAction):
- Convert to enum class.
(WebCore::anyDragSourceAction): Add.
- Replaces WebCore::DragSourceActionAny.
(WTF::EnumTraits<WebCore::DragSourceAction>): Add.
(WTF::OptionSetTraits<WebCore::DragSourceAction>): Add.
* page/DragClient.h:
* page/DragController.cpp:
(WebCore::DragController::delegateDragSourceAction):
(WebCore::DragController::draggableElement const):
(WebCore::DragController::prepareForDragStart const):
(WebCore::DragController::startDrag):
(WebCore::DragController::doSystemDrag):
- Use OptionSet<>::toSingleValue() and add ASSERT() that it does
  not return WTF::nullopt.
* page/DragController.h:
(WebCore::DragController::dragSourceAction const):
* page/DragState.h:
* page/EventHandler.cpp:
(WebCore::EventHandler::updateDragSourceActionsAllowed const):
(WebCore::EventHandler::dragHysteresisExceeded const):
- Use OptionSet<>::toSingleValue() and add ASSERT() that it does
  not return WTF::nullopt.
- Remove case statements for DragSourceActionNone and
  DragSourceActionAny, along with ASSERT_NOT_REACHED(). The
  ASSERT() for toSingleValue() replaces the DragSourceActionNone
  case.
(WebCore::EventHandler::didStartDrag):
(WebCore::ExactlyOneBitSet): Delete.
- Move to WTF::OptionSet<>::hasExactlyOneBitSet().
(WebCore::EventHandler::handleDrag):
- Add code to #ifndef NDEBUG/#endif instead of modifying
  dragState().type in-place since it seemed weird to modify it
  just to check an ASSERT(), even though it was overwritten
  immediately after that.
* page/EventHandler.h:
* platform/DragItem.h:
(WebCore::DragItem::encode const):
(WebCore::DragItem::decode):
- Stop using decodeEnum()/encodeEnum() with
  Optional<DragSourceAction>.

Source/WebKit:

Summary:
- Convert argument parameters from uint64_t to
  OptionSet<DragSourceAction>.
- Convert DragSourceAction to OptionSet<DragSourceAction>.

* Scripts/webkit/messages.py:
- Map DragSourceAction enum to DragActions.h header.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/DragDropInteractionState.h:
* UIProcess/ios/DragDropInteractionState.mm:
(WebKit::shouldUseDragImageToCreatePreviewForDragSource):
(WebKit::shouldUseVisiblePathToCreatePreviewForDragSource):
(WebKit::shouldUseTextIndicatorToCreatePreviewForDragSource):
(WebKit::canUpdatePreviewForActiveDragSource):
(WebKit::DragDropInteractionState::anyActiveDragSourceIs const):
(WebKit::DragDropInteractionState::stageDragItem):
(WebKit::DragDropInteractionState::hasStagedDragSource const):
(WebKit::DragDropInteractionState::updatePreviewsForActiveDragSources):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _startDrag:item:]):
(-[WKContentView _allowedDragSourceActions]):
(-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::requestDragStart):
(WebKit::WebPageProxy::requestAdditionalItemsForDragSession):
* WebProcess/WebCoreSupport/WebDragClient.cpp:
(WebKit::WebDragClient::dragSourceActionMaskForPoint):
* WebProcess/WebCoreSupport/WebDragClient.h:
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::allowedDragSourceActions const):
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::requestDragStart):
(WebKit::WebPage::requestAdditionalItemsForDragSession):

Source/WebKitLegacy/mac:

Summary:
- Add and use conversion functions between
  OptionSet<WebCore::DragSourceAction> and WebDragSourceAction.
- Update method signatures.

* WebCoreSupport/WebDragClient.h:
* WebCoreSupport/WebDragClient.mm:
(coreDragSourceActionMask): Add.
(WebDragClient::dragSourceActionMaskForPoint):
(WebDragClient::willPerformDragSourceAction):
(WebDragClient::startDrag):
* WebView/WebView.mm:
(kit): Add.
- Convert from Optional<WebCore::DragSourceAction> to
  WebDragSourceAction.
(-[WebView _startDrag:]):
* WebView/WebViewInternal.h:
(kit): Add declaration to reuse function in WebDragClient.mm.

Source/WebKitLegacy/win:

Summary:
- Add and use conversion functions between
  OptionSet<WebCore::DragSourceAction> and WebDragSourceAction.
- Update method signatures.

* WebCoreSupport/WebDragClient.cpp:
(coreDragSourceActionMask): Add.
(kit): Add.
- Convert from WebCore::DragSourceAction to WebDragSourceAction.
(WebDragClient::dragSourceActionMaskForPoint):
(WebDragClient::willPerformDragSourceAction):
(WebDragClient::startDrag):
* WebCoreSupport/WebDragClient.h:
(WebDragClient::dragSourceActionMaskForPoint):

Source/WTF:

* wtf/OptionSet.h:
(WTF::OptionSet::hasExactlyOneBitSet const): Add.
- Move here from WebCore::ExactlyOneBitSet() in
  Source/WebCore/page/EventHandler.cpp.
(WTF::OptionSet::toSingleValue const): Add.
- Use hasExactlyOneBitSet() to determine whether exactly one
  enum bitmask value can be returned.

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

4 months agoREGRESSION: [ Mac ] inspector/page/setBootstrapScript-sub-frame.html is flaky failing.
lawrence.j@apple.com [Thu, 11 Jun 2020 18:47:14 +0000 (18:47 +0000)]
REGRESSION: [ Mac ] inspector/page/setBootstrapScript-sub-frame.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=213087

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

4 months ago[iOS] editing/selection/ios/update-selection-after-overflow-scroll.html times out
wenson_hsieh@apple.com [Thu, 11 Jun 2020 17:57:12 +0000 (17:57 +0000)]
[iOS] editing/selection/ios/update-selection-after-overflow-scroll.html times out
https://bugs.webkit.org/show_bug.cgi?id=213082
<rdar://problem/64228007>

Reviewed by Megan Gardner.

This test makes a programmatic selection, and then scrolls an overflow area with accelerated scrolling by using
`UIHelper.immediateScrollElementAtContentPointToOffset()`. This helper method hit-tests for a subscrollable
region, and then uses platform API to change the content offset. However, after timing changes in the system,
this hit-testing now fails because it ends up finding the callout menu that shows up after making the text
selection, and so scrolling fails.

Fix this by using (40, 40) instead of (150, 100) when hit-testing the child scroll view when scrolling.

* editing/selection/ios/update-selection-after-overflow-scroll.html:

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

4 months agoRelease Assert @ WebCore::RenderTreeBuilder::RenderTreeBuilder
commit-queue@webkit.org [Thu, 11 Jun 2020 17:51:59 +0000 (17:51 +0000)]
Release Assert @ WebCore::RenderTreeBuilder::RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=212714

Patch by Pinki Gyanchandani <pgyanchandani@apple.com> on 2020-06-11
Reviewed by Geoffrey Garen.

Added a regression test.

* fast/rendering/widget-removal-in-render-tree-builder-crash-expected.txt: Added.
* fast/rendering/widget-removal-in-render-tree-builder-crash.html: Added.

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

4 months agoRegExp.prototype getters should throw on cross-realm access
shvaikalesh@gmail.com [Thu, 11 Jun 2020 17:23:56 +0000 (17:23 +0000)]
RegExp.prototype getters should throw on cross-realm access
https://bugs.webkit.org/show_bug.cgi?id=213075

Reviewed by Saam Barati.

JSTests:

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

Source/JavaScriptCore:

This patch makes RegExp.prototype getters throw TypeError when called on
RegExp.prototype object from another realm, aligning JSC with V8 and SpiderMonkey.

The spec [1] allows same-realm access to avoid breaking the web, while makes
RegExp.prototype an ordinary object (rather than RegExp instance) where possible.

[1]: https://tc39.es/ecma262/#sec-get-regexp.prototype.global (step 3.a)

* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoGetterGlobal):
(JSC::regExpProtoGetterIgnoreCase):
(JSC::regExpProtoGetterMultiline):
(JSC::regExpProtoGetterDotAll):
(JSC::regExpProtoGetterSticky):
(JSC::regExpProtoGetterUnicode):
(JSC::regExpProtoGetterSource):

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

4 months agoEnd a remote MediaStreamTrack if its source is ended
youenn@apple.com [Thu, 11 Jun 2020 17:14:07 +0000 (17:14 +0000)]
End a remote MediaStreamTrack if its source is ended
https://bugs.webkit.org/show_bug.cgi?id=213074

Reviewed by Eric Carlson.

Source/WebCore:

Make remote audio/video source observers of their webrtc source.
In case the webrtc source ends, end the source, thus its related tracks as well.
This is covered by the above test.

Test: webrtc/receiver-track-should-stay-live-even-if-receiver-is-inactive.html

* platform/mediastream/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
(WebCore::RealtimeIncomingAudioSource::~RealtimeIncomingAudioSource):
(WebCore::RealtimeIncomingAudioSource::startProducingData):
(WebCore::RealtimeIncomingAudioSource::stopProducingData):
(WebCore::RealtimeIncomingAudioSource::OnChanged):
* platform/mediastream/RealtimeIncomingAudioSource.h:
* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
(WebCore::RealtimeIncomingVideoSource::~RealtimeIncomingVideoSource):
(WebCore::RealtimeIncomingVideoSource::startProducingData):
(WebCore::RealtimeIncomingVideoSource::stopProducingData):
(WebCore::RealtimeIncomingVideoSource::OnChanged):
* platform/mediastream/RealtimeIncomingVideoSource.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::requestToEnd):
(WebCore::RealtimeMediaSource::end):
* platform/mediastream/RealtimeMediaSource.h:

LayoutTests:

* webrtc/receiver-track-should-stay-live-even-if-receiver-is-inactive-expected.txt: Added.
* webrtc/receiver-track-should-stay-live-even-if-receiver-is-inactive.html: Added.

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

4 months ago[Cocoa] Build callOnMainThread on WTF::RunLoop rather than on a timer
ggaren@apple.com [Thu, 11 Jun 2020 16:28:32 +0000 (16:28 +0000)]
[Cocoa] Build callOnMainThread on WTF::RunLoop rather than on a timer
https://bugs.webkit.org/show_bug.cgi?id=213063

Reviewed by Anders Carlsson.

Always use the RunLoop API for main thread tasks.

Previously, callOnMainThread sometimes scheduled a timer and sometimes
used the RunLoop. (Ironically, the timer behavior was added in r55816
with the intention to establish a single point of execution. Now, it has
the opposite effect.)

I picked the RunLoop API rather than the timer API because it moves us
closer to universally applying the RunLoop speedup in
https://bugs.webkit.org/show_bug.cgi?id=202874. Also, it avoids
allocating a timer, which can be expensive.

* wtf/cocoa/MainThreadCocoa.mm:
(WTF::scheduleDispatchFunctionsOnMainThread): The webIfExists() check
is a superset of the isWebThread() check, so we can just remove the
isWebThread() check when scheduling tasks to the web thread.
(WTF::timerFired): Deleted.
(WTF::postTimer): Deleted.

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

4 months ago[Cocoa] MediaUsageManagerCocoa should use a different USVideoUsage initializer
eric.carlson@apple.com [Thu, 11 Jun 2020 15:18:26 +0000 (15:18 +0000)]
[Cocoa] MediaUsageManagerCocoa should use a different USVideoUsage initializer
https://bugs.webkit.org/show_bug.cgi?id=213058

Reviewed by Jer Noble.

No new tests, tested manually.

* UIProcess/Media/cocoa/MediaUsageManagerCocoa.mm:
(WebKit::MediaUsageManagerCocoa::reset): Drive-by fix: don't call -stop unless the
element was playing.
(WebKit::MediaUsageManagerCocoa::updateMediaUsage): Use a different initializer so
we can pass in the state.

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

4 months agoAdd missing include to JSONObject.cpp - non-unified build
pmatos@igalia.com [Thu, 11 Jun 2020 14:41:57 +0000 (14:41 +0000)]
Add missing include to JSONObject.cpp - non-unified build
https://bugs.webkit.org/show_bug.cgi?id=213073

Reviewed by Adrian Perez de Castro.

* runtime/JSONObject.cpp:

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

4 months ago[css-grid] Reimport WPT tests removed in r262809
obrufau@igalia.com [Thu, 11 Jun 2020 12:47:19 +0000 (12:47 +0000)]
[css-grid] Reimport WPT tests removed in r262809
https://bugs.webkit.org/show_bug.cgi?id=213028

Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

r261841 imported some WPT grid tests, but it was reverted in r262809.
This patch reimports these tests again.

* resources/import-expectations.json:
* web-platform-tests/css/css-grid/grid-items/grid-item-dynamic-min-contribution-001-expected.txt: Added.
* web-platform-tests/css/css-grid/grid-items/grid-item-dynamic-min-contribution-001.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-001.html:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-002.html:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-003-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-003.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-004-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-004.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-005-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-005.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-006-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-006.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-007-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-007.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-008-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-008.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-009-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-009.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-010-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-010.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-011-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-011.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-012-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-012.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-013-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-013.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-014-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-014.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-vertical-lr-001.html:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-vertical-lr-002.html:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-vertical-rl-001.html:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-vertical-rl-002.html:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-001.html:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-002.html:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-003-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-003.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-004-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-004.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-005-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-005.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-006-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-006.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-007-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-007.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-008-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-008.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-009-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-009.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-010-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-010.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-011-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-011.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-012-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-012.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-013-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-013.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-014-expected.xht: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-014.html: Added.
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-lr-001.html:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-lr-002-expected.txt:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-lr-002.html:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-rl-001.html:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-rl-002-expected.txt:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-rl-002.html:
* web-platform-tests/css/css-grid/grid-items/w3c-import.log:

LayoutTests:

Add failure expectations of the new tests.

* TestExpectations:

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

4 months agoImprove url-setters.html WPT test
commit-queue@webkit.org [Thu, 11 Jun 2020 09:41:33 +0000 (09:41 +0000)]
Improve url-setters.html WPT test
https://bugs.webkit.org/show_bug.cgi?id=213046

Patch by Rob Buis <rbuis@igalia.com> on 2020-06-11
Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Update improved test expectation.

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

Source/WebCore:

Improve url-setters.html WPT test by testing for failure that can occur
when setting host or hostname [1].

[1] https://url.spec.whatwg.org/#host-state

* html/URLDecomposition.cpp:
(WebCore::URLDecomposition::setHost):
(WebCore::URLDecomposition::setHostname):

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

4 months ago[GTK] Implement button-press-event, button-release-event, and absolute-axis-event...
changseok@webkit.org [Thu, 11 Jun 2020 08:58:28 +0000 (08:58 +0000)]
[GTK] Implement button-press-event, button-release-event, and absolute-axis-event of GAMEPAD API.
https://bugs.webkit.org/show_bug.cgi?id=133850

Reviewed by Carlos Garcia Campos.

Source/WebCore:

This is a follow-up change after r261965, implementing the rest of missing GAMEPAD API
for the gtk port. Buttons and analog sticks of standard gamepads work with this change.

No new tests since existing tests can cover this change.

* html/OffscreenCanvas.h:
* platform/gamepad/manette/ManetteGamepad.cpp:
(WebCore::toStandardGamepadAxis):
(WebCore::onAbsoluteAxisEvent):
(WebCore::toStandardGamepadButton):
(WebCore::onButtonPressEvent):
(WebCore::onButtonReleaseEvent):
(WebCore::ManetteGamepad::ManetteGamepad):
(WebCore::ManetteGamepad::~ManetteGamepad):
(WebCore::ManetteGamepad::buttonPressedOrReleased):
(WebCore::ManetteGamepad::absoluteAxisChanged):
* platform/gamepad/manette/ManetteGamepad.h:
* platform/gamepad/manette/ManetteGamepadProvider.cpp:
(WebCore::ManetteGamepadProvider::ManetteGamepadProvider):
(WebCore::ManetteGamepadProvider::~ManetteGamepadProvider):
(WebCore::ManetteGamepadProvider::gamepadHadInput):
(WebCore::ManetteGamepadProvider::inputNotificationTimerFired):
* platform/gamepad/manette/ManetteGamepadProvider.h:

Source/WebKit:

* UIProcess/Gamepad/UIGamepadProvider.cpp: Add the OS(LINUX) guard.
* UIProcess/Gamepad/gtk/UIGamepadProviderGtk.cpp:
(WebKit::getWebPageProxy): Build fix. WebKitWebViewBase is used, not WebKitWebViewPrivate.
* UIProcess/Gamepad/manette/UIGamepadProviderManette.cpp: Add the OS(LINUX) guard.

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

4 months ago[WebXR] Pass an unsigned long to cancelAnimationCallback() as handle
svillar@igalia.com [Thu, 11 Jun 2020 08:09:33 +0000 (08:09 +0000)]
[WebXR] Pass an unsigned long to cancelAnimationCallback() as handle
https://bugs.webkit.org/show_bug.cgi?id=212529

Reviewed by Youenn Fablet.

The type of the handle returned by XRSession::requestAnimationFrame() was recently changed
to unsigned long from long as there was no point in using signed integers for that. However
we forgot to update the cancelAnimationFrame() in the specs as well as it receives the handle
returned by requestAnimationFrame().

We landed https://github.com/immersive-web/webxr/pull/1069 in the WebXR specs so we can now
safely also replace signed by unsigned integers in our implementation.

No new tests as there is no change in functionality.

Reland r262718.

* Modules/webxr/WebXRSession.cpp:
(WebCore::WebXRSession::cancelAnimationFrame): Use unsigned ids.
* Modules/webxr/WebXRSession.h: Ditto.
* Modules/webxr/WebXRSession.idl: Ditto.

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

4 months ago[Web Animations] Setting the style at the last style change event to null should...
graouts@webkit.org [Thu, 11 Jun 2020 07:52:46 +0000 (07:52 +0000)]
[Web Animations] Setting the style at the last style change event to null should not create an ElementAnimationRareData object
https://bugs.webkit.org/show_bug.cgi?id=213070
<rdar://problem/63841893>

Reviewed by Tim Horton.

In r262154 we added code that records the pre-animation style for a given element in
Style::TreeResolver::createAnimatedElementUpdate(), which is in Web Animations spec
parlance the style at the last style change event. This style is set on the backing
ElementAnimationRareData object for the given Element. For any element that did not
actually have any animations, we would set this style to null, but the function on
Element acting as a go-between would always create the backing ElementAnimationRareData
even though it would set a null value. We now only creaste the ElementAnimationRareData
object if there is a value to be stored, which fixes a performance regression in the
Speedometer2 test.

* dom/Element.cpp:
(WebCore::Element::setLastStyleChangeEventStyle):

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

4 months agoUnreviewed, updated libsoup dependency in jhbuild.
svillar@igalia.com [Thu, 11 Jun 2020 07:50:12 +0000 (07:50 +0000)]
Unreviewed, updated libsoup dependency in jhbuild.

* wpe/jhbuild.modules:

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

4 months ago[macOS]: The File Picker of the <input> file element should show the selection filter
commit-queue@webkit.org [Thu, 11 Jun 2020 06:31:53 +0000 (06:31 +0000)]
[macOS]: The File Picker of the <input> file element should show the selection filter
https://bugs.webkit.org/show_bug.cgi?id=212485

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2020-06-10
Reviewed by Darin Adler.

Source/WebCore/PAL:

Expose an SPI from CoreServcies to get all the UTIs known by the system.

* pal/spi/cocoa/CoreServicesSPI.h:

Source/WebKit:

Add two private helpers to WKOpenPanelParameters.

* UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
(-[WKOpenPanelParameters _allowedFileExtensions]):
Returns an array of strings representing the allowed extensions.

(-[WKOpenPanelParameters _allowedFileExtensionsDescription]):
Returns a string representing a description for the allowed extensions.

* UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h:

Tools:

Create a view with an NSPopupButton for the file extensions filter. Set
this view as the AccessoryView of the OpenPanel. Create a customized target
for the NSPopupButton to respond to changing its selection.

* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[FileExtensionsPopupTarget initWithOpenPanel:allowedFileExtensions:]):
(-[FileExtensionsPopupTarget popupAction:]):
(-[FileExtensionsPopupTarget dealloc]):
(-[WK2BrowserWindowController dealloc]):
(-[WK2BrowserWindowController createFilterView:popupTarget:]):
(-[WK2BrowserWindowController webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:]):

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

4 months agoReplace instances of blacklist in WebCore with blocklist
bdakin@apple.com [Thu, 11 Jun 2020 04:23:20 +0000 (04:23 +0000)]
Replace instances of blacklist in WebCore with blocklist
https://bugs.webkit.org/show_bug.cgi?id=213064

Reviewed by Tim Horton.

Source/WebCore:

* dom/ExtensionStyleSheets.cpp:
(WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const):
* page/Frame.cpp:
(WebCore::Frame::injectUserScriptImmediately):
* page/UserContentURLPattern.cpp:
(WebCore::UserContentURLPattern::matchesPatterns):
* page/UserContentURLPattern.h:
* page/UserScript.h:
(WebCore::UserScript::UserScript):
(WebCore::UserScript::blocklist const):
(WebCore::UserScript::encode const):
(WebCore::UserScript::decode):
(WebCore::UserScript::blacklist const): Deleted.
* page/UserStyleSheet.h:
(WebCore::UserStyleSheet::UserStyleSheet):
(WebCore::UserStyleSheet::blocklist const):
(WebCore::UserStyleSheet::blacklist const): Deleted.
* platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
(WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
(WebCore::GraphicsContextGLOpenGL::checkGPUStatus):
* platform/mac/PasteboardMac.mm:
(WebCore::cocoaTypeFromHTMLClipboardType):
* platform/text/TextEncodingRegistry.cpp:
(WebCore::pruneBlocklistedCodecs):
(WebCore::extendTextCodecMaps):
(WebCore::pruneBlacklistedCodecs): Deleted.

Source/WebKit:

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<UserStyleSheet>::encode):
(IPC::ArgumentCoder<UserStyleSheet>::decode):

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

4 months agoMultiple SVG Filters Unexpectedly lightens image using linearRGB
commit-queue@webkit.org [Thu, 11 Jun 2020 03:27:40 +0000 (03:27 +0000)]
Multiple SVG Filters Unexpectedly lightens image using linearRGB
https://bugs.webkit.org/show_bug.cgi?id=212649

Patch by Frank Yang <guowei_yang@apple.com> on 2020-06-10
Reviewed by Myles C. Maxfield, Simon Fraser, Darin Adler

Source/WebCore:

Added color space conversion of input FilterEffect ImageBuffer and ImageData
for filters that directly manipulates pixel values. The conversion
is missing only on CG platforms because on CG platforms,
FilterEffect::transformResultColorSpace doesn't perform any operations
Its author assumed all filters are using CG ImageBuffers, and that
CG will handle the conversion which is not the case. The following filters
operates on the raw pixels inside an ImageBuffer, and this requires an explicit
color space conversion of the pixel values when the ImageData are retrieved
by calling FilterEffect::copy{Pre/Un}multipliedData().

The filters affected are feComponentTransfer, feComposite, feConvolveMatrix
feGaussianBlur, FELighting, feMorphology. The conversion is done
by CG, by drawing the input ImageBuffer to a new ImageBuffer that
has the correct color space tag. The ImageData is then pulled from
this new ImageBuffer and used in platformApplySoftware()

Tests: svg/filters/feComponentTransfer-clipped-expected.svg
       svg/filters/feComponentTransfer-clipped.svg
       svg/filters/feComposite-clipped-expected.svg
       svg/filters/feComposite-clipped.svg
       svg/filters/feConvolveMatrix-clipped-expected.svg
       svg/filters/feConvolveMatrix-clipped.svg
       svg/filters/feGaussianBlur-clipped-expected.svg
       svg/filters/feGaussianBlur-clipped.svg
       svg/filters/feLighting-clipped-expected.svg
       svg/filters/feLighting-clipped.svg
       svg/filters/feMorphology-clipped-expected.svg
       svg/filters/feMorphology-clipped.svg

* platform/graphics/filters/FEComponentTransfer.cpp:
(WebCore::FEComponentTransfer::platformApplySoftware): Modified function call to
     FilterEffect::premultipliedResult, color space conversion is required on CG
     platforms, so operatingColorSpace is passed in and input will be converted to
     that color space
* platform/graphics/filters/FEComposite.cpp:
(WebCore::FEComposite::platformApplySoftware): Similarly, color space conversion
     Required on CG color space conversion is required on CG
     platforms, so operatingColorSpace is passed in and input will be converted to
     that color space
* platform/graphics/filters/FEConvolveMatrix.cpp:
(WebCore::FEConvolveMatrix::platformApplySoftware): converting to operating space
* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::platformApplySoftware): converting to operating space
* platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::platformApplySoftware): converting to operating space
* platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::platformApplyDegenerate): converting to operating space
(WebCore::FEMorphology::platformApplySoftware): converting to operating space
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::unmultipliedResult): modified function signature so that
     The Optional ColorSpace enum could be passed in to copyUnmultipliedResult()
(WebCore::FilterEffect::premultipliedResult): modified function signature so that
     The Optional ColorSpace enum could be passed in to copyUnmultipliedResult()
(WebCore::FilterEffect::convertImageDataToColorSpace): helper function that takes an ImageData ptr
     as input, put it into an ImageBuffer, and calls convertImageBufferToColorSpace to
     perform color conversion, and returns the converted ImageData
(WebCore::FilterEffect::convertImageBufferToColorSpace): helper function that takes an ImageBuffer ptr
     as input, create a new ImageBuffer with target color space, write input ImageBuffer to this new buffer
     (CG backend handles the conversion) and returns the ImageData in the buffer.
(WebCore::FilterEffect::copyConvertedImageBufferToDestination): helper function that copies data from ImageBuffer
     whose data is converted to the correct color space, to the destination array
(WebCore::FilterEffect::copyConvertedImageDataToDestination): helper function that copies data from ImageData
     whose data is converted to the correct color space, to the destination array
(WebCore::FilterEffect::copyUnmultipliedResult): added an optional argument, colorSpace, which will be passed
     into requiresAdditionalColorSpaceConversion, in order to determine if color space conversion is required
     when obtaining the unmultiplied result. Then, added code to convert color space before writing to the
     destination array
(WebCore::FilterEffect::copyPremultipliedResult): added an optional argument, colorSpace, which will be passed
     into requiresAdditionalColorSpaceConversion, in order to determine if color space conversion is required
     when obtaining the premultiplied result. Then, added code to convert color space before writing to the
     destination array.
(WebCore::FilterEffect::requiresImageDataColorSpaceConversion): unction that only returns true
      when 1) destination color space is non-null and is different than current color space AND
           2) the code is running on CG platforms
      This function will only be called inside copy{Un, Pre}multipliedResult, to address the issue
      where color space is needed for filters that modifies raw pixels.
* platform/graphics/filters/FilterEffect.h: Added function declarations

LayoutTests:

Added new tests that checks SVG render results for
feComponentTransfer, feComposite, feConvolveMatrix
feGaussianBlur, feMorphology and lighting

* svg/filters/feComponentTransfer-clipped-expected.svg: Added.
* svg/filters/feComponentTransfer-clipped.svg: Added.
* svg/filters/feComposite-clipped-expected.svg: Added.
* svg/filters/feComposite-clipped.svg: Added.
* svg/filters/feConvolveMatrix-clipped-expected.svg: Added.
* svg/filters/feConvolveMatrix-clipped.svg: Added.
* svg/filters/feGaussianBlur-clipped-expected.svg: Added.
* svg/filters/feGaussianBlur-clipped.svg: Added.
* svg/filters/feLighting-clipped-expected.svg: Added.
* svg/filters/feLighting-clipped.svg: Added.
* svg/filters/feMorphology-clipped-expected.svg: Added.
* svg/filters/feMorphology-clipped.svg: Added.

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

4 months ago[Line clamp] Do not apply the special anchor handling when the anchor content is...
zalan@apple.com [Thu, 11 Jun 2020 03:01:49 +0000 (03:01 +0000)]
[Line clamp] Do not apply the special anchor handling when the anchor content is visible after clamping
https://bugs.webkit.org/show_bug.cgi?id=213052
<rdar://problem/59739131>

Reviewed by Simon Fraser.

Source/WebCore:

Line clamping tries to preserve the anchor text if it is at the bottom of the paragraph to support cases like "... Read more", where the "read more" is an actual link.
This patch makes sure that we only apply the special case handling if the anchor text get clamped.

Test: fast/flexbox/line-clamp-with-anchor-content-only.html

* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):

LayoutTests:

* fast/flexbox/line-clamp-with-anchor-content-only-expected.html: Added.
* fast/flexbox/line-clamp-with-anchor-content-only.html: Added.

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

4 months ago[iOS] editing/pasteboard/dom-paste tests consistently time out
wenson_hsieh@apple.com [Thu, 11 Jun 2020 02:40:43 +0000 (02:40 +0000)]
[iOS] editing/pasteboard/dom-paste tests consistently time out
https://bugs.webkit.org/show_bug.cgi?id=213061
<rdar://problem/64211161>

Reviewed by Darin Adler.

On recent versions of iOS, system changes have moved the timing of the call to
`-requestAutocorrectionContextWithCompletionHandler:` when focusing an editable element. This results in a
consistently reproducible deadlock between the UI process and web process if a page tries to request
programmatic clipboard access during the click event (importantly, in the same runloop as element focus).

What ends up happening is that the autocorrection context is requested by the UI process shortly after the
(unbounded) sync IPC message for the DOM paste arrives, so we end up waiting forever for the sync-IPC-blocked
web process to respond. Normally this just results in a 1 second hang, and the DOM paste proceeds as normal.
However these layout tests purposefully opt out of sync IPC timeouts (precisely so that we can catch bugs like
this). See below for more details.

* UIProcess/ios/WKContentViewInteraction.h:

Keep track of the most recent autocorrection context that arrived in the UI process.

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

Clear out the autocorrection context, in case the web process crashes.

(-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):

If the autocorrection context is requested while handling a DOM paste, we know that the latest autocorrection
context must be up to date, since the autocorrection context is computed and sent immediately before a DOM paste
request. Use this to immediately invoke the completion handler, without any sync IPC back to the web process.

(-[WKContentView _handleAutocorrectionContext:]):

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

4 months agoREGRESSION(r260697): [Intl] "missing script" locales like zh-TW are no longer mapped
ross.kirsling@sony.com [Thu, 11 Jun 2020 02:20:47 +0000 (02:20 +0000)]
REGRESSION(r260697): [Intl] "missing script" locales like zh-TW are no longer mapped
https://bugs.webkit.org/show_bug.cgi?id=213007

Reviewed by Darin Adler.

JSTests:

* stress/intl-missing-script-locales.js: Added.

Source/JavaScriptCore:

addMissingScriptLocales was removed from IntlObject when changing our locale resolution to depend more directly
on ICU, but apparently even latest ICU won't perform this legacy "region implies script" mapping for us.

ICU 65+ does have uloc_openAvailableByType which will do the trick, so perhaps we should use this in the future,
but it still doesn't seem to help us with Collator, which has its own separate set of "available locales".

The exact set of locales which should be mapped is currently under discussion here:
https://github.com/tc39/ecma402/issues/159
But the crux seems to be that we should ensure we have an xx-ZZ alias for all available xx-Yyyy-ZZ locales.

* runtime/IntlObject.cpp:
(JSC::addScriptlessLocaleIfNeeded):
(JSC::intlAvailableLocales):
(JSC::intlCollatorAvailableLocales):

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

4 months ago[iOS] Option + Forward Delete should delete next word
commit-queue@webkit.org [Thu, 11 Jun 2020 02:20:45 +0000 (02:20 +0000)]
[iOS] Option + Forward Delete should delete next word
https://bugs.webkit.org/show_bug.cgi?id=213062
rdar://64225458

Patch by Hiro (mzp) Mizuno <mzp@apple.com> on 2020-06-10
Reviewed by Daniel Bates.

Source/WebKit:

Implement support for pressing Option + Forward Delete to delete the next word. This makes text editing
in WebKit more closely match the platform conventions.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformAction:withSender:]): Handle _deleteForwardByWord.
(-[WKContentView _deleteForwardByWord]): Added.

LayoutTests:

Add tests to ensure that Option + Forward Delete delete to the next word.
Skip the tests for now until we have the UIKit fix <rdar://problem/63253983>.

* fast/events/ios/key-command-delete-next-word-expected.txt: Added.
* fast/events/ios/key-command-delete-next-word.html: Added.
* platform/ios/TestExpectations: Skip tests for now

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

4 months agoCatalyst WebKit apps continue to play audio after quitting (Follow-up fix)
jbedard@apple.com [Thu, 11 Jun 2020 00:46:50 +0000 (00:46 +0000)]
Catalyst WebKit apps continue to play audio after quitting (Follow-up fix)
https://bugs.webkit.org/show_bug.cgi?id=212981
<rdar://problem/57089471>

Unreviewed build fix.

* WebKitPrivateFrameworkStubs/appletvos/13/RunningBoardServices.framework/RunningBoardServices.tbd:
* WebKitPrivateFrameworkStubs/watchos/6/RunningBoardServices.framework/RunningBoardServices.tbd:

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

4 months agoGeneralize configure-xcode-for-ios-development (Part 2)
jbedard@apple.com [Thu, 11 Jun 2020 00:41:32 +0000 (00:41 +0000)]
Generalize configure-xcode-for-ios-development (Part 2)
https://bugs.webkit.org/show_bug.cgi?id=207043
<rdar://problem/63946933>

Reviewed by Darin Adler.

* EWSTools/start-queue-mac.sh: Use configure-xcode-for-embedded-development over configure-xcode-for-ios-development.
* Scripts/configure-xcode-for-ios-development: Removed.

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

4 months ago[Cocoa] CRASH: imported/w3c/web-platform-tests/remote-playback/watch-availability...
jer.noble@apple.com [Thu, 11 Jun 2020 00:33:24 +0000 (00:33 +0000)]
[Cocoa] CRASH: imported/w3c/web-platform-tests/remote-playback/watch-availability-initial-callback.html is flaky crashing
https://bugs.webkit.org/show_bug.cgi?id=213044
<rdar://problem/62317723>

Reviewed by Eric Carlson.

Add null-checks around previously non-null-checked derefs of WeakPtr<HTMLMediaElement>.

* Modules/remoteplayback/RemotePlayback.cpp:
(WebCore::RemotePlayback::watchAvailability):
(WebCore::RemotePlayback::shouldPlayToRemoteTargetChanged):
(WebCore::RemotePlayback::playbackTargetPickerWasDismissed):

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

4 months agoText manipulation does not observe inserted elements that are invisible
sihui_liu@apple.com [Thu, 11 Jun 2020 00:28:06 +0000 (00:28 +0000)]
Text manipulation does not observe inserted elements that are invisible
https://bugs.webkit.org/show_bug.cgi?id=213057
<rdar://problem/63768253>

Reviewed by Wenson Hsieh.

Source/WebCore:

TextManipulationController gets notification when renderer of an element is created and starts observing the
element. It currently sets the observing range to be the visible start position and visible end position of the
element. When the invisible content becomes visible later, TextManipulationController does not get notification
and will miss the content. Therefore, TextManipulationController should use the actual start and end positions
of the element for range.

Test: TextManipulation.StartTextManipulationFindsInsertedClippedText

* editing/TextManipulationController.cpp:
(WebCore::makeHashablePositionRange):
(WebCore::TextManipulationController::scheduleObservationUpdate):

Tools:

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

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

4 months agoSome style improvements to main thread code
ggaren@apple.com [Thu, 11 Jun 2020 00:15:05 +0000 (00:15 +0000)]
Some style improvements to main thread code
https://bugs.webkit.org/show_bug.cgi?id=213051

Reviewed by Darin Adler.

Source/WebCore:

Updated for rename.

* WebCore.order:
* platform/ios/wak/WebCoreThread.mm:
(StartWebThread):

Source/WebDriver:

Updated for rename.

* WebDriverService.cpp:
(WebDriver::WebDriverService::run):

Source/WebKit:

Updated for rename.

* Shared/Cocoa/WebKit2InitializeCocoa.mm:
(WebKit::runInitializationCode):
(WebKit::InitializeWebKit2):
* Shared/WebKit2Initialize.cpp:
(WebKit::InitializeWebKit2):

Source/WebKitLegacy/mac:

Updated for rename.

* History/WebBackForwardList.mm:
(+[WebBackForwardList initialize]):
* History/WebHistoryItem.mm:
(+[WebHistoryItem initialize]):
* Misc/WebCache.mm:
(+[WebCache initialize]):
* Misc/WebElementDictionary.mm:
(+[WebElementDictionary initialize]):
* Misc/WebIconDatabase.mm:
* Plugins/Hosted/WebHostedNetscapePluginView.mm:
(+[WebHostedNetscapePluginView initialize]):
* Plugins/WebBaseNetscapePluginView.mm:
* Plugins/WebBasePluginPackage.mm:
(+[WebBasePluginPackage initialize]):
* Plugins/WebNetscapePluginView.mm:
(+[WebNetscapePluginView initialize]):
* WebCoreSupport/WebEditorClient.mm:
(+[WebUndoStep initialize]):
* WebCoreSupport/WebFrameLoaderClient.mm:
(+[WebFramePolicyListener initialize]):
* WebView/WebArchive.mm:
(+[WebArchivePrivate initialize]):
* WebView/WebDataSource.mm:
(+[WebDataSource initialize]):
* WebView/WebHTMLView.mm:
(+[WebHTMLViewPrivate initialize]):
(+[WebHTMLView initialize]):
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
* WebView/WebResource.mm:
(+[WebResourcePrivate initialize]):
* WebView/WebTextIterator.mm:
(+[WebTextIteratorPrivate initialize]):
* WebView/WebView.mm:
(+[WebView initialize]):
* WebView/WebViewData.mm:
(+[WebViewPrivate initialize]):

Source/WebKitLegacy/win:

Updated for rename.

* WebView.cpp:
(WebView::WebView):

Source/WTF:

* wtf/RunLoop.cpp:
(WTF::RunLoop::initializeMain): Renamed initializeMainRunLoop => initializeMain
to match the getter's name.
(WTF::RunLoop::initializeWeb): Samesies.
(WTF::RunLoop::webIfExists): Added an IfExists accessor for use in
scheduleDispatchFunctionsOnMainThread().
(WTF::RunLoop::initializeMainRunLoop): Deleted.
(WTF::RunLoop::initializeWebRunLoop): Deleted.

* wtf/RunLoop.h:

* wtf/cocoa/MainThreadCocoa.mm:
(WTF::scheduleDispatchFunctionsOnMainThread): Use RunLoop::webIfExists()
to check for the web thread run loop, since that's more explicit than
checking a pthread variable.

(WTF::isWebThread): Renamed mainThreadPthread => webThreadPthread because
it's the web thread. Changed style on globals to "s_" for consistency.
Removed mainThreadNSThread because it was unused.
(WTF::initializeApplicationUIThread):
(WTF::initializeWebThread):
(WTF::canCurrentThreadAccessThreadLocalData):

Tools:

Updated for rename.

* TestWebKitAPI/Tests/WTF/RefPtr.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/RunLoop.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebCore/AbortableTaskQueue.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebCore/ApplicationManifestParser.cpp:
(ApplicationManifestParserTest::SetUp):
* TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp:
(TestWebKitAPI::ComplexTextControllerTest::SetUp):
* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::ContentExtensionTest::SetUp):
* TestWebKitAPI/Tests/WebCore/DNS.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebCore/FileMonitor.cpp:
(TestWebKitAPI::TEST_F):
* TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
(initializeInAppBrowserPrivacyTestSettings):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):

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

4 months agoRelease Assert @ WebCore::RenderTreeBuilder::RenderTreeBuilder
commit-queue@webkit.org [Thu, 11 Jun 2020 00:10:30 +0000 (00:10 +0000)]
Release Assert @ WebCore::RenderTreeBuilder::RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=212714

Patch by Pinki Gyanchandani <pgyanchandani@apple.com> on 2020-06-10
Reviewed by Geoffrey Garen.

Replaced call to WTFMove(widgetNewParentMap()) with std::exchange(widgetNewParentMap(), { }) in the
WidgetHierarchyUpdatesSuspensionScope::moveWidgets(), thereby making it explicit to set the source map empty.

Test would be added later.

* rendering/RenderWidget.cpp:
(WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets):

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

4 months agoresults.webkit.org: Health check should access redis and Cassandra
jbedard@apple.com [Thu, 11 Jun 2020 00:07:51 +0000 (00:07 +0000)]
results.webkit.org: Health check should access redis and Cassandra
https://bugs.webkit.org/show_bug.cgi?id=212899
<rdar://problem/64118077>

Reviewed by Stephanie Lewis.

* resultsdbpy/resultsdbpy/example/main.py:
(health): Check the health status of the model.
* resultsdbpy/resultsdbpy/model/model.py:
(Model.HealthTable):
(Model.__init__): Construct a Cassandra table used to check the health of our Cassandra connection.
(Model.healthy): Make both a read and write connection to our two database dependencies so that if
our connection to those databases fails, an instance will be forced to restart.
* resultsdbpy/resultsdbpy/model/model_unittest.py: Added.
(ModelTest):
(ModelTest.init_database):
(ModelTest.test_health):

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

4 months agoWebKit:Add PepperUICoreSPI.h (Follow-up fix 2)
jbedard@apple.com [Thu, 11 Jun 2020 00:00:11 +0000 (00:00 +0000)]
WebKit:Add PepperUICoreSPI.h (Follow-up fix 2)
https://bugs.webkit.org/show_bug.cgi?id=212996
<rdar://problem/64182627>

Unreviewed build fix.

* UIProcess/ios/forms/WKNumberPadViewController.mm:
(-[WKNumberPadViewController addContentViewAnimations:]): Correct APPLE_INTERNAL_SDK macro.
* UIProcess/ios/forms/WKQuickboardListViewController.mm:
(-[WKQuickboardListViewController initWithDelegate:]): Ditto.

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