WebKit-https.git
9 months agoUnreviewed, rolling out r246501.
ryanhaddad@apple.com [Mon, 17 Jun 2019 20:23:46 +0000 (20:23 +0000)]
Unreviewed, rolling out r246501.

Breaks Apple internal builds.

Reverted changeset:

"Support using ANGLE as the backend for the WebGL
implementation"
https://bugs.webkit.org/show_bug.cgi?id=197755
https://trac.webkit.org/changeset/246501

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

9 months agoscrollingcoordinator/ios/sync-layer-positions-after-scroll.html is a flaky failure...
sroberts@apple.com [Mon, 17 Jun 2019 20:14:05 +0000 (20:14 +0000)]
scrollingcoordinator/ios/sync-layer-positions-after-scroll.html is a flaky failure on iOS Simulator
https://bugs.webkit.org/show_bug.cgi?id=172001

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

9 months agoWeb Inspector: Settings: split the General panel into sub panels so it's less crowded
drousso@apple.com [Mon, 17 Jun 2019 19:32:11 +0000 (19:32 +0000)]
Web Inspector: Settings: split the General panel into sub panels so it's less crowded
https://bugs.webkit.org/show_bug.cgi?id=198803

Reviewed by Timothy Hatcher.

* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype.initialLayout):
(WI.SettingsTabContentView.prototype._createGeneralSettingsView):
Many of the settings in General only affect a specific part of Web Inspector, and therefore
aren't really "general".

(WI.SettingsTabContentView.prototype._createElementsSettingsView): Added.
 - Element Selection
 - CSS Changes

(WI.SettingsTabContentView.prototype._createSourcesSettingsView): Added.
 - Debugger
 - Source Maps

(WI.SettingsTabContentView.prototype._createConsoleSettingsView): Added.
 - Traces (renamed from "Console")
 - WebRTC Logging
 - Media Logging
 - MSE Logging

* Localizations/en.lproj/localizedStrings.js:

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

9 months agoWeb Inspector: Sources: the Inspector Style Sheet is missing when grouped by path
drousso@apple.com [Mon, 17 Jun 2019 19:30:54 +0000 (19:30 +0000)]
Web Inspector: Sources: the Inspector Style Sheet is missing when grouped by path
https://bugs.webkit.org/show_bug.cgi?id=198860

Reviewed by Timothy Hatcher.

* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype.get styleSheets):
(WI.CSSManager.prototype.inspectorStyleSheetsForFrame):
(WI.CSSManager.prototype.preferredInspectorStyleSheetForFrame):
(WI.CSSManager.prototype._inspectorStyleSheetsForFrame): Deleted.
Expose a way to fetch all inspector stylesheets for a given frame.
Make sure to associate inspector stylesheets with their frame.

* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._compareTreeElements):
(WI.SourcesNavigationSidebarPanel.prototype._addResourcesRecursivelyForFrame):
(WI.SourcesNavigationSidebarPanel.prototype._handleCSSStyleSheetAdded):
Add paths for inspector stylesheet creation/fetching when grouping by path.
Sort inspector stylesheets as the first item of an origin/frame when grouping by path.

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

9 months agoWeb Inspector: Go To Line dialog is white when in Dark Mode
commit-queue@webkit.org [Mon, 17 Jun 2019 19:29:18 +0000 (19:29 +0000)]
Web Inspector: Go To Line dialog is white when in Dark Mode
https://bugs.webkit.org/show_bug.cgi?id=198596

Patch by Jamal Nasser <jamaln@mail.com> on 2019-06-17
Reviewed by Timothy Hatcher.

* UserInterface/Views/GoToLineDialog.css:
(@media (prefers-color-scheme: dark)):
(.go-to-line-dialog):
(.go-to-line-dialog > div > input):
(.go-to-line-dialog > div > input::placeholder):
(.go-to-line-dialog > div::before):

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

9 months agoConcurrent GC should check the conn before starting a new collection cycle
tzagallo@apple.com [Mon, 17 Jun 2019 18:54:30 +0000 (18:54 +0000)]
Concurrent GC should check the conn before starting a new collection cycle
https://bugs.webkit.org/show_bug.cgi?id=198913
<rdar://problem/49515149>

Reviewed by Filip Pizlo.

Heap::requestCollection tries to steal the conn as an optimization to avoid waking up the collector
thread if it's idle. We determine if the collector is idle by ensuring that there are no pending collections
and that the current GC phase is NotRunning. However, that's not safe immediately after the concurrent
GC has finished processing the last pending request. The collector thread will runEndPhase and immediately
start runNotRunningPhase, without checking if it still has the conn. If the mutator has stolen the conn in
the mean time, this will lead to both threads collecting concurrently, and eventually we'll crash in checkConn,
since the collector is running but doesn't have the conn anymore.

To solve this, we check if we still have the conn after holding the lock in runNotRunningPhase, in case the mutator
has stolen the conn. Ideally, we wouldn't let the mutator steal the conn in the first place, but that doesn't seem
trivial to determine.

* heap/Heap.cpp:
(JSC::Heap::runNotRunningPhase):

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

9 months agoREGRESSION (r242686): Paths in XPC services’ LC_DYLD_ENVIRONMENT are incorrect in...
mitz@apple.com [Mon, 17 Jun 2019 18:53:31 +0000 (18:53 +0000)]
REGRESSION (r242686): Paths in XPC services’ LC_DYLD_ENVIRONMENT are incorrect in built products directory
https://bugs.webkit.org/show_bug.cgi?id=198904

Reviewed by Alex Christensen.

After r242686, in local builds, the XPC service executables run from their location at the
top of the built products directory, rather than inside the framework.

* Configurations/BaseXPCService.xcconfig: Updated the load commands that set
  DYLD_FRAMEWORK_PATH and DYLD_LIBRARY_PATH for the new location in the built products
  directory. Also removed WK_XPC_SERVICE_INSERT_LIBRARIES_DIR that had been unused.

* WebKit.xcodeproj/project.pbxproj: Made the creation of symbolic links inside the
  framework’s XPCServices directory predicated on whether this is an install build, rather
  than on the build configuration, for consistency with the condition used in the .xcconfig.

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

9 months ago[JSC] Introduce DisposableCallSiteIndex to enforce type-safety
ysuzuki@apple.com [Mon, 17 Jun 2019 18:49:03 +0000 (18:49 +0000)]
[JSC] Introduce DisposableCallSiteIndex to enforce type-safety
https://bugs.webkit.org/show_bug.cgi?id=197378

Reviewed by Saam Barati.

JSTests:

* stress/disposable-call-site-index-with-call-and-this.js: Added.
(foo):
(bar):
* stress/disposable-call-site-index.js: Added.
(foo):
(bar):

Source/JavaScriptCore:

Some of CallSiteIndex are disposable. This is because some of CallSiteIndex are allocated and freed at runtime (not DFG/FTL compile time).
The example is CallSiteIndex for exception handler in GCAwareJITStubRoutineWithExceptionHandler. If we do not allocate and free CallSiteIndex,
we will create a new CallSiteIndex continuously and leak memory.

The other CallSiteIndex are not simply disposable because the ownership model is not unique one. They can be shared between multiple clients.
But not disposing them is OK because they are static one: they are allocated when compiling DFG/FTL, and we do not allocate such CallSiteIndex
at runtime.

To make this difference explicit and avoid disposing non-disposable CallSiteIndex accidentally, we introduce DisposableCallSiteIndex type, and
enforce type-safety to some degree.

We also correctly update the DisposableCallSiteIndex => CodeOrigin table when we are reusing the previously used DisposableCallSiteIndex.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::newExceptionHandlingCallSiteIndex):
(JSC::CodeBlock::removeExceptionHandlerForCallSite):
* bytecode/CodeBlock.h:
* bytecode/PolymorphicAccess.cpp:
(JSC::AccessGenerationState::callSiteIndexForExceptionHandling):
(JSC::PolymorphicAccess::regenerate):
* bytecode/PolymorphicAccess.h:
(JSC::AccessGenerationState::callSiteIndexForExceptionHandling): Deleted.
* dfg/DFGCommonData.cpp:
(JSC::DFG::CommonData::addUniqueCallSiteIndex):
(JSC::DFG::CommonData::addDisposableCallSiteIndex):
(JSC::DFG::CommonData::removeDisposableCallSiteIndex):
(JSC::DFG::CommonData::removeCallSiteIndex): Deleted.
* dfg/DFGCommonData.h:
* interpreter/CallFrame.h:
(JSC::DisposableCallSiteIndex::DisposableCallSiteIndex):
(JSC::DisposableCallSiteIndex::fromCallSiteIndex):
* jit/GCAwareJITStubRoutine.cpp:
(JSC::GCAwareJITStubRoutineWithExceptionHandler::GCAwareJITStubRoutineWithExceptionHandler):
(JSC::GCAwareJITStubRoutineWithExceptionHandler::observeZeroRefCount):
(JSC::createJITStubRoutine):
* jit/GCAwareJITStubRoutine.h:
* jit/JITInlineCacheGenerator.h:

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

9 months ago[WASM-References] Add support for Funcref in parameters and return types
justin_michaud@apple.com [Mon, 17 Jun 2019 18:44:18 +0000 (18:44 +0000)]
[WASM-References] Add support for Funcref in parameters and return types
https://bugs.webkit.org/show_bug.cgi?id=198157

Reviewed by Yusuke Suzuki.

JSTests:

* wasm/Builder.js:
(export.default.Builder.prototype._registerSectionBuilders.const.section.in.WASM.description.section.switch.section.case.string_appeared_here.this.section):
* wasm/references/anyref_globals.js:
* wasm/references/func_ref.js: Added.
(fullGC.gc.makeExportedFunction):
(makeExportedIdent):
(makeAnyfuncIdent):
(fun):
(assert.eq.instance.exports.fix.fun):
(assert.eq.instance.exports.fix):
(string_appeared_here.End.End.Function.End.Code.End.WebAssembly.imp.ref):
(string_appeared_here.End.End.Function.End.Code.End.WebAssembly):
(GetLocal.0.I32Const.0.TableSet.End.End.WebAssembly.fun):
(GetLocal.0.I32Const.0.TableSet.End.End.WebAssembly.assert.throws):
(GetLocal.0.I32Const.0.TableSet.End.End.WebAssembly):
(assert.throws):
(assert.throws.doTest):
(let.importedFun.of):
(makeAnyfuncIdent.fun):
* wasm/references/validation.js:
(assert.throws):
* wasm/wasm.json:

Source/JavaScriptCore:

Add support for funcref in parameters, globals, and in table.get/set. When converting a JSValue to
a funcref (nee anyfunc), we first make sure it is an exported wasm function or null.

We also add support for Ref.func. Anywhere a Ref.func is used, (statically) we construct a JS wrapper
for it so that we never need to construct JSValues when handling references. This should make threads
easier to implement.

Finally, we add some missing bounds checks for table.get/set.

* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::tmpForType):
(JSC::Wasm::AirIRGenerator::moveOpForValueType):
(JSC::Wasm::AirIRGenerator::AirIRGenerator):
(JSC::Wasm::AirIRGenerator::addLocal):
(JSC::Wasm::AirIRGenerator::addConstant):
(JSC::Wasm::AirIRGenerator::addRefFunc):
(JSC::Wasm::AirIRGenerator::addTableSet):
(JSC::Wasm::AirIRGenerator::setGlobal):
(JSC::Wasm::AirIRGenerator::addReturn):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::addLocal):
(JSC::Wasm::B3IRGenerator::addTableSet):
(JSC::Wasm::B3IRGenerator::addRefFunc):
(JSC::Wasm::B3IRGenerator::setGlobal):
* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::compileFunctions):
* wasm/WasmCallingConvention.h:
(JSC::Wasm::CallingConventionAir::marshallArgument const):
(JSC::Wasm::CallingConventionAir::setupCall const):
* wasm/WasmExceptionType.h:
* wasm/WasmFormat.h:
(JSC::Wasm::isValueType):
(JSC::Wasm::isSubtype):
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::parseExpression):
(JSC::Wasm::FunctionParser<Context>::parseUnreachableExpression):
* wasm/WasmInstance.cpp:
(JSC::Wasm::Instance::Instance):
(JSC::Wasm::Instance::getFunctionWrapper const):
(JSC::Wasm::Instance::setFunctionWrapper):
* wasm/WasmInstance.h:
* wasm/WasmModuleInformation.h:
(JSC::Wasm::ModuleInformation::referencedFunctions const):
(JSC::Wasm::ModuleInformation::addReferencedFunction const):
* wasm/WasmSectionParser.cpp:
(JSC::Wasm::SectionParser::parseGlobal):
(JSC::Wasm::SectionParser::parseInitExpr):
* wasm/WasmValidate.cpp:
(JSC::Wasm::Validate::addTableGet):
(JSC::Wasm::Validate::addTableSet):
(JSC::Wasm::Validate::addRefIsNull):
(JSC::Wasm::Validate::addRefFunc):
(JSC::Wasm::Validate::setLocal):
(JSC::Wasm::Validate::addCall):
(JSC::Wasm::Validate::addCallIndirect):
* wasm/js/JSToWasm.cpp:
(JSC::Wasm::createJSToWasmWrapper):
* wasm/js/JSWebAssemblyHelpers.h:
(JSC::isWebAssemblyHostFunction):
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::visitChildren):
* wasm/js/JSWebAssemblyRuntimeError.cpp:
(JSC::createJSWebAssemblyRuntimeError):
* wasm/js/JSWebAssemblyRuntimeError.h:
* wasm/js/WasmToJS.cpp:
(JSC::Wasm::handleBadI64Use):
(JSC::Wasm::wasmToJS):
(JSC::Wasm::emitWasmToJSException):
* wasm/js/WasmToJS.h:
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):
* wasm/wasm.json:

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

9 months agoAdd missing test result after r246471. EWS didn't show any failure when it was missing.
simon.fraser@apple.com [Mon, 17 Jun 2019 18:29:30 +0000 (18:29 +0000)]
Add missing test result after r246471. EWS didn't show any failure when it was missing.

* compositing/overflow/composited-scrolling-paint-phases-expected.txt: Added.

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

9 months agoWeb Inspector: Sources: searching doesn't use the case sensitive or regex global...
drousso@apple.com [Mon, 17 Jun 2019 18:28:03 +0000 (18:28 +0000)]
Web Inspector: Sources: searching doesn't use the case sensitive or regex global settings
https://bugs.webkit.org/show_bug.cgi?id=198897

Reviewed by Joseph Pecoraro.

* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.customPerformSearch):

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

9 months agoSupport using ANGLE as the backend for the WebGL implementation
dino@apple.com [Mon, 17 Jun 2019 18:25:19 +0000 (18:25 +0000)]
Support using ANGLE as the backend for the WebGL implementation
https://bugs.webkit.org/show_bug.cgi?id=197755

Patch by Kenneth Russell <kbr@chromium.org> on 2019-06-17
Reviewed by Dean Jackson.

Source/ThirdParty/ANGLE:

