WebKit-https.git
5 months agoExtended Color Cleanup: Move Color coder definitions to Color to allow for future...
weinig@apple.com [Fri, 22 May 2020 03:52:07 +0000 (03:52 +0000)]
Extended Color Cleanup: Move Color coder definitions to Color to allow for future encaspulation improvements
https://bugs.webkit.org/show_bug.cgi?id=212247

Reviewed by Simon Fraser.

Move IPC encoder/decoder definitions from WebKit down into Color itself to move closer
to making Color::rgb() private.

Source/WebCore:

* platform/graphics/Color.h:
(WebCore::Color::encode const):
(WebCore::Color::decode):

Source/WebKit:

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<Color>::encode): Deleted.
(IPC::ArgumentCoder<Color>::decode): Deleted.
* Shared/WebCoreArgumentCoders.h:

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

5 months agoPVRTC compressed textures are failing with ANGLE backend
dino@apple.com [Fri, 22 May 2020 03:26:30 +0000 (03:26 +0000)]
PVRTC compressed textures are failing with ANGLE backend
https://bugs.webkit.org/show_bug.cgi?id=212240
<rdar://problem/63517385>

Reviewed by Ken Russell (representing ANGLE).

Source/ThirdParty/ANGLE:

The values used for the PVRTC formats were incorrect.

* src/libANGLE/formatutils.cpp:
(gl::BuildInternalFormatInfoMap):

LayoutTests:

Merge the upstream change to this test.

* webgl/1.0.3/resources/webgl_test_files/conformance/extensions/webgl-compressed-texture-pvrtc.html:

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

5 months agoScrolling thread scrolls on sync-scrolling scrollers don't get to the main thread
simon.fraser@apple.com [Fri, 22 May 2020 02:21:06 +0000 (02:21 +0000)]
Scrolling thread scrolls on sync-scrolling scrollers don't get to the main thread
https://bugs.webkit.org/show_bug.cgi?id=212225

Fix builds that use Nicosia after r262041.

* page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp:
(WebCore::ScrollingTreeFrameScrollingNodeNicosia::currentScrollPositionChanged):
* page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h:

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

5 months agoFix some thread safety issues with ScrollController timers
simon.fraser@apple.com [Fri, 22 May 2020 02:18:09 +0000 (02:18 +0000)]
Fix some thread safety issues with ScrollController timers
https://bugs.webkit.org/show_bug.cgi?id=212238

Reviewed by Wenson Hsieh.

There were some problems with the timers fired by ScrollController, used for rubber-banding
and scroll snap.

First, they could fire on the main thread when we intended them to fire on the scrolling thread.
This happened because in r260716 I made the scrolling tree commit on the main thread, so we'd
construct the ScrollingTreeScrollingNodeDelegateMac and its ScrollController there and its
timers would grab the main thread runloop. Fix by creating the timers on demand.

Secondly, the timer callbacks called into scrolling tree code, but without taking
the scrolling tree lock,
and without any guarantee that the node would stay alive for the duration of the callback.
Fix by having the ScrollControllerClient create the timers, allowing the client to have
a callback wrapper that locks, and to ensure object lifetime (or make a weak ref). Now
that scrolling tree nodes could be extended by a pending timer, we need to explicitly
clear the timers when nodes are removed from the tree.

Finally, rename some confusingly named ScrollControllerClient functions.

* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::treeMutex):
* page/scrolling/ScrollingTreeNode.h:
(WebCore::ScrollingTreeNode::wasBeRemovedFromTree):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::wasBeRemovedFromTree):
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::wasBeRemovedFromTree):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::nodeWillBeDestroyed):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::createTimer):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::didStopRubberbandSnapAnimation):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::willStartScrollSnapAnimation):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::didStopScrollSnapAnimation):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::stopSnapRubberbandTimer): Deleted.
(WebCore::ScrollingTreeScrollingNodeDelegateMac::startScrollSnapTimer): Deleted.
(WebCore::ScrollingTreeScrollingNodeDelegateMac::stopScrollSnapTimer): Deleted.
* platform/ScrollAnimator.cpp:
(WebCore::ScrollAnimator::createTimer):
* platform/ScrollAnimator.h:
* platform/cocoa/ScrollController.h:
(WebCore::ScrollControllerTimer::ScrollControllerTimer):
(WebCore::ScrollControllerClient::willStartRubberBandSnapAnimation):
(WebCore::ScrollControllerClient::didStopRubberbandSnapAnimation):
(WebCore::ScrollControllerClient::willStartScrollSnapAnimation):
(WebCore::ScrollControllerClient::didStopScrollSnapAnimation):
(WebCore::ScrollControllerClient::startSnapRubberbandTimer): Deleted.
(WebCore::ScrollControllerClient::stopSnapRubberbandTimer): Deleted.
(WebCore::ScrollControllerClient::startScrollSnapTimer): Deleted.
(WebCore::ScrollControllerClient::stopScrollSnapTimer): Deleted.
* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::ScrollController):
(WebCore::ScrollController::stopAllTimers):
(WebCore::ScrollController::handleWheelEvent):
(WebCore::ScrollController::snapRubberBandTimerFired):
(WebCore::ScrollController::isRubberBandInProgress const):
(WebCore::ScrollController::isScrollSnapInProgress const):
(WebCore::ScrollController::startSnapRubberbandTimer):
(WebCore::ScrollController::stopSnapRubberbandTimer):
(WebCore::ScrollController::snapRubberBand):
(WebCore::ScrollController::scheduleStatelessScrollSnap):
(WebCore::ScrollController::statelessSnapTransitionTimerFired):
(WebCore::ScrollController::startScrollSnapTimer):
(WebCore::ScrollController::stopScrollSnapTimer):
* platform/mac/ScrollAnimatorMac.h:

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

5 months agoScrolling thread scrolls on sync-scrolling scrollers don't get to the main thread
simon.fraser@apple.com [Fri, 22 May 2020 02:17:57 +0000 (02:17 +0000)]
Scrolling thread scrolls on sync-scrolling scrollers don't get to the main thread
https://bugs.webkit.org/show_bug.cgi?id=212225

Reviewed by Tim Horton.

Some scrolls on nodes with synchronousScrollingReasons failed to set the m_scrolledSinceLastCommit bit,
because ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged() bypassed a call to the superclass.

Fix by passing ScrollingLayerPositionAction so that it can just call super.

This will be tested by existing tests after some upcoming scroll snap changes.

* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):

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

5 months agoVarious compile-time boolean flags could/should be marked constexpr
rmorisset@apple.com [Fri, 22 May 2020 02:17:54 +0000 (02:17 +0000)]
Various compile-time boolean flags could/should be marked constexpr
https://bugs.webkit.org/show_bug.cgi?id=212244

Reviewed by Mark Lam.

Source/JavaScriptCore:

This trivial patch saves roughly 16kB from the JavaScriptCore binary in release mode.

* b3/B3OptimizeAssociativeExpressionTrees.cpp:
* b3/air/AirAllocateRegistersByGraphColoring.cpp:
* b3/air/AirSimplifyCFG.cpp:
(JSC::B3::Air::simplifyCFG):
* b3/air/AirTmpWidth.cpp:
(JSC::B3::Air::TmpWidth::recompute):
* dfg/DFGPredictionPropagationPhase.cpp:
* heap/GCIncomingRefCountedInlines.h:
(JSC::GCIncomingRefCounted<T>::filterIncomingReferences):
* heap/Heap.cpp:
(JSC::Heap::updateAllocationLimits):
* wasm/WasmEntryPlan.cpp:

Source/WTF:

* wtf/ParkingLot.cpp:

Tools:

* TestWebKitAPI/Tests/WTF/Condition.cpp:

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

5 months agoRemove AssemblerBufferWithConstantPool.h (as it has been dead for years)
rmorisset@apple.com [Fri, 22 May 2020 00:39:30 +0000 (00:39 +0000)]
Remove AssemblerBufferWithConstantPool.h (as it has been dead for years)
https://bugs.webkit.org/show_bug.cgi?id=212241

Reviewed by Yusuke Suzuki.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/AssemblerBufferWithConstantPool.h: Removed.

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

5 months agoFix issues of the Picture-in-Picture API under stress tests
peng.liu6@apple.com [Fri, 22 May 2020 00:20:29 +0000 (00:20 +0000)]
Fix issues of the Picture-in-Picture API under stress tests
https://bugs.webkit.org/show_bug.cgi?id=212191

Reviewed by Eric Carlson.

Source/WebCore:

The current implementation of the Picture-in-Picture API is not robust under stress tests.
Changing the video presentation mode of a video element between inline and picture-in-picture
continuously may corrupt the internal states of the video element.

This patch refactors the approach to tracking the progress of video presentation mode changes
and make sure no new requestPictureInPicture() or exitPictureInPicture() will trigger
a presentation mode change unless the previous operations are completed.

This patch also removes the code for testing purposes in the HTMLVideoElement class.

Covered by existing tests.

* html/HTMLMediaElement.h:
* html/HTMLVideoElement.cpp:
(WebCore::toPresentationMode):
(WebCore::HTMLVideoElement::setFullscreenMode):
(WebCore::HTMLVideoElement::fullscreenModeChanged):
(WebCore::HTMLVideoElement::didEnterFullscreen):
(WebCore::HTMLVideoElement::didExitFullscreen):
(WebCore::HTMLVideoElement::setPictureInPictureObserver):
(WebCore::HTMLVideoElement::setVideoFullscreenFrame):
(WebCore::HTMLVideoElement::didBecomeFullscreenElement): Deleted.
(WebCore::HTMLVideoElement::setPictureInPictureAPITestEnabled): Deleted.
* html/HTMLVideoElement.h:

* testing/Internals.cpp:
(WebCore::Internals::setPictureInPictureAPITestEnabled): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
Remove setPictureInPictureAPITestEnabled().

Source/WebKit:

* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenManagerProxy::enterFullscreen):
Mock the behavior of the VideoFullscreenInterface[AVKit|Mac] regarding
the Picture-in-Picture mode support.

* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::VideoFullscreenManager::didEnterFullscreen):
(WebKit::VideoFullscreenManager::didCleanupFullscreen):
Add callbacks for the end of entering/exiting fullscreen.

LayoutTests:

Refactor the layout tests for the Picture-in-Picture API with the Mock VideoPresentation Mode.

* media/picture-in-picture/picture-in-picture-api-css-selector-expected.txt:
* media/picture-in-picture/picture-in-picture-api-css-selector.html:
* media/picture-in-picture/picture-in-picture-api-enter-pip-1-expected.txt:
* media/picture-in-picture/picture-in-picture-api-enter-pip-1.html:
* media/picture-in-picture/picture-in-picture-api-enter-pip-2-expected.txt:
* media/picture-in-picture/picture-in-picture-api-enter-pip-2.html:
* media/picture-in-picture/picture-in-picture-api-enter-pip-3-expected.txt:
* media/picture-in-picture/picture-in-picture-api-enter-pip-3.html:
* media/picture-in-picture/picture-in-picture-api-enter-pip-4-expected.txt:
* media/picture-in-picture/picture-in-picture-api-enter-pip-4.html:
* media/picture-in-picture/picture-in-picture-api-events-expected.txt:
* media/picture-in-picture/picture-in-picture-api-events.html:
* media/picture-in-picture/picture-in-picture-api-exit-pip-1-expected.txt:
* media/picture-in-picture/picture-in-picture-api-exit-pip-1.html:
* media/picture-in-picture/picture-in-picture-api-exit-pip-2-expected.txt:
* media/picture-in-picture/picture-in-picture-api-exit-pip-2.html:
* media/picture-in-picture/picture-in-picture-api-pip-window-expected.txt:
* media/picture-in-picture/picture-in-picture-api-pip-window.html:
* media/picture-in-picture/picture-in-picture-events-expected.txt:
* media/picture-in-picture/picture-in-picture-events.html:
* media/picture-in-picture/picture-in-picture-interruption-expected.txt:
* media/picture-in-picture/picture-in-picture-interruption.html:

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

5 months agoFix misspelling -- m_releaseNetwrokActivityTimer --> m_releaseNetworkActivityTimer
commit-queue@webkit.org [Fri, 22 May 2020 00:13:11 +0000 (00:13 +0000)]
Fix misspelling -- m_releaseNetwrokActivityTimer --> m_releaseNetworkActivityTimer
https://bugs.webkit.org/show_bug.cgi?id=212237

Patch by Tyler Wilcock <twilco.o@protonmail.com> on 2020-05-21
Reviewed by Simon Fraser.

No new tests required -- simply fixing a misspelling.

* UIProcess/Cocoa/NavigationState.h: Rename m_releaseNetwrokActivityTimer to m_releaseNetworkActivityTimer
* UIProcess/Cocoa/NavigationState.mm: Rename m_releaseNetwrokActivityTimer to m_releaseNetworkActivityTimer
(WebKit::NavigationState::NavigationState):
(WebKit::NavigationState::releaseNetworkActivity):
(WebKit::NavigationState::didChangeIsLoading):

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

5 months agoRoll ANGLE to 2020-05-21
commit-queue@webkit.org [Fri, 22 May 2020 00:12:18 +0000 (00:12 +0000)]
Roll ANGLE to 2020-05-21
https://bugs.webkit.org/show_bug.cgi?id=212228

Patch by Kenneth Russell <kbr@chromium.org> on 2020-05-21
Reviewed by Dean Jackson.

Roll ANGLE to 96a80283cc0fe604d03c0bc0b3f9eb100edd22f9 in the
upstream repository using jdarpinian's excellent update-angle.sh
script.

Manually undo the fix from Bug 210992, which was fixed differently
upstream.

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

5 months agoExtended Color Cleanup: Remove trivial uses of Color::rgb()
weinig@apple.com [Thu, 21 May 2020 23:33:16 +0000 (23:33 +0000)]
Extended Color Cleanup: Remove trivial uses of Color::rgb()
https://bugs.webkit.org/show_bug.cgi?id=212231

Source/WebCore:

Reviewed by Darin Adler

Replaces a few unnecessary uses of Color::rgb():
- Uses of an idiom where code round-tripped a Color via Color(myColor.rgb()). This is
  not compatible with extended colors and seems to be unnecessary.
- Uses of colorWithOverrideAlpha(). This function requires a SimpleColor, so required
  using color.rgb(). We can't transition to Color::colorWithAlpha due to a slightly
  different rounding of the alpha, so a new function Color::colorWithAlphaUsingAlternativeRounding
  was added to which implements the alternative rounding. A later change can reconcile
  the two versions.
- Creation of D2D1::ColorF. D2D1::ColorF has a constructor that takes a four floats that
  is used instead.
- Comparing two colors using rgb() for each to avoid comparing the semantic bit. equalIgnoringSemanticColor
  exists for just this use.

* editing/cocoa/HTMLConverter.mm:
(HTMLConverterCaches::colorPropertyValueForNode):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::addHTMLColorToStyle):
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::setStrokeStyle):
(WebCore::CanvasRenderingContext2DBase::setFillStyle):
(WebCore::CanvasRenderingContext2DBase::setShadow):
* html/canvas/CanvasStyle.cpp:
(WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::updateCueFromCueData):
* platform/graphics/Color.cpp:
(WebCore::Color::colorWithAlphaMultipliedByUsingAlternativeRounding const):
(WebCore::Color::colorWithAlpha const):
(WebCore::Color::colorWithAlphaUsingAlternativeRounding const):
(WebCore::colorWithOverrideAlpha): Deleted.
* platform/graphics/Color.h:
(WebCore::colorWithOverrideAlpha): Deleted.
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::prepareCairoContextSource):
* platform/graphics/filters/FEFlood.cpp:
(WebCore::FEFlood::platformApplySoftware):
* platform/graphics/win/ColorDirect2D.cpp:
(WebCore::Color::operator D2D1_COLOR_F const):
(WebCore::Color::operator D2D1_VECTOR_4F const):
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::colorWithGlobalAlpha const):
* platform/mac/ThemeMac.mm:
(WebCore::drawCellFocusRingWithFrameAtTime):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformFocusRingColor const):
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):
* svg/SVGStopElement.cpp:
(WebCore::SVGStopElement::stopColorIncludingOpacity const):

