WebKit-https.git
9 months agoUnreviewed, add extra test failure logging after r200971
drousso@apple.com [Tue, 27 Aug 2019 00:48:14 +0000 (00:48 +0000)]
Unreviewed, add extra test failure logging after r200971

* inspector/debugger/tail-deleted-frames-this-value.html:

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

9 months agoRegression: ITP started doing a lot more IPC after its logic was moved to the network...
cdumez@apple.com [Tue, 27 Aug 2019 00:20:31 +0000 (00:20 +0000)]
Regression: ITP started doing a lot more IPC after its logic was moved to the network process
https://bugs.webkit.org/show_bug.cgi?id=201155

Reviewed by John Wilander.

Source/WebCore:

ITP started doing a lot more IPC after its logic was moved to the network process. Web processes used to
send their statistics to the UIProcess at most every 5 seconds. However, when the logic got moved to the network
process, we started notifying the network process via IPC after every sub resource load. This is bad for performance
and battery life. This patch restores the 5 second delay to address the issue.

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::ResourceLoadObserver):
(WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
(WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded):
(WebCore::ResourceLoadObserver::updateCentralStatisticsStore):
(WebCore::ResourceLoadObserver::clearState):
* loader/ResourceLoadObserver.h:

Source/WebKit:

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

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

9 months agoRemove UIHelper.activateElementAtHumanSpeed
wenson_hsieh@apple.com [Tue, 27 Aug 2019 00:18:57 +0000 (00:18 +0000)]
Remove UIHelper.activateElementAtHumanSpeed
https://bugs.webkit.org/show_bug.cgi?id=201147

Reviewed by Tim Horton.

Tools:

Add plumbing for a new script controller hook to wait for the double tap delay to pass. On non-iOS, this
resolves immediately; on iOS, we inspect the content view for tap gestures that require more than one tap, and
find the value of the maximum double tap delay. We then delay for this amount of time before resolving.

* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.h:
(WTR::UIScriptController::doAfterDoubleTapDelay):
* WebKitTestRunner/ios/UIScriptControllerIOS.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptControllerIOS::doAfterDoubleTapDelay):

LayoutTests:

This was used in layout tests that simulate repeated taps to work around <webkit.org/b/201129>, and should no
longer be needed after <https://trac.webkit.org/changeset/249112/webkit>. Instead, we can just use UIHelper's
activateElement as intended in cases where successive taps in the test does not result in a double-click; for
the cases where we need to avoid triggering double clicks when tapping (e.g. in several payment tests), use a
new script controller hook to wait for the double tap gesture delay before continuing.

* fast/forms/ios/file-upload-panel.html:
* http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt:

Rebaseline more line numbers.

* http/tests/adClickAttribution/anchor-tag-attributes-validation.html:

Refactor this test so that the links are laid out in two (or more) columns to avoid firing the double click
gesture recognizer instead of the synthetic click gesture.

* http/tests/resources/payment-request.js:
(activateThen):

Instead of using activateElementAtHumanSpeed, wait for the platform double tap delay first, and then simulate
a click using activateElement.

* resources/ui-helper.js:
(window.UIHelper.waitForDoubleTapDelay):

Add a new UIHelper method to wait for the platform double tap delay. See Tools ChangeLog for more details.

(window.UIHelper):
(window.UIHelper.activateElementAtHumanSpeed.return.new.Promise): Deleted.
(window.UIHelper.activateElementAtHumanSpeed): Deleted.

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

9 months ago[results.webkit.org Timline] Add symbols to the timeline dot
zhifei_fang@apple.com [Mon, 26 Aug 2019 23:36:50 +0000 (23:36 +0000)]
[results.webkit.org Timline] Add symbols to the timeline dot
https://bugs.webkit.org/show_bug.cgi?id=201105

Reviewed by Jonathan Bedard.

* resultsdbpy/resultsdbpy/view/static/js/timeline.js:
* resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js:
(Timeline.CanvasSeriesComponent): Modify the drawDot api to provide user ability to add symbol to the dots, it supports unicode symbol
* resultsdbpy/resultsdbpy/view/templates/base.html: Add the encoding UTF-8 for the page, so that we can add unicode symbol to the dots

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

9 months agoResync web-platform-tests/html/browsers/the-window-object from upstream
cdumez@apple.com [Mon, 26 Aug 2019 23:20:45 +0000 (23:20 +0000)]
Resync web-platform-tests/html/browsers/the-window-object from upstream
https://bugs.webkit.org/show_bug.cgi?id=201145

Reviewed by Youenn Fablet.

Resync web-platform-tests/html/browsers/the-window-object from upstream 552bd3bf8bc1be.