Add a build step which processes ANGLE's copied public headers so they
can all be referred to under the <ANGLE/xyz.h> prefix. This avoids
touching ANGLE's headers and allows WebCore to include them with no
additional include path modifications.

* ANGLE.xcodeproj/project.pbxproj:
* adjust-angle-include-paths.sh: Added.

Source/WebCore:

Add new files supplying an ANGLE version of GraphicsContext3D and
Extensions3D, conditionalized under USE_ANGLE. Update Xcode project to
build these files. This option compiles and links successfully.

FIXMEs remain in several common files which will be addressed in
subsequent patches.

This work will be tested with the preexisting WebGL conformance
suite.

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/ANGLEWebKitBridge.h:
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/GraphicsContext3DManager.cpp:
(WebCore::GraphicsContext3DManager::updateAllContexts):
(WebCore::GraphicsContext3DManager::updateHighPerformanceState):
(WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired):
* platform/graphics/angle/Extensions3DANGLE.cpp: Copied from Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp.
(WebCore::Extensions3DANGLE::Extensions3DANGLE):
(WebCore::Extensions3DANGLE::supports):
(WebCore::Extensions3DANGLE::ensureEnabled):
(WebCore::Extensions3DANGLE::isEnabled):
(WebCore::Extensions3DANGLE::getGraphicsResetStatusARB):
(WebCore::Extensions3DANGLE::getTranslatedShaderSourceANGLE):
(WebCore::Extensions3DANGLE::initializeAvailableExtensions):
(WebCore::Extensions3DANGLE::readnPixelsEXT):
(WebCore::Extensions3DANGLE::getnUniformfvEXT):
(WebCore::Extensions3DANGLE::getnUniformivEXT):
(WebCore::Extensions3DANGLE::blitFramebuffer):
(WebCore::Extensions3DANGLE::renderbufferStorageMultisample):
(WebCore::Extensions3DANGLE::createVertexArrayOES):
(WebCore::Extensions3DANGLE::deleteVertexArrayOES):
(WebCore::Extensions3DANGLE::isVertexArrayOES):
(WebCore::Extensions3DANGLE::bindVertexArrayOES):
(WebCore::Extensions3DANGLE::insertEventMarkerEXT):
(WebCore::Extensions3DANGLE::pushGroupMarkerEXT):
(WebCore::Extensions3DANGLE::popGroupMarkerEXT):
(WebCore::Extensions3DANGLE::supportsExtension):
(WebCore::Extensions3DANGLE::drawBuffersEXT):
(WebCore::Extensions3DANGLE::drawArraysInstanced):
(WebCore::Extensions3DANGLE::drawElementsInstanced):
(WebCore::Extensions3DANGLE::vertexAttribDivisor):
(WebCore::Extensions3DANGLE::getExtensions):
* platform/graphics/angle/Extensions3DANGLE.h: Added.
* platform/graphics/angle/GraphicsContext3DANGLE.cpp: Copied from Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp.
(WebCore::GraphicsContext3D::releaseShaderCompiler):
(WebCore::wipeAlphaChannelFromPixels):
(WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary):
(WebCore::GraphicsContext3D::validateAttributes):
(WebCore::GraphicsContext3D::reshapeFBOs):
(WebCore::GraphicsContext3D::attachDepthAndStencilBufferIfNeeded):
(WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
(WebCore::GraphicsContext3D::renderbufferStorage):
(WebCore::GraphicsContext3D::getIntegerv):
(WebCore::GraphicsContext3D::getShaderPrecisionFormat):
(WebCore::GraphicsContext3D::texImage2D):
(WebCore::GraphicsContext3D::depthRange):
(WebCore::GraphicsContext3D::clearDepth):
(WebCore::GraphicsContext3D::getExtensions):
(WebCore::GraphicsContext3D::readPixels):
(WebCore::setCurrentNameHashMapForShader):
(WebCore::nameHashForShader):
(WebCore::GraphicsContext3D::validateDepthStencil):
(WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
(WebCore::GraphicsContext3D::paintCompositedResultsToCanvas):
(WebCore::GraphicsContext3D::paintRenderingResultsToImageData):
(WebCore::GraphicsContext3D::prepareTexture):
(WebCore::GraphicsContext3D::readRenderingResults):
(WebCore::GraphicsContext3D::reshape):
(WebCore::GraphicsContext3D::checkVaryingsPacking const):
(WebCore::GraphicsContext3D::precisionsMatch const):
(WebCore::GraphicsContext3D::getInternalFramebufferSize const):
(WebCore::GraphicsContext3D::activeTexture):
(WebCore::GraphicsContext3D::attachShader):
(WebCore::GraphicsContext3D::bindAttribLocation):
(WebCore::GraphicsContext3D::bindBuffer):
(WebCore::GraphicsContext3D::bindFramebuffer):
(WebCore::GraphicsContext3D::bindRenderbuffer):
(WebCore::GraphicsContext3D::bindTexture):
(WebCore::GraphicsContext3D::blendColor):
(WebCore::GraphicsContext3D::blendEquation):
(WebCore::GraphicsContext3D::blendEquationSeparate):
(WebCore::GraphicsContext3D::blendFunc):
(WebCore::GraphicsContext3D::blendFuncSeparate):
(WebCore::GraphicsContext3D::bufferData):
(WebCore::GraphicsContext3D::bufferSubData):
(WebCore::GraphicsContext3D::mapBufferRange):
(WebCore::GraphicsContext3D::unmapBuffer):
(WebCore::GraphicsContext3D::copyBufferSubData):
(WebCore::GraphicsContext3D::getInternalformativ):
(WebCore::GraphicsContext3D::renderbufferStorageMultisample):
(WebCore::GraphicsContext3D::texStorage2D):
(WebCore::GraphicsContext3D::texStorage3D):
(WebCore::GraphicsContext3D::getActiveUniforms):
(WebCore::GraphicsContext3D::checkFramebufferStatus):
(WebCore::GraphicsContext3D::clearColor):
(WebCore::GraphicsContext3D::clear):
(WebCore::GraphicsContext3D::clearStencil):
(WebCore::GraphicsContext3D::colorMask):
(WebCore::GraphicsContext3D::compileShader):
(WebCore::GraphicsContext3D::compileShaderDirect):
(WebCore::GraphicsContext3D::copyTexImage2D):
(WebCore::GraphicsContext3D::copyTexSubImage2D):
(WebCore::GraphicsContext3D::cullFace):
(WebCore::GraphicsContext3D::depthFunc):
(WebCore::GraphicsContext3D::depthMask):
(WebCore::GraphicsContext3D::detachShader):
(WebCore::GraphicsContext3D::disable):
(WebCore::GraphicsContext3D::disableVertexAttribArray):
(WebCore::GraphicsContext3D::drawArrays):
(WebCore::GraphicsContext3D::drawElements):
(WebCore::GraphicsContext3D::enable):
(WebCore::GraphicsContext3D::enableVertexAttribArray):
(WebCore::GraphicsContext3D::finish):
(WebCore::GraphicsContext3D::flush):
(WebCore::GraphicsContext3D::framebufferRenderbuffer):
(WebCore::GraphicsContext3D::framebufferTexture2D):
(WebCore::GraphicsContext3D::frontFace):
(WebCore::GraphicsContext3D::generateMipmap):
(WebCore::GraphicsContext3D::getActiveAttribImpl):
(WebCore::GraphicsContext3D::getActiveAttrib):
(WebCore::GraphicsContext3D::getActiveUniformImpl):
(WebCore::GraphicsContext3D::getActiveUniform):
(WebCore::GraphicsContext3D::getAttachedShaders):
(WebCore::generateHashedName):
(WebCore::GraphicsContext3D::mappedSymbolInShaderSourceMap):
(WebCore::GraphicsContext3D::mappedSymbolName):
(WebCore::GraphicsContext3D::originalSymbolInShaderSourceMap):
(WebCore::GraphicsContext3D::originalSymbolName):
(WebCore::GraphicsContext3D::getAttribLocation):
(WebCore::GraphicsContext3D::getAttribLocationDirect):
(WebCore::GraphicsContext3D::getContextAttributes):
(WebCore::GraphicsContext3D::moveErrorsToSyntheticErrorList):
(WebCore::GraphicsContext3D::getError):
(WebCore::GraphicsContext3D::getString):
(WebCore::GraphicsContext3D::hint):
(WebCore::GraphicsContext3D::isBuffer):
(WebCore::GraphicsContext3D::isEnabled):
(WebCore::GraphicsContext3D::isFramebuffer):
(WebCore::GraphicsContext3D::isProgram):
(WebCore::GraphicsContext3D::isRenderbuffer):
(WebCore::GraphicsContext3D::isShader):
(WebCore::GraphicsContext3D::isTexture):
(WebCore::GraphicsContext3D::lineWidth):
(WebCore::GraphicsContext3D::linkProgram):
(WebCore::GraphicsContext3D::pixelStorei):
(WebCore::GraphicsContext3D::polygonOffset):
(WebCore::GraphicsContext3D::sampleCoverage):
(WebCore::GraphicsContext3D::scissor):
(WebCore::GraphicsContext3D::shaderSource):
(WebCore::GraphicsContext3D::stencilFunc):
(WebCore::GraphicsContext3D::stencilFuncSeparate):
(WebCore::GraphicsContext3D::stencilMask):
(WebCore::GraphicsContext3D::stencilMaskSeparate):
(WebCore::GraphicsContext3D::stencilOp):
(WebCore::GraphicsContext3D::stencilOpSeparate):
(WebCore::GraphicsContext3D::texParameterf):
(WebCore::GraphicsContext3D::texParameteri):
(WebCore::GraphicsContext3D::uniform1f):
(WebCore::GraphicsContext3D::uniform1fv):
(WebCore::GraphicsContext3D::uniform2f):
(WebCore::GraphicsContext3D::uniform2fv):
(WebCore::GraphicsContext3D::uniform3f):
(WebCore::GraphicsContext3D::uniform3fv):
(WebCore::GraphicsContext3D::uniform4f):
(WebCore::GraphicsContext3D::uniform4fv):
(WebCore::GraphicsContext3D::uniform1i):
(WebCore::GraphicsContext3D::uniform1iv):
(WebCore::GraphicsContext3D::uniform2i):
(WebCore::GraphicsContext3D::uniform2iv):
(WebCore::GraphicsContext3D::uniform3i):
(WebCore::GraphicsContext3D::uniform3iv):
(WebCore::GraphicsContext3D::uniform4i):
(WebCore::GraphicsContext3D::uniform4iv):
(WebCore::GraphicsContext3D::uniformMatrix2fv):
(WebCore::GraphicsContext3D::uniformMatrix3fv):
(WebCore::GraphicsContext3D::uniformMatrix4fv):
(WebCore::GraphicsContext3D::useProgram):
(WebCore::GraphicsContext3D::validateProgram):
(WebCore::GraphicsContext3D::vertexAttrib1f):
(WebCore::GraphicsContext3D::vertexAttrib1fv):
(WebCore::GraphicsContext3D::vertexAttrib2f):
(WebCore::GraphicsContext3D::vertexAttrib2fv):
(WebCore::GraphicsContext3D::vertexAttrib3f):
(WebCore::GraphicsContext3D::vertexAttrib3fv):
(WebCore::GraphicsContext3D::vertexAttrib4f):
(WebCore::GraphicsContext3D::vertexAttrib4fv):
(WebCore::GraphicsContext3D::vertexAttribPointer):
(WebCore::GraphicsContext3D::viewport):
(WebCore::GraphicsContext3D::createVertexArray):
(WebCore::GraphicsContext3D::deleteVertexArray):
(WebCore::GraphicsContext3D::isVertexArray):
(WebCore::GraphicsContext3D::bindVertexArray):
(WebCore::GraphicsContext3D::getBooleanv):
(WebCore::GraphicsContext3D::getBufferParameteriv):
(WebCore::GraphicsContext3D::getFloatv):
(WebCore::GraphicsContext3D::getInteger64v):
(WebCore::GraphicsContext3D::getFramebufferAttachmentParameteriv):
(WebCore::GraphicsContext3D::getProgramiv):
(WebCore::GraphicsContext3D::getNonBuiltInActiveSymbolCount):
(WebCore::GraphicsContext3D::getUnmangledInfoLog):
(WebCore::GraphicsContext3D::getProgramInfoLog):
(WebCore::GraphicsContext3D::getRenderbufferParameteriv):
(WebCore::GraphicsContext3D::getShaderiv):
(WebCore::GraphicsContext3D::getShaderInfoLog):
(WebCore::GraphicsContext3D::getShaderSource):
(WebCore::GraphicsContext3D::getTexParameterfv):
(WebCore::GraphicsContext3D::getTexParameteriv):
(WebCore::GraphicsContext3D::getUniformfv):
(WebCore::GraphicsContext3D::getUniformiv):
(WebCore::GraphicsContext3D::getUniformLocation):
(WebCore::GraphicsContext3D::getVertexAttribfv):
(WebCore::GraphicsContext3D::getVertexAttribiv):
(WebCore::GraphicsContext3D::getVertexAttribOffset):
(WebCore::GraphicsContext3D::texSubImage2D):
(WebCore::GraphicsContext3D::compressedTexImage2D):
(WebCore::GraphicsContext3D::compressedTexSubImage2D):
(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):
(WebCore::GraphicsContext3D::markContextChanged):
(WebCore::GraphicsContext3D::markLayerComposited):
(WebCore::GraphicsContext3D::layerComposited const):
(WebCore::GraphicsContext3D::forceContextLost):
(WebCore::GraphicsContext3D::recycleContext):
(WebCore::GraphicsContext3D::dispatchContextChangedNotification):
(WebCore::GraphicsContext3D::texImage2DDirect):
(WebCore::GraphicsContext3D::drawArraysInstanced):
(WebCore::GraphicsContext3D::drawElementsInstanced):
(WebCore::GraphicsContext3D::vertexAttribDivisor):
* platform/graphics/angle/TemporaryANGLESetting.cpp: Added.
(WebCore::TemporaryANGLESetting::TemporaryANGLESetting):
(WebCore::TemporaryANGLESetting::~TemporaryANGLESetting):
* platform/graphics/angle/TemporaryANGLESetting.h: Added.
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::~GraphicsContext3D):
(WebCore::GraphicsContext3D::makeContextCurrent):
(WebCore::GraphicsContext3D::checkGPUStatus):
(WebCore::GraphicsContext3D::screenDidChange):
* platform/graphics/cocoa/WebGLLayer.h:
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer display]):
* platform/graphics/cv/TextureCacheCV.mm:
(WebCore::TextureCacheCV::create):
(WebCore::TextureCacheCV::textureFromImage):
* platform/graphics/cv/VideoTextureCopierCV.cpp:
(WebCore::enumToStringMap):
(WebCore::VideoTextureCopierCV::initializeContextObjects):
(WebCore::VideoTextureCopierCV::initializeUVContextObjects):
(WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
(WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):
* platform/graphics/opengl/Extensions3DOpenGL.cpp:
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:

Source/WTF:

Add a USE_ANGLE definition to wtf/Platform.h (currently disabled)
which, when enabled, uses ANGLE instead of the OpenGL or OpenGL ES
backend.

* wtf/Platform.h:

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

9 months agoEnsure ITP state is relayed to Network Process on restart
bfulgham@apple.com [Mon, 17 Jun 2019 17:41:39 +0000 (17:41 +0000)]
Ensure ITP state is relayed to Network Process on restart
https://bugs.webkit.org/show_bug.cgi?id=198797
<rdar://problem/51646944>

Reviewed by Youenn Fablet.

Source/WebKit:

Now that the ITP state is maintained in the Network Process, we have to make sure that we update
that process with current ITP state if the Network Process crashes and is relaunched. This wasn't a
problem in earlier releases because we tracked all ITP state in the UIProcess.

This patch does the following:
1. Add a new method to WKWebsiteDataStore to allow us to trigger statistics processing, which has the
   side effect of syncing ITP state persistently so that it will be available after bouncing the process.
2. Adds a new test that sets a tracking domain, bounces the process, and confirms the state is still
   consistent.

Tested by TestWebKitAPI.

* NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
(WebKit::ResourceLoadStatisticsStore::processStatisticsAndDataRecords):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _clearPrevalentDomain:completionHandler:]):
(-[WKWebsiteDataStore _processStatisticsAndDataRecords:]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::setResourceLoadStatisticsEnabled):
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm:
(cleanupITPDatabase): Added.
(TEST:EnableDisableITP): Update to use cleanup method.
(TEST:NetworkProcessRestart): Added.

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