Source/WebKit:

Reviewed by Darin Adler.

* UIProcess/API/ios/WKWebViewIOS.mm:
(scrollViewBackgroundColor):
Replace colorWithOverrideAlpha() with Color::colorWithAlphaUsingAlternativeRounding() to avoid
unnecessary use of Color::rgb()

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

5 months agoRename some variables in Bitmap API test for consistency and better readability.
mark.lam@apple.com [Thu, 21 May 2020 23:16:43 +0000 (23:16 +0000)]
Rename some variables in Bitmap API test for consistency and better readability.
https://bugs.webkit.org/show_bug.cgi?id=212235

Reviewed by Saam Barati.

This patch renames the following:
    bitmap0 => bitmapZeroes
    bitmapFilled => bitmapOnes
    bitmap3 => bitmap2Clone
    bitmapSmallZeroed => smallBitmapZeroes
    bitmapSmallFilled => smallBitmapOnes
    bitmapSmall1 => smallBitmap1
    bitmapSmall2 => smallBitmap2

Apart from these renamings, there are no other code changes.

* TestWebKitAPI/Tests/WTF/Bitmap.cpp:
(TestWebKitAPI::testBitmapSize):
(TestWebKitAPI::testBitmapConstructedEmpty):
(TestWebKitAPI::testBitmapSetGet):
(TestWebKitAPI::testBitmapTestAndSet):
(TestWebKitAPI::testBitmapTestAndClear):
(TestWebKitAPI::testBitmapConcurrentTestAndSet):
(TestWebKitAPI::testBitmapConcurrentTestAndClear):
(TestWebKitAPI::testBitmapClear):
(TestWebKitAPI::testBitmapClearAll):
(TestWebKitAPI::testBitmapInvert):
(TestWebKitAPI::testBitmapFindRunOfZeros):
(TestWebKitAPI::testBitmapCount):
(TestWebKitAPI::testBitmapIsEmpty):
(TestWebKitAPI::testBitmapIsFull):
(TestWebKitAPI::testBitmapMerge):
(TestWebKitAPI::testBitmapFilter):
(TestWebKitAPI::testBitmapExclude):
(TestWebKitAPI::testBitmapConcurrentFilter):
(TestWebKitAPI::testBitmapSubsumes):
(TestWebKitAPI::testBitmapForEachSetBit):
(TestWebKitAPI::testBitmapFindBit):
(TestWebKitAPI::testBitmapIteration):
(TestWebKitAPI::testBitmapMergeAndClear):
(TestWebKitAPI::testBitmapSetAndClear):
(TestWebKitAPI::testBitmapSetEachNthBit):
(TestWebKitAPI::testBitmapOperatorEqual):
(TestWebKitAPI::testBitmapOperatorNotEqual):
(TestWebKitAPI::testBitmapOperatorAssignment):
(TestWebKitAPI::testBitmapOperatorBitOrAssignment):
(TestWebKitAPI::testBitmapOperatorBitAndAssignment):
(TestWebKitAPI::testBitmapOperatorBitXorAssignment):
(TestWebKitAPI::testBitmapHash):

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

5 months ago[css-grid] Don't create renderers for whitespace nodes
obrufau@igalia.com [Thu, 21 May 2020 22:59:01 +0000 (22:59 +0000)]
[css-grid] Don't create renderers for whitespace nodes
https://bugs.webkit.org/show_bug.cgi?id=212220

Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

Import WPT test.

* web-platform-tests/css/css-grid/grid-items/w3c-import.log:
* web-platform-tests/css/css-grid/grid-items/whitespace-in-grid-item-001-expected.html: Added.
* web-platform-tests/css/css-grid/grid-items/whitespace-in-grid-item-001.html: Added.

Source/WebCore:

Even with 'white-space: pre' we shouldn't create RenderTexts
for whitespace-only nodes in grid layout, according to
https://drafts.csswg.org/css-grid/#grid-items

This patch is based on https://codereview.chromium.org/16888008

Tests: fast/text/simple-line-layout-with-zero-sized-font.html
       imported/w3c/web-platform-tests/css/css-grid/grid-items/whitespace-in-grid-item-001.html

* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::textRendererIsNeeded):

LayoutTests:

Update test expectation.

* fast/text/simple-line-layout-with-zero-sized-font-expected.txt:

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

5 months agoUse an OptionSet instead of uint8_t for MessageFlags
achristensen@apple.com [Thu, 21 May 2020 22:30:01 +0000 (22:30 +0000)]
Use an OptionSet instead of uint8_t for MessageFlags
https://bugs.webkit.org/show_bug.cgi?id=212230
<rdar://problem/63496543>

Reviewed by Darin Adler.

I also reduce the encoding size of OptionSet.

* Platform/IPC/ArgumentCoders.h:
(IPC::ArgumentCoder<OptionSet<T>>::encode):
(IPC::ArgumentCoder<OptionSet<T>>::decode):
* Platform/IPC/Decoder.cpp:
(IPC::Decoder::isSyncMessage const):
(IPC::Decoder::shouldDispatchMessageWhenWaitingForSyncReply const):
(IPC::Decoder::shouldUseFullySynchronousModeForTesting const):
* Platform/IPC/Decoder.h:
* Platform/IPC/Encoder.cpp:
(IPC::Encoder::isSyncMessage const):
(IPC::Encoder::shouldDispatchMessageWhenWaitingForSyncReply const):
(IPC::Encoder::setIsSyncMessage):
(IPC::Encoder::setShouldDispatchMessageWhenWaitingForSyncReply):
(IPC::Encoder::setFullySynchronousModeForTesting):
(IPC::Encoder::messageFlags):
(IPC::Encoder::messageFlags const):
* Platform/IPC/Encoder.h:
* Platform/IPC/MessageFlags.h:
(): Deleted.

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

5 months ago[GTK] Gardening, update expectations after r262016
dpino@igalia.com [Thu, 21 May 2020 22:25:00 +0000 (22:25 +0000)]
[GTK] Gardening, update expectations after r262016
https://bugs.webkit.org/show_bug.cgi?id=212234

Unreviewed gardening.

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

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

5 months agoAdd more Bitmap methods.
mark.lam@apple.com [Thu, 21 May 2020 22:12:43 +0000 (22:12 +0000)]
Add more Bitmap methods.
https://bugs.webkit.org/show_bug.cgi?id=212190
<rdar://problem/63481333>

Reviewed by Robin Morisset.

Source/WTF:

Specifically,
    setEachNthBit - sets every Nth bit starting at a specified start bit
    operator=     - assignment
    operator|=    - bit or and assignment
    operator&=    - bit and and assignment
    operator^=    - bit xor and assignment

* wtf/Bitmap.h:

Tools:

Added test coverage for the new WTF::Bitmap methods.

* TestWebKitAPI/Tests/WTF/Bitmap.cpp:
(TestWebKitAPI::testBitmapSetEachNthBit):
(TestWebKitAPI::testBitmapOperatorAssignment):
(TestWebKitAPI::testBitmapOperatorBitOrAssignment):
(TestWebKitAPI::testBitmapOperatorBitAndAssignment):
(TestWebKitAPI::testBitmapOperatorBitXorAssignment):
(TestWebKitAPI::TEST):

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

5 months agoUpdate description.
dino@apple.com [Thu, 21 May 2020 21:25:06 +0000 (21:25 +0000)]
Update description.

* platform/ios/TestExpectations:

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

5 months agoFix rare crash in TileGrid::platformCALayerShowRepaintCounter()
simon.fraser@apple.com [Thu, 21 May 2020 21:20:53 +0000 (21:20 +0000)]
Fix rare crash in TileGrid::platformCALayerShowRepaintCounter()
https://bugs.webkit.org/show_bug.cgi?id=212182
<rdar://problem/55618414>

Reviewed by Darin Adler.

Crash data suggest that owner() can be null in platformCALayerShowRepaintCounter(),
so null-check in these functions.

* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::platformCALayerDeviceScaleFactor const):
(WebCore::TileGrid::platformCALayerShowDebugBorders const):
(WebCore::TileGrid::platformCALayerShowRepaintCounter const):
(WebCore::TileGrid::isUsingDisplayListDrawing const):

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

5 months agoUnreviewed. Mark some webgl video tests as skipped
dino@apple.com [Thu, 21 May 2020 21:20:27 +0000 (21:20 +0000)]
Unreviewed. Mark some webgl video tests as skipped
now that they timeout rather than failing instantly.

* platform/ios/TestExpectations:

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

5 months agoIncorrect location.origin in blob workers
youenn@apple.com [Thu, 21 May 2020 20:40:03 +0000 (20:40 +0000)]
Incorrect location.origin in blob workers
https://bugs.webkit.org/show_bug.cgi?id=211876
<rdar://problem/63284717>

Reviewed by Sihui Liu.

Source/WebCore:

Instead of computing the origin from the location URL in worker, get it directly from the WorkerGlobalScope origin.
This ensures we unwrap properly blob URLs.

Test: http/tests/security/contentSecurityPolicy/worker-blob-location.html

* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::location const):
* workers/WorkerLocation.cpp:
(WebCore::WorkerLocation::origin const):
* workers/WorkerLocation.h:
(WebCore::WorkerLocation::create):
(WebCore::WorkerLocation::url const):
(WebCore::WorkerLocation::WorkerLocation):

LayoutTests:

* http/tests/security/contentSecurityPolicy/worker-blob-location-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/worker-blob-location.html: Added.

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

5 months agoUnreviewed test gardening, remove expectations for tests that are consistently passing.
ryanhaddad@apple.com [Thu, 21 May 2020 20:27:36 +0000 (20:27 +0000)]
Unreviewed test gardening, remove expectations for tests that are consistently passing.

* platform/ios-wk2/TestExpectations:

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

5 months agoStorage Access API: Allow configurable storage access scope
wilander@apple.com [Thu, 21 May 2020 20:22:39 +0000 (20:22 +0000)]
Storage Access API: Allow configurable storage access scope
https://bugs.webkit.org/show_bug.cgi?id=212114
<rdar://problem/63423063>

Reviewed by Alex Christensen.

The scope of storage access as per-frame or per-page was discussed in the
standards process here: https://github.com/privacycg/storage-access/issues/3

The decision was to have per-page storage access by default. Recent feedback
from Google and conversation with Mozilla suggest that we might want to
support the caller choosing the scope.

This patch adds support for different scope configurations while keeping the
existing default as per-frame. A later patch will switch the default and add
test cases for per-page scope.

Source/WebCore:

A new struct is added WebCore::RequestStorageAccessResult which carries full
information about the storage access request result.

A new enum is added WebCore::StorageAccessScope to encode per-frame and
per-page access.

No new tests. No changed functionality. Tests already exist.

* dom/DocumentStorageAccess.cpp:
(WebCore::DocumentStorageAccess::requestStorageAccess):
* dom/DocumentStorageAccess.h:
(WebCore::RequestStorageAccessResult::encode const):
(WebCore::RequestStorageAccessResult::decode):
* page/ChromeClient.h:
(WebCore::ChromeClient::requestStorageAccess):

Source/WebKit:

Most of the changes is piping through the new enum
WebCore::StorageAccessScope from the call side to encode per-frame and
per-page access, and piping through the new struct
WebCore::RequestStorageAccessResult on the return side which carries full
information about the storage access request result.

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::CompletionHandler<void):
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
(WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
(WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
(WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessEphemeral):
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccessEphemeral):
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInStorageSession):
    Renamed from WebResourceLoadStatisticsStore::grantStorageAccess()
    to reduce confusion since we already have another function called
    WebResourceLoadStatisticsStore::grantStorageAccess().
(WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* Scripts/webkit/messages.py:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::requestStorageAccess):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::requestStorageAccess):
* WebProcess/WebPage/WebPage.h:

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

5 months agoNull Ptr Deref @ WebCore::ResourceResponse::platformLazyInit
commit-queue@webkit.org [Thu, 21 May 2020 20:14:36 +0000 (20:14 +0000)]
Null Ptr Deref @ WebCore::ResourceResponse::platformLazyInit
https://bugs.webkit.org/show_bug.cgi?id=212224

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

Source/WebKitLegacy/mac:

Its possible that client can cancel the load implicitly or explicitly after its informed that load is committed, but code continues to assume that
loading is still in progress. This was cause of crash.
Added nullptr check before dereferencing the documentLoader, after client calls the commit load.

* WebView/WebHTMLRepresentation.mm:
(-[WebHTMLRepresentation receivedData:withDataSource:]):

LayoutTests:

Added a regression test.

* media/continue-load-after-client-cancellation-crash-expected.txt: Added.
* media/continue-load-after-client-cancellation-crash.html: Added.

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

5 months ago[PlayStation] Add minimal WKView API to enable TestWebKitAPI
yoshiaki.jitsukawa@sony.com [Thu, 21 May 2020 19:52:41 +0000 (19:52 +0000)]
[PlayStation] Add minimal WKView API to enable TestWebKitAPI
https://bugs.webkit.org/show_bug.cgi?id=211868

Reviewed by Alex Christensen.

Enable TestWebKitAPI

.:

* Source/cmake/OptionsPlayStation.cmake:
Disable FullScreen API and ContextMenus.

Source/WebCore:

* PlatformPlayStation.cmake:
Add WebKitRequirements library to WebCore_CopySharedLibs.

Source/WebKit:

* Platform/IPC/Connection.h:
* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::platformInvalidate):
(IPC::Connection::open):
Add SocketMonitor to monitor received messages.

* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
Add PlayStation specific members: WebProcess and NetworkProcess paths, and user ID.

* UIProcess/Launcher/ProcessLauncher.h:
Add PlayStation specific members: Process path and user ID.

