WebKit.git
10 months agoUnreviewed GTK+ gardening. Update expectations after r247346.
magomez@igalia.com [Thu, 11 Jul 2019 15:46:21 +0000 (15:46 +0000)]
Unreviewed GTK+ gardening. Update expectations after r247346.

* platform/gtk/TestExpectations:

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

10 months ago[LFC][IFC] Cleanup InlineFormattingContext::LineLayout class.
zalan@apple.com [Thu, 11 Jul 2019 14:09:55 +0000 (14:09 +0000)]
[LFC][IFC] Cleanup InlineFormattingContext::LineLayout class.
https://bugs.webkit.org/show_bug.cgi?id=199702
<rdar://problem/52931733>

Reviewed by Sam Weinig.

Move some structs to .cpp. They don't need to pollute the class declaration.

* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::LineLayout::layoutState const):
(): Deleted.
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::LineInput::HorizontalConstraint::HorizontalConstraint):
(WebCore::Layout::LineInput::LineInput):
(WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
(WebCore::Layout::InlineFormattingContext::LineLayout::LineInput::HorizontalConstraint::HorizontalConstraint): Deleted.
(WebCore::Layout::InlineFormattingContext::LineLayout::LineInput::LineInput): Deleted.

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

10 months agoAX: Implement support for ARIA roles insertion, deletion, subscript, superscript...
jdiggs@igalia.com [Thu, 11 Jul 2019 13:36:50 +0000 (13:36 +0000)]
AX: Implement support for ARIA roles insertion, deletion, subscript, superscript, and time
https://bugs.webkit.org/show_bug.cgi?id=199692

Reviewed by Chris Fleizach.

Source/WebCore:

Create new AccessibilityRole types which correspond to the new ARIA roles and
update AccessibilityRenderObject::determineAccessibilityRole() to assign these
internal roles to the related HTML elements.

Update both ATK and Mac to recognize these new internal roles. In addition, update
the ATK mappings for the ins and del elements to ATK_ROLE_CONTENT_INSERTION and
ATK_ROLE_CONTENT_DELETION respectively. Also expose "insertion" and "deletion" via
the AtkObject xml-roles attribute so that this information is not completely absent
for GTK or WPE built against earlier versions of ATK.

Remove AccessibilityObject's isSubscriptStyleGroup() and isSuperscriptStyleGroup().
These two methods were only being used by ATK and are no longer needed for platform
role mapping.

No new tests. Instead add the roles to the existing role-exposure tests.

* accessibility/AccessibilityObject.cpp:
(WebCore::initializeRoleMap):
(WebCore::AccessibilityObject::isSubscriptStyleGroup const): Deleted.
(WebCore::AccessibilityObject::isSuperscriptStyleGroup const): Deleted.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/atk/WebKitAccessible.cpp:
(webkitAccessibleGetAttributes):
(atkRole):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):
(-[WebAccessibilityObjectWrapper subrole]):

Tools:

Add support for output of AXDeletion and AXInsertion roles for tests.
Update GTK and WPE jhbuild modules to use version of ATK and AT-SPI2
which include ROLE_CONTENT_DELETION and ROLE_CONTENT_INSERTION.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
* gtk/jhbuild.modules:
* wpe/jhbuild.modules:

LayoutTests:

Add the new roles to the existing role-exposure tests and update expectations accordingly.

* accessibility/gtk/object-attributes-expected.txt:
* accessibility/gtk/object-attributes.html:
* accessibility/gtk/xml-roles-exposed-expected.txt:
* accessibility/gtk/xml-roles-exposed.html:
* accessibility/roles-computedRoleString.html:
* accessibility/roles-exposed.html:
* platform/gtk/accessibility/roles-computedRoleString-expected.txt:
* platform/gtk/accessibility/roles-exposed-expected.txt:
* platform/mac-wk2/accessibility/roles-exposed-expected.txt:
* platform/mac/accessibility/roles-computedRoleString-expected.txt:
* platform/mac/accessibility/roles-exposed-expected.txt:
* platform/wpe/accessibility/roles-computedRoleString-expected.txt:
* platform/wpe/accessibility/roles-exposed-expected.txt:

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

10 months ago[ews-build] Remove workers {ltilve,tanty}-gtk-wk2-ews from configuration
aperez@igalia.com [Thu, 11 Jul 2019 12:45:22 +0000 (12:45 +0000)]
[ews-build] Remove workers {ltilve,tanty}-gtk-wk2-ews from configuration
https://bugs.webkit.org/show_bug.cgi?id=199707

Reviewed by Aakash Jain.

* BuildSlaveSupport/ews-build/config.json: Remove old unused workers.

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

10 months ago[GStreamer][MediaStream] Use the new dispatchMediaSampleToObservers to dispatch new...
commit-queue@webkit.org [Thu, 11 Jul 2019 10:57:54 +0000 (10:57 +0000)]
[GStreamer][MediaStream] Use the new dispatchMediaSampleToObservers to dispatch new buffers
https://bugs.webkit.org/show_bug.cgi?id=199689

Patch by Thibault Saunier <tsaunier@igalia.com> on 2019-07-11
Reviewed by Philippe Normand.

We already have tests for this.

* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::processNewFrame):
(WebCore::GStreamerVideoCaptureSource::newSampleCallback):
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:

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

10 months agoUnreviewed, revert r243617.
ysuzuki@apple.com [Thu, 11 Jul 2019 09:42:22 +0000 (09:42 +0000)]
Unreviewed, revert r243617.
https://bugs.webkit.org/show_bug.cgi?id=196341

Mark pointed out that JSVirtualMachine can be gone in the other thread while we are executing GC constraint-solving.
This patch does not account that JavaScriptCore.framework is multi-thread safe: JSVirtualMachine wrapper can be destroyed,
and [JSVirtualMachine dealloc] can be executed in any threads while the VM is retained and used in the other thread (e.g.
destroyed from AutoReleasePool in some thread).

* API/JSContext.mm:
(-[JSContext initWithVirtualMachine:]):
(-[JSContext dealloc]):
(-[JSContext initWithGlobalContextRef:]):
(-[JSContext wrapperMap]):
(+[JSContext contextWithJSGlobalContextRef:]):
* API/JSVirtualMachine.mm:
(initWrapperCache):
(wrapperCache):
(+[JSVMWrapperCache addWrapper:forJSContextGroupRef:]):
(+[JSVMWrapperCache wrapperForJSContextGroupRef:]):
(-[JSVirtualMachine initWithContextGroupRef:]):
(-[JSVirtualMachine dealloc]):
(+[JSVirtualMachine virtualMachineWithContextGroupRef:]):
(-[JSVirtualMachine contextForGlobalContextRef:]):
(-[JSVirtualMachine addContext:forGlobalContextRef:]):
(scanExternalObjectGraph):
(scanExternalRememberedSet):
* API/JSVirtualMachineInternal.h:
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::setWrapperMap):
(JSC::JSGlobalObject::setAPIWrapper): Deleted.
(JSC::JSGlobalObject::apiWrapper const): Deleted.
* runtime/VM.h:

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

10 months agoMobileSafari may crash under -[UIKeyboardTaskExecutionContext transferExecutionToMain...
wenson_hsieh@apple.com [Thu, 11 Jul 2019 07:34:19 +0000 (07:34 +0000)]
MobileSafari may crash under -[UIKeyboardTaskExecutionContext transferExecutionToMainThreadWithTask:]
https://bugs.webkit.org/show_bug.cgi?id=199701
<rdar://problem/52590170>

Reviewed by Tim Horton.

Mitigates a crash wherein we end up calling the completion handler of
-requestAutocorrectionContextWithCompletionHandler: within a nested call
to -requestAutocorrectionContextWithCompletionHandler:. In this particular
case, a sync `window.open` from the web process to the UI process happens
while the UI process is already handling a sync autocorrection context
request. This causes the UI process to try and immediately dispatch the
incoming sync message to avoid deadlock. However, Safari's logic to create
and set up a new web view when opening a new window makes the new view the
first responder, which then prompts UIKit logic to request an autocorrection
context for the new web view.

To avoid the issue for now, simply use -resignFirstResponder as a cue to invoke
pending autocorrection context handlers in the original web view before UIKit
tries to request autocorrection context in the newly created view.

I attempted to write a test for this, but realized that we only end up hitting
the debug assertion pointed out in <https://webkit.org/b/199680>; we should be
able to write a test for this in the future, if we teach Connection to handle
multiple outgoing sync messages.

For the time being, I've attached a manual test case to the bug.

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

Add a new helper to signify that a pending autocorrection context handler should be cancelled (invoked
immediately with empty data). Use this in a few places where we currently explicitly pass
-[WKAutocorrectionContext emptyAutocorrectionContext].

(-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):

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

10 months ago[iOS WK2] With modal overlay and body overflow:hidden, can't access all the content
simon.fraser@apple.com [Thu, 11 Jul 2019 04:28:16 +0000 (04:28 +0000)]
[iOS WK2] With modal overlay and body overflow:hidden, can't access all the content
https://bugs.webkit.org/show_bug.cgi?id=199693
rdar://problem/51930364

Reviewed by Tim Horton.
Source/WebCore:

A page with overflow:hidden on the root needs to be scrollable if:
* it's zoomed
* the visual viewport is smaller than the layout viewport (including visible keyboard)
* scrolling is required to hide MobileSafari's squishy bars

This patch does the last two, plumbing a "visual viewport is smaller than layout viewport"
bit up from WebCore via the scrolling tree (that way, when it changes we automatically trigger
a commit), and checking for squished bars in WKWebView.

Tested by new API tests.

* page/FrameView.cpp:
(WebCore::FrameView::updateLayoutViewport):
(WebCore::FrameView::layoutOrVisualViewportChanged): Make this not iOS-specific. It's not yet called
in all the right places (doing so has risk because it's exposed via VisualViewport resize events).
(WebCore::FrameView::didUpdateViewportOverrideRects): Deleted.
* page/FrameView.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewVisualViewportChanged):
(WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::frameViewVisualViewportChanged):
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::setPropertyChangedBitsAfterReattach):
(WebCore::ScrollingStateFrameScrollingNode::setVisualViewportIsSmallerThanLayoutViewport):
(WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNode::dumpProperties const):
* page/scrolling/ScrollingTreeFrameScrollingNode.h:

Source/WebKit:

A page with overflow:hidden on the root needs to be scrollable if:
* it's zoomed
* the visual viewport is smaller than the layout viewport (including visible keyboard)
* scrolling is required to hide MobileSafari's squishy bars

This patch does the last two, plumbing a "visual viewport is smaller than layout viewport"
bit up from WebCore via the scrolling tree (that way, when it changes we automatically trigger
a commit), and checking for squished bars in WKWebView.

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
(ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:]):
(-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::hasScrollableMainFrame const):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::maximumUnobscuredSize const):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::updateVisibleContentRects):

Tools:

New API tests that test scrollability with various combinations of content, insets,
input accessory bars etc.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/ios/ScrollViewScrollabilityTests.mm: Added.
(TestWebKitAPI::webViewWithAutofocusedInput):
(TestWebKitAPI::TEST):

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

10 months agoLong pressing on attachments will crash the WebContent process
timothy_horton@apple.com [Thu, 11 Jul 2019 04:09:52 +0000 (04:09 +0000)]
Long pressing on attachments will crash the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=199696
<rdar://problem/52920241>

Reviewed by Dean Jackson.

Source/WebKit:

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::linkIndicatorPositionInformation):
(WebKit::elementPositionInformation):
(WebKit::selectionPositionInformation):
(WebKit::WebPage::positionInformation):
Instead of one-off creating a node snapshot for <attachment>, just
use TextIndicator. This way, we get an estimated background color,
paint at the right resolution, etc.

Also, hitNode was often null where we were previously calling
shareableBitmapSnapshotForNode, because it depends on the element
having click event handlers. selectionPositionInformation() re-hit-tests
more permissively to find the <attachment>, so moving this code
inside that function ensures that we don't try to snapshot a null node.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKRequestActivatedElementInfo.mm:
(TestWebKitAPI::TEST):
Add a test that previously crashed.

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

10 months ago[WHLSL] Optional<UniqueRef<T>> -> std::unique_ptr in Return/IfStatement/ForLoop
rmorisset@apple.com [Thu, 11 Jul 2019 02:09:52 +0000 (02:09 +0000)]
[WHLSL] Optional<UniqueRef<T>> -> std::unique_ptr in Return/IfStatement/ForLoop
https://bugs.webkit.org/show_bug.cgi?id=199695

Reviewed by Dean Jackson.

Trivial patch that saves 8 bytes per Return/If, and 16 bytes per For loop.

No new tests as there is no intended functional change.

* Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
(WebCore::WHLSL::AST::ForLoop::ForLoop):
(WebCore::WHLSL::AST::ForLoop::condition):
(WebCore::WHLSL::AST::ForLoop::increment):
* Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
(WebCore::WHLSL::AST::IfStatement::IfStatement):
(WebCore::WHLSL::AST::IfStatement::elseBody):
* Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
(WebCore::WHLSL::AST::Return::Return):
(WebCore::WHLSL::AST::Return::value):
* Modules/webgpu/WHLSL/WHLSLParser.cpp:
(WebCore::WHLSL::Parser::parseIfStatement):
(WebCore::WHLSL::Parser::parseForLoop):
(WebCore::WHLSL::Parser::parseStatement):

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

10 months agoSafari’s context menu actions are missing options
dino@apple.com [Thu, 11 Jul 2019 01:27:04 +0000 (01:27 +0000)]
Safari’s context menu actions are missing options
https://bugs.webkit.org/show_bug.cgi?id=199694
<rdar://problem/52726822>

Reviewed by Tim Horton.

One of the most embarrassing errors I've ever made. I was returning
early when something existed, instead of when it didn't exist.
(*cough* tests *cough*)

* UIProcess/ios/WKContentViewInteraction.mm:

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

10 months ago[WHLSL] The recursion checker should not have quadratic complexity
rmorisset@apple.com [Thu, 11 Jul 2019 01:18:14 +0000 (01:18 +0000)]
[WHLSL] The recursion checker should not have quadratic complexity
https://bugs.webkit.org/show_bug.cgi?id=199688

Reviewed by Saam Barati.

I fix it by using two different hash sets, tracking which functions we have started visiting, and which we have finished visiting.
The difference are those that are currently "on the stack", and calling any of those is an error.
As a bonus, I also overrode visit(Program&), so that we only bother visiting function definitions.

On whlsl-compute.html ran 5 times, this patch reduces the time spent in the recursion checker from 26ms to 12ms.
It is likely to be a much bigger win on larger programs (since it took the complexity from quadratic to linear).

No new tests as there is no intended functional change.

* Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp:

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

10 months ago[WHLSL] Import all tests that pass without compiler changes from the JS reference...
sbarati@apple.com [Thu, 11 Jul 2019 00:59:10 +0000 (00:59 +0000)]
[WHLSL] Import all tests that pass without compiler changes from the JS reference test suite
https://bugs.webkit.org/show_bug.cgi?id=199595

Rubber stamped by Robin Morisset.

* webgpu/whlsl-argument-evaluation-order-expected.txt: Added.
* webgpu/whlsl-argument-evaluation-order.html: Added.
* webgpu/whlsl-array-length-spec-tests-expected.txt: Added.
* webgpu/whlsl-array-length-spec-tests.html: Added.
* webgpu/whlsl-array-spec-tests-expected.txt:
* webgpu/whlsl-array-spec-tests.html:
* webgpu/whlsl-bad-add-expected.txt: Added.
* webgpu/whlsl-bad-add.html: Added.
* webgpu/whlsl-bools-expected.txt: Added.
* webgpu/whlsl-bools.html: Added.
* webgpu/whlsl-casts-expected.txt: Added.
* webgpu/whlsl-casts.html: Added.
* webgpu/whlsl-comment-parsing-expected.txt: Added.
* webgpu/whlsl-comment-parsing.html: Added.
* webgpu/whlsl-copy-expected.txt: Added.
* webgpu/whlsl-copy.html: Added.
* webgpu/whlsl-dereference-ordering-expected.txt: Added.
* webgpu/whlsl-dereference-ordering.html: Added.
* webgpu/whlsl-double-not-expected.txt: Added.
* webgpu/whlsl-double-not.html: Added.
* webgpu/whlsl-duplicates-expected.txt: Added.
* webgpu/whlsl-duplicates.html: Added.
* webgpu/whlsl-increment-decrement-expected.txt: Added.
* webgpu/whlsl-increment-decrement.html: Added.
* webgpu/whlsl-index-ander-expected.txt: Added.
* webgpu/whlsl-index-ander.html: Added.
* webgpu/whlsl-index-setter-getter-expected.txt: Added.
* webgpu/whlsl-index-setter-getter.html: Added.
* webgpu/whlsl-logical-negation-expected.txt: Added.
* webgpu/whlsl-logical-negation.html: Added.
* webgpu/whlsl-lots-of-local-variables-expected.txt: Added.
* webgpu/whlsl-lots-of-local-variables.html: Added.
* webgpu/whlsl-lvalues-expected.txt: Added.
* webgpu/whlsl-lvalues.html: Added.
* webgpu/whlsl-null-arg-expected.txt: Added.
* webgpu/whlsl-null-arg.html: Added.
* webgpu/whlsl-operator-overload-expected.txt: Added.
* webgpu/whlsl-operator-overload.html: Added.
* webgpu/whlsl-overload-expected.txt: Added.
* webgpu/whlsl-overload.html: Added.
* webgpu/whlsl-setter-spec-tests-expected.txt: Added.
* webgpu/whlsl-setter-spec-tests.html: Added.
* webgpu/whlsl-store-null-expected.txt: Added.
* webgpu/whlsl-store-null.html: Added.
* webgpu/whlsl-struct-expected.txt: Added.
* webgpu/whlsl-struct.html: Added.
* webgpu/whlsl-switch-expected.txt: Added.
* webgpu/whlsl-switch.html: Added.
* webgpu/whlsl-variable-shadowing-expected.txt: Added.
* webgpu/whlsl-variable-shadowing.html: Added.
* webgpu/whlsl-vector-syntax-expected.txt: Added.
* webgpu/whlsl-vector-syntax.html: Added.

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

