WebKit-https.git
5 weeks agoEnable client certificate authentication unit test
commit-queue@webkit.org [Fri, 12 Jul 2019 22:51:47 +0000 (22:51 +0000)]
Enable client certificate authentication unit test
https://bugs.webkit.org/show_bug.cgi?id=199735

Patch by Alex Christensen <achristensen@webkit.org> on 2019-07-12
Reviewed by Chris Dumez.

* TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:
(TEST):
I originally wrote this in https://bugs.webkit.org/show_bug.cgi?id=197800 but it was disabled because it crashed.
I found what was crashing.  I was reading out of bounds on my vector of 2 strings :(

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

5 weeks agoAdd API to get all the dependencies of a given JSScript
keith_miller@apple.com [Fri, 12 Jul 2019 22:15:55 +0000 (22:15 +0000)]
Add API to get all the dependencies of a given JSScript
https://bugs.webkit.org/show_bug.cgi?id=199746

Reviewed by Saam Barati.

The method only returns the dependencies if the module was
actually evaluated. Technically, we know what the dependencies are
at the satisfy phase but for API simplicity we only provide that
information if the module graph was complete enough to at least
run.

This patch also fixes an issue where we would allow import
specifiers that didn't start "./" or "/". For reference, We have
this restriction to be consistent with the web/node. The
restriction exists in order to preserve namespace for
builtin-modules.

Lastly, this patch makes it so that we copy all scripts in the
API/tests/testapiScripts directory so they don't have to be
individually added to the xcode project.

* API/JSAPIGlobalObject.mm:
(JSC::computeValidImportSpecifier):
(JSC::JSAPIGlobalObject::moduleLoaderResolve):
(JSC::JSAPIGlobalObject::moduleLoaderImportModule):
* API/JSContext.mm:
(-[JSContext dependencyIdentifiersForModuleJSScript:]):
* API/JSContextPrivate.h:
* API/JSScript.h:
* API/tests/testapi.mm:
(testFetchWithTwoCycle):
(testFetchWithThreeCycle):
(testModuleBytecodeCache):
(+[JSContextFileLoaderDelegate newContext]):
(-[JSContextFileLoaderDelegate fetchModuleScript:]):
(-[JSContextFileLoaderDelegate findScriptForKey:]):
(-[JSContextFileLoaderDelegate context:fetchModuleForIdentifier:withResolveHandler:andRejectHandler:]):
(testDependenciesArray):
(testDependenciesEvaluationError):
(testDependenciesSyntaxError):
(testDependenciesBadImportId):
(testDependenciesMissingImport):
(testObjectiveCAPI):
* API/tests/testapiScripts/dependencyListTests/badModuleImportId.js: Added.
* API/tests/testapiScripts/dependencyListTests/bar.js: Added.
* API/tests/testapiScripts/dependencyListTests/dependenciesEntry.js: Added.
* API/tests/testapiScripts/dependencyListTests/foo.js: Added.
* API/tests/testapiScripts/dependencyListTests/missingImport.js: Added.
* API/tests/testapiScripts/dependencyListTests/referenceError.js: Added.
* API/tests/testapiScripts/dependencyListTests/syntaxError.js: Added.
* API/tests/testapiScripts/testapi-function-overrides.js: Renamed from Source/JavaScriptCore/API/tests/testapi-function-overrides.js.
* API/tests/testapiScripts/testapi.js: Renamed from Source/JavaScriptCore/API/tests/testapi.js.
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/ModuleLoader.js:
(dependencyKeysIfEvaluated):
* runtime/JSModuleLoader.cpp:
(JSC::JSModuleLoader::dependencyKeysIfEvaluated):
* runtime/JSModuleLoader.h:
* shell/CMakeLists.txt:

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

5 weeks agoBegin unifying TestWebKitAPI build
commit-queue@webkit.org [Fri, 12 Jul 2019 22:12:59 +0000 (22:12 +0000)]
Begin unifying TestWebKitAPI build
https://bugs.webkit.org/show_bug.cgi?id=199728

Patch by Alex Christensen <achristensen@webkit.org> on 2019-07-12
Reviewed by Keith Miller.

* TestWebKitAPI/Configurations/Base.xcconfig:
* TestWebKitAPI/Scripts/generate-unified-sources.sh: Added.
* TestWebKitAPI/Sources.txt: Added.
* TestWebKitAPI/SourcesCocoa.txt: Added.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:

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

5 weeks agoBegin unifying WebKitLegacy sources
commit-queue@webkit.org [Fri, 12 Jul 2019 22:08:02 +0000 (22:08 +0000)]
Begin unifying WebKitLegacy sources
https://bugs.webkit.org/show_bug.cgi?id=199730

Patch by Alex Christensen <achristensen@webkit.org> on 2019-07-12
Reviewed by Keith Miller.

Source/WebKitLegacy:

* Sources.txt: Added.
* SourcesCocoa.txt: Added.
* WebKitLegacy.xcodeproj/project.pbxproj:
* scripts/generate-unified-sources.sh: Added.

Source/WebKitLegacy/mac:

* Configurations/WebKitLegacy.xcconfig:

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

5 weeks agoRegression(macOS Catalina): Cannot quick look html documents in Mail
cdumez@apple.com [Fri, 12 Jul 2019 22:03:27 +0000 (22:03 +0000)]
Regression(macOS Catalina): Cannot quick look html documents in Mail
https://bugs.webkit.org/show_bug.cgi?id=199754
<rdar://problem/51304961>

Reviewed by Geoff Garen.

If the client asks us to load a file URL but does not provide a resource path, WebKit
would fallback to issuing a sandbox extension for /. This no longer works on mac OS
Catalina and it would thus fail to load the file.

To address the issue, if the attempt to create a sandbox extension for / fails, we now
fall back to issuing one for the file's baseURL (path of containing folder).

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

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

5 weeks agoChange RELEASE_ASSERT in DocumentWriter::addData to ASSERT and early return
commit-queue@webkit.org [Fri, 12 Jul 2019 21:50:31 +0000 (21:50 +0000)]
Change RELEASE_ASSERT in DocumentWriter::addData to ASSERT and early return
https://bugs.webkit.org/show_bug.cgi?id=199756
<rdar://problem/51554775>

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

Attempts to reach this assertion were unsuccessful, but sometimes this assertion crashes.
Let's change it to an early return to prevent crashes.

* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::addData):

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

5 weeks ago[iOS WK2] Can't place caret or select in content that overflows a contenteditable...
simon.fraser@apple.com [Fri, 12 Jul 2019 21:35:08 +0000 (21:35 +0000)]
[iOS WK2] Can't place caret or select in content that overflows a contenteditable element
https://bugs.webkit.org/show_bug.cgi?id=199741
rdar://problem/50545233

Reviewed by Wenson Hsieh.
Source/WebCore:

Various code paths for editing used renderer->absoluteBoundingBoxRect(), which is the border
box of the element (or a set of line boxes for inline elements) converted to absolute
coordinates. This excludes overflow content, but contenteditable needs to be able to
place the caret in overflow content, and allow selection rects to be in the overflow area
(if the element has visible overflow).

Try to clean this up by adding some static helpers on WebPage for accessing the relevant
rects, and use them in code call from visiblePositionInFocusedNodeForPoint(), and
code that is input to selectionClipRect.

This changes selectionClipRect to use the padding box (excluding borders), which is a progression.

Tests: editing/caret/ios/caret-in-overflow-area.html
       editing/selection/ios/place-selection-in-overflow-area.html
       editing/selection/ios/selection-extends-into-overflow-area.html

* editing/FrameSelection.cpp:
(WebCore::DragCaretController::editableElementRectInRootViewCoordinates const):

Source/WebKit:

Various code paths for editing used renderer->absoluteBoundingBoxRect(), which is the border
box of the element (or a set of line boxes for inline elements) converted to absolute
coordinates. This excludes overflow content, but contenteditable needs to be able to
place the caret in overflow content, and allow selection rects to be in the overflow area
(if the element has visible overflow).

Try to clean this up by adding some static helpers on WebPage for accessing the relevant
rects, and use them in code call from visiblePositionInFocusedNodeForPoint(), and
code that is input to selectionClipRect.

This changes selectionClipRect to use the padding box (excluding borders), which is a progression.

* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState const):
(WebKit::elementBoundsInFrame):
(WebKit::constrainPoint):
(WebKit::WebPage::rootViewBoundsForElement):
(WebKit::WebPage::absoluteInteractionBoundsForElement):
(WebKit::WebPage::rootViewInteractionBoundsForElement):
(WebKit::WebPage::dispatchSyntheticMouseEventsForSelectionGesture):
(WebKit::WebPage::getFocusedElementInformation):
(WebKit::innerFrameQuad): Deleted.
(WebKit::elementRectInRootViewCoordinates): Deleted.

LayoutTests:

Re-enable editing/caret/ios, fixing the result of emoji.html which for some reason was
checked in as an html file (the test still fails).

* editing/caret/ios/caret-in-overflow-area-expected.txt: Added.
* editing/caret/ios/caret-in-overflow-area.html: Added.
* editing/caret/ios/emoji-expected.txt: Renamed from LayoutTests/editing/caret/ios/emoji-expected.html.
* editing/caret/ios/fixed-caret-position-after-scroll-expected.txt:
* editing/caret/ios/fixed-caret-position-after-scroll.html:
* editing/selection/ios/place-selection-in-overflow-area-expected.txt: Added.
* editing/selection/ios/place-selection-in-overflow-area.html: Added.
* editing/selection/ios/selection-extends-into-overflow-area-expected.txt: Added.
* editing/selection/ios/selection-extends-into-overflow-area.html: Added.
* platform/ios-wk2/TestExpectations:

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

5 weeks ago[WebGPU] Move error scopes out of GPUDevice for more portable error generation
justin_fan@apple.com [Fri, 12 Jul 2019 21:07:49 +0000 (21:07 +0000)]
[WebGPU] Move error scopes out of GPUDevice for more portable error generation
https://bugs.webkit.org/show_bug.cgi?id=199740

Reviewed by Myles C. Maxfield.

Move error generation into a separate RefCounted class to allow GPU objects to generate
errors independent of any GPUDevice.
Create GPUObjectBase to delegate error generation and refactor GPUBuffer to inherit from GPUObjectBase.

No behavior change or new tests. Error scopes covered by error-scopes-test.html.

* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::WebGPUDevice): Now creates a GPUErrorGenerator.
(WebCore::WebGPUDevice::createBuffer const): Pass the GPUErrorGenerator to any created GPUBuffer.
(WebCore::WebGPUDevice::createBufferMapped const): Ditto.
(WebCore::WebGPUDevice::popErrorScope): Shouldn't be const. Can just ask for the GPUError rather than passing a lambda.
(WebCore::WebGPUDevice::pushErrorScope const): Deleted.
(WebCore::WebGPUDevice::popErrorScope const): Deleted.
* Modules/webgpu/WebGPUDevice.h:
(WebCore::WebGPUDevice::pushErrorScope):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUBuffer.h: Now inherits from GPUObjectBase for error generation ease.
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateBuffer): Ensure GPUBuffers reference the GPUErrorGenerator.
(WebCore::GPUDevice::pushErrorScope): Deleted. No longer needed here.
(WebCore::GPUDevice::popErrorScope): Deleted.
(WebCore::GPUDevice::registerError): Deleted.
* platform/graphics/gpu/GPUDevice.h: Move error scope logic out.
* platform/graphics/gpu/GPUErrorGenerator.cpp: Added.
(WebCore::GPUErrorGenerator::pushErrorScope):
(WebCore::GPUErrorGenerator::popErrorScope):
(WebCore::GPUErrorGenerator::generateError):
* platform/graphics/gpu/GPUErrorGenerator.h: Added.
(WebCore::GPUErrorGenerator::create):
* platform/graphics/gpu/GPUObjectBase.h: Added.
(WebCore::GPUObjectBase::generateError):
(WebCore::GPUObjectBase::GPUObjectBase):
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Use the GPUErrorGenerator directly during buffer creation.
(WebCore::GPUBuffer::validateBufferUsage):
(WebCore::GPUBuffer::tryCreate):
(WebCore::GPUBuffer::GPUBuffer):
* platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
(WebCore::GPUQueue::submit): Prevent possible null dereference.

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

5 weeks agoWebBackForwardListItem::setPageState should receive pageState by rvalue reference
mcatanzaro@igalia.com [Fri, 12 Jul 2019 20:58:43 +0000 (20:58 +0000)]
WebBackForwardListItem::setPageState should receive pageState by rvalue reference
https://bugs.webkit.org/show_bug.cgi?id=199535

Reviewed by Alex Christensen

Coverity is complaining here about copying PageState by value in the parameter list. It's
sort of a false positive, in that the PageState really does need to be copied here, so this
is the best we can do. But pass by value and then WTFMove() is a pretty strange way to write
it. Passing by rvalue reference would be better. This makes the copy more clear.

* Shared/WebBackForwardListItem.h:
(WebKit::WebBackForwardListItem::setPageState):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::updateBackForwardItem):

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

5 weeks agoAdd release logging for quota checks
youenn@apple.com [Fri, 12 Jul 2019 20:14:05 +0000 (20:14 +0000)]
Add release logging for quota checks
https://bugs.webkit.org/show_bug.cgi?id=199697

Reviewed by Alex Christensen.

Source/WebCore:

Log whether a request to extend quota is made and the result of the request.
This logging should happen in the networking process.
No change of behavior.

* platform/Logging.h:
* storage/StorageQuotaManager.cpp:
(WebCore::StorageQuotaManager::askForMoreSpace):
(WebCore::StorageQuotaManager::processPendingRequests):

Source/WebKit:

Log requests made to the page and the result from the application.

* Platform/Logging.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestStorageSpace):

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

5 weeks agoRemove unneeded variable in LocalStorageNamespace::getOrCreateStorageArea
youenn@apple.com [Fri, 12 Jul 2019 20:08:04 +0000 (20:08 +0000)]
Remove unneeded variable in LocalStorageNamespace::getOrCreateStorageArea
https://bugs.webkit.org/show_bug.cgi?id=199477

Reviewed by Alex Christensen.

* NetworkProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea):

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

5 weeks agorun-javascriptcore-tests won't report test results for testmasm, testair, testb3...
commit-queue@webkit.org [Fri, 12 Jul 2019 19:50:06 +0000 (19:50 +0000)]
run-javascriptcore-tests won't report test results for testmasm, testair, testb3, testdfg and test api
https://bugs.webkit.org/show_bug.cgi?id=199489
<rdar://problem/47891081>

Patch by Zhifei Fang <zhifei_fang@apple.com> on 2019-07-12
Reviewed by Aakash Jain.

* BuildSlaveSupport/build.webkit.org-config/steps.py:
(RunJavaScriptCoreTests.countFailures):
* BuildSlaveSupport/build.webkit.org-config/steps_unittest.py:
* Scripts/run-javascriptcore-tests:
(runTest):
(reportTestFailures):
(runJSCStressTests):

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

5 weeks agoConnection::waitForSyncReply() uses wall time clock for timeout
commit-queue@webkit.org [Fri, 12 Jul 2019 18:01:39 +0000 (18:01 +0000)]
Connection::waitForSyncReply() uses wall time clock for timeout
https://bugs.webkit.org/show_bug.cgi?id=198712
Due to a nature of the system time (it might not be set, jump, be off
by a lot) it is better to use monotonically increasing time which is
exactly what's used in a similar place i.e. Connection::waitForMessage()

Patch by Pawel Stanek <p.stanek@metrological.com> on 2019-07-12
Reviewed by Alex Christensen.

* Platform/IPC/Connection.cpp:
(IPC::Connection::waitForSyncReply):

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

5 weeks agoStopping a cloned MediaStream video track should not stop any other video track
youenn@apple.com [Fri, 12 Jul 2019 17:27:53 +0000 (17:27 +0000)]
Stopping a cloned MediaStream video track should not stop any other video track
https://bugs.webkit.org/show_bug.cgi?id=199635

Reviewed by Eric Carlson.

Source/WebCore:

In case a track is requesting its source to end, the
RealtimeVideoSource should request its own source to end and not stop it directly.

Also, if a track is removing itself as an observer to a RealtimeVideoSource, we should
stop the underlying source only if this one does not have any other observer.
Covered by updated test.

* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::removeObserver):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::requestToEnd):
(WebCore::RealtimeVideoSource::stopBeingObserved):
* platform/mediastream/RealtimeVideoSource.h:

LayoutTests:

* fast/mediastream/mediastreamtrack-video-clone-expected.txt:
* fast/mediastream/mediastreamtrack-video-clone.html:

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

5 weeks agoB3 should reduce (integer) Sub(Neg(x), y) to Neg(Add(x, y))
justin_michaud@apple.com [Fri, 12 Jul 2019 17:11:31 +0000 (17:11 +0000)]
B3 should reduce (integer) Sub(Neg(x), y) to Neg(Add(x, y))
https://bugs.webkit.org/show_bug.cgi?id=196371

Reviewed by Keith Miller.

JSTests:

* microbenchmarks/mul-immediate-sub.js: Added.
(doTest):

Source/JavaScriptCore:

Adding these strength reductions gives 2x a (x86) and 3x (arm64) performance improvement
on the microbenchmark.

* b3/B3ReduceStrength.cpp:
* b3/testb3.cpp:
(JSC::B3::testSubSub):
(JSC::B3::testSubSub2):
(JSC::B3::testSubAdd):
(JSC::B3::testSubFirstNeg):
(JSC::B3::run):

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

5 weeks ago[ews-build] Make layout-tests' full_results.json accessible in Buildbot
aakash_jain@apple.com [Fri, 12 Jul 2019 16:59:22 +0000 (16:59 +0000)]
[ews-build] Make layout-tests' full_results.json accessible in Buildbot
https://bugs.webkit.org/show_bug.cgi?id=199743

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
* BuildSlaveSupport/ews-build/steps_unittest.py: Updated unit-tests.

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

5 weeks agoDrop DarkModeCSSEnabled as an experimental feature and always enable it.
timothy@apple.com [Fri, 12 Jul 2019 15:19:06 +0000 (15:19 +0000)]
Drop DarkModeCSSEnabled as an experimental feature and always enable it.
https://bugs.webkit.org/show_bug.cgi?id=199725
rdar://problem/52970972

Reviewed by Megan Gardner.

Source/WebCore:

Tests: css-dark-mode

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/MediaQueryEvaluator.cpp:
(WebCore::prefersColorSchemeEvaluate):
* css/MediaQueryExpression.cpp:
(WebCore::featureWithValidIdent):
(WebCore::isFeatureValidWithoutValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::process):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setDarkModeCSSEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::darkModeCSSEnabled const): Deleted.

Source/WebKit:

* Shared/WebPreferences.yaml: Removed DarkModeCSSEnabled.

LayoutTests:

Removed <!-- webkit-test-runner [ experimental:DarkModeCSSEnabled=true ] -->
from all dark mode tests.

* css-dark-mode/color-scheme-css-parse.html:
* css-dark-mode/color-scheme-css.html:
* css-dark-mode/color-scheme-meta.html:
* css-dark-mode/color-scheme-priority.html:
* css-dark-mode/color-scheme-scrollbar.html:
* css-dark-mode/default-colors.html:
* css-dark-mode/older-syntax/supported-color-schemes-css.html:
* css-dark-mode/older-syntax/supported-color-schemes-meta.html:
* css-dark-mode/older-systems/color-scheme-css.html:
* css-dark-mode/older-systems/color-scheme-meta.html:
* css-dark-mode/older-systems/prefers-color-scheme.html:
* css-dark-mode/prefers-color-scheme-picture-element.html:
* css-dark-mode/prefers-color-scheme.html:

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

5 weeks ago[BigInt] Add ValueBitLShift into DFG
ticaiolima@gmail.com [Fri, 12 Jul 2019 14:47:36 +0000 (14:47 +0000)]
[BigInt] Add ValueBitLShift into DFG
https://bugs.webkit.org/show_bug.cgi?id=192664

Reviewed by Saam Barati.

JSTests:

We are adding tests to cover ValueBitwise operations AI changes.

* stress/big-int-left-shift-untyped.js: Added.
* stress/bit-op-with-object-returning-int32.js:
* stress/value-bit-and-ai-rule.js: Added.
* stress/value-bit-lshift-ai-rule.js: Added.
* stress/value-bit-or-ai-rule.js: Added.
* stress/value-bit-xor-ai-rule.js: Added.

PerformanceTests:

* BigIntBench/big-int-simple-lshift.js: Added.

Source/JavaScriptCore:

This patch is splitting the `BitLShift` into `ArithBitLShift` and
`ValueBitLShift` to handle BigInt speculation more efficiently during
DFG and FTL layers. Following the same approach of other `ValueBitOps`,
`ValueBitLShift` handles Untyped and BigInt speculations, while
`ArithBitLShift` handles number and boolean operands and always results into
Int32.

* bytecode/BytecodeList.rb:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
* bytecode/Opcode.h:
* dfg/DFGAbstractInterpreter.h:
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::handleConstantBinaryBitwiseOp):
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

We moved `BitLShift` constant fold rules to a new method
`handleConstantBinaryBitwiseOp` to be reused by `ArithBitLShift` and
`ValueBitLShift`. This also enables support of constant folding on other
bitwise operations like `ValueBitAnd`, `ValueBitOr` and `ValueBitXor`, when
their binary use kind is UntypedUse. Such cases can happen on those
nodes because fixup phase is conservative.

* dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwo):
(JSC::DFG::BackwardsPropagationPhase::propagate):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicGetter):
(JSC::DFG::ByteCodeParser::parseBlock):

We parse `op_lshift` as `ArithBitLShift` when its operands are numbers.
Otherwise, we fallback to `ValueBitLShift` and rely on fixup phase to
convert `ValueBitLShift` into `ArithBitLShift` when possible.

* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):

`ArithBitLShift` has the same clobberize rules as former `BitLShift`.
`ValueBitLShift` only clobberize world when it is UntypedUse.

* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):

`ValueBitLShift` can GC when `BigIntUse` because it allocates new
JSBigInts to perform this operation. It also can GC on UntypedUse
because of observable user code.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):

`ValueBitLShift` and `ArithBitLShift` has the same fixup rules of
other binary bitwise operations. In the case of `ValueBitLShift`
We check if we should speculate on BigInt or Untyped and fallback to
`ArithBitLShift` when both cheks fail.

* dfg/DFGNode.h:
(JSC::DFG::Node::hasHeapPrediction):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:

We updated `operationValueBitLShift` to handle BigInt cases. Also, we
added `operationBitLShiftBigInt` that is used when we compile
`ValueBitLValueBitLShift(BigIntUse)`.

* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:

`ValueBitLShift`'s prediction propagation rules differs from other
bitwise operations, because using only heap prediction for this node causes
significant performance regression on Octane's zlib and mandreel.
The reason is because of cases where a function is compiled but the
instruction `op_lshift` was never executed before. If we use
`getPrediction()` we will emit a `ForceOSRExit`, resulting in more OSR
than desired. To solve such issue, we are then using
`getPredictionWithoutOSR()` and falling back to `getHeapPrediction()`
only on cases where we can't rely on node's input types.

* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileValueLShiftOp):
(JSC::DFG::SpeculativeJIT::compileShiftOp):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::shiftOp):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileArithBitLShift):
(JSC::FTL::DFG::LowerDFGToB3::compileValueBitLShift):
(JSC::FTL::DFG::LowerDFGToB3::compileBitLShift): Deleted.
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):

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

5 weeks agogetIndexQuickly should be const
keith_miller@apple.com [Fri, 12 Jul 2019 13:24:08 +0000 (13:24 +0000)]
getIndexQuickly should be const
https://bugs.webkit.org/show_bug.cgi?id=199747

Reviewed by Yusuke Suzuki.

* runtime/Butterfly.h:
(JSC::Butterfly::indexingPayload const):
(JSC::Butterfly::arrayStorage const):
(JSC::Butterfly::contiguousInt32 const):
(JSC::Butterfly::contiguousDouble const):
(JSC::Butterfly::contiguous const):
* runtime/JSObject.h:
(JSC::JSObject::canGetIndexQuickly const):
(JSC::JSObject::getIndexQuickly const):
(JSC::JSObject::tryGetIndexQuickly const):
(JSC::JSObject::canGetIndexQuickly): Deleted.
(JSC::JSObject::getIndexQuickly): Deleted.

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