* NetworkProcess/EntryPoint/playstation/NetworkProcessMain.cpp: Copied from Tools\TestWebKitAPI\playstation\main.cpp.
(loadLibraryOrExit):
(main):
* PlatformPlayStation.cmake:
* Shared/API/c/playstation/WKEventPlayStation.cpp: Added.
(WKKeyboardEventMake):
(WKMouseEventMake):
(WKWheelEventMake):
* Shared/API/c/playstation/WKEventPlayStation.h: Added.
* UIProcess/API/C/playstation/WKAPICastPlayStation.h:
(WebKit::toAPI<>):
(WebKit::toImpl<>):
* UIProcess/API/C/playstation/WKContextConfigurationPlayStation.cpp: Copied from Tools\TestWebKitAPI\playstation\PlatformUtilitiesPlayStation.cpp.
(WKContextConfigurationSetWebProcessPath):
(WKContextConfigurationCopyWebProcessPath):
(WKContextConfigurationSetNetworkProcessPath):
(WKContextConfigurationCopyNetworkProcessPath):
(WKContextConfigurationSetUserId):
(WKContextConfigurationGetUserId):
* UIProcess/API/C/playstation/WKContextConfigurationPlayStation.h: Copied from Source\WebKit\UIProcess\API\C\playstation\WKView.h.
* UIProcess/API/C/playstation/WKPagePrivatePlayStation.cpp: Added.
(WKPageHandleKeyboardEvent):
(WKPageHandleMouseEvent):
(WKPageHandleWheelEvent):
* UIProcess/API/C/playstation/WKPagePrivatePlayStation.h: Copied from Source\WebKit\UIProcess\API\C\playstation\WKView.h.
* UIProcess/API/C/playstation/WKView.cpp: Copied from Source\WebKit\WebProcess\InjectedBundle\playstation\InjectedBundlePlayStation.cpp.
(WKViewCreate):
(WKViewGetPage):
* UIProcess/API/C/playstation/WKView.h:
* UIProcess/Launcher/playstation/ProcessLauncherPlayStation.cpp:
(WebKit::defaultProcessPath):
(WebKit::ProcessLauncher::launchProcess):
(WebKit::ProcessLauncher::terminateProcess):
(WebKit::ProcessLauncher::platformInvalidate):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getLaunchOptions):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getLaunchOptions):
* UIProcess/playstation/PageClientImpl.cpp: Added.
(WebKit::PageClientImpl::PageClientImpl):
(WebKit::PageClientImpl::createDrawingAreaProxy):
(WebKit::PageClientImpl::setViewNeedsDisplay):
(WebKit::PageClientImpl::requestScroll):
(WebKit::PageClientImpl::viewScrollPosition):
(WebKit::PageClientImpl::viewSize):
(WebKit::PageClientImpl::isViewWindowActive):
(WebKit::PageClientImpl::isViewFocused):
(WebKit::PageClientImpl::isViewVisible):
(WebKit::PageClientImpl::isViewInWindow):
(WebKit::PageClientImpl::processDidExit):
(WebKit::PageClientImpl::didRelaunchProcess):
(WebKit::PageClientImpl::pageClosed):
(WebKit::PageClientImpl::preferencesDidChange):
(WebKit::PageClientImpl::toolTipChanged):
(WebKit::PageClientImpl::didCommitLoadForMainFrame):
(WebKit::PageClientImpl::handleDownloadRequest):
(WebKit::PageClientImpl::didChangeContentSize):
(WebKit::PageClientImpl::setCursor):
(WebKit::PageClientImpl::setCursorHiddenUntilMouseMoves):
(WebKit::PageClientImpl::didChangeViewportProperties):
(WebKit::PageClientImpl::registerEditCommand):
(WebKit::PageClientImpl::clearAllEditCommands):
(WebKit::PageClientImpl::canUndoRedo):
(WebKit::PageClientImpl::executeUndoRedo):
(WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore):
(WebKit::PageClientImpl::convertToDeviceSpace):
(WebKit::PageClientImpl::convertToUserSpace):
(WebKit::PageClientImpl::screenToRootView):
(WebKit::PageClientImpl::rootViewToScreen):
(WebKit::PageClientImpl::accessibilityScreenToRootView):
(WebKit::PageClientImpl::rootViewToAccessibilityScreen):
(WebKit::PageClientImpl::doneWithKeyEvent):
(WebKit::PageClientImpl::createPopupMenuProxy):
(WebKit::PageClientImpl::enterAcceleratedCompositingMode):
(WebKit::PageClientImpl::exitAcceleratedCompositingMode):
(WebKit::PageClientImpl::updateAcceleratedCompositingMode):
(WebKit::PageClientImpl::fullScreenManagerProxyClient):
(WebKit::PageClientImpl::didFinishLoadingDataForCustomContentProvider):
(WebKit::PageClientImpl::navigationGestureDidBegin):
(WebKit::PageClientImpl::navigationGestureWillEnd):
(WebKit::PageClientImpl::navigationGestureDidEnd):
(WebKit::PageClientImpl::willRecordNavigationSnapshot):
(WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot):
(WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame):
(WebKit::PageClientImpl::didFinishLoadForMainFrame):
(WebKit::PageClientImpl::didFailLoadForMainFrame):
(WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame):
(WebKit::PageClientImpl::didChangeBackgroundColor):
(WebKit::PageClientImpl::isPlayingAudioWillChange):
(WebKit::PageClientImpl::isPlayingAudioDidChange):
(WebKit::PageClientImpl::refView):
(WebKit::PageClientImpl::derefView):
(WebKit::PageClientImpl::didRestoreScrollPosition):
(WebKit::PageClientImpl::userInterfaceLayoutDirection):
(WebKit::PageClientImpl::requestDOMPasteAccess):
* UIProcess/playstation/PageClientImpl.h: Added.
* UIProcess/playstation/WebProcessPoolPlayStation.cpp:
(WebKit::WebProcessPool::platformInitialize):
* UIProcess/playstation/PlayStationWebView.cpp: Copied from Source\WebKit\UIProcess\playstation\WebProcessPoolPlayStation.cpp.
(WebKit::PlayStationWebView::create):
(WebKit::PlayStationWebView::PlayStationWebView):
(WebKit::PlayStationWebView::~PlayStationWebView):
(WebKit::PlayStationWebView::isActive const):
(WebKit::PlayStationWebView::isFocused const):
(WebKit::PlayStationWebView::isVisible const):
* UIProcess/playstation/PlayStationWebView.h: Copied from Source\WebKit\WebProcess\InjectedBundle\playstation\InjectedBundlePlayStation.cpp.
(WebKit::PlayStationWebView::page):
* WebProcess/EntryPoint/playstation/WebProcessMain.cpp: Copied from Tools\TestWebKitAPI\playstation\main.cpp.
(loadLibraryOrExit):
(main):
* WebProcess/InjectedBundle/playstation/InjectedBundlePlayStation.cpp:
(WebKit::InjectedBundle::initialize):
(WebKit::InjectedBundle::setBundleParameter):
* WebProcess/WebPage/AcceleratedSurface.cpp:
(WebKit::AcceleratedSurface::create):

Source/WTF:

* wtf/PlatformPlayStation.cmake:
Link libc as a system library.

Tools:

* TestWebKitAPI/PlatformPlayStation.cmake:
* TestWebKitAPI/PlatformWebView.h:
* TestWebKitAPI/playstation/PlatformUtilitiesPlayStation.cpp:
(TestWebKitAPI::Util::createInjectedBundlePath):
(TestWebKitAPI::Util::createURLForResource):
* TestWebKitAPI/playstation/PlatformWebViewPlayStation.cpp:
(TestWebKitAPI::PlatformWebView::PlatformWebView):
(TestWebKitAPI::PlatformWebView::~PlatformWebView):
(TestWebKitAPI::PlatformWebView::initialize):
(TestWebKitAPI::PlatformWebView::resizeTo):
(TestWebKitAPI::PlatformWebView::page const):
(TestWebKitAPI::PlatformWebView::simulateSpacebarKeyPress):
(TestWebKitAPI::PlatformWebView::simulateMouseMove):
(TestWebKitAPI::PlatformWebView::simulateRightClick):
(TestWebKitAPI::PlatformWebView::simulateButtonClick):
* TestWebKitAPI/playstation/main.cpp:
(loadLibraryOrExit):
(main):
Add PlayStation Platform support.

* TestWebKitAPI/Tests/WebKit/WKPreferences.cpp:
(TestWebKitAPI::TEST):
Use the same expected default font preferences as GTK's.

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

5 months agoLayout test media/video-fullscreen-only-playback.html is a flaky failure
peng.liu6@apple.com [Thu, 21 May 2020 19:04:06 +0000 (19:04 +0000)]
Layout test media/video-fullscreen-only-playback.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=212171

Reviewed by Jer Noble.

* media/video-fullscreen-only-playback.html:

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

5 months agocompositing/show-composited-iframe-on-back-button.html is a flaky timing out
cdumez@apple.com [Thu, 21 May 2020 19:00:26 +0000 (19:00 +0000)]
compositing/show-composited-iframe-on-back-button.html is a flaky timing out
https://bugs.webkit.org/show_bug.cgi?id=212221
<rdar://problem/63493074>

Reviewed by Alex Christensen.

I am unable to reproduce the flakiness locally so this is a speculative fix.
Stop using testRunner.queueLoad() / testRunner.queueBackNavigation() and instead
just navigate to page-cache-helper.html in JS, by setting window.location.
Also, call testRunner.waitUntilDone() and call testRunner.notifyDone() when the
page comes out of the back/forward cache.

* compositing/show-composited-iframe-on-back-button.html:

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

5 months ago[macOS] TestWebKitAPI.WebKit.HTTPReferer is a flaky failure
achristensen@apple.com [Thu, 21 May 2020 18:52:06 +0000 (18:52 +0000)]
[macOS] TestWebKitAPI.WebKit.HTTPReferer is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=212180

Reviewed by Darin Adler.

Sometimes an HTTP request takes more than one call to nw_connection_receive to receive entirely.
Add a new abstraction Connection that wraps an nw_connection_t and knows how to read an entire request.
Use strnstr instead of null terminating and using strstr.

* TestWebKitAPI/Tests/WebKitCocoa/Download.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/Proxy.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:
* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerTCPServer.h:
* TestWebKitAPI/cocoa/HTTPServer.h:
(TestWebKitAPI::Connection::receiveHTTPRequest):
(TestWebKitAPI::Connection::Connection):
* TestWebKitAPI/cocoa/HTTPServer.mm:
(TestWebKitAPI::HTTPServer::HTTPServer):
(TestWebKitAPI::dataFromString):
(TestWebKitAPI::vectorFromData):
(TestWebKitAPI::HTTPServer::respondToRequests):
(TestWebKitAPI::HTTPServer::request const):
(TestWebKitAPI::Connection::receiveHTTPRequest const):
(TestWebKitAPI::Connection::send const):
(TestWebKitAPI::Connection::terminate const):
(TestWebKitAPI::nullTerminatedRequest): Deleted.

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

5 months agoUse @isUndefinedOrNull instead of abstract equality with null
shvaikalesh@gmail.com [Thu, 21 May 2020 18:37:50 +0000 (18:37 +0000)]
Use @isUndefinedOrNull instead of abstract equality with null
https://bugs.webkit.org/show_bug.cgi?id=210954

Reviewed by Yusuke Suzuki.

JSTests:

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

Source/JavaScriptCore:

This patch:

a) Replaces 2 `!== @undefined` comparisons in String.prototype.{replace,replaceAll}
with @isUndefinedOrNull() as per spec [1], aligning JSC with V8 and SpiderMonkey.

b) Replaces 3 `!= @undefined` and 7 `!= null` comparisons with @isUndefinedOrNull()
as only the latter is correct with [[IsHTMLDDA]] aka MasqueradesAsUndefined objects [2].

c) Removes @isDictionary() since it is unused, easy to inline and its name is quite
misleading: one might expect it to perform Structure::isDictionary().

[1]: https://tc39.es/ecma262/#sec-getmethod (step 3)
[2]: https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot

* builtins/ArrayConstructor.js:
* builtins/GlobalOperations.js:
(globalPrivate.isDictionary): Deleted.
* builtins/RegExpPrototype.js:
(Symbol.split): Unobservable as there is `=== null` check in @regExpExec.
* builtins/StringPrototype.js:
(match):
(replace):
(replaceAll):
(search):
(split):
* builtins/TypedArrayConstructor.js:

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

5 months agoASSERTION FAILED: m_wrapper on fast/events/scoped/editing-commands.html
cdumez@apple.com [Thu, 21 May 2020 18:03:36 +0000 (18:03 +0000)]
ASSERTION FAILED: m_wrapper on fast/events/scoped/editing-commands.html
https://bugs.webkit.org/show_bug.cgi?id=209862
<rdar://problem/61164607>

Reviewed by Darin Adler.

Make sure ScopedEventQueue keeps its event targets alive using a GCReachableRef<Node>
so that it keeps alive both the target and its JS wrapper.

No new tests, covered by existing test.

* dom/ScopedEventQueue.cpp:
(WebCore::ScopedEventQueue::enqueueEvent):
(WebCore::ScopedEventQueue::dispatchEvent const):
(WebCore::ScopedEventQueue::dispatchAllEvents):
* dom/ScopedEventQueue.h:

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

5 months agoSQLite database fails to close in SQLiteIDBBackingStore::databaseNameFromFile
sihui_liu@apple.com [Thu, 21 May 2020 18:02:57 +0000 (18:02 +0000)]
SQLite database fails to close in SQLiteIDBBackingStore::databaseNameFromFile
https://bugs.webkit.org/show_bug.cgi?id=212090

Reviewed by Darin Adler.

We should finish SQLite statement before closing database.

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromFile):

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

5 months agoAdd an option that exposes functions on the global object to turn on and off the...
sbarati@apple.com [Thu, 21 May 2020 17:44:13 +0000 (17:44 +0000)]
Add an option that exposes functions on the global object to turn on and off the sampling profiler and the super sampler
https://bugs.webkit.org/show_bug.cgi?id=212178

Reviewed by Yusuke Suzuki.

When profiling things like Speedometer inside the browser, it's important to
to only enable the super sampler and the sampling profiler around the code
that you want profiled. Otherwise, you will be profiling things that aren't
relevant to the benchmark score. This patch adds a new option, exposeProfilersOnGlobalObject,
which when true, will expose JS functions on the global object that allow
enabling/disabling the super sampler and the sampling profiler. This way,
we can change the Speedometer source code locally such that these profilers
are only sampling code accounted for in the benchmark score.

* bytecode/SuperSampler.cpp:
(JSC::initializeSuperSampler):
(JSC::enableSuperSampler):
(JSC::disableSuperSampler):
* bytecode/SuperSampler.h:
* jsc.cpp:
(jscmain):
* runtime/JSGlobalObject.cpp:
(JSC::enableSamplingProfiler):
(JSC::disableSamplingProfiler):
(JSC::enableSuperSampler):
(JSC::disableSuperSampler):
(JSC::JSGlobalObject::init):
* runtime/OptionsList.h:

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

5 months ago[JSC] Fix 32bit JSBigInt with INT32_MAX < x <= UINT32_MAX
ysuzuki@apple.com [Thu, 21 May 2020 17:21:14 +0000 (17:21 +0000)]
[JSC] Fix 32bit JSBigInt with INT32_MAX < x <= UINT32_MAX
https://bugs.webkit.org/show_bug.cgi?id=212193

Reviewed by Mark Lam.

In 32bit architecture, we are creating one-length JSBigInt for INT32_MIN <= x <= INT32_MAX, and two-length JSBigInt otherwise.
This is wrong since one-length JSBigInt should cover from -UINT32_MAX <= x <= UINT32_MAX.

This patch fixes the bug and cleans up createFrom(VM&, int64_t). And it also adds JSBigInt::createFrom(VM&, uint64_t) in preparation for [1]
Currently, this path is not used while it was used previously because BigIntConstructor starts using JSBigInt::createFrom(VM&, double). But this
will be used in [1], and simply the existing implementation is wrong.

[1]: https://bugs.webkit.org/show_bug.cgi?id=190800

* runtime/JSBigInt.cpp:
(JSC::JSBigInt::createFromImpl):
(JSC::JSBigInt::createFrom):
* runtime/JSBigInt.h:

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

5 months agoLayoutTest compositing/video/video-poster.html is a flaky failure
jacob_uphoff@apple.com [Thu, 21 May 2020 17:03:27 +0000 (17:03 +0000)]
LayoutTest compositing/video/video-poster.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=168953

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

5 months agoREGRESSION (r261277): [ Mac iOS ] webrtc/datachannel/gather-candidates-networkprocess...
tsavell@apple.com [Thu, 21 May 2020 17:00:55 +0000 (17:00 +0000)]
REGRESSION (r261277): [ Mac iOS ] webrtc/datachannel/gather-candidates-networkprocess-crash.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=212218

Unreviewed test gardening.

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

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

5 months ago[GTK] webaudio/codec-tests/aac/vbr-128kbps-44khz.html is failing
dpino@igalia.com [Thu, 21 May 2020 16:50:02 +0000 (16:50 +0000)]
[GTK] webaudio/codec-tests/aac/vbr-128kbps-44khz.html is failing
https://bugs.webkit.org/show_bug.cgi?id=211770

Unreviewed gardening.

Test just needs to update audio baseline for target platform.

* platform/glib/TestExpectations:
* platform/gtk/webaudio/codec-tests/aac/vbr-128kbps-44khz-expected.wav:

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

5 months ago[ iOS & macOS ] media/track/track-cue-missing.html is a flaky failure
jacob_uphoff@apple.com [Thu, 21 May 2020 16:42:57 +0000 (16:42 +0000)]
[ iOS & macOS ] media/track/track-cue-missing.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=212219

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:
* platform/mac/TestExpectations:

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

5 months ago[ macOS ] REGRESSION: media/video-isplayingtoautomotiveheadunit.html is a flaky failure
jacob_uphoff@apple.com [Thu, 21 May 2020 16:22:09 +0000 (16:22 +0000)]
[ macOS ] REGRESSION: media/video-isplayingtoautomotiveheadunit.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=212215

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

5 months agoSome http/tests/in-app-browser-privacy/ tests are timing out or failing
katherine_cheney@apple.com [Thu, 21 May 2020 16:16:41 +0000 (16:16 +0000)]
Some http/tests/in-app-browser-privacy/ tests are timing out or failing
https://bugs.webkit.org/show_bug.cgi?id=212176
<rdar://problem/63452877>