10 months agoCrash at WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator
sihui_liu@apple.com [Thu, 11 Jul 2019 00:43:07 +0000 (00:43 +0000)]
Crash at WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator
https://bugs.webkit.org/show_bug.cgi?id=199677
<rdar://problem/52334665>

Reviewed by Alex Christensen.

Add an early return in incrementReverseIterator when setFirstInRemainingRange fails to set m_iterator. This is
in line with what we did in incrementForwardIterator.

* Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
(WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):

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

10 months agoSupport MacCatalyst in run-webkit-app
dino@apple.com [Thu, 11 Jul 2019 00:41:43 +0000 (00:41 +0000)]
Support MacCatalyst in run-webkit-app
https://bugs.webkit.org/show_bug.cgi?id=199690

Reviewed by Tim Horton.

Add a --maccatalyst option to run-webkit-app that
can launch MacCatalyst applications with a built WebKit.

* Scripts/webkitdirs.pm:
(argumentsForConfiguration):
(determineXcodeSDK):
(xcodeSDKPlatformName):
(determineConfigurationProductDir):
(determinePortName):
(isCatalystWebKit):
(isAppleCocoaWebKit):
(willUseCatalystSDK):

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

10 months agoMarking webgpu/whlsl-builtin-vectors-2.html as Slow after https://trac.webkit.org...
tsavell@apple.com [Thu, 11 Jul 2019 00:06:26 +0000 (00:06 +0000)]
Marking webgpu/whlsl-builtin-vectors-2.html as Slow after https://trac.webkit.org/changeset/247319/webkit
https://bugs.webkit.org/show_bug.cgi?id=199651

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

10 months agoOpt trello.com to mobile UA
jonlee@apple.com [Wed, 10 Jul 2019 23:36:01 +0000 (23:36 +0000)]
Opt trello.com to mobile UA
https://bugs.webkit.org/show_bug.cgi?id=199686
rdar://problem/51708119

Reviewed by Wenson Hsieh.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::desktopClassBrowsingRecommendedForRequest): Currently the desktop version
of the site prevents users from tapping cards to edit them. Opt trello into the mobile
UA for now.

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

10 months agoStop using GenericTaskQueue from multiple threads
cdumez@apple.com [Wed, 10 Jul 2019 23:08:27 +0000 (23:08 +0000)]
Stop using GenericTaskQueue from multiple threads
https://bugs.webkit.org/show_bug.cgi?id=199652

Reviewed by Eric Carlson and Geoffrey Garen.

WebCoreAVFLoaderDelegate was calling GenericTaskQueue::enqueueTask() from a background thread,
which is not safe because the implementation of enqueueTask() calls makeWeakPtr() on the
GenericTaskQueue (a main thread object).

Update WebCoreAVFLoaderDelegate to make sure it is on the main thread before it calls
GenericTaskQueue::enqueueTask().

* platform/GenericTaskQueue.h:
Remove last template parameter which was used exclusively by WebCoreAVFLoaderDelegate to try and
make GenericTaskQueue thread-safe.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(-[WebCoreAVFMovieObserver metadataLoaded]):
(-[WebCoreAVFMovieObserver didEnd:]):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
(-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
(-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]):
(-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
(-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):

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

10 months agoAX: VoiceOver ignored role="presentation" on <table> HTML elements
cfleizach@apple.com [Wed, 10 Jul 2019 22:42:21 +0000 (22:42 +0000)]
AX: VoiceOver ignored role="presentation" on <table> HTML elements
https://bugs.webkit.org/show_bug.cgi?id=199659

Reviewed by Zalan Bujtas.

Source/WebCore:

Only include a table ancestor if it's a table we care about for accessibility.

Modified Test: accessibility/ios-simulator/tables-lists.html

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):

LayoutTests:

* accessibility/ios-simulator/tables-lists-expected.txt:
* accessibility/ios-simulator/tables-lists.html:

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

10 months ago[WHLSL] Track code locations correctly throughout the compiler to get good error...
rmorisset@apple.com [Wed, 10 Jul 2019 22:33:56 +0000 (22:33 +0000)]
[WHLSL] Track code locations correctly throughout the compiler to get good error messages
https://bugs.webkit.org/show_bug.cgi?id=199675

Reviewed by Myles Maxfield.

The basic idea is to go from having each AST node contain its own token to having each AST node contain a pair of offsets into the source,
the offset before its start and the offset after its end. This will let us get good error messages.
As a bonus, it saves a bit of memory as Tokens are larger (one extra word for their type).

The new CodeLocation class is put in Lexer.h, because it has a cyclic dependency on Token, which also has a cyclic dependency on Lexer.

No new tests as there is no intended functional change.

* Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
(WebCore::WHLSL::AST::ArrayReferenceType::ArrayReferenceType):
* Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
(WebCore::WHLSL::AST::ArrayType::ArrayType):
* Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
(WebCore::WHLSL::AST::AssignmentExpression::AssignmentExpression):
* Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h:
(WebCore::WHLSL::AST::BaseFunctionAttribute::BaseFunctionAttribute):
* Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h:
(WebCore::WHLSL::AST::BaseSemantic::BaseSemantic):
* Modules/webgpu/WHLSL/AST/WHLSLBlock.h:
(WebCore::WHLSL::AST::Block::Block):
* Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h:
(WebCore::WHLSL::AST::BooleanLiteral::BooleanLiteral):
(WebCore::WHLSL::AST::BooleanLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLBreak.h:
(WebCore::WHLSL::AST::Break::Break):
* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
(WebCore::WHLSL::AST::BuiltInSemantic::BuiltInSemantic):
* Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
(WebCore::WHLSL::AST::CallExpression::CallExpression):
* Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h:
(WebCore::WHLSL::AST::CommaExpression::CommaExpression):
* Modules/webgpu/WHLSL/AST/WHLSLContinue.h:
(WebCore::WHLSL::AST::Continue::Continue):
* Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h:
(WebCore::WHLSL::AST::DereferenceExpression::DereferenceExpression):
* Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h:
(WebCore::WHLSL::AST::DoWhileLoop::DoWhileLoop):
* Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h:
(WebCore::WHLSL::AST::DotExpression::DotExpression):
* Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h:
(WebCore::WHLSL::AST::EffectfulExpressionStatement::EffectfulExpressionStatement):
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
(WebCore::WHLSL::AST::EnumerationDefinition::EnumerationDefinition):
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
(WebCore::WHLSL::AST::EnumerationMember::EnumerationMember):
(WebCore::WHLSL::AST::EnumerationMember::codeLocation const):
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
(WebCore::WHLSL::AST::EnumerationMemberLiteral::EnumerationMemberLiteral):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::wrap):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
(WebCore::WHLSL::AST::Expression::Expression):
(WebCore::WHLSL::AST::Expression::codeLocation const):
(WebCore::WHLSL::AST::Expression::updateCodeLocation):
* Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h:
(WebCore::WHLSL::AST::Fallthrough::Fallthrough):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
(WebCore::WHLSL::AST::FloatLiteral::FloatLiteral):
(WebCore::WHLSL::AST::FloatLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp:
(WebCore::WHLSL::AST::FloatLiteralType::FloatLiteralType):
(WebCore::WHLSL::AST::FloatLiteralType::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
* Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
(WebCore::WHLSL::AST::ForLoop::ForLoop):
* Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
(WebCore::WHLSL::AST::FunctionDeclaration::FunctionDeclaration):
(WebCore::WHLSL::AST::FunctionDeclaration::codeLocation const):
* Modules/webgpu/WHLSL/AST/WHLSLGlobalVariableReference.h:
(WebCore::WHLSL::AST::GlobalVariableReference::GlobalVariableReference):
* Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
(WebCore::WHLSL::AST::IfStatement::IfStatement):
* Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
(WebCore::WHLSL::AST::IndexExpression::IndexExpression):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
(WebCore::WHLSL::AST::IntegerLiteral::IntegerLiteral):
(WebCore::WHLSL::AST::IntegerLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
(WebCore::WHLSL::AST::IntegerLiteralType::IntegerLiteralType):
(WebCore::WHLSL::AST::IntegerLiteralType::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
* Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h:
(WebCore::WHLSL::AST::LogicalExpression::LogicalExpression):
* Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h:
(WebCore::WHLSL::AST::LogicalNotExpression::LogicalNotExpression):
* Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
(WebCore::WHLSL::AST::MakeArrayReferenceExpression::MakeArrayReferenceExpression):
* Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
(WebCore::WHLSL::AST::MakePointerExpression::MakePointerExpression):
* Modules/webgpu/WHLSL/AST/WHLSLNamedType.h:
(WebCore::WHLSL::AST::NamedType::NamedType):
(WebCore::WHLSL::AST::NamedType::codeLocation const):
(WebCore::WHLSL::AST::NamedType::updateCodeLocation):
* Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
(WebCore::WHLSL::AST::NativeTypeDeclaration::NativeTypeDeclaration):
* Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h:
(WebCore::WHLSL::AST::NullLiteral::NullLiteral):
(WebCore::WHLSL::AST::NullLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLNumThreadsFunctionAttribute.h:
(WebCore::WHLSL::AST::NumThreadsFunctionAttribute::NumThreadsFunctionAttribute):
* Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
(WebCore::WHLSL::AST::PointerType::PointerType):
* Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
(WebCore::WHLSL::AST::PropertyAccessExpression::PropertyAccessExpression):
* Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
(WebCore::WHLSL::AST::ReadModifyWriteExpression::create):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::ReadModifyWriteExpression):
* Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
(WebCore::WHLSL::AST::ReferenceType::ReferenceType):
* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
(WebCore::WHLSL::AST::ResourceSemantic::ResourceSemantic):
* Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
(WebCore::WHLSL::AST::Return::Return):
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h:
(WebCore::WHLSL::AST::SpecializationConstantSemantic::SpecializationConstantSemantic):
* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h:
(WebCore::WHLSL::AST::StageInOutSemantic::StageInOutSemantic):
* Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
(WebCore::WHLSL::AST::Statement::Statement):
(WebCore::WHLSL::AST::Statement::codeLocation const):
(WebCore::WHLSL::AST::Statement::updateCodeLocation):
* Modules/webgpu/WHLSL/AST/WHLSLStatementList.h:
(WebCore::WHLSL::AST::StatementList::StatementList):
* Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
(WebCore::WHLSL::AST::StructureDefinition::StructureDefinition):
* Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
(WebCore::WHLSL::AST::StructureElement::StructureElement):
(WebCore::WHLSL::AST::StructureElement::codeLocation const):
* Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h:
(WebCore::WHLSL::AST::SwitchCase::SwitchCase):
* Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h:
(WebCore::WHLSL::AST::SwitchStatement::SwitchStatement):
* Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h:
(WebCore::WHLSL::AST::TernaryExpression::TernaryExpression):
* Modules/webgpu/WHLSL/AST/WHLSLTrap.h:
(WebCore::WHLSL::AST::Trap::Trap):
* Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
(WebCore::WHLSL::AST::TypeDefinition::TypeDefinition):
* Modules/webgpu/WHLSL/AST/WHLSLTypeReference.cpp:
(WebCore::WHLSL::AST::TypeReference::wrap):
* Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
(WebCore::WHLSL::AST::TypeReference::TypeReference):
(WebCore::WHLSL::AST::TypeReference::cloneTypeReference const):
* Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
(WebCore::WHLSL::AST::UnnamedType::UnnamedType):
(WebCore::WHLSL::AST::UnnamedType::codeLocation const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
(WebCore::WHLSL::AST::UnsignedIntegerLiteral::UnsignedIntegerLiteral):
(WebCore::WHLSL::AST::UnsignedIntegerLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::UnsignedIntegerLiteralType):
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
* Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
* Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h:
(WebCore::WHLSL::AST::VariableDeclarationsStatement::VariableDeclarationsStatement):
* Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h:
(WebCore::WHLSL::AST::VariableReference::VariableReference):
(WebCore::WHLSL::AST::VariableReference::wrap):
* Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h:
(WebCore::WHLSL::AST::WhileLoop::WhileLoop):
* Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp:
(WebCore::WHLSL::AutoInitialize::visit):
* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
(WebCore::WHLSL::resolveWithOperatorAnderIndexer):
(WebCore::WHLSL::resolveWithOperatorLength):
(WebCore::WHLSL::resolveWithReferenceComparator):
(WebCore::WHLSL::resolveByInstantiation):
(WebCore::WHLSL::resolveFunction):
(WebCore::WHLSL::Checker::visit):
(WebCore::WHLSL::argumentTypeForAndOverload):
(WebCore::WHLSL::Checker::finishVisiting):
* Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
(WebCore::WHLSL::matchAndCommit):
* Modules/webgpu/WHLSL/WHLSLLexer.cpp:
(WebCore::WHLSL::Token::typeName):
(WebCore::WHLSL::Lexer::consumeTokenFromStream):
* Modules/webgpu/WHLSL/WHLSLLexer.h:
(WebCore::WHLSL::AST::CodeLocation::CodeLocation):
(WebCore::WHLSL::AST::CodeLocation::startOffset const):
(WebCore::WHLSL::AST::CodeLocation::endOffset const):
(WebCore::WHLSL::Token::startOffset const):
(WebCore::WHLSL::Lexer::errorString):
(WebCore::WHLSL::Token::stringView const):
* Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
(WebCore::WHLSL::NameResolver::visit):
* Modules/webgpu/WHLSL/WHLSLParser.cpp:
(WebCore::WHLSL::Parser::parse):
(WebCore::WHLSL::Parser::peek):
(WebCore::WHLSL::Parser::peekFurther):
(WebCore::WHLSL::Types::includes):
(WebCore::WHLSL::Types::appendNameTo):
(WebCore::WHLSL::Types<t>::includes):
(WebCore::WHLSL::Types<t>::appendNameTo):
(WebCore::WHLSL::Parser::peekType):
(WebCore::WHLSL::Parser::tryType):
(WebCore::WHLSL::Parser::tryTypes):
(WebCore::WHLSL::Parser::consumeType):
(WebCore::WHLSL::Parser::consumeTypes):
(WebCore::WHLSL::Parser::consumeIntegralLiteral):
(WebCore::WHLSL::Parser::parseConstantExpression):
(WebCore::WHLSL::Parser::parseTypeArgument):
(WebCore::WHLSL::Parser::parseTypeArguments):
(WebCore::WHLSL::Parser::parseTypeSuffixAbbreviated):
(WebCore::WHLSL::Parser::parseTypeSuffixNonAbbreviated):
(WebCore::WHLSL::Parser::parseType):
(WebCore::WHLSL::Parser::parseTypeDefinition):
(WebCore::WHLSL::Parser::parseBuiltInSemantic):
(WebCore::WHLSL::Parser::parseResourceSemantic):
(WebCore::WHLSL::Parser::parseSpecializationConstantSemantic):
(WebCore::WHLSL::Parser::parseStageInOutSemantic):
(WebCore::WHLSL::Parser::parseSemantic):
(WebCore::WHLSL::Parser::parseQualifiers):
(WebCore::WHLSL::Parser::parseStructureElement):
(WebCore::WHLSL::Parser::parseStructureDefinition):
(WebCore::WHLSL::Parser::parseEnumerationDefinition):
(WebCore::WHLSL::Parser::parseEnumerationMember):
(WebCore::WHLSL::Parser::parseNativeTypeDeclaration):
(WebCore::WHLSL::Parser::parseNumThreadsFunctionAttribute):
(WebCore::WHLSL::Parser::parseAttributeBlock):
(WebCore::WHLSL::Parser::parseParameter):
(WebCore::WHLSL::Parser::parseParameters):
(WebCore::WHLSL::Parser::parseComputeFunctionDeclaration):
(WebCore::WHLSL::Parser::parseVertexOrFragmentFunctionDeclaration):
(WebCore::WHLSL::Parser::parseRegularFunctionDeclaration):
(WebCore::WHLSL::Parser::parseOperatorFunctionDeclaration):
(WebCore::WHLSL::Parser::parseFunctionDeclaration):
(WebCore::WHLSL::Parser::parseBlock):
(WebCore::WHLSL::Parser::parseBlockBody):
(WebCore::WHLSL::Parser::parseIfStatement):
(WebCore::WHLSL::Parser::parseSwitchStatement):
(WebCore::WHLSL::Parser::parseSwitchCase):
(WebCore::WHLSL::Parser::parseForLoop):
(WebCore::WHLSL::Parser::parseWhileLoop):
(WebCore::WHLSL::Parser::parseDoWhileLoop):
(WebCore::WHLSL::Parser::parseVariableDeclaration):
(WebCore::WHLSL::Parser::parseVariableDeclarations):
(WebCore::WHLSL::Parser::parseStatement):
(WebCore::WHLSL::Parser::parseEffectfulExpression):
(WebCore::WHLSL::Parser::parseEffectfulAssignment):
(WebCore::WHLSL::Parser::parseLimitedSuffixOperator):
(WebCore::WHLSL::Parser::parseSuffixOperator):
(WebCore::WHLSL::Parser::parseExpression):
(WebCore::WHLSL::Parser::completeTernaryConditional):
(WebCore::WHLSL::Parser::completeAssignment):
(WebCore::WHLSL::Parser::parsePossibleTernaryConditional):
(WebCore::WHLSL::Parser::completePossibleLogicalBinaryOperation):
(WebCore::WHLSL::Parser::completePossibleRelationalBinaryOperation):
(WebCore::WHLSL::Parser::completePossibleShift):
(WebCore::WHLSL::Parser::completePossibleAdd):
(WebCore::WHLSL::Parser::completePossibleMultiply):
(WebCore::WHLSL::Parser::parsePossiblePrefix):
(WebCore::WHLSL::Parser::parsePossibleSuffix):
(WebCore::WHLSL::Parser::parseCallExpression):
(WebCore::WHLSL::Parser::parseTerm):
* Modules/webgpu/WHLSL/WHLSLParser.h:
* Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
(WebCore::WHLSL::anonymousToken):
(WebCore::WHLSL::PreserveLifetimes::PreserveLifetimes):
(WebCore::WHLSL::PreserveLifetimes::assignVariableIntoStruct):
(WebCore::WHLSL::preserveVariableLifetimes):
* Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
(WebCore::WHLSL::PropertyResolver::visit):
(WebCore::WHLSL::wrapAnderCallArgument):
(WebCore::WHLSL::setterCall):
(WebCore::WHLSL::getterCall):
(WebCore::WHLSL::modify):
(WebCore::WHLSL::PropertyResolver::simplifyRightValue):
(WebCore::WHLSL::LeftValueSimplifier::finishVisiting):
* Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
(WebCore::WHLSL::synthesizeArrayOperatorLength):
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
(WebCore::WHLSL::synthesizeConstructors):
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
(WebCore::WHLSL::synthesizeEnumerationFunctions):
* Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
(WebCore::WHLSL::synthesizeStructureAccessors):

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

10 months ago[iOS] Selection handles "Lollipops" can become gray and stay gray
dbates@webkit.org [Wed, 10 Jul 2019 22:07:11 +0000 (22:07 +0000)]
[iOS] Selection handles "Lollipops" can become gray and stay gray
https://bugs.webkit.org/show_bug.cgi?id=198852
<rdar://problem/51736130>

Reviewed by Wenson Hsieh.

Tell the text interaction assistant to update the selection UI when the tint color changes.
We do this by way of deactivating and activating selection.

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

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

10 months ago[iOS] REGRESSION(r244851): Revealing caret sometimes fails when content inset is...
rniwa@webkit.org [Wed, 10 Jul 2019 21:12:47 +0000 (21:12 +0000)]
[iOS] REGRESSION(r244851): Revealing caret sometimes fails when content inset is used
https://bugs.webkit.org/show_bug.cgi?id=199662

Reviewed by Simon Fraser.

Source/WebCore:

The bug was caused by ScrollableArea::maximumScrollPosition using ScrollableArea::visibleSize, which does not
take the content insets into account correctly, rather than FrameView::visualViewportRectExpandedByContentInsets,
which does, and is used for "viewRect" in RenderLayer::scrollRectToVisible.

Override the maximum scroll position using visualViewportRectExpandedByContentInsets in iOS to fix the issue.

Test: editing/selection/ios/autoscroll-with-top-content-inset-2.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible): Fixed the bug.

LayoutTests:

Added a regression test.

* editing/selection/ios/autoscroll-with-top-content-inset-2-expected.txt: Added.
* editing/selection/ios/autoscroll-with-top-content-inset-2.html: Added.

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

10 months agoShare or Copy image from context menu does not share the correct data
dino@apple.com [Wed, 10 Jul 2019 20:40:05 +0000 (20:40 +0000)]
Share or Copy image from context menu does not share the correct data
https://bugs.webkit.org/show_bug.cgi?id=199681
<rdar://problem/50538771>

Reviewed by Tim Horton.

The UIContextMenuInteraction calls didEndInteraction before executing the
actions of a selected menu item. This means we were assuming the interaction
had finished before performing the action triggered in the interaction, ending
up in the state where we had forgotten which element we were working with.

Rather than ask for UIKit to change, I'm just starting the interaction again
as the action is run. Thankfully we already had the location of the interaction.
There is a small risk that the page has changed in the meantime, but I'm not
sure what to do about that.

While here, I moved a method only used by us into _WKElementActionInternal,
and changed the location stored by _WKActivatedElementInfo from a CGPoint
to an WebCore::IntPoint (since it doesn't escape WebKit).

* UIProcess/API/Cocoa/_WKActivatedElementInfo.mm: Use a WebCore::IntPoint rather than a CGPoint.
(-[_WKActivatedElementInfo _initWithType:URL:imageURL:location:title:ID:rect:image:]):
(-[_WKActivatedElementInfo _initWithType:URL:imageURL:location:title:ID:rect:image:userInfo:]):
(-[_WKActivatedElementInfo _interactionLocation]):
* UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:

* UIProcess/API/Cocoa/_WKElementAction.h: Move uiActionForElementInfo to Internal.
* UIProcess/API/Cocoa/_WKElementActionInternal.h:

* UIProcess/API/Cocoa/_WKElementAction.mm: When executing the handlers, restart the interaction
using the location in _WKActivatedElementInfo.
(+[_WKElementAction _elementActionWithType:customTitle:assistant:]):

* UIProcess/ios/WKContentViewInteraction.mm: Explicitly start and stop interactions at
the appropriate points in the UIContextMenu flow. This isn't really needed since we're
doing it in the handlers, but it will be correct if the UIKit delegate order changes.
(-[WKContentView continueContextMenuInteraction:]):
(-[WKContentView contextMenuInteractionDidEnd:]):

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

10 months agoUnreviewed, rolling out r247316.
ryanhaddad@apple.com [Wed, 10 Jul 2019 20:37:27 +0000 (20:37 +0000)]
Unreviewed, rolling out r247316.

Broke Mojave build

Reverted changeset:

"[WHLSL] Track code locations correctly throughout the
compiler to get good error messages"
https://bugs.webkit.org/show_bug.cgi?id=199675
https://trac.webkit.org/changeset/247316

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

10 months agoAllow CMake to build WebCore on Mac
commit-queue@webkit.org [Wed, 10 Jul 2019 20:30:26 +0000 (20:30 +0000)]
Allow CMake to build WebCore on Mac
https://bugs.webkit.org/show_bug.cgi?id=198979

Patch by Alex Christensen <achristensen@webkit.org> on 2019-07-10
Reviewed by Don Olmstead.

Source/ThirdParty/ANGLE:

* include/GLSLANG/ShaderLang.h:

Source/WebCore:

* Modules/websockets/ThreadableWebSocketChannel.cpp:
(WebCore::ThreadableWebSocketChannel::validateURL):
* PlatformMac.cmake:
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
* platform/ios/WebItemProviderPasteboard.h:

Source/WebCore/PAL:

* pal/PlatformMac.cmake:

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

10 months agoUnreviewed, rolling out r247292.
cdumez@apple.com [Wed, 10 Jul 2019 20:13:26 +0000 (20:13 +0000)]
Unreviewed, rolling out r247292.

Caused CloseWebViewDuringEnterFullscreen.VideoFullscreen API
test to time out on Mojave bots

Reverted changeset:

"Stop using GenericTaskQueue from multiple threads"
https://bugs.webkit.org/show_bug.cgi?id=199652
https://trac.webkit.org/changeset/247292

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

10 months agoCrash under IPC::Connection::waitForMessage()
cdumez@apple.com [Wed, 10 Jul 2019 20:10:49 +0000 (20:10 +0000)]
Crash under IPC::Connection::waitForMessage()
https://bugs.webkit.org/show_bug.cgi?id=199680
<rdar://problem/52500561>

Reviewed by Tim Horton.

IPC::Connection::waitForMessage() is crashing due to a null defererence of
m_waitingForMessage. Since m_waitingForMessage is only ever set to null in
waitForMessage(), this seems to imply we've re-entered waitForMessage().
This is in theory possible since the loop inside waitForMessage() calls
SyncMessageState::singleton().dispatchMessages() on every iteration to
process incoming synchronous IPC messages. In theory, one of these sync
IPC messages could run code which ends up calling waitForAndDispatchImmediately()
(and thus waitForMessage()).

We had a debug assertion to try and catch re-entrancy with a comment stating
"We don't support having multiple clients waiting for messages." but we
would not see those in release and we would crash with a null dereference
instead.

To address the crashes in release, return early in case of re-entrancy
(we would still hit an assertion in debug).

* Platform/IPC/Connection.cpp:
(IPC::Connection::Connection):
(IPC::Connection::waitForMessage):
* Platform/IPC/Connection.h:

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

10 months agoContext menus are not presented for WKWebViews that don't have UIDelegates
timothy_horton@apple.com [Wed, 10 Jul 2019 20:04:26 +0000 (20:04 +0000)]
Context menus are not presented for WKWebViews that don't have UIDelegates
https://bugs.webkit.org/show_bug.cgi?id=199678

Reviewed by Dean Jackson.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView continueContextMenuInteraction:]):
Remove this unnecessary early-return if we don't have a UIDelegate.
We have a default behavior that we totally want to happen.
Also, rename completion() to continueWithContextMenuConfiguration()
to reduce confusion between completion() and completionBlock() in
this method.

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

10 months ago[WHLSL Import more JS reference spec tests
sbarati@apple.com [Wed, 10 Jul 2019 20:01:55 +0000 (20:01 +0000)]
[WHLSL Import more JS reference spec tests
https://bugs.webkit.org/show_bug.cgi?id=199651

Rubber stamped by Robin Morisset.

* webgpu/whlsl-builtin-vectors-2-expected.txt: Added.
* webgpu/whlsl-builtin-vectors-2.html: Added.
* webgpu/whlsl-builtin-vectors-expected.txt: Added.
* webgpu/whlsl-builtin-vectors.html: Added.
* webgpu/whlsl-getter-setter-type-expected.txt: Added.
* webgpu/whlsl-getter-setter-type.html: Added.
* webgpu/whlsl-loops-spec-tests-expected.txt: Added.
* webgpu/whlsl-loops-spec-tests.html: Added.
* webgpu/whlsl-null-array-ref.html: Added.
* webgpu/whlsl-override-subscript-expected.txt: Added.
* webgpu/whlsl-override-subscript.html: Added.
* webgpu/whlsl-plus-equals-expected.txt: Added.
* webgpu/whlsl-plus-equals.html: Added.
* webgpu/whlsl-recursive-structs-expected.txt: Added.
* webgpu/whlsl-recursive-structs.html: Added.
* webgpu/whlsl-ternary-spec-test-expected.txt: Added.
* webgpu/whlsl-ternary-spec-test.html: Added.
* webgpu/whlsl-wrong-argument-length-expected.txt: Added.
* webgpu/whlsl-wrong-argument-length.html: Added.
* webgpu/whlsl-wrong-types-expected.txt: Added.
* webgpu/whlsl-wrong-types.html: Added.

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

10 months agoUnreviewed, rolling out r247223.
commit-queue@webkit.org [Wed, 10 Jul 2019 19:46:05 +0000 (19:46 +0000)]
Unreviewed, rolling out r247223.
https://bugs.webkit.org/show_bug.cgi?id=199679

Caused perf regression. (Requested by deanj on #webkit).

Reverted changeset:

"[iPadOS] Viewport pops while loading sohu.com, xinhuanet.com,
and various other websites"
https://bugs.webkit.org/show_bug.cgi?id=199575
https://trac.webkit.org/changeset/247223

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

10 months ago[WHLSL] Track code locations correctly throughout the compiler to get good error...
rmorisset@apple.com [Wed, 10 Jul 2019 19:44:48 +0000 (19:44 +0000)]
[WHLSL] Track code locations correctly throughout the compiler to get good error messages
https://bugs.webkit.org/show_bug.cgi?id=199675

Reviewed by Myles Maxfield.

The basic idea is to go from having each AST node contain its own token to having each AST node contain a pair of offsets into the source,
the offset before its start and the offset after its end. This will let us get good error messages.
As a bonus, it saves a bit of memory as Tokens are larger (one extra word for their type).

The new CodeLocation class is put in Lexer.h, because it has a cyclic dependency on Token, which also has a cyclic dependency on Lexer.

No new tests as there is no intended functional change.

* Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
(WebCore::WHLSL::AST::ArrayReferenceType::ArrayReferenceType):
* Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
(WebCore::WHLSL::AST::ArrayType::ArrayType):
* Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
(WebCore::WHLSL::AST::AssignmentExpression::AssignmentExpression):
* Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h:
(WebCore::WHLSL::AST::BaseFunctionAttribute::BaseFunctionAttribute):
* Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h:
(WebCore::WHLSL::AST::BaseSemantic::BaseSemantic):
* Modules/webgpu/WHLSL/AST/WHLSLBlock.h:
(WebCore::WHLSL::AST::Block::Block):
* Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h:
(WebCore::WHLSL::AST::BooleanLiteral::BooleanLiteral):
(WebCore::WHLSL::AST::BooleanLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLBreak.h:
(WebCore::WHLSL::AST::Break::Break):
* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
(WebCore::WHLSL::AST::BuiltInSemantic::BuiltInSemantic):
* Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
(WebCore::WHLSL::AST::CallExpression::CallExpression):
* Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h:
(WebCore::WHLSL::AST::CommaExpression::CommaExpression):
* Modules/webgpu/WHLSL/AST/WHLSLContinue.h:
(WebCore::WHLSL::AST::Continue::Continue):
* Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h:
(WebCore::WHLSL::AST::DereferenceExpression::DereferenceExpression):
* Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h:
(WebCore::WHLSL::AST::DoWhileLoop::DoWhileLoop):
* Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h:
(WebCore::WHLSL::AST::DotExpression::DotExpression):
* Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h:
(WebCore::WHLSL::AST::EffectfulExpressionStatement::EffectfulExpressionStatement):
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
(WebCore::WHLSL::AST::EnumerationDefinition::EnumerationDefinition):
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
(WebCore::WHLSL::AST::EnumerationMember::EnumerationMember):
(WebCore::WHLSL::AST::EnumerationMember::codeLocation const):
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
(WebCore::WHLSL::AST::EnumerationMemberLiteral::EnumerationMemberLiteral):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::wrap):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
(WebCore::WHLSL::AST::Expression::Expression):
(WebCore::WHLSL::AST::Expression::codeLocation const):
(WebCore::WHLSL::AST::Expression::updateCodeLocation):
* Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h:
(WebCore::WHLSL::AST::Fallthrough::Fallthrough):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
(WebCore::WHLSL::AST::FloatLiteral::FloatLiteral):
(WebCore::WHLSL::AST::FloatLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp:
(WebCore::WHLSL::AST::FloatLiteralType::FloatLiteralType):
(WebCore::WHLSL::AST::FloatLiteralType::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
* Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
(WebCore::WHLSL::AST::ForLoop::ForLoop):
* Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
(WebCore::WHLSL::AST::FunctionDeclaration::FunctionDeclaration):
(WebCore::WHLSL::AST::FunctionDeclaration::codeLocation const):
* Modules/webgpu/WHLSL/AST/WHLSLGlobalVariableReference.h:
(WebCore::WHLSL::AST::GlobalVariableReference::GlobalVariableReference):
* Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
(WebCore::WHLSL::AST::IfStatement::IfStatement):
* Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
(WebCore::WHLSL::AST::IndexExpression::IndexExpression):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
(WebCore::WHLSL::AST::IntegerLiteral::IntegerLiteral):
(WebCore::WHLSL::AST::IntegerLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
(WebCore::WHLSL::AST::IntegerLiteralType::IntegerLiteralType):
(WebCore::WHLSL::AST::IntegerLiteralType::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
* Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h:
(WebCore::WHLSL::AST::LogicalExpression::LogicalExpression):
* Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h:
(WebCore::WHLSL::AST::LogicalNotExpression::LogicalNotExpression):
* Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
(WebCore::WHLSL::AST::MakeArrayReferenceExpression::MakeArrayReferenceExpression):
* Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
(WebCore::WHLSL::AST::MakePointerExpression::MakePointerExpression):
* Modules/webgpu/WHLSL/AST/WHLSLNamedType.h:
(WebCore::WHLSL::AST::NamedType::NamedType):
(WebCore::WHLSL::AST::NamedType::codeLocation const):
(WebCore::WHLSL::AST::NamedType::updateCodeLocation):
* Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
(WebCore::WHLSL::AST::NativeTypeDeclaration::NativeTypeDeclaration):
* Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h:
(WebCore::WHLSL::AST::NullLiteral::NullLiteral):
(WebCore::WHLSL::AST::NullLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLNumThreadsFunctionAttribute.h:
(WebCore::WHLSL::AST::NumThreadsFunctionAttribute::NumThreadsFunctionAttribute):
* Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
(WebCore::WHLSL::AST::PointerType::PointerType):
* Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
(WebCore::WHLSL::AST::PropertyAccessExpression::PropertyAccessExpression):
* Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
(WebCore::WHLSL::AST::ReadModifyWriteExpression::create):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::ReadModifyWriteExpression):
* Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
(WebCore::WHLSL::AST::ReferenceType::ReferenceType):
* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
(WebCore::WHLSL::AST::ResourceSemantic::ResourceSemantic):
* Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
(WebCore::WHLSL::AST::Return::Return):
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h:
(WebCore::WHLSL::AST::SpecializationConstantSemantic::SpecializationConstantSemantic):
* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h:
(WebCore::WHLSL::AST::StageInOutSemantic::StageInOutSemantic):
* Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
(WebCore::WHLSL::AST::Statement::Statement):
(WebCore::WHLSL::AST::Statement::codeLocation const):
(WebCore::WHLSL::AST::Statement::updateCodeLocation):
* Modules/webgpu/WHLSL/AST/WHLSLStatementList.h:
(WebCore::WHLSL::AST::StatementList::StatementList):
* Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
(WebCore::WHLSL::AST::StructureDefinition::StructureDefinition):
* Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
(WebCore::WHLSL::AST::StructureElement::StructureElement):
(WebCore::WHLSL::AST::StructureElement::codeLocation const):
* Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h:
(WebCore::WHLSL::AST::SwitchCase::SwitchCase):
* Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h:
(WebCore::WHLSL::AST::SwitchStatement::SwitchStatement):
* Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h:
(WebCore::WHLSL::AST::TernaryExpression::TernaryExpression):
* Modules/webgpu/WHLSL/AST/WHLSLTrap.h:
(WebCore::WHLSL::AST::Trap::Trap):
* Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
(WebCore::WHLSL::AST::TypeDefinition::TypeDefinition):
* Modules/webgpu/WHLSL/AST/WHLSLTypeReference.cpp:
(WebCore::WHLSL::AST::TypeReference::wrap):
* Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
(WebCore::WHLSL::AST::TypeReference::TypeReference):
(WebCore::WHLSL::AST::TypeReference::cloneTypeReference const):
* Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
(WebCore::WHLSL::AST::UnnamedType::UnnamedType):
(WebCore::WHLSL::AST::UnnamedType::codeLocation const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
(WebCore::WHLSL::AST::UnsignedIntegerLiteral::UnsignedIntegerLiteral):
(WebCore::WHLSL::AST::UnsignedIntegerLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::UnsignedIntegerLiteralType):
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
* Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
* Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h:
(WebCore::WHLSL::AST::VariableDeclarationsStatement::VariableDeclarationsStatement):
* Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h:
(WebCore::WHLSL::AST::VariableReference::VariableReference):
(WebCore::WHLSL::AST::VariableReference::wrap):
* Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h:
(WebCore::WHLSL::AST::WhileLoop::WhileLoop):
* Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp:
(WebCore::WHLSL::AutoInitialize::visit):
* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
(WebCore::WHLSL::resolveWithOperatorAnderIndexer):
(WebCore::WHLSL::resolveWithOperatorLength):
(WebCore::WHLSL::resolveWithReferenceComparator):
(WebCore::WHLSL::resolveByInstantiation):
(WebCore::WHLSL::resolveFunction):
(WebCore::WHLSL::Checker::visit):
(WebCore::WHLSL::argumentTypeForAndOverload):
(WebCore::WHLSL::Checker::finishVisiting):
* Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
(WebCore::WHLSL::matchAndCommit):
* Modules/webgpu/WHLSL/WHLSLLexer.cpp:
(WebCore::WHLSL::Token::typeName):
(WebCore::WHLSL::Lexer::consumeTokenFromStream):
* Modules/webgpu/WHLSL/WHLSLLexer.h:
(WebCore::WHLSL::AST::CodeLocation::CodeLocation):
(WebCore::WHLSL::AST::CodeLocation::startOffset const):
(WebCore::WHLSL::AST::CodeLocation::endOffset const):
(WebCore::WHLSL::Token::startOffset const):
(WebCore::WHLSL::Lexer::errorString):
(WebCore::WHLSL::Token::stringView const):
* Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
(WebCore::WHLSL::NameResolver::visit):
* Modules/webgpu/WHLSL/WHLSLParser.cpp:
(WebCore::WHLSL::Parser::parse):
(WebCore::WHLSL::Parser::peek):
(WebCore::WHLSL::Parser::peekFurther):
(WebCore::WHLSL::Types::includes):
(WebCore::WHLSL::Types::appendNameTo):
(WebCore::WHLSL::Types<t>::includes):
(WebCore::WHLSL::Types<t>::appendNameTo):
(WebCore::WHLSL::Parser::peekType):
(WebCore::WHLSL::Parser::tryType):
(WebCore::WHLSL::Parser::tryTypes):
(WebCore::WHLSL::Parser::consumeType):
(WebCore::WHLSL::Parser::consumeTypes):
(WebCore::WHLSL::Parser::consumeIntegralLiteral):
(WebCore::WHLSL::Parser::parseConstantExpression):
(WebCore::WHLSL::Parser::parseTypeArgument):
(WebCore::WHLSL::Parser::parseTypeArguments):
(WebCore::WHLSL::Parser::parseTypeSuffixAbbreviated):
(WebCore::WHLSL::Parser::parseTypeSuffixNonAbbreviated):
(WebCore::WHLSL::Parser::parseType):
(WebCore::WHLSL::Parser::parseTypeDefinition):
(WebCore::WHLSL::Parser::parseBuiltInSemantic):
(WebCore::WHLSL::Parser::parseResourceSemantic):
(WebCore::WHLSL::Parser::parseSpecializationConstantSemantic):
(WebCore::WHLSL::Parser::parseStageInOutSemantic):
(WebCore::WHLSL::Parser::parseSemantic):
(WebCore::WHLSL::Parser::parseQualifiers):
(WebCore::WHLSL::Parser::parseStructureElement):
(WebCore::WHLSL::Parser::parseStructureDefinition):
(WebCore::WHLSL::Parser::parseEnumerationDefinition):
(WebCore::WHLSL::Parser::parseEnumerationMember):
(WebCore::WHLSL::Parser::parseNativeTypeDeclaration):
(WebCore::WHLSL::Parser::parseNumThreadsFunctionAttribute):
(WebCore::WHLSL::Parser::parseAttributeBlock):
(WebCore::WHLSL::Parser::parseParameter):
(WebCore::WHLSL::Parser::parseParameters):
(WebCore::WHLSL::Parser::parseComputeFunctionDeclaration):
(WebCore::WHLSL::Parser::parseVertexOrFragmentFunctionDeclaration):
(WebCore::WHLSL::Parser::parseRegularFunctionDeclaration):
(WebCore::WHLSL::Parser::parseOperatorFunctionDeclaration):
(WebCore::WHLSL::Parser::parseFunctionDeclaration):
(WebCore::WHLSL::Parser::parseBlock):
(WebCore::WHLSL::Parser::parseBlockBody):
(WebCore::WHLSL::Parser::parseIfStatement):
(WebCore::WHLSL::Parser::parseSwitchStatement):
(WebCore::WHLSL::Parser::parseSwitchCase):
(WebCore::WHLSL::Parser::parseForLoop):
(WebCore::WHLSL::Parser::parseWhileLoop):
(WebCore::WHLSL::Parser::parseDoWhileLoop):
(WebCore::WHLSL::Parser::parseVariableDeclaration):
(WebCore::WHLSL::Parser::parseVariableDeclarations):
(WebCore::WHLSL::Parser::parseStatement):
(WebCore::WHLSL::Parser::parseEffectfulExpression):
(WebCore::WHLSL::Parser::parseEffectfulAssignment):
(WebCore::WHLSL::Parser::parseLimitedSuffixOperator):
(WebCore::WHLSL::Parser::parseSuffixOperator):
(WebCore::WHLSL::Parser::parseExpression):
(WebCore::WHLSL::Parser::completeTernaryConditional):
(WebCore::WHLSL::Parser::completeAssignment):
(WebCore::WHLSL::Parser::parsePossibleTernaryConditional):
(WebCore::WHLSL::Parser::completePossibleLogicalBinaryOperation):
(WebCore::WHLSL::Parser::completePossibleRelationalBinaryOperation):
(WebCore::WHLSL::Parser::completePossibleShift):
(WebCore::WHLSL::Parser::completePossibleAdd):
(WebCore::WHLSL::Parser::completePossibleMultiply):
(WebCore::WHLSL::Parser::parsePossiblePrefix):
(WebCore::WHLSL::Parser::parsePossibleSuffix):
(WebCore::WHLSL::Parser::parseCallExpression):
(WebCore::WHLSL::Parser::parseTerm):
* Modules/webgpu/WHLSL/WHLSLParser.h:
* Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
(WebCore::WHLSL::anonymousToken):
(WebCore::WHLSL::PreserveLifetimes::PreserveLifetimes):
(WebCore::WHLSL::PreserveLifetimes::assignVariableIntoStruct):
(WebCore::WHLSL::preserveVariableLifetimes):
* Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
(WebCore::WHLSL::PropertyResolver::visit):
(WebCore::WHLSL::wrapAnderCallArgument):
(WebCore::WHLSL::setterCall):
(WebCore::WHLSL::getterCall):
(WebCore::WHLSL::modify):
(WebCore::WHLSL::PropertyResolver::simplifyRightValue):
(WebCore::WHLSL::LeftValueSimplifier::finishVisiting):
* Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
(WebCore::WHLSL::synthesizeArrayOperatorLength):
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
(WebCore::WHLSL::synthesizeConstructors):
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
(WebCore::WHLSL::synthesizeEnumerationFunctions):
* Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
(WebCore::WHLSL::synthesizeStructureAccessors):

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

10 months agoHook up WebGL's back buffer in ANGLE backend on macOS
commit-queue@webkit.org [Wed, 10 Jul 2019 18:43:02 +0000 (18:43 +0000)]
Hook up WebGL's back buffer in ANGLE backend on macOS
https://bugs.webkit.org/show_bug.cgi?id=198982

Patch by Kenneth Russell <kbr@chromium.org> on 2019-07-10
Reviewed by Alex Christensen.

Source/ThirdParty/ANGLE:

Add source files needed to implement and call ANGLE extensions, and
export headers necessary for those extensions. Update the script which
adjusts include paths to handle the new headers.

Cherry-pick fix for ANGLE bug crbug.com/angleproject/3669 to support
antialias:true for ANGLE-backed WebGL contexts.

* ANGLE.xcodeproj/project.pbxproj:
* adjust-angle-include-paths.sh:
* src/libANGLE/FramebufferAttachment.cpp:
(gl::FramebufferAttachment::getTextureImageIndex const): Deleted.
* src/libANGLE/FramebufferAttachment.h:
(gl::FramebufferAttachment::getTextureImageIndex const):
* src/libANGLE/validationES2.cpp:
(gl::ValidateBlitFramebufferANGLE):

Source/WebCore:

Fix a few places which were accidentally calling desktop OpenGL rather
than ANGLE. Fix some calls which were using ANGLE's OpenGL ES 3.0
entry points rather than the OpenGL ES 2.0 extension APIs, causing
them to generate errors in WebGL 1.0's backend. Change
Extensions3DANGLE to use ANGLE's requestable extension mechanism.

Fix framebuffer setup when using ANGLE for WebGL 1.0 contexts, for
both antialias:true and false.

Remove ANGLEWebKitBridge in ANGLE backend. It interfered with the
correct operation of ANGLE's internal shader compiler, and was
unnecessary given the use of ANGLE. Remove all manual shader name
hashing and mapping in ANGLE backend.

Tested with parts of the WebGL conformance suite and the San
Angeles demo, which now runs properly with WebKit's ANGLE backend
for WebGL.

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::getProgramParameter):
(WebCore::WebGLRenderingContextBase::getUniformLocation):
(WebCore::WebGLRenderingContextBase::linkProgramWithoutInvalidatingAttribLocations):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/angle/Extensions3DANGLE.cpp:
(WebCore::Extensions3DANGLE::Extensions3DANGLE):
(WebCore::Extensions3DANGLE::supports):
(WebCore::Extensions3DANGLE::ensureEnabled):
(WebCore::Extensions3DANGLE::isEnabled):
(WebCore::Extensions3DANGLE::getTranslatedShaderSourceANGLE):
(WebCore::Extensions3DANGLE::initializeAvailableExtensions):
(WebCore::Extensions3DANGLE::blitFramebuffer):
(WebCore::Extensions3DANGLE::renderbufferStorageMultisample):
(WebCore::Extensions3DANGLE::createVertexArrayOES):
(WebCore::Extensions3DANGLE::deleteVertexArrayOES):
(WebCore::Extensions3DANGLE::isVertexArrayOES):
(WebCore::Extensions3DANGLE::bindVertexArrayOES):
(WebCore::Extensions3DANGLE::supportsExtension):
(WebCore::Extensions3DANGLE::drawBuffersEXT):
(WebCore::Extensions3DANGLE::drawArraysInstanced):
(WebCore::Extensions3DANGLE::drawElementsInstanced):
(WebCore::Extensions3DANGLE::vertexAttribDivisor):
* platform/graphics/angle/Extensions3DANGLE.h:
* platform/graphics/angle/GraphicsContext3DANGLE.cpp:
(WebCore::GraphicsContext3D::validateAttributes):
(WebCore::GraphicsContext3D::reshapeFBOs):
(WebCore::GraphicsContext3D::attachDepthAndStencilBufferIfNeeded):
(WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
(WebCore::GraphicsContext3D::validateDepthStencil):
(WebCore::GraphicsContext3D::prepareTexture):
(WebCore::GraphicsContext3D::attachShader):
(WebCore::GraphicsContext3D::bindAttribLocation):
(WebCore::GraphicsContext3D::compileShader):
(WebCore::GraphicsContext3D::compileShaderDirect):
(WebCore::GraphicsContext3D::detachShader):
(WebCore::GraphicsContext3D::getActiveAttribImpl):
(WebCore::GraphicsContext3D::getActiveAttrib):
(WebCore::GraphicsContext3D::getActiveUniformImpl):
(WebCore::GraphicsContext3D::getActiveUniform):
(WebCore::GraphicsContext3D::getAttribLocation):
(WebCore::GraphicsContext3D::getAttribLocationDirect):
(WebCore::GraphicsContext3D::moveErrorsToSyntheticErrorList):
(WebCore::GraphicsContext3D::linkProgram):
(WebCore::GraphicsContext3D::shaderSource):
(WebCore::GraphicsContext3D::getUnmangledInfoLog):
(WebCore::GraphicsContext3D::getShaderiv):
(WebCore::GraphicsContext3D::getShaderInfoLog):
(WebCore::GraphicsContext3D::getUniformLocation):
(WebCore::GraphicsContext3D::createBuffer):
(WebCore::GraphicsContext3D::createFramebuffer):
(WebCore::GraphicsContext3D::createProgram):
(WebCore::GraphicsContext3D::createRenderbuffer):
(WebCore::GraphicsContext3D::createShader):
(WebCore::GraphicsContext3D::createTexture):
(WebCore::GraphicsContext3D::deleteBuffer):
(WebCore::GraphicsContext3D::deleteFramebuffer):
(WebCore::GraphicsContext3D::deleteProgram):
(WebCore::GraphicsContext3D::deleteRenderbuffer):
(WebCore::GraphicsContext3D::deleteShader):
(WebCore::GraphicsContext3D::deleteTexture):
(WebCore::GraphicsContext3D::synthesizeGLError):
(): Deleted.
(WebCore::setCurrentNameHashMapForShader): Deleted.
(WebCore::nameHashForShader): Deleted.
(WebCore::GraphicsContext3D::checkVaryingsPacking const): Deleted.
(WebCore::GraphicsContext3D::precisionsMatch const): Deleted.
(WebCore::generateHashedName): Deleted.
(WebCore::GraphicsContext3D::mappedSymbolInShaderSourceMap): Deleted.
(WebCore::GraphicsContext3D::mappedSymbolName): Deleted.
(WebCore::GraphicsContext3D::originalSymbolInShaderSourceMap): Deleted.
(WebCore::GraphicsContext3D::originalSymbolName): Deleted.
(WebCore::GraphicsContext3D::getNonBuiltInActiveSymbolCount): Deleted.
(WebCore::GraphicsContext3D::getShaderSource): Deleted.
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::~GraphicsContext3D):
(WebCore::GraphicsContext3D::makeContextCurrent):
(WebCore::GraphicsContext3D::checkGPUStatus):
(WebCore::GraphicsContext3D::allocateIOSurfaceBackingStore):
(WebCore::GraphicsContext3D::updateFramebufferTextureBackingStoreFromLayer):
* platform/graphics/cocoa/WebGLLayer.h:
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer initWithGraphicsContext3D:]):
(-[WebGLLayer copyImageSnapshotWithColorSpace:]):
(-[WebGLLayer display]):
(-[WebGLLayer setEGLDisplay:andConfig:]):
(-[WebGLLayer dealloc]):
(-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]):
(-[WebGLLayer bindFramebufferToNextAvailableSurface]):

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

10 months agoDisable speculative loading if cache is not to be used for the load
youenn@apple.com [Wed, 10 Jul 2019 18:17:59 +0000 (18:17 +0000)]
Disable speculative loading if cache is not to be used for the load
https://bugs.webkit.org/show_bug.cgi?id=199644

Reviewed by Chris Dumez.

Source/WebKit:

When the page is reloaded, loads are instructed to not use the cache.
It is therefore unneeded to do speculative revalidation.
Allow speculative revalidation if the cache policy is either the default HTTP policy or
if policy is to refresh all cache data.
Covered by added test.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::cachePolicyValidForSpeculativeRevalidation):
(WebKit::NetworkCache::canRequestUseSpeculativeRevalidation):

LayoutTests:

* http/wpt/fetch/disable-speculative-for-reload-expected.txt: Added.
* http/wpt/fetch/disable-speculative-for-reload.html: Added.
* http/wpt/fetch/resources/iframe-with-image.py: Added.
(main):
* http/wpt/fetch/resources/image-load-count.py: Added.
(main):
* http/wpt/fetch/resources/image-load.py: Added.
(main):

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

10 months agoopenDatabase property should not be enumerable on DOMWindow
youenn@apple.com [Wed, 10 Jul 2019 18:09:27 +0000 (18:09 +0000)]
openDatabase property should not be enumerable on DOMWindow
https://bugs.webkit.org/show_bug.cgi?id=199672
<rdar://problem/52809000>

Reviewed by Chris Dumez.

Source/WebCore:

Test: storage/websql/openDatabase-deprecation.html

* Modules/webdatabase/DOMWindowWebDatabase.idl:

LayoutTests:

* storage/websql/openDatabase-deprecation-expected.txt: Added.
* storage/websql/openDatabase-deprecation.html: Added.

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

10 months ago[MacOS] Filter VPA info logged to stdout
ryanhaddad@apple.com [Wed, 10 Jul 2019 18:00:13 +0000 (18:00 +0000)]
[MacOS] Filter VPA info logged to stdout
https://bugs.webkit.org/show_bug.cgi?id=199673

Reviewed by Eric Carlson.

* Scripts/webkitpy/port/mac.py:
(MacPort.logging_patterns_to_strip):

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

10 months agoFix unsafe usage of makeWeakPtr() in CMTimebaseEffectiveRateChangedCallback()
cdumez@apple.com [Wed, 10 Jul 2019 17:34:19 +0000 (17:34 +0000)]
Fix unsafe usage of makeWeakPtr() in CMTimebaseEffectiveRateChangedCallback()
https://bugs.webkit.org/show_bug.cgi?id=199656

Reviewed by Eric Carlson.

CMTimebaseEffectiveRateChangedCallback() is getting called on a background thread and would call
makeWeakPtr() on the MediaPlayerPrivateMediaSourceAVFObjC object, which is not safe because
MediaPlayerPrivateMediaSourceAVFObjC is a main thread object.

To address the issue, move the logic for listening to effective rate changes to its own
Listener class which is ThreadSafeRefCounted. Instead of using makeWeakPtr() on the background
thread, we now merely ref the thread-safe listener.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::EffectiveRateChangedListener::create):
(WebCore::EffectiveRateChangedListener::effectiveRateChanged):
(WebCore::CMTimebaseEffectiveRateChangedCallback):
(WebCore::EffectiveRateChangedListener::stop):
(WebCore::EffectiveRateChangedListener::EffectiveRateChangedListener):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC):

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

10 months agoFix build after Foundation changes UIEdgeInsets definition
commit-queue@webkit.org [Wed, 10 Jul 2019 17:17:16 +0000 (17:17 +0000)]
Fix build after Foundation changes UIEdgeInsets definition
https://bugs.webkit.org/show_bug.cgi?id=199660
<rdar://problem/52390453>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-07-10
Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/Cocoa/WKWebViewContentProvider.h:

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

10 months agoUnreviewed, rolling out r247286.
ryanhaddad@apple.com [Wed, 10 Jul 2019 17:09:05 +0000 (17:09 +0000)]
Unreviewed, rolling out r247286.

Caused TestWTF.WTF.StringOperators to fail on debug bots

Reverted changeset:

"Add StringBuilder member function which allows makeString()
style variadic argument construction"
https://bugs.webkit.org/show_bug.cgi?id=198997
https://trac.webkit.org/changeset/247286

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

10 months agoRemove TouchActionData
antti@apple.com [Wed, 10 Jul 2019 17:03:04 +0000 (17:03 +0000)]
Remove TouchActionData
https://bugs.webkit.org/show_bug.cgi?id=199668

Reviewed by Simon Fraser.

Source/WebCore:

TouchActionData structure has been superseded by touch-action regions in EventRegion and is unused.
Remove it and the supporting code.

No functional changes.

* dom/Document.cpp:
(WebCore::Document::nodeWillBeRemoved):
(WebCore::Document::updateTouchActionElements): Deleted.
* dom/Document.h:
(WebCore::Document::mayHaveElementsWithNonAutoTouchAction const):
(WebCore::Document::setMayHaveElementsWithNonAutoTouchAction):

Replace touchActionElements set with a bit that covers the only remaining clients (optimizations).
Note that touchActionElements was not deleted when emptied, it had the same "may have" behavior (which
is currently needed).

(WebCore::Document::touchActionElements const): Deleted.
* dom/Element.cpp:
(WebCore::Element::computedTouchActions const): Deleted.
* dom/Element.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::touchActionDataAtPoint const): Deleted.
* page/scrolling/ScrollingTree.h:
* platform/EventTrackingRegions.cpp:
(WebCore::operator==):
* platform/EventTrackingRegions.h:
(): Deleted.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateEventRegion):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):

Source/WebKit:

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

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

10 months ago[ews-build] Explicitly use perl or python while invoking scripts
aakash_jain@apple.com [Wed, 10 Jul 2019 16:10:59 +0000 (16:10 +0000)]
[ews-build] Explicitly use perl or python while invoking scripts
https://bugs.webkit.org/show_bug.cgi?id=199669

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py: Explicitly added perl or python while invoking scripts.
* BuildSlaveSupport/ews-build/steps_unittest.py: Updated unit-tests accordingly.

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

10 months agoRun tests on mips EWS
guijemont@igalia.com [Wed, 10 Jul 2019 16:06:02 +0000 (16:06 +0000)]
Run tests on mips EWS
https://bugs.webkit.org/show_bug.cgi?id=196854

Reviewed by Carlos Garcia Campos.

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

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

10 months ago[LFC][IFC] Remove redundant InlineFormattingContext::LineLayout members.
zalan@apple.com [Wed, 10 Jul 2019 15:53:35 +0000 (15:53 +0000)]
[LFC][IFC] Remove redundant InlineFormattingContext::LineLayout members.
https://bugs.webkit.org/show_bug.cgi?id=199654
<rdar://problem/52869206>

Reviewed by Antti Koivisto.

Some of the members are actually only needed in selected functions.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::LineLayout::layoutState const):
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::LineLayout::LineLayout):
(WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
(WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const):
(WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
(WebCore::Layout::InlineFormattingContext::LineLayout::alignRuns const):
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::inlineItems):
(WebCore::Layout::InlineFormattingState::inlineRuns):
(WebCore::Layout::InlineFormattingState::lineBoxes):

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

10 months ago[GStreamer] Protect against null samples and samples with null buffers
eocanha@igalia.com [Wed, 10 Jul 2019 14:53:51 +0000 (14:53 +0000)]
[GStreamer] Protect against null samples and samples with null buffers
https://bugs.webkit.org/show_bug.cgi?id=199619

Reviewed by Philippe Normand.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::GstVideoFrameHolder::GstVideoFrameHolder): Assert to enforce non-null samples.
(WebCore::GstVideoFrameHolder::updateTexture): Protect against null m_buffer and improperly mapped video frame.

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