9 months agoUpdate test262 tests (2019.06.13)
ross.kirsling@sony.com [Mon, 17 Jun 2019 17:28:43 +0000 (17:28 +0000)]
Update test262 tests (2019.06.13)
https://bugs.webkit.org/show_bug.cgi?id=198821

Reviewed by Konstantin Tokarev.

* test262/expectations.yaml:
* test262/harness/:
* test262/latest-changes-summary.txt:
* test262/test/:
* test262/test262-Revision.txt:

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

9 months agoNew EWS can't process patches larger than 640kb
aakash_jain@apple.com [Mon, 17 Jun 2019 16:31:38 +0000 (16:31 +0000)]
New EWS can't process patches larger than 640kb
https://bugs.webkit.org/show_bug.cgi?id=198851

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/master.cfg: Increase the patch size limit to 100 MB.

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

9 months agowebkitpy: Add macOS Catalina, iOS 13
jbedard@apple.com [Mon, 17 Jun 2019 15:33:14 +0000 (15:33 +0000)]
webkitpy: Add macOS Catalina, iOS 13
https://bugs.webkit.org/show_bug.cgi?id=198492

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/Catalina.png: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/Catalina@2x.png: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/IOS13.png: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/IOS13@2x.png: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/IOS13Simulator.png: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Images/IOS13Simulator@2x.png: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Dashboard.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Main.css:
* BuildSlaveSupport/ews-build/steps.py:
* Scripts/webkitpy/common/version_name_map.py:
* Scripts/webkitpy/common/version_name_map_unittest.py:
* Scripts/webkitpy/layout_tests/models/test_expectations.py:
* TestResultServer/static-dashboards/flakiness_dashboard.js:

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

9 months ago[GTK] Stop accessing GdkEvent fields when possible
commit-queue@webkit.org [Mon, 17 Jun 2019 15:01:09 +0000 (15:01 +0000)]
[GTK] Stop accessing GdkEvent fields when possible
https://bugs.webkit.org/show_bug.cgi?id=198829

Patch by Ludovico de Nittis <ludovico.denittis@collabora.com> on 2019-06-17
Reviewed by Michael Catanzaro.

Direct access to GdkEvent structs is no longer possible in GTK 4.

Source/WebCore:

No behaviour changes.

* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::eventTypeForGdkKeyEvent):
(WebCore::modifiersForGdkKeyEvent):
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
* platform/gtk/PlatformMouseEventGtk.cpp:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):

Source/WebKit:

* Shared/gtk/WebEventFactory.cpp:
(WebKit::buttonForEvent):
(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::WebEventFactory::createWebWheelEvent):
(WebKit::WebEventFactory::createWebKeyboardEvent):
(WebKit::WebEventFactory::createWebTouchEvent):
* UIProcess/API/gtk/WebKitEmojiChooser.cpp:
* UIProcess/API/gtk/WebKitScriptDialogImpl.cpp:
(webkitScriptDialogImplKeyPressEvent):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(ClickCounter::currentClickCountForGdkButtonEvent):
(webkitWebViewBaseKeyPressEvent):
(webkitWebViewBaseHandleMouseEvent):
(webkitWebViewBaseCrossingNotifyEvent):
(webkitWebViewBaseGetTouchPointsForEvent):
(webkitWebViewBaseTouchEvent):
(webkitWebViewBaseEvent):
* UIProcess/gtk/GestureController.cpp:
(WebKit::GestureController::handleEvent):
* UIProcess/gtk/InputMethodFilter.cpp:
(WebKit::InputMethodFilter::filterKeyEvent):
(WebKit::InputMethodFilter::logHandleKeyboardEventForTesting):
(WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting):
* UIProcess/gtk/KeyBindingTranslator.cpp:
(WebKit::KeyBindingTranslator::commandsForKeyEvent):
* UIProcess/gtk/ViewGestureControllerGtk.cpp:
(WebKit::isEventStop):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas):
(WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
* UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
(WebKit::WebPopupMenuProxyGtk::treeViewButtonReleaseEventCallback):
(WebKit::WebPopupMenuProxyGtk::keyPressEventCallback):

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

9 months agoUnreviewed. Update OptionsGTK.cmake and NEWS for 2.25.2 release
carlosgc@webkit.org [Mon, 17 Jun 2019 09:16:35 +0000 (09:16 +0000)]
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.25.2 release

.:

* Source/cmake/OptionsGTK.cmake: Bump version numbers

Source/WebKit:

* gtk/NEWS: Add release notes for 2.25.2.

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

9 months agoUnreviewed, rolling out r246467.
carlosgc@webkit.org [Mon, 17 Jun 2019 08:52:29 +0000 (08:52 +0000)]
Unreviewed, rolling out r246467.

It broke scrolling with mouse wheel

Reverted changeset:

"[GTK] Stop accessing GdkEvent fields when possible"
https://bugs.webkit.org/show_bug.cgi?id=198829
https://trac.webkit.org/changeset/246467

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

9 months agoUnreviewed. [GTK] Bump WPEBackend-fdo requirement to 1.3.1
carlosgc@webkit.org [Mon, 17 Jun 2019 08:33:50 +0000 (08:33 +0000)]
Unreviewed. [GTK] Bump WPEBackend-fdo requirement to 1.3.1

.:

* Source/cmake/OptionsGTK.cmake:

Tools:

* gtk/jhbuild.modules:
* gtk/patches/wpebackend-fdo-Handle-the-case-of-new-target-created-for-the-same-v.patch: Removed.
* gtk/wpebackend-fdo-view-backend-exportable-private-don-t-double-free-ca.patch: Removed.

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

9 months ago[LFC] Expand tests coverage (325 new tests -> 1198).
zalan@apple.com [Mon, 17 Jun 2019 05:04:55 +0000 (05:04 +0000)]
[LFC] Expand tests coverage (325 new tests -> 1198).

* LayoutReloaded/misc/LFC-passing-tests.txt:

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

9 months agoConvert some uses of fixed width and fixed precision floating point formatting to...
darin@apple.com [Mon, 17 Jun 2019 01:59:28 +0000 (01:59 +0000)]
Convert some uses of fixed width and fixed precision floating point formatting to use shortest instead
https://bugs.webkit.org/show_bug.cgi?id=198896

Reviewed by Sam Weinig.

Source/WebCore:

* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::loggingString const): Removed unneeded use of
FormattedNumber::fixedWidth to override the default shortest-form formatting.
* page/History.cpp:
(WebCore::History::stateObjectAdded): Ditto.

* page/PrintContext.cpp:
(WebCore::PrintContext::pageProperty): Use String::number instead of
String::numberToStringFixedPrecision. Also removed some uses of
FormattedNumber::fixedPrecision.
* platform/graphics/FloatPolygon.cpp:
(WebCore::FloatPolygonEdge::debugString const): Ditto.

LayoutTests:

* fast/loader/stateobjects/pushstate-frequency-expected.txt:
* fast/loader/stateobjects/pushstate-frequency-iframe-expected.txt:
* fast/loader/stateobjects/replacestate-frequency-expected.txt:
* fast/loader/stateobjects/replacestate-frequency-iframe-expected.txt:
Updated to expect cleaner output without ".000000".

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

9 months agoRename AtomicString to AtomString
darin@apple.com [Mon, 17 Jun 2019 01:48:13 +0000 (01:48 +0000)]
Rename AtomicString to AtomString
https://bugs.webkit.org/show_bug.cgi?id=195276

Reviewed by Michael Catanzaro.

* many files: Let do-webcore-rename do the renaming.
Source/WTF:

* wtf/text/AtomString.h: After renaming, added AtomicString as a synonym for
now; helps smooth things over with a tiny bit of Apple internal software so
we don't have to do this all at once. Can remove it soon.

Tools:

* Scripts/do-webcore-rename: Updated with a list of all the identifiers
that mention "atomic string" and changed them to instead say "atom string".

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

9 months ago[MediaStream] Avoid roundoff error when setting AVCapture min/max frame rate
eric.carlson@apple.com [Mon, 17 Jun 2019 01:38:51 +0000 (01:38 +0000)]
[MediaStream] Avoid roundoff error when setting AVCapture min/max frame rate
https://bugs.webkit.org/show_bug.cgi?id=198875
<rdar://problem/51768374>

Reviewed by Youenn Fablet.

Source/WebCore:

* platform/graphics/MediaPlayer.h:
(WTF::LogArgument<MediaTime>::toString): Deleted, moved to MediaTime.h.
(WTF::LogArgument<MediaTimeRange>::toString): Deleted, moved to MediaTime.h.

* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate): Avoid roundoff error.

Source/WTF:

* wtf/MediaTime.h:
(WTF::LogArgument<MediaTime>::toString):
(WTF::LogArgument<MediaTimeRange>::toString):

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

9 months agoImplement ScrollableArea::scrollOffset()
simon.fraser@apple.com [Mon, 17 Jun 2019 00:33:32 +0000 (00:33 +0000)]
Implement ScrollableArea::scrollOffset()
https://bugs.webkit.org/show_bug.cgi?id=198895

Reviewed by Antti Koivisto.

Source/WebCore:

Remove from ScrollableArea the following:
    virtual int scrollSize(ScrollbarOrientation) const = 0;
    virtual int scrollOffset(ScrollbarOrientation) const = 0;
and instead implement ScrollOffset scrollOffset() const.

Also make scrollPosition() pure virtual, avoiding the reverse dependency where
this base class implementation got values from scrollbars.

scrollSize(ScrollbarOrientation) was only used by ScrollAnimatorIOS and we can
do the same computation via min/max scroll positions.

RenderListBox and PopupMenuWin need implementations of scrollPosition().

Remove some PLATFORM(IOS_FAMILY) #ifdefs from ScrollableArea for code that compiles
on all platforms.

* page/FrameView.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::overhangAmount const):
(WebCore::ScrollView::scrollSize const): Deleted.
(WebCore::ScrollView::scrollOffset const): Deleted.
* platform/ScrollView.h:
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::isPinnedVerticallyInDirection const):
(WebCore::ScrollableArea::scrollOffset const):
(WebCore::ScrollableArea::scrollPosition const): Deleted.
* platform/ScrollableArea.h:
(WebCore::offsetForOrientation):
(WebCore::ScrollableArea::isHorizontalScrollerPinnedToMinimumPosition const):
(WebCore::ScrollableArea::isHorizontalScrollerPinnedToMaximumPosition const):
(WebCore::ScrollableArea::isVerticalScrollerPinnedToMinimumPosition const):
(WebCore::ScrollableArea::isVerticalScrollerPinnedToMaximumPosition const):
(WebCore::ScrollableArea::tiledBacking const): Deleted.
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::Scrollbar):
(WebCore::Scrollbar::offsetDidChange):
* platform/ios/ScrollAnimatorIOS.mm:
(WebCore::ScrollAnimatorIOS::handleTouchEvent):
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::scrollPosition const):
(WebCore::PopupMenuWin::wndProc):
(WebCore::PopupMenuWin::scrollSize const): Deleted.
(WebCore::PopupMenuWin::scrollOffset const): Deleted.
* platform/win/PopupMenuWin.h:
(WebCore::PopupMenuWin::scrollOffset const): Deleted.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollSize const): Deleted.
(WebCore::RenderLayer::scrollOffset const): Deleted.
* rendering/RenderLayer.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::scrollPosition const):
(WebCore::RenderListBox::scrollSize const): Deleted.
(WebCore::RenderListBox::scrollOffset const): Deleted.
* rendering/RenderListBox.h:

Source/WebKit:

* UIProcess/win/WebPopupMenuProxyWin.cpp:
(WebKit::PopupMenuWin::scrollPosition const):
(WebKit::WebPopupMenuProxyWin::onKeyDown): Just use m_scrollOffset.
(WebKit::WebPopupMenuProxyWin::scrollSize const): Deleted.
* UIProcess/win/WebPopupMenuProxyWin.h: Remove the one-axis scrollOffset()
* WebProcess/Plugins/PDF/PDFPlugin.h:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::scrollSize const): Deleted.
(WebKit::PDFPlugin::scrollOffset const): Deleted.
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):

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

9 months ago[JSC] Grown region of WasmTable should be initialized with null
ysuzuki@apple.com [Sun, 16 Jun 2019 22:06:29 +0000 (22:06 +0000)]
[JSC] Grown region of WasmTable should be initialized with null
https://bugs.webkit.org/show_bug.cgi?id=198903

Reviewed by Saam Barati.

JSTests:

* wasm/stress/wasm-table-grow-initialize.js: Added.
(shouldBe):

Source/JavaScriptCore:

Grown region of Wasmtable is now empty. We should initialize it with null.
We also rename Wasm::Table::visitChildren to Wasm::Table::visitAggregate to
align to the naming convention.

* wasm/WasmTable.cpp:
(JSC::Wasm::Table::grow):
(JSC::Wasm::Table::visitAggregate):
(JSC::Wasm::Table::visitChildren): Deleted.
* wasm/WasmTable.h:
* wasm/js/JSWebAssemblyTable.cpp:
(JSC::JSWebAssemblyTable::visitChildren):

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

9 months agoAddress Sam's post-landing review of r246234.
zalan@apple.com [Sun, 16 Jun 2019 21:04:41 +0000 (21:04 +0000)]
Address Sam's post-landing review of r246234.

* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):

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

9 months ago[LFC] Unreviewed test gardening.
zalan@apple.com [Sun, 16 Jun 2019 20:51:48 +0000 (20:51 +0000)]
[LFC] Unreviewed test gardening.

Unsupported alignments.

fast/inline/absolute-positioned-inline-in-centred-block.html -align: center
fast/borders/empty-outline-border-assert.html -vertical-align: super
css2.1/20110323/vertical-align-boxes-001.htm - vertical-align: middle