Reviewed by Maciej Stachowiak.

These tests rely on a new network session load for each test resource.
When run in iterations, caching occurs, and the resource does not get
a new network session. This patch adds a random decoration value and
reloads each resource to ensure it is not cached.

* http/tests/in-app-browser-privacy/app-bound-domain-gets-app-bound-session.html:
* http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session.html:
* http/tests/in-app-browser-privacy/non-app-bound-iframe-under-app-bound-domain-is-app-bound.html:

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

5 months agoAddress post review comments from Mitz after r262004.
cdumez@apple.com [Thu, 21 May 2020 16:12:41 +0000 (16:12 +0000)]
Address post review comments from Mitz after r262004.

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

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

5 months ago[WK2] WebKit abandons compiled sandbox profiles
cdumez@apple.com [Thu, 21 May 2020 16:08:50 +0000 (16:08 +0000)]
[WK2] WebKit abandons compiled sandbox profiles
https://bugs.webkit.org/show_bug.cgi?id=212177
<rdar://problem/54613619>

Reviewed by Saam Barati.

WebKit generates new compiled sandbox profiles whenever sandbox profiles are updated or
whenever webkit directories change (which is super common for WebKitTestRunner). Previous
compiled sandbox profiles do not get deleted and therefore may accumulate.

To address the issue, we now save compiled sandbox profiles under _CS_DARWIN_USER_TEMP_DIR
instead of _CS_DARWIN_USER_CACHE_DIR. The system takes care of deleting the files under
_CS_DARWIN_USER_TEMP_DIR upon reboot or if they have not been accessed for 3 days.

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

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

5 months agoDispatch pending events only for current page
dougk@apple.com [Thu, 21 May 2020 16:04:12 +0000 (16:04 +0000)]
Dispatch pending events only for current page
https://bugs.webkit.org/show_bug.cgi?id=211975
<rdar://problem/58942759>

Reviewed by Chris Dumez.

Document::implicitClose() should not dispatch events globally. The EventSender class operates as a singleton pattern
for each event queue, so to add some means to restrict which documents are handling events, we can send the current
page pointer and only dispatch the event if the event is for the same page. Other events are simply re-enqueued
to be triggered at a later time.

* dom/Document.cpp:
(WebCore::Document::implicitClose):
* dom/EventSender.h:
(WebCore::EventSender::timerFired):
(WebCore::EventSender<T>::dispatchPendingEvents):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::dispatchPendingLoadEvents):
* html/HTMLLinkElement.h:
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::dispatchPendingLoadEvents):
* html/HTMLStyleElement.h:
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::dispatchPendingBeforeLoadEvents):
(WebCore::ImageLoader::dispatchPendingLoadEvents):
(WebCore::ImageLoader::dispatchPendingErrorEvents):
* loader/ImageLoader.h:
(WebCore::ImageLoader::document):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::append):

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

5 months agoUnreviewed, fix the iOS 13.4 build after r261978
wenson_hsieh@apple.com [Thu, 21 May 2020 15:42:19 +0000 (15:42 +0000)]
Unreviewed, fix the iOS 13.4 build after r261978

Source/WebKit:

* Platform/spi/ios/UIKitSPI.h:

Only declare `_UIHoverEventRespondable` if HAVE(UI_HOVER_EVENT_RESPONDABLE) is defined.

* UIProcess/ios/WKMouseGestureRecognizer.mm:

If `_UIHoverEventRespondable` is not present, fall back to declaring internal methods on
`UIHoverGestureRecognizer`.

Source/WTF:

Add a `HAVE()` macro to guard usages of _UIHoverEventRespondable.

* wtf/PlatformHave.h:

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

5 months ago[macOS] Scrolling synchronization part 2: Have the scrolling thread detect when the...
simon.fraser@apple.com [Thu, 21 May 2020 15:35:21 +0000 (15:35 +0000)]
[macOS] Scrolling synchronization part 2: Have the scrolling thread detect when the main thread is slow to respond to start a rendering update
https://bugs.webkit.org/show_bug.cgi?id=212175

Reviewed by Tim Horton.

The scrolling thread now detects when a main thread rendering update is taking too long, going into
desynchronized mode when that happens.

However, there's another state that needs to be handled, which is the main thread being busy and
taking too long to start the rendering update. The scrolling thread gets a "displayDidRefresh" ping
and expects that the main thread will get the same ping, and use it to start the rendering update,
but a busy main thread won't respond to this ping promptly.

Detect this with a short-duration (1ms) timer that fires on the scrolling thread; if the timer fires
we go into desynchronized mode until the next update. The timer is canceled if the scrolling thread
receives the willStartRenderingUpdate().

* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::waitForRenderingUpdateCompletionOrTimeout):
(WebCore::ThreadedScrollingTree::scheduleDelayedRenderingUpdateDetectionTimer):
(WebCore::ThreadedScrollingTree::delayedRenderingUpdateDetectionTimerFired):
(WebCore::ThreadedScrollingTree::displayDidRefreshOnScrollingThread):
* page/scrolling/ThreadedScrollingTree.h:

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

5 months ago[ConnectionUnix] Set MSG_NOSIGNAL to avoid SIGPIPE
yoshiaki.jitsukawa@sony.com [Thu, 21 May 2020 15:27:19 +0000 (15:27 +0000)]
[ConnectionUnix] Set MSG_NOSIGNAL to avoid SIGPIPE
https://bugs.webkit.org/show_bug.cgi?id=211719

Reviewed by Don Olmstead.

Set MSG_NOSIGNAL to sendmsg()/resvmsg() in order to avoid
SIGPIPE when the other process disappears.
* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::readBytesFromSocket):
(IPC::Connection::sendOutputMessage):

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

5 months agoREGRESSION (r253926): webgl/2.0.0/conformance2/buffers/get-buffer-sub-data.html is...
commit-queue@webkit.org [Thu, 21 May 2020 15:26:46 +0000 (15:26 +0000)]
REGRESSION (r253926): webgl/2.0.0/conformance2/buffers/get-buffer-sub-data.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=205667

Patch by Kenneth Russell <kbr@chromium.org> on 2020-05-21
Reviewed by Alexey Proskuryakov.

Remove get-buffer-sub-data.html suppression since it's now passing
reliably.

* TestExpectations:

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

5 months agoSource/WebCore:
svillar@igalia.com [Thu, 21 May 2020 14:45:18 +0000 (14:45 +0000)]
Source/WebCore:
[css-grid] [css-flex] Width of table as grid/flex item is infinite when the sum of columns' width exceed 100%
https://bugs.webkit.org/show_bug.cgi?id=191365

Reviewed by Manuel Rego Casasnovas.

Automatic table layout algorithm generates infinite width tables
(tableMaxWidth to be more exact) when the sum of the columns percentages
exceed the 100% value and there is at least one non-percentage based
column with positive width as in those cases it's impossible to fulfill
the table constrains. That should not be done in the case of the table
being a flex or a grid item because they both define new formatting
contexts.

Based on Blink's crrev.com/1095220 by <mstensho@chromium.org>

* rendering/AutoTableLayout.cpp:
(WebCore::shouldScaleColumnsForParent): return false when the table is
either a grid or a flex item.

LayoutTests:
[css-grid] width of table in a grid is incorrect when table cell has width:100%
https://bugs.webkit.org/show_bug.cgi?id=191365

Reviewed by Manuel Rego Casasnovas.

* TestExpectations: Unskipped 3 tests that are now passing.

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

5 months ago[WPE] Gardening, update WAV baseline for webaudio test
dpino@igalia.com [Thu, 21 May 2020 14:41:12 +0000 (14:41 +0000)]
[WPE] Gardening, update WAV baseline for webaudio test
https://bugs.webkit.org/show_bug.cgi?id=212212

Unreviewed gardening.

Baseline was updated on r261878 and since then the test started
failing. The test wasn't failing before though. In conclusion, it
seems the update from r261878 wasn't needed for this test.

* platform/wpe/webaudio/codec-tests/mp3/128kbps-44khz-expected.wav:

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

5 months ago[ macOS debug ] REGRESSION: fast/layoutformattingcontext/table-basic-row-baseline...
zalan@apple.com [Thu, 21 May 2020 14:28:06 +0000 (14:28 +0000)]
[ macOS debug ] REGRESSION: fast/layoutformattingcontext/table-basic-row-baseline-with-nested-table.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=212139
<rdar://problem/63447683>

Reviewed by Antti Koivisto.

Source/WebCore:

Uninitialized row baseline value caused unexpected cell height in nested tables.

* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::setUsedGeometryForRows):
* layout/tableformatting/TableGrid.h:

LayoutTests:

* platform/mac/TestExpectations:

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

5 months agoFurther non-unified build fixes
pmatos@igalia.com [Thu, 21 May 2020 13:58:04 +0000 (13:58 +0000)]
Further non-unified build fixes
https://bugs.webkit.org/show_bug.cgi?id=212195

Reviewed by Adrian Perez de Castro.

* bytecode/InstanceOfStatus.cpp:
* heap/MarkedSpace.cpp:
* runtime/ObjectInitializationScope.cpp:
* runtime/ThrowScope.cpp:

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

5 months agoUnreviewed WPE gardening. Enabling a few subdirectories under fast/,
zandobersek@gmail.com [Thu, 21 May 2020 13:19:31 +0000 (13:19 +0000)]
Unreviewed WPE gardening. Enabling a few subdirectories under fast/,
providing the necessary baselines as well as test expectations.

* platform/wpe/TestExpectations:
* platform/wpe/fast/attachment: 8 baselines added.
* platform/wpe/fast/fast-mobile-scrolling: 2 baselines added.
* platform/wpe/fast/scrolling: 2 baselines added.
* platform/wpe/fast/spatial-navigation: 1 baseline added.
* platform/wpe/fast/text: 211 baselines added.

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

5 months ago[LFC][TFC] Collapse in-between cell borders
zalan@apple.com [Thu, 21 May 2020 12:33:00 +0000 (12:33 +0000)]
[LFC][TFC] Collapse in-between cell borders
https://bugs.webkit.org/show_bug.cgi?id=212183

Reviewed by Antti Koivisto.

Source/WebCore:

This patch expands border collapsing to in-between cell borders.

Test: fast/layoutformattingcontext/table-simple-border-collapse3.html

* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutCell):
* layout/tableformatting/TableFormattingContext.h:
* layout/tableformatting/TableFormattingContextGeometry.cpp:
(WebCore::Layout::TableFormattingContext::Geometry::computedCellBorder const):
(WebCore::Layout::TableFormattingContext::Geometry::intrinsicWidthConstraintsForCell):

LayoutTests:

* fast/layoutformattingcontext/table-simple-border-collapse3-expected.html: Added.
* fast/layoutformattingcontext/table-simple-border-collapse3.html: Added.

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

5 months agoEXT_color_buffer_half_float not exposed on iOS
commit-queue@webkit.org [Thu, 21 May 2020 10:50:54 +0000 (10:50 +0000)]
EXT_color_buffer_half_float not exposed on iOS
https://bugs.webkit.org/show_bug.cgi?id=212181

Patch by Kenneth Russell <kbr@chromium.org> on 2020-05-21
Reviewed by Dean Jackson.

Remove OES_texture_half_float requirement for advertising
EXT_color_buffer_half_float in ANGLE. This is implicit in ES 3.0.

* src/libANGLE/renderer/gl/formatutilsgl.cpp:
(rx::nativegl::BuildInternalFormatInfoMap):

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

5 months ago[WPE] Gardening, remove tests passing after 261987
dpino@igalia.com [Thu, 21 May 2020 10:38:47 +0000 (10:38 +0000)]
[WPE] Gardening, remove tests passing after 261987
https://bugs.webkit.org/show_bug.cgi?id=212196

Unreviewed gardening.

* platform/wpe/TestExpectations:

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

5 months ago[GTK] Gardening, remove tests passing after r261986
dpino@igalia.com [Thu, 21 May 2020 10:08:57 +0000 (10:08 +0000)]
[GTK] Gardening, remove tests passing after r261986
https://bugs.webkit.org/show_bug.cgi?id=212194

Unreviewed gardening.

* platform/gtk/TestExpectations:

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

5 months agoArray.prototype.concat is incorrect with objects whose "length" exceeds 2 ** 32 - 1
shvaikalesh@gmail.com [Thu, 21 May 2020 08:41:21 +0000 (08:41 +0000)]
Array.prototype.concat is incorrect with objects whose "length" exceeds 2 ** 32 - 1
https://bugs.webkit.org/show_bug.cgi?id=212167

Reviewed by Saam Barati.

JSTests:

* stress/array-prototype-concat-of-long-spliced-arrays.js:
* stress/array-prototype-concat-of-long-spliced-arrays2.js:
* test262/expectations.yaml: Mark 4 test cases as passing.

Source/JavaScriptCore:

This patch increases "length" limit of Array.prototype.concat result to @MAX_SAFE_INTEGER
and changes thrown error to TypeError, aligning JSC with the spec [1], V8, and SpiderMonkey.

Also, adds missing @MAX_SAFE_INTEGER overflow check in Array.from [2] (we implement similar
checks in other methods). SunSpider and microbenchmarks/concat-append-one.js are both neutral.

[1]: https://tc39.es/ecma262/#sec-array.prototype.concat (steps 5.c.iii, 5.d.ii)
[2]: https://tc39.es/ecma262/#sec-array.from (step 5.e.i)

* builtins/ArrayConstructor.js:
(from):
* builtins/ArrayPrototype.js:
(globalPrivate.concatSlowPath):

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

5 months ago[GStreamer][GTK][WPE] Expose and honor the media content types requiring hardware...
eocanha@igalia.com [Thu, 21 May 2020 07:47:05 +0000 (07:47 +0000)]
[GStreamer][GTK][WPE] Expose and honor the media content types requiring hardware support setting
https://bugs.webkit.org/show_bug.cgi?id=211950

Reviewed by Adrian Perez de Castro.

Source/WebCore:

Provide the needed information about media content types requiring hardware support
when asking the MediaPlayer about what types are supported. This was already being done
from HTMLMediaElement for player selection, but not in MediaSource nor in
MediaSource::addSourceBuffer() when the webpage used the MSE API to check type support.
In order to ask for the mediaContentTypesRequiringHardwareSupport setting we need a
reference to the current Document in all the places where we need to check type support.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::addSourceBuffer): Provide hardware content types extra info.
(WebCore::MediaSource::isTypeSupported): Get hardware content types extra info from
ScriptExecutionContext and provide it to a new refactored private version of
isTypeSupported() which can also be reused from addSourceBuffer().
* Modules/mediasource/MediaSource.h: Changed isTypeSupported() prototype to take
ScriptExecutionContext and added a new overloaded version of the method.
* Modules/mediasource/MediaSource.idl: isTypeSupported() now provides a reference to
ScriptExecutionContext. It's the only way to access the required document settings from a
static method.
* platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::isContentTypeSupported const): Factor ContentType
discrimination logic common to MediaPlayerPrivateGStreamer and
MediaPlayerPrivateGStreamerMSE.
* platform/graphics/gstreamer/GStreamerRegistryScanner.h: Added new method.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::supportsType): Provide hardware content types extra
info when asking for type support.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsType): Ditto.

Source/WebKit:

Expose mediaContentTypesRequiringHardwareSupport as a setting on WPE and WebKitGTK.

* UIProcess/API/glib/WebKitSettings.cpp:
(_WebKitSettingsPrivate::_WebKitSettingsPrivate):
(webKitSettingsSetProperty):
(webKitSettingsGetProperty):
(webkit_settings_class_init):
(webkit_settings_get_media_content_types_requiring_hardware_support):
(webkit_settings_set_media_content_types_requiring_hardware_support):
* UIProcess/API/gtk/WebKitSettings.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/wpe/WebKitSettings.h:
* UIProcess/API/wpe/docs/wpe-1.0-sections.txt:

Tools:

Exercise the new mediaContentTypesRequiringHardwareSupport setting.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp:
(testWebKitSettings):

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