10 months ago[GTK][WPE] Enable support for CSS_COMPOSITING
clopez@igalia.com [Wed, 10 Jul 2019 11:59:00 +0000 (11:59 +0000)]
[GTK][WPE] Enable support for CSS_COMPOSITING
https://bugs.webkit.org/show_bug.cgi?id=199513

Reviewed by Michael Catanzaro.

.:

This feature is needed to support the CSS properties "mix-blend-mode" and "isolation".
Enable it for all ports except for AppleWin (doesn't build).

It has been tested that it builds on the EWS bots of all the ports enabled (for those that have an EWS).
Also, for the GTK and WPE ports it also has been tested that the feature works fine on most of the cases and that doesn't cause regressions.

* Source/cmake/OptionsFTW.cmake: Enable the feature.
* Source/cmake/OptionsMac.cmake: Use the new default.
* Source/cmake/OptionsWin.cmake: Enable for WinCairo only.
* Source/cmake/WebKitFeatures.cmake: Enable it Globally

LayoutTests:

Rebaseline the tests that pass after enabling CSS_COMPOSITING.
The feature works is most of the cases, but there are still some tests/cases not working.

There are also some new failures marked related to SVG blending (css3/blending/svg*), but those were already failing before.
So its unrelated to this change.

* platform/gtk/TestExpectations:
* platform/gtk/css3/blending/background-blend-mode-default-value-expected.png:
* platform/gtk/css3/blending/background-blend-mode-different-image-formats-expected.png:
* platform/gtk/css3/blending/background-blend-mode-image-color-expected.png:
* platform/gtk/css3/blending/background-blend-mode-image-image-expected.png:
* platform/gtk/css3/blending/background-blend-mode-single-layer-no-blending-expected.png:
* platform/gtk/css3/blending/blend-mode-background-expected.png:
* platform/gtk/css3/blending/blend-mode-background-expected.txt:
* platform/gtk/css3/blending/blend-mode-isolation-flags-append-non-stacking-context-blending-expected.png: Added.
* platform/gtk/css3/blending/blend-mode-isolation-flags-append-non-stacking-context-blending-expected.txt: Added.
* platform/gtk/css3/blending/blend-mode-isolation-flags-append-stacking-context-blending-expected.png: Added.
* platform/gtk/css3/blending/blend-mode-isolation-flags-append-stacking-context-blending-expected.txt: Added.
* platform/gtk/css3/blending/blend-mode-isolation-flags-turn-off-blending-expected.png: Added.
* platform/gtk/css3/blending/blend-mode-isolation-flags-turn-off-blending-expected.txt: Added.
* platform/gtk/css3/blending/blend-mode-isolation-flags-turn-off-blending-no-isolation-expected.png: Added.
* platform/gtk/css3/blending/blend-mode-isolation-flags-turn-off-blending-no-isolation-expected.txt: Added.
* platform/gtk/css3/blending/blend-mode-isolation-flags-turn-off-stacking-context-expected.png: Added.
* platform/gtk/css3/blending/blend-mode-isolation-flags-turn-off-stacking-context-expected.txt: Added.
* platform/gtk/css3/blending/blend-mode-isolation-flags-turn-on-blending-expected.png: Added.
* platform/gtk/css3/blending/blend-mode-isolation-flags-turn-on-blending-expected.txt: Added.
* platform/gtk/css3/blending/blend-mode-isolation-flags-turn-on-stacking-context-expected.png: Added.
* platform/gtk/css3/blending/blend-mode-isolation-flags-turn-on-stacking-context-expected.txt: Added.
* platform/gtk/css3/blending/blend-mode-overflow-expected.png: Added.
* platform/gtk/css3/blending/blend-mode-overflow-expected.txt: Added.
* platform/gtk/css3/blending/blend-mode-simple-expected.png: Added.
* platform/gtk/css3/blending/blend-mode-simple-expected.txt: Added.
* platform/gtk/css3/blending/repaint/blend-mode-turn-off-isolation-no-effect-expected.txt: Added.
* platform/gtk/css3/blending/svg-blend-layer-blend-expected.png:
* platform/gtk/css3/blending/svg-blend-layer-blend-expected.txt:
* platform/gtk/css3/blending/svg-blend-layer-clip-path-expected.png: Added.
* platform/gtk/css3/blending/svg-blend-layer-clip-path-expected.txt: Added.
* platform/gtk/css3/blending/svg-blend-layer-filter-expected.png:
* platform/gtk/css3/blending/svg-blend-layer-filter-expected.txt:
* platform/gtk/css3/blending/svg-blend-layer-mask-expected.png:
* platform/gtk/css3/blending/svg-blend-layer-mask-expected.txt:
* platform/gtk/css3/blending/svg-blend-layer-opacity-expected.png:
* platform/gtk/css3/blending/svg-blend-layer-opacity-expected.txt:
* platform/wpe/TestExpectations:
* platform/wpe/css3/blending/background-blend-mode-default-value-expected.png: Added.
* platform/wpe/css3/blending/background-blend-mode-default-value-expected.txt: Added.
* platform/wpe/css3/blending/background-blend-mode-different-image-formats-expected.png: Added.
* platform/wpe/css3/blending/background-blend-mode-different-image-formats-expected.txt: Added.
* platform/wpe/css3/blending/background-blend-mode-gif-color-2-expected.png: Added.
* platform/wpe/css3/blending/background-blend-mode-gif-color-2-expected.txt: Added.
* platform/wpe/css3/blending/background-blend-mode-gif-color-expected.png: Added.
* platform/wpe/css3/blending/background-blend-mode-gif-color-expected.txt: Added.
* platform/wpe/css3/blending/background-blend-mode-image-color-expected.png: Added.
* platform/wpe/css3/blending/background-blend-mode-image-color-expected.txt: Added.
* platform/wpe/css3/blending/background-blend-mode-image-image-expected.png: Added.
* platform/wpe/css3/blending/background-blend-mode-image-image-expected.txt: Added.
* platform/wpe/css3/blending/background-blend-mode-single-layer-no-blending-expected.png: Added.
* platform/wpe/css3/blending/background-blend-mode-single-layer-no-blending-expected.txt: Added.
* platform/wpe/css3/blending/blend-mode-background-expected.png: Added.
* platform/wpe/css3/blending/blend-mode-background-expected.txt: Copied from LayoutTests/platform/gtk/css3/blending/blend-mode-background-expected.txt.
* platform/wpe/css3/blending/blend-mode-isolation-flags-append-non-stacking-context-blending-expected.png: Added.
* platform/wpe/css3/blending/blend-mode-isolation-flags-append-non-stacking-context-blending-expected.txt: Added.
* platform/wpe/css3/blending/blend-mode-isolation-flags-append-stacking-context-blending-expected.png: Added.
* platform/wpe/css3/blending/blend-mode-isolation-flags-append-stacking-context-blending-expected.txt: Added.
* platform/wpe/css3/blending/blend-mode-isolation-flags-remove-non-stacking-context-blending-expected.png: Added.
* platform/wpe/css3/blending/blend-mode-isolation-flags-remove-non-stacking-context-blending-expected.txt: Added.
* platform/wpe/css3/blending/blend-mode-isolation-flags-remove-stacking-context-blending-expected.png: Added.
* platform/wpe/css3/blending/blend-mode-isolation-flags-remove-stacking-context-blending-expected.txt: Added.
* platform/wpe/css3/blending/blend-mode-isolation-flags-turn-off-blending-expected.png: Added.
* platform/wpe/css3/blending/blend-mode-isolation-flags-turn-off-blending-expected.txt: Added.
* platform/wpe/css3/blending/blend-mode-isolation-flags-turn-off-blending-no-isolation-expected.png: Added.
* platform/wpe/css3/blending/blend-mode-isolation-flags-turn-off-blending-no-isolation-expected.txt: Added.
* platform/wpe/css3/blending/blend-mode-isolation-flags-turn-off-stacking-context-expected.png: Added.
* platform/wpe/css3/blending/blend-mode-isolation-flags-turn-off-stacking-context-expected.txt: Added.
* platform/wpe/css3/blending/blend-mode-isolation-flags-turn-on-blending-expected.png: Added.
* platform/wpe/css3/blending/blend-mode-isolation-flags-turn-on-blending-expected.txt: Added.
* platform/wpe/css3/blending/blend-mode-isolation-flags-turn-on-stacking-context-expected.png: Added.
* platform/wpe/css3/blending/blend-mode-isolation-flags-turn-on-stacking-context-expected.txt: Added.
* platform/wpe/css3/blending/blend-mode-overflow-expected.png: Added.
* platform/wpe/css3/blending/blend-mode-overflow-expected.txt: Added.
* platform/wpe/css3/blending/blend-mode-simple-expected.png: Added.
* platform/wpe/css3/blending/blend-mode-simple-expected.txt: Added.
* platform/wpe/css3/blending/repaint/blend-mode-turn-off-isolation-no-effect-expected.txt: Added.
* platform/wpe/css3/blending/svg-blend-layer-blend-expected.png: Added.
* platform/wpe/css3/blending/svg-blend-layer-blend-expected.txt: Added.
* platform/wpe/css3/blending/svg-blend-layer-clip-path-expected.png: Added.
* platform/wpe/css3/blending/svg-blend-layer-clip-path-expected.txt: Added.
* platform/wpe/css3/blending/svg-blend-layer-filter-expected.png: Added.
* platform/wpe/css3/blending/svg-blend-layer-filter-expected.txt: Added.
* platform/wpe/css3/blending/svg-blend-layer-mask-expected.png: Added.
* platform/wpe/css3/blending/svg-blend-layer-mask-expected.txt: Added.
* platform/wpe/css3/blending/svg-blend-layer-opacity-expected.png: Added.
* platform/wpe/css3/blending/svg-blend-layer-opacity-expected.txt: Added.

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

10 months agoOptimize join of large empty arrays
tzagallo@apple.com [Wed, 10 Jul 2019 08:24:52 +0000 (08:24 +0000)]
Optimize join of large empty arrays
https://bugs.webkit.org/show_bug.cgi?id=199636

Reviewed by Mark Lam.

JSTests:

* microbenchmarks/large-empty-array-join.js: Added.
* microbenchmarks/large-empty-array-join-resolve-rope.js: Added.

Source/JavaScriptCore:

Replicate the behavior of `str.repeat(count)` when performing `new Array(count + 1).join(str)`.
I added two new microbenchmarks:
- large-empty-array-join, which does not use the result of the join and runs ~44x faster and uses ~18x less memory.
- large-empty-array-join-resolve-rope, which uses the result of the join and runs 2x faster.

                                            baseline                    diff
large-empty-array-join                2713.9698+-72.7621    ^     61.2335+-10.4836       ^ definitely 44.3217x faster
large-empty-array-join-resolve-string   26.5517+-0.3995     ^     12.9309+-0.5516        ^ definitely 2.0533x faster

large-empty-array-join memory usage with baseline (dirty):
    733012 kB current_mem
    756824 kB lifetime_peak

large-empty-array-join memory usage with diff (dirty):
    41904 kB current_mem
    41972 kB lifetime_peak

Additionally, I ran JetStream2, sunspider and v8-spider and all were neutral.

* runtime/ArrayPrototype.cpp:
(JSC::fastJoin):

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

10 months agoAX: HTML datalist accessibility is not exposed by WebKit
commit-queue@webkit.org [Wed, 10 Jul 2019 06:33:57 +0000 (06:33 +0000)]
AX: HTML datalist accessibility is not exposed by WebKit
https://bugs.webkit.org/show_bug.cgi?id=196998
<rdar://problem/49962521>

Patch by Andres Gonzalez <andresg_22@apple.com> on 2019-07-09
Reviewed by Chris Fleizach.

Source/WebCore:

Input fields with datalist are exposed as having a listbox popup.

Test: accessibility/datalist.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::popupValue const):
(WebCore::AccessibilityObject::hasDatalist const):
* accessibility/AccessibilityObject.h:

LayoutTests:

* accessibility/datalist-expected.txt: Added.
* accessibility/datalist.html: Added.

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

10 months ago[WPE][GTK] GUniqueOutPtr::release should return a raw pointer
mcatanzaro@igalia.com [Wed, 10 Jul 2019 06:02:33 +0000 (06:02 +0000)]
[WPE][GTK] GUniqueOutPtr::release should return a raw pointer
https://bugs.webkit.org/show_bug.cgi?id=199579

Reviewed by Carlos Garcia Campos.

Source/WebKit:

* NetworkProcess/glib/WebKitCachedResolver.cpp:
(webkitCachedResolverLookupByNameAsync):
(webkitCachedResolverLookupByNameWithFlagsAsync):
* UIProcess/API/glib/WebKitFaviconDatabase.cpp:
(processPendingIconsForPageURL):
(webkit_favicon_database_get_favicon):
* UIProcess/API/glib/WebKitUserContentFilterStore.cpp:
(webkit_user_content_filter_store_save_from_file):

Source/WTF:

GUniqueOutPtr::release should release to a raw pointer, rather than a GUniquePtr. If a
GUniquePtr is desired, it's trivial to construct one from the raw pointer, but all existing
callsites under Source/ would rather have a raw pointer. Currently they have to call
release().release() to get the raw pointer, which is annoying.

* wtf/glib/GUniquePtr.h:
(WTF::GUniqueOutPtr::release):

Tools:

* TestWebKitAPI/Tests/WTF/glib/GUniquePtr.cpp:
(TestWebKitAPI::TEST):

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

10 months agoReplace old, broken WebGPU IDL spec link with the new one in IDL comments.
justin_fan@apple.com [Wed, 10 Jul 2019 04:39:33 +0000 (04:39 +0000)]
Replace old, broken WebGPU IDL spec link with the new one in IDL comments.

Rubber-stamped by Myles C. Maxfield.

No test changes or change in behavior.