5 weeks agoRefactor ShadowBlur: remove some class variables and use function parameters instead.
clopez@igalia.com [Fri, 12 Jul 2019 12:31:42 +0000 (12:31 +0000)]
Refactor ShadowBlur: remove some class variables and use function parameters instead.
https://bugs.webkit.org/show_bug.cgi?id=199511

Reviewed by Said Abou-Hallawa.

On the ShadowBlur class it is confusing to know if the status of the m_layerImage buffer or the
values calculated by calculateLayerBoundingRect() are valid between the different function calls.

To avoid this problem, pass this values as function parameters instead of storing them in the class.

No new tests, no intended behaviour change.

* platform/graphics/ShadowBlur.cpp:
(WebCore::ShadowBlur::ShadowBlur):
(WebCore::ShadowBlur::calculateLayerBoundingRect):
(WebCore::ShadowBlur::drawShadowBuffer):
(WebCore::ShadowBlur::drawRectShadow): Pass the parameters from the callback.
(WebCore::ShadowBlur::drawInsetShadow): Ditto.
(WebCore::ShadowBlur::drawRectShadowWithoutTiling):
(WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
(WebCore::ShadowBlur::drawRectShadowWithTiling):
(WebCore::ShadowBlur::drawInsetShadowWithTiling):
(WebCore::ShadowBlur::drawLayerPieces):
(WebCore::ShadowBlur::drawLayerPiecesAndFillCenter):
(WebCore::ShadowBlur::blurShadowBuffer):
(WebCore::ShadowBlur::blurAndColorShadowBuffer):
(WebCore::ShadowBlur::drawShadowLayer):
* platform/graphics/ShadowBlur.h: Use a struct to pass the values calculated on calculateLayerBoundingRect().

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

5 weeks ago[ATK] Avoid unneeded call to to core(selection) in listObjectForSelection()
aperez@igalia.com [Fri, 12 Jul 2019 10:08:57 +0000 (10:08 +0000)]
[ATK] Avoid unneeded call to to core(selection) in listObjectForSelection()
https://bugs.webkit.org/show_bug.cgi?id=199748
<rdar://problem/52995908>

Reviewed by Konstantin Tokarev.

No new tests needed.

* accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
(listObjectForCoreSelection): Renamed from listObjectForSelection() and remove the
unneeded call to core() now that coreSelection is passed directly to the function.
(optionFromList): Change to pass coreSelection directly to listObjectForCoreSelection().

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

5 weeks agoFix non-thread safe use of makeWeakPtr() under MediaPlayerPrivateMediaFoundation...
cdumez@apple.com [Fri, 12 Jul 2019 04:36:59 +0000 (04:36 +0000)]
Fix non-thread safe use of makeWeakPtr() under MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify()
https://bugs.webkit.org/show_bug.cgi?id=199727

Reviewed by Eric Carlson.

Stop calling makeWeakPtr() on a main thread object from a background thread.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify):

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

5 weeks agoRegister a MediaStreamTrack as media producer only if it is a capture track
youenn@apple.com [Fri, 12 Jul 2019 04:24:59 +0000 (04:24 +0000)]
Register a MediaStreamTrack as media producer only if it is a capture track
https://bugs.webkit.org/show_bug.cgi?id=199566
<rdar://problem/52761361>

Addressing post-landing comment to simplify setMuted call.
Unreviewed.

* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::MediaStreamTrack):

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

5 weeks agoProtect CoreAudioSharedUnit::m_clients for accessing in different threads simultaneously
youenn@apple.com [Fri, 12 Jul 2019 04:22:36 +0000 (04:22 +0000)]
Protect CoreAudioSharedUnit::m_clients for accessing in different threads simultaneously
https://bugs.webkit.org/show_bug.cgi?id=199717

Reviewed by Eric Carlson.

Add a lock whenever accessing to m_clients.
Manual tests show that audio capture still works.

* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioSharedUnit::addClient):
(WebCore::CoreAudioSharedUnit::removeClient):
(WebCore::CoreAudioSharedUnit::forEachClient const):
(WebCore::CoreAudioSharedUnit::processMicrophoneSamples):
(WebCore::CoreAudioSharedUnit::captureFailed):

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

5 weeks agoDrop non thread-safe usage of WeakPtr in PlaybackSessionInterfaceAVKit
cdumez@apple.com [Fri, 12 Jul 2019 02:35:07 +0000 (02:35 +0000)]
Drop non thread-safe usage of WeakPtr in PlaybackSessionInterfaceAVKit
https://bugs.webkit.org/show_bug.cgi?id=199698

Reviewed by Eric Carlson.

The PlaybackSessionInterfaceAVKit constructor was making a weakPtr on the UI Thread
of an WebThread object. The WeakPtr would then be used as a data member throughout
the class on the UIThread. This is not thread-safe.

This patch switches to using a raw pointer instead of a WeakPtr. This is a partial
rollout of r243337, which turned the raw pointer into a WeakPtr for hardening
purposes. For extra safety, this patch updates the VideoFullscreenControllerContext
so that it notifies its clients (i.e. PlaybackSessionInterfaceAVKit) that it is
getting destroyed, so that they can null-out their m_playbackSessionModel data
member. This gives the sames guarantees than WeakPtr but in a thread-safe way.

* platform/cocoa/PlaybackSessionModel.h:
(WebCore::PlaybackSessionModelClient::modelDestroyed):
* platform/ios/PlaybackSessionInterfaceAVKit.h:
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
(WebCore::PlaybackSessionInterfaceAVKit::~PlaybackSessionInterfaceAVKit):
(WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const):
(WebCore::PlaybackSessionInterfaceAVKit::modelDestroyed):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::~VideoFullscreenControllerContext):
(VideoFullscreenControllerContext::addClient):
(VideoFullscreenControllerContext::removeClient):

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

5 weeks agoFix builds where HAVE_DESIGN_SYSTEM_UI_FONTS is not defined.
simon.fraser@apple.com [Fri, 12 Jul 2019 02:20:51 +0000 (02:20 +0000)]
Fix builds where HAVE_DESIGN_SYSTEM_UI_FONTS is not defined.

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::fontWithFamilySpecialCase):

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

5 weeks agoUnreviewed build fix.
justin_fan@apple.com [Fri, 12 Jul 2019 01:13:31 +0000 (01:13 +0000)]
Unreviewed build fix.

* Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp: Missing include.

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

5 weeks agoNew York font erroneously gets synthetic bold
mmaxfield@apple.com [Fri, 12 Jul 2019 01:08:29 +0000 (01:08 +0000)]
New York font erroneously gets synthetic bold
https://bugs.webkit.org/show_bug.cgi?id=199653
<rdar://problem/51692592>

Reviewed by Simon Fraser.

Source/WebCore:

This patch adds support for -apple-system-ui-serif, -apple-system-ui-monospaced,
and -apple-system-ui-rounded, behind an SPI that is off-by-default. We don't want
to expose these fonts to the web because we don't a standardization story for them
yet, but we do want some apps to be able to use them.

WebKit clients who want to use these fonts can set
-[WKPreferences _shouldAllowDesignSystemUIFonts] = YES.

The patch generalizes our existing system-ui infrastructure to handle these three
additional fonts. It also explicitly disables the unsupported dot-prefixed names
so they don't leak out into Web content.