5 months ago[macOS] Scrolling synchronization part 1: Have the scrolling thread wait half a frame...
simon.fraser@apple.com [Thu, 21 May 2020 06:47:24 +0000 (06:47 +0000)]
[macOS] Scrolling synchronization part 1: Have the scrolling thread wait half a frame for the main thread to complete the rendering update
https://bugs.webkit.org/show_bug.cgi?id=212168

Reviewed by Tim Horton.

Source/WebCore:

Currently the scrolling thread is a free-running thread that moves layers around in response
to wheel events, and asynchronously posts data about scrolled layers back to the main thread.
That results in an almost guaranteed lack of synchronization between the displayed layer
positions, and the web-exposed values for scroll position (element.scrollTop, window.pageYOffset etc).
This is a frequent source of stuttering or jumpy web content when scrolling.

The first step to fixing this is to synchronize the scrolling thread layer positions
and the main thread state for the case where the main thread is responsive enough to
render once per frame. This is achieved as follow:
    - When the main thread is starting a rendering update, Page::updateRendering() informs
      the scrolling tree via ScrollingCoordinatorMac::willStartRenderingUpdate(). This
      atomically waits for the scrolling thread to take the m_treeMutex (via a BinarySemaphore)
      and starts waiting on the m_stateCondition Condition. Now the main thread pulls the
      state of the scrolling tree via synchronizeStateFromScrollingTree() and uses it for
      the rendering update.
    - If the rendering update finishes within half a frame (8ms), then m_stateCondition
      is released, and the scrolling thread assumes that the main thread is going to
      commit layers rapidly enough to preserve 60fps scrolling.
    - If the rendering update takes too long, m_stateCondition times out, and the scrolling
      thread applies layer positions, triggering a CA commit on that thread.

We no longer apply layer positions directly when handling wheel events.

synchronizeStateFromScrollingTree() has to only pull state from nodes that have moved on the scrolling thread,
so track that via ScrollingTreeScrollingNode::scrolledSinceLastCommit() and adjust the visitor function to
make it available during scrolling tree traversal.

* page/Page.cpp:
(WebCore::Page::updateRendering):
(WebCore::Page::finalizeRenderingUpdate):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::synchronizeStateFromScrollingTree):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::willStartRenderingUpdate):
(WebCore::ScrollingCoordinator::didCompleteRenderingUpdate):
(WebCore::ScrollingCoordinator::synchronizeStateFromScrollingTree): Deleted.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
(WebCore::ScrollingTree::traverseScrollingTreeRecursive):
(WebCore::ScrollingTree::commitTreeState):
(WebCore::ScrollingTree::updateTreeFromStateNodeRecursive):
(WebCore::ScrollingTree::applyLayerPositionsInternal):
(WebCore::ScrollingTree::nominalFramesPerSecond):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeNode.h:
(WebCore::ScrollingTreeNode::didCompleteCommitForNode):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::didCompleteCommitForNode):
(WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::willStartRenderingUpdate):
(WebCore::ThreadedScrollingTree::maxAllowableRenderingUpdateDurationForSynchronization):
(WebCore::ThreadedScrollingTree::waitForRenderingUpdateCompletionOrTimeout):
(WebCore::ThreadedScrollingTree::didCompleteRenderingUpdate):
(WebCore::ThreadedScrollingTree::displayDidRefreshOnScrollingThread):
* page/scrolling/ThreadedScrollingTree.h:
(WebCore::ThreadedScrollingTree::treeMutex):
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::willStartRenderingUpdate):
(WebCore::ScrollingCoordinatorMac::didCompleteRenderingUpdate):

Source/WTF:

Some new trace points for scrolling thread activity.

* wtf/SystemTracing.h:

Tools:

Some new trace points for scrolling thread activity.

* Tracing/SystemTracePoints.plist:

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

5 months agoREGRESSION (iOS 13.4.1): SpeechSynthesisUtterance.onend event won't fire on cancel().
cfleizach@apple.com [Thu, 21 May 2020 05:46:51 +0000 (05:46 +0000)]
REGRESSION (iOS 13.4.1): SpeechSynthesisUtterance.onend event won't fire on cancel().
https://bugs.webkit.org/show_bug.cgi?id=211776
<rdar://problem/63130249>

Reviewed by Per Arne Vollan.

With the move to having speech synthesis happen in the client, the cancel case hits a snag.
We cancel the speech job and clear out the current utterance. By the time the cancel callback comes back,
the current utterance is gone and nothing happens.

The fix is to process the speechError event immediately and not wait on the speech synthesizer -- which seems sane,
since we're just cancelling a speech job.

* Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::cancel):

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

5 months ago[WinCairo] Unreviewed test gardening
Hironori.Fujii@sony.com [Thu, 21 May 2020 04:16:37 +0000 (04:16 +0000)]
[WinCairo] Unreviewed test gardening

* platform/wincairo/TestExpectations:
* platform/wincairo/css1/text_properties/text_indent-expected.txt:
* platform/wincairo/css2.1/20110323/margin-applies-to-006-expected.txt:
* platform/wincairo/css2.1/t1601-c547-indent-01-d-expected.txt:
* platform/wincairo/editing/selection/mixed-editability-10-expected.txt:
* platform/wincairo/fast/css/font-weight-1-expected.txt:
* platform/wincairo/fast/text/atsui-spacing-features-expected.txt:
* platform/wincairo/fast/text/crash-complex-text-surrogate-expected.txt:
* platform/wincairo/fast/text/hyphenate-limit-lines-expected.txt:
* platform/wincairo/fast/text/international/hindi-whitespace-expected.txt:
* platform/wincairo/fast/text/midword-break-before-surrogate-pair-2-expected.txt:
* platform/wincairo/fast/text/whitespace/pre-break-word-expected.txt:
* platform/wincairo/fast/text/word-break-expected.txt:

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

5 months ago[Win] Unreviewed test gardening.
zalan@apple.com [Thu, 21 May 2020 02:54:03 +0000 (02:54 +0000)]
[Win] Unreviewed test gardening.

* platform/win/TestExpectations:

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

5 months agoDictation context should be an object identifier, not a type-punned pointer
darin@apple.com [Thu, 21 May 2020 01:59:23 +0000 (01:59 +0000)]
Dictation context should be an object identifier, not a type-punned pointer
https://bugs.webkit.org/show_bug.cgi?id=212174

Reviewed by Anders Carlsson.

Source/WebCore:

* Headers.cmake: Added DictationContext.h.
* Sources.txt: Removed DictationAlternative.cpp.
* WebCore.xcodeproj/project.pbxproj: Added DictationContext.h, removed DictationAlternative.cpp.

* dom/DocumentMarker.h: Use DictationContext instead of uint64_t.
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::timerFired): Ditto.
* editing/AlternativeTextController.h: Ditto.

* editing/DictationAlternative.h: Use DictationContext instead of uint64_t, but also
use CharacterRange rather than two "unsigned" values. Also convert into a simple
struct without constructors; don't really need those.

* editing/DictationAlternative.cpp: Removed.

* editing/DictationCommand.cpp:
(WebCore::DictationCommand::collectDictationAlternativesInRange): Updated for
changes to DictationAlternative.

* editing/DictationContext.h: Added.

* editing/Editor.h: Forward declare DictationAlternative rather than including
its header.

* editing/cocoa/AlternativeTextContextController.h: Use a pair of maps to bind NSTextAlternatives
objects to object identifiers. Remove unnecessary explicit constructor and destructor. Also removed
unnecessary use of WTF_MAKE_FAST_ALLOCATED, since this is only used as a data member of another
class. Removed unused invalidContext constant.
* editing/cocoa/AlternativeTextContextController.mm: Removed the unneeded includes.
This file treats NSTextAlternatives as an opaque Objective-C type and so doesn't need
any details of that class.
(WebCore::AlternativeTextContextController::addAlternatives): Changed to return a
DictationContext and use two maps, using HashMap::ensure to avoid double hashing.
(WebCore::AlternativeTextContextController::alternativesForContext): Added a null check.
(WebCore::AlternativeTextContextController::removeAlternativesForContext): Ditto. Also
updated to remove from both maps.
(WebCore::AlternativeTextContextController::clear): Clear both maps.

* editing/cocoa/AlternativeTextUIController.h: Since this header is used only from Objective-C,
removed use of OBJC_CLASS. Put showAlternatives inside a macOS-specific block. Use DictationContext
instead of uint64_t.
* editing/cocoa/AlternativeTextUIController.mm:
(WebCore::AlternativeTextUIController::addAlternatives): Use DictationContext instead of uint64_t.
(WebCore::AlternativeTextUIController::alternativesForContext): Ditto.
(WebCore::AlternativeTextUIController::showAlternatives): Ditto.
(WebCore::AlternativeTextUIController::handleAcceptedAlternative): Ditto.
(WebCore::AlternativeTextUIController::removeAlternatives): Ditto.

* page/AlternativeTextClient.h: Use DictationContext instead of uint64_t.

Source/WebKit:

* Scripts/webkit/messages.py: Added DictationContext to the list of types that are
not C++ classes.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<DictationAlternative>::encode): Updated for change to
DictationAlternative structure.
(IPC::ArgumentCoder<DictationAlternative>::decode): Ditto.

* UIProcess/Cocoa/PageClientImplCocoa.h: Use DictationContext instead of uint64_t.
* UIProcess/Cocoa/PageClientImplCocoa.mm:
(WebKit::PageClientImplCocoa::addDictationAlternatives): Ditto.
(WebKit::PageClientImplCocoa::removeDictationAlternatives): Ditto.
(WebKit::PageClientImplCocoa::dictationAlternatives): Ditto.
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::insertDictatedTextAsync): Ditto.
* UIProcess/PageClient.h: Ditto.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showDictationAlternativeUI): Ditto.
(WebKit::WebPageProxy::removeDictationAlternatives): Ditto.
(WebKit::WebPageProxy::dictationAlternatives): Ditto.
* UIProcess/WebPageProxy.h: Ditto.
* UIProcess/WebPageProxy.messages.in: Ditto.
* UIProcess/ios/PageClientImplIOS.h: Ditto.
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::showDictationAlternativeUI): Ditto.
* UIProcess/mac/PageClientImplMac.h: Ditto.
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::showDictationAlternativeUI): Ditto.

* UIProcess/mac/WebPageProxyMac.mm: Removed unneeded include of
DictationAlternative.h.

* WebProcess/WebCoreSupport/WebAlternativeTextClient.h: Use DictationContext
instead of uint64_t. Also marked class final and made everything private.
* WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp:
(WebKit::WebAlternativeTextClient::removeDictationAlternatives): Ditto.
(WebKit::WebAlternativeTextClient::showDictationAlternativeUI): Ditto.
(WebKit::WebAlternativeTextClient::dictationAlternatives): Ditto.

Source/WebKitLegacy/mac:

* WebCoreSupport/WebAlternativeTextClient.h: Use DictationContext instead of uint64_t.
* WebCoreSupport/WebAlternativeTextClient.mm:
(WebAlternativeTextClient::removeDictationAlternatives): Ditto.
(WebAlternativeTextClient::showDictationAlternativeUI): Ditto.
(WebAlternativeTextClient::dictationAlternatives): Ditto.

* WebView/WebHTMLView.mm: Added include of DictationAlternative.h, now needed because
it's forward declared in Editor.h.
* WebView/WebView.mm: Ditto.
(-[WebView _getWebCoreDictationAlternatives:fromTextAlternatives:]): Updated for change
to DictationAlternative.
(-[WebView _showDictationAlternativeUI:forDictationContext:]): Use DictationContext
instead of uint64_t.
(-[WebView _removeDictationAlternatives:]): Ditto.
(-[WebView _dictationAlternatives:]): Ditto.
* WebView/WebViewInternal.h: Updated for the above.

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

5 months ago[LFC][TFC] Preferred width computation should take border collapsing into account
zalan@apple.com [Thu, 21 May 2020 01:58:33 +0000 (01:58 +0000)]
[LFC][TFC] Preferred width computation should take border collapsing into account
https://bugs.webkit.org/show_bug.cgi?id=212141

Reviewed by Antti Koivisto.

Source/WebCore:

Test: fast/layoutformattingcontext/table-simple-border-collapse2.html

* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns):
* layout/tableformatting/TableFormattingContext.h:
(WebCore::Layout::TableFormattingContext::Geometry::Geometry):
* layout/tableformatting/TableFormattingContextGeometry.cpp:
(WebCore::Layout::TableFormattingContext::Geometry::intrinsicWidthConstraintsForCell):

LayoutTests:

* fast/layoutformattingcontext/table-simple-border-collapse2-expected.html: Added.
* fast/layoutformattingcontext/table-simple-border-collapse2.html: Added.

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

5 months agoRepaint issues when the login field collapses on music.apple.com
zalan@apple.com [Thu, 21 May 2020 01:44:12 +0000 (01:44 +0000)]
Repaint issues when the login field collapses on music.apple.com
https://bugs.webkit.org/show_bug.cgi?id=212101
<rdar://problem/62874369>

Reviewed by Simon Fraser.

Source/WebCore:

RenderWidgets (e.g iframe) are painted on integral pixel boundaries. When we issue the repaints on such renderers, we need to
make sure that the repaint rectangles are also snapped to integral pixel values.
Currently trunk only covers the case when the renderer itself is positioned on a subpixel position (e.g when the containing block's content box has a non-integral position value).
This patch ensures that we repaint the RenderWidgets properly when a non-direct ancestor puts the renderer on a subpixel position.

Test: fast/repaint/iframe-on-subpixel-position.html

* page/FrameView.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeVisibleRectInContainer const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::setContentsNeedDisplay):
(WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
* rendering/RenderObject.h:
* testing/Internals.cpp:
(WebCore::Internals::enableSubframeRepaintTracking): add subframe repaint tracking
(WebCore::Internals::disableSubframeRepaintTracking):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* fast/repaint/iframe-on-subpixel-position-expected.txt: Added.
* fast/repaint/iframe-on-subpixel-position.html: Added.

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

5 months agoWKMouseGestureRecognizer should be implemented without using UIKit internals
timothy_horton@apple.com [Thu, 21 May 2020 01:19:54 +0000 (01:19 +0000)]
WKMouseGestureRecognizer should be implemented without using UIKit internals
https://bugs.webkit.org/show_bug.cgi?id=212173
<rdar://problem/61163726>

Reviewed by Wenson Hsieh.

Source/WebKit:

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView gestureRecognizer:shouldReceiveTouch:]):
* UIProcess/ios/WKMouseGestureRecognizer.h:
* UIProcess/ios/WKMouseGestureRecognizer.mm:
(-[WKMouseGestureRecognizer _hoverEntered:withEvent:]):
(-[WKMouseGestureRecognizer initWithTarget:action:]): Deleted.
(-[WKMouseGestureRecognizer setView:]): Deleted.
(-[WKMouseGestureRecognizer _wantsHoverEvents]): Deleted.
(-[WKMouseGestureRecognizer canPreventGestureRecognizer:]): Deleted.
(-[WKMouseGestureRecognizer canBePreventedByGestureRecognizer:]): Deleted.
Reimplement WKMouseGestureRecognizer as a UIHoverGestureRecognizer subclass,
so we can decouple ourselves a bit from UIKit internals.

Source/WTF:

* wtf/PlatformHave.h:

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

5 months ago[iOS] Fix message filter sandbox violation
pvollan@apple.com [Thu, 21 May 2020 00:52:35 +0000 (00:52 +0000)]
[iOS] Fix message filter sandbox violation
https://bugs.webkit.org/show_bug.cgi?id=212100
<rdar://problem/63407155>

Reviewed by Brent Fulgham.

A message needs to be added to the message filter in the WebContent sandbox on iOS.

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

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

5 months agoOES_texture_half_float_linear unavailable on WebGL 1.0 on iOS with ANGLE
dino@apple.com [Thu, 21 May 2020 00:35:02 +0000 (00:35 +0000)]
OES_texture_half_float_linear unavailable on WebGL 1.0 on iOS with ANGLE
https://bugs.webkit.org/show_bug.cgi?id=212170

Patch by Kenneth Russell <kbr@chromium.org> on 2020-05-20
Reviewed by Dean Jackson.