* LayoutReloaded/misc/LFC-passing-tests.txt:

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

9 months ago[LFC][IFC] Decouple baseline ascent/descent and baseline offset.
zalan@apple.com [Sun, 16 Jun 2019 20:41:59 +0000 (20:41 +0000)]
[LFC][IFC] Decouple baseline ascent/descent and baseline offset.
https://bugs.webkit.org/show_bug.cgi?id=198901
<rdar://problem/51782393>

Reviewed by Antti Koivisto.

Baseline offset is the baseline's distance from the line's logical top -and it is not necessarily the same as the baseline's ascent.
It's easier to track the baseline and its top separately since certain properties only change one or the other.

* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
(WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::Line):
(WebCore::Layout::Line::close):
(WebCore::Layout::Line::adjustBaselineAndLineHeight):
(WebCore::Layout::Line::halfLeadingMetrics):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::Content::baselineOffset const):
(WebCore::Layout::Line::Content::setBaselineOffset):
(WebCore::Layout::Line::baselineOffset const):
* layout/inlineformatting/InlineLineBox.h:
(WebCore::Layout::LineBox::baselineOffset const):
(WebCore::Layout::LineBox::LineBox):

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

9 months ago[LFC][IFC] Intruding float may prevent adding any inline box
zalan@apple.com [Sun, 16 Jun 2019 20:19:24 +0000 (20:19 +0000)]
[LFC][IFC] Intruding float may prevent adding any inline box
https://bugs.webkit.org/show_bug.cgi?id=198891
<rdar://problem/51779956>

Reviewed by Antti Koivisto.

Take the intruding left/right float pair and find the vertical position where the next line might go
if these floats prevent us from adding even one inline box to the current line.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::mapPointToAncestor):
(WebCore::Layout::FormattingContext::mapPointToDescendent):
* layout/FormattingContext.h:
* layout/LayoutUnits.h:
(WebCore::Layout::Point::max):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
(WebCore::Layout::InlineFormattingContext::LineLayout::layout const):

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

9 months ago[LFC][Floats] Add bottom value to FloatingState::Constraints
zalan@apple.com [Sun, 16 Jun 2019 20:15:02 +0000 (20:15 +0000)]
[LFC][Floats] Add bottom value to FloatingState::Constraints
https://bugs.webkit.org/show_bug.cgi?id=198889
<rdar://problem/51776730>

Reviewed by Antti Koivisto.

Constraints::left/right->y indicates where this particular constrain ends. This is going to be used by inline layout to figure where
the next line should go (vertical position).

* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::constraints const):
* layout/floats/FloatingState.h:

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

9 months ago[LFC][IFC] Ignore descent when in limited/full quirks mode
zalan@apple.com [Sun, 16 Jun 2019 20:04:31 +0000 (20:04 +0000)]
[LFC][IFC] Ignore descent when in limited/full quirks mode
https://bugs.webkit.org/show_bug.cgi?id=198893
<rdar://problem/51780634>

Reviewed by Antti Koivisto.

In limited/full quirks mode, line's descent should be ignored when computing the final line height when
1. the line has baseline aligned content only and
2. these baseline aligned boxes don't have descent.

* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::isVisuallyEmpty const):
(WebCore::Layout::Line::close):

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

9 months ago[LFC][IFC] Line::isVisuallyEmpty should check inline-block boxes.
zalan@apple.com [Sun, 16 Jun 2019 20:02:17 +0000 (20:02 +0000)]
[LFC][IFC] Line::isVisuallyEmpty should check inline-block boxes.
https://bugs.webkit.org/show_bug.cgi?id=198894
<rdar://problem/51780886>

Reviewed by Antti Koivisto.

Non-zero width/height inline-block boxes make the line visually non-empty.

* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::isVisuallyEmpty const):

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

9 months ago[LFC] Add Layout::Box::isContainingBlockDescendantOf
zalan@apple.com [Sun, 16 Jun 2019 19:33:18 +0000 (19:33 +0000)]
[LFC] Add Layout::Box::isContainingBlockDescendantOf
https://bugs.webkit.org/show_bug.cgi?id=198888
<rdar://problem/51776466>

Reviewed by Antti Koivisto.

Box::isDescendantOf indicates simple ancestor - descendant relationship, while
isContainingBlockDescendantOf checks the containing block chain.

* layout/FormattingContext.cpp:
(WebCore::Layout::mapHorizontalPositionToAncestor):
(WebCore::Layout::FormattingContext::mapBoxToAncestor):
(WebCore::Layout::FormattingContext::mapTopToAncestor):
(WebCore::Layout::FormattingContext::mapPointToAncestor):
* layout/floats/FloatingState.h:
(WebCore::Layout::FloatingState::FloatItem::isDescendantOfFormattingRoot const):
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isDescendantOf const):
(WebCore::Layout::Box::isContainingBlockDescendantOf const):
* layout/layouttree/LayoutBox.h:

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

9 months ago[LFC][IFC] Remove Line::Content::isVisuallyEmpty
zalan@apple.com [Sun, 16 Jun 2019 19:32:52 +0000 (19:32 +0000)]
[LFC][IFC] Remove Line::Content::isVisuallyEmpty
https://bugs.webkit.org/show_bug.cgi?id=198892
<rdar://problem/51780345>

Reviewed by Antti Koivisto.

Instead of setting the isVisuallyEmpty flag, reset the line height to 0.

* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::close):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::Content::isEmpty const):
(WebCore::Layout::Line::Content::setBaseline):
(WebCore::Layout::Line::Content::isVisuallyEmpty const): Deleted.
(WebCore::Layout::Line::Content::setIsVisuallyEmpty): Deleted.

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

9 months ago[LFC] Add limited quirks mode to LayoutState.
zalan@apple.com [Sun, 16 Jun 2019 19:30:46 +0000 (19:30 +0000)]
[LFC] Add limited quirks mode to LayoutState.
https://bugs.webkit.org/show_bug.cgi?id=198881
<rdar://problem/51773229>

Reviewed by Antti Koivisto.

This is in preparation for introducing limited quirks mode to inline layout.

* layout/LayoutState.h:
(WebCore::Layout::LayoutState::setQuirksMode):
(WebCore::Layout::LayoutState::inQuirksMode const):
(WebCore::Layout::LayoutState::inLimitedQuirksMode const):
(WebCore::Layout::LayoutState::inNoQuirksMode const):
(WebCore::Layout::LayoutState::setInQuirksMode): Deleted.
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

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

9 months ago[LFC][IFC] Completely collapsed runs should not go to the trimmable run list.
zalan@apple.com [Sun, 16 Jun 2019 19:30:15 +0000 (19:30 +0000)]
[LFC][IFC] Completely collapsed runs should not go to the trimmable run list.
https://bugs.webkit.org/show_bug.cgi?id=198900
<rdar://problem/51782156>

Reviewed by Antti Koivisto.

* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::trailingTrimmableWidth const):
(WebCore::Layout::Line::appendTextContent):

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

9 months ago[LFC][IFC] Use the borderBox rect consistently to size the inline box.
zalan@apple.com [Sun, 16 Jun 2019 19:28:14 +0000 (19:28 +0000)]
[LFC][IFC] Use the borderBox rect consistently to size the inline box.
https://bugs.webkit.org/show_bug.cgi?id=198899

Reviewed by Antti Koivisto.
<rdar://problem/51781969>

Use the margin box height (when applicable) to adjust the line height and use the borderBox rect (or font size) height to size the inline box.

* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::borderBoxHeight const):
(WebCore::Display::Box::marginBoxHeight const):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::appendInlineContainerStart):
(WebCore::Layout::Line::appendTextContent):
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::inlineItemContentHeight const):
(WebCore::Layout::Line::inlineItemHeight const): Deleted.
* layout/inlineformatting/InlineLine.h:

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

9 months agoWebProcessPool::clearWebProcessHasUploads cannot assume its given processIdentifier...
youenn@apple.com [Sun, 16 Jun 2019 06:38:02 +0000 (06:38 +0000)]
WebProcessPool::clearWebProcessHasUploads cannot assume its given processIdentifier is valid
https://bugs.webkit.org/show_bug.cgi?id=198865

Unreviewed.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::clearWebProcessHasUploads):
Remove wrong debug assertion in case of WebProcessProxy destruction.

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

9 months agoMake layerTreeAsText() output a bit less verbose
simon.fraser@apple.com [Sun, 16 Jun 2019 05:33:28 +0000 (05:33 +0000)]
Make layerTreeAsText() output a bit less verbose
https://bugs.webkit.org/show_bug.cgi?id=198870

Reviewed by Tim Horton.

Source/WebCore:

"accelerates drawing" was getting dumped twice for debug dumps.
Only dump the non-default state for "uses display-list drawing".
Use the new OptionSet<> dumping for GraphicsLayerPaintingPhases.

* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::dumpProperties const):
(WebCore::operator<<):
* platform/graphics/GraphicsLayer.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):

LayoutTests:

* compositing/overflow/stacking-context-composited-scroller-with-foreground-paint-phases-expected.txt:
* platform/gtk/compositing/overflow/composited-scrolling-paint-phases-expected.txt:
* platform/ios-wk2/compositing/overflow/stacking-context-composited-scroller-with-foreground-paint-phases-expected.txt:
* platform/mac-wk1/compositing/overflow/stacking-context-composited-scroller-with-foreground-paint-phases-expected.txt:
* platform/mac/compositing/overflow/composited-scrolling-paint-phases-expected.txt: Removed.

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

9 months agoMake MediaStream constructor take a Document instead of a ScriptExecutionContext
youenn@apple.com [Sun, 16 Jun 2019 04:47:05 +0000 (04:47 +0000)]
Make MediaStream constructor take a Document instead of a ScriptExecutionContext
https://bugs.webkit.org/show_bug.cgi?id=198873

Reviewed by Darin Adler.

Update MediaStream constructors and call site to take a Document&.
Make the same for creation of CanvasCaptureMediaStreamTrack.
No observable change of behavior.

* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::create):
(WebCore::CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack):
(WebCore::loggerFromContext): Deleted.
* Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::create):
(WebCore::MediaStream::MediaStream):
(WebCore::MediaStream::clone):
(WebCore::loggerFromContext): Deleted.
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/MediaStream.idl:
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::allow):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::captureStream):
* html/HTMLCanvasElement.h:
* html/HTMLCanvasElement.idl:

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

9 months agoWPT test importer WTR option reader should not throw if the file is not proper UTF-8
youenn@apple.com [Sun, 16 Jun 2019 04:46:16 +0000 (04:46 +0000)]
WPT test importer WTR option reader should not throw if the file is not proper UTF-8
https://bugs.webkit.org/show_bug.cgi?id=198780

Reviewed by Jonathan Bedard.

* Scripts/webkitpy/w3c/test_importer.py:
(TestImporter._webkit_test_runner_options):
In case the test file cannot be read as text, consider that there is no WTR option.

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

9 months ago[LFC][BFC] Fix available width for non-floating positioned float avoiders.
zalan@apple.com [Sat, 15 Jun 2019 19:30:06 +0000 (19:30 +0000)]
[LFC][BFC] Fix available width for non-floating positioned float avoiders.
https://bugs.webkit.org/show_bug.cgi?id=198886
<rdar://problem/51773643>

Reviewed by Antti Koivisto.

Normally the available width for an in-flow block level box is the width of the containing block's content box.
However a non-floating positioned float avoider box might be constrained by existing floats.
The idea here is that we pre-compute(estimate) the vertical position and check the current floating context for
left and right floats. These floats contrain the available width and this computed value should be used instead of the containing block's
content box's width whe calculating the used width for width: auto.

* layout/FormattingContext.cpp:
(WebCore::Layout::mapHorizontalPositionToAncestor):
(WebCore::Layout::FormattingContext::mapLeftToAncestor):
(WebCore::Layout::FormattingContext::mapRightToAncestor):
(WebCore::Layout::FormattingContext::mapPointToAncestor):
(WebCore::Layout::FormattingContext::mapCoordinateToAncestor): Deleted.
* layout/FormattingContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition const):
(WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition const):
(WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot const):
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
* layout/blockformatting/BlockFormattingContext.h:
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::staticVerticalPosition):
(WebCore::Layout::BlockFormattingContext::Geometry::staticHorizontalPosition):
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::constraints const):
* layout/layouttree/LayoutBlockContainer.cpp:
(WebCore::Layout::BlockContainer::establishesInlineFormattingContextOnly const):
* layout/layouttree/LayoutBlockContainer.h:
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isFloatAvoider const):
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::establishesInlineFormattingContextOnly const):

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

9 months ago[GTK] Stop accessing GdkEvent fields when possible
commit-queue@webkit.org [Sat, 15 Jun 2019 18:33:03 +0000 (18:33 +0000)]
[GTK] Stop accessing GdkEvent fields when possible
https://bugs.webkit.org/show_bug.cgi?id=198829

Patch by Ludovico de Nittis <ludovico.denittis@collabora.com> on 2019-06-15
Reviewed by Michael Catanzaro.

Direct access to GdkEvent structs is no longer possible in GTK 4.

Source/WebCore:

No behaviour changes.

* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::eventTypeForGdkKeyEvent):
(WebCore::modifiersForGdkKeyEvent):
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
* platform/gtk/PlatformMouseEventGtk.cpp:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):

Source/WebKit:

* Shared/gtk/WebEventFactory.cpp:
(WebKit::buttonForEvent):
(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::WebEventFactory::createWebWheelEvent):
(WebKit::WebEventFactory::createWebKeyboardEvent):
(WebKit::WebEventFactory::createWebTouchEvent):
* UIProcess/API/gtk/WebKitEmojiChooser.cpp:
* UIProcess/API/gtk/WebKitScriptDialogImpl.cpp:
(webkitScriptDialogImplKeyPressEvent):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(ClickCounter::currentClickCountForGdkButtonEvent):
(webkitWebViewBaseKeyPressEvent):
(webkitWebViewBaseHandleMouseEvent):
(webkitWebViewBaseCrossingNotifyEvent):
(webkitWebViewBaseGetTouchPointsForEvent):
(webkitWebViewBaseTouchEvent):
(webkitWebViewBaseEvent):
* UIProcess/gtk/GestureController.cpp:
(WebKit::GestureController::handleEvent):
* UIProcess/gtk/InputMethodFilter.cpp:
(WebKit::InputMethodFilter::filterKeyEvent):
(WebKit::InputMethodFilter::logHandleKeyboardEventForTesting):
(WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting):
* UIProcess/gtk/KeyBindingTranslator.cpp:
(WebKit::KeyBindingTranslator::commandsForKeyEvent):
* UIProcess/gtk/ViewGestureControllerGtk.cpp:
(WebKit::isEventStop):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas):
(WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
* UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
(WebKit::WebPopupMenuProxyGtk::treeViewButtonReleaseEventCallback):
(WebKit::WebPopupMenuProxyGtk::keyPressEventCallback):

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

9 months agoSource/WebCore:
commit-queue@webkit.org [Sat, 15 Jun 2019 18:20:27 +0000 (18:20 +0000)]
Source/WebCore:
Add tests for prefetch redirects
https://bugs.webkit.org/show_bug.cgi?id=197371

Patch by Rob Buis <rbuis@igalia.com> on 2019-06-15
Reviewed by Youenn Fablet.

Test: http/wpt/prefetch/link-prefetch-main-resource-redirect.html

Allow clearing of the Purpose request header field.

* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::clearPurpose):
* platform/network/ResourceRequestBase.h:

Source/WebKit:
Store prefetch redirects in the prefetch cache
https://bugs.webkit.org/show_bug.cgi?id=197371

Patch by Rob Buis <rbuis@igalia.com> on 2019-06-15
Reviewed by Youenn Fablet.

Store prefetch redirects in the prefetch cache and use them when
navigating.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
(WebKit::NetworkResourceLoader::willSendRedirectedRequest):
(WebKit::NetworkResourceLoader::didFinishWithRedirectResponse):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cache/PrefetchCache.cpp:
(WebKit::PrefetchCache::Entry::Entry):
(WebKit::PrefetchCache::storeRedirect):
* NetworkProcess/cache/PrefetchCache.h:

LayoutTests:
Add tests for prefetch redirects
https://bugs.webkit.org/show_bug.cgi?id=197371

Patch by Rob Buis <rbuis@igalia.com> on 2019-06-15
Reviewed by Youenn Fablet.

Add a test to verify prefetch redirections are cached in the prefetch
cache and reused when navigating.

* http/wpt/prefetch/link-prefetch-main-resource-redirect-expected.txt: Added.
* http/wpt/prefetch/link-prefetch-main-resource-redirect.html: Added.
* http/wpt/prefetch/resources/main-resource-redirect-no-prefetch.py: Added.
(main):
* http/wpt/prefetch/resources/navigate.html: Added.
* http/wpt/prefetch/resources/prefetched-main-resource-redirect.py: Added.
(main):
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

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

9 months agoUnreviewed. Temporarily mark webgpu/whlsl-oob-access.html as flaky.
sbarati@apple.com [Sat, 15 Jun 2019 17:42:48 +0000 (17:42 +0000)]
Unreviewed. Temporarily mark webgpu/whlsl-oob-access.html as flaky.

* TestExpectations:

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

9 months ago[LFC][MarginCollapsing] Remove redundant checks in MarginCollapse::marginBefore/After...
zalan@apple.com [Sat, 15 Jun 2019 14:36:40 +0000 (14:36 +0000)]
[LFC][MarginCollapsing] Remove redundant checks in MarginCollapse::marginBefore/AfterCollapsesWith*
https://bugs.webkit.org/show_bug.cgi?id=198882
<rdar://problem/51773334>

Reviewed by Antti Koivisto.

In-flow child can neither be floating nor out-of-flow positioned.

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

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

9 months ago[LFC][MarginCollapsing] Collapsed through margin values preserve quirk state.
zalan@apple.com [Sat, 15 Jun 2019 14:16:13 +0000 (14:16 +0000)]
[LFC][MarginCollapsing] Collapsed through margin values preserve quirk state.
https://bugs.webkit.org/show_bug.cgi?id=198885
<rdar://problem/51773568>

Reviewed by Antti Koivisto.

The collapsed through margin becomes a quirk margin if either of the vertical(before/after) margins have quirk value.

* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::computedPositiveAndNegativeMargin):

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

9 months ago[LFC[MarginCollapsing] Anonymous boxes never collapse their margins with siblings.
zalan@apple.com [Sat, 15 Jun 2019 14:13:55 +0000 (14:13 +0000)]
[LFC[MarginCollapsing] Anonymous boxes never collapse their margins with siblings.
https://bugs.webkit.org/show_bug.cgi?id=198884
<rdar://problem/51773509>

Reviewed by Antti Koivisto.

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

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

9 months ago[LFC][MarginCollapsing] Add check for computed height value in MarginCollapse::margin...
zalan@apple.com [Sat, 15 Jun 2019 14:11:37 +0000 (14:11 +0000)]
[LFC][MarginCollapsing] Add check for computed height value in MarginCollapse::marginsCollapseThrough
https://bugs.webkit.org/show_bug.cgi?id=198883
<rdar://problem/51773395>

Reviewed by Antti Koivisto.

"A box's own margins collapse if... ...and it has a 'height' of either 0 or 'auto"
https://www.w3.org/TR/CSS22/box.html#collapsing-margins

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

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

9 months ago[LFC] Fix available width for shrink-to-fit (for out-of-flow non-replaced box)
zalan@apple.com [Sat, 15 Jun 2019 14:09:16 +0000 (14:09 +0000)]
[LFC] Fix available width for shrink-to-fit (for out-of-flow non-replaced box)
https://bugs.webkit.org/show_bug.cgi?id=198880
<rdar://problem/51773118>

Reviewed by Antti Koivisto.

This patch fixes the cases when the available width for the out-of-flow positioned box is not the same as the containing block's (padding)width.

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):

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

9 months ago[LFC] Fix over-constrained logic for out-of-flow non-replaced horizontal geometry.
zalan@apple.com [Sat, 15 Jun 2019 14:06:57 +0000 (14:06 +0000)]
[LFC] Fix over-constrained logic for out-of-flow non-replaced horizontal geometry.
https://bugs.webkit.org/show_bug.cgi?id=198879
<rdar://problem/51772995>

Reviewed by Antti Koivisto.

The over-constrained logic applies to the case when all the horizontal properties are set.

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):

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

9 months ago[LFC] Convert both the absolutely and statically positioned out-of-flow block level...
zalan@apple.com [Sat, 15 Jun 2019 14:05:44 +0000 (14:05 +0000)]
[LFC] Convert both the absolutely and statically positioned out-of-flow block level boxes positions relative to the containing block's padding box
https://bugs.webkit.org/show_bug.cgi?id=198878
<rdar://problem/51772882>

Reviewed by Antti Koivisto.

This patch ensures that while we compute the vertical/horizontal geometry for an out-of-flow block level box,
the static and the absolute positioned values are in the same coordinate system (relative to the containing block's padding box).

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
(WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):

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

9 months ago[LFC][IFC] Add support for vertical-align: top and bottom
zalan@apple.com [Sat, 15 Jun 2019 14:03:23 +0000 (14:03 +0000)]
[LFC][IFC] Add support for vertical-align: top and bottom
https://bugs.webkit.org/show_bug.cgi?id=198697
<rdar://problem/51556188>

Reviewed by Antti Koivisto.

Use the layout box's vertical alignment to adjust line baseline and height and set the run's logical top when the line is being closed.

* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::isVisuallyEmpty const):
(WebCore::Layout::Line::close):
(WebCore::Layout::Line::appendInlineContainerStart):
(WebCore::Layout::Line::appendTextContent):
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::appendHardLineBreak):
(WebCore::Layout::Line::adjustBaselineAndLineHeight):
(WebCore::Layout::Line::inlineItemHeight const):
(WebCore::Layout::Line::Content::isVisuallyEmpty const): Deleted.
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::Content::isVisuallyEmpty const):
(WebCore::Layout::Line::Content::setIsVisuallyEmpty):
(WebCore::Layout::Line::hasContent const):

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

9 months agowaitForNavigationToComplete may be called before WebPageProxy knows it's loading
drousso@apple.com [Sat, 15 Jun 2019 03:20:42 +0000 (03:20 +0000)]
waitForNavigationToComplete may be called before WebPageProxy knows it's loading
https://bugs.webkit.org/show_bug.cgi?id=198741
<rdar://problem/31164316>

Reviewed by Joseph Pecoraro.

There's a potential race in `WebAutomationSession::waitForNavigationToCompleteOnPage` when
querying for the `WebPageProxy`'s loading state (via `PageLoadingState::isLoading`), in that
a pending load may be committed _after_ the `WebAutomationSession` checks it's value. This
makes the automation session think that it isn't loading, so it will continue running
commands, which can lead to a JavaScript error ("Callback was not called before the unload
event") as any injected scripts will be cleared by the impending navigation, leaving the
script evaluation callbacks "dangling".

Expose more information from `PageLoadState` about whether it thinks there _may_ be a
navigation currently happening, which the `WebAutomationSession` can use to delay commands.

In the best case, no navigations are "missed".

In the worst case, the automation session will wait `pageLoadTimeout` before continuing.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):

* UIProcess/PageLoadState.h:
* UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::hasUncommittedLoad const): Added.

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

9 months agoWeb Inspector: rework http/tests/inspector/network/resource-sizes-network.html to...
drousso@apple.com [Sat, 15 Jun 2019 03:09:19 +0000 (03:09 +0000)]
Web Inspector: rework http/tests/inspector/network/resource-sizes-network.html to print the actual values so other platforms don't FAIL
https://bugs.webkit.org/show_bug.cgi?id=198877
<rdar://problem/50381370>

Reviewed by Joseph Pecoraro.

* http/tests/inspector/network/resources/resource-size-test.js:
(TestPage.registerInitializer.window.addResourceSizeTest):

* http/tests/inspector/network/resource-sizes-disk-cache.html:
* http/tests/inspector/network/resource-sizes-disk-cache-expected.txt:

* http/tests/inspector/network/resource-sizes-memory-cache.html:
* http/tests/inspector/network/resource-sizes-memory-cache-expected.txt:
* platform/gtk/http/tests/inspector/network/resource-sizes-memory-cache-expected.txt:
* platform/mac/http/tests/inspector/network/resource-sizes-memory-cache-expected.txt:
* platform/mac-sierra/http/tests/inspector/network/resource-sizes-memory-cache-expected.txt:

* http/tests/inspector/network/resource-sizes-network.html:
* http/tests/inspector/network/resource-sizes-network-expected.txt:
* platform/gtk/http/tests/inspector/network/resource-sizes-network-expected.txt:
* platform/mac/http/tests/inspector/network/resource-sizes-network-expected.txt:
* platform/mac-sierra/http/tests/inspector/network/resource-sizes-network-expected.txt:

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

9 months agoRepeatedly check for IDB removal to address flakiness in http/tests/resourceLoadStati...
wilander@apple.com [Sat, 15 Jun 2019 02:23:16 +0000 (02:23 +0000)]
Repeatedly check for IDB removal to address flakiness in http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html
https://bugs.webkit.org/show_bug.cgi?id=198185
<rdar://problem/51074251>

Unreviewed test gardening.

There's an asynchronosity in the removal of IDB entries so this test case
needs to check repeatedly until the removal has happened.

* http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html:
* platform/ios-simulator-wk2/TestExpectations:
    Removed skip.

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

9 months agoWebProcessPool::clearWebProcessHasUploads cannot assume its given processIdentifier...
youenn@apple.com [Sat, 15 Jun 2019 01:07:16 +0000 (01:07 +0000)]
WebProcessPool::clearWebProcessHasUploads cannot assume its given processIdentifier is valid
https://bugs.webkit.org/show_bug.cgi?id=198865
<rdar://problem/51618878>

Reviewed by Brady Eidson.

NetworkProcess currently instructs UIProcess whether a given WebProcess is doing upload.
There is no guarantee though that the WebProcessProxy is still there when the IPC is arriving at UIProcess.
Instead, let WebProcess handles its upload state and notify WebProcessPool about its state.
Make sure WebProcessProxy unregisters itself in case of crash.
In case of NetworkProcess crash, WebProcesses will see all their uploads fail
and will notify automatically UIProcess to update their state.

Since the processID given to WebProcessPool is coming from IPC, we cannot not trust it.
Add early return in case of not finding a WebProcessProxy for WebProcessPool clear/set methods.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkResourceLoadMap.cpp:
(WebKit::NetworkResourceLoadMap::add):
(WebKit::NetworkResourceLoadMap::take):
* NetworkProcess/NetworkResourceLoadMap.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::setWebProcessHasUploads):
(WebKit::WebProcessPool::clearWebProcessHasUploads):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::~WebProcessProxy):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
(WebKit::WebLoaderStrategy::remove):
(WebKit::WebLoaderStrategy::tryLoadingSynchronouslyUsingURLSchemeHandler):
* WebProcess/Network/WebLoaderStrategy.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::ensureNetworkProcessConnection):

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

9 months agoRestore PAC based cage.
keith_miller@apple.com [Fri, 14 Jun 2019 23:14:14 +0000 (23:14 +0000)]
Restore PAC based cage.
https://bugs.webkit.org/show_bug.cgi?id=198872

Rubber-stamped by Saam Barati.

Source/bmalloc:

* bmalloc/Gigacage.h:

Source/JavaScriptCore:

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::bitFieldInsert64):
* assembler/MacroAssemblerARM64E.h:
* assembler/testmasm.cpp:
(JSC::testCagePreservesPACFailureBit):
(JSC::run):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::jumpForTypedArrayIsNeuteredIfOutOfBounds):
(JSC::DFG::SpeculativeJIT::cageTypedArrayStorage):
(JSC::DFG::SpeculativeJIT::compileGetTypedArrayByteOffset):
(JSC::DFG::SpeculativeJIT::compileNewTypedArrayWithSize):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNewTypedArray):
(JSC::FTL::DFG::LowerDFGToB3::caged):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::cageWithoutUntagging):
(JSC::AssemblyHelpers::cageConditionally):
(JSC::AssemblyHelpers::cage): Deleted.
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitIntTypedArrayGetByVal):
(JSC::JIT::emitFloatTypedArrayGetByVal):
(JSC::JIT::emitIntTypedArrayPutByVal):
(JSC::JIT::emitFloatTypedArrayPutByVal):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter64.asm:
* offlineasm/arm64.rb:
* offlineasm/instructions.rb:
* offlineasm/registers.rb:
* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::restoreWebAssemblyGlobalState):
(JSC::Wasm::AirIRGenerator::addCallIndirect):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::restoreWebAssemblyGlobalState):
(JSC::Wasm::B3IRGenerator::addCallIndirect):
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToWasm):
* wasm/js/JSToWasm.cpp:
(JSC::Wasm::createJSToWasmWrapper):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):

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

9 months ago[iOS] Split up fast/events/ios/key-events-meta-alt-combinations.html and add more...
dbates@webkit.org [Fri, 14 Jun 2019 23:12:14 +0000 (23:12 +0000)]
[iOS] Split up fast/events/ios/key-events-meta-alt-combinations.html and add more tests
https://bugs.webkit.org/show_bug.cgi?id=198834
<rdar://problem/50103348>

Reviewed by Brent Fulgham.

The test fast/events/ios/key-events-meta-alt-combinations.html frequently times out. Let's try
to break up this test into multiple files. Also add more modifier combination tests and group
all these combination tests under a new direcdtory: fast/events/ios/key-events-comprehensive.