Tests: fast/text/design-system-ui-10.html
       fast/text/design-system-ui-11.html
       fast/text/design-system-ui-12.html
       fast/text/design-system-ui-13.html
       fast/text/design-system-ui-14.html
       fast/text/design-system-ui-15.html
       fast/text/design-system-ui-16.html
       fast/text/design-system-ui-2.html
       fast/text/design-system-ui-3.html
       fast/text/design-system-ui-4.html
       fast/text/design-system-ui-5.html
       fast/text/design-system-ui-6.html
       fast/text/design-system-ui-7.html
       fast/text/design-system-ui-8.html
       fast/text/design-system-ui-9.html
       fast/text/design-system-ui.html

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::shouldAllowDesignSystemUIFonts const):
* css/CSSFontFace.h:
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::load):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::initializeFontStyle):
* page/Settings.yaml:
* platform/graphics/FontDescription.cpp:
(WebCore::m_shouldAllowDesignSystemUIFonts):
(WebCore::m_shouldAllowUserInstalledFonts): Deleted.
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::shouldAllowDesignSystemUIFonts const):
(WebCore::FontDescription::setShouldAllowDesignSystemUIFonts):
(WebCore::FontDescription::operator== const):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::platformFontLookupWithFamily):
(WebCore::fontWithFamily):
* platform/graphics/cocoa/FontCacheCoreText.h:
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::systemFontUse):
(WebCore::systemFontCascadeList):
(WebCore::FontCascadeDescription::effectiveFamilyCount const):
(WebCore::FontCascadeDescription::effectiveFamilyAt const):
(WebCore::isSystemFontString): Deleted.
(WebCore::isUIFontTextStyle): Deleted.
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::ctFont const):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::SystemFontDatabaseCoreText::createSystemUI):
(WebCore::SystemFontDatabaseCoreText::createDesignSystemUI):
(WebCore::SystemFontDatabaseCoreText::createTextStyle):
(WebCore::SystemFontDatabaseCoreText::cascadeList):
(WebCore::SystemFontDatabaseCoreText::applyWeightItalicsAndFallbackBehavior):
(WebCore::SystemFontDatabaseCoreText::systemFontParameters):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::platformFontWithFamilySpecialCase):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::platformFontWithFamilySpecialCase):
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setShouldAllowDesignSystemUIFonts):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

Source/WebCore/PAL:

* pal/spi/cocoa/CoreTextSPI.h:

Source/WebKit:

Add the SPI to enable the new fonts.

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetShouldAllowDesignSystemUIFonts):
(WKPreferencesGetShouldAllowDesignSystemUIFonts):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _shouldAllowDesignSystemUIFonts]):
(-[WKPreferences _setShouldAllowDesignSystemUIFonts:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

Source/WTF:

* wtf/Platform.h:

LayoutTests:

* TestExpectations:
* fast/text/design-system-ui-10-expected-mismatch.html: Added.
* fast/text/design-system-ui-10.html: Added.
* fast/text/design-system-ui-11-expected-mismatch.html: Added.
* fast/text/design-system-ui-11.html: Added.
* fast/text/design-system-ui-12-expected-mismatch.html: Added.
* fast/text/design-system-ui-12.html: Added.
* fast/text/design-system-ui-13-expected-mismatch.html: Added.
* fast/text/design-system-ui-13.html: Added.
* fast/text/design-system-ui-14-expected-mismatch.html: Added.
* fast/text/design-system-ui-14.html: Added.
* fast/text/design-system-ui-15-expected-mismatch.html: Added.
* fast/text/design-system-ui-15.html: Added.
* fast/text/design-system-ui-16-expected-mismatch.html: Added.
* fast/text/design-system-ui-16.html: Added.
* fast/text/design-system-ui-2-expected.html: Added.
* fast/text/design-system-ui-2.html: Added.
* fast/text/design-system-ui-3-expected-mismatch.html: Added.
* fast/text/design-system-ui-3.html: Added.
* fast/text/design-system-ui-4-expected-mismatch.html: Added.
* fast/text/design-system-ui-4.html: Added.
* fast/text/design-system-ui-5-expected-mismatch.html: Added.
* fast/text/design-system-ui-5.html: Added.
* fast/text/design-system-ui-6-expected.html: Added.
* fast/text/design-system-ui-6.html: Added.
* fast/text/design-system-ui-7-expected.html: Added.
* fast/text/design-system-ui-7.html: Added.
* fast/text/design-system-ui-8-expected-mismatch.html: Added.
* fast/text/design-system-ui-8.html: Added.
* fast/text/design-system-ui-9-expected-mismatch.html: Added.
* fast/text/design-system-ui-9.html: Added.
* fast/text/design-system-ui-expected.html: Added.
* fast/text/design-system-ui.html: Added.
* platform/mac/TestExpectations:

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

5 weeks ago[GTK][WPE] Rebaseline css3/blending tests with an empty homedir.
clopez@igalia.com [Fri, 12 Jul 2019 00:49:53 +0000 (00:49 +0000)]
[GTK][WPE] Rebaseline css3/blending tests with an empty homedir.

It seems this tests are sensible to some configuration of some
library as they produce different output (the layers with more left
margin) depending on that. The test pass on both cases, but the
check with the expected result fails, so it is flagged as failing.

This rebaselines the results to those that happen when running with
an empty/temporal homedir on Debian 10 to match what happens on the
bots. For more info see bugs 169916 and 199738.

Unreviewed gardening commit.

* 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:
* platform/gtk/css3/blending/svg-blend-layer-clip-path-expected.txt:
* 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: css3/blending/svg-isolation-isolated-group.html passes with an empty homedir.
* platform/wpe/css3/blending/svg-blend-layer-blend-expected.png:
* platform/wpe/css3/blending/svg-blend-layer-blend-expected.txt:
* platform/wpe/css3/blending/svg-blend-layer-clip-path-expected.png:
* platform/wpe/css3/blending/svg-blend-layer-clip-path-expected.txt:
* platform/wpe/css3/blending/svg-blend-layer-filter-expected.png:
* platform/wpe/css3/blending/svg-blend-layer-filter-expected.txt:
* platform/wpe/css3/blending/svg-blend-layer-mask-expected.png:
* platform/wpe/css3/blending/svg-blend-layer-mask-expected.txt:
* platform/wpe/css3/blending/svg-blend-layer-opacity-expected.png:
* platform/wpe/css3/blending/svg-blend-layer-opacity-expected.txt:

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

5 weeks agoASSERTION FAILED: RunLoop::isMain() under IPC::Connection::sendWithAsyncReply()
cdumez@apple.com [Thu, 11 Jul 2019 23:58:35 +0000 (23:58 +0000)]
ASSERTION FAILED: RunLoop::isMain() under IPC::Connection::sendWithAsyncReply()
https://bugs.webkit.org/show_bug.cgi?id=199734
<rdar://problem/52977439>

Reviewed by Geoffrey Garen.

It appears WKProcessTaskStateObserverDelegate's taskStateDidChange handler can get called
on a background thread so we need to make sure we go back to the main thread before we
go into WebKit and do IPC.

* Shared/Cocoa/ProcessTaskStateObserver.mm:
(-[WKProcessTaskStateObserverDelegate process:taskStateDidChange:]):

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

5 weeks ago[iOS] fast/events/ios/rotation/orientationchange-event-listener-on.body.html is flaky
cdumez@apple.com [Thu, 11 Jul 2019 23:47:06 +0000 (23:47 +0000)]
[iOS] fast/events/ios/rotation/orientationchange-event-listener-on.body.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=199732
<rdar://problem/52693087>

Reviewed by Alex Christensen.

Stop logging in each event listener to not be reliant on the order in which listener are called.
Instead, simply make sure all event listeners that should be called were actually called.

* fast/events/ios/rotation/orientationchange-event-listener-on.body-expected.txt:
* fast/events/ios/rotation/orientationchange-event-listener-on.body.html:

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

5 weeks agoMake the test added in r247327 more reliable.
rniwa@webkit.org [Thu, 11 Jul 2019 23:30:02 +0000 (23:30 +0000)]
Make the test added in r247327 more reliable.

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

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

5 weeks agoUnreviewed follow-up fix to r247364.
aakash_jain@apple.com [Thu, 11 Jul 2019 23:18:12 +0000 (23:18 +0000)]
Unreviewed follow-up fix to r247364.
[ews-build] Add build step to clean up .git/index.lock file
https://bugs.webkit.org/show_bug.cgi?id=199722

* BuildSlaveSupport/ews-build/steps.py:
(CheckOutSource): CheckOutSource should not haltOnFailure since CleanUpGitIndexLock step needs
to be run after this step.

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

5 weeks agoLayout Test fast/viewport/ios/viewport-shrink-to-fit-on-new-navigation.html is Failin...
tsavell@apple.com [Thu, 11 Jul 2019 22:53:59 +0000 (22:53 +0000)]
Layout Test fast/viewport/ios/viewport-shrink-to-fit-on-new-navigation.html is Failing Consistently on iOS-WK2.
https://bugs.webkit.org/show_bug.cgi?id=199731

Unreviewed Test Gardening

Patch by Russell Epstein <russell_e@apple.com> on 2019-07-11

* platform/ios-wk2/TestExpectations:

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

5 weeks agoStorageArea should not be destructed on the main thread
sihui_liu@apple.com [Thu, 11 Jul 2019 22:26:25 +0000 (22:26 +0000)]
StorageArea should not be destructed on the main thread
https://bugs.webkit.org/show_bug.cgi?id=199713
<rdar://problem/52911900>

Reviewed by Alex Christensen.

After r246079, LocalStorageNameSpace could be destructed on the main thread and it may hold the last reference
to StorageArea. Then we saw the crashes that StorageArea was wrongly destructed on the main thread.

* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::~NetworkSession):
* NetworkProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::waitUntilTasksFinished):
(WebKit::StorageManager::waitUntilWritesFinished): Deleted.
* NetworkProcess/WebStorage/StorageManager.h:

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