Source/ThirdParty/ANGLE:

Now that FP16 luminance/alpha texture formats are correctly
emulated on ES 3.0, advertise them as filterable.

* src/libANGLE/renderer/gl/formatutilsgl.cpp:
(rx::nativegl::BuildInternalFormatInfoMap):

LayoutTests:

Remove failure expectation for oes-texture-half-float-linear.html
in the WebGL 2.0 conformance suite.

* platform/ios-simulator/webgl/2.0.0/conformance/extensions/oes-texture-half-float-linear-expected.txt: Removed.

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

5 months agoOES_texture_float / OES_texture_half_float unavailable in WebGL 1.0 on iOS Simulator...
commit-queue@webkit.org [Thu, 21 May 2020 00:16:47 +0000 (00:16 +0000)]
OES_texture_float / OES_texture_half_float unavailable in WebGL 1.0 on iOS Simulator with ANGLE
https://bugs.webkit.org/show_bug.cgi?id=210524

Patch by Kenneth Russell <kbr@chromium.org> on 2020-05-20
Reviewed by Dean Jackson.

Source/ThirdParty/ANGLE:

Emulate LUMINANCE, ALPHA and LUMINANCE_ALPHA floating-point
textures on top of RED / RG textures when the underlying
OES_texture_float/half_float OpenGL ES extensions are unavailable.

This makes the conformance/extensions/oes-texture{-half}-float*
tests run and pass in the iOS Simulator.

This change is being reviewed upstream in the ANGLE repository and
is only being uploaded here for testing purposes. It will be
rolled in with the next ANGLE update.

* src/libANGLE/renderer/gl/TextureGL.cpp:
(rx::TextureGL::setSwizzle):
* src/libANGLE/renderer/gl/formatutilsgl.cpp:
(rx::nativegl::BuildInternalFormatInfoMap):
(rx::nativegl::IsLUMAFormat):
(rx::nativegl::EmulateLUMAFormat):
(rx::nativegl::EmulateLUMA):
(rx::nativegl::GetNativeInternalFormat):
(rx::nativegl::GetNativeFormat):
(rx::nativegl::GetNativeType):
(rx::nativegl::GetTexImageFormat):
(rx::nativegl::GetTexSubImageFormat):

LayoutTests:

Remove expected failure for
webgl/2.0.0/conformance/extensions/oes-texture-float-expected.txt
on ios-simulator. Enable
fast/canvas/webgl/oes-texture-half-float-uint16.html on iOS.

* platform/ios-simulator/webgl/2.0.0/conformance/extensions/oes-texture-float-expected.txt: Removed.
* platform/ios/TestExpectations:

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

5 months agoComputed min-width/height for auto depends on box
obrufau@igalia.com [Thu, 21 May 2020 00:12:45 +0000 (00:12 +0000)]
Computed min-width/height for auto depends on box
https://bugs.webkit.org/show_bug.cgi?id=209651

Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

Update test expectations.

* web-platform-tests/css/css-flexbox/getcomputedstyle/flexbox_computedstyle_min-auto-size-expected.txt:
* web-platform-tests/css/css-grid/grid-items/grid-item-min-auto-size-001-expected.txt:

Source/WebCore:

Resolved value of min-width and min-height for auto min sizing of flex
and grid items may be 'auto'. We based this on the computed style of the
shadow including parent. Instead we should rely on whether the element
will actually be a rendered flex/grid item.

The difference matters e.g. when the parent has 'display: contents' and
thus is not a flex nor grid container, but the element can still be a
flex or grid item, depending on the grand-parent.

This patch is based on https://crrev.com/540901 from Chromium.

Tests: imported/w3c/web-platform-tests/css/css-flexbox/getcomputedstyle/flexbox_computedstyle_min-auto-size.html
       imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-min-auto-size-001.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::isFlexOrGridItem):
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):

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

5 months ago(r261946) [ iOS ] fast/frames/didBecomeCurrentDocumentInFrame-crash.html is failing
cdumez@apple.com [Thu, 21 May 2020 00:02:31 +0000 (00:02 +0000)]
(r261946) [ iOS ] fast/frames/didBecomeCurrentDocumentInFrame-crash.html is failing
https://bugs.webkit.org/show_bug.cgi?id=212179
<rdar://problem/63469486>

Unreviewed, add testRunner.dumpAsText() call in the test to get nicer expected
result.

* fast/frames/didBecomeCurrentDocumentInFrame-crash-expected.txt:
* fast/frames/didBecomeCurrentDocumentInFrame-crash.html:
* platform/win/fast/frames/didBecomeCurrentDocumentInFrame-crash-expected.txt: Removed.

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

5 months ago[iOS] Layout tests in editing/pasteboard sporadically crash
wenson_hsieh@apple.com [Wed, 20 May 2020 23:42:20 +0000 (23:42 +0000)]
[iOS] Layout tests in editing/pasteboard sporadically crash
https://bugs.webkit.org/show_bug.cgi?id=212169
<rdar://problem/63361966>

Reviewed by Tim Horton.

Add some missing entitlements.

* TestWebKitAPI/Configurations/TestWebKitAPI-iOS.entitlements:
* WebKitTestRunner/Configurations/WebKitTestRunnerApp-iOS.entitlements:

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

5 months agoDisable support for BeforeLoadEvent
ryanhaddad@apple.com [Wed, 20 May 2020 23:38:32 +0000 (23:38 +0000)]
Disable support for BeforeLoadEvent
https://bugs.webkit.org/show_bug.cgi?id=212140

Unreviewed test gardening.

Update baselines for Windows.

* platform/win/fast/events/event-attribute-expected.txt:
* platform/win/fast/frames/didBecomeCurrentDocumentInFrame-crash-expected.txt: Added.

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

5 months ago[macOS] Tests in fast/events and fast/forms are no longer crashing
mmaxfield@apple.com [Wed, 20 May 2020 23:34:50 +0000 (23:34 +0000)]
[macOS] Tests in fast/events and fast/forms are no longer crashing
https://bugs.webkit.org/show_bug.cgi?id=212164
<rdar://problem/33522420>

Unreviewed.

* platform/mac-wk1/TestExpectations:

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

5 months agoplatform/mac/media/media-source/media-source-change-source.html is a flaky failure
ryanhaddad@apple.com [Wed, 20 May 2020 23:30:34 +0000 (23:30 +0000)]
platform/mac/media/media-source/media-source-change-source.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=212091

Unreviewed test gardening.

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

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

5 months agoRemove implicit URL->String conversion operators
commit-queue@webkit.org [Wed, 20 May 2020 22:59:51 +0000 (22:59 +0000)]
Remove implicit URL->String conversion operators
https://bugs.webkit.org/show_bug.cgi?id=211033

Patch by Alex Christensen <achristensen@webkit.org> on 2020-05-20
Reviewed by Darin Adler.

Source/WebCore:

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::stringValueForMSAA const):
* html/DOMURL.cpp:
(WebCore::DOMURL::create):
* html/HTMLPlugInElement.cpp:
(WebCore::pluginReplacementForType):
* html/URLUtils.h:
(WebCore::URLUtils<T>::protocol const):
(WebCore::URLUtils<T>::setUsername):
(WebCore::URLUtils<T>::setPassword):
* page/Location.cpp:
(WebCore::Location::setProtocol):
(WebCore::Location::setHost):
(WebCore::Location::setHostname):
(WebCore::Location::setPort):
(WebCore::Location::setPathname):
(WebCore::Location::setSearch):
(WebCore::Location::setHash):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::load):

Source/WebKitLegacy/mac:

* DOM/DOMHTMLBaseElement.mm:
(-[DOMHTMLBaseElement href]):

Source/WTF:

These operators have been the cause of many subtle bugs related to type inference that are hard to see in the code,
as well as performance bugs where we unnecessarily re-parse parsed URLs.
After my recent cleanup this was easier than I thought it would be.

* wtf/URL.h:
(WTF::URL::operator const String& const): Deleted.
(WTF::URL::operator StringView const): Deleted.
(WTF::URL::operator NSString * const): Deleted.

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

5 months agoReplace Color::getHSL() with sRGBToHSL to ensure it at least gives somewhat sensible...
weinig@apple.com [Wed, 20 May 2020 22:54:11 +0000 (22:54 +0000)]
Replace Color::getHSL() with sRGBToHSL to ensure it at least gives somewhat sensible results for ExtendedColors and reduce code duplication
https://bugs.webkit.org/show_bug.cgi?id=212143

Reviewed by Simon Fraser.

Source/WebCore:

- Updated API tests to test sRGBToHSL() rather than Color::getHSL() and extended the tests
  to include lightness tests and round tripping tests.
- Update editing/pasteboard/paste-dark-mode-color-filtered.html with extended color test cases.

Replaces Color::getHSL() with sRGBToHSL(color.toSRGBAComponentsLossy()) and adds
an optimized variant, lightness(...) that just extracts the lightness component for
callers that only needed that.

It is now required to explicitly use color.toSRGBAComponentsLossy() to indicate that
for non-SRGB colors, this will be a lossy transformation and give us an easy way to
find all these sites in the future, if we want to make a better conversion for other
color spaces.

* editing/ReplaceSelectionCommand.cpp:
(WebCore::fragmentNeedsColorTransformed):
Switch to using lightness(). This was previously broken for extended colors but now works (though
in a lossy way through sRGB). Update editing/pasteboard/paste-dark-mode-color-filtered.html with extended colors.

* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::detectContentInRange):
Switch to using sRGBToHSL(color.toSRGBAComponentsLossy()).

* page/FrameView.cpp:
(WebCore::FrameView::recalculateScrollbarOverlayStyle):
Switch to using lightness().

* platform/graphics/Color.cpp:
(WebCore::Color::getHSL const): Deleted.
* platform/graphics/Color.h:
Remove Color::getHSL().

* platform/graphics/ColorUtilities.cpp:
(WebCore::lightness):
Added optimized subset of sRGBToHSL which just computes the lightness component for callers
that only need that.

(WebCore::sRGBToHSL):
Simplify/cleanup code a little using initialize-list based std::max/std::min and structured bindings.

* platform/graphics/ColorUtilities.h:
Export functions to allow testing them directly.

Source/WebKit:

* UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _updateScrollViewBackground]):
Switch to using Color::lightness().

Tools:

* TestWebKitAPI/Tests/WebCore/ColorTests.cpp:
(TestWebKitAPI::TEST):
Update tests to use sRGBToHSL instead of Color::getHSL() and add testing of WebCore::lightness() and
round tripping. Update results for hue to be 0->1 rather than 0->6 which allows the round tripping to succeed.

LayoutTests:

* editing/pasteboard/paste-dark-mode-color-filtered-expected.txt:
* editing/pasteboard/paste-dark-mode-color-filtered.html:
Update test to include a test case that uses extended colors.

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

5 months agoHide password echo when screen is being captured.
megan_gardner@apple.com [Wed, 20 May 2020 22:33:59 +0000 (22:33 +0000)]
Hide password echo when screen is being captured.
https://bugs.webkit.org/show_bug.cgi?id=212060
<rdar://problem/47653578>

Reviewed by Wenson Hsieh.

Source/WebCore:

When the screen is being captured, turn off the password echo.

* editing/InsertIntoTextNodeCommand.cpp:
(WebCore::InsertIntoTextNodeCommand::doApply):
* page/EditorClient.h:
(WebCore::EditorClient::isScreenCaptured const):

Source/WebKit:

Use the UIScreen state and notification to determine if the
screen is being shared or captured. This flag is for all
capture methods, Air Play, Screen Recording, etc. If the screen is
being captured, turn off the password echo to prevent the password from
being leaked.

* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):
(-[WKContentView _screenCapturedDidChange:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setIsScreenCaptured):
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
(WebKit::WebEditorClient::isScreenCaptured const):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::isScreenCaptured const):
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::setIsScreenCaptured):

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

5 months ago[GTK] Implement connected and disconnected events of GAMEPAD API with libmanette
changseok@webkit.org [Wed, 20 May 2020 22:33:35 +0000 (22:33 +0000)]
[GTK] Implement connected and disconnected events of GAMEPAD API with libmanette
https://bugs.webkit.org/show_bug.cgi?id=133854

Reviewed by Carlos Garcia Campos.

This patch brings initial GAMEPAD API support to the gtk port. We use libmanette,
a simple GObject game controller library to handle gamepad connection and input.
.:

* Source/cmake/FindManette.cmake: Added to detect libmanette headers and libs installed in host system.
* Source/cmake/OptionsGTK.cmake: Added a private flag, ENABLE_GAMEPAD.
  Once libmanette is found, we expose another build flag, USE_MANETTE for other ports.

Source/WebCore:

This change aims to implement two GAMEPAD API events: 'gamepadconnected' and 'gamepaddisconnected'
on top of libmanette. Rest of API will be implemented by following patches.

No new tests since existing tests can cover this change.

* PlatformGTK.cmake: Add header & library paths for libmanette.
* SourcesGTK.txt:
* platform/gamepad/manette/GUniquePtrManette.h: Added to define a smart pointer for ManetteMonitor.
* platform/gamepad/manette/ManetteGamepad.cpp: Added. A wrapper class for ManetteDevice.
  A ManetteGamepad instance is created per a physically connected gamepad. Currently,
  it is empty but input handling login will be placed in this class.
(WebCore::ManetteGamepad::ManetteGamepad):
* platform/gamepad/manette/ManetteGamepad.h: Added.
* platform/gamepad/manette/ManetteGamepadProvider.cpp: Added. A manager class
  for ManetteGamepad instances. This class represents ManetteMonitor that
  handles connection and disconnection of gamepads. Many parts of this class implementation
  is brought from HIDGamepad.cpp
(WebCore::ManetteGamepadProvider::singleton):
(WebCore::onDeviceConnected):
(WebCore::onDeviceDisconnected):
(WebCore::ManetteGamepadProvider::ManetteGamepadProvider):
(WebCore::ManetteGamepadProvider::startMonitoringGamepads):
(WebCore::ManetteGamepadProvider::stopMonitoringGamepads):
(WebCore::ManetteGamepadProvider::deviceConnected):
(WebCore::ManetteGamepadProvider::deviceDisconnected):
(WebCore::ManetteGamepadProvider::indexForNewlyConnectedDevice):
(WebCore::ManetteGamepadProvider::connectionDelayTimerFired):
(WebCore::ManetteGamepadProvider::removeGamepadForDevice):
* platform/gamepad/manette/ManetteGamepadProvider.h: Added.

Source/WebKit:

* SourcesGTK.txt:
* UIProcess/Gamepad/UIGamepadProvider.cpp: Add a build flag to void default interface
* UIProcess/Gamepad/gtk/UIGamepadProviderGtk.cpp: Added to retrieve WebPageProxy to which
  a gamepad connects. The returned WebPageProxy handles input events from the gamepad.
(WebKit::getWebPageProxy):
(WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput):
* UIProcess/Gamepad/manette/UIGamepadProviderManette.cpp: Added.
(WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider):
(WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput):
(WebKit::UIGamepadProvider::platformStopMonitoringInput):
(WebKit::UIGamepadProvider::platformStartMonitoringInput):

Tools:

In particular, we use libmanette-0.2.4 which is the latest version and minimum
version to build in c++.

* gtk/jhbuild.modules:

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

5 months agoSupport operating dates in ResourceLoadStatisticsDatabaseStore
katherine_cheney@apple.com [Wed, 20 May 2020 22:14:13 +0000 (22:14 +0000)]
Support operating dates in ResourceLoadStatisticsDatabaseStore
https://bugs.webkit.org/show_bug.cgi?id=212034
<rdar://problem/63349242>

Reviewed by Brent Fulgham.

Source/WebKit:

Tests: http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-database.html
       http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed.html
       http/tests/resourceLoadStatistics/operating-dates-all-website-data-removed-database.html
       http/tests/resourceLoadStatistics/operating-dates-all-website-data-removed.html

Patch to support Operating Dates in the ResourceLoadStatisticsDatabaseStore.
Moves functions out of ResourceLoadStatisticsStore now that each store
needs its own implementation.