* fast/events/ios/key-events-comprehensive/key-events-control-expected.txt: Renamed from LayoutTests/fast/events/ios/key-events-control-expected.txt.
* fast/events/ios/key-events-comprehensive/key-events-control-option-expected.txt: Added.
* fast/events/ios/key-events-comprehensive/key-events-control-option.html: Copied from LayoutTests/fast/events/ios/key-events-control.html.
* fast/events/ios/key-events-comprehensive/key-events-control-shift-expected.txt: Added.
* fast/events/ios/key-events-comprehensive/key-events-control-shift.html: Copied from LayoutTests/fast/events/ios/key-events-control.html.
* fast/events/ios/key-events-comprehensive/key-events-control.html: Renamed from LayoutTests/fast/events/ios/key-events-control.html.
* fast/events/ios/key-events-comprehensive/key-events-meta-control-expected.txt: Added.
* fast/events/ios/key-events-comprehensive/key-events-meta-control.html: Copied from LayoutTests/fast/events/ios/key-events-meta.html.
* fast/events/ios/key-events-comprehensive/key-events-meta-expected.txt: Renamed from LayoutTests/fast/events/ios/key-events-meta-expected.txt.
* fast/events/ios/key-events-comprehensive/key-events-meta-option-expected.txt: Added.
* fast/events/ios/key-events-comprehensive/key-events-meta-option.html: Renamed from LayoutTests/fast/events/ios/key-events-meta-alt-combinations.html.
* fast/events/ios/key-events-comprehensive/key-events-meta-shift-expected.txt: Added.
* fast/events/ios/key-events-comprehensive/key-events-meta-shift.html: Copied from LayoutTests/fast/events/ios/key-events-meta.html.
* fast/events/ios/key-events-comprehensive/key-events-meta.html: Renamed from LayoutTests/fast/events/ios/key-events-meta.html.
* fast/events/ios/key-events-comprehensive/key-events-option-expected.txt: Added.
* fast/events/ios/key-events-comprehensive/key-events-option-shift-expected.txt: Added.
* fast/events/ios/key-events-comprehensive/key-events-option-shift.html: Added.
* fast/events/ios/key-events-comprehensive/key-events-option.html: Added.
* fast/events/ios/key-events-comprehensive/key-events-shift-expected.txt: Added.
* fast/events/ios/key-events-comprehensive/key-events-shift.html: Added.
* fast/events/ios/key-events-meta-alt-combinations-expected.txt: Removed.

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

9 months agoWebResourceLoadStatisticsStore should not use its network session if invalidated
youenn@apple.com [Fri, 14 Jun 2019 23:05:31 +0000 (23:05 +0000)]
WebResourceLoadStatisticsStore should not use its network session if invalidated
https://bugs.webkit.org/show_bug.cgi?id=198814

Reviewed by Geoffrey Garen.

Source/WebKit:

Tell WebResourceLoadStatisticsStore that its network session is invalidated.
WebResourceLoadStatisticsStore will then clear its reference to the network session.

* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
Added for test purposes to trigger further cookie processing.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::invalidateAndCancel):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::invalidateAndCancel):

Tools:

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

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

9 months ago[Cocoa] NSFileWrapper associated with _WKAttachment
pecoraro@apple.com [Fri, 14 Jun 2019 22:52:24 +0000 (22:52 +0000)]
[Cocoa] NSFileWrapper associated with _WKAttachment
https://bugs.webkit.org/show_bug.cgi?id=198871
<rdar://problem/51760625>

Reviewed by Wenson Hsieh.

* UIProcess/API/Cocoa/_WKAttachment.mm:
(-[_WKAttachment dealloc]):
Ensure we destruct the API::Object associated with this so RetainPtrs can release.

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

9 months agoWebKit's NSAttributedString.h is not included in the WebKit.h umbrella header
timothy_horton@apple.com [Fri, 14 Jun 2019 22:50:00 +0000 (22:50 +0000)]
WebKit's NSAttributedString.h is not included in the WebKit.h umbrella header
https://bugs.webkit.org/show_bug.cgi?id=198869
<rdar://problem/51754437>

Reviewed by Timothy Hatcher.

* Shared/API/Cocoa/WebKit.h:
Make the new API available to modularized clients and folks who just import WebKit.h

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

9 months agoDisable AppSSO for web processes and plugin processes
jiewen_tan@apple.com [Fri, 14 Jun 2019 21:39:07 +0000 (21:39 +0000)]
Disable AppSSO for web processes and plugin processes
https://bugs.webkit.org/show_bug.cgi?id=198843
<rdar://problem/51642920>

Reviewed by Sam Weinig.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:
Adds a SPI to disable AppSSO for CFNetwork.

Source/WebKit:

This patch moves the disabling of AppSSO from AuxiliaryProcess to PluginProcess
and WebProcess such that NetworkingProcess will not be affected.

* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::platformInitializePluginProcess):
* Shared/ios/AuxiliaryProcessIOS.mm:
(WebKit::AuxiliaryProcess::platformInitialize):
* Shared/mac/AuxiliaryProcessMac.mm:
(WebKit::AuxiliaryProcess::platformInitialize):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeProcess):

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

9 months ago[Pointer Events] button property is -1 for pointerdown and pointerup
graouts@webkit.org [Fri, 14 Jun 2019 21:17:02 +0000 (21:17 +0000)]
[Pointer Events] button property is -1 for pointerdown and pointerup
https://bugs.webkit.org/show_bug.cgi?id=198868
<rdar://problem/51758109>

Reviewed by Dean Jackson.

Source/WebCore:

A value of -1 for "button", which means there was no change of pressed button since the last event, should only ever be used for "pointermove" events.

Test: pointerevents/mouse/pointer-button-and-buttons.html

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

LayoutTests:

* pointerevents/mouse/pointer-button-and-buttons-expected.txt: Added.
* pointerevents/mouse/pointer-button-and-buttons.html: Added.
* pointerevents/utils.js:
(prototype._handlePointerEvent):

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

9 months agoMove Synthetic Editing Commands to behind an experimental feature flag
megan_gardner@apple.com [Fri, 14 Jun 2019 21:00:13 +0000 (21:00 +0000)]
Move Synthetic Editing Commands to behind an experimental feature flag
https://bugs.webkit.org/show_bug.cgi?id=198842
<rdar://problem/50594700>

Reviewed by Simon Fraser.

Source/WebCore:

Moving from a quirk to a feature flag.

* page/Quirks.cpp:
(WebCore::shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreasForHost): Deleted.
(WebCore::Quirks::shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreas const): Deleted.
* page/Quirks.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setSyntheticEditingCommandsEnabled):
(WebCore::RuntimeEnabledFeatures::syntheticEditingCommandsEnabled const):

Source/WebKit:

Add a feature flag to gate synthetic editing commands.

* Shared/WebPreferences.yaml:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getFocusedElementInformation):

Source/WebKitLegacy/mac:

Add plumbing for synthetic editing command feature flag.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences syntheticEditingCommandsEnabled]):
(-[WebPreferences setSyntheticEditingCommandsEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

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

9 months agoREGRESSION(244439): platform/mac/media/encrypted-media/fps-* tests are crashing
jer.noble@apple.com [Fri, 14 Jun 2019 20:10:29 +0000 (20:10 +0000)]
REGRESSION(244439): platform/mac/media/encrypted-media/fps-* tests are crashing
https://bugs.webkit.org/show_bug.cgi?id=198612
<rdar://problem/51078978>

Reviewed by Eric Carlson.

There are two implementations of a 'cenc' initialiation data factory; an ASSERT fires when
the second one is added to the registry. Unify them.

* Modules/encryptedmedia/InitDataRegistry.cpp:
(WebCore::extractKeyIDsCenc):
* platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
(WebCore::CDMPrivateFairPlayStreaming::validFairPlayStreamingSchemes):
(WebCore::CDMPrivateFairPlayStreaming::fairPlaySystemID):
(WebCore::validInitDataTypes):
(WebCore::CDMFactory::platformRegisterFactories):
(WebCore::validFairPlayStreamingSchemes): Deleted.
(WebCore::CDMPrivateFairPlayStreaming::cencName): Deleted.
(WebCore::fairPlaySystemID): Deleted.
(WebCore::extractSchemeAndKeyIdFromCenc): Deleted.
(WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsCenc): Deleted.
(WebCore::CDMPrivateFairPlayStreaming::sanitizeCenc): Deleted.
* platform/graphics/avfoundation/CDMFairPlayStreaming.h:

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

9 months agoMove http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html off of testRu...
wilander@apple.com [Fri, 14 Jun 2019 20:10:23 +0000 (20:10 +0000)]
Move http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html off of testRunner.setAlwaysAcceptCookies()
https://bugs.webkit.org/show_bug.cgi?id=198863
<rdar://problem/47854589>

Unreviewed test gardening.

testRunner.setAlwaysAcceptCookies() is not working right (tracked
in rdar://problem/51757107). Therefore, we need to change
http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html
to make it work properly.

* http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt:
* http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html:

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

9 months agoUnreviewed. Follow up to r246438. This removes a debug assert until
sbarati@apple.com [Fri, 14 Jun 2019 18:59:18 +0000 (18:59 +0000)]
Unreviewed. Follow up to r246438. This removes a debug assert until
we do further compiler work in: https://bugs.webkit.org/show_bug.cgi?id=198861

* Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
(WebCore::WHLSL::checkDuplicateFunctions):
* Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:

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

9 months ago[WHLSL] Implement out-of-bounds and nullptr behavior
sbarati@apple.com [Fri, 14 Jun 2019 18:01:05 +0000 (18:01 +0000)]
[WHLSL] Implement out-of-bounds and nullptr behavior
https://bugs.webkit.org/show_bug.cgi?id=198600
<rdar://problem/51668853>

Reviewed by Robin Morisset.

Source/WebCore:

The behavior we're implementing is:
- OOB writes are ignored.
- OOB reads return zero.
- Writes to null are ignored.
- Reads from null return zero.
- &*x == x, including &*null == null.

We implement this like so:
- The value stack in FunctionWriter turns into a stack of pairs: rvalues and lvalues.
  rvalues are represented the same as before. Lvalues are always pointers.
- Anything that produces an lvalue must push a pointer to the stack. Not
  all things produce lvalues, so that entry in the stack may be empty.
  However, all things that produce lvalues also produce rvalues. So, "*x = 42" works,
  and so does "foo(*x)". Nodes that produce lvalues are responsible for also producing
  an rvalue, which should be the value as if the lvalue was dereferenced at that point
  in program execution. So the "*x" in "thread int* x = null; *x" produces the int zero
  for its rvalue, and null for its lvalue.
- Dereference just works, as dereference produces both an lvalue and rvalue. Dereference
  node's child must also be an lvalue. So we just forward that value along on
  the stack. For the rvalue, if we try to dereference nullptr, we just fill in
  zero bytes instead. Otherwise, the rvalue is the result of dereferencing the
  non-null pointer.
- Assignment expressions check if the incoming lvalue is null. If it is, it
  skips the assignment.
- operator&[] returns nullptr on an OOB access. Then, based on the above
  behavior, we get the desired OOB reads return zero, and OOB writes are
  ignored.
- MakePointerExpression just takes the last lvalue off the stack (which must
  be a pointer) and returns it as an rvalue.
- VariableReference will push both the variable value and a pointer to the variable
  onto the stack.

This patch also fixes a few bugs where we weren't giving certain AST nodes the
proper address space values.

This patch also removes code to generate native functions for operators
"operator[]" and "operator[]=" as we should never be generating these
ourselves. We should only be generating the "operator&[]" ander.

Tests: webgpu/whlsl-null-dereference.html
       webgpu/whlsl-oob-access.html

* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendRightValue):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendLeftValue):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastValue):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastLeftValue):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::emitLoop):
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
(WebCore::WHLSL::Metal::writeNativeFunction):
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
(WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
* Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
(WebCore::WHLSL::PreserveLifetimes::assignVariableIntoStruct):
* Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
(WebCore::WHLSL::PropertyResolver::visit):
* Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
* platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
(WebCore::trySetFunctions):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::trySetFunctions):

LayoutTests:

* webgpu/whlsl-null-dereference-expected.txt: Added.
* webgpu/whlsl-null-dereference.html: Added.
* webgpu/whlsl-oob-access-expected.txt: Added.
* webgpu/whlsl-oob-access.html: Added.

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

9 months agoCRASH(nullptr) in WebCore::jsAudioContextCurrentTime()
jer.noble@apple.com [Fri, 14 Jun 2019 17:42:13 +0000 (17:42 +0000)]
CRASH(nullptr) in WebCore::jsAudioContextCurrentTime()
https://bugs.webkit.org/show_bug.cgi?id=198859
<rdar://problem/27986991>

Reviewed by Eric Carlson.

AudioContext's m_destinationNode can become null during iframe teardown,
but can AudioContext methods can still be called by JavaScript. Add null-checks
to all (remaing) unprotected dereferences of m_destinationNode.

* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::uninitialize):
(WebCore::AudioContext::createBufferSource):
(WebCore::AudioContext::createScriptProcessor):
(WebCore::AudioContext::createBiquadFilter):
(WebCore::AudioContext::createPanner):
(WebCore::AudioContext::createConvolver):
(WebCore::AudioContext::createDynamicsCompressor):
(WebCore::AudioContext::createAnalyser):
(WebCore::AudioContext::createGain):
(WebCore::AudioContext::createDelay):
(WebCore::AudioContext::createChannelSplitter):
(WebCore::AudioContext::createChannelMerger):
(WebCore::AudioContext::createOscillator):
* Modules/webaudio/AudioContext.h:
(WebCore::AudioContext::currentSampleFrame const):
(WebCore::AudioContext::currentTime const):
(WebCore::AudioContext::sampleRate const):

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

9 months agoCloning a MediaStreamTrack does not clone the logger
youenn@apple.com [Fri, 14 Jun 2019 17:14:47 +0000 (17:14 +0000)]
Cloning a MediaStreamTrack does not clone the logger
https://bugs.webkit.org/show_bug.cgi?id=198844

Reviewed by Eric Carlson.

Source/WebCore:

Make MediaStream and MediaStreamTrack rely on their private versions for logging.
Move from a RefPtr version to a Ref so as to forbid nullptr crashes.
Make sure that RealtimeIncomingAudioSource and RealtimeIncomingVideoSource check for their logger before logging.
Covered by existing tests and updated test.

* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::loggerFromContext):
(WebCore::CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack):
* Modules/mediastream/MediaStream.cpp:
(WebCore::loggerFromContext):
(WebCore::MediaStream::create):
(WebCore::MediaStream::MediaStream):
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::MediaStreamTrack):
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::allow):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::createReceiverForSource):
* Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
(WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::create):
(WebCore::MediaStreamPrivate::MediaStreamPrivate):
(WebCore::MediaStreamPrivate::setLogger): Deleted.
* platform/mediastream/MediaStreamPrivate.h:
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::create):
(WebCore::MediaStreamTrackPrivate::MediaStreamTrackPrivate):
(WebCore::MediaStreamTrackPrivate::clone):
(WebCore::MediaStreamTrackPrivate::setLogger): Deleted.
* platform/mediastream/MediaStreamTrackPrivate.h:
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::createMediaStream):
* platform/mediastream/RealtimeMediaSourceCenter.h:
* platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
(WebCore::RealtimeIncomingAudioSourceCocoa::OnData):
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferPool):
(WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
(WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):

LayoutTests:

* fast/mediastream/MediaStreamTrack-clone-expected.txt:
* fast/mediastream/MediaStreamTrack-clone.html:

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

9 months agowebgpu/compute-squares.html test was deleted in https://trac.webkit.org/changeset...
sroberts@apple.com [Fri, 14 Jun 2019 17:12:07 +0000 (17:12 +0000)]
webgpu/compute-squares.html test was deleted in https://trac.webkit.org/changeset/246427
https://bugs.webkit.org/show_bug.cgi?id=198841

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations: Removing expectation for deleted teest

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

9 months agoimport-w3c-tests should respect WEBKIT_OUTPUTDIR
youenn@apple.com [Fri, 14 Jun 2019 15:53:55 +0000 (15:53 +0000)]
import-w3c-tests should respect WEBKIT_OUTPUTDIR
https://bugs.webkit.org/show_bug.cgi?id=198682
<rdar://problem/51536931>

Reviewed by Jonathan Bedard.

Check for WEBKIT_OUTPUTDIR environment variable to compute the w3c-tests folder.
Made some refactoring to also teach WPTPaths users about WEBKIT_OUTPUTDIR.

* Scripts/webkitpy/common/webkit_finder.py:
(WebKitFinder.path_from_webkit_outputdir):
* Scripts/webkitpy/w3c/common.py:
(WPTPaths):
(WPTPaths.checkout_directory):
(WPTPaths.wpt_checkout_path):
* Scripts/webkitpy/w3c/test_importer.py:
(TestImporter.__init__):
* Scripts/webkitpy/w3c/test_importer_unittest.py:
(test_checkout_directory):

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

9 months ago[Win10] Some tests are failing only on specific machines
pvollan@apple.com [Fri, 14 Jun 2019 14:44:39 +0000 (14:44 +0000)]
[Win10] Some tests are failing only on specific machines
https://bugs.webkit.org/show_bug.cgi?id=197509

Unreviewed test gardening.

* platform/win/TestExpectations:

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

9 months agoIntersectionObserver rootMargin detection fails when `root` is an element
ajuma@chromium.org [Fri, 14 Jun 2019 13:05:13 +0000 (13:05 +0000)]
IntersectionObserver rootMargin detection fails when `root` is an element
https://bugs.webkit.org/show_bug.cgi?id=198784

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

Import https://github.com/web-platform-tests/wpt/pull/17323.

* web-platform-tests/intersection-observer/root-margin-root-element-expected.txt: Added.
* web-platform-tests/intersection-observer/root-margin-root-element.html: Added.

Source/WebCore:

When computing a target's bounds in root space, we were applying the root's
clip rect (if any), and then intersecting with the root rect expanded by the
root margin. This meant that if a target did not intersect the non-expanded root
rect, we would get an empty intersection even if the target did intersect the
expanded root rect. Fix this by not applying the root's clip rect when computing
a target's bounds in root space. Add a new VisibleRectContextOption::ApplyContainerClip
that determines whether RenderObject::computeVisibleRectInContainer should apply
the container's clip.

Test: imported/w3c/web-platform-tests/intersection-observer/root-margin-root-element.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::applyCachedClipAndScrollPosition const):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::visibleRectContextForRepaint):
* rendering/RenderObject.h:

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

9 months ago[cairo] Entering text into forms on github.com creates a trapezoid artifact
carlosgc@webkit.org [Fri, 14 Jun 2019 08:02:54 +0000 (08:02 +0000)]
[cairo] Entering text into forms on github.com creates a trapezoid artifact
https://bugs.webkit.org/show_bug.cgi?id=126124

Reviewed by Michael Catanzaro.

Mixing antialiasing modes in the same clip is not actually supported by cairo. In the case of rectangle clips we
are already ignoring the current antialiasing to not do any antialiasing. We could do the opposite for clips
receiving a path, we want to enforce antialiasing in that case since the paths might contain curves. Doing that
we ensure all calls to clip with a path use the same antialiasing, which is the case of the github bug.

* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::doClipWithAntialias): Helper to call cairo_clip() with the given antialising mode.
(WebCore::Cairo::clip): Use doClipWithAntialias().
(WebCore::Cairo::clipOut): Ditto.
(WebCore::Cairo::clipPath): Ditto.

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

9 months agoWeb Inspector: REGRESSION(r246178): extra spaces added in at-rules when formatting CSS
drousso@apple.com [Fri, 14 Jun 2019 06:52:07 +0000 (06:52 +0000)]
Web Inspector: REGRESSION(r246178): extra spaces added in at-rules when formatting CSS
https://bugs.webkit.org/show_bug.cgi?id=198806

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

* UserInterface/Workers/Formatter/CSSFormatter.js:
(CSSFormatter.prototype._format):
Add more specific tests for at-rules, and add/remove whitespace depending on the type of
at-rule (e.g. `@supports` vs `@media`), as well as where the scanner is in the parameters of
the at at-rule (e.g. `@supports |` vs `@media (|`).

* UserInterface/Workers/Formatter/FormatterContentBuilder.js:
(FormatterContentBuilder):
(FormatterContentBuilder.prototype.get lastToken): Added.
(FormatterContentBuilder.prototype.get currentLine):
(FormatterContentBuilder.prototype.removeLastNewline):
(FormatterContentBuilder.prototype.removeLastWhitespace):
(FormatterContentBuilder.prototype._popFormattedContent):
(FormatterContentBuilder.prototype._append):
Update `lastTokenWasNewline` and `lastTokenWasWhitespace` when removing newlines/whitespace.
Memoize the `currentLine` so it's less expensive to re-fetch.

LayoutTests:

* inspector/formatting/resources/css-tests/keyframes.css:
* inspector/formatting/resources/css-tests/keyframes-expected.css:
* inspector/formatting/resources/css-tests/media-query.css:
* inspector/formatting/resources/css-tests/media-query-expected.css:
* inspector/formatting/resources/css-tests/selectors.css:
* inspector/formatting/resources/css-tests/selectors-expected.css:
* inspector/formatting/resources/css-tests/wrapping.css:
* inspector/formatting/resources/css-tests/wrapping-expected.css:

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

9 months agoREGRESSION (r246103) [ Mojave+ WK1 ] Layout Test scrollbars/scrollbar-iframe-click...
graouts@webkit.org [Fri, 14 Jun 2019 06:50:51 +0000 (06:50 +0000)]
REGRESSION (r246103) [ Mojave+ WK1 ] Layout Test scrollbars/scrollbar-iframe-click-does-not-blur-content.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=198800
<rdar://problem/51679634>

Reviewed by Tim Horton.

Source/WebKitLegacy/mac:

Expose a private method that we need to use from DumpRenderTree.

* WebView/WebHTMLView.mm:
(-[WebHTMLView _hitViewForEvent:]):
* WebView/WebHTMLViewPrivate.h:

Tools:

We didn't detect an NSScroller in a sub-frame due to WebHTMLView's implementation of -[NSView hitTest:]. We now use a private method
which lets us use the default implementation and correctly returns an NSScroller in a sub-frame.

* DumpRenderTree/mac/EventSendingController.mm:
(eventPressedMouseButtonsSwizzlerForViewAndEvent):
(-[EventSendingController mouseDown:withModifiers:]):
(-[EventSendingController mouseUp:withModifiers:]):
(-[EventSendingController mouseMoveToX:Y:]):

LayoutTests:

This test now passes reliably on WK1.

* platform/mac-wk1/TestExpectations:

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

9 months ago[WHLSL] Remove unnecessary ASSERT()s and clean up visitor lambdas
mmaxfield@apple.com [Fri, 14 Jun 2019 05:45:43 +0000 (05:45 +0000)]
[WHLSL] Remove unnecessary ASSERT()s and clean up visitor lambdas
https://bugs.webkit.org/show_bug.cgi?id=198706

Reviewed by Dean Jackson, Saam Barati, and Robin Morisset.

Some minor refactoring.

If the code is going to unconditionally downcast<Foo>(bar), there's no need
to guard that with an ASSERT(is<Foo>(bar)) because the downcast() call will
do that automatically.

No new tests because there is no behavior change.

* Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
(WebCore::WHLSL::AST::ConstantExpression::visit):
(WebCore::WHLSL::AST::ConstantExpression::visit const):
* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
(WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
(WebCore::WHLSL::Metal::EntryPointScaffolding::mangledOutputPath):
(WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns):
* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
(WebCore::WHLSL::Metal::writeNativeFunction):
* Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
(WebCore::WHLSL::Metal::writeNativeType):
* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
(WebCore::WHLSL::Metal::find):
(WebCore::WHLSL::Metal::TypeNamer::createNameNode):
(WebCore::WHLSL::Metal::TypeNamer::insert):
(WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
(WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
(WebCore::WHLSL::Checker::visit):
(WebCore::WHLSL::argumentTypeForAndOverload):
* Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
(WebCore::WHLSL::inferTypesForTypeArguments):
* Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
(WebCore::WHLSL::Intrinsics::addFullTexture):
(WebCore::WHLSL::Intrinsics::addDepthTexture):
* Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
(WebCore::WHLSL::modify):
(WebCore::WHLSL::PropertyResolver::visit):
* Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
(WebCore::WHLSL::Visitor::visit):

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

9 months ago[WHLSL] Hook up compute
mmaxfield@apple.com [Fri, 14 Jun 2019 05:20:00 +0000 (05:20 +0000)]
[WHLSL] Hook up compute
https://bugs.webkit.org/show_bug.cgi?id=198644

Reviewed by Saam Barati.

Source/WebCore:

This patch hooks up compute shaders in exactly the same way that vertex and fragment shaders
are hooked up. I've modified the two patchs (compute and rendering) to be almost exactly the
same code.

This patch also adds support for the WHLSL compiler to determine what the numthreads()
attribute in the shader says so that it can be hooked up to Metal's threads-per-threadgroup
argument in the dispatch call. There is some logic to make sure that there aren't two
numthreads() attributes on the same compute shader.

It also adds a little bit of type renaming. For built-in variables, sometimes Metal's type
doesn't always match WHLSL's (and HLSL's type). For example, in WHLSL and HLSL,        SV_DispatchThreadID variables have to be a float3, but in Metal, they are a uint3.
Therefore, I've added a little bit of code during each entry point's pack and unpack stages
to handle this type conversion.

Test: webgpu/whlsl-compute.html

* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
(WebCore::WHLSL::Metal::internalTypeForSemantic): Determine which Metal type corresponds to
each built-in variable.
(WebCore::WHLSL::Metal::EntryPointScaffolding::builtInsSignature): Perform the type
conversion.
(WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns): Ditto.
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::VertexEntryPointScaffolding): Ditto.
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::helperTypes): Ditto.
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::pack): Ditto.
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::FragmentEntryPointScaffolding): Ditto.
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes): Ditto.
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::pack): Ditto.
(WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::signature): Ditto.
* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
* Modules/webgpu/WHLSL/WHLSLComputeDimensions.cpp: Added. Add a pass to determine whether
or not any entry point has duplicate numthreads() attribute, and to determine what the
appropriate numthreads() values should be for the current entry point.
(WebCore::WHLSL::ComputeDimensionsVisitor::ComputeDimensionsVisitor):
(WebCore::WHLSL::ComputeDimensionsVisitor::computeDimensions const):
(WebCore::WHLSL::computeDimensions):
* Modules/webgpu/WHLSL/WHLSLComputeDimensions.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLPrepare.h.
* Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
(WebCore::WHLSL::gatherEntryPointItems): Compute shaders don't need to have a semantic for their return type.
* Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
(WebCore::WHLSL::prepare): Run the computeDimensions() pass.
* Modules/webgpu/WHLSL/WHLSLPrepare.h:
* Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp: In a left-value propertyAccessExpression,
the index expression can be a right-value. Treat it as such.
(WebCore::WHLSL::LeftValueSimplifier::finishVisiting):
(WebCore::WHLSL::LeftValueSimplifier::visit):
* Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: We need support for multiplication (for a
test) and float3 for SV_DispatchThreadID.
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUComputePipeline.h: Associate a compute dimensions with a particular
compute pipeline. This is how Metal knows what values to use for a dispatch.
(WebCore::GPUComputePipeline::computeDimensions const):
* platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm: Use the saved compute dimensions.
(WebCore::GPUComputePassEncoder::dispatch):
* platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm: Make the code match GPURenderPipelineMetal.
(WebCore::trySetMetalFunctions):
(WebCore::trySetFunctions):
(WebCore::convertComputePipelineDescriptor):
(WebCore::tryCreateMTLComputePipelineState):
(WebCore::GPUComputePipeline::tryCreate):
(WebCore::GPUComputePipeline::GPUComputePipeline):
(WebCore::tryCreateMtlComputeFunction): Deleted.
* platform/graphics/gpu/cocoa/GPUPipelineMetalConvertLayout.cpp: Added. Moved shared helper
functions to a file where they can be accessed by multiple places.
(WebCore::convertShaderStageFlags):
(WebCore::convertBindingType):
(WebCore::convertLayout):
* platform/graphics/gpu/cocoa/GPUPipelineMetalConvertLayout.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLPrepare.h.
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Delete the functions that were moved to GPUPipelineMetalConvertLayout.
(WebCore::trySetFunctions):
(WebCore::tryCreateMtlRenderPipelineState):
(WebCore::convertShaderStageFlags): Deleted.
(WebCore::convertBindingType): Deleted.
(WebCore::convertLayout): Deleted.

LayoutTests:

This doesn't thoroughly test compute, but it's at least enough to unblock the WHLSL testing effort.

* webgpu/compute-squares-expected.txt: Deleted. Covered by webgpu/whlsl-compute.html.
* webgpu/compute-squares.html: Deleted. Ditto.
* webgpu/whlsl-compute-expected.txt: Added.
* webgpu/whlsl-compute.html: Added.

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

9 months ago[ContentChangeObserver] LayoutTest/fast/content-observation/click-event-suppression...
zalan@apple.com [Fri, 14 Jun 2019 03:50:31 +0000 (03:50 +0000)]
[ContentChangeObserver] LayoutTest/fast/content-observation/click-event-suppression-on-content-change.html is failing
https://bugs.webkit.org/show_bug.cgi?id=198848
<rdar://problem/51689630>

Reviewed by Dean Jackson.

1. Enable content observation for this test.
2. Add role attribute to trigger fast click-through -less flaky with the sleeps.
3. Use UIHelper functions.

* fast/content-observation/click-event-suppression-on-content-change.html: Removed.
* fast/events/touch/ios/content-observation/click-event-suppression-on-content-change-expected.txt: Renamed from LayoutTests/fast/content-observation/click-event-suppression-on-content-change-expected.txt.
* fast/events/touch/ios/content-observation/click-event-suppression-on-content-change.html: Added.

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

9 months agoFix selection hang in Mail
megan_gardner@apple.com [Fri, 14 Jun 2019 03:06:20 +0000 (03:06 +0000)]
Fix selection hang in Mail
https://bugs.webkit.org/show_bug.cgi?id=198845
<rdar://problem/51388180>

Reviewed by Tim Horton.