5 weeks agoNull deref of Range under WebPage::startAutoscrollAtPosition
timothy_horton@apple.com [Thu, 11 Jul 2019 22:22:57 +0000 (22:22 +0000)]
Null deref of Range under WebPage::startAutoscrollAtPosition
https://bugs.webkit.org/show_bug.cgi?id=199724
<rdar://problem/41127089>

Reviewed by Dean Jackson.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::startAutoscrollAtPosition):
Refactor this function to be early-return-y, and add one more
early return if the Range is null.

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

5 weeks agoFlaky API Test TestWTF.bmalloc.ScavengedMemoryShouldBeReused
ysuzuki@apple.com [Thu, 11 Jul 2019 21:56:32 +0000 (21:56 +0000)]
Flaky API Test TestWTF.bmalloc.ScavengedMemoryShouldBeReused
https://bugs.webkit.org/show_bug.cgi?id=199524
<rdar://problem/52783816>

Reviewed by Saam Barati.

This test is white-box one and it has strong assumption how IsoHeap allocates pages.
But this test has several problems.

1. IsoPage::numObjects is not the exact number of how many we allocate objects. This
   number is calculated by pageSize / sizeof(T), and this does not account the header
   size of IsoPage. So, # of objects per IsoPage is less than numObjects. Since sizeof(double)
   is very small, we can have many objects in one IsoPage. As a result, we need a large
   bitmap in IsoPage. This reduces # of objects in IsoPage largely. So, `ptrs.size()` becomes
   less than numObjects.

2. We now have lower tier of allocation in IsoHeap. It means that we allocate 8 objects in
   shared page (page is shared, but memory is pinned for a specific type) before using IsoHeap's
   page. This also makes the intention of this test wrong.

Due to (1), we access OoB of ptrs vector, passing a garbage to IsoHeap::deallocate, and crashing.

We make this test robust while we still keep this test white-box one to test the critical feature
of IsoHeap. We first exhaust lower tier of IsoHeap, and after that, start testing the memory. We
allocate many pointers, deallocate them, allocate one pointer while keeping pointers in the lower
tier live, and check whether the deallocated memory is reused.

* TestWebKitAPI/Tests/WTF/bmalloc/IsoHeap.cpp:
(TEST):

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

5 weeks ago[WPE][GTK] Build failure with ENABLE_ACCESSIBILITY=OFF
psaavedra@igalia.com [Thu, 11 Jul 2019 21:51:24 +0000 (21:51 +0000)]
[WPE][GTK] Build failure with ENABLE_ACCESSIBILITY=OFF
https://bugs.webkit.org/show_bug.cgi?id=199625

Added ENABLE(ACCESSIBILITY) and replaced HAVE(ACCESSIBILITY)
with ENABLE(ACCESSIBILITY) in the code.

Additionally, the TestRunner code generator now honors the
Conditional IDL format.

.:

Reviewed by Konstantin Tokarev.

* Source/cmake/OptionsWPE.cmake:
* Source/cmake/WebKitFeatures.cmake:

Source/WebCore:

No new tests as there is no intended functional change

Reviewed by Konstantin Tokarev.

* accessibility/AXObjectCache.cpp:
* accessibility/AXObjectCache.h:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::detach):
(WebCore::AccessibilityObject::isDetached const):
* accessibility/AccessibilityObject.h:
* accessibility/atk/AXObjectCacheAtk.cpp:
* accessibility/atk/AccessibilityObjectAtk.cpp:
* accessibility/atk/WebKitAccessible.cpp:
* accessibility/atk/WebKitAccessible.h:
* accessibility/atk/WebKitAccessibleHyperlink.cpp:
* accessibility/atk/WebKitAccessibleHyperlink.h:
* accessibility/atk/WebKitAccessibleInterfaceAction.cpp:
* accessibility/atk/WebKitAccessibleInterfaceAction.h:
* accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
* accessibility/atk/WebKitAccessibleInterfaceComponent.h:
* accessibility/atk/WebKitAccessibleInterfaceDocument.cpp:
* accessibility/atk/WebKitAccessibleInterfaceDocument.h:
* accessibility/atk/WebKitAccessibleInterfaceEditableText.cpp:
* accessibility/atk/WebKitAccessibleInterfaceEditableText.h:
* accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp:
* accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.h:
* accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp:
* accessibility/atk/WebKitAccessibleInterfaceHypertext.h:
* accessibility/atk/WebKitAccessibleInterfaceImage.cpp:
* accessibility/atk/WebKitAccessibleInterfaceImage.h:
* accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
* accessibility/atk/WebKitAccessibleInterfaceSelection.h:
* accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
* accessibility/atk/WebKitAccessibleInterfaceTable.h:
* accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
* accessibility/atk/WebKitAccessibleInterfaceTableCell.h:
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
* accessibility/atk/WebKitAccessibleInterfaceText.h:
* accessibility/atk/WebKitAccessibleInterfaceValue.cpp:
* accessibility/atk/WebKitAccessibleInterfaceValue.h:
* accessibility/atk/WebKitAccessibleUtil.cpp:
* accessibility/atk/WebKitAccessibleUtil.h:
* accessibility/ios/AXObjectCacheIOS.mm:
* accessibility/ios/AccessibilityObjectIOS.mm:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
* accessibility/mac/AXObjectCacheMac.mm:
* accessibility/mac/AccessibilityObjectBase.mm:
* accessibility/mac/AccessibilityObjectMac.mm:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
* accessibility/win/AccessibilityObjectWin.cpp:
* accessibility/win/AccessibilityObjectWrapperWin.cpp:
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
* editing/FrameSelection.h:
* editing/atk/FrameSelectionAtk.cpp:
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setInnerTextValue):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):

Source/WebKit:

Reviewed by Konstantin Tokarev.

* UIProcess/API/glib/WebKitWebViewAccessible.cpp:
* UIProcess/API/glib/WebKitWebViewAccessible.h:
* UIProcess/API/wpe/PageClientImpl.cpp:
* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::m_backend):
(WKWPE::View::~View):
* UIProcess/API/wpe/WPEView.h:
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKAccessibilityRootObject):
(WKAccessibilityFocusedObject):
(WKAccessibilityEnableEnhancedAccessibility):
(WKAccessibilityEnhancedAccessibilityEnabled):
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp:
* WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.h:
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::platformInitialize):
* WebProcess/WebPage/wpe/WebPageWPE.cpp:
(WebKit::WebPage::platformInitialize):
* WebProcess/wpe/WebProcessMainWPE.cpp:

Source/WebKitLegacy/mac:

Reviewed by Konstantin Tokarev.

* WebView/WebFrame.mm:
(-[WebFrame setAccessibleName:]):
(-[WebFrame enhancedAccessibilityEnabled]):
(-[WebFrame setEnhancedAccessibility:]):
(-[WebFrame accessibilityRoot]):

Source/WTF:

Reviewed by Konstantin Tokarev.

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

Tools:

Reviewed by Konstantin Tokarev.

* WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:
* WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.cpp:
* WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.cpp:
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityController.idl:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarker.idl:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarkerRange.idl:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
(_generateImplementationFile):

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