Adds a new function for testing which inserts an expired statistic
and makes sure the proper behavior occurs depending on additional
parameters.

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::createTableQueries):
(WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
(WebKit::ResourceLoadStatisticsDatabaseStore::checkForMissingTablesInSchema):
(WebKit::ResourceLoadStatisticsDatabaseStore::createUniqueIndices):
(WebKit::ResourceLoadStatisticsDatabaseStore::createSchema):
(WebKit::ResourceLoadStatisticsDatabaseStore::getLeastRecentOperatingDate):
(WebKit::ResourceLoadStatisticsDatabaseStore::mergeOperatingDates):
(WebKit::ResourceLoadStatisticsDatabaseStore::includeTodayAsOperatingDateIfNecessary):
(WebKit::ResourceLoadStatisticsDatabaseStore::hasStatisticsExpired const):
(WebKit::ResourceLoadStatisticsDatabaseStore::insertExpiredStatisticForTesting):
Migrated Operating Dates functions from ResourceLoadStatisticsStore and implemented
them using SQLite instead of a vector. Functionality is
identical to the original in-memory implementation.

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
(WebKit::ResourceLoadStatisticsMemoryStore::mergeOperatingDates):
(WebKit::ResourceLoadStatisticsMemoryStore::includeTodayAsOperatingDateIfNecessary):
(WebKit::ResourceLoadStatisticsMemoryStore::hasStatisticsExpired const):
(WebKit::ResourceLoadStatisticsMemoryStore::insertExpiredStatisticForTesting):
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
Migrated Operating Dates functions from ResourceLoadStatisticsStore
now that the database store does not use them.

* NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
Spelling error.

* NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
(WebKit::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore):
(WebKit::ResourceLoadStatisticsStore::updateCookieBlockingForDomains):
(WebKit::ResourceLoadStatisticsStore::statisticsEpirationTime const): Deleted.
(WebKit::ResourceLoadStatisticsStore::mergeOperatingDates): Deleted.
(WebKit::ResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary): Deleted.
(WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const): Deleted.
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
(WebKit::OperatingDate::year const):
(WebKit::OperatingDate::month const):
(WebKit::OperatingDate::monthDay const):
These functions should be public now that they are needed outside
of this file after migrating OperatingDates functions.

(WebKit::ResourceLoadStatisticsStore::parameters const):
(WebKit::ResourceLoadStatisticsStore::operatingDates const): Deleted.
(WebKit::ResourceLoadStatisticsStore::clearOperatingDates): Deleted.
Moved OperatingDates functions to the memory store. Moved
operatingDatesWindow constexpr variables to the header file so that
the database and memory stores can both use them.

* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::insertExpiredStatisticForTesting):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::insertExpiredStatisticForTesting):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetStatisticsExpiredStatistic):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::insertExpiredStatisticForTesting):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::mergeStatisticForTesting):
(WebKit::WebsiteDataStore::insertExpiredStatisticForTesting):
* UIProcess/WebsiteData/WebsiteDataStore.h:
Function to add expired statistic to the ITP store.

Tools:

Add a testing function to insert an expired statistic.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setStatisticsExpiredStatistic):
(WTR::TestRunner::statisticsCallDidSetExpiredStatisticCallback):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::setStatisticsExpiredStatistic):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
(WTR::TestInvocation::didSetExpiredStatistic):
* WebKitTestRunner/TestInvocation.h:

LayoutTests:

Add tests for memory and database stores.

* http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-database.html: Added.
* http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-expected.txt: Added.
* http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed.html: Added.
* http/tests/resourceLoadStatistics/operating-dates-all-website-data-removed-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/operating-dates-all-website-data-removed-database.html: Added.
* http/tests/resourceLoadStatistics/operating-dates-all-website-data-removed-expected.txt: Added.
* http/tests/resourceLoadStatistics/operating-dates-all-website-data-removed.html: Added.

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

5 months agoWeb Inspector: Left/Right arrow keys should collapse/expand details sections
nvasilyev@apple.com [Wed, 20 May 2020 22:08:13 +0000 (22:08 +0000)]
Web Inspector: Left/Right arrow keys should collapse/expand details sections
https://bugs.webkit.org/show_bug.cgi?id=212064
<rdar://problem/63384091>

Reviewed by Devin Rousso.

* UserInterface/Views/DetailsSection.js:
(WI.DetailsSection):
(WI.DetailsSection.prototype._headerElementClicked):
(WI.DetailsSection.prototype._handleHeaderElementKeyDown):
Use keydown event instead of keypress because the latter doesn't fire for arrow keys.
Drive-by: remove unused `expandedByUser`.
* UserInterface/Views/ExpandableView.js:
(WI.ExpandableView):
(WI.ExpandableView.prototype._handleDisclosureButtonKeyDown):
Computed panel items should also collapse/expand by pressing Left/Right keys.

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

5 months agoPotential crash in PointerCaptureController::cancelPointer()
graouts@webkit.org [Wed, 20 May 2020 21:51:57 +0000 (21:51 +0000)]
Potential crash in PointerCaptureController::cancelPointer()
https://bugs.webkit.org/show_bug.cgi?id=208347
<rdar://problem/59866247>

Reviewed by David Kilzer and Daniel Bates.

* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::cancelPointer):

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

5 months agoDeprecate WKBundlePageSetPolicyClient() Injected bundle C API
cdumez@apple.com [Wed, 20 May 2020 21:33:24 +0000 (21:33 +0000)]
Deprecate WKBundlePageSetPolicyClient() Injected bundle C API
https://bugs.webkit.org/show_bug.cgi?id=212166

Reviewed by Alex Christensen.

Source/WebKit:

Deprecate WKBundlePageSetPolicyClient() Injected bundle C API. Approving navigations from
the injected bundle can lead to WebProcess terminations like in <rdar://problem/60340647>
because the WebProcess is not in a position to do sandbox checks when navigating to file
URLs.

* WebProcess/InjectedBundle/API/c/WKBundlePage.h:

Tools:

* TestWebKitAPI/Tests/WebKitObjC/CustomProtocolsInvalidScheme_Bundle.cpp:
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):

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

5 months agoLayout Test media/video-zoom-controls.html is flaky
jacob_uphoff@apple.com [Wed, 20 May 2020 21:05:46 +0000 (21:05 +0000)]
Layout Test media/video-zoom-controls.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=183424

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

5 months ago[ macOS iOS ] http/tests/resourceLoadStatistics/telemetry-generation-basic-functional...
jacob_uphoff@apple.com [Wed, 20 May 2020 21:00:57 +0000 (21:00 +0000)]
[ macOS iOS ] http/tests/resourceLoadStatistics/telemetry-generation-basic-functionality-database.html is a rare flaky failure
https://bugs.webkit.org/show_bug.cgi?id=212165

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

5 months ago[css-grid] Fix auto repeat with multiple tracks and gutters
obrufau@igalia.com [Wed, 20 May 2020 20:24:52 +0000 (20:24 +0000)]
[css-grid] Fix auto repeat with multiple tracks and gutters
https://bugs.webkit.org/show_bug.cgi?id=182922

Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

Import WPT test.

* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-multiple-values-001-expected.html: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-multiple-values-001.html: Added.
* web-platform-tests/css/css-grid/grid-definition/w3c-import.log:

Source/WebCore:

The code that computes the number of auto repeat tracks wrongly assumes
that the second argument of the repeat() notation is a single track
function. That was true in the beginning, however specs were later on
modified to allow a <track-list>. We support a <track-list> as a second
argument since long ago but the code that computes the number of
auto-repeat tracks was never updated.

This patch modifies two places that relate to the gaps between the
auto-repeat tracks, which ensures the proper total length.

This is a port of https://crrev.com/620278 from Chromium.

Tests: fast/css-grid-layout/grid-auto-repeat-huge-grid.html
       imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-multiple-values-001.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeAutoRepeatTracksCount const):

LayoutTests:

Update test expectations.

* fast/css-grid-layout/grid-auto-repeat-huge-grid.html:

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

5 months agoPlumb the display's nominal refresh rate down to ScrollingTree for use in scroll...
simon.fraser@apple.com [Wed, 20 May 2020 20:23:38 +0000 (20:23 +0000)]
Plumb the display's nominal refresh rate down to ScrollingTree for use in scroll synchronization
https://bugs.webkit.org/show_bug.cgi?id=212159

Reviewed by Tim Horton.

Plumb an Optional<unsigned> down windowScreenDidChange, which contains the nominal
display refresh rate (as frames per second) if available. On macOS, we get this
from CVDisplayLinkGetNominalOutputVideoRefreshPeriod().

To read it, WebProcessPool::nominalFramesPerSecondForDisplay() makes a DisplayLink
that doesn't get any observers, but that DisplayLink will very likely get used
as soon as we schedule a rendering update.

Source/WebCore:

* page/Chrome.cpp:
(WebCore::Chrome::windowScreenDidChange):
* page/Chrome.h:
* page/Page.cpp:
(WebCore::Page::scrollingCoordinator):
(WebCore::Page::windowScreenDidChange):
* page/Page.h:
(WebCore::Page::displayNominalFramesPerSecond const):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::windowScreenDidChange):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::windowScreenDidChange):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::windowScreenDidChange):
* page/scrolling/ScrollingTree.h:
* platform/HostWindow.h:

Source/WebKit:

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::nominalFramesPerSecondForDisplay):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::windowDidChangeScreen):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::windowScreenDidChange):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.h:
* UIProcess/mac/DisplayLink.cpp:
(WebKit::DisplayLink::DisplayLink):
(WebKit::DisplayLink::nominalFramesPerSecond const):
* UIProcess/mac/DisplayLink.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::windowScreenDidChange):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Source/WebKitLegacy/mac:

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

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

5 months agoDisable support for BeforeLoadEvent
cdumez@apple.com [Wed, 20 May 2020 20:14:23 +0000 (20:14 +0000)]
Disable support for BeforeLoadEvent
https://bugs.webkit.org/show_bug.cgi?id=212140
<rdar://problem/62847577>

Reviewed by Antti Koivisto.

Source/WebCore:

Disable support for BeforeLoadEvent. Other browsers do not support it and
Chrome dropped it shortly after the fork:
- https://bugs.chromium.org/p/chromium/issues/detail?id=333318

This is a synchronous event and therefore very dangerous.

Test: fast/frames/didBecomeCurrentDocumentInFrame-crash.html

* bindings/js/WebCoreBuiltinNames.h:
* dom/BeforeLoadEvent.idl:
* dom/Node.cpp:
(WebCore::Node::dispatchBeforeLoadEvent):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setLegacyBeforeLoadEventEnabled):
(WebCore::RuntimeEnabledFeatures::legacyBeforeLoadEventEnabled const):

LayoutTests:

* fast/frames/didBecomeCurrentDocumentInFrame-crash-expected.txt: Added.
* fast/frames/didBecomeCurrentDocumentInFrame-crash.html: Added.
Add layout test coverage for crash in <rdar://problem/62847577>.

* fast/dom/HTMLLinkElement/event-while-removing-attribute-expected.txt:
* fast/dom/HTMLObjectElement/beforeload-set-text-crash-expected.txt: Removed.
* fast/dom/HTMLObjectElement/beforeload-set-text-crash.xhtml: Removed.
* fast/dom/HTMLScriptElement/async-onbeforeload-expected.txt: Removed.
* fast/dom/HTMLScriptElement/async-onbeforeload.html: Removed.
* fast/dom/HTMLScriptElement/defer-onbeforeload-expected.txt: Removed.
* fast/dom/HTMLScriptElement/defer-onbeforeload.html: Removed.
* fast/dom/HTMLScriptElement/move-in-beforeload-expected.txt: Removed.
* fast/dom/HTMLScriptElement/move-in-beforeload.html: Removed.
* fast/dom/HTMLScriptElement/remove-in-beforeload-expected.txt: Removed.
* fast/dom/HTMLScriptElement/remove-in-beforeload.html: Removed.
* fast/dom/beforeload/cached-image-before-load-expected.txt: Removed.
* fast/dom/beforeload/cached-image-before-load.html: Removed.
* fast/dom/beforeload/clear-video-poster-in-beforeload-listener-expected.txt: Removed.
* fast/dom/beforeload/clear-video-poster-in-beforeload-listener.html: Removed.
* fast/dom/beforeload/flash-before-load-expected.txt: Removed.
* fast/dom/beforeload/flash-before-load.html: Removed.
* fast/dom/beforeload/frame-before-load-expected.txt: Removed.
* fast/dom/beforeload/frame-before-load.html: Removed.
* fast/dom/beforeload/image-before-load-expected.txt: Removed.
* fast/dom/beforeload/image-before-load-innerHTML-expected.txt: Removed.
* fast/dom/beforeload/image-before-load-innerHTML.html: Removed.
* fast/dom/beforeload/image-before-load.html: Removed.
* fast/dom/beforeload/image-object-before-load-expected.txt: Removed.
* fast/dom/beforeload/image-object-before-load-innerHTML-expected.txt: Removed.
* fast/dom/beforeload/image-object-before-load-innerHTML.html: Removed.
* fast/dom/beforeload/image-object-before-load.html: Removed.
* fast/dom/beforeload/image-removed-during-before-load-expected.txt: Removed.
* fast/dom/beforeload/image-removed-during-before-load.html: Removed.
* fast/dom/beforeload/link-before-load-expected.txt: Removed.
* fast/dom/beforeload/link-before-load.html: Removed.
* fast/dom/beforeload/pi-before-load-expected.txt: Removed.
* fast/dom/beforeload/pi-before-load.xhtml: Removed.
* fast/dom/beforeload/recursive-css-pi-before-load-expected.txt: Removed.
* fast/dom/beforeload/recursive-css-pi-before-load.html: Removed.
* fast/dom/beforeload/recursive-link-before-load-expected.txt: Removed.
* fast/dom/beforeload/recursive-link-before-load.html: Removed.
* fast/dom/beforeload/recursive-xsl-pi-before-load-expected.txt: Removed.
* fast/dom/beforeload/recursive-xsl-pi-before-load.html: Removed.
* fast/dom/beforeload/remove-bad-object-in-beforeload-listener-expected.txt: Removed.
* fast/dom/beforeload/remove-bad-object-in-beforeload-listener.html: Removed.
* fast/dom/beforeload/remove-flash-in-beforeload-listener-expected.txt: Removed.
* fast/dom/beforeload/remove-flash-in-beforeload-listener.html: Removed.
* fast/dom/beforeload/remove-frame-in-beforeload-listener-expected.txt: Removed.
* fast/dom/beforeload/remove-frame-in-beforeload-listener.html: Removed.
* fast/dom/beforeload/remove-image-in-beforeload-listener-expected.txt: Removed.
* fast/dom/beforeload/remove-image-in-beforeload-listener.html: Removed.
* fast/dom/beforeload/remove-link-in-beforeload-listener-expected.txt: Removed.
* fast/dom/beforeload/remove-link-in-beforeload-listener.html: Removed.
* fast/dom/beforeload/remove-script-in-beforeload-listener-expected.txt: Removed.
* fast/dom/beforeload/remove-script-in-beforeload-listener.html: Removed.
* fast/dom/beforeload/remove-video-in-beforeload-listener-expected.txt: Removed.
* fast/dom/beforeload/remove-video-in-beforeload-listener.html: Removed.
* fast/dom/beforeload/remove-video-poster-in-beforeload-listener-expected.txt: Removed.
* fast/dom/beforeload/remove-video-poster-in-beforeload-listener.html: Removed.
* fast/dom/beforeload/resources/content.xhtml: Removed.
* fast/dom/beforeload/resources/fail.css: Removed.
* fast/dom/beforeload/resources/fail.js: Removed.
* fast/dom/beforeload/resources/pass.css: Removed.
* fast/dom/beforeload/resources/print.js: Removed.
* fast/dom/beforeload/resources/test.xsl: Removed.
* fast/dom/beforeload/script-before-load-dynamic-expected.txt: Removed.
* fast/dom/beforeload/script-before-load-dynamic.html: Removed.
* fast/dom/beforeload/script-before-load-expected.txt: Removed.
* fast/dom/beforeload/script-before-load-xhtml-expected.txt: Removed.
* fast/dom/beforeload/script-before-load-xhtml.xhtml: Removed.
* fast/dom/beforeload/script-before-load.html: Removed.
* fast/dom/beforeload/video-before-load-expected.txt: Removed.
* fast/dom/beforeload/video-before-load.html: Removed.
* fast/events/constructors/before-load-event-constructor-expected.txt: Removed.
* fast/events/constructors/before-load-event-constructor.html: Removed.
* fast/events/event-attribute-expected.txt:
* fast/events/event-handler-regions-layout-expected.txt: Removed.
* fast/events/event-handler-regions-layout.html: Removed.
* fast/frames/crash-display-none-iframe-during-onbeforeload-expected.txt:
* fast/frames/restoring-page-cache-should-not-run-scripts-via-style-update-expected.txt:
* fast/html/link-element-removal-during-beforeload-expected.txt: Removed.
* fast/html/link-element-removal-during-beforeload.html: Removed.
* fast/parser/document-write-fighting-eof-expected.txt: Removed.
* fast/parser/document-write-fighting-eof.html: Removed.
* fast/parser/document-write-partial-entity-before-load-expected.txt: Removed.
* fast/parser/document-write-partial-entity-before-load.html: Removed.
* fast/parser/remove-misnested-iframe-in-beforeload-expected.txt: Removed.
* fast/parser/remove-misnested-iframe-in-beforeload.html: Removed.
* fast/parser/remove-misnested-iframe-parent-in-beforeload-expected.txt: Removed.
* fast/parser/remove-misnested-iframe-parent-in-beforeload.html: Removed.
* fast/replaced/object-param-spaces-expected.txt: Removed.
* fast/replaced/object-param-spaces.html: Removed.
* fast/scrolling/marquee-scroll-crash-expected.txt:
* fast/tokenizer/write-before-load-expected.txt:
* http/tests/security/beforeload-iframe-client-redirect-expected.txt:
* http/tests/security/beforeload-iframe-server-redirect-expected.txt:
* http/tests/security/xssAuditor/object-embed-tag-control-char-expected.txt:
* http/tests/security/xssAuditor/object-embed-tag-control-char.html:
* http/tests/security/xssAuditor/object-embed-tag-expected.txt:
* http/tests/security/xssAuditor/object-embed-tag-null-char-expected.txt:
* http/tests/security/xssAuditor/object-embed-tag-null-char.html:
* http/tests/security/xssAuditor/object-embed-tag.html:
* http/tests/security/xssAuditor/object-src-inject.html:
* http/tests/security/xssAuditor/object-tag-expected.txt:
* http/tests/security/xssAuditor/object-tag-javascript-url-expected.txt:
* http/tests/security/xssAuditor/object-tag-javascript-url.html:
* http/tests/security/xssAuditor/object-tag.html:
* http/tests/security/xssAuditor/resources/echo-intertag.pl:
* http/tests/security/xssAuditor/resources/echo-object-src.pl:
* http/tests/security/xssAuditor/resources/utilities.js:
(notifyDoneAfterReceivingLoaded):
(notifyDoneAfterReceivingBeforeloadFromIds): Deleted.
* plugins/unsupported-plugin-with-replacement-in-iframe-crash-expected.txt:
Update existing tests accordingly.

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