* Modules/webgpu/GPUBindGroupLayoutBinding.idl:
* Modules/webgpu/GPUBindGroupLayoutDescriptor.idl:
* Modules/webgpu/GPUBlendDescriptor.idl:
* Modules/webgpu/GPUBufferDescriptor.idl:
* Modules/webgpu/GPUBufferUsage.idl:
* Modules/webgpu/GPUCanvasContext.idl:
* Modules/webgpu/GPUColor.idl:
* Modules/webgpu/GPUColorStateDescriptor.idl:
* Modules/webgpu/GPUColorWriteBits.idl:
* Modules/webgpu/GPUCompareFunction.idl:
* Modules/webgpu/GPUDepthStencilStateDescriptor.idl:
* Modules/webgpu/GPUExtent3D.idl:
* Modules/webgpu/GPULoadOp.idl:
* Modules/webgpu/GPUOrigin3D.idl:
* Modules/webgpu/GPURequestAdapterOptions.idl:
* Modules/webgpu/GPUSamplerDescriptor.idl:
* Modules/webgpu/GPUShaderStageBit.idl:
* Modules/webgpu/GPUStoreOp.idl:
* Modules/webgpu/GPUTextureDescriptor.idl:
* Modules/webgpu/GPUTextureUsage.idl:
* Modules/webgpu/GPUVertexAttributeDescriptor.idl:
* Modules/webgpu/GPUVertexBufferDescriptor.idl:
* Modules/webgpu/GPUVertexInputDescriptor.idl:
* Modules/webgpu/WebGPU.idl:
* Modules/webgpu/WebGPUAdapter.idl:
* Modules/webgpu/WebGPUBindGroup.idl:
* Modules/webgpu/WebGPUBindGroupBinding.idl:
* Modules/webgpu/WebGPUBindGroupDescriptor.idl:
* Modules/webgpu/WebGPUBindGroupLayout.idl:
* Modules/webgpu/WebGPUBuffer.idl:
* Modules/webgpu/WebGPUBufferBinding.idl:
* Modules/webgpu/WebGPUCommandBuffer.idl:
* Modules/webgpu/WebGPUCommandEncoder.idl:
* Modules/webgpu/WebGPUComputePassEncoder.idl:
* Modules/webgpu/WebGPUComputePipeline.idl:
* Modules/webgpu/WebGPUComputePipelineDescriptor.idl:
* Modules/webgpu/WebGPUDevice.idl:
* Modules/webgpu/WebGPUPipelineDescriptorBase.idl:
* Modules/webgpu/WebGPUPipelineLayout.idl:
* Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl:
* Modules/webgpu/WebGPUPipelineStageDescriptor.idl:
* Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
* Modules/webgpu/WebGPUQueue.idl:
* Modules/webgpu/WebGPURenderPassDescriptor.idl:
* Modules/webgpu/WebGPURenderPassEncoder.idl:
* Modules/webgpu/WebGPURenderPipeline.idl:
* Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
* Modules/webgpu/WebGPUSampler.idl:
* Modules/webgpu/WebGPUShaderModule.idl:
* Modules/webgpu/WebGPUShaderModuleDescriptor.idl:
* Modules/webgpu/WebGPUSwapChain.idl:
* Modules/webgpu/WebGPUTexture.idl:
* Modules/webgpu/WebGPUTextureView.idl:

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

10 months agoStop using GenericTaskQueue from multiple threads
cdumez@apple.com [Wed, 10 Jul 2019 04:19:48 +0000 (04:19 +0000)]
Stop using GenericTaskQueue from multiple threads
https://bugs.webkit.org/show_bug.cgi?id=199652

Reviewed by Geoffrey Garen.

WebCoreAVFLoaderDelegate was calling GenericTaskQueue::enqueueTask() from a background thread,
which is not safe because the implementation of enqueueTask() calls makeWeakPtr() on the
GenericTaskQueue (a main thread object).

Update WebCoreAVFLoaderDelegate to use callOnMainThread() instead.

* platform/GenericTaskQueue.h:
Stop last template parameter which was used exclusively by WebCoreAVFLoaderDelegate to try and
make GenericTaskQueue thread-safe.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(-[WebCoreAVFMovieObserver metadataLoaded]):
(-[WebCoreAVFMovieObserver didEnd:]):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
(-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
(-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]):
(-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
(-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):

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

10 months agoFixed elements appear in the middle of full page screenshots taken when scrolled
timothy_horton@apple.com [Wed, 10 Jul 2019 01:52:23 +0000 (01:52 +0000)]
Fixed elements appear in the middle of full page screenshots taken when scrolled
https://bugs.webkit.org/show_bug.cgi?id=199649
<rdar://problem/52476226>

Reviewed by Simon Fraser.

Source/WebCore:

* page/FrameView.h:
Expose a getter for the layout viewport override rect.

Source/WebKit:

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
Temporarily expand the layout viewport to the size of the snapshotting page,
so that fixed elements sit against the bounds of the page instead of
wherever you're currently scrolled to.

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

10 months ago[iOS WK2] Use Optional<> for two data members of WKWebView
simon.fraser@apple.com [Wed, 10 Jul 2019 01:31:03 +0000 (01:31 +0000)]
[iOS WK2] Use Optional<> for two data members of WKWebView
https://bugs.webkit.org/show_bug.cgi?id=199637

Reviewed by Tim Horton.

Use Optional<CGSize> to replace _overridesViewLayoutSize/_viewLayoutSizeOverride
and _overridesMaximumUnobscuredSize/_maximumUnobscuredSizeOverride.

No behavior change.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView activeViewLayoutSize:]):
(-[WKWebView _frameOrBoundsChanged]):
(activeMaximumUnobscuredSize):
(-[WKWebView _minimumLayoutSizeOverride]):
(-[WKWebView _setViewLayoutSizeOverride:]):
(-[WKWebView _maximumUnobscuredSizeOverride]):
(-[WKWebView _setMaximumUnobscuredSizeOverride:]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
(-[WKWebView _clearOverrideLayoutParameters]):

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

10 months ago[WHLSL] Import another round of JS spec tests
sbarati@apple.com [Wed, 10 Jul 2019 00:23:19 +0000 (00:23 +0000)]
[WHLSL] Import another round of JS spec tests
https://bugs.webkit.org/show_bug.cgi?id=199647

Reviewed by Myles C. Maxfield.

This patch also removes the unneded <!-- webkit-test-runner [ experimental:WebGPUEnabled=true ] -->
comments in various tests.

* webgpu/bind-groups.html:
* webgpu/blit-commands.html:
* webgpu/map-read-buffers.html:
* webgpu/map-write-buffers.html:
* webgpu/msl-harness-test.html:
* webgpu/pipeline-layouts.html:
* webgpu/queue-creation.html:
* webgpu/render-command-encoding.html:
* webgpu/shader-modules.html:
* webgpu/textures-textureviews.html:
* webgpu/whlsl-array-spec-tests.html:
* webgpu/whlsl-bad-ander-expected.txt: Added.
* webgpu/whlsl-bad-ander.html: Added.
* webgpu/whlsl-bad-literals-expected.txt: Added.
* webgpu/whlsl-bad-literals.html: Added.
* webgpu/whlsl-bitwise-bool-ops.html:
* webgpu/whlsl-enum-spec-tests.html:
* webgpu/whlsl-equality.html:
* webgpu/whlsl-float-math-expected.txt: Added.
* webgpu/whlsl-float-math.html: Added.
* webgpu/whlsl-index-getter-setter-expected.txt: Added.
* webgpu/whlsl-index-getter-setter.html: Added.
* webgpu/whlsl-int-bit-math-expected.txt: Added.
* webgpu/whlsl-int-bit-math.html: Added.
* webgpu/whlsl-int-literal-compare.html:
* webgpu/whlsl-make-array-ref-spec-tests-expected.txt: Added.
* webgpu/whlsl-make-array-ref-spec-tests.html: Added.
* webgpu/whlsl-matrices-spec-tests.html:
* webgpu/whlsl-pointer-spec-tests-expected.txt: Added.
* webgpu/whlsl-pointer-spec-tests.html: Added.
* webgpu/whlsl-postfix-prefix-expected.txt: Added.
* webgpu/whlsl-postfix-prefix.html: Added.
* webgpu/whlsl-return-spec-tests.html:
* webgpu/whlsl-simple-getter-setter.html:
* webgpu/whlsl-simple-tests.html:
* webgpu/whlsl-simple-while-loop.html:
* webgpu/whlsl-test-harness-test.html:
* webgpu/whlsl-type-mismatch.html:
* webgpu/whlsl-uint-bitwise.html:

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

10 months agoFix integer type encoding / decoding in WKRemoteObjectCoder
cdumez@apple.com [Wed, 10 Jul 2019 00:13:01 +0000 (00:13 +0000)]
Fix integer type encoding / decoding in WKRemoteObjectCoder
https://bugs.webkit.org/show_bug.cgi?id=199643
<rdar://problem/52732342>

Reviewed by Anders Carlsson.

Source/WebKit:

As per [1], q / Q match to long long / unsigned long long, not long / unsigned long.

[1] https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtTypeEncodings.html#//apple_ref/doc/uid/TP40008048-CH100

* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(encodeInvocationArguments):
(decodeInvocationArguments):

Tools:

Update API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/RemoteObjectRegistry.h:
* TestWebKitAPI/Tests/WebKitCocoa/RemoteObjectRegistry.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/RemoteObjectRegistryPlugIn.mm:
(-[RemoteObjectRegistryPlugIn takeUnsignedLongLong:completionHandler:]):
(-[RemoteObjectRegistryPlugIn takeLongLong:completionHandler:]):
(-[RemoteObjectRegistryPlugIn takeUnsignedLong:completionHandler:]):
(-[RemoteObjectRegistryPlugIn takeLong:completionHandler:]):

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

10 months agoAdd StringBuilder member function which allows makeString() style variadic argument...
weinig@apple.com [Tue, 9 Jul 2019 23:54:07 +0000 (23:54 +0000)]
Add StringBuilder member function which allows makeString() style variadic argument construction
https://bugs.webkit.org/show_bug.cgi?id=198997

Reviewed by Darin Adler.

Source/WTF:

Adds new StringBuilder::flexibleAppend(...) member function which allows passing one or more
string-adaptable (in the sense that there is StringTypeAdapter specialization for the
type) parameters. This re-ususes the variadic template infrastructure in StringConcatenate.h
that is used for makeString(...) allowing for improvements in one to benefit the other.

The advantage of StringBuilder::flexibleAppend(...) over calling StringBuilder::append(...)
multiple times (beyond the code sharing with makeString(...) is that it can avoid unnecessary
additional re-allocations when the StringBuilder needs to expand it's capacity. It does this
by computing the complete required length for all the passed arguments and then ensuring enough
capacity is available. It also reduces the allocation overhead versus the anti-pattern of
builder.append(makeString(...)).

Ideally, this member function should eventually just be called StringBuilder::append(...), but
the current overload set for StringBuilder::append(...) makes this complicated due to overloads
that take two arguments such as StringBuilder::append(const UChar*, unsigned). Going forward, we
should rename or remove those overloads and move to a standard interface.

* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::pathByAppendingComponents):
Adopt StringBuilder::flexibleAppend, using to combine the append of '/' and component.

* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::appendUninitialized):
(WTF::StringBuilder::appendUninitializedWithoutOverflowCheck):
Extract the part of appendUnitialized that doesn't do the overflow check
into it's own member function to allow callers that have already done the
overflow check to bypass it.

(WTF::StringBuilder::appendUninitializedWithoutOverflowCheckForUChar):
(WTF::StringBuilder::appendUninitializedWithoutOverflowCheckForLChar):
Added to allow template member function flexibleAppendFromAdapters to call
appendUninitializedWithoutOverflowCheck without moving it to the header.

* wtf/text/StringBuilder.h:
(WTF::StringBuilder::flexibleAppendFromAdapters):
(WTF::StringBuilder::flexibleAppend):
Modeled on tryMakeStringFromAdapters in StringConcatenate.h, these
eagerly compute the required length, expand the buffer and then use
the existing string type adaptor accumulation functions used by makeString.

* wtf/text/StringConcatenate.h:
(WTF::stringTypeAdapterAccumulator):
(WTF::tryMakeStringFromAdapters):
(WTF::makeStringAccumulator): Deleted.
Renames makeStringAccumulator to stringTypeAdapterAccumulator now that it is used
by more than just makeString.

Tools:

* TestWebKitAPI/Tests/WTF/StringBuilder.cpp:
Add basic test showing that StringBuilder::flexibleAppend can be used to
append one or more string adaptable types.

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

10 months agoUnreviewed test gardening, address TestExpectations linter warning.
ryanhaddad@apple.com [Tue, 9 Jul 2019 23:20:53 +0000 (23:20 +0000)]
Unreviewed test gardening, address TestExpectations linter warning.

* TestExpectations: Delete entry for fast/content-observation since
the directory doesn't exist anymore.

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

10 months ago[WHLSL] Add another group of WHLSL JS reference spec tests
sbarati@apple.com [Tue, 9 Jul 2019 23:05:45 +0000 (23:05 +0000)]
[WHLSL] Add another group of WHLSL JS reference spec tests
https://bugs.webkit.org/show_bug.cgi?id=199642

Reviewed by Robin Morisset.

* webgpu/whlsl-array-spec-tests-expected.txt: Added.
* webgpu/whlsl-array-spec-tests.html: Added.
* webgpu/whlsl-enum-spec-tests-expected.txt: Added.
* webgpu/whlsl-enum-spec-tests.html: Added.
* webgpu/whlsl-equality-expected.txt: Added.
* webgpu/whlsl-equality.html: Added.
* webgpu/whlsl-matrices-spec-tests-expected.txt: Added.
* webgpu/whlsl-matrices-spec-tests.html: Added.
* webgpu/whlsl-return-spec-tests-expected.txt: Added.
* webgpu/whlsl-return-spec-tests.html: Added.
* webgpu/whlsl-simple-getter-setter-expected.txt: Added.
* webgpu/whlsl-simple-getter-setter.html: Added.
* webgpu/whlsl-simple-while-loop-expected.txt: Added.
* webgpu/whlsl-simple-while-loop.html: Added.

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

10 months agoCleanup uses of NetworkProcess::m_sessionByConnection
cdumez@apple.com [Tue, 9 Jul 2019 22:40:08 +0000 (22:40 +0000)]
Cleanup uses of NetworkProcess::m_sessionByConnection
https://bugs.webkit.org/show_bug.cgi?id=199586

Reviewed by Alex Christensen.

Avoid double HashMap lookups and call add() instead of ensure() when appropriate.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::networkSessionByConnection const):
(WebKit::NetworkProcess::webPageWasAdded):
(WebKit::NetworkProcess::webProcessWasDisconnected):

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

10 months agoFix build after r247279
achristensen@apple.com [Tue, 9 Jul 2019 22:11:04 +0000 (22:11 +0000)]
Fix build after r247279
https://bugs.webkit.org/show_bug.cgi?id=199640

* WebCore.xcodeproj/project.pbxproj:

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

10 months agoWKObject's minimum object alignment needs to be larger
commit-queue@webkit.org [Tue, 9 Jul 2019 21:49:21 +0000 (21:49 +0000)]
WKObject's minimum object alignment needs to be larger
https://bugs.webkit.org/show_bug.cgi?id=199523

Patch by Saagar Jha <saagarjha@apple.com> on 2019-07-09
Reviewed by Alex Christensen.

WKObject's wrapped objects are currently constructed at addresses aligned to 8-byte boundaries, but some
classes have more stringent requirements. By querying std::aligned_storage for the alignment of an object
larger than anything we can construct, we should be able to satisfy alignment for any of WebKit's types.

* Shared/Cocoa/APIObject.mm: Use std::aligned_storage in conjunction with alignof to determine
minimumObjectAlignment, instead of hardcoding 8.

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

10 months agoDon't strip out spaces for personalized Autocorrections
megan_gardner@apple.com [Tue, 9 Jul 2019 21:45:05 +0000 (21:45 +0000)]
Don't strip out spaces for personalized Autocorrections
https://bugs.webkit.org/show_bug.cgi?id=199476
<rdar://problem/50782015>

Reviewed by Dean Jackson.

When inserting 'autocorrections' that are really predictive
text suggestions based on personal data, we would remove the space
before the suggestion, resulting in incorrect input.
To fix, do not remove a space when the autocorrected text and the text it is
replacing do not have any length.

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

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

10 months agoMove AutofillElements.{h,cpp} from editing/ios to editing/cocoa since they're used...
achristensen@apple.com [Tue, 9 Jul 2019 21:30:05 +0000 (21:30 +0000)]
Move AutofillElements.{h,cpp} from editing/ios to editing/cocoa since they're used on macOS
https://bugs.webkit.org/show_bug.cgi?id=199640

Reviewed by Chris Dumez.

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* editing/cocoa/AutofillElements.cpp: Copied from Source/WebCore/editing/ios/AutofillElements.cpp.
* editing/cocoa/AutofillElements.h: Copied from Source/WebCore/editing/ios/AutofillElements.h.
* editing/ios/AutofillElements.cpp: Removed.
* editing/ios/AutofillElements.h: Removed.

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

10 months agoWeb Inspector: Canvas: replace WTF::Vector with std::initializer_list in CallTracer...
drousso@apple.com [Tue, 9 Jul 2019 21:07:53 +0000 (21:07 +0000)]
Web Inspector: Canvas: replace WTF::Vector with std::initializer_list in CallTracer to avoid dynamic allocations
https://bugs.webkit.org/show_bug.cgi?id=199611

Reviewed by Joseph Pecoraro.

Source/WebCore:

The number of arguments for each member function is known at build time, so there's no need
to dynamically allocate a `WTF::Vector` when capturing the arguments. One downside to using
a `std::initializer_list` is that we can no longer "flatten" `WTF::Variant` arguments into
a `RecordCanvasActionVariant`, but this is acceptable because `WTF::Variant` supports having
yet another `WTF::Variant` as one of it's types, which the `InspectorCanvas` can then figure
out when it finally gets the data. The same applies to `nullptr`/`Optional` checks as well.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateAttributeSetterBodyDefinition):
(GenerateImplementationFunctionCall):
(GenerateCallTracer):
(GenerateCallTracerParameter): Deleted.
* bindings/scripts/test/JS/JSTestCallTracer.cpp:

* bindings/js/CallTracerTypes.h:
* bindings/js/CallTracer.h:
* bindings/js/CallTracer.cpp:
(WebCore::CallTracer::recordCanvasAction):

* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::recordCanvasAction):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::recordCanvasActionImpl):

* inspector/agents/InspectorCanvasAgent.h:
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::recordCanvasAction):