5 weeks ago[WebGPU] Implement GPUError and error scopes
justin_fan@apple.com [Thu, 11 Jul 2019 21:32:06 +0000 (21:32 +0000)]
[WebGPU] Implement GPUError and error scopes
https://bugs.webkit.org/show_bug.cgi?id=199655

Reviewed by Myles C. Maxfield.

Source/WebCore:

Add GPUErrorFilter, GPUError, and the ability to push and pop error scopes on a GPUDevice.
This will allow us to check for WebGPU errors from JavaScript.
Currently, only some GPUBuffer creation errors are reported for testing; more errors will follow in later patches.

Test: webgpu/error-scopes-test.html

* Modules/webgpu/GPUErrorFilter.idl: Added.
* Modules/webgpu/GPUOutOfMemoryError.idl: Added.
* Modules/webgpu/GPUValidationError.idl: Added.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::pushErrorScope):
(WebCore::WebGPUDevice::popErrorScope): Resolve the Promise here, since GPUDevice shouldn't worry about DOM layer.
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDeviceErrorScopes.cpp: Added.
(WebCore::WebGPUDeviceErrorScopes::pushErrorScope): Delegates to WebGPUDevice.
(WebCore::WebGPUDeviceErrorScopes::popErrorScope): Ditto.
* Modules/webgpu/WebGPUDeviceErrorScopes.h: Added.
* Modules/webgpu/WebGPUDeviceErrorScopes.idl: Added.
* platform/graphics/gpu/GPUBuffer.h:
* platform/graphics/gpu/GPUDevice.cpp: The actual error stack lives here.
(WebCore::GPUDevice::pushErrorScope):
(WebCore::GPUDevice::popErrorScope): Calls a callback with a GPUError, if any.
(WebCore::GPUDevice::registerError): Actually creates GPUErrors.
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/GPUError.cpp: Added.
(WebCore::createError): Factory function for various error types.
* platform/graphics/gpu/GPUError.h: Added.
* platform/graphics/gpu/GPUErrorFilter.h: Added.
* platform/graphics/gpu/GPUOutOfMemoryError.h: Added.
(WebCore::GPUOutOfMemoryError::create):
* platform/graphics/gpu/GPUValidationError.cpp: Added.
(WebCore::GPUValidationError::create):
(WebCore::GPUValidationError::GPUValidationError):
* platform/graphics/gpu/GPUValidationError.h: Added.
(WebCore::GPUValidationError::message const):
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::validateBufferUsage): Create an actual GPUValidationError :)
(WebCore::GPUBuffer::tryCreate): Create GPUOutOfMemoryErrors where appropriate.

Add file/name references:
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:

Missing includes:
* Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp:

LayoutTests:

Add a test to cover the cases outlined in the WebGPU error handling design doc.

* webgpu/error-scopes-test-expected.txt: Added.
* webgpu/error-scopes-test.html: Added.

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

5 weeks agoNull deref of RenderView under FrameView::setNeedsCompositingConfigurationUpdate
timothy_horton@apple.com [Thu, 11 Jul 2019 21:15:24 +0000 (21:15 +0000)]
Null deref of RenderView under FrameView::setNeedsCompositingConfigurationUpdate
https://bugs.webkit.org/show_bug.cgi?id=199723
<rdar://problem/51554747>

Reviewed by Simon Fraser.

* page/FrameView.cpp:
(WebCore::FrameView::setNeedsCompositingConfigurationUpdate):
Add a null-check; it looks like it is possible to get here by dismissing
the find overlay (or other page overlay) at an inopportune time.

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

5 weeks ago[ews-build] Add build step to clean up .git/index.lock file
aakash_jain@apple.com [Thu, 11 Jul 2019 21:12:39 +0000 (21:12 +0000)]
[ews-build] Add build step to clean up .git/index.lock file
https://bugs.webkit.org/show_bug.cgi?id=199722

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(CheckOutSource.getResultSummary): Run CleanUpGitIndexLock step when CheckOutSource fails.
(CleanUpGitIndexLock.__init__): Configure timeout and logEnviron.
(CleanUpGitIndexLock.evaluateCommand): Always RETRY the build after this step is run.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.

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

5 weeks agoAdd b3 macro lowering for CheckMul on arm64
justin_michaud@apple.com [Thu, 11 Jul 2019 21:08:36 +0000 (21:08 +0000)]
Add b3 macro lowering for CheckMul on arm64
https://bugs.webkit.org/show_bug.cgi?id=199251

Reviewed by Robin Morisset.

JSTests:

* microbenchmarks/check-mul-constant.js: Added.
(doTest):
* microbenchmarks/check-mul-no-constant.js: Added.
(doTest):
* microbenchmarks/check-mul-power-of-two.js: Added.
(doTest):

Source/JavaScriptCore:

- Lower CheckMul for 32-bit arguments on arm64 into a mul and then an overflow check.
- Add a new opcode to air on arm64 for smull (multiplySignExtend32).
- Fuse sign extend 32 + mul into smull (taking two 32-bit arguments and producing 64 bits).
- 1.25x speedup on power of two microbenchmark, 1.15x speedup on normal constant microbenchmark,
  and no change on the no-constant benchmark.
Also, skip some of the b3 tests that were failing before this patch so that the new tests can run
to completion.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::multiplySignExtend32):
* assembler/testmasm.cpp:
(JSC::testMul32SignExtend):
(JSC::run):
* b3/B3LowerMacros.cpp:
* b3/B3LowerToAir.cpp:
* b3/air/AirOpcode.opcodes:
* b3/testb3.cpp:
(JSC::B3::testMulArgs32SignExtend):
(JSC::B3::testMulImm32SignExtend):
(JSC::B3::testMemoryFence):
(JSC::B3::testStoreFence):
(JSC::B3::testLoadFence):
(JSC::B3::testPinRegisters):
(JSC::B3::run):

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

5 weeks agoUnreviewed, rolling out r247314.
commit-queue@webkit.org [Thu, 11 Jul 2019 21:04:05 +0000 (21:04 +0000)]
Unreviewed, rolling out r247314.
https://bugs.webkit.org/show_bug.cgi?id=199721

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

Reverted changeset:

"Disable speculative loading if cache is not to be used for
the load"
https://bugs.webkit.org/show_bug.cgi?id=199644
https://trac.webkit.org/changeset/247314

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

5 weeks agoPages using Google Tag Manager Google's anti-flicker optimization may take ~5 seconds...
cdumez@apple.com [Thu, 11 Jul 2019 20:52:06 +0000 (20:52 +0000)]
Pages using Google Tag Manager Google's anti-flicker optimization may take ~5 seconds to do initial paint
https://bugs.webkit.org/show_bug.cgi?id=199704
<rdar://problem/52966461>

Reviewed by Geoffrey Garen.

Apply the same fix as r246764 for when "https://www.googletagmanager.com/gtm.js" load is blocked by a content
extension to avoid delaying initial paint by ~5 seconds. This was tested on https://www.formula1.com/en.html.

* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):

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

5 weeks agoCrashTracer: Regression : MobileSafari at UIKit: -[CALayerAccessibility__UIKit__Quart...
dino@apple.com [Thu, 11 Jul 2019 20:11:47 +0000 (20:11 +0000)]
CrashTracer: Regression : MobileSafari at UIKit: -[CALayerAccessibility__UIKit__QuartzCore setBounds:]
https://bugs.webkit.org/show_bug.cgi?id=199720
<rdar://problem/51470469>

Reviewed by Tim Horton.

Speculative fix after confirming that this crash can occur when
a zero width/height view is used for a UITargetedPreview. We
already guarded against this in the default flow, but not in
the fallback path where we take a view snapshot.

* UIProcess/ios/WKContentViewInteraction.mm:
(createFallbackTargetedPreview): Return early if rectangles are empty.

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

5 weeks agoVersioning.
alancoon@apple.com [Thu, 11 Jul 2019 19:39:23 +0000 (19:39 +0000)]
Versioning.

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

5 weeks agoDisable RGB10 IOSurface pixel format for Mac Catalyst
cdumez@apple.com [Thu, 11 Jul 2019 18:43:39 +0000 (18:43 +0000)]
Disable RGB10 IOSurface pixel format for Mac Catalyst
https://bugs.webkit.org/show_bug.cgi?id=199712
<rdar://problem/52793584>

Reviewed by Beth Dakin.

Disable RGB10 IOSurface pixel format for Mac Catalyst. This format is not supported
on Mac Catalyst and causes us not to render anything.

* platform/graphics/cocoa/IOSurface.h:

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

5 weeks agoUse mobile UA on jsfiddle.net
commit-queue@webkit.org [Thu, 11 Jul 2019 18:39:16 +0000 (18:39 +0000)]
Use mobile UA on jsfiddle.net
https://bugs.webkit.org/show_bug.cgi?id=199687
<rdar://problem/50839844>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-07-11
Reviewed by Maciej Stachowiak.

Text selection does not work on iPads using desktop UA.
This isn't the best solution, but it's certainly *a* solution.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::desktopClassBrowsingRecommendedForRequest):

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