5 months agoRenderObject::VisibleRectContext members should not be prefixed with m_
zalan@apple.com [Wed, 20 May 2020 19:59:53 +0000 (19:59 +0000)]
RenderObject::VisibleRectContext members should not be prefixed with m_
https://bugs.webkit.org/show_bug.cgi?id=212154

Reviewed by Simon Fraser.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::applyCachedClipAndScrollPosition const):
(WebCore::RenderBox::computeVisibleRectInContainer const):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::computeVisibleRectInContainer const):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::computeVisibleRectInContainer const):
* rendering/RenderObject.h:
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computeVisibleRectInContainer const):
* rendering/RenderView.cpp:
(WebCore::RenderView::computeVisibleRectInContainer const):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::computeFloatVisibleRectInContainer const):

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

5 months agoSource/WebCore:
mmaxfield@apple.com [Wed, 20 May 2020 19:19:39 +0000 (19:19 +0000)]
Source/WebCore:
[iPadOS] -webkit-text-size-adjust:percentage doesn't work
https://bugs.webkit.org/show_bug.cgi?id=212122
<rdar://problem/54560875>

Reviewed by Wenson Hsieh.

We've gotten many bug reports that -webkit-text-size-adjust:X% no longer works in
WebKit on iPads. We don't want to just start honoring the value, because our
testing indicates that, with desktop-class browsing on iPad, more sites work better
when we don't honor percentages. However, if Safari is using the mobile content mode,
or if a native app has local content, it should be possible to get the old behavior
of honoring percentages.

This patch adds a new Setting, idempotentModeAutosizingOnlyHonorsPercentages, which
is hooked up to the desktop-class browsing feature. When
WebPageProxy::effectiveContentModeAfterAdjustingPolicies() determines that the
WebContentMode::Mobile mode should be used, it sets the new setting, which
causes idempotent text autosizing mode to have the same behavior that WKWebViews
on iPadOS used to have: -w-t-s-a:auto and -w-t-s-a:none have no effect, but
-w-t-s-a:X% is honored. This affects both Safari and WKWebView apps.

If a native app wants the old behavior, they can set
WKWebpagePreferences.preferredContentMode = WKContentModeMobile to force the old
iPad behavior. It's expected that apps with legacy content would be doing this
anyway.

Tests: fast/text-autosizing/ios/idempotentmode/idempotent-percentage.html
       TestWebKitAPI.PreferredContentMode.IdempotentModeAutosizingOnlyHonorsPercentages

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::applyPoliciesToSettings):
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setIdempotentModeAutosizingOnlyHonorsPercentages):
(WebCore::DocumentLoader::idempotentModeAutosizingOnlyHonorsPercentages const):
* page/Settings.yaml:
* style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjustmentForTextAutosizing):
* style/StyleBuilderCustom.h:
(WebCore::Style::computeBaseSpecifiedFontSize):
* style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::updateFontForTextSizeAdjust):

Source/WebKit:
[iPadOS] -webkit-text-size-adjust:percentage doesn't work in native apps
https://bugs.webkit.org/show_bug.cgi?id=212122
<rdar://problem/54560875>

Reviewed by Wenson Hsieh.

* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::copy const):
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):

Tools:
[iPadOS] -webkit-text-size-adjust:percentage doesn't work in native apps
https://bugs.webkit.org/show_bug.cgi?id=212122
<rdar://problem/54560875>

Reviewed by Wenson Hsieh.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/idempotent-mode-autosizing-only-honors-percentages.html: Added.
* TestWebKitAPI/ios/PreferredContentMode.mm:

LayoutTests:
[iPadOS] -webkit-text-size-adjust:percentage doesn't work in native apps
https://bugs.webkit.org/show_bug.cgi?id=212122
<rdar://problem/54560875>

Reviewed by Wenson Hsieh.

Update existing idempotent autosizing tests to force desktop mode.
Also add idempotent-percentage.html which doesn't force any mode.

* fast/text-autosizing/ios/idempotentmode/css-exposure.html:
* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-after-changing-initial-scale.html:
* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidate-special-cases.html:
* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html:
* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-identity.html:
* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-reaches-stable-state.html:
* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing.html:
* fast/text-autosizing/ios/idempotentmode/idempotent-percentage-expected.txt: Added.
* fast/text-autosizing/ios/idempotentmode/idempotent-percentage.html: Added.
* fast/text-autosizing/ios/idempotentmode/line-height-boosting.html:
* fast/text-autosizing/ios/idempotentmode/viewport-change-relayout.html:

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

5 months agoMove the TextStream logging definition in VisibleSelection.cpp to the outside of...
changseok@webkit.org [Wed, 20 May 2020 18:49:58 +0000 (18:49 +0000)]
Move the TextStream logging definition in VisibleSelection.cpp to the outside of the TREE_DEBUGGING guard
https://bugs.webkit.org/show_bug.cgi?id=212127

Reviewed by Simon Fraser.

A linking failure occurs after r261819 where ENABLE_TREE_DEBUGGING is disabled.
The TextStream logging defining is placed inside the guard while its declaration is not since r218976.

Build fix, no functionality changed.

* editing/VisibleSelection.cpp:
(WebCore::operator<<):

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

5 months agoDisable support for BeforeLoadEvent
ryanhaddad@apple.com [Wed, 20 May 2020 18:48:49 +0000 (18:48 +0000)]
Disable support for BeforeLoadEvent
https://bugs.webkit.org/show_bug.cgi?id=212140

Unreviewed.

* http/tests/cache/cancel-during-revalidation-succeeded.html:
Remove <CR> characters from line endings in an attempt to get `svn-apply` work on EWS bots.

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

5 months agoUnreviewed WPE gardening. Also enable the imported Blink and Mozilla
zandobersek@gmail.com [Wed, 20 May 2020 18:44:57 +0000 (18:44 +0000)]
Unreviewed WPE gardening. Also enable the imported Blink and Mozilla
layout tests, along with the necessary handful of baselines and expectations.

* platform/wpe/TestExpectations:
* platform/wpe/imported/blink: Added.
* platform/wpe/imported/blink/http: Added.
* platform/wpe/imported/blink/http/tests: Added.
* platform/wpe/imported/blink/http/tests/security: Added.
* platform/wpe/imported/blink/http/tests/security/contentSecurityPolicy: Added.
* platform/wpe/imported/blink/http/tests/security/contentSecurityPolicy/object-src-applet-archive-codebase-expected.txt: Added.
* platform/wpe/imported/blink/http/tests/security/contentSecurityPolicy/object-src-applet-archive-expected.txt: Added.
* platform/wpe/imported/blink/http/tests/security/contentSecurityPolicy/object-src-applet-code-codebase-expected.txt: Added.
* platform/wpe/imported/blink/http/tests/security/contentSecurityPolicy/object-src-applet-code-expected.txt: Added.

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

5 months agohttps://bugs.webkit.org/show_bug.cgi?id=198195
jacob_uphoff@apple.com [Wed, 20 May 2020 18:42:29 +0000 (18:42 +0000)]
https://bugs.webkit.org/show_bug.cgi?id=198195
REGRESSION (r244353) [Mac WK2] Layout Test fast/css/sticky/sticky-left-percentage.html is a flaky ImageOnlyFailure

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

5 months agoREGRESSION (r261892) [ Mac Debug ] 4 API tests failing related to ResourceLoadStatistics
katherine_cheney@apple.com [Wed, 20 May 2020 18:37:47 +0000 (18:37 +0000)]
REGRESSION (r261892) [ Mac Debug ] 4 API tests failing related to ResourceLoadStatistics
https://bugs.webkit.org/show_bug.cgi?id=212153
<rdar://problem/63452541>

Reviewed by Sihui Liu.

Accidentally deleted necessary reset() call for a SQLite statement
when converting stored statements to SQLiteStatementAutoResetScope in
https://trac.webkit.org/changeset/261892/webkit.

This statement is used in a loop with multiple bind() calls so it must be reset.

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::checkForMissingTablesInSchema):

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

5 months agoFix for accessibility-node-memory-management.html in isolated tree mode.
andresg_22@apple.com [Wed, 20 May 2020 18:21:10 +0000 (18:21 +0000)]
Fix for accessibility-node-memory-management.html in isolated tree mode.
https://bugs.webkit.org/show_bug.cgi?id=212142

Reviewed by Chris Fleizach.

LayoutTests/accessibility/accessibility-node-memory-management.html.

- Fix in applyPendingChanges that was not removing removed nodes from
the nodes map. This was causing that some detached AXIsolatedObjects
were being returned.
- Also handle the case where pending changes can come from a detached
AXObject with invalid ID and no platform wrapper.
- updateChildren better handles the case when the notification target
is not in the isolated tree by walking up the object hierarchy until it
finds an associated object that does have a corresponding isolated object.

* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::treeForPageID):
(WebCore::AXIsolatedTree::updateChildren):
(WebCore::AXIsolatedTree::applyPendingChanges):

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

5 months agoREGRESSION(r260978): Web Inspector: Styles: Pressing Space no longer toggles selected...
nvasilyev@apple.com [Wed, 20 May 2020 18:01:49 +0000 (18:01 +0000)]
REGRESSION(r260978): Web Inspector: Styles: Pressing Space no longer toggles selected properties
https://bugs.webkit.org/show_bug.cgi?id=212121

Reviewed by Devin Rousso.

r260978 removed `tabIndex = -1` from the style property element so it wouldn't have a focus outline
when in the Computed panel. However, this also made style properties non-focusable in the Styles panel.

This patch sets `tabIndex = -1` on style property elements when they can be selected (e.g. in the Styles panel).
It doesn't set any tabIndex for style property elements in Computed or Changes panels.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.layout):
* UserInterface/Views/SpreadsheetStyleProperty.js:

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

5 months agoAdd a test to check for creation and deletion of an audio renderer without playing it
youenn@apple.com [Wed, 20 May 2020 17:59:59 +0000 (17:59 +0000)]
Add a test to check for creation and deletion of an audio renderer without playing it
https://bugs.webkit.org/show_bug.cgi?id=212138

Reviewed by Eric Carlson.

* webrtc/remoteAudio-never-played-expected.txt: Added.
* webrtc/remoteAudio-never-played.html: Added.

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

5 months agoUnreviewed WPE gardening. Unskipped half of pending HTTP tests,
zandobersek@gmail.com [Wed, 20 May 2020 17:53:42 +0000 (17:53 +0000)]
Unreviewed WPE gardening. Unskipped half of pending HTTP tests,
providing test baselines and text expectations as required.

* platform/wpe/TestExpectations:
* platform/wpe/http/tests/loading: 2 baselines added.
* platform/wpe/http/tests/misc: 11 baselines added.
* platform/wpe/http/tests/multipart: 2 baselines added.
* platform/wpe/http/tests/navigation: 6 baselines added.
* platform/wpe/http/tests/websocket: 6 baselines added.
* platform/wpe/http/tests/xmlhttprequest: 11 baselines added.

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

5 months ago[Wasm] Limit the size of Wasm function we optimize in OMG mode
msaboff@apple.com [Wed, 20 May 2020 17:48:22 +0000 (17:48 +0000)]
[Wasm] Limit the size of Wasm function we optimize in OMG mode
https://bugs.webkit.org/show_bug.cgi?id=212105

Reviewed by Filip Pizlo.

Given that memory grows O(N^2) compiling Wasm code through the OMG path,
we can run out of memory when compiling large Wasm functions.  This change adds
a limit option, webAssemblyBBQFallbackSize,  When the Wasm function size is
equal to or greater than this limit we always compile using BBQ optimization
parameters.

As part of this change, we still go through the OMG loop entry OSR code
generation path for functions that are at or above the threshold, but we
compile such functions with BBQ compilation optimization levels.
Also for Wasm functions at or above  the threashold, we don't tier up to an
OMG compiled normal entry function.  Instead we stay with the BBQ compiled version.

* runtime/OptionsList.h:
* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::AirIRGenerator):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::parseAndCompile):
* wasm/WasmCompilationMode.cpp:
(JSC::Wasm::wasmFunctionSizeCanBeOMGCompiled):
* wasm/WasmCompilationMode.h:
* wasm/WasmOperations.cpp:
(JSC::Wasm::operationWasmTriggerOSREntryNow):

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

5 months agohttps://bugs.webkit.org/show_bug.cgi?id=212139
jacob_uphoff@apple.com [Wed, 20 May 2020 17:44:50 +0000 (17:44 +0000)]
https://bugs.webkit.org/show_bug.cgi?id=212139
[ macOS debug ] REGRESSION: fast/layoutformattingcontext/table-basic-row-baseline-with-nested-table.html is a flaky crash

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

5 months agoUpdate some media logging
eric.carlson@apple.com [Wed, 20 May 2020 17:24:27 +0000 (17:24 +0000)]
Update some media logging
https://bugs.webkit.org/show_bug.cgi?id=212109
<rdar://problem/63424816>

Unreviewed, remove a change unintentionally included in r261899.

* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullScreenWindowController _interactivePinchDismissChanged:]):

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