* inspector/InspectorCanvas.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::recordAction):
(WebCore::InspectorCanvas::buildAction):
Drive-by: handle the situation where a parameter is an array of deduplicated strings, which
          would otherwise be treated as an array of numbers.

Source/WebInspectorUI:

* UserInterface/Models/Recording.js:
(WI.Recording.prototype.async swizzle):
Drive-by: handle the situation where a parameter is an array of deduplicated strings, which
          would otherwise be treated as an array of numbers.

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

10 months agoUnreviewed, rolling out r247230.
tsavell@apple.com [Tue, 9 Jul 2019 21:01:50 +0000 (21:01 +0000)]
Unreviewed, rolling out r247230.

Caused storage/domstorage/localstorage/private-browsing-
affects-storage.html to crash with an assertion.

Reverted changeset:

"Cleanup uses of NetworkProcess::m_sessionByConnection"
https://bugs.webkit.org/show_bug.cgi?id=199586
https://trac.webkit.org/changeset/247230

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

10 months agoXHR CORS requests logged twice in the server
youenn@apple.com [Tue, 9 Jul 2019 20:44:07 +0000 (20:44 +0000)]
XHR CORS requests logged twice in the server
https://bugs.webkit.org/show_bug.cgi?id=199492
<rdar://problem/52757558>

Reviewed by Chris Dumez.

Source/WebKit:

Disable speculative loading for XHR and fetch.
These speculative requests might have specific headers that are no longer relevant
when reloading the page. This might then confuse servers.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::makeStoreDecision):
(WebKit::NetworkCache::canRequestUseSpeculativeRevalidation):
(WebKit::NetworkCache::Cache::retrieve):

LayoutTests:

* http/wpt/fetch/disable-speculative-load-for-xhr-and-fetch-loads-expected.txt: Added.
* http/wpt/fetch/disable-speculative-load-for-xhr-and-fetch-loads.html: Added.
* http/wpt/fetch/resources/fetch-xhr-load.py: Added.
(main):
* http/wpt/fetch/resources/xhr-and-fetch.html: Added.

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

10 months agoWeb Inspector: Add another Protocol Version (iOS 13.0)
pecoraro@apple.com [Tue, 9 Jul 2019 20:41:12 +0000 (20:41 +0000)]
Web Inspector: Add another Protocol Version (iOS 13.0)
https://bugs.webkit.org/show_bug.cgi?id=199631
<rdar://problem/47538193>

Reviewed by Devin Rousso.

* UserInterface/Protocol/Legacy/13.0/InspectorBackendCommands.js: Added.
* Versions/Inspector-iOS-13.0.json: Added.

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

10 months agoFix validation of method signature in decodeInvocation()
cdumez@apple.com [Tue, 9 Jul 2019 20:28:15 +0000 (20:28 +0000)]
Fix validation of method signature in decodeInvocation()
https://bugs.webkit.org/show_bug.cgi?id=199629
<rdar://problem/52731659>

Reviewed by Dan Bernstein.

The decoder was mistakenly assigning remoteMethodSignature to localMethodSignature
before comparing remoteMethodSignature and localMethodSignature, thus making the
check useless.

* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(decodeInvocation):

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

10 months agoFix non thread-safe use of WeakPtr in DisplayRefreshMonitorMac::displayLinkFired()
cdumez@apple.com [Tue, 9 Jul 2019 20:03:08 +0000 (20:03 +0000)]
Fix non thread-safe use of WeakPtr in DisplayRefreshMonitorMac::displayLinkFired()
https://bugs.webkit.org/show_bug.cgi?id=199626

Reviewed by Ryosuke Niwa.

Fix non thread-safe use of WeakPtr in DisplayRefreshMonitorMac::displayLinkFired().
DisplayRefreshMonitorMac gets constructed / destroyed on the main thread, it is
not thread-safe to call makeWeakPtr() on a DisplayRefreshMonitorMac object like it
was done before.

To address the issue, mark the object as ThreadSafeRefCounted and ref the object
in the lambda instead.

* platform/graphics/DisplayRefreshMonitor.h:
(WebCore::DisplayRefreshMonitor::stop):
* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::unregisterClient):
* platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
(WebCore::DisplayRefreshMonitorMac::~DisplayRefreshMonitorMac):
(WebCore::DisplayRefreshMonitorMac::stop):
(WebCore::DisplayRefreshMonitorMac::displayLinkFired):
* platform/graphics/mac/DisplayRefreshMonitorMac.h:

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

10 months agoRevert conditional WebPageProxy check to grant universal file read sandbox upon corre...
youenn@apple.com [Tue, 9 Jul 2019 19:56:24 +0000 (19:56 +0000)]
Revert conditional WebPageProxy check to grant universal file read sandbox upon correct sandbox creation
https://bugs.webkit.org/show_bug.cgi?id=199622
<rdar://problem/52357508>

Reviewed by Alex Christensen.

On iOS, the sandbox extension to '/' will usually fail, thus the universal file read sandbox is not granted.
This makes WebPageProxy cancel some file:// loads to the application own container.
As a short term fix, go back to previous behavior.
Covered by testing broken app identified in rdar://problem/52357508.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):

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

10 months agoRemove rel=subresource tests
commit-queue@webkit.org [Tue, 9 Jul 2019 19:38:54 +0000 (19:38 +0000)]
Remove rel=subresource tests
https://bugs.webkit.org/show_bug.cgi?id=199616

Patch by Rob Buis <rbuis@igalia.com> on 2019-07-09
Reviewed by Ryosuke Niwa.

Remove rel=subresource references by deleting or using rel=prefetch
instead.

* TestExpectations:
* fast/dom/HTMLLinkElement/cachedresource-types.html:
* http/tests/misc/link-rel-prefetch-and-subresource.html: Removed.
* webarchive/test-link-rel-subresource-beforeload-expected.webarchive: Removed.
* webarchive/test-link-rel-subresource-beforeload.html: Removed.

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

10 months agoOnly allow fetching and removing session credentials from WebsiteDataStore
sihui_liu@apple.com [Tue, 9 Jul 2019 19:25:57 +0000 (19:25 +0000)]
Only allow fetching and removing session credentials from WebsiteDataStore
https://bugs.webkit.org/show_bug.cgi?id=199385
<rdar://problem/52622080>

Reviewed by Alex Christensen.

Source/WebCore:

Fetch and remove only session credentials from NSURLCredentialStorage.

Modified existing API tests: WKWebsiteDataStore.FetchPersistentCredentials

* platform/network/CredentialStorage.cpp:
(WebCore::CredentialStorage::originsWithCredentials const):
(WebCore::CredentialStorage::originsWithSessionCredentials):
(WebCore::CredentialStorage::removeSessionCredentialsWithOrigins):
(WebCore::CredentialStorage::clearSessionCredentials):
(WebCore::CredentialStorage::clearPermanentCredentialsForProtectionSpace):
* platform/network/CredentialStorage.h:
* platform/network/mac/CredentialStorageMac.mm:
(WebCore::CredentialStorage::originsWithSessionCredentials):
(WebCore::CredentialStorage::removeSessionCredentialsWithOrigins):
(WebCore::CredentialStorage::clearSessionCredentials):
(WebCore::CredentialStorage::clearPermanentCredentialsForProtectionSpace):
(WebCore::CredentialStorage::originsWithPersistentCredentials): Deleted.

Source/WebKit:

Stop sending an extra message to network process for fetching or removing persistent credentials.

Also introduce a new SPI for clearing persistent credentials created in test.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::clearPermanentCredentialsForProtectionSpace):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
(WebKit::NetworkProcess::originsWithPersistentCredentials): Deleted.
(WebKit::NetworkProcess::removeCredentialsWithOrigins): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::originsWithPersistentCredentials): Deleted.
(WebKit::NetworkProcess::removeCredentialsWithOrigins): Deleted.
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _clearPermanentCredentialsForProtectionSpace:completionHandler:]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::clearPermanentCredentialsForProtectionSpace):
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::computeWebProcessAccessTypeForDataRemoval):
(WebKit::WebsiteDataStore::removeData):

Tools:

removeDataOfTypes will no longer remove persistent credentials. We should clear persistent credentials using
the new SPI after each test that creates persistent credentials, otherwise the later tests may use credentials
left by previous tests and didReceiveAuthenticationChallenge will not be invoked.

* TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm:
(TestWebKitAPI::TEST):

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

10 months agoWhen parsing an IPv4 address, wait until after deciding it is indeed an IPv4 address...
achristensen@apple.com [Tue, 9 Jul 2019 19:15:04 +0000 (19:15 +0000)]
When parsing an IPv4 address, wait until after deciding it is indeed an IPv4 address before reporting syntax violations
https://bugs.webkit.org/show_bug.cgi?id=199628

Reviewed by Brady Eidson.

Source/WTF:

Otherwise, we sometimes report syntax violations on things that are not IPv4 addresses and don't have syntax violations.
I added a unit test with one such URL that used to cause an assertion.

* wtf/URLParser.cpp:
(WTF::URLParser::parseIPv4Host):

Tools:

* TestWebKitAPI/Tests/WTF/URLParser.cpp:
(TestWebKitAPI::TEST_F):

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

10 months agoRemove invalid assertion in URLParser::domainToASCII
achristensen@apple.com [Tue, 9 Jul 2019 19:13:52 +0000 (19:13 +0000)]
Remove invalid assertion in URLParser::domainToASCII
https://bugs.webkit.org/show_bug.cgi?id=199624

Reviewed by Brady Eidson.

Source/WTF:

When a non-ASCII domain's punycode encoding is longer than 63 characters,
the URL is supposed to fail to parse, according to https://www.unicode.org/reports/tr46/#ToASCII
We and all other browsers do this.  When uidna_nameToASCII tries to punycode encode such a domain,
it can return a number larger than 63.  In this case, processingDetails.errors is UIDNA_ERROR_LABEL_TOO_LONG
and we fail to parse as desired and uidna_nameToASCII did not write out of bounds, so it was just the assertion
that was wrong.  I added some unit tests that would have hit the assertion and verify that we fail at the correct length.

* wtf/URLParser.cpp:
(WTF::URLParser::domainToASCII):

Tools:

* TestWebKitAPI/Tests/WTF/URLParser.cpp:
(TestWebKitAPI::TEST_F):

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

10 months agoURLParser should reserialize IPv6 addresses that end with a colon
achristensen@apple.com [Tue, 9 Jul 2019 19:12:42 +0000 (19:12 +0000)]
URLParser should reserialize IPv6 addresses that end with a colon
https://bugs.webkit.org/show_bug.cgi?id=199627

Reviewed by Brady Eidson.

Source/WTF:

When an IPv6 address ends in a colon, the colon should be removed which means the
serialized output is different than the input, which the URLParser calls a syntax violation.
This matches the URL specification, and I added a unit test that used to assert.

* wtf/URLParser.cpp:
(WTF::URLParser::parseIPv6Host):

Tools:

* TestWebKitAPI/Tests/WTF/URLParser.cpp:
(TestWebKitAPI::TEST_F):

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

10 months agoNull check HistoryItems given to loadDifferentDocumentItem
achristensen@apple.com [Tue, 9 Jul 2019 18:55:43 +0000 (18:55 +0000)]
Null check HistoryItems given to loadDifferentDocumentItem
https://bugs.webkit.org/show_bug.cgi?id=199596
<rdar://problem/49884391>

Reviewed by Ryosuke Niwa.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
Under some rare and mysterious conditions we can have a null provisionalItem when loading from the cache.

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

10 months ago[Pointer Events] Scroll indicators should not show for scrollable content with touch...
graouts@webkit.org [Tue, 9 Jul 2019 18:43:57 +0000 (18:43 +0000)]
[Pointer Events] Scroll indicators should not show for scrollable content with touch-action: none
https://bugs.webkit.org/show_bug.cgi?id=199618

Reviewed by Simon Fraser.

Source/WebKit:

Even though we correctly didn't scroll when "touch-action: none" was specified on an element, we would only apply
scrolling constraints after the panning gesture was recognized and the backing UIScrollView would show its scroll
indicators. While this is correct when only "pan-x" or "pan-y" is specified, we should not show the scroll indicators
at all for "touch-action: none" since no scrolling should happen.

To do this, we add a new method to the WKTouchActionGestureRecognizerDelegate protocol to indicate whether a given
gesture recognizer may pan content in the WKWebView. If the gesture recognizer is the top-level scroll view or one
created within the page to back "overflow: scroll" content or an iframe, we correctly make that gesture recognizer
fail to recognize if neither "pan-x" nor "pan-y" is specified for this touch identifier.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView gestureRecognizerMayPanWebView:]):
* UIProcess/ios/WKTouchActionGestureRecognizer.h:
* UIProcess/ios/WKTouchActionGestureRecognizer.mm:
(-[WKTouchActionGestureRecognizer canPreventGestureRecognizer:]):

LayoutTests:

Add a new test that swipes "overflow: scroll" content which would show scroll indicators without scrolling
prior to this patch.

* pointerevents/ios/touch-action-none-no-scroll-indicators-expected.html: Added.
* pointerevents/ios/touch-action-none-no-scroll-indicators.html: Added.

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

10 months agoValidate reply block signature in [WKRemoteObjectRegistry _invokeMethod]
cdumez@apple.com [Tue, 9 Jul 2019 18:41:46 +0000 (18:41 +0000)]
Validate reply block signature in [WKRemoteObjectRegistry _invokeMethod]
https://bugs.webkit.org/show_bug.cgi?id=199584
<rdar://problem/46268249>

Reviewed by Geoffrey Garen.

Validate reply block signature in [WKRemoteObjectRegistry _invokeMethod] for robustness.

* Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
(validateReplyBlockSignature):
(-[_WKRemoteObjectRegistry _invokeMethod:]):

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

10 months agoUserData::decode should return false when decoding an unrecognized type
achristensen@apple.com [Tue, 9 Jul 2019 18:27:23 +0000 (18:27 +0000)]
UserData::decode should return false when decoding an unrecognized type
https://bugs.webkit.org/show_bug.cgi?id=199598
<rdar://52735138>

Reviewed by Ryosuke Niwa.

* Shared/UserData.cpp:
(WebKit::UserData::decode):

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

10 months agoFix LOG_DISABLED and TREE_DEBUGGING enabled build.
zalan@apple.com [Tue, 9 Jul 2019 18:26:31 +0000 (18:26 +0000)]
Fix LOG_DISABLED and TREE_DEBUGGING enabled build.
https://bugs.webkit.org/show_bug.cgi?id=199623
<rdar://problem/52837648>

Reviewed by Simon Fraser.

* rendering/RenderLayerCompositor.cpp:

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

10 months ago[GStreamer] HLS media test gardening
cturner@igalia.com [Tue, 9 Jul 2019 16:52:52 +0000 (16:52 +0000)]
[GStreamer] HLS media test gardening
https://bugs.webkit.org/show_bug.cgi?id=199620

Unreviewed gardening commit.

* platform/gtk/TestExpectations:

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

10 months ago[ews-build] Do not run unix commands for windows in PrintConfiguration
aakash_jain@apple.com [Tue, 9 Jul 2019 16:14:04 +0000 (16:14 +0000)]
[ews-build] Do not run unix commands for windows in PrintConfiguration
https://bugs.webkit.org/show_bug.cgi?id=199605

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:

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

10 months ago[LFC][IFC] Remove InlineItem references from inline runs.
zalan@apple.com [Tue, 9 Jul 2019 15:29:31 +0000 (15:29 +0000)]
[LFC][IFC] Remove InlineItem references from inline runs.
https://bugs.webkit.org/show_bug.cgi?id=199608
<rdar://problem/52812775>

Reviewed by Antti Koivisto.

Constructing the inline runs is where we stop using InlineItems in the process of processing the inline content.
InlineItems are redundant in the context of Display::Runs.
It also enables us to create temporary InlineItems to process split content.

* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
* layout/inlineformatting/InlineFormattingContextQuirks.cpp:
(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::Content::Run::Run):
(WebCore::Layout::Line::isVisuallyEmpty const):
(WebCore::Layout::Line::close):
(WebCore::Layout::Line::removeTrailingTrimmableContent):
(WebCore::Layout::Line::trailingTrimmableWidth const):
(WebCore::Layout::Line::appendNonBreakableSpace):
(WebCore::Layout::Line::appendTextContent):
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::appendHardLineBreak):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::Content::Run::layoutBox const):
(WebCore::Layout::Line::Content::Run::logicalRect const):
(WebCore::Layout::Line::Content::Run::textContext const):
(WebCore::Layout::Line::Content::Run::type const):
(WebCore::Layout::Line::Content::Run::isText const):
(WebCore::Layout::Line::Content::Run::isBox const):
(WebCore::Layout::Line::Content::Run::isLineBreak const):
(WebCore::Layout::Line::Content::Run::isContainerStart const):
(WebCore::Layout::Line::Content::Run::isContainerEnd const):
(WebCore::Layout::Line::Content::Run::adjustLogicalTop):
(WebCore::Layout::Line::Content::Run::moveVertically):
(WebCore::Layout::Line::Content::Run::moveHorizontally):
(WebCore::Layout::Line::Content::Run::setTextIsCollapsed):

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

10 months agoREGRESSION(r244906): Crash in WebCore::positionOffsetValue
antti@apple.com [Tue, 9 Jul 2019 15:21:11 +0000 (15:21 +0000)]
REGRESSION(r244906): Crash in WebCore::positionOffsetValue
https://bugs.webkit.org/show_bug.cgi?id=199613
<rdar://problem/51518172>

Reviewed by Zalan Bujtas.

Source/WebCore:

Test: fast/css/getComputedStyle/sticky-scroll-container-crash.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::positionOffsetValue):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::enclosingScrollportBox const): Deleted.

The client trivally hits nullptr when this is called for element without overflow scroll parent.

Fix by removing the whole function and using shared enclosingClippingBoxForStickyPosition instead.
It does the same ancestor walk more efficiently via layer tree.

* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::enclosingClippingBoxForStickyPosition const):

Factor into function.

(WebCore::RenderBoxModelObject::computeStickyPositionConstraints const):
* rendering/RenderBoxModelObject.h:

LayoutTests:

* fast/css/getComputedStyle/sticky-scroll-container-crash-expected.txt: Added.
* fast/css/getComputedStyle/sticky-scroll-container-crash.html: Added.

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

10 months agoSupport writing-mode and direction for scrollIntoViewOptions.
commit-queue@webkit.org [Tue, 9 Jul 2019 10:03:19 +0000 (10:03 +0000)]
Support writing-mode and direction for scrollIntoViewOptions.
https://bugs.webkit.org/show_bug.cgi?id=161611

Patch by Cathie Chen <cathiechen@igalia.com> on 2019-07-09
Reviewed by Frédéric Wang and Simon Fraser.

LayoutTests/imported/w3c:

* web-platform-tests/css/cssom-view/scrollIntoView-horizontal-tb-writing-mode-and-rtl-direction-expected.txt:
* web-platform-tests/css/cssom-view/scrollIntoView-vertical-lr-writing-mode-and-rtl-direction-expected.txt:
* web-platform-tests/css/cssom-view/scrollIntoView-vertical-lr-writing-mode-expected.txt:
* web-platform-tests/css/cssom-view/scrollIntoView-vertical-rl-writing-mode-expected.txt:

Source/WebCore:

To determine which physical side to align we need to transform ScrollIntoViewOptions to scrollAlignment.
We'll translate the inline and block direction separately. The writing-mode will affect the block scrollAlignment.
While both writing-mode and CSS direction will affect the inline scrollAlignment. The argument for scrollRectToVisible
should be physical, so if !isHorizontalWritingMode(), we need to switch alignX and alignY.

For direction: rtl and writing-mode: horizontal-tb box, WebKit puts the scrollbar on the left side. The visible rect
starts from the right side of the scroll bar, so localExposeRect should also start from the right side of
scroll bar.

* dom/Element.cpp:
(WebCore::toScrollAlignmentForInlineDirection):
(WebCore::toScrollAlignmentForBlockDirection):
(WebCore::Element::scrollIntoView):
(WebCore::toScrollAlignment): Deleted.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible):

LayoutTests:

* platform/ios-simulator-wk2/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-horizontal-tb-writing-mode-and-rtl-direction-expected.txt: Removed.

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

10 months ago[WHLSL Import 23 new JS reference spec tests
sbarati@apple.com [Tue, 9 Jul 2019 05:32:26 +0000 (05:32 +0000)]
[WHLSL Import 23 new JS reference spec tests
https://bugs.webkit.org/show_bug.cgi?id=199604

Reviewed by Myles C. Maxfield.

Source/WebCore:

This patch imports a bunch of JS reference spec tests on our way to
completing https://bugs.webkit.org/show_bug.cgi?id=199595

It also fixes the recursion checker phase. That phase had two bugs:
1. We'd assert after visiting the function declaration that it was
still in the set. However, it will not be in the set when we actually
detect recursion.
2. We would not visit the arguments to a call, so if they contained other
calls which were recursive, we would not detect such recursive calls.

Tests: webgpu/whlsl-int-literal-compare.html
       webgpu/whlsl-simple-tests.html
       webgpu/whlsl-type-mismatch.html
       webgpu/whlsl-uint-bitwise.html

* Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp:

LayoutTests:

This moves some stuff down into whlsl-test-harness which are needed by
all tests. This also adds a new checkFail that ensures the program never
runs (e.g, it has a compile error).

* webgpu/js/whlsl-test-harness.js:
(async.checkFail):
(const.webGPUPromiseTest):
* webgpu/whlsl-bitwise-bool-ops-expected.txt:
* webgpu/whlsl-bitwise-bool-ops.html:
* webgpu/whlsl-int-literal-compare-expected.txt: Added.
* webgpu/whlsl-int-literal-compare.html: Added.
* webgpu/whlsl-simple-tests-expected.txt: Added.
* webgpu/whlsl-simple-tests.html: Added.
* webgpu/whlsl-type-mismatch-expected.txt: Added.
* webgpu/whlsl-type-mismatch.html: Added.
* webgpu/whlsl-uint-bitwise-expected.txt: Added.
* webgpu/whlsl-uint-bitwise.html: Added.

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

10 months agoWeb Inspector: Debugger: special breakpoints and event targets should be sorted into...
drousso@apple.com [Tue, 9 Jul 2019 03:30:12 +0000 (03:30 +0000)]
Web Inspector: Debugger: special breakpoints and event targets should be sorted into separate "areas"
https://bugs.webkit.org/show_bug.cgi?id=199554

Reviewed by Joseph Pecoraro.

Move the special All Requests breakpoint down to be right above all other URL breakpoints.
Move the `window` object tree element below other DOM node tree elements.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._addTreeElement):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._insertDebuggerTreeElement):

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

10 months agoWeb Inspector: DOM Debugger: there should be different icons for each type of DOM...
drousso@apple.com [Tue, 9 Jul 2019 03:16:04 +0000 (03:16 +0000)]
Web Inspector: DOM Debugger: there should be different icons for each type of DOM breakpoint
https://bugs.webkit.org/show_bug.cgi?id=199552

Reviewed by Joseph Pecoraro.

[S] for Subtree Modified
[A] for Attribute Modified
[R] for Node Removed

* UserInterface/Views/DOMBreakpointTreeElement.js:
(WI.DOMBreakpointTreeElement):
* UserInterface/Views/DOMBreakpointTreeElement.css: Added.
(.breakpoint.dom.breakpoint-for-subtree-modified:not(.breakpoint-paused-icon) .icon):
(.breakpoint.dom.breakpoint-for-attribute-modified:not(.breakpoint-paused-icon) .icon):
(.breakpoint.dom.breakpoint-for-node-removed:not(.breakpoint-paused-icon) .icon):

* UserInterface/Main.html:
* UserInterface/Images/DOMBreakpointAttributeModified.svg: Added.
* UserInterface/Images/DOMBreakpointNodeRemoved.svg: Added.
* UserInterface/Images/DOMBreakpointSubtreeModified.svg: Added.

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

10 months ago[iOS 13] paste-does-not-fire-promises-while-sanitizing-web-content.html times out...
wenson_hsieh@apple.com [Tue, 9 Jul 2019 03:10:36 +0000 (03:10 +0000)]
[iOS 13] paste-does-not-fire-promises-while-sanitizing-web-content.html times out when run with multiple iterations
https://bugs.webkit.org/show_bug.cgi?id=199597

Reviewed by Tim Horton.

Make this test more robust to work around bugs in iOS 13 that currently prevent some single tap gestures from
being recognized, due to conflicts with double tap gesture recognizers.
-   Make both the subframe and editable element taller, so that they're easier to hit.
-   Tap twice when attempting to trigger a paste, in hopes that at least one of the taps will be recognized as a
    single click.
-   Make several event listeners one-shot, to prevent the double tap gesture from triggering paste twice.

* editing/pasteboard/paste-does-not-fire-promises-while-sanitizing-web-content.html:

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

10 months agoSpeculative fix for crashes under LocalStorageDatabaseTracker::databasePath()
cdumez@apple.com [Tue, 9 Jul 2019 03:06:12 +0000 (03:06 +0000)]
Speculative fix for crashes under LocalStorageDatabaseTracker::databasePath()
https://bugs.webkit.org/show_bug.cgi?id=199599
<rdar://problem/31169686>

Reviewed by Ryosuke Niwa.

Speculative fix for crashes under LocalStorageDatabaseTracker::databasePath():
- Add new localStorageDirectory() getter to LocalStorageDatabaseTracker which
  calls isolatedCopy() on m_localStorageDirectory before returning it.
  Use it everywhere instead of m_localStorageDirectory since it is not safe
  to use the same String from various threads like it was done.
- Move localStorageDirectory when constructing the LocalStorageDatabaseTracker
  instead of copying it.
- Make sure that LocalStorageDatabaseTracker and StorageManager are both
  constructed and destroyed on the main thread.

* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
* NetworkProcess/NetworkSession.h:
* NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::create):
(WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
(WebKit::LocalStorageDatabaseTracker::localStorageDirectory const):
(WebKit::LocalStorageDatabaseTracker::~LocalStorageDatabaseTracker):
(WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
(WebKit::LocalStorageDatabaseTracker::origins const):
(WebKit::LocalStorageDatabaseTracker::databasePath const):
* NetworkProcess/WebStorage/LocalStorageDatabaseTracker.h:
* NetworkProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::create):
(WebKit::StorageManager::StorageManager):
(WebKit::StorageManager::~StorageManager):
* NetworkProcess/WebStorage/StorageManager.h:
* NetworkProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm:
(WebKit::LocalStorageDatabaseTracker::platformMaybeExcludeFromBackup const):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* NetworkProcess/curl/NetworkSessionCurl.cpp:
(WebKit::NetworkSessionCurl::NetworkSessionCurl):
* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSessionSoup::NetworkSessionSoup):

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

10 months agoUncaught Exception: Unexpected enum value: CPU
drousso@apple.com [Tue, 9 Jul 2019 02:22:30 +0000 (02:22 +0000)]
Uncaught Exception: Unexpected enum value: CPU
https://bugs.webkit.org/show_bug.cgi?id=199564

Reviewed by Joseph Pecoraro.

* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.prototype._updateAutoCaptureInstruments):
Filter the list of auto-capture instruments based on what's actually supported, instead of
directly using the saved list from the `WI.Setting`.

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

10 months agoEnabling the Layers tab hides the paint flashing button
drousso@apple.com [Tue, 9 Jul 2019 02:19:26 +0000 (02:19 +0000)]
Enabling the Layers tab hides the paint flashing button
https://bugs.webkit.org/show_bug.cgi?id=199549

Reviewed by Joseph Pecoraro.

Still show the Compositing Borders and Paint Flashing navigation items in the Elements tab
even when the Layers tab is enabled (just like the Layers details sidebar).

* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView.prototype.get navigationItems):
(WI.DOMTreeContentView.prototype._updateCompositingBordersButtonToMatchPageSettings):

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

10 months agoEnable Intl.PluralRules and Intl.NumberFormatToParts by default
keith_miller@apple.com [Tue, 9 Jul 2019 02:18:56 +0000 (02:18 +0000)]
Enable Intl.PluralRules and Intl.NumberFormatToParts by default
https://bugs.webkit.org/show_bug.cgi?id=199288

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

These features have been around for a while. We should turn them on by default.

* runtime/IntlNumberFormatPrototype.cpp:
(JSC::IntlNumberFormatPrototype::finishCreation):
* runtime/IntlObject.cpp:
(JSC::IntlObject::finishCreation): Deleted.
* runtime/IntlObject.h:
* runtime/Options.h:

LayoutTests:

Remove runtime flag from testing.

* js/intl-numberformat-format-to-parts.html:
* js/intl-pluralrules.html:
* js/script-tests/intl-numberformat-format-to-parts.js:
* js/script-tests/intl-pluralrules.js:

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

10 months agoYouTube embedding iframes in WebView sometimes go blank when the video starts playing
simon.fraser@apple.com [Tue, 9 Jul 2019 01:24:15 +0000 (01:24 +0000)]
YouTube embedding iframes in WebView sometimes go blank when the video starts playing
https://bugs.webkit.org/show_bug.cgi?id=199600
rdar://problem/47806012

Reviewed by Tim Horton.

With some combinations of nested iframes that are being resized from empty, and toggling into
compositing mode, we'd fail to update compositing in the iframe's enclosing document, so never
host the iframes's layers.

Fix by moving some widget-resize-related code into RenderLayerCompositor::widgetDidChangeSize(),
and adding code to schedule a compositing update.

I was unable to come up with a layout test for this.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::widgetDidChangeSize):
* rendering/RenderLayerCompositor.h:
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::setWidgetGeometry):

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

10 months ago[WinCairo] ASSERTION FAILED: info.bmBitsPixel == 32 in createCairoContextWithHDC
Hironori.Fujii@sony.com [Tue, 9 Jul 2019 01:07:18 +0000 (01:07 +0000)]
[WinCairo] ASSERTION FAILED: info.bmBitsPixel == 32 in createCairoContextWithHDC
https://bugs.webkit.org/show_bug.cgi?id=198323

Reviewed by Per Arne Vollan.

WebView::paint binds m_backingStoreBitmap to a DC by using
SelectObject. WebView::paint can be called recursively, but
m_backingStoreBitmap can't be bound to multiple DCs at the same
time. Then, SelectObject was failing in such case.

Call WebCore::Page::updateRendering before binding
m_backingStoreBitmap instead of after it.

Reverted r202744 change which won't be needed since this change.

* WebView.cpp:
(WebView::scrollBackingStore): Removed r202744's change.
(WebView::updateBackingStore): Removed m_page->updateRendering().
(WebView::paint): Do m_page->updateRendering() before binding m_backingStoreBitmap.
* WebView.h: Removed unused WebView::isPainting.

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

10 months agoJSTestGlobalObject.cpp of bindings-generation-tests is failing for Windows Python
Hironori.Fujii@sony.com [Tue, 9 Jul 2019 01:03:27 +0000 (01:03 +0000)]
JSTestGlobalObject.cpp of bindings-generation-tests is failing for Windows Python
https://bugs.webkit.org/show_bug.cgi?id=199487

Reviewed by Ross Kirsling.

In Windows Python, preprocessor.pm is using cl.exe. cl.exe was
failing to open testglobalscope_constructors_file which was
created by using tempfile.mkstemp() because it keeps the file
open. Use tempfile.mkdtemp() to create temporary files in the
temporary directory instead of tempfile.mkstemp().

* Scripts/webkitpy/bindings/main.py:
(BindingsTests.run_tests):
(BindingsTests.main):
(BindingsTests.close_and_remove): Deleted.

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

10 months agoUse WeakHashSet for WebUserContentControllerProxy::m_processes
cdumez@apple.com [Tue, 9 Jul 2019 00:53:26 +0000 (00:53 +0000)]
Use WeakHashSet for WebUserContentControllerProxy::m_processes
https://bugs.webkit.org/show_bug.cgi?id=199591
<rdar://problem/52798721>

Reviewed by Youenn Fablet.

Source/WebKit:

Use WeakHashSet for WebUserContentControllerProxy::m_processses for safety. In theory, a WebProcessProxy could
stay in the map if we failed to call WebProcessProxy::shutDown() before destroying it.

* UIProcess/UserContent/WebUserContentControllerProxy.cpp:
(WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy):
(WebKit::WebUserContentControllerProxy::addProcess):
(WebKit::WebUserContentControllerProxy::removeProcess):
(WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
(WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
(WebKit::WebUserContentControllerProxy::addUserScript):
(WebKit::WebUserContentControllerProxy::removeUserScript):
(WebKit::WebUserContentControllerProxy::removeAllUserScripts):
(WebKit::WebUserContentControllerProxy::addUserStyleSheet):
(WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
(WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
(WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
(WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
(WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
(WebKit::WebUserContentControllerProxy::addContentRuleList):
(WebKit::WebUserContentControllerProxy::removeContentRuleList):
(WebKit::WebUserContentControllerProxy::removeAllContentRuleLists):
* UIProcess/UserContent/WebUserContentControllerProxy.h:
(WebKit::WebUserContentControllerProxy::addNetworkProcess):
(WebKit::WebUserContentControllerProxy::removeNetworkProcess):

Source/WTF:

Update WeakHashSet::add() to return an AddResult type, similarly to our other containers.

* wtf/WeakHashSet.h:
(WTF::WeakHashSet::add):

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

10 months ago[ews-build] Add KillOldProcesses step before running API or Layout tests
aakash_jain@apple.com [Tue, 9 Jul 2019 00:35:31 +0000 (00:35 +0000)]
[ews-build] Add KillOldProcesses step before running API or Layout tests
https://bugs.webkit.org/show_bug.cgi?id=199592

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/factories.py:

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

10 months agoWeb Inspector: REGRESSION: Elements: pasting in the Styles sidebar adds a text node...
drousso@apple.com [Tue, 9 Jul 2019 00:27:05 +0000 (00:27 +0000)]
Web Inspector: REGRESSION: Elements: pasting in the Styles sidebar adds a text node to the DOM tree
https://bugs.webkit.org/show_bug.cgi?id=199588

Reviewed by Joseph Pecoraro.

* UserInterface/Base/Main.js:
(WI._paste):
Bail if `event.defaultPrevented`, as that means that something else has handled (and likely
overrode) this event.

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

10 months agoWeb Inspector: the "x" in the Exception icon overlaps the border
drousso@apple.com [Tue, 9 Jul 2019 00:03:53 +0000 (00:03 +0000)]
Web Inspector: the "x" in the Exception icon overlaps the border
https://bugs.webkit.org/show_bug.cgi?id=199553

Reviewed by Joseph Pecoraro.

* UserInterface/Images/Exception.svg:
* UserInterface/Images/Function.svg:
* UserInterface/Images/TailDeletedFunction.svg:

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

10 months agoMake Document::postTask() safe to call from a background thread
cdumez@apple.com [Mon, 8 Jul 2019 23:56:45 +0000 (23:56 +0000)]
Make Document::postTask() safe to call from a background thread
https://bugs.webkit.org/show_bug.cgi?id=199585

Reviewed by Alex Christensen.

Make Document::postTask() safe to call from a background thread by not calling makeWeakPtr() on the Document.
Calling makeWeakPtr() on a document from a background thread is not safe since Document is a main thread
object. Instead, capture Document::identifier() in the lambda and lookup the document from its identifier
once we're on the main thread.

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

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

10 months agoHop explicitly to the main thread after generating a frame in ScreenDisplayCaptureSou...
youenn@apple.com [Mon, 8 Jul 2019 23:51:43 +0000 (23:51 +0000)]
Hop explicitly to the main thread after generating a frame in ScreenDisplayCaptureSourceMac
https://bugs.webkit.org/show_bug.cgi?id=199581

Reviewed by Eric Carlson.

Instead of locking and setting the current frame from a background thread, hop to the main thread.
This also makes sure the weakThis check is done in the main thread.
Manually tested.

* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
(WebCore::ScreenDisplayCaptureSourceMac::DisplaySurface::DisplaySurface):
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
(WebCore::ScreenDisplayCaptureSourceMac::generateFrame):
(WebCore::ScreenDisplayCaptureSourceMac::newFrame):
(WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Deleted.

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