5 weeks agoWeb Inspector: Layers: Uncaught Exception: Request with id = 2 failed. {"code":-32601...
drousso@apple.com [Thu, 11 Jul 2019 18:36:57 +0000 (18:36 +0000)]
Web Inspector: Layers: Uncaught Exception: Request with id = 2 failed. {"code":-32601,"message":"'Page' domain was not found","data":[{"code":-32601,"message":"'Page' domain was not found"}]}
https://bugs.webkit.org/show_bug.cgi?id=199555

Reviewed by Joseph Pecoraro.

Use modern inspected target support checking, and defer agent commands until a target is
available.

* UserInterface/Views/Layers3DContentView.js:
(WI.Layers3DContentView):
(WI.Layers3DContentView.prototype._showPaintRectsSettingChanged):
(WI.Layers3DContentView.prototype._updateCompositingBordersButtonState):
(WI.Layers3DContentView.prototype._toggleCompositingBorders):

* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView):
(WI.DOMTreeContentView.prototype._toggleCompositingBorders):
(WI.DOMTreeContentView.prototype._updateCompositingBordersButtonToMatchPageSettings):
(WI.DOMTreeContentView.prototype._showPaintRectsSettingChanged):
(WI.DOMTreeContentView.prototype._showPrintStylesChanged):
(WI.DOMTreeContentView.prototype._showRulersChanged):
Drive-by: apply the same changes to the Elements tab for when the Layers tab isn't enabled.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247356 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks ago[iOS 13] Enable WebKit build
jbedard@apple.com [Thu, 11 Jul 2019 17:17:58 +0000 (17:17 +0000)]
[iOS 13] Enable WebKit build
https://bugs.webkit.org/show_bug.cgi?id=199481
<rdar://problem/52619048>

Reviewed by Tim Horton.

Source/WebCore:

No new tests, iOS 13 test expectations will be migrated in the near future.

* platform/ios/LocalCurrentTraitCollection.mm:
(WebCore::LocalCurrentTraitCollection::LocalCurrentTraitCollection): Remove underscore from currentTraitCollection.
(WebCore::LocalCurrentTraitCollection::~LocalCurrentTraitCollection): Remove underscore from setCurrentTraitCollection.

Source/WebCore/PAL:

* pal/spi/cocoa/NSProgressSPI.h: We need the NSProgress SPI in public builds because NSProgress API
is marked unavailable on iOS, watchOS and tvOS.
* pal/spi/ios/CoreUISPI.h: Add CUIStyleEffectConfiguration.appearanceName SPI.
* pal/spi/ios/DataDetectorsUISPI.h: Add UIContextMenuConfiguration.contextMenuConfigurationForURL SPI.
* pal/spi/ios/SystemPreviewSPI.h: Add ARQuickLookWebKitItem.initWithPreviewItemProvider SPI.
* pal/spi/ios/UIKitSPI.h: Add systemBrownColor, UIColor.tableCellDefaultSelectionTintColor should be marked nullable.
* pal/spi/mac/AVFoundationSPI.h: Add AVOutputDevice.name SPI.

Source/WebKit:

* Platform/spi/ios/UIKitSPI.h: Add UITextEffectsWindow.sharedTextEffectsWindowForWindowScene SPI.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView showGlobalMenuControllerInRect:]): setTargetRect, setMenuVisible marked depreciated in iOS 13.
(-[WKContentView hideGlobalMenuController]): Ditto.

Tools:

* TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig: Add iOS framework stubs.

WebKitLibraries:

Added iOS 13 framework stubs, used tbd version 3 in all new stubs.

* WebKitPrivateFrameworkStubs/iOS/13: Added.
* WebKitPrivateFrameworkStubs/iOS/13/AppSupport.framework: Added.
* WebKitPrivateFrameworkStubs/iOS/13/AssertionServices.framework: Added.
* WebKitPrivateFrameworkStubs/iOS/13/AuthKit.framework: Added.
* WebKitPrivateFrameworkStubs/iOS/13/CorePDF.framework: Added.
* WebKitPrivateFrameworkStubs/iOS/13/CorePrediction.framework: Added.
* WebKitPrivateFrameworkStubs/iOS/13/GraphicsServices.framework: Added.
* WebKitPrivateFrameworkStubs/iOS/13/SafariSafeBrowsing.framework: Added.
* WebKitPrivateFrameworkStubs/iOS/13/URLFormatting.framework: Added.

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

5 weeks agoFix non thread-safe usage of makeWeakPtr() in MediaPlayerPrivateMediaFoundation
cdumez@apple.com [Thu, 11 Jul 2019 17:10:52 +0000 (17:10 +0000)]
Fix non thread-safe usage of makeWeakPtr() in MediaPlayerPrivateMediaFoundation
https://bugs.webkit.org/show_bug.cgi?id=199700

Reviewed by Eric Carlson.

The code was calling makeWeakPtr() on a main-thread object, from a background thread.
This is not thread safe. To address the issue, this patches creates the WeakPtr ahead
of time, on the main thread.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
(WebCore::MediaPlayerPrivateMediaFoundation::endCreatedMediaSource):
(WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
(WebCore::MediaPlayerPrivateMediaFoundation::ThreadSafeWrapper::create):
(WebCore::MediaPlayerPrivateMediaFoundation::ThreadSafeWrapper::wrapped):
(WebCore::MediaPlayerPrivateMediaFoundation::ThreadSafeWrapper::ThreadSafeWrapper):

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

5 weeks agoAdd test expectations and baselines for iOS 13
ryanhaddad@apple.com [Thu, 11 Jul 2019 17:08:30 +0000 (17:08 +0000)]
Add test expectations and baselines for iOS 13
https://bugs.webkit.org/show_bug.cgi?id=199329

Reviewed by Jonathan Bedard.

Tools:

* Scripts/webkitpy/port/ios.py:
(IOSPort): Increment current version to 13.
* Scripts/webkitpy/port/ios_device_unittest.py: Update unit tests.
(IOSDeviceTest.test_layout_test_searchpath_with_apple_additions):
(IOSDeviceTest.test_layout_test_searchpath_without_apple_additions):
(IOSDeviceTest.test_layout_searchpath_wih_device_type):
* Scripts/webkitpy/port/ios_simulator_unittest.py: Ditto.
(IOSSimulatorTest.make_port):
(IOSSimulatorTest.test_layout_test_searchpath_with_apple_additions):
(IOSSimulatorTest.test_layout_test_searchpath_without_apple_additions):
(IOSSimulatorTest.test_layout_searchpath_wih_device_type):
* Scripts/webkitpy/port/ios_testcase.py: Ditto.
(IOSTest.make_port):

LayoutTests:

* platform/ios-12/*: Move iOS 12 specific baselines to their own directory.
* platform/ios/*: Add iOS 13 baselines and test expectations.

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

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247352 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247350 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247349 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247348 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247347 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247346 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247345 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247344 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247342 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247341 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247340 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247339 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247338 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247337 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247336 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247333 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247332 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247331 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247330 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247329 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247328 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247327 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247326 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247325 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247324 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247323 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247322 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247321 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247319 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247317 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247316 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247315 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247314 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247313 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247310 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247309 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247308 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247307 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247306 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247305 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247301 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247299 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247298 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247297 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247296 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247295 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247294 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 weeks 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: https://svn.webkit.org/repository/webkit/trunk@247293 268f45cc-cd09-0410-ab3c-d52691b4dbfc