SelectionDidChange requires a selectionWillChange in order to keep things in line.

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

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

9 months agoWeb Inspector: Settings: indent type and size settings aren't respected everywhere
drousso@apple.com [Fri, 14 Jun 2019 02:11:17 +0000 (02:11 +0000)]
Web Inspector: Settings: indent type and size settings aren't respected everywhere
https://bugs.webkit.org/show_bug.cgi?id=198804

Reviewed by Timothy Hatcher.

* UserInterface/Views/CodeMirrorEditor.js:
(WI.CodeMirrorEditor.create):
When creating a `CodeMirror` instance, default to using the global `Setting`s as the options.
If an override is specified in `options`, it will take precedence and the `CodeMirror` will
ignore any changes to the `Setting` as well.

* UserInterface/Views/TextEditor.js:
(WI.TextEditor):
(WI.TextEditor.prototype.close): Deleted.

* UserInterface/Views/AuditTestCaseContentView.js:
(WI.AuditTestCaseContentView.prototype.layout):
* UserInterface/Views/BreakpointActionView.js:
(WI.BreakpointActionView.prototype._updateBody):
* UserInterface/Views/ConsolePrompt.js:
(WI.ConsolePrompt):
* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
(WI.ScopeChainDetailsSidebarPanel.prototype._addWatchExpressionButtonClicked):
Remove overrides that aren't necessary for `CodeMirror` to fit in the container element:
 - `showWhitespaceCharacters`
 - `indentWithTabs`
 - `indentUnit`

* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.close):
* UserInterface/Views/ShaderProgramContentView.js:
(WI.ShaderProgramContentView.prototype.closed): Deleted.
* UserInterface/Views/TextContentView.js:
(WI.TextContentView.prototype.closed): Deleted.
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView.prototype.closed):
Delete the logic for removing event listeners from global `Setting`, as it didn't work
anyways, since none of the event listeners were added using a `thisObject`.

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

9 months ago[WinCairo][WebKitTestRunner] pixel image dump outputs blank images
Hironori.Fujii@sony.com [Fri, 14 Jun 2019 01:51:09 +0000 (01:51 +0000)]
[WinCairo][WebKitTestRunner] pixel image dump outputs blank images
https://bugs.webkit.org/show_bug.cgi?id=198820

Reviewed by Ross Kirsling.

WebView window paints nothing because it is moved out of the
screen. Send WM_PRINT with memory DC instead of WM_PAINT as well
as DumpRenderTree does.

* WebKitTestRunner/win/PlatformWebViewWin.cpp:
(WTR::PlatformWebView::windowSnapshotImage): Send WM_PRINT instead of BitBlt.

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

9 months ago[iOS] Normalize test result of fast/events/ios/keyboard-event-key-attribute.html...
dbates@webkit.org [Thu, 13 Jun 2019 23:01:57 +0000 (23:01 +0000)]
[iOS] Normalize test result of fast/events/ios/keyboard-event-key-attribute.html to handle possible modifier dispatch
https://bugs.webkit.org/show_bug.cgi?id=198835
<rdar://problem/46082708>

Reviewed by Darin Adler.

WebKit now knows how to handle flag change events on iOS and dispatch DOM events just like Mac.
Until USE(UIKIT_KEYBOARD_ADDITIONS) is enabled by default WebKit does not expect to receive
modifier flag changes. But once this compile time flag is enabled it will and the test
fast/events/ios/keyboard-event-key-attribute.html will fail because it types '@' and only
expects to see a single keydown for '@' even though it actually requires two key downs to
generate an '@': Shift, and 2 (on a US keyboard layout). We have a bunch of other tests to
check that modifier key presses generate DOM events. So, let's just normalize the result of
this test to ignore Shift keydowns.

* fast/events/ios/keyboard-event-key-attribute.html:

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

9 months agoTest gardening after r246406
tsavell@apple.com [Thu, 13 Jun 2019 21:59:41 +0000 (21:59 +0000)]
Test gardening after r246406
https://bugs.webkit.org/show_bug.cgi?id=198774

Unreviewed test gardening.

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

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

9 months agoAVKit play button bypasses MediaElementSession playbackPermitted() checks.
jer.noble@apple.com [Thu, 13 Jun 2019 21:26:33 +0000 (21:26 +0000)]
AVKit play button bypasses MediaElementSession playbackPermitted() checks.
https://bugs.webkit.org/show_bug.cgi?id=198813

Reviewed by Eric Carlson.

HTMLMediaElement::togglePlayState() is an internal-only method that doesn't
run playbackPermitted() checks. For our imitation AVPlayerController, translate
requests to -togglePlayback: into calls to play() and pause() depending on
playback state.

* platform/ios/WebAVPlayerController.mm:
(-[WebAVPlayerController togglePlayback:]):

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

9 months agoMake it possible for validate-committer-lists to dump a mailmap file
timothy_horton@apple.com [Thu, 13 Jun 2019 21:22:21 +0000 (21:22 +0000)]
Make it possible for validate-committer-lists to dump a mailmap file
https://bugs.webkit.org/show_bug.cgi?id=198517

Reviewed by Simon Fraser.

.:

* .gitignore:
Ignore .mailmap files.

Tools:

Mailmaps wildly improve the output of various Git tools, including
`git shortlog -sne`, mapping committers to our canonical name/email pair.

* Scripts/validate-committer-lists:
(CommitterListFromGit):
(CommitterListBugzillaChecker.print_committers_with_invalid_bugzilla_emails):
Add some missing legacy username mappings.

(dump_mailmap):
(dump_mailmap.format_email):
(dump_mailmap.format_email_with_gitsvn_uuid):
(dump_mailmap.map_emails_to_legacy_username):
(main):
Add `validate-committer-lists --dump-mailmap`, which generates
one given committers.json and the existing mapping of legacy username
to email addresses that exists in validate-committer-lists.

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

9 months agoNo content shows up for WKWebView while locked even with _canShowWhileLocked is YES
timothy_horton@apple.com [Thu, 13 Jun 2019 21:20:26 +0000 (21:20 +0000)]
No content shows up for WKWebView while locked even with _canShowWhileLocked is YES
https://bugs.webkit.org/show_bug.cgi?id=198819
<rdar://problem/51636240>

Reviewed by Simon Fraser.

* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::didCreateContextForVisibilityPropagation):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::contextIDForVisibilityPropagation const):
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::contextIDForVisibilityPropagation): Deleted.
* UIProcess/WebProcessProxy.messages.in:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _setupVisibilityPropagationView]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didCreateContextForVisibilityPropagation): Deleted.
* UIProcess/ios/WebProcessProxyIOS.mm:
(WebKit::WebProcessProxy::didCreateContextForVisibilityPropagation): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shrinkToFitContentTimer):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebProcess.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
Move the creation of the visibility propagation context to WebPage instead of WebProcess,
because canShowWhileLocked is per-page, not per-process.

Also, pass canShowWhileLocked into the context creation function for the visibility
propagation context, not just RemoteLayerTree contexts.

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

9 months agorun-webkit-tests: Correctly garden fast/events/ios, fast/forms/ios tests
jbedard@apple.com [Thu, 13 Jun 2019 20:55:59 +0000 (20:55 +0000)]
run-webkit-tests: Correctly garden fast/events/ios, fast/forms/ios tests
https://bugs.webkit.org/show_bug.cgi?id=198798

Reviewed by Aakash Jain.

Any expectations for fast/events/ios and fast/forms/ios tests are overriden
in ios-wk2 expectations, remove them since they don't do anything.

* platform/ios-device/TestExpectations:
* platform/ios-wk1/TestExpectations:
* platform/ios/TestExpectations:
* platform/ipad/TestExpectations:

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

9 months agowebgpu/compute-squares.html is crashing on HighSierra
sroberts@apple.com [Thu, 13 Jun 2019 20:36:42 +0000 (20:36 +0000)]
webgpu/compute-squares.html is crashing on HighSierra
https://bugs.webkit.org/show_bug.cgi?id=198841

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations: Skipping on High Sierra

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

9 months agoWeb Inspector: Settings: sticky header disappears when over scrolling
drousso@apple.com [Thu, 13 Jun 2019 20:00:01 +0000 (20:00 +0000)]
Web Inspector: Settings: sticky header disappears when over scrolling
https://bugs.webkit.org/show_bug.cgi?id=198833

Reviewed by Joseph Pecoraro.

* UserInterface/Views/SettingsTabContentView.css:
(.content-view.settings .navigation-bar):
(.content-view.settings > .settings-view): Added.
(.content-view.settings): Deleted.

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

9 months agoUnreviewed, rolling out r246396 and r246397.
sroberts@apple.com [Thu, 13 Jun 2019 19:06:31 +0000 (19:06 +0000)]
Unreviewed, rolling out r246396 and r246397.
https://bugs.webkit.org/show_bug.cgi?id=198837

Breaks internal builds (Requested by ShawnRoberts on #webkit).

Reverted changesets:

"[WHLSL] Hook up compute"
https://bugs.webkit.org/show_bug.cgi?id=198644
https://trac.webkit.org/changeset/246396

"[WHLSL] Hook up compute"
https://bugs.webkit.org/show_bug.cgi?id=198644
https://trac.webkit.org/changeset/246397

Patch by Commit Queue <commit-queue@webkit.org> on 2019-06-13

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

9 months agoYarr bytecode compilation failure should be gracefully handled
ysuzuki@apple.com [Thu, 13 Jun 2019 18:47:22 +0000 (18:47 +0000)]
Yarr bytecode compilation failure should be gracefully handled
https://bugs.webkit.org/show_bug.cgi?id=198700

Reviewed by Michael Saboff.

JSTests:

* stress/regexp-bytecode-compilation-fail.js: Added.
(shouldThrow):

Source/JavaScriptCore:

Currently, we assume that Yarr bytecode compilation does not fail. But in fact it can fail.
We should gracefully handle this failure as a runtime error, as we did for parse errors in [1].
We also harden Yarr's consumed character calculation by using Checked.

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

* inspector/ContentSearchUtilities.cpp:
(Inspector::ContentSearchUtilities::findMagicComment):
* runtime/RegExp.cpp:
(JSC::RegExp::byteCodeCompileIfNecessary):
(JSC::RegExp::compile):
(JSC::RegExp::compileMatchOnly):
* runtime/RegExpInlines.h:
(JSC::RegExp::matchInline):
* yarr/YarrErrorCode.cpp:
(JSC::Yarr::errorMessage):
(JSC::Yarr::errorToThrow):
* yarr/YarrErrorCode.h:
* yarr/YarrInterpreter.cpp:
(JSC::Yarr::ByteCompiler::ByteCompiler):
(JSC::Yarr::ByteCompiler::compile):
(JSC::Yarr::ByteCompiler::atomCharacterClass):
(JSC::Yarr::ByteCompiler::atomBackReference):
(JSC::Yarr::ByteCompiler::atomParenthesesOnceBegin):
(JSC::Yarr::ByteCompiler::atomParenthesesTerminalBegin):
(JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
(JSC::Yarr::ByteCompiler::atomParentheticalAssertionBegin):
(JSC::Yarr::ByteCompiler::popParenthesesStack):
(JSC::Yarr::ByteCompiler::closeAlternative):
(JSC::Yarr::ByteCompiler::closeBodyAlternative):
(JSC::Yarr::ByteCompiler::alternativeBodyDisjunction):
(JSC::Yarr::ByteCompiler::alternativeDisjunction):
(JSC::Yarr::ByteCompiler::emitDisjunction):

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

9 months agotwitch.tv: embedded video hovers down the screen when scrolling on iPad
antti@apple.com [Thu, 13 Jun 2019 18:36:03 +0000 (18:36 +0000)]
twitch.tv: embedded video hovers down the screen when scrolling on iPad
https://bugs.webkit.org/show_bug.cgi?id=198832
<rdar://problem/51541439>

Reviewed by Simon Fraser.

Source/WebCore:

Test: compositing/scrolling/async-overflow-scrolling/overflow-scroll-paint-order-sibling.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):

Overflow scroll layer may have composited descendants that are its paint order siblings. We need to invalidate
the tree of the paint order parent for compositing update (instead of just the tree of the overflow scroll layer).

This matches what RenderLayer::updateLayerPosition() does.

LayoutTests:

* compositing/scrolling/async-overflow-scrolling/overflow-scroll-paint-order-sibling-expected.html: Added.
* compositing/scrolling/async-overflow-scrolling/overflow-scroll-paint-order-sibling.html: Added.

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

9 months agoImport WPT websockets tests
youenn@apple.com [Thu, 13 Jun 2019 18:35:26 +0000 (18:35 +0000)]
Import WPT websockets tests
https://bugs.webkit.org/show_bug.cgi?id=198774

Reviewed by Geoffrey Garen.

LayoutTests/imported/w3c:

* resources/import-expectations.json:
* resources/resource-files.json:
* web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/abort.sub.window-expected.txt:
Rebasing since we now have some websockets specific handlers.
* web-platform-tests/websockets: Added.

LayoutTests:

* platform/mac-wk1/TestExpectations:
* TestExpectations:
* tests-options.json:

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

9 months agoSocketStreamHandle should not be destroyed in a background thread
youenn@apple.com [Thu, 13 Jun 2019 18:14:31 +0000 (18:14 +0000)]
SocketStreamHandle should not be destroyed in a background thread
https://bugs.webkit.org/show_bug.cgi?id=198781

Reviewed by Geoffrey Garen.

Make sure to destroy SocketStreamHandle on the main thread since it owns an URL created on the main thread.
Covered by WPT websocket tests from https://bugs.webkit.org/show_bug.cgi?id=198774.

* platform/network/SocketStreamHandle.cpp:
(WebCore::SocketStreamHandle::SocketStreamHandle):
* platform/network/SocketStreamHandle.h:

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

9 months ago"display: contents" Content click does not trigger
commit-queue@webkit.org [Thu, 13 Jun 2019 16:05:27 +0000 (16:05 +0000)]
"display: contents" Content click does not trigger
https://bugs.webkit.org/show_bug.cgi?id=198559
<rdar://problem/51488524>

Patch by Antoine Quint <graouts@apple.com> on 2019-06-13
Reviewed by Antti Koivisto.

Source/WebCore:

Test: fast/events/ios/click-event-and-display-contents.html

* dom/Element.h:

Source/WebKit:

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

LayoutTests:

Add a new test that checks that tapping on an element with "display: contents" correctly gets a "click" event.

* fast/events/ios/click-event-and-display-contents-expected.txt: Added.
* fast/events/ios/click-event-and-display-contents.html: Added.

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

9 months agoUpdate service worker test and expectation after revision 246363
youenn@apple.com [Thu, 13 Jun 2019 15:07:18 +0000 (15:07 +0000)]
Update service worker test and expectation after revision 246363
https://bugs.webkit.org/show_bug.cgi?id=198808

Reviewed by Geoffrey Garen.

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/fetch-event-async-respond-with.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event-async-respond-with.https.html:
Make sure the fetch load finishes so that removing the frame does not cancel the fetch.

LayoutTests:

* TestExpectations:
Skip timing out test in Debug

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