* resources/resource-files.json:
* web-platform-tests/html/browsers/the-window-object/*:

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

9 months agoUnreviewed, fix test failure after r200971
drousso@apple.com [Mon, 26 Aug 2019 23:01:47 +0000 (23:01 +0000)]
Unreviewed, fix test failure after r200971

* inspector/timeline/line-column-expected.txt:

* inspector/debugger/tail-deleted-frames-this-value.html:
Add messages to all `InspectorTest.assert` so we can know which one is firing on the bots.

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

9 months ago[bmalloc] Disable IsoHeap completely if DebugHeap is enabled
ysuzuki@apple.com [Mon, 26 Aug 2019 22:31:59 +0000 (22:31 +0000)]
[bmalloc] Disable IsoHeap completely if DebugHeap is enabled
https://bugs.webkit.org/show_bug.cgi?id=201154

Reviewed by Simon Fraser.

Previously we had the guarantee that IsoHeap is disabled when DebugHeap is enabled.
But this is guaranteed in a bit tricky way: when DebugHeap is enabled, Gigacage is disabled.
And IsoHeap is disabled when Gigacage is disabled. However r249065 enabled IsoHeap even if
Gigacage is disabled. This accidentally enabled IsoHeap even if DebugHeap is enabled.

Currently, this is incorrect. When DebugHeap is enabled, we do not start bmalloc::Scavenger.
So IsoHeap does not work. In addition, when DebugHeap is enabled, we want to investigate the Malloc data.
However IsoHeap wipes these information for IsoHeaped objects. Moreover enabling IsoHeap is not free
in terms of memory usage: bmalloc::Scavenger starts working.

So we should not enable IsoHeap in such an accidental way for DebugHeap environment. If we consider enabling
IsoHeap even if `Malloc=1` is specified, we should first examine how memory is used by this change because
the users of `Malloc=1` requires explicitly tight memory usage.

In this patch, we remove the accidental enabling of IsoHeap for DebugHeap by checking DebugHeap status in IsoTLS.

* bmalloc/IsoTLS.cpp:
(bmalloc::IsoTLS::determineMallocFallbackState):

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

9 months agoOptimize computation of AbsoluteClipRects clip rects
simon.fraser@apple.com [Mon, 26 Aug 2019 22:21:38 +0000 (22:21 +0000)]
Optimize computation of AbsoluteClipRects clip rects
https://bugs.webkit.org/show_bug.cgi?id=201148

Reviewed by Zalan Bujtas.

When adding layers to the compositing overlap map, we compute AbsoluteClipRects for every
layer which is expensive. This was more expensive than necessary because we converted them
to TemporaryClipRects when crossing painting boundaries, but AbsoluteClipRects don't
care about painting boundaries, so don't do this.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):

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

9 months agoDrop WEBCORE_EXPORT from ChromeClient class
cdumez@apple.com [Mon, 26 Aug 2019 22:16:25 +0000 (22:16 +0000)]
Drop WEBCORE_EXPORT from ChromeClient class
https://bugs.webkit.org/show_bug.cgi?id=201146

Reviewed by Alex Christensen.

Drop WEBCORE_EXPORT from ChromeClient class. All its methods and either pure virtual or inlined in the header.

* page/ChromeClient.h:

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

9 months agoWeb Inspector: decrease horizontal padding of `WI.ScopeBar` to have more room
drousso@apple.com [Mon, 26 Aug 2019 21:59:24 +0000 (21:59 +0000)]
Web Inspector: decrease horizontal padding of `WI.ScopeBar` to have more room
https://bugs.webkit.org/show_bug.cgi?id=201090

Reviewed by Joseph Pecoraro.

There's a lot of "wasted" padding space around each item that we could reuse (or "move") for
other navigation items.

* UserInterface/Views/FilterBar.css:
(.filter-bar > .navigation-bar > .item.scope-bar):
* UserInterface/Views/RadioButtonNavigationItem.css:
(.navigation-bar .item.radio.button.text-only):
* UserInterface/Views/ScopeBar.css:
(.scope-bar):
(body[dir=ltr] .scope-bar > li.multiple > select):
(body[dir=rtl] .scope-bar > li.multiple > select):
(.scope-bar > li.multiple > .arrows):

* UserInterface/Views/RadioButtonNavigationItem.js:
(WI.RadioButtonNavigationItem):
(WI.RadioButtonNavigationItem.prototype.update): Deleted.
There's no reason to forcibly set the `min-width` since all instances are just text.

* UserInterface/Views/AuditTestGroupContentView.js:
(WI.AuditTestGroupContentView.prototype.initialLayout):
* UserInterface/Views/AuditTestGroupContentView.css:
(.content-view.audit-test-group > header > nav:not(:empty):before): Deleted.
Remove the unnecessary "Showing: " prefix before the `WI.ScopeBar`.

* UserInterface/Views/ScopeRadioButtonNavigationItem.js: Removed.
* UserInterface/Views/ScopeRadioButtonNavigationItem.css: Removed.
These classes were never used.

* Localizations/en.lproj/localizedStrings.js:

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

9 months ago[JSC] Ensure x?.y ?? z is fast
ross.kirsling@sony.com [Mon, 26 Aug 2019 21:09:35 +0000 (21:09 +0000)]
[JSC] Ensure x?.y ?? z is fast
https://bugs.webkit.org/show_bug.cgi?id=200875

Reviewed by Yusuke Suzuki.

JSTests:

* stress/nullish-coalescing.js:

Source/JavaScriptCore:

We anticipate `x?.y ?? z` to quickly become a common idiom in JS. With a little bytecode rearrangement,
we can avoid the "load undefined and check it" dance in the middle and just turn this into two jumps.

Before:
        (get x)
  ----- jundefined_or_null
  |     (get y)
  | --- jmp
  > |   (load undefined)
    > - jnundefined_or_null
      | (get z)
      > end

After:
        (get x)
    --- jundefined_or_null
    |   (get y)
    | - jnundefined_or_null
    > | (get z)
      > end

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::popOptionalChainTarget): Added specialization.
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::CoalesceNode::emitBytecode):
(JSC::OptionalChainNode::emitBytecode):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::makeDeleteNode):
(JSC::ASTBuilder::makeCoalesceNode): Added.
(JSC::ASTBuilder::makeBinaryNode):
* parser/NodeConstructors.h:
(JSC::CoalesceNode::CoalesceNode):
* parser/Nodes.h:
(JSC::ExpressionNode::isDeleteNode const): Added. (Replaces OptionalChainNode::m_isDelete.)

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

9 months agoUnreviewed, remove useMaximalFlushInsertionPhase use
ysuzuki@apple.com [Mon, 26 Aug 2019 20:42:48 +0000 (20:42 +0000)]
Unreviewed, remove useMaximalFlushInsertionPhase use
https://bugs.webkit.org/show_bug.cgi?id=201036

* Scripts/run-jsc-stress-tests:

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

9 months agoDon't compute upconverted characters twice in buildQuery() in DataDetection.mm
ddkilzer@apple.com [Mon, 26 Aug 2019 20:26:50 +0000 (20:26 +0000)]
Don't compute upconverted characters twice in buildQuery() in DataDetection.mm
<https://webkit.org/b/201144>
<rdar://problem/54689399>

Reviewed by Brent Fulgham.

Source/WebCore:

* editing/cocoa/DataDetection.mm:
(WebCore::buildQuery): Extract common variables to prevent double
conversion for 8-bit strings.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Add
DataDetectorsTestIOS.mm to the project.
* TestWebKitAPI/Tests/ios/DataDetectorsTestIOS.mm: Add a new
test for Data Detectors for phone numbers.

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

9 months agoUnreviewed, unmark two datalist tests as timing out on iOS 13 after r249112
wenson_hsieh@apple.com [Mon, 26 Aug 2019 19:58:39 +0000 (19:58 +0000)]
Unreviewed, unmark two datalist tests as timing out on iOS 13 after r249112

* platform/ios/TestExpectations:

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

9 months agoREGRESSION (iOS 13): Tests that simulate multiple back-to-back single taps fail or...
wenson_hsieh@apple.com [Mon, 26 Aug 2019 19:37:29 +0000 (19:37 +0000)]
REGRESSION (iOS 13): Tests that simulate multiple back-to-back single taps fail or time out
https://bugs.webkit.org/show_bug.cgi?id=201129
<rdar://problem/51857277>

Reviewed by Tim Horton.

Source/WebKit:

Adds a new SPI hook in WebKit to let clients know when a synthetic tap gesture that has ended has been reset.
See Tools/ChangeLog and LayoutTests/ChangeLog for more details.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _doAfterResettingSingleTapGesture:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _singleTapDidReset:]):
(-[WKContentView _doAfterResettingSingleTapGesture:]):

Tools:

The tests in editing/pasteboard/ios were timing out on iOS 13 before this change. This is because they simulate
back-to-back single taps; while this is recognized as two single taps on iOS 12 and prior, only the first single
tap is recognized on iOS 13 (and the second is simply dropped on the floor). This occurs because the synthetic
single tap gesture is reset slightly later on iOS 13 compared to iOS 12, so when the second tap is dispatched,
the gesture recognizer is still in "ended" state after the first tap on iOS 13, which means the gesture isn't
capable of recognizing further touches yet.

In UIKit, a gesture recognizer is only reset once its UIGestureEnvironment's containing dependency subgraph no
longer contains gestures that are active. In iOS 12, the synthetic click gesture is a part of a dependency
subgraph that contains only itself and the normal (blocking) double tap gesture which requires the click to fail
before it can be recognized; immediately after simulating the tap, both these gestures are inactive, which
allows both of them to be reset.

However, in iOS 13, the synthetic click gesture is part of a gesture dependency graph that contains the double
tap for double click gesture, as well as the non-blocking double tap gesture, both of which are still active
immediately after sending the first tap. This change in dependencies is caused by the introduction of
UIUndoGestureInteraction's single and double three-finger tap gestures, which (in -[UIUndoGestureInteraction
gestureRecognizer:shouldBeRequiredToFailByGestureRecognizer:]) explicitly add all other taps as failure
requirements. This effectively links the synthetic single tap gesture to most of the other gestures in
WKContentView's dependency graph by way of these tap gestures for the undo interaction.

All this means that there is now a short (~50 ms) delay after the synthetic single tap gestures is recognized,
before it can be recognized again. To account for this new delay in our test infrastructure, simply wait for
single tap gestures that have ended to reset before attempting to send subsequent single taps. We do this by
introducing WebKit testing SPI to invoke a completion handler after resetting the synthetic click gesture (only
if necessary - i.e., if the gesture is in ended state when we are about to begin simulating the tap). This
allows calls to `UIScriptController::singleTapAtPoint` to be reliably recognized as single taps without
requiring arbitrary 120 ms "human speed" delays.

This fixes a number of flaky or failing layout tests, including the tests in editing/pasteboard/ios.

* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.h:
(WTR::UIScriptController::doubleTapAtPoint):

Add a `delay` parameter to `doubleTapAtPoint`. A number of layout tests were actually simulating double click
gestures by simulating two back-to-back single taps; this is done for the purposes of being able to add a "human
speed" delay prior to the second single tap gesture. After the change to wait for the single tap gesture to
reset before attempting to simulate the next tap, this strategy no longer works, since the second gesture is
recognized only as a single tap instead of a double tap.

Instead, we add a delay parameter to `UIScriptController::doubleTapAtPoint`, which the "human speed" double tap
gestures use instead to wait after simulating the first tap.

* WebKitTestRunner/ios/HIDEventGenerator.h:
* WebKitTestRunner/ios/HIDEventGenerator.mm:
(-[HIDEventGenerator _waitFor:]):
(-[HIDEventGenerator sendTaps:location:withNumberOfTouches:delay:completionBlock:]):

Plumb the tap gesture delay through to this helper method.

(-[HIDEventGenerator tap:completionBlock:]):
(-[HIDEventGenerator doubleTap:delay:completionBlock:]):
(-[HIDEventGenerator twoFingerTap:completionBlock:]):
(-[HIDEventGenerator sendTaps:location:withNumberOfTouches:completionBlock:]): Deleted.
(-[HIDEventGenerator doubleTap:completionBlock:]): Deleted.
* WebKitTestRunner/ios/UIScriptControllerIOS.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptControllerIOS::waitForSingleTapToReset const):

Add a new helper to wait for the content view's single tap gesture to reset if needed; call this before
attempting to simulate single taps (either using a stylus, or with a regular touch).

(WTR::UIScriptControllerIOS::singleTapAtPointWithModifiers):
(WTR::UIScriptControllerIOS::doubleTapAtPoint):
(WTR::UIScriptControllerIOS::stylusTapAtPointWithModifiers):

LayoutTests:

Adjusts a few layout tests after changes to UIScriptController::doubleTapAtPoint and
UIScriptController::singleTapAtPoint.

* editing/selection/ios/change-selection-by-tapping.html:

Tweak this test to tap the page 12 times instead of 20 (which seems to cause occasional timeouts locally, when
running all layout tests with a dozen active simulators).

* fast/events/ios/double-tap-zoom.html:
* fast/events/ios/viewport-device-width-allows-double-tap-zoom-out.html:
* fast/events/ios/viewport-shrink-to-fit-allows-double-tap.html:

Augment a few call sites of `doubleTapAtPoint` with a 0 delay. Ideally, these should just use ui-helper.js, but
we can refactor these tests as a part of folding basic-gestures.js into ui-helper.js.

* http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt:
* http/tests/security/anchor-download-block-crossorigin-expected.txt:

Rebaseline these layout tests, due to change in line numbers.

* platform/ipad/TestExpectations:

Unskip these tests on iPad, now that they should pass.

* pointerevents/utils.js:
(const.ui.new.UIController.prototype.doubleTapToZoom):
* resources/basic-gestures.js:
(return.new.Promise.):
(return.new.Promise):

Adjust some more call sites of `doubleTapAtPoint`. Ideally, these should use just `ui-helper.js` too.

* resources/ui-helper.js:
(window.UIHelper.doubleTapAt.return.new.Promise):
(window.UIHelper.doubleTapAt):
(window.UIHelper.humanSpeedDoubleTapAt):
(window.UIHelper.humanSpeedZoomByDoubleTappingAt):

Add a delay parameter to `doubleTapAt` to specify a delay after each simulated tap. By default, this is 0, but
the `humanSpeed*` helpers add a delay of 120 milliseconds. Additionally, these helpers were previously calling
`singleTapAtPoint` twice, with a timeout in between to add a delay. Instead, call `doubleTapAtPoint` with a
nonzero delay; otherwise, we'll end up waiting in `singleTapAtPoint` for the gesture subgraph containing both
the double tap gestures and the synthetic single tap gesture to reset, which causes these two single taps to no
longer be recognized as a double tap gesture.

(window.UIHelper.zoomByDoubleTappingAt):

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

9 months agoresults.webkit.org: Allow clicking on the tooltip arrow
jbedard@apple.com [Mon, 26 Aug 2019 19:18:15 +0000 (19:18 +0000)]
results.webkit.org: Allow clicking on the tooltip arrow
https://bugs.webkit.org/show_bug.cgi?id=201103

Rubber-stamped by Aakash Jain.

By design, the arrow sits above the canvas and intercepts mouse events from it.
This will often make an element that has a tooltip unclickable.

* resultsdbpy/resultsdbpy/view/static/js/timeline.js:
(xAxisFromScale):
(TimelineFromEndpoint.prototype.render.onDotEnterFactory):
(TimelineFromEndpoint.prototype.render):
* resultsdbpy/resultsdbpy/view/static/js/tooltip.js:
(_ToolTip):
(_ToolTip.prototype.toString): Trigger onClick callback when the arrow is clicked.
(_ToolTip.prototype.set): Set the onClick callback.

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

9 months ago[FTW] Go back to ID2D1Bitmap as our NativeImage type
bfulgham@apple.com [Mon, 26 Aug 2019 19:08:57 +0000 (19:08 +0000)]
[FTW] Go back to ID2D1Bitmap as our NativeImage type
https://bugs.webkit.org/show_bug.cgi?id=201122

Reviewed by Alex Christensen.

In Bug 200093 I switched the OS type of NativeImagePtr from ID2D1Bitmap to IWICBitmap.
However, this was an ill-advised approach, because it dramatically harmed performance due
to the heavy use of software rendering.

I originally made this change because I thought this was the only way to get to the backing
bits of the bitmaps, but it turns out that a more recent Direct2D data type (ID2D1Bitmap1)
has the ability to map its memory to CPU-accessible memory, allowing software filter effects.

This patch switches back to the ID2D1Bitap data type, and hooks up the ID2D1Bitmap1 data type
to access the underlying memory of the bitmaps when software filter effects are used.

Source/WebCore:

* platform/graphics/ImageBuffer.h:
* platform/graphics/NativeImage.h:
* platform/graphics/texmap/BitmapTextureGL.cpp:
* platform/graphics/win/Direct2DOperations.cpp:
* platform/graphics/win/Direct2DOperations.h:
* platform/graphics/win/Direct2DUtilities.cpp:
(WebCore::Direct2D::writeDiagnosticPNGToPath):
(WebCore::Direct2D::writeImageToDiskAsPNG): Deleted.
* platform/graphics/win/Direct2DUtilities.h:
* platform/graphics/win/GraphicsContextDirect2D.cpp:
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
* platform/graphics/win/ImageBufferDataDirect2D.h:
* platform/graphics/win/ImageBufferDirect2D.cpp:
* platform/graphics/win/ImageDecoderDirect2D.cpp:
* platform/graphics/win/NativeImageDirect2D.cpp:
* platform/graphics/win/PatternDirect2D.cpp:
* svg/graphics/SVGImage.cpp:

Source/WebKit:

Reviewed by Alex Christensen.

* Shared/ShareableBitmap.h:
* Shared/win/ShareableBitmapDirect2D.cpp:
* UIProcess/win/BackingStoreDirect2D.cpp:
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:

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

9 months ago[WHLSL] TypeNamer can be simplified by replacing BaseTypeNameNode with uniqued AST...
weinig@apple.com [Mon, 26 Aug 2019 18:58:00 +0000 (18:58 +0000)]
[WHLSL] TypeNamer can be simplified by replacing BaseTypeNameNode with uniqued AST::UnnamedTypes
https://bugs.webkit.org/show_bug.cgi?id=200632

Reviewed by Saam Barati.

There is no longer a reason to keep a parallel tree of the UnnamedType-like objects
BaseTypeNameNodes. Instead, we can store a single HashMap mapping from UnnamedTypeKeys
to MangledTypeName, and use the the UnnamedType stored in the UnnamedTypeKey while
emitting the metal code. This removes the parallel BaseTypeNameNode type hierarchy
and removes an extra allocation for each UnnamedType.

* Modules/webgpu/WHLSL/AST/WHLSLUnnamedTypeHash.h:
Define HashTraits and DefaultHash specializations for UnnamedTypeKey to simplify
uses of UnnamedTypeKey as a key in HashMap/HashSet.

* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h:
* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
(WebCore::WHLSL::Metal::TypeNamer::insert): Deleted.
(WebCore::WHLSL::Metal::TypeNamer::generateUniquedTypeName):
Replace old insert function with generateUniquedTypeName, which uniques and generates
names for the UnnamedType and any 'parent' UnnamedTypes.

(WebCore::WHLSL::Metal::BaseTypeNameNode): Deleted.
Remove BaseTypeNameNode and subclasses.

(WebCore::WHLSL::Metal::TypeNamer::find): Deleted.
(WebCore::WHLSL::Metal::TypeNamer::createNameNode): Deleted.
We no longer need the find or createNameNode functions, as the UnnamedTypes can be now be
used directly everywhere.

(WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
Switch to directly using the UnnamedType and always have the caller pass in the mangled
name, since in the main emit loop, we always have access to the them. Also, inline the
the recursive calls to emitNamedTypeDefinition for 'parent' types to avoid unnecessary
extra switch over the kind getting the parent, and avoid it entirely for TypeReference
which never has a parent.

(WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
Switches to now passing in the neighbors, since they are always available in the main
emit loop. Also move to a switch statement rather than ifs for consistency.

(WebCore::WHLSL::Metal::TypeNamer::emitMetalTypeDefinitions):
Pass keys and values into the emit functions to avoid double lookups.

(WebCore::WHLSL::Metal::TypeNamer::mangledNameForType):
Update to hash lookup.

* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
Take advantage of default HashTraits and DefaultHash for UnnamedTypeKey.

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

9 months ago[WebAuthn] Support HID authenticators on iOS
jiewen_tan@apple.com [Mon, 26 Aug 2019 18:43:09 +0000 (18:43 +0000)]
[WebAuthn] Support HID authenticators on iOS
https://bugs.webkit.org/show_bug.cgi?id=201084
<rdar://problem/51908390>

Reviewed by Youenn Fablet.

Source/WebCore/PAL:

* pal/spi/cocoa/IOKitSPI.h:
Move IOHIDDevice.h and IOHIDManager.h to IOKitSPI.h given they are in iOS.

Source/WebKit:

This patch makes the macOS HID implementation available in iOS as well.
Mostly, it removes the PLATFORM(MAC) compile time flag.

* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManagerInternal::collectTransports):
* UIProcess/WebAuthentication/AuthenticatorTransportService.cpp:
(WebKit::AuthenticatorTransportService::create):
(WebKit::AuthenticatorTransportService::createMock):
* UIProcess/WebAuthentication/Cocoa/HidConnection.h:
* UIProcess/WebAuthentication/Cocoa/HidConnection.mm:
* UIProcess/WebAuthentication/Cocoa/HidService.h:
* UIProcess/WebAuthentication/Cocoa/HidService.mm:
* UIProcess/WebAuthentication/Cocoa/NfcConnection.mm:
(WebKit::NfcConnection::NfcConnection):
A tentative solution before there is an official UI.
* UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
* UIProcess/WebAuthentication/Mock/MockHidConnection.h:
* UIProcess/WebAuthentication/Mock/MockHidService.cpp:
* UIProcess/WebAuthentication/Mock/MockHidService.h:
* UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
* UIProcess/WebAuthentication/fido/CtapHidDriver.h:

LayoutTests:

* platform/ios-wk2/TestExpectations:
Unskips HID tests for iOS.

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

9 months agoUnreviewed, test gardening
jiewen_tan@apple.com [Mon, 26 Aug 2019 18:41:58 +0000 (18:41 +0000)]
Unreviewed, test gardening

* platform/mac-wk2/TestExpectations:
Skip WebAuthn tests for HighSierra and Mojave.

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

9 months agoREGRESSION (18E140): “return streaming movie to real time” suggesting “resume real...
commit-queue@webkit.org [Mon, 26 Aug 2019 18:03:27 +0000 (18:03 +0000)]
REGRESSION (18E140): “return streaming movie to real time” suggesting “resume real time streaming”
https://bugs.webkit.org/show_bug.cgi?id=201108
<rdar://problem/46372525>

Patch by Peng Liu <peng.liu6@apple.com> on 2019-08-26
Reviewed by Eric Carlson.

Update Localizable.strings.

No new test.

* en.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::localizedMediaControlElementHelpText):

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

9 months agoCacheStorageConnection::computeRealBodySize is not thread-safe
youenn@apple.com [Mon, 26 Aug 2019 17:51:18 +0000 (17:51 +0000)]
CacheStorageConnection::computeRealBodySize is not thread-safe
https://bugs.webkit.org/show_bug.cgi?id=201074

Reviewed by Chris Dumez.

In case of a form data, the size computation might require sync IPC to the network process which is not thread-safe
In that case, hop to the main thread to compute the size of the body.
Covered by existing service worker tests in Debug mode.

* Modules/cache/CacheStorageConnection.cpp:
(WebCore::formDataSize):
(WebCore::CacheStorageConnection::computeRealBodySize):

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

9 months ago[EWS] Do not append additional '(failure)' string at the end of custom failure messag...
aakash_jain@apple.com [Mon, 26 Aug 2019 17:48:11 +0000 (17:48 +0000)]
[EWS] Do not append additional '(failure)' string at the end of custom failure message in EWS Buildbot
https://bugs.webkit.org/show_bug.cgi?id=201140

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(TestWithFailureCount.getResultSummary): Do not append (failure) when in case of custom status.
* BuildSlaveSupport/ews-build/steps_unittest.py: Updated unit-tests accordingly.

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

9 months agoAdd a script to update ANGLE
commit-queue@webkit.org [Mon, 26 Aug 2019 17:36:28 +0000 (17:36 +0000)]
Add a script to update ANGLE
https://bugs.webkit.org/show_bug.cgi?id=201109

Patch by James Darpinian <jdarpinian@google.com> on 2019-08-26
Reviewed by Alex Christensen.

* update-angle.sh: Added.

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

9 months agorun-webkit-tests: Cap the number of automatically booted simulators at 12
jbedard@apple.com [Mon, 26 Aug 2019 17:21:28 +0000 (17:21 +0000)]
run-webkit-tests: Cap the number of automatically booted simulators at 12
https://bugs.webkit.org/show_bug.cgi?id=201139

Reviewed by Aakash Jain.

To make local development with simulators more pleasant, machines should
never automatically boot more than 12 simulators.

* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDeviceManager.max_supported_simulators):

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

9 months agoUnreviewed, rolling out r248961.
russell_e@apple.com [Mon, 26 Aug 2019 17:12:43 +0000 (17:12 +0000)]
Unreviewed, rolling out r248961.

Same patch was re-landed after being rolled out. Patch is
causing Catalina/iOS 13 test failures. Rolling out.

Reverted changeset:

"Verify Prefetch and credential behavior"
https://bugs.webkit.org/show_bug.cgi?id=200000
https://trac.webkit.org/changeset/248961

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

9 months ago[ews] Add EWS queue for applying watchlist
aakash_jain@apple.com [Mon, 26 Aug 2019 17:08:21 +0000 (17:08 +0000)]
[ews] Add EWS queue for applying watchlist
https://bugs.webkit.org/show_bug.cgi?id=201072

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(ApplyWatchList): Build step to apply watchlist.
(ApplyWatchList.__init__): Set logEnviron to False.
(ApplyWatchList.getResultSummary): Updated the description in case of failure.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.
* BuildSlaveSupport/ews-build/factories.py:
(WatchListFactory): Build factory for WatchList.
* BuildSlaveSupport/ews-build/loadConfig.py:
* BuildSlaveSupport/ews-build/config.json:

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

9 months agordar://51857070 (iPad: Many fast/text-autosizing layout tests are consistently failing)
russell_e@apple.com [Mon, 26 Aug 2019 16:57:16 +0000 (16:57 +0000)]
rdar://51857070 (iPad: Many fast/text-autosizing layout tests are consistently failing)

Unreviewed Test Gardening.
Tests are no longer failing. Removing test expectations.

* platform/ipad/TestExpectations:

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

9 months agoRemove NPAPI Examples
achristensen@apple.com [Mon, 26 Aug 2019 16:48:21 +0000 (16:48 +0000)]
Remove NPAPI Examples
https://bugs.webkit.org/show_bug.cgi?id=201089

Reviewed by Alexey Proskuryakov.

We are only supporting NPAPI for flash until its upcoming end of life.
We don't need to encourage the creation of new NPAPI plugins by having examples.

* Examples: Removed.

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

9 months agoAdd a WebsiteDataStore delegate to handle AuthenticationChallenge that do not come...
youenn@apple.com [Mon, 26 Aug 2019 15:00:05 +0000 (15:00 +0000)]
Add a WebsiteDataStore delegate to handle AuthenticationChallenge that do not come from pages
https://bugs.webkit.org/show_bug.cgi?id=196870
LayoutTests/imported/w3c:

<rdar://problem/54593556>

Reviewed by Alex Christensen.

* web-platform-tests/service-workers/service-worker/websocket-in-service-worker.https-expected.txt:

Source/WebKit:

Reviewed by Alex Christensen.

Make NetworkProcess provide the session ID for any authentication challenge.
In case there is no associated page for the authentication challenge or this is related to a service worker,
ask the website data store to take a decision.
Add website data store delegate to allow applications to make the decision.
Restrict using the delegate to server trust evaluation only.

Make ping loads reuse the same mechanism.

Covered by service worker tests and updated beacon test.

* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::sessionID const):
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::didReceiveChallenge):
* NetworkProcess/NetworkLoadChecker.h:
(WebKit::NetworkLoadChecker::networkProcess):
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::didReceiveChallenge):
* Shared/Authentication/AuthenticationManager.cpp:
(WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
* Shared/Authentication/AuthenticationManager.h:
* Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.h: Copied from Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.h.
* Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.mm: Copied from Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h.
(WebKit::toAuthenticationChallengeDisposition):
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(WebsiteDataStoreClient::WebsiteDataStoreClient):
* UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/ServiceWorkerProcessProxy.cpp:
* UIProcess/ServiceWorkerProcessProxy.h:
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::isServiceWorkerPageID const):
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStoreClient.h:
(WebKit::WebsiteDataStoreClient::didReceiveAuthenticationChallenge):
* WebKit.xcodeproj/project.pbxproj:

Tools:

Reviewed by Alex Christensen.

Implement the new delegate by respecting the value set by testRunner.setAllowsAnySSLCertificate
Accept any server certificate by default.

* WebKitTestRunner/TestController.cpp:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::cocoaResetStateToConsistentValues):
(WTR::TestController::setAllowsAnySSLCertificate):
* WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.h:
* WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.mm:
(-[TestWebsiteDataStoreDelegate didReceiveAuthenticationChallenge:completionHandler:]):
(-[TestWebsiteDataStoreDelegate setAllowAnySSLCertificate:]):

LayoutTests:

Reviewed by Alex Christensen.

Add tests to validate that the delegate decision is respected for beacons and service worker loads.

* http/wpt/beacon/cors/crossorigin-arraybufferview-no-preflight-expected.txt:
* http/wpt/beacon/cors/crossorigin-arraybufferview-no-preflight.html:
* http/wpt/beacon/resources/beacon-preflight.py:
(main):
* http/wpt/service-workers/resources/lengthy-pass.py:
(main):
* http/wpt/service-workers/server-trust-evaluation.https-expected.txt: Added.
* http/wpt/service-workers/server-trust-evaluation.https.html: Added.
* http/wpt/service-workers/server-trust-worker.js: Added.
* http/tests/ssl/certificate-validation.html: Remove unneeded setting call
since we deny server trust requests if SSL certificates are not all allowed.

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

9 months agoMissing media controls when WebKit is built with Python3
clopez@igalia.com [Mon, 26 Aug 2019 14:36:47 +0000 (14:36 +0000)]
Missing media controls when WebKit is built with Python3
https://bugs.webkit.org/show_bug.cgi?id=194367

Reviewed by Carlos Garcia Campos.

The JavaScript minifier script jsmin.py expects a text stream
with text type as input, but the script make-js-file-arrays.py
was passing to it a FileIO() object. So, when the jsmin script
called read() over this object, python3 was returning a type of
bytes, but for python2 it returns type str.

This caused two problems: first that jsmin failed to do any minifying
because it was comparing strings with a variable of type bytes.
The second major problem was in the write() function, when the
jsmin script tried to convert a byte character to text by calling
str() on it. Because what this does is not to convert from byte
type to string, but to simply generate a string with the format b'c'.
So the jsmin script was returning back as minified JS complete
garbage in the form of "b't'b'h'b'h'b'i" for python3.

Therefore, when WebKit was built with python3 this broke everything
that depended on the embedded JS code that make-js-file-arrays.py
was supposed to generate, like the media controls and the WebDriver
atoms.

Fix this by reworking the code in make-js-file-arrays script to
read the data from the file using a TextIOWrapper in python 3
with decoding for 'utf-8'. This ensures that the jsmin receives
a text type. For python2 keep using the same FileIO class.

On the jsmin.py script remove the problematic call to str() inside
the write() function when running with python3.
On top of that, add an extra check in jsmin.py script to make it
fail if the character type read is not the one expected. This
will cause the build to fail instead of failing silently like
now. I did some tests and the runtime cost of this extra check
is almost zero.

* Scripts/jsmin.py:
(JavascriptMinify.minify.write):
(JavascriptMinify):
* Scripts/make-js-file-arrays.py:
(main):

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

9 months agoMessagePort should be WeakPtrFactoryInitialization::Eager
youenn@apple.com [Mon, 26 Aug 2019 09:41:28 +0000 (09:41 +0000)]
MessagePort should be WeakPtrFactoryInitialization::Eager
https://bugs.webkit.org/show_bug.cgi?id=201073

Reviewed by Chris Dumez.

Covered by existing layout tests.

* dom/MessagePort.h:

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

9 months ago[iOS WK2] Make a strongly-typed TransactionID to replace uint64_t transactionIDs
simon.fraser@apple.com [Mon, 26 Aug 2019 06:16:50 +0000 (06:16 +0000)]
[iOS WK2] Make a strongly-typed TransactionID to replace uint64_t transactionIDs
https://bugs.webkit.org/show_bug.cgi?id=199983

Reviewed by Dean Jackson.

Add TransactionID which is a MonotonicObjectIdentifier<TransactionIDType>. This is modeled
after ObjectIdentifier<>, but we can't use that because it doesn't have a guarantee of
values always increasing by 1 (all derived classes share the same value source). Also, we
need a per-RemoteLayerTreeDrawingArea set of values, but a static seed would cause values to
be incremented by all RemoteLayerTreeDrawingAreas in a WebProcess.

Replace all the bare uint64_t with TransactionID, fixing message generation codegen.

* Scripts/webkit/messages.py:
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::transactionID const):
(WebKit::RemoteLayerTreeTransaction::setTransactionID):
* Shared/TransactionID.h: Added.
(WebKit::MonotonicObjectIdentifier::MonotonicObjectIdentifier):
(WebKit::MonotonicObjectIdentifier::isHashTableDeletedValue const):
(WebKit::MonotonicObjectIdentifier::encode const):
(WebKit::MonotonicObjectIdentifier::decode):
(WebKit::MonotonicObjectIdentifier::operator== const):
(WebKit::MonotonicObjectIdentifier::operator> const):
(WebKit::MonotonicObjectIdentifier::operator>= const):
(WebKit::MonotonicObjectIdentifier::operator< const):
(WebKit::MonotonicObjectIdentifier::operator<= const):
(WebKit::MonotonicObjectIdentifier::operator!= const):
(WebKit::MonotonicObjectIdentifier::increment):
(WebKit::MonotonicObjectIdentifier::next const):
(WebKit::MonotonicObjectIdentifier::toUInt64 const):
(WebKit::MonotonicObjectIdentifier::operator bool const):
(WebKit::MonotonicObjectIdentifier::loggingString const):
(WebKit::MonotonicObjectIdentifier::hashTableDeletedValue):
(WebKit::MonotonicObjectIdentifier::isValidIdentifier):
(WebKit::operator<<):
* Shared/VisibleContentRectUpdateInfo.h:
(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::lastLayerTreeTransactionID const):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _processWillSwapOrDidExit]):
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::willCommitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetState):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::commitPotentialTap):
(WebKit::WebPageProxy::handleTap):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
(WebKit::RemoteLayerTreeDrawingArea::nextTransactionID const):
(WebKit::RemoteLayerTreeDrawingArea::lastCommittedTransactionID const):
(WebKit::RemoteLayerTreeDrawingArea::takeNextTransactionID):
* WebProcess/WebPage/WebFrame.h:
(WebKit::WebFrame::firstLayerTreeTransactionIDAfterDidCommitLoad const):
(WebKit::WebFrame::setFirstLayerTreeTransactionIDAfterDidCommitLoad):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleTap):
(WebKit::WebPage::handlePotentialDoubleTapForDoubleClickAtPoint):
(WebKit::WebPage::commitPotentialTap):

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

9 months agoRegression(r248533) Assertion hit in isMainThread() for some clients using WTF becaus...
Hironori.Fujii@sony.com [Mon, 26 Aug 2019 01:51:57 +0000 (01:51 +0000)]
Regression(r248533) Assertion hit in isMainThread() for some clients using WTF because the main thread is not initialized
https://bugs.webkit.org/show_bug.cgi?id=201083
<rdar://problem/54651993>

Unreviewed build fox for Windows.

* wtf/win/MainThreadWin.cpp:
(WTF::isMainThreadInitialized): Added.

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

9 months agoHave RenderLayer::calculateClipRects() use offsetFromAncestor() when possible
simon.fraser@apple.com [Sun, 25 Aug 2019 02:14:30 +0000 (02:14 +0000)]
Have RenderLayer::calculateClipRects() use offsetFromAncestor() when possible
https://bugs.webkit.org/show_bug.cgi?id=201066

Reviewed by Dean Jackson.

offsetFromAncestor() is a layer tree walk, so faster than localToContainerPoint(),
but we can't use it when there are transforms on the layer and intermediates up
to the ancestor.

canUseConvertToLayerCoords() was trying to answer the question about whether it's
OK to use offsetFromAncestor() (which calls convertToLayerCoords() internally), but
it has insufficient information to make a determination. Leave this issue alone, but
at least rename canUseConvertToLayerCoords().

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositions):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:

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

9 months agoPage crashes under CGPathAddUnevenCornersRoundedRect
simon.fraser@apple.com [Sat, 24 Aug 2019 21:42:42 +0000 (21:42 +0000)]
Page crashes under CGPathAddUnevenCornersRoundedRect
https://bugs.webkit.org/show_bug.cgi?id=201117

Reviewed by Dean Jackson.
Source/WebCore:

Fix crash on https://onehtmlpagechallenge.com/entries/pure-css-still-life-water-lemon.html
We were passing CG radius values where the sum of two radii was greater than the height or
width, caused by rounding when converting from floats to doubles.

Test: fast/borders/renderable-uneven-rounded-rects.html

* platform/graphics/cg/PathCG.cpp:
(WebCore::Path::platformAddPathForRoundedRect):

LayoutTests:

* fast/borders/renderable-uneven-rounded-rects-expected.txt: Added.
* fast/borders/renderable-uneven-rounded-rects.html: Added.

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

9 months agoWeb Inspector: "Copy Rule" menu item does not propagate comments properly
drousso@apple.com [Sat, 24 Aug 2019 18:21:04 +0000 (18:21 +0000)]
Web Inspector: "Copy Rule" menu item does not propagate comments properly
https://bugs.webkit.org/show_bug.cgi?id=201095

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype.commentOut):
(WI.CSSProperty.prototype.get formattedText):
Wrap the `text` in `/* ${text} */` if the `WI.CSSProperty` isn't `enabled` (e.g. commented out).

LayoutTests:

* inspector/css/generateCSSRuleString.html:
* inspector/css/generateCSSRuleString-expected.txt:

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

9 months agoRenderLayer::updateLayerPositions() doesn't propagate the ancestor flags correctly
simon.fraser@apple.com [Sat, 24 Aug 2019 17:35:25 +0000 (17:35 +0000)]
RenderLayer::updateLayerPositions() doesn't propagate the ancestor flags correctly
https://bugs.webkit.org/show_bug.cgi?id=201115

Reviewed by Zalan Bujtas.

When an updateLayerPositions() traversal starts at a non-root layer, we failed to populate
the ancestor-related UpdateLayerPositionsFlag flags, leaving layers with missing flags
(e.g. the m_hasTransformedAncestor flag). This is detected by the patch in bug 201066.

Fix by having updateLayerPositionsAfterStyleChange() and updateLayerPositionsAfterLayout()
initialize the flags from the parent layer.

This is a behavior change not detected by any existing test, but will be exercised once
the patch from bug 201066 lands.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::flagsForUpdateLayerPositions):
(WebCore::RenderLayer::updateLayerPositionsAfterStyleChange):
(WebCore::RenderLayer::updateLayerPositionsAfterLayout):
(WebCore::outputPaintOrderTreeLegend):
(WebCore::outputPaintOrderTreeRecursive): Log hasTransformedAncestor().
* rendering/RenderLayer.h:

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

9 months agoMake CacheStorageEngineCaches's decodeCachesNames() more robust against bad input...
cdumez@apple.com [Sat, 24 Aug 2019 16:02:52 +0000 (16:02 +0000)]
Make CacheStorageEngineCaches's decodeCachesNames() more robust against bad input data
https://bugs.webkit.org/show_bug.cgi?id=201102

Reviewed by Antti Koivisto.

Use Vector::tryReserveCapacity() instead of Vector::reserveInitialCapacity() in CacheStorage::decodeCachesNames()
since the size is read from disk and thus cannot be trusted. If the size is too large, reserveInitialCapacity()
would end up crashing the network process. Now, we merely discard the data if tryReserveCapacity() fails because
the size is too large.

* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::decodeCachesNames):

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

9 months ago[LFC][TFC] Add section renderers to the layout tree (THEAD/TBODY/TFOOT)
zalan@apple.com [Sat, 24 Aug 2019 13:36:29 +0000 (13:36 +0000)]
[LFC][TFC] Add section renderers to the layout tree (THEAD/TBODY/TFOOT)
https://bugs.webkit.org/show_bug.cgi?id=201114
<rdar://problem/54664992>

Reviewed by Antti Koivisto.

Section renderers (THEAD/TBODY/TFOOT) are direct children of the RenderTable. Let's include them in the layout tree as well.

* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createTableStructure):
(WebCore::Layout::outputInlineRuns):

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

9 months ago[LFC] Box::isAnonymous() can not rely on the lack of ElementType.
zalan@apple.com [Sat, 24 Aug 2019 13:34:50 +0000 (13:34 +0000)]
[LFC] Box::isAnonymous() can not rely on the lack of ElementType.
https://bugs.webkit.org/show_bug.cgi?id=201106
<rdar://problem/54660287>

Reviewed by Antti Koivisto.

Add bool m_isAnonymous member to mark anonymous layout boxes. Anonymous boxes are not rare enough to include this variable in RareData.

* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::setIsAnonymous):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createLayoutBox):

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

9 months agoImplement layout system independent text box iterator
antti@apple.com [Sat, 24 Aug 2019 13:31:50 +0000 (13:31 +0000)]
Implement layout system independent text box iterator
https://bugs.webkit.org/show_bug.cgi?id=201076

Reviewed by Zalan Bujtas.

Add a generic way to traverse line layout without caring about the details of the underlying layout system.

This patch adds basic support for traversing text boxes and uses it to remove layout path specific branches in RenderTreeAsText.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):
(WebCore::writeTextBox):
(WebCore::write):
(WebCore::writeTextRun): Deleted.
(WebCore::writeSimpleLine): Deleted.
* rendering/line/LineLayoutInterfaceTextBoxes.cpp: Added.
(WebCore::LineLayoutInterface::TextBox::rect const):
(WebCore::LineLayoutInterface::TextBox::logicalRect const):
(WebCore::LineLayoutInterface::TextBox::hasHyphen const):
(WebCore::LineLayoutInterface::TextBox::isLeftToRightDirection const):
(WebCore::LineLayoutInterface::TextBox::dirOverride const):
(WebCore::LineLayoutInterface::TextBox::text const):
(WebCore::LineLayoutInterface::TextBoxIterator::TextBoxIterator):
(WebCore::LineLayoutInterface::TextBoxIterator::traverseNext):
(WebCore::LineLayoutInterface::TextBoxIterator::operator== const):
(WebCore::LineLayoutInterface::simpleLineRunResolverForText):
(WebCore::LineLayoutInterface::rangeForText):
(WebCore::LineLayoutInterface::TextBoxRange::TextBoxRange):
(WebCore::LineLayoutInterface::textBoxes):
* rendering/line/LineLayoutInterfaceTextBoxes.h: Added.
(WebCore::LineLayoutInterface::TextBox::TextBox):
(WebCore::LineLayoutInterface::TextBoxIterator::operator++):
(WebCore::LineLayoutInterface::TextBoxIterator::operator!= const):
(WebCore::LineLayoutInterface::TextBoxIterator::operator* const):
(WebCore::LineLayoutInterface::TextBoxRange::begin const):
(WebCore::LineLayoutInterface::TextBoxRange::end const):

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

9 months ago[LFC][BFC] Non-inline formatting context(table, grid etc) root container should not...
zalan@apple.com [Sat, 24 Aug 2019 13:24:29 +0000 (13:24 +0000)]
[LFC][BFC] Non-inline formatting context(table, grid etc) root container should not collapse through.
https://bugs.webkit.org/show_bug.cgi?id=201099
<rdar://problem/54658946>

Reviewed by Antti Koivisto.

I didn't manage to find it in the spec, but surely formatting contexts like table, grid and flex should behave like
block so that their vertical margins are not adjoining, when they have at least one inflow child.

* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):

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

9 months ago[LFC] Add THEAD/TBODY/TFOOT output to Layout::showLayoutTree
zalan@apple.com [Sat, 24 Aug 2019 13:17:03 +0000 (13:17 +0000)]
[LFC] Add THEAD/TBODY/TFOOT output to Layout::showLayoutTree
https://bugs.webkit.org/show_bug.cgi?id=201113
<rdar://problem/54664134>

Reviewed by Antti Koivisto.

* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputLayoutBox):

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

9 months ago[LFC] Remove redundant Layout::Box::ElementType::TableRowGroup
zalan@apple.com [Sat, 24 Aug 2019 13:16:41 +0000 (13:16 +0000)]
[LFC] Remove redundant Layout::Box::ElementType::TableRowGroup
https://bugs.webkit.org/show_bug.cgi?id=201112
<rdar://problem/54663833>

Reviewed by Antti Koivisto.

Use Layout::Box::ElementType::TableBodyGroup instead.

* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isPaddingApplicable const):
* layout/layouttree/LayoutBox.h:
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createLayoutBox):

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

9 months agoRenderLayerModelObject should not call private RenderLayer functions
simon.fraser@apple.com [Sat, 24 Aug 2019 03:31:55 +0000 (03:31 +0000)]
RenderLayerModelObject should not call private RenderLayer functions
https://bugs.webkit.org/show_bug.cgi?id=201111

Reviewed by Zalan Bujtas.

Make RenderLayerModelObject no longer a friend class of RenderLayer, giving it a public
willRemoveChildWithBlendMode() function to call. Also make the UpdateLayerPositionsFlag
enum private, providing a updateLayerPositionsAfterStyleChange() for RenderLayerModelObject,
and changing the arguments of updateLayerPositionsAfterLayout() for FrameView.

No behavior change.

* page/FrameView.cpp:
(WebCore::FrameView::didLayout):
(WebCore::updateLayerPositionFlags): Deleted.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositionsAfterStyleChange):
(WebCore::RenderLayer::updateLayerPositionsAfterLayout):
(WebCore::RenderLayer::willRemoveChildWithBlendMode):
* rendering/RenderLayer.h:
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::styleDidChange):

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

9 months agoImplement StaticRange constructor
rniwa@webkit.org [Sat, 24 Aug 2019 02:22:28 +0000 (02:22 +0000)]
Implement StaticRange constructor
https://bugs.webkit.org/show_bug.cgi?id=201055

Reviewed by Wenson Hsieh.

LayoutTests/imported/w3c:

Added a test from https://github.com/web-platform-tests/wpt/pull/18619
with my review comment addressed.

* web-platform-tests/dom/interfaces-expected.txt: Rebaselined.
* web-platform-tests/dom/ranges/StaticRange-constructor-expected.txt: Added.
* web-platform-tests/dom/ranges/StaticRange-constructor.html: Added.

Source/WebCore:

Added the constructor to StaticRange per https://github.com/whatwg/dom/pull/778.

Test: imported/w3c/web-platform-tests/dom/ranges/StaticRange-constructor.html

* dom/StaticRange.cpp:
(WebCore::isDocumentTypeOrAttr):
(WebCore::StaticRange::create):
* dom/StaticRange.h:
* dom/StaticRange.idl:

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

9 months agoWeb Inspector: create additional command line api functions for other console methods
drousso@apple.com [Sat, 24 Aug 2019 00:46:56 +0000 (00:46 +0000)]
Web Inspector: create additional command line api functions for other console methods
https://bugs.webkit.org/show_bug.cgi?id=200971

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

Expose all `console.*` functions in the command line API, since they're all already able to
be referenced via the `console` object.

Provide a simpler interface for other injected scripts to modify the command line API.

* inspector/InjectedScriptModule.cpp:
(Inspector::InjectedScriptModule::ensureInjected):

* inspector/InjectedScriptSource.js:
(InjectedScript.prototype.inspectObject):
(InjectedScript.prototype.addCommandLineAPIGetter): Added.
(InjectedScript.prototype.addCommandLineAPIMethod): Added.
(InjectedScript.prototype.hasInjectedModule): Added.
(InjectedScript.prototype.injectModule):
(InjectedScript.prototype._evaluateOn):
(InjectedScript.CommandLineAPI): Added.
(InjectedScript.prototype.module): Deleted.
(InjectedScript.prototype._savedResult): Deleted.
(bind): Deleted.
(BasicCommandLineAPI): Deleted.
(clear): Deleted.
(table): Deleted.
(profile): Deleted.
(profileEnd): Deleted.
(keys): Deleted.
(values): Deleted.
(queryInstances): Deleted.
(queryObjects): Deleted.
(queryHolders): Deleted.

Source/WebCore:

Expose all `console.*` functions in the command line API, since they're all already able to
be referenced via the `console` object.

Provide a simpler interface for other injected scripts to modify the command line API.

* inspector/CommandLineAPIModuleSource.js:
(injectedScript._inspectObject): Added.
(normalizeEventTypes): Added.
(logEvent): Added.
(canQuerySelectorOnNode): Added.
(bind): Deleted.
(value): Deleted.
(this.method.toString): Deleted.
(CommandLineAPI): Deleted.
(CommandLineAPIImpl): Deleted.
(CommandLineAPIImpl.prototype): Deleted.
(CommandLineAPIImpl.prototype._canQuerySelectorOnNode): Deleted.
(CommandLineAPIImpl.prototype.x): Deleted.
(CommandLineAPIImpl.prototype.dir): Deleted.
(CommandLineAPIImpl.prototype.dirxml): Deleted.
(CommandLineAPIImpl.prototype.keys): Deleted.
(CommandLineAPIImpl.prototype.values): Deleted.
(CommandLineAPIImpl.prototype.profile): Deleted.
(CommandLineAPIImpl.prototype.profileEnd): Deleted.
(CommandLineAPIImpl.prototype.table): Deleted.
(CommandLineAPIImpl.prototype.screenshot): Deleted.
(CommandLineAPIImpl.prototype.monitorEvents): Deleted.
(CommandLineAPIImpl.prototype.unmonitorEvents): Deleted.
(CommandLineAPIImpl.prototype.inspect): Deleted.
(CommandLineAPIImpl.prototype.queryInstances): Deleted.
(CommandLineAPIImpl.prototype.queryObjects): Deleted.
(CommandLineAPIImpl.prototype.queryHolders): Deleted.
(CommandLineAPIImpl.prototype.copy): Deleted.
(CommandLineAPIImpl.prototype.clear): Deleted.
(CommandLineAPIImpl.prototype.getEventListeners): Deleted.
(CommandLineAPIImpl.prototype._inspectedObject): Deleted.
(CommandLineAPIImpl.prototype._normalizeEventTypes): Deleted.
(CommandLineAPIImpl.prototype._logEvent): Deleted.
(CommandLineAPIImpl.prototype._inspect): Deleted.

Source/WebInspectorUI:

Expose all `console.*` functions in the command line API, since they're all already able to
be referenced via the `console` object.

Provide a simpler interface for other injected scripts to modify the command line API.

* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.prototype.get _commandLineAPIKeys): Added.
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.updateLastPropertyNames):
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedPropertyNames):

LayoutTests:

* http/tests/inspector/dom/cross-domain-inspected-node-access-expected.txt:
* inspector/console/command-line-api-expected.txt:

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

9 months agoCrash under TimerBase::setNextFireTime() in the NetworkProcess
cdumez@apple.com [Sat, 24 Aug 2019 00:24:11 +0000 (00:24 +0000)]
Crash under TimerBase::setNextFireTime() in the NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=201097
<rdar://problem/54658339>

Reviewed by Ryosuke Niwa.

NetworkStateNotifier is a WebCore/platform class used by both WebKitLegacy and WebKit2 in the NetworkProcess.
On iOS, the lambda in the implementation of NetworkStateNotifier::startObserving() may get called by the
underlying framework on a non-main thread and we therefore want to go back to the main thread before calling
NetworkStateNotifier::singleton().updateStateSoon(). This is important because updateStateSoon() will schedule
a WebCore::Timer. The issue is that the code was using WebThreadRun() to go back the the main thread. While
this works fine in iOS WK1, it does not do what we want in WebKit2 in the network process. Indeed, before there
is no WebThread in the network process, WebThreadRun() will simply run the block on whatever thread we're one.
This would lead to crashes when trying to schedule the Timer in updateStateSoon(). To address the issue, we now
use callOnMainThread().

* platform/network/ios/NetworkStateNotifierIOS.mm:
(WebCore::NetworkStateNotifier::startObserving):

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

9 months agoREGRESSION (r248807): Objects stored in ElementRareData are leaked
rniwa@webkit.org [Sat, 24 Aug 2019 00:20:57 +0000 (00:20 +0000)]
REGRESSION (r248807): Objects stored in ElementRareData are leaked
https://bugs.webkit.org/show_bug.cgi?id=200954

Reviewed by David Kilzer.

NodeRareData didn't have a virtual destructor. As a result, member variables
of ElementRareData did not get destructed properly.

* dom/NodeRareData.cpp:
* dom/NodeRareData.h:
(WebCore::NodeRareData::~NodeRareData):

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

9 months agoRemove MaximalFlushInsertionPhase
tzagallo@apple.com [Fri, 23 Aug 2019 23:08:06 +0000 (23:08 +0000)]
Remove MaximalFlushInsertionPhase
https://bugs.webkit.org/show_bug.cgi?id=201036

Reviewed by Saam Barati.

JSTests:

Remove all the references to maximal flush

* stress/arith-ceil-on-various-types.js:
(checkCompileCountForUselessNegativeZero):
* stress/arith-floor-on-various-types.js:
(checkCompileCountForUselessNegativeZero):
* stress/arith-negate-on-various-types.js:
(checkCompileCountForUselessNegativeZero):
* stress/arith-round-on-various-types.js:
(checkCompileCountForUselessNegativeZero):
* stress/arith-trunc-on-various-types.js:
(checkCompileCountForUselessNegativeZero):
* stress/dfg-compare-eq-via-nonSpeculativeNonPeepholeCompareNullOrUndefined.js:
* stress/has-indexed-property-should-accept-non-int32.js:
* stress/has-indexed-property-with-worsening-array-mode.js:
* stress/known-int32-cant-be-used-across-bytecode-boundary.js:
* stress/read-dead-bytecode-locals-in-must-handle-values1.js:
* stress/read-dead-bytecode-locals-in-must-handle-values2.js:
* stress/rest-parameter-many-arguments.js:
* stress/set-argument-maybe-maximal-flush-should-not-extend-liveness-2.js:
* stress/set-argument-maybe-maximal-flush-should-not-extend-liveness.js:
* stress/to-index-string-should-not-assume-incoming-value-is-uint32.js:

Source/JavaScriptCore:

Maximal flush has found too many false positives recently, so we decided it's finally time
to remove it instead of hacking it to fix the most recent false positive.

The most recent false positive was caused by a LoadVarargs followed by a SetArgumentDefinitely
for the argument count that was being flushed in a much later block. Now, since that block was
the head of a loop, and there was a SetLocal in the same block to the same variable, this
generated a Phi of both values, which then led to the unification of their VariableAccessData
in the unification phase. This caused AI to assign the Int52 type to argument count, which
broke the AI’s assumption that it should always be an Int32.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleVarargsInlining):
* dfg/DFGMaximalFlushInsertionPhase.cpp: Removed.
* dfg/DFGMaximalFlushInsertionPhase.h: Removed.
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThreadImpl):
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):
* runtime/Options.h:

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

9 months ago[iOS] [WebKit2] Tapping on the “I’m” text suggestion after typing “i’” does nothing
wenson_hsieh@apple.com [Fri, 23 Aug 2019 23:00:38 +0000 (23:00 +0000)]
[iOS] [WebKit2] Tapping on the “I’m” text suggestion after typing “i’” does nothing
https://bugs.webkit.org/show_bug.cgi?id=201085
<rdar://problem/53056118>

Reviewed by Tim Horton.

Source/WebCore:

Exposes an existing quote folding function as a helper on TextIterator, and also adjusts foldQuoteMarks to take
a const String& rather than a String. See WebKit ChangeLog for more details.

* editing/TextIterator.cpp:
(WebCore::foldQuoteMarks):
(WebCore::SearchBuffer::SearchBuffer):
* editing/TextIterator.h:

Source/WebKit:

Currently, logic in applyAutocorrectionInternal only selects the range to autocorrect if the text of the range
matches the string to replace (delivered to us from UIKit). In the case of changing "I’" to "I’m", the string to
replace is "I'" (with a straight quote rather than an apostrophe), even though the DOM contains an apostrophe.

This is because kbd believes that the document context contains straight quotes (rather than apostrophes). For
native text views, this works out because UIKit uses relative UITextPositions to determine the replacement
range rather than by checking against the contents of the document. However, WKWebView does not have the ability
to synchronously compute and reason about arbitrary UITextPositions relative to the selection, so we instead
search for the string near the current selection when applying autocorrections.

Of course, this doesn't work in this scenario because the replacement string contains a straight quote, yet the
text node contains an apostrophe, so we bail and don't end up replacing any text. To address this, we repurpose
TextIterator helpers currently used to allow find-in-page to match straight quotes against apostrophes; instead
of matching the replacement string exactly, we instead match the quote-folded versions of these strings when
finding the range to replace.

Test: fast/events/ios/autocorrect-with-apostrophe.html

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::applyAutocorrectionInternal):

LayoutTests:

Add a new layout test to verify that "I’" can be autocorrected to "I’m".

* fast/events/ios/autocorrect-with-apostrophe-expected.txt: Added.
* fast/events/ios/autocorrect-with-apostrophe.html: Added.

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

9 months agoUnreviewed WinCairo build fix following r249058.
ross.kirsling@sony.com [Fri, 23 Aug 2019 22:56:58 +0000 (22:56 +0000)]
Unreviewed WinCairo build fix following r249058.

* API/tests/testapi.cpp:
(TestAPI::callFunction):
WinCairo chokes on `JSValueRef args[sizeof...(arguments)]` when there are no arguments, but AppleWin does not...
MSVC must have changed somehow.

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

9 months agoREGRESSION (r248974): fast/events/ios/key-command-delete-to-end-of-paragraph.html...
timothy_horton@apple.com [Fri, 23 Aug 2019 22:54:48 +0000 (22:54 +0000)]
REGRESSION (r248974): fast/events/ios/key-command-delete-to-end-of-paragraph.html is timing out on iOS
https://bugs.webkit.org/show_bug.cgi?id=201091
<rdar://problem/54647731>

Reviewed by Megan Gardner.

* fast/events/ios/key-command-delete-to-end-of-paragraph.html:
The test as-written doesn't actually wait for the tap to complete before
continuing on with the test - it starts immediately when the focus event
fires. This results in the selection being changed by the single click
handler *after* focusing the field.

Rewrite the test to await completion of the tap before moving forward
instead of waiting for focus.

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

9 months agoRemove IDBDatabaseIdentifier::m_mainFrameOrigin
youenn@apple.com [Fri, 23 Aug 2019 21:37:03 +0000 (21:37 +0000)]
Remove IDBDatabaseIdentifier::m_mainFrameOrigin
https://bugs.webkit.org/show_bug.cgi?id=201078

Reviewed by Darin Adler.

No change of behavior.

* Modules/indexeddb/IDBDatabaseIdentifier.h:

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

9 months ago[WASM-References] Do not overwrite argument registers in jsCallEntrypoint
justin_michaud@apple.com [Fri, 23 Aug 2019 21:33:08 +0000 (21:33 +0000)]
[WASM-References] Do not overwrite argument registers in jsCallEntrypoint
https://bugs.webkit.org/show_bug.cgi?id=200952

Reviewed by Saam Barati.

JSTests:

* wasm/references/func_ref.js:
(assert.throws):

Source/JavaScriptCore:

The c call that we emitted was incorrect. If we had an int argument that was supposed to be placed in GPR0 by this loop,
we would clobber it while making the call (among many other possible registers). To fix this, we just inline the call
to isWebassemblyHostFunction.

* wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):

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

9 months agoUnreviewed, build fix after r249059
jiewen_tan@apple.com [Fri, 23 Aug 2019 21:21:51 +0000 (21:21 +0000)]
Unreviewed, build fix after r249059

Source/WebKit:

* UIProcess/WebAuthentication/Cocoa/NfcConnection.mm:
(WebKit::NfcConnection::NfcConnection):
Remove the HAVE() macro.

Source/WTF:

* wtf/Platform.h:
Make HAVE_NEAR_FIELD available only on iOS 13+ and macOS Catalina+.

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

9 months agoIncrease log level for watchlist result
aakash_jain@apple.com [Fri, 23 Aug 2019 21:06:02 +0000 (21:06 +0000)]
Increase log level for watchlist result
https://bugs.webkit.org/show_bug.cgi?id=201081

Reviewed by Jonathan Bedard.

* Scripts/webkitpy/tool/steps/applywatchlist.py: Increased log level.
* Scripts/webkitpy/tool/steps/applywatchlist_unittest.py: Updated unit-tests.
* Scripts/webkitpy/tool/commands/applywatchlistlocal_unittest.py: Ditto.

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

9 months ago[geolocation] Rename interfaces and remove [NoInterfaceObject]
cdumez@apple.com [Fri, 23 Aug 2019 20:58:49 +0000 (20:58 +0000)]
[geolocation] Rename interfaces and remove [NoInterfaceObject]
https://bugs.webkit.org/show_bug.cgi?id=200885

Reviewed by Alex Christensen.

Source/WebCore:

Rename Geolocation interfaces and expose them on the global Window object to match the
latest specification:
- https://w3c.github.io/geolocation-api/#api_description

Test: fast/dom/Geolocation/exposed-geolocation-interfaces.html

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Headers.cmake:
* Modules/geolocation/GeoNotifier.cpp:
(WebCore::GeoNotifier::setFatalError):
(WebCore::GeoNotifier::runSuccessCallback):
(WebCore::GeoNotifier::runErrorCallback):
(WebCore::GeoNotifier::timerFired):
* Modules/geolocation/GeoNotifier.h:
* Modules/geolocation/Geolocation.cpp:
(WebCore::createGeolocationPosition):
(WebCore::createGeolocationPositionError):
(WebCore::Geolocation::lastPosition):
(WebCore::Geolocation::startRequest):
(WebCore::Geolocation::requestUsesCachedPosition):
(WebCore::Geolocation::makeCachedPositionCallbacks):
(WebCore::Geolocation::haveSuitableCachedPosition):
(WebCore::Geolocation::setIsAllowed):
(WebCore::Geolocation::sendError):
(WebCore::Geolocation::sendPosition):
(WebCore::Geolocation::cancelRequests):
(WebCore::Geolocation::handleError):
(WebCore::Geolocation::makeSuccessCallbacks):
(WebCore::Geolocation::positionChanged):
(WebCore::Geolocation::setError):
(WebCore::Geolocation::handlePendingPermissionNotifiers):
* Modules/geolocation/Geolocation.h:
* Modules/geolocation/Geolocation.idl:
* Modules/geolocation/GeolocationClient.h:
* Modules/geolocation/GeolocationController.cpp:
(WebCore::GeolocationController::positionChanged):
(WebCore::GeolocationController::lastPosition):
* Modules/geolocation/GeolocationController.h:
* Modules/geolocation/GeolocationCoordinates.cpp: Renamed from Source/WebCore/Modules/geolocation/Coordinates.cpp.
(WebCore::GeolocationCoordinates::GeolocationCoordinates):
* Modules/geolocation/GeolocationCoordinates.h: Renamed from Source/WebCore/Modules/geolocation/Coordinates.h.
(WebCore::GeolocationCoordinates::create):
(WebCore::GeolocationCoordinates::isolatedCopy const):
* Modules/geolocation/GeolocationCoordinates.idl: Renamed from Source/WebCore/Modules/geolocation/Coordinates.idl.
* Modules/geolocation/GeolocationPosition.h:
(WebCore::GeolocationPosition::create):
(WebCore::GeolocationPosition::isolatedCopy const):
(WebCore::GeolocationPosition::timestamp const):
(WebCore::GeolocationPosition::coords const):
(WebCore::GeolocationPosition::GeolocationPosition):
* Modules/geolocation/GeolocationPosition.idl: Renamed from Source/WebCore/Modules/geolocation/Geoposition.idl.
* Modules/geolocation/GeolocationPositionData.h: Copied from Source/WebCore/Modules/geolocation/GeolocationPosition.h.
(WebCore::GeolocationPositionData::GeolocationPositionData):
(WebCore::GeolocationPositionData::encode const):
(WebCore::GeolocationPositionData::decode):
(WebCore::GeolocationPositionData::isValid const):
* Modules/geolocation/GeolocationPositionError.h: Renamed from Source/WebCore/Modules/geolocation/PositionError.h.
(WebCore::GeolocationPositionError::create):
(WebCore::GeolocationPositionError::GeolocationPositionError):
* Modules/geolocation/GeolocationPositionError.idl: Renamed from Source/WebCore/Modules/geolocation/PositionError.idl.
* Modules/geolocation/Geoposition.h: Removed.
* Modules/geolocation/PositionCallback.h:
* Modules/geolocation/PositionCallback.idl:
* Modules/geolocation/PositionErrorCallback.h:
* Modules/geolocation/PositionErrorCallback.idl:
* Modules/geolocation/ios/GeolocationPositionDataIOS.mm: Renamed from Source/WebCore/Modules/geolocation/ios/GeolocationPositionIOS.mm.
(WebCore::GeolocationPositionData::GeolocationPositionData):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/mock/GeolocationClientMock.cpp:
(WebCore::GeolocationClientMock::setPosition):
(WebCore::GeolocationClientMock::lastPosition):
* platform/mock/GeolocationClientMock.h:

Source/WebKit:

* Shared/WebGeolocationPosition.cpp:
(WebKit::WebGeolocationPosition::create):
* Shared/WebGeolocationPosition.h:
(WebKit::WebGeolocationPosition::corePosition const):
(WebKit::WebGeolocationPosition::WebGeolocationPosition):
* UIProcess/API/C/WKGeolocationPosition.cpp:
(WKGeolocationPositionCreate_c):
* UIProcess/WebGeolocationManagerProxy.h:
(WebKit::WebGeolocationManagerProxy::lastPosition const):
* UIProcess/ios/WKGeolocationProviderIOS.mm:
(-[WKLegacyCoreLocationProvider positionChanged:]):
* WebProcess/Geolocation/WebGeolocationManager.cpp:
(WebKit::WebGeolocationManager::didChangePosition):
* WebProcess/Geolocation/WebGeolocationManager.h:
* WebProcess/Geolocation/WebGeolocationManager.messages.in:
* WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
(WebKit::WebGeolocationClient::lastPosition):
* WebProcess/WebCoreSupport/WebGeolocationClient.h:

Source/WebKitLegacy/ios:

* Misc/WebGeolocationCoreLocationProvider.h:
* Misc/WebGeolocationCoreLocationProvider.mm:
(-[WebGeolocationCoreLocationProvider sendLocation:]):
* Misc/WebGeolocationProviderIOS.mm:
(-[_WebCoreLocationUpdateThreadingProxy positionChanged:]):

Source/WebKitLegacy/mac:

* WebCoreSupport/WebGeolocationClient.h:
* WebCoreSupport/WebGeolocationClient.mm:
(WebGeolocationClient::lastPosition):
* WebView/WebGeolocationPosition.mm:
(-[WebGeolocationPositionInternal initWithCoreGeolocationPosition:]):
(core):
(-[WebGeolocationPosition initWithTimestamp:latitude:longitude:accuracy:]):
(-[WebGeolocationPosition initWithGeolocationPosition:]):
* WebView/WebGeolocationPositionInternal.h:

Tools:

* DumpRenderTree/mac/TestRunnerMac.mm:
(TestRunner::setMockGeolocationPosition):

LayoutTests:

Add layout test coverage.

* fast/dom/Geolocation/exposed-geolocation-interfaces-expected.txt: Added.
* fast/dom/Geolocation/exposed-geolocation-interfaces.html: Added.
* fast/dom/Geolocation/position-string-expected.txt:
* fast/dom/Geolocation/position-string.html:

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

9 months agoUndo disabling of IsoHeaps when Gigacage is off.
mark.lam@apple.com [Fri, 23 Aug 2019 20:55:28 +0000 (20:55 +0000)]
Undo disabling of IsoHeaps when Gigacage is off.
https://bugs.webkit.org/show_bug.cgi?id=201061
<rdar://problem/54622500>

Reviewed by Saam Barati and Michael Saboff.

* CMakeLists.txt:
* bmalloc.xcodeproj/project.pbxproj:
* bmalloc/IsoTLS.cpp:
(bmalloc::IsoTLS::determineMallocFallbackState):
* bmalloc/PerThread.cpp: Removed.
* bmalloc/PerThread.h:

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

9 months agoRegression(r248533) Assertion hit in isMainThread() for some clients using WTF becaus...
cdumez@apple.com [Fri, 23 Aug 2019 20:31:08 +0000 (20:31 +0000)]
Regression(r248533) Assertion hit in isMainThread() for some clients using WTF because the main thread is not initialized
https://bugs.webkit.org/show_bug.cgi?id=201083

Reviewed by Alex Christensen.

An assertion is hit in isMainThread() for some clients using WTF because the main thread is not initialized, since r248533.
Clients can work around this by calling WTF::initializeMainThread() before using WTF but it seems unfortunate to force them
to do so. I propose we disable the assertion until the main thread is initialized.

* wtf/MainThread.h:
* wtf/RefCounted.h:
(WTF::RefCountedBase::RefCountedBase):
(WTF::RefCountedBase::applyRefDerefThreadingCheck const):
* wtf/cocoa/MainThreadCocoa.mm:
(WTF::isMainThreadInitialized):
* wtf/generic/MainThreadGeneric.cpp:
(WTF::isMainThreadInitialized):

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

9 months agoUnreviewed, rolling out r249001.
ryanhaddad@apple.com [Fri, 23 Aug 2019 20:23:21 +0000 (20:23 +0000)]
Unreviewed, rolling out r249001.

Caused one layout test to fail on all configurations and
another to time out on Catalina / iOS 13.

Reverted changeset:

"Add a WebsiteDataStore delegate to handle
AuthenticationChallenge that do not come from pages"
https://bugs.webkit.org/show_bug.cgi?id=196870
https://trac.webkit.org/changeset/249001

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

9 months agoREGRESSION(r248713): WebDriver commands which target the implicit main frame now...
bburg@apple.com [Fri, 23 Aug 2019 19:35:02 +0000 (19:35 +0000)]
REGRESSION(r248713): WebDriver commands which target the implicit main frame now hit an ASSERT
https://bugs.webkit.org/show_bug.cgi?id=200793
<rdar://problem/54516988>

Reviewed by Chris Dumez.

SimulatedInputDispatcher and its callers need to support Optional<FrameIdentifier>
and WTF::nullopt as an encoding for the implicit main frame.

* UIProcess/Automation/SimulatedInputDispatcher.h:
* UIProcess/Automation/SimulatedInputDispatcher.cpp:
(WebKit::SimulatedInputDispatcher::resolveLocation):
(WebKit::SimulatedInputDispatcher::run):

* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
(WebKit::WebAutomationSession::performInteractionSequence):
(WebKit::WebAutomationSession::cancelInteractionSequence):

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

9 months agoresults.webkit.org: Escape html in changelog
jbedard@apple.com [Fri, 23 Aug 2019 19:25:31 +0000 (19:25 +0000)]
results.webkit.org: Escape html in changelog
https://bugs.webkit.org/show_bug.cgi?id=201025
<rdar://problem/54564837>

Reviewed by Darin Adler.

* resultsdbpy/resultsdbpy/view/commit_view.py:
(CommitView.commit): Output a dictionary instead of a JSON encoded string.
* resultsdbpy/resultsdbpy/view/templates/commit.html: Unpack commits dictionary
directly into a JavaScript dictionary.

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

9 months agoREGRESSION: fast/events/pointer/ios/drag-gives-pointerdown-pointermove-pointerup...
commit-queue@webkit.org [Fri, 23 Aug 2019 19:21:32 +0000 (19:21 +0000)]
REGRESSION: fast/events/pointer/ios/drag-gives-pointerdown-pointermove-pointerup.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=201075
<rdar://problem/54491246>

Patch by Antoine Quint <graouts@apple.com> on 2019-08-23
Reviewed by Daniel Bates.

This test was written very early on in the process of implementing Pointer Events and assumed events would keep
firing when scrolling occured. We need to add "touch-action: none" to ensure we get pointermove and pointerup
events. We also need to ensure that the interaction occurs over content otherwise events won't fire. Finally, we
pretty up the test a bit.

* fast/events/pointer/ios/drag-gives-pointerdown-pointermove-pointerup-expected.txt:
* fast/events/pointer/ios/drag-gives-pointerdown-pointermove-pointerup.html:

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

9 months ago[WebAuthn] Support NFC authenticators for iOS
jiewen_tan@apple.com [Fri, 23 Aug 2019 18:56:03 +0000 (18:56 +0000)]
[WebAuthn] Support NFC authenticators for iOS
https://bugs.webkit.org/show_bug.cgi?id=188624
<rdar://problem/43354214>

Reviewed by Chris Dumez.

Source/WebCore:

Tests: http/wpt/webauthn/ctap-nfc-failure.https.html
       http/wpt/webauthn/public-key-credential-create-failure-nfc.https.html
       http/wpt/webauthn/public-key-credential-create-success-nfc.https.html
       http/wpt/webauthn/public-key-credential-get-failure-nfc.https.html
       http/wpt/webauthn/public-key-credential-get-success-nfc.https.html

* Modules/webauthn/apdu/ApduResponse.h:
Adds a new method to support moving m_data.
* Modules/webauthn/fido/FidoConstants.h:
Adds constants for NFC applet selection.

Source/WebKit:

This patch implements support for NFC authenticators including both FIDO2 and U2F ones. It utilizes a private
framework called NearField instead of CoreNFC to be able to supply a custom UI later if necessary.

The patch follows almost the same flow as previous HID and Local authenticator support.
1) Discovery is via NfcService which will invoke NFHardwareManager to start a generic NFC reader session.
2) Once a reader session is established, a NfcConnection is created to start the polling and register the WKNFReaderSessionDelegate
to wait for 'didDetectTags'.
3) When tags are detected, NfcConnection will determine if it meets our requriements: { type, connectability, fido applet availability }.
The first tag that meets all requirement will then be returned for WebAuthn operations.
4) The first WebAuthn operation is to send authenticatorGetInfo command to determine the supported protocol, and then initialize corresponding
authenticators. Noted, the sending/receiving of this command is now abstracted into FidoService which will be shared across HidService and NfcService.
5) From then, the actual WebAuthn request, either makeCredential or getAssertion will be sent.

For testing, this patch follows the same flow as well.
1) MockNfcService overrides NfcService to mock the behavior of NFC Tags discovery.
2) The same class also swizzles methods from NFReaderSession to mock tag connection and communication.

* Platform/spi/Cocoa/NearFieldSPI.h: Added.
* Sources.txt:
* SourcesCocoa.txt:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManagerInternal::collectTransports):
* UIProcess/WebAuthentication/AuthenticatorTransportService.cpp:
(WebKit::AuthenticatorTransportService::create):
(WebKit::AuthenticatorTransportService::createMock):
* UIProcess/WebAuthentication/Cocoa/HidService.h:
* UIProcess/WebAuthentication/Cocoa/HidService.mm:
(WebKit::HidService::HidService):
(WebKit::HidService::deviceAdded):
(WebKit::HidService::continueAddDeviceAfterGetInfo): Deleted.
* UIProcess/WebAuthentication/Cocoa/NearFieldSoftLink.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
* UIProcess/WebAuthentication/Cocoa/NearFieldSoftLink.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
* UIProcess/WebAuthentication/Cocoa/NfcConnection.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
* UIProcess/WebAuthentication/Cocoa/NfcConnection.mm: Added.
(WebKit::fido::compareVersion):
(WebKit::NfcConnection::NfcConnection):
(WebKit::NfcConnection::~NfcConnection):
(WebKit::NfcConnection::transact const):
(WebKit::NfcConnection::didDetectTags const):
* UIProcess/WebAuthentication/Cocoa/NfcService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
* UIProcess/WebAuthentication/Cocoa/NfcService.mm: Added.
(WebKit::NfcService::NfcService):
(WebKit::NfcService::~NfcService):
(WebKit::NfcService::didConnectTag):
(WebKit::NfcService::startDiscoveryInternal):
(WebKit::NfcService::platformStartDiscovery):
* UIProcess/WebAuthentication/Cocoa/WKNFReaderSessionDelegate.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
* UIProcess/WebAuthentication/Cocoa/WKNFReaderSessionDelegate.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
(-[WKNFReaderSessionDelegate initWithConnection:]):
(-[WKNFReaderSessionDelegate readerSession:didDetectTags:]):
* UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
(WebKit::MockHidConnection::send):
(WebKit::MockHidConnection::registerDataReceivedCallbackInternal):
(WebKit::MockHidConnection::parseRequest):
(WebKit::MockHidConnection::feedReports):
(WebKit::MockHidConnection::shouldContinueFeedReports):
* UIProcess/WebAuthentication/Mock/MockNfcService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
* UIProcess/WebAuthentication/Mock/MockNfcService.mm: Added.
(-[WKMockNFTag type]):
(-[WKMockNFTag initWithNFTag:]):
(-[WKMockNFTag description]):
(-[WKMockNFTag isEqualToNFTag:]):
(-[WKMockNFTag initWithType:]):
(WebKit::MockNfcService::MockNfcService):
(WebKit::MockNfcService::transceive):
(WebKit::MockNfcService::platformStartDiscovery):
(WebKit::MockNfcService::detectTags const):
* UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
* UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
* UIProcess/WebAuthentication/fido/CtapAuthenticator.h:
* UIProcess/WebAuthentication/fido/CtapNfcDriver.cpp: Added.
(WebKit::CtapNfcDriver::CtapNfcDriver):
(WebKit::CtapNfcDriver::transact):
(WebKit::CtapNfcDriver::respondAsync const):
* UIProcess/WebAuthentication/fido/CtapNfcDriver.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
* UIProcess/WebAuthentication/fido/FidoService.cpp: Added.
(WebKit::FidoService::FidoService):
(WebKit::FidoService::getInfo):
(WebKit::FidoService::continueAfterGetInfo):
* UIProcess/WebAuthentication/fido/FidoService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
* UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp:
* UIProcess/WebAuthentication/fido/U2fAuthenticator.h:
* UIProcess/ios/WebPageProxyIOS.mm:
* WebKit.xcodeproj/project.pbxproj:

Source/WTF:

* wtf/Platform.h:
Add a feature flag for NearField.

Tools:

* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setWebAuthenticationMockConfiguration):
Setup NFC mock testing configuration.

LayoutTests:

* http/wpt/webauthn/ctap-nfc-failure.https-expected.txt: Added.
* http/wpt/webauthn/ctap-nfc-failure.https.html: Added.
* http/wpt/webauthn/public-key-credential-create-failure-nfc.https-expected.txt: Added.
* http/wpt/webauthn/public-key-credential-create-failure-nfc.https.html: Added.
* http/wpt/webauthn/public-key-credential-create-success-hid.https-expected.txt:
* http/wpt/webauthn/public-key-credential-create-success-hid.https.html:
This patch replaces the "local" keyword with "hid".
* http/wpt/webauthn/public-key-credential-create-success-nfc.https-expected.txt: Added.
* http/wpt/webauthn/public-key-credential-create-success-nfc.https.html: Added.
* http/wpt/webauthn/public-key-credential-get-failure-nfc.https-expected.txt: Added.
* http/wpt/webauthn/public-key-credential-get-failure-nfc.https.html: Added.
* http/wpt/webauthn/public-key-credential-get-success-nfc.https-expected.txt: Added.
* http/wpt/webauthn/public-key-credential-get-success-nfc.https.html: Added.
* http/wpt/webauthn/resources/util.js:
* platform/ios-simulator-wk2/TestExpectations:
Skip NFC tests for simulators.

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

9 months agoJSC should have public API for unhandled promise rejections
ross.kirsling@sony.com [Fri, 23 Aug 2019 18:51:20 +0000 (18:51 +0000)]
JSC should have public API for unhandled promise rejections
https://bugs.webkit.org/show_bug.cgi?id=197172

Reviewed by Keith Miller.

Source/JavaScriptCore:

This patch makes it possible to register a unhandled promise rejection callback via the JSC API.
Since there is no event loop in such an environment, this callback fires off of the microtask queue.
The callback receives the promise and rejection reason as arguments and its return value is ignored.

* API/JSContextRef.cpp:
(JSGlobalContextSetUnhandledRejectionCallback): Added.
* API/JSContextRefPrivate.h:
Add new C++ API call.

* API/tests/testapi.cpp:
(TestAPI::promiseResolveTrue): Clean up test output.
(TestAPI::promiseRejectTrue): Clean up test output.
(TestAPI::promiseUnhandledRejection): Added.
(TestAPI::promiseUnhandledRejectionFromUnhandledRejectionCallback): Added.
(TestAPI::promiseEarlyHandledRejections): Added.
(testCAPIViaCpp):
Add new C++ API test.

* jsc.cpp:
(GlobalObject::finishCreation):
(functionSetUnhandledRejectionCallback): Added.
Add corresponding global to JSC shell.

* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::setUnhandledRejectionCallback): Added.
(JSC::JSGlobalObject::unhandledRejectionCallback const): Added.
Keep a strong reference to the callback.

* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncHostPromiseRejectionTracker):
Add default behavior.

* runtime/VM.cpp:
(JSC::VM::callPromiseRejectionCallback): Added.
(JSC::VM::didExhaustMicrotaskQueue): Added.
(JSC::VM::promiseRejected): Added.
(JSC::VM::drainMicrotasks):
When microtask queue is exhausted, deal with any pending unhandled rejections
(in a manner based on RejectedPromiseTracker's reportUnhandledRejections),
then make sure this didn't cause any new microtasks to be added to the queue.

* runtime/VM.h:
Store unhandled rejections.
(This collection will always be empty in the presence of WebCore.)

Source/WebCore:

* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::promiseRejectionTracker):
Move JSInternalPromise early-out to JSC side.

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

9 months agoWeb Inspector: transparency checkerboard is too bright in dark mode
drousso@apple.com [Fri, 23 Aug 2019 18:29:59 +0000 (18:29 +0000)]
Web Inspector: transparency checkerboard is too bright in dark mode
https://bugs.webkit.org/show_bug.cgi?id=201067

Reviewed by Joseph Pecoraro.

* UserInterface/Views/Main.css:
(@media (prefers-color-scheme: dark) :matches(img, canvas).show-grid):
* UserInterface/Views/ConsoleMessageView.css:
(.console-message-body > .show-grid):

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

9 months agoSupport ITP on a per-session basis (198923)
commit-queue@webkit.org [Fri, 23 Aug 2019 18:14:43 +0000 (18:14 +0000)]
Support ITP on a per-session basis (198923)
https://bugs.webkit.org/show_bug.cgi?id=198923

Patch by Kate Cheney <katherine_cheney@apple.com> on 2019-08-23
Reviewed by Chris Dumez.

Source/WebCore:

This patch updated the data structure used to collect resource load
statistics in order to support ITP data collection on a per session
basis. Each sessionID is stored as a key-value pair with its own map
of ResourceLoadStatistics.

It also updated the statisticsForURL function call to perform lookups
of URL data based on sessionID.

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setStatisticsUpdatedCallback):
(WebCore::ResourceLoadObserver::shouldLog const):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
(WebCore::ResourceLoadObserver::logFontLoad):
(WebCore::ResourceLoadObserver::logCanvasRead):
(WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
(WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
(WebCore::ResourceLoadObserver::logScreenAPIAccessed):
(WebCore::ResourceLoadObserver::ensureResourceStatisticsForRegistrableDomain):
(WebCore::ResourceLoadObserver::statisticsForURL):
(WebCore::ResourceLoadObserver::takeStatistics):
(WebCore::ResourceLoadObserver::clearState):
* loader/ResourceLoadObserver.h:
* testing/Internals.cpp:
(WebCore::Internals::resourceLoadStatisticsForURL):

Source/WebKit:

The original implementation of resourceLoadStatisticsUpdated
did not allow for ITP on a per session basis due to the sessionID
not being passed to the resourceLoadStatisticsUpdated function.
This patch allows access of the correct networkSession by passing
all resourceLoadStatistics in a new data structure of key-value
pairs, where the sessionID is the key.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* WebProcess/WebProcess.cpp:

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

9 months agoVirtualRegister::dump() can use more informative CallFrame header slot names.
mark.lam@apple.com [Fri, 23 Aug 2019 17:21:19 +0000 (17:21 +0000)]
VirtualRegister::dump() can use more informative CallFrame header slot names.
https://bugs.webkit.org/show_bug.cgi?id=201062

Reviewed by Tadeu Zagallo.

For example, it currently dumps head3 instead of callee.  This patch changes the
dump as follows (for 64-bit addressing):
    head0 => callerFrame
    head1 => returnPC
    head2 => codeBlock
    head3 => callee
    head4 => argumentCount

Now, one might be wondering when would bytecode ever access callerFrame and
returnPC?  The answer is never.  However, I don't think its the role of the
dumper to catch a bug where these header slots are being used.  The dumper's role
is to clearly report them so that we can see that these unexpected values are
being used.

* bytecode/VirtualRegister.cpp:
(JSC::VirtualRegister::dump const):

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

9 months agoUnreviewed, rolling out r249031.
russell_e@apple.com [Fri, 23 Aug 2019 17:15:42 +0000 (17:15 +0000)]
Unreviewed, rolling out r249031.

Causes multiple test failures on iOS simulator

Reverted changeset:

"[iOS] Should show input view when became first responder if
keyboard was showing when the view was resigned"
https://bugs.webkit.org/show_bug.cgi?id=200902
https://trac.webkit.org/changeset/249031

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

9 months agoRemove unnecessary call to enclosingClippingScopes()
simon.fraser@apple.com [Fri, 23 Aug 2019 16:53:02 +0000 (16:53 +0000)]
Remove unnecessary call to enclosingClippingScopes()
https://bugs.webkit.org/show_bug.cgi?id=201063

Reviewed by Zalan Bujtas.

This line of code did nothing, and was left in by mistake. Remove it.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateOverlapMap const):

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

9 months ago[ews] Enable Style queue on new EWS
aakash_jain@apple.com [Fri, 23 Aug 2019 15:47:44 +0000 (15:47 +0000)]
[ews] Enable Style queue on new EWS
https://bugs.webkit.org/show_bug.cgi?id=201071

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/config.json: Enabled the scheduler for Style queue.
* BuildSlaveSupport/ews-app/ews/views/statusbubble.py: Enabled style queue bubble on new EWS.
* QueueStatusServer/config/queues.py: Removed style queue from old EWS.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js:
(BubbleQueueServer): Removed style queue from bot-watcher's dashboard.

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

9 months agoCache hasCompositedScrollableOverflow as a bit on RenderLayer
simon.fraser@apple.com [Fri, 23 Aug 2019 15:31:12 +0000 (15:31 +0000)]
Cache hasCompositedScrollableOverflow as a bit on RenderLayer
https://bugs.webkit.org/show_bug.cgi?id=201065

Reviewed by Zalan Bujtas.

hasCompositedScrollableOverflow() is pretty hot on some compositing-related code paths, and isn't
super cheap, as it checks a Setting and calls into renderer code. Optimize by computing it in
computeScrollDimensions().

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::hasCompositedScrollableOverflow const):
(WebCore::RenderLayer::computeScrollDimensions):
* rendering/RenderLayer.h:

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

9 months agoDon't call clipCrossesPaintingBoundary() when not necessary
simon.fraser@apple.com [Fri, 23 Aug 2019 15:14:46 +0000 (15:14 +0000)]
Don't call clipCrossesPaintingBoundary() when not necessary
https://bugs.webkit.org/show_bug.cgi?id=201064

Reviewed by Zalan Bujtas.

clipCrossesPaintingBoundary() does some RenderLayer ancestor walks, so avoid
calling it when we already know that the clip rects are TemporaryClipRects.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):

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

9 months ago[GStreamer] Hole-punch build is broken
philn@webkit.org [Fri, 23 Aug 2019 10:53:00 +0000 (10:53 +0000)]
[GStreamer] Hole-punch build is broken
https://bugs.webkit.org/show_bug.cgi?id=200972

Reviewed by Žan Doberšek.

This patch fixes link issues when building with
USE_GSTREAMER_HOLEPUNCH enabled, the hole punch client destructor
was missing.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
Remove FAST_ALLOCATED annotation, because:
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
it's now in the base class, along with a default destructor.

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

9 months agoRevert delete-in-input-in-iframe.html and typing-in-input-in-iframe.html to original...
megan_gardner@apple.com [Fri, 23 Aug 2019 07:25:00 +0000 (07:25 +0000)]
Revert delete-in-input-in-iframe.html and typing-in-input-in-iframe.html to original behaviour after r248977 and make associated test autoscroll-input-when-very-zoomed.html more stable
https://bugs.webkit.org/show_bug.cgi?id=201058

Reviewed by Simon Fraser.

delete-in-input-in-iframe and typing-in-input-in-iframe were changed when scrolling was made to work differently in r244141.
They actually did find a bug, and that bug was fixed in r248977, so we put the tests back to test that scolls do not happen.
Also update autoscroll-input-when-very-zoomed which was added to test r248977 to be more robust.

* fast/forms/ios/delete-in-input-in-iframe-expected.txt:
* fast/forms/ios/delete-in-input-in-iframe.html:
* fast/forms/ios/typing-in-input-in-iframe-expected.txt:
* fast/forms/ios/typing-in-input-in-iframe.html:
* fast/scrolling/ios/autoscroll-input-when-very-zoomed.html:

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

9 months ago[SVG] -webkit-clip-path treats url(abc#xyz) as url(#xyz) because it checks only URL...
Hironori.Fujii@sony.com [Fri, 23 Aug 2019 02:06:42 +0000 (02:06 +0000)]
[SVG] -webkit-clip-path treats url(abc#xyz) as url(#xyz) because it checks only URL fragment part
https://bugs.webkit.org/show_bug.cgi?id=201030

Reviewed by Ryosuke Niwa.

Source/WebCore:

Tests: svg/clip-path/clip-path-invalid-reference-001-expected.svg
       svg/clip-path/clip-path-invalid-reference-001.svg
       svg/clip-path/clip-path-invalid-reference-002-expected.svg
       svg/clip-path/clip-path-invalid-reference-002.svg

* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertClipPath): Use
SVGURIReference::fragmentIdentifierFromIRIString to get fragment
identifier from -webkit-clip-path.

LayoutTests:

* svg/clip-path/clip-path-invalid-reference-001-expected.svg: Added.
* svg/clip-path/clip-path-invalid-reference-001.svg: Added.
* svg/clip-path/clip-path-invalid-reference-002-expected.svg: Added.
* svg/clip-path/clip-path-invalid-reference-002.svg: Added.

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

9 months ago[Win][MiniBrowser] URL bar should be updated for in-page navigations
Hironori.Fujii@sony.com [Fri, 23 Aug 2019 01:59:22 +0000 (01:59 +0000)]
[Win][MiniBrowser] URL bar should be updated for in-page navigations
https://bugs.webkit.org/show_bug.cgi?id=201032

Reviewed by Darin Adler.

* MiniBrowser/win/BrowserWindow.h: Added activeURLChanged to BrowserWindowClient interface.
* MiniBrowser/win/MainWindow.cpp:
(MainWindow::init):
(MainWindow::activeURLChanged): Added.
* MiniBrowser/win/MainWindow.h:
* MiniBrowser/win/MiniBrowserWebHost.cpp:
(MiniBrowserWebHost::didCommitLoadForFrame):
(MiniBrowserWebHost::didChangeLocationWithinPageForFrame): Added.
(MiniBrowserWebHost::updateAddressBar): Deleted.
(MiniBrowserWebHost::loadURL): Deleted.
* MiniBrowser/win/MiniBrowserWebHost.h:
(MiniBrowserWebHost::MiniBrowserWebHost):
(MiniBrowserWebHost::didCommitLoadForFrame): Deleted.
(MiniBrowserWebHost::didChangeLocationWithinPageForFrame): Deleted.
* MiniBrowser/win/PrintWebUIDelegate.cpp:
* MiniBrowser/win/WebKitBrowserWindow.cpp:
(WebKitBrowserWindow::create):
(WebKitBrowserWindow::WebKitBrowserWindow):
(WebKitBrowserWindow::didChangeIsLoading): Removed an unused variable.
(WebKitBrowserWindow::didChangeActiveURL): Added.
(WebKitBrowserWindow::createNewPage):
(WebKitBrowserWindow::didCommitNavigation): Deleted.
* MiniBrowser/win/WebKitBrowserWindow.h: Removed m_urlBarWnd.
* MiniBrowser/win/WebKitLegacyBrowserWindow.cpp:
(WebKitLegacyBrowserWindow::create):
(WebKitLegacyBrowserWindow::WebKitLegacyBrowserWindow):
(WebKitLegacyBrowserWindow::init):
(WebKitLegacyBrowserWindow::navigateToHistory):
* MiniBrowser/win/WebKitLegacyBrowserWindow.h: Removed m_urlBarWnd.

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

9 months agoWeb Inspector: Console: automatically select the "Evaluations" filter whenever runnin...
drousso@apple.com [Fri, 23 Aug 2019 01:43:43 +0000 (01:43 +0000)]
Web Inspector: Console: automatically select the "Evaluations" filter whenever running commands
https://bugs.webkit.org/show_bug.cgi?id=201060

Reviewed by Timothy Hatcher.

If the Console is actively being filtered (e.g. not "All"), it can be confusing to run a
command, only to not see any results. We should automatically enable the "Evaluations"
filter in addition to any other existing filters in these cases.

* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype.didAppendConsoleMessageView):
* UserInterface/Views/ScopeBarItem.js:
(WI.ScopeBarItem.prototype.set selected):
(WI.ScopeBarItem.prototype.toggle): Added.

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

9 months agoWeb Inspector: REGRESSION(r248485): stack overflow when viewing a source map generate...
drousso@apple.com [Fri, 23 Aug 2019 01:07:43 +0000 (01:07 +0000)]
Web Inspector: REGRESSION(r248485): stack overflow when viewing a source map generated from inline content
https://bugs.webkit.org/show_bug.cgi?id=201042
<rdar://problem/54509750>

Reviewed by Antoine Quint.

In r248485, `WI.ResourceClusterContentView` was changed to `requestContent` whenever the
given resource finished loading (by listening for `WI.Resource.Event.LoadingDidFinish`).

Even though retrieving a source map's contents uses `Promise`s, in the case that the content
was inlined in the "original" source code, the code path would mark the source map as being
finished (which would fire a `WI.Resource.Event.LoadingDidFinish`) _before_ it could return
a `Promise`, which would've been cached (`WI.SourceCode.prototype.requestContent`) and
preventend any reentrancy.

Wrapping the inline code path in a `Promise.resolve()` gives the `WI.SourceCode` a chance to
cache the `Promise` before any events are fired.

* UserInterface/Models/SourceMapResource.js:
(WI.SourceMapResource.prototype.requestContentFromBackend):

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

9 months ago[watchOS] Disable Content Filtering in the simulator build
aestes@apple.com [Thu, 22 Aug 2019 23:54:59 +0000 (23:54 +0000)]
[watchOS] Disable Content Filtering in the simulator build
https://bugs.webkit.org/show_bug.cgi?id=201047

Reviewed by Tim Horton.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/Platform.h:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

9 months agoTry to recover nicely when getting an unexpected schema in the service workers database
cdumez@apple.com [Thu, 22 Aug 2019 23:28:45 +0000 (23:28 +0000)]
Try to recover nicely when getting an unexpected schema in the service workers database
https://bugs.webkit.org/show_bug.cgi?id=201002
<rdar://problem/54574991>

Reviewed by Youenn Fablet.

Source/WebCore:

Try to recover nicely when getting an unexpected schema in the service workers database instead
of crashing the network process. To recover, we delete the database file and re-create it.

* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::openSQLiteDatabase):
(WebCore::RegistrationDatabase::ensureValidRecordsTable):

Tools:

Add API test coverage.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:

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

9 months agoWeb Inspector: console.dir should expand objects
nvasilyev@apple.com [Thu, 22 Aug 2019 23:17:46 +0000 (23:17 +0000)]
Web Inspector: console.dir should expand objects
https://bugs.webkit.org/show_bug.cgi?id=152039
<rdar://problem/23816853>

Reviewed by Joseph Pecoraro.

Expand objects logged by console.dir but keep them collapsed when logged by console.log.

* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype.render):

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

9 months agoRemove support for tvOS < 13.0
krollin@apple.com [Thu, 22 Aug 2019 22:51:46 +0000 (22:51 +0000)]
Remove support for tvOS < 13.0
https://bugs.webkit.org/show_bug.cgi?id=200963
<rdar://problem/54541355>

Reviewed by Tim Horton.

Update conditionals that reference __TV_OS_VERSION_MIN_REQUIRED and
__TV_OS_VERSION_MAX_ALLOWED, assuming that they both have values >=
130000. This means that expressions like "__TV_OS_VERSION_MIN_REQUIRED
< 130000" are always False and "__TV_OS_VERSION_MIN_REQUIRED >=
130000" are always True.

Source/WebCore/PAL:

* pal/spi/cocoa/NSKeyedArchiverSPI.h:
* pal/spi/cocoa/NSProgressSPI.h:

Source/WTF:

* wtf/FeatureDefines.h:
* wtf/Platform.h:

Tools:

* TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm:
(TestWebKitAPI::TEST):

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

9 months ago[iOS] Should show input view when became first responder if keyboard was showing...
dbates@webkit.org [Thu, 22 Aug 2019 22:22:49 +0000 (22:22 +0000)]
[iOS] Should show input view when became first responder if keyboard was showing when the view was resigned
https://bugs.webkit.org/show_bug.cgi?id=200902
<rdar://problem/54231756>

Reviewed by Wenson Hsieh.

Source/WebKit:

When resigning first responder save whether the peripheral host has an input view on screen,
including the software keyboard, so that we show the input view(s) again when the WKWebView
is made first responder. In Safari, this avoids the need for a person to explicitly focus an
editable element again to bring up the keyboard when returning to a tab they were previously
typing in. It also makes the behavior of switching tabs in Safari with a software keyboard
match the behavior of doing the same thing when a hardware keyboard attached.

* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::focusedElementDidChangeInputMode):
Pass a diff of the activity state from the web process to the UI process so that we can
differentiate between an inputmode change as a result of page deactivation vs a change
caused by some other means. We need to differentiate these cases because we want to
ignore a page that sets inputmode "none" (i.e. a request to hide the keyboard) from inside
a focus event handler if the handler was called as part of the process of page activation
(i.e. switching to the tab). Google Docs is one example of a web site that sets inputmode
to "none" as a result of the page activation process.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]): Clear out state.
(-[WKContentView resignFirstResponderForWebView]): Save whether the peripheral host is on screen
into a local before ending the editing session. We then copy the local into the ivar if we
actually will resign. This ordering is explicitly done because:
        1. Ending the editing session may dismiss the keyboard => we need to query the peripheral
           host first.
        2. If the view is being resigned as a result of a keyboard dismissal (i.e. a person pressed
           the hide keyboard button on iPad) then the user has indicated that they are finished
           with the keyboard and we do not want to show the keyboard on page re-activation => we
           do not want to copy the local to the ivar.
        3. If the view refuses to resign itself then it does not make sense to save the keyboard
           state as responder status hasn't changed.
(-[WKContentView shouldShowAutomaticKeyboardUI]): Ignore inputmode="none", if needed.
(-[WKContentView _didCommitLoadForMainFrame]): Clear out state.
(-[WKContentView isFirstResponderOrBecomingFirstResponder]): Added.
(-[WKContentView shouldShowInputViewOnPageActivation:]): Added.
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
Update ivar if this element is being focused as a result of page activation.
(-[WKContentView _didUpdateInputMode:activityStateChanges:]): Modified to take the activity state
diff. If the input mode was changed as a result of page activation then we want to update our ivar
so that when we call -reloadInputViews and UIKit calls us back in -shouldShowAutomaticKeyboardUI we
will know to ignore inputmode set to "none" when determining whether to show the automatic keyboard UI.
Note that we do not need to check/track whether an earlier -_elementDidFocus actually started an
input session as part of updating the value of our ivar because if an input session was not started,
say the embedding client disallowed it, then we would not have a focused element => we early return from
this function. Also remove duplication and improve code readbility by making use of the convenience function
hasFocusedElement() instead of duplicating what it does.
(-[WKContentView _didUpdateInputMode:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::focusedElementDidChangeInputMode): Modified to take the activity state diff
and pass it through.
(WebKit::WebPageProxy::didReleaseAllTouchPoints): Pass the empty set for the activity state diff to
keep our current behavior.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::focusedElementDidChangeInputMode): Send the activity state diff to the UI process.

LayoutTests:

Add tests to ensure that we show the keyboard when becoming first responder if the view resigned with the
keyboard on screen. Also add a test to ensure that we keep our current behavior and do NOT show the keyboard
for an autofocused text field when the view becomes first responder.

* fast/events/ios/resources/check-keyboard-on-screen.js: Added.
(async.checkKeyboardOnScreen):
(async.checkKeyboardNotOnScreen):
* fast/events/ios/should-not-show-keyboard-for-autofocused-field-when-becoming-first-responder-after-navigation-expected.txt: Added.
* fast/events/ios/should-not-show-keyboard-for-autofocused-field-when-becoming-first-responder-after-navigation.html: Added.
* fast/events/ios/show-keyboard-when-becoming-first-responder-despite-inputmode-none-expected.txt: Added.
* fast/events/ios/show-keyboard-when-becoming-first-responder-despite-inputmode-none.html: Added.
* fast/events/ios/show-keyboard-when-becoming-first-responder-expected.txt: Added.
* fast/events/ios/show-keyboard-when-becoming-first-responder.html: Added.
* resources/ui-helper.js:
(window.UIHelper.waitForKeyboardToShow.return.new.Promise): Added.
(window.UIHelper.waitForKeyboardToShow): Added.
(window.UIHelper.becomeFirstResponder): Added.

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

9 months ago[lldb-webkit] OptionSet summary shows size 0 sometimes for non-empty set
dbates@webkit.org [Thu, 22 Aug 2019 22:06:54 +0000 (22:06 +0000)]
[lldb-webkit] OptionSet summary shows size 0 sometimes for non-empty set
https://bugs.webkit.org/show_bug.cgi?id=200742

Reviewed by Simon Fraser.

The OptionSet synthetic provider must respond to requests for the value of m_storage
(i.e. GetChildMemberWithName('m_storage')) to avoid interfering with the computation
of the type summary.

Synthetic providers substitute alternative debug information (children) for the default
information for a variable. The OptionSet type summary is implemented in terms of the
OptionSet synthetic provider to maximize code reuse. If LLDB instantiates the provider
before invoking the type summary handler then evaluating GetChildMemberWithName() on
the SBValue passed to the type summary handler will access the substitute information
instead of the original debug information. As a result OptionSet's synthetic provider's
get_child_index('m_storage') returns None hence SBValue.GetChildMemberWithName('m_storage')
returned an invalid value; => WTFOptionSetProvider._bitmask() returns 0; => the size
reported in the type summary for the OptionSet is 0. Instead get_child_index('m_storage')
should return a valid value.

* lldb/lldb_webkit.py:
(FlagEnumerationProvider.__init__):
(FlagEnumerationProvider):
(FlagEnumerationProvider._get_child_index): Added. WTFOptionSetProvider will override.
(FlagEnumerationProvider._get_child_at_index): Added. WTFOptionSetProvider will override.
(FlagEnumerationProvider.size): Added.
(FlagEnumerationProvider.get_child_index): Modified to call _get_child_index().
(FlagEnumerationProvider.get_child_at_index): Modified to call _get_child_at_index().
(FlagEnumerationProvider.update): Moved initialization of self._elements to the constructor
and removed self.size. For the latter we can just expose a getter that returns the size of
the list self._elements.
(WTFOptionSetProvider._get_child_index): Added. Return the index for LLDB to query for the
value of m_storage.
(WTFOptionSetProvider):
(WTFOptionSetProvider._get_child_at_index): Added. Return the value for m_storage if it
matches the specified index.
* lldb/lldb_webkit_unittest.py:
(TestSummaryProviders.serial_test_WTFOptionSetProvider_empty): Update expected result now
that we return the value of m_storage as the last synthetic child.

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

9 months agoRemove logging that contains a URL
krollin@apple.com [Thu, 22 Aug 2019 21:43:53 +0000 (21:43 +0000)]
Remove logging that contains a URL
https://bugs.webkit.org/show_bug.cgi?id=201052
<rdar://problem/54613204>

Reviewed by Chris Dumez.

checkURLReceivedFromWebProcess in WebProcessProxy.cpp contains an old
logging line that logs a URL. We don't log URLs any more for privacy
reasons, so remove this.

A search for WTFLogAlways.*url turns up other matches, but those are
either false positives or cases where the URLs are logged only on
demand by the developer as part of debugging.
checkURLReceivedFromWebProcess is the only place where a URL is logged
as a matter of course.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::checkURLReceivedFromWebProcess):

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

9 months agoREGRESSION (r248974): fast/events/ios/select-all-with-existing-selection.html fails
timothy_horton@apple.com [Thu, 22 Aug 2019 21:30:46 +0000 (21:30 +0000)]
REGRESSION (r248974): fast/events/ios/select-all-with-existing-selection.html fails
https://bugs.webkit.org/show_bug.cgi?id=201050

Reviewed by Wenson Hsieh.

* fast/events/ios/select-all-with-existing-selection.html:
The test as-written doesn't actually wait for the tap to complete before
continuing on with the test - it starts immediately when the focus event
fires. This results in the selection being changed by the single click
handler *after* focusing the field.

Rewrite the test to await completion of the tap before moving forward
instead of waiting for focus.

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

9 months agoLogging in FileSystem::deleteFile should avoid logging unsurprising errors
commit-queue@webkit.org [Thu, 22 Aug 2019 21:28:29 +0000 (21:28 +0000)]
Logging in FileSystem::deleteFile should avoid logging unsurprising errors
https://bugs.webkit.org/show_bug.cgi?id=200831

Patch by Kate Cheney <katherine_cheney@apple.com> on 2019-08-22
Reviewed by Chris Dumez.

To avoid overlogging unnecessary information, added a check to avoid logging
ENOENT (file not found) errors.

* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::deleteFile):

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

9 months agoCrash may happen when an SVG <feImage> element references the root <svg> element
said@apple.com [Thu, 22 Aug 2019 21:13:38 +0000 (21:13 +0000)]
Crash may happen when an SVG <feImage> element references the root <svg> element
https://bugs.webkit.org/show_bug.cgi?id=201014

Reviewed by Ryosuke Niwa.

Source/WebCore:

When an <feImage> references an <svg> element as its target image but
this <svg> element is also one of the ancestors of the <feImage>, the
parent <filter> should not be applied.

Test: svg/filters/filter-image-ref-root.html

* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::build const):

LayoutTests:

Ensure the cyclic reference between the <feImage> renderer and its
ancestor <svg> root renderer is broken.

* svg/filters/filter-image-ref-root-expected.txt: Added.
* svg/filters/filter-image-ref-root.html: Added.

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

9 months agoMake ImageBuffer and SVG's FilterData isoheap'ed
rniwa@webkit.org [Thu, 22 Aug 2019 19:25:48 +0000 (19:25 +0000)]
Make ImageBuffer and SVG's FilterData isoheap'ed
https://bugs.webkit.org/show_bug.cgi?id=201029

Reviewed by Simon Fraser.

Made ImageBuffer and RenderSVGResourceFilter use IsoHeap.

* platform/graphics/ImageBuffer.cpp:
* platform/graphics/ImageBuffer.h:
* rendering/svg/RenderSVGResourceFilter.cpp:
* rendering/svg/RenderSVGResourceFilter.h:

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

9 months agoresults.webkit.org: Remove branch and repository information from commit tooltip
jbedard@apple.com [Thu, 22 Aug 2019 19:09:55 +0000 (19:09 +0000)]
results.webkit.org: Remove branch and repository information from commit tooltip
https://bugs.webkit.org/show_bug.cgi?id=201035

Reviewed by Aakash Jain.

* resultsdbpy/resultsdbpy/view/static/js/timeline.js:
(xAxisFromScale): Remove branch and repository information from tooltip.

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

9 months agorun-webkit-tests: Use -noBulkSymbolication when calling spindump
jbedard@apple.com [Thu, 22 Aug 2019 19:04:52 +0000 (19:04 +0000)]
run-webkit-tests: Use -noBulkSymbolication when calling spindump
https://bugs.webkit.org/show_bug.cgi?id=201000
<rdar://problem/53778938>

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/port/darwin.py:
(DarwinPort.sample_process): Attempt to symbolicate with -noBulkSymbolication first.
* Scripts/webkitpy/port/darwin_testcase.py:
(DarwinTest.test_tailspin):
(DarwinTest.test_get_crash_log): Deleted.
* Scripts/webkitpy/port/ios_device_unittest.py:
(IOSDeviceTest.test_tailspin):

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

9 months ago[GTK][WPE] Fixes for non-unified builds after r248547
aperez@igalia.com [Thu, 22 Aug 2019 18:54:34 +0000 (18:54 +0000)]
[GTK][WPE] Fixes for non-unified builds after r248547
https://bugs.webkit.org/show_bug.cgi?id=201044

Reviewed by Philippe Normand.

Source/JavaScriptCore:

* b3/B3ReduceLoopStrength.cpp: Add missing inclusions of B3BasicBlockInlines.h,
B3InsertionSet.h, and B3NaturalLoops.h
* wasm/WasmOMGForOSREntryPlan.h: Include WasmCallee.h instead of forward-declaring
BBQCallee in order to avoid build failure due to incomplete definition on template
expansions.

Source/WebCore:

* platform/audio/AudioResamplerKernel.h: Add missing inclusion of wtf/Noncopyable.h

Source/WebKit:

* NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp: Add missing inclusion of
the wtf/CrossThreadCopier.h header.
* WebProcess/WebStorage/StorageNamespaceImpl.h: Add missing inclusion of the
WebCore/PageIdentifier.h header.

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

9 months ago[results.webkit.org Webkit.css] Change input's disable style
zhifei_fang@apple.com [Thu, 22 Aug 2019 18:50:01 +0000 (18:50 +0000)]
[results.webkit.org Webkit.css] Change input's disable style
The disable input style will always show the label like it has a value
https://bugs.webkit.org/show_bug.cgi?id=200998

Reviewed by Jonathan Bedard.

* resultsdbpy/resultsdbpy/view/static/library/css/docs.yaml: Adding a new example for disabled input that already has a value
*resultsdbpy/resultsdbpy/view/static/library/css/generate-webkit-css-docs:
* resultsdbpy/resultsdbpy/view/static/library/css/index.html:
* resultsdbpy/resultsdbpy/view/static/library/css/webkit.css:
(.input>input[type="text"][required][disabled],.input>input[type="number"][required][disabled],):When disabling a text input element even without a value, the style should match the style of a text input element with a value
(.input>input[type="text"][required][disabled]~label, .input>input[type="number"][required][disabled]~label,):
(@media (prefers-color-scheme: dark)):

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

9 months agoAdd missing exception check in canonicalizeLocaleList
justin_michaud@apple.com [Thu, 22 Aug 2019 18:18:04 +0000 (18:18 +0000)]
Add missing exception check in canonicalizeLocaleList
https://bugs.webkit.org/show_bug.cgi?id=201021

Reviewed by Mark Lam.

JSTests:

* stress/missing-exception-check-in-canonicalizeLocaleList.js: Added.
(catch):

Source/JavaScriptCore:

* runtime/IntlObject.cpp:
(JSC::canonicalizeLocaleList):

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

9 months agoDisable legacy TLS versions and add a temporary default to re-enable it
commit-queue@webkit.org [Thu, 22 Aug 2019 18:13:08 +0000 (18:13 +0000)]
Disable legacy TLS versions and add a temporary default to re-enable it
https://bugs.webkit.org/show_bug.cgi?id=200945

Patch by Alex Christensen <achristensen@webkit.org> on 2019-08-22
Reviewed by Brady Eidson.

Source/WebKit:

* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::privateSessionParameters):
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):

Source/WTF:

* wtf/Platform.h:

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

9 months agoMake MediaStreamTrackPrivate WeakPtrFactoryInitialization::Eager
youenn@apple.com [Thu, 22 Aug 2019 18:01:09 +0000 (18:01 +0000)]
Make MediaStreamTrackPrivate WeakPtrFactoryInitialization::Eager
https://bugs.webkit.org/show_bug.cgi?id=201037

Reviewed by Darin Adler.

No change of behavior, replacing m_weakThis by the more convenient Eager.

* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::audioSamplesAvailable):
(WebCore::MediaStreamTrackPrivate::MediaStreamTrackPrivate): Deleted.
* platform/mediastream/MediaStreamTrackPrivate.h:

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

9 months agoRebaseline some editing tests after r248974
timothy_horton@apple.com [Thu, 22 Aug 2019 17:35:06 +0000 (17:35 +0000)]
Rebaseline some editing tests after r248974
https://bugs.webkit.org/show_bug.cgi?id=200999
<rdar://problem/54564878>

* platform/ios/editing/deleting/smart-delete-003-expected.txt:
* platform/ios/editing/deleting/smart-delete-004-expected.txt:
* platform/ios/editing/pasteboard/smart-paste-008-expected.txt:

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