WebKit-https.git
4 months agoresults.webkit.org: Fix drawer style
jbedard@apple.com [Thu, 22 Aug 2019 05:33:33 +0000 (05:33 +0000)]
results.webkit.org: Fix drawer style
https://bugs.webkit.org/show_bug.cgi?id=200988

Rubber-stamped by Aakash Jain.

* resultsdbpy/resultsdbpy/view/static/js/drawer.js:
(Drawer): Nothing in the drawer should be selectable.
(ConfigurationSelectors): Standardize text size, remove underscore from expanders.
* resultsdbpy/resultsdbpy/view/static/library/css/webkit.css:
(.action:hover): Disable underline on 'links' which are actually actions
(.unselectable): Make a div unselectable.
* resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js:
(Timeline.ExpandableSeriesWithHeaderExpanderComponent): Remove underscore from expanders.

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

4 months ago[WHLSL] Improve default constructor and emit fewer pointers in metal codegen
sbarati@apple.com [Thu, 22 Aug 2019 02:55:32 +0000 (02:55 +0000)]
[WHLSL] Improve default constructor and emit fewer pointers in metal codegen
https://bugs.webkit.org/show_bug.cgi?id=200995

Reviewed by Myles C. Maxfield.

This patch makes it so that we:
1. Emit less code for copy constructors by omitting an unused variable.
2. Emit ternary expressions instead of if statements for conditional assignments.
3. Don't copy pointers for producing an lvalue from DereferenceExpression.
4. Lazily produce lvalues for GlobalVariableReference.

* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
(WebCore::WHLSL::Metal::inlineNativeFunction):

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

4 months ago[WHLSL] Vertex shader and fragment shader need to be able to come from two different...
mmaxfield@apple.com [Thu, 22 Aug 2019 02:50:21 +0000 (02:50 +0000)]
[WHLSL] Vertex shader and fragment shader need to be able to come from two different programs
https://bugs.webkit.org/show_bug.cgi?id=195446

Reviewed by Saam Barati.

Source/WebCore:

When an author configures WebGPU to render things, the author provides a vertex shader and a fragment
shader, and they both execute within the same draw call. It's common for authors coming from WebGL to
put the two shaders in distinct files. Until this patch, WHLSL was unable to process two shaders from
different sources which were meant to be hooked together.

The first thing this patch does is add the notion of a "shader module" to the WHLSL compiler. This
represents the source code containing one or more shaders. When the author wants to actually compile
their source, they supply one or more shader modules to the compiler. The compiler then looks in the
first module for the vertex shader and the second module for the fragment shader. The two modules are
passed by reference, so they may refer to the same underlying object, which is supported.

Shader modules have this interesting behavior where, within a shader module, funtion / type names may
refer to each other, but may not refer to any other name within any other shader module. They behave
as if all the names inside the module are not exported. So, it would seem that the most natural way to
support this would be to run the WHLSL compiler and the MSL compiler twice independently, once for each
module. However, this means that our compile times would double, which would be unfortunate. Instead,
a more performant option would be to make the WHLSL compiler smart enough to handle multiple shader
modules at once, and to produce a single merged output program that contains everything. It does this
by parsing all the shader modules into a single Program object, but remembering which items in the
Program came from which places.

This is implemented by teaching the WHLSL compiler about "namespaces." There are three namespaces: one
for each shader module, and an additional one for the standard library. Every global object (e.g.
named types and functions) knows which namespace it lives inside. The NameResolver has been educated
to understand namespaces, so when you ask it for a name in a particular namespace, it will look up
all the names both in that namespace and in the standard library's namespace, and it will union the
results together.

Function overload resolution doesn't actually go through the name resolver; instead, it's handled by
sorting all functions into buckets such that any CallExpression only has to look in a single bucket
to find all its potential overloads. These buckets can't be educated about namespaces (consider a
function which has overloads in all 3 namespaces that is called from both shader modules - all the
overloads must end up in the same bucket). Therefore, this logic is moved into
resolveFunctionOverload(), which will now disregard candidate functions if they are in an inaccessible
namespace.

Tests: webgpu/whlsl/separate-shader-modules/separate-shader-modules-10.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-11.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-12.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-13.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-14.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-15.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-16.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-17.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-18.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-19.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-2.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-20.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-21.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-22.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-23.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-24.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-25.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-26.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-27.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-3.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-4.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-5.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-6.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-7.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-8.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules-9.html
       webgpu/whlsl/separate-shader-modules/separate-shader-modules.html

* Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
(WebCore::WHLSL::AST::FunctionDeclaration::nameSpace const):
(WebCore::WHLSL::AST::FunctionDeclaration::setNameSpace):
* Modules/webgpu/WHLSL/AST/WHLSLNameSpace.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.h.
* Modules/webgpu/WHLSL/AST/WHLSLNamedType.h:
(WebCore::WHLSL::AST::NamedType::nameSpace const):
(WebCore::WHLSL::AST::NamedType::setNameSpace):
* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
(WebCore::WHLSL::Metal::emitMetalFunctions):
* Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
(WebCore::WHLSL::DuplicateFunctionKey::operator== const):
* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
(WebCore::WHLSL::FunctionKey::operator== const):
(WebCore::WHLSL::checkOperatorOverload):
(WebCore::WHLSL::Checker::checkShaderType):
(WebCore::WHLSL::Checker::visit):
(WebCore::WHLSL::Checker::resolveFunction):
* Modules/webgpu/WHLSL/WHLSLLexer.cpp:
* Modules/webgpu/WHLSL/WHLSLNameContext.cpp:
(WebCore::WHLSL::NameContext::add):
(WebCore::WHLSL::NameContext::getTypes):
(WebCore::WHLSL::NameContext::getFunctions):
(WebCore::WHLSL::NameContext::searchTypes const):
(WebCore::WHLSL::NameContext::searchFunctions const):
(WebCore::WHLSL::NameContext::globalExists const):
(WebCore::WHLSL::NameContext::localExists const):
(WebCore::WHLSL::NameContext::exists): Deleted.
* Modules/webgpu/WHLSL/WHLSLNameContext.h:
(WebCore::WHLSL::NameContext::setCurrentNameSpace):
* Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
(WebCore::WHLSL::NameResolver::NameResolver):
(WebCore::WHLSL::NameResolver::visit):
(WebCore::WHLSL::resolveNamesInTypes):
(WebCore::WHLSL::resolveTypeNamesInFunctions):
* Modules/webgpu/WHLSL/WHLSLNameResolver.h:
(WebCore::WHLSL::NameResolver::setCurrentNameSpace):
* Modules/webgpu/WHLSL/WHLSLParser.cpp:
(WebCore::WHLSL::Parser::parse):
(WebCore::WHLSL::Parser::fail):
(WebCore::WHLSL::Parser::consumeIntegralLiteral):
(WebCore::WHLSL::Parser::consumeNonNegativeIntegralLiteral):
(WebCore::WHLSL::Parser::parseConstantExpression):
(WebCore::WHLSL::Parser::parseTypeSuffixAbbreviated):
(WebCore::WHLSL::Parser::parseTypeSuffixNonAbbreviated):
(WebCore::WHLSL::Parser::parseBuiltInSemantic):
(WebCore::WHLSL::Parser::parseResourceSemantic):
(WebCore::WHLSL::Parser::parseStageInOutSemantic):
(WebCore::WHLSL::Parser::parseEnumerationDefinition):
(WebCore::WHLSL::Parser::parseEnumerationMember):
(WebCore::WHLSL::Parser::parseNumThreadsFunctionAttribute):
(WebCore::WHLSL::Parser::parseVertexOrFragmentFunctionDeclaration):
(WebCore::WHLSL::Parser::parseRegularFunctionDeclaration):
(WebCore::WHLSL::Parser::parseSwitchCase):
(WebCore::WHLSL::Parser::parseForLoop):
(WebCore::WHLSL::Parser::parseVariableDeclarations):
(WebCore::WHLSL::Parser::completeAssignment):
(WebCore::WHLSL::Parser::parsePossibleTernaryConditional):
(WebCore::WHLSL::Parser::parseTerm):
* Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
(WebCore::WHLSL::ShaderModule::ShaderModule):
(WebCore::WHLSL::createShaderModule):
(WebCore::WHLSL::ShaderModuleDeleter::operator()):
(WebCore::WHLSL::prepareShared):
(WebCore::WHLSL::prepare):
* Modules/webgpu/WHLSL/WHLSLPrepare.h:
* Modules/webgpu/WHLSL/WHLSLProgram.h:
(WebCore::WHLSL::Program::append):
* Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
(WebCore::WHLSL::resolveFunctionOverloadImpl):
(WebCore::WHLSL::resolveFunctionOverload):
* Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.h:
* Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp:
(WebCore::WHLSL::matchSemantics):
(WebCore::WHLSL::findEntryPoint): Deleted.
* Modules/webgpu/WHLSL/WHLSLSemanticMatcher.h:
* Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
(WebCore::WHLSL::includeStandardLibrary):
* Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.h:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUShaderModule.h:
(WebCore::GPUShaderModule::platformShaderModule const):
(WebCore::GPUShaderModule::whlslModule const):
(WebCore::GPUShaderModule::whlslSource const): Deleted.
* platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
(WebCore::trySetFunctions):
(WebCore::convertComputePipelineDescriptor):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::trySetMetalFunctions):
(WebCore::trySetFunctions):
(WebCore::convertRenderPipelineDescriptor):
* platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm:
(WebCore::GPUShaderModule::tryCreate):
(WebCore::GPUShaderModule::GPUShaderModule):

LayoutTests:

* webgpu/whlsl/separate-shader-modules/separate-shader-modules-10-expected.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-10.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-11-expected.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-11.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-12-expected.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-12.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-13-expected.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-13.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-14-expected.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-14.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-15-expected.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-15.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-16-expected.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-16.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-17-expected.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-17.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-18-expected.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-18.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-19-expected.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-19.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-2-expected.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-2.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-20-expected.txt: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-20.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-21-expected.txt: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-21.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-22-expected.txt: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-22.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-23-expected.txt: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-23.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-24-expected.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-24.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-25-expected.txt: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-25.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-26-expected.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-26.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-27-expected.txt: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-27.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-3-expected.txt: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-3.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-4-expected.txt: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-4.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-5-expected.txt: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-5.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-6-expected.txt: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-6.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-7-expected.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-7.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-8-expected.txt: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-8.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-9-expected.txt: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-9.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules-expected.html: Added.
* webgpu/whlsl/separate-shader-modules/separate-shader-modules.html: Added.

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

4 months agoFix infinite recursion in WTFCrashWithInfo() after r248930.
mark.lam@apple.com [Thu, 22 Aug 2019 02:44:01 +0000 (02:44 +0000)]
Fix infinite recursion in WTFCrashWithInfo() after r248930.
https://bugs.webkit.org/show_bug.cgi?id=201022

Reviewed by Saam Barati.

* wtf/Assertions.cpp:
(WTFCrashWithInfoImpl):
(WTFCrashWithInfo): Deleted.
* wtf/Assertions.h:
(WTFCrashWithInfo):

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

4 months agoWeb Inspector: RTL: DOM outline in Elements tab should be LTR
nvasilyev@apple.com [Thu, 22 Aug 2019 02:33:40 +0000 (02:33 +0000)]
Web Inspector: RTL: DOM outline in Elements tab should be LTR
https://bugs.webkit.org/show_bug.cgi?id=200601

Reviewed by Timothy Hatcher.

Make DOM outlines in Console and Elements tab always LTR,
and unsure that Left and Right arrow keys continue working correctly.

* UserInterface/Base/Main.js:
(WI.resolveLayoutDirectionForElement): Added.
The existing WI.resolvedLayoutDirection function returns the value of the root DOM element.
The newly added resolveLayoutDirectionForElement function returns the correct value for any element,
including elements with `dir=ltr` inside of `<body dir=rtl>`.

* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom li:matches(.hovered, .selected) + ol.children.expanded):
(.tree-outline.dom li:not(.editing)):
(.tree-outline.dom li.editing):
(.tree-outline.dom li .pseudo-class-indicator):
(.tree-outline.dom.single-node li):
(.tree-outline.dom li.parent):
(.tree-outline.dom li .html-tag.close):
(.tree-outline.dom li.parent::before):
(.tree-outline.dom li.parent.shadow::after):
Remove RTL logic.

* UserInterface/Views/DOMTreeOutline.js:
* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype._treeKeyDown):
Make Left and Right arrow keys work correctly for LTR DOM outlines inside of the global RTL.

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

4 months ago[Win][MiniBrowser] Add a progress indicator to the main window
Hironori.Fujii@sony.com [Thu, 22 Aug 2019 01:49:48 +0000 (01:49 +0000)]
[Win][MiniBrowser] Add a progress indicator to the main window
https://bugs.webkit.org/show_bug.cgi?id=200970

Reviewed by Alex Christensen.

* MiniBrowser/win/BrowserWindow.h: Added BrowserWindowClient class.
* MiniBrowser/win/MainWindow.cpp:
(MainWindow::init):
(MainWindow::resizeSubViews):
(MainWindow::progressChanged):
(MainWindow::progressFinished):
* MiniBrowser/win/MainWindow.h: Inherited BrowserWindowClient.
Added m_hProgressIndicator.
(MainWindow::hwnd const): Deleted.
(MainWindow::browserWindow const): Deleted.
(): Deleted.
* MiniBrowser/win/MiniBrowserWebHost.cpp:
(MiniBrowserWebHost::onNotify):
* MiniBrowser/win/MiniBrowserWebHost.h:
* MiniBrowser/win/WebKitBrowserWindow.cpp:
(WebKitBrowserWindow::create):
(WebKitBrowserWindow::WebKitBrowserWindow):
(WebKitBrowserWindow::didChangeIsLoading):
(WebKitBrowserWindow::didChangeEstimatedProgress):
(WebKitBrowserWindow::createNewPage):
* MiniBrowser/win/WebKitBrowserWindow.h:
* MiniBrowser/win/WebKitLegacyBrowserWindow.cpp:
(WebKitLegacyBrowserWindow::create):
(WebKitLegacyBrowserWindow::WebKitLegacyBrowserWindow):
(WebKitLegacyBrowserWindow::init):
* MiniBrowser/win/WebKitLegacyBrowserWindow.h:

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

4 months agoWasm::FunctionParser is failing to enforce maxFunctionLocals.
mark.lam@apple.com [Thu, 22 Aug 2019 01:42:22 +0000 (01:42 +0000)]
Wasm::FunctionParser is failing to enforce maxFunctionLocals.
https://bugs.webkit.org/show_bug.cgi?id=201016
<rdar://problem/54579911>

Reviewed by Yusuke Suzuki.

JSTests:

* wasm/stress/too-many-locals.js: Added.
(import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.catch):

Source/JavaScriptCore:

Currently, Wasm::FunctionParser is allowing

    maxFunctionParams + maxFunctionLocals * maxFunctionLocals

... locals, which is 0x9502FCE8.  It should be enforcing max locals of
maxFunctionLocals instead.

* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::parse):

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

4 months agoSVG element should become focusable when focus and key event listeners are added
rniwa@webkit.org [Thu, 22 Aug 2019 00:34:48 +0000 (00:34 +0000)]
SVG element should become focusable when focus and key event listeners are added
https://bugs.webkit.org/show_bug.cgi?id=200997

Reviewed by Said Abou-Hallawa.

Source/WebCore:

This patch removes the odd behavior WebKit (and Blink) browsers had to make SVG elements
with key or focus event listeners focusable. New behavior matches the behavior of Firefox
as well as the SVG 2.0 specification: https://www.w3.org/TR/SVG2/interact.html#Focus

Test: svg/custom/tabindex-order.html

* svg/SVGAElement.cpp:
(WebCore::SVGAElement::supportsFocus const):
* svg/SVGElement.cpp:
(WebCore::SVGElement::hasFocusEventListeners const): Deleted.
(WebCore::SVGElement::isMouseFocusable const): Deleted.
* svg/SVGElement.h:
* svg/SVGGraphicsElement.h:

LayoutTests:

Updated existing tests to set tabIndex where appropriate, and added SVG elements
without tabindex content attribute to tabindex-order.html so that the test would
skip those elements when sequentially focus navigating across them.

* svg/custom/add-event-listener-shadow-tree-element.html:
* svg/custom/resources/focus-event-handling-keyboard.js:
* svg/custom/resources/focus-event-handling.js:
* svg/custom/tabindex-order-expected.txt:
* svg/custom/tabindex-order.html: Added test cases without tabindex.

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

4 months agoUnreviewed, rolling out r248970.
ryanhaddad@apple.com [Thu, 22 Aug 2019 00:23:15 +0000 (00:23 +0000)]
Unreviewed, rolling out r248970.

Caused
lldb_webkit_unittest.TestSummaryProviders.serial_test_WTFOptionSetProvider_empty
to fail.

Reverted changeset:

"[lldb-webkit] OptionSet summary shows size 0 sometimes for
non-empty set"
https://bugs.webkit.org/show_bug.cgi?id=200742
https://trac.webkit.org/changeset/248970

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

4 months agoresults.webkit.org: Add database table to save zip archives to
jbedard@apple.com [Thu, 22 Aug 2019 00:21:50 +0000 (00:21 +0000)]
results.webkit.org: Add database table to save zip archives to
https://bugs.webkit.org/show_bug.cgi?id=200718

Rubber-stamped by Aakash Jain.

* resultsdbpy/resultsdbpy/model/archive_context.py: Added.
(ArchiveContext):
(ArchiveContext.ArchivesByCommit): Store archives to be retrieved by commit and configuration.
(ArchiveContext.ArchivesByCommit.unpack):
(ArchiveContext.assert_zipfile):
(ArchiveContext.open_zipfile):
(ArchiveContext.__init__):
(ArchiveContext.__enter__):
(ArchiveContext.__exit__):
(ArchiveContext.register): Save the provided archive to Cassandra.
(ArchiveContext.find_archive): Find all archives matching the specified criteria.
(ArchiveContext._files_for_archive):
(ArchiveContext.ls): List all files in the matching archives.
(ArchiveContext.file): Extract a file from the matching archives.
* resultsdbpy/resultsdbpy/model/archive_context_unittest.py: Added.
(ArchiveContextTest):
* resultsdbpy/resultsdbpy/model/mock_model_factory.py:
(MockModelFactory):
(MockModelFactory.process_results):
(MockModelFactory.add_mock_archives):
* resultsdbpy/resultsdbpy/model/model.py:
(Model.__init__): Add an ArchiveContext to the model.

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

4 months agoAdopt AVSystemController_ActiveAudioRouteDidChangeNotification
jer.noble@apple.com [Thu, 22 Aug 2019 00:11:28 +0000 (00:11 +0000)]
Adopt AVSystemController_ActiveAudioRouteDidChangeNotification
https://bugs.webkit.org/show_bug.cgi?id=200992
<rdar://problem/54408993>

Reviewed by Eric Carlson.

Follow-up to r248962: When the active audio route changes, and the
system instructs us to pause, only pause the currently audible sessions.

* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::activeAudioRouteDidChange):
(-[WebMediaSessionHelper activeAudioRouteDidChange:]):
(WebCore::MediaSessionManageriOS::activeRouteDidChange): Deleted.

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

4 months agoDo not adjust viewport if editing selection is already visible
megan_gardner@apple.com [Thu, 22 Aug 2019 00:06:38 +0000 (00:06 +0000)]
Do not adjust viewport if editing selection is already visible
https://bugs.webkit.org/show_bug.cgi?id=200907
<rdar://problem/53903417>

Reviewed by Simon Fraser.

Source/WebCore:

Test: fast/scrolling/ios/autoscroll-input-when-very-zoomed.html

Currently due to scrolling being mostly handled by integers, we are getting
issues with rounding errors when trying to adjust the viewport while
editing text when we are significantly zoomed in. The real fix would be to
start dealing with scrolling with floats/doubles, but until such time,
we should early out of adjusting selections that we are certain are currently
visible.

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

LayoutTests:

* fast/scrolling/ios/autoscroll-input-when-very-zoomed-expected.txt: Added.
* fast/scrolling/ios/autoscroll-input-when-very-zoomed.html: Added.
* resources/ui-helper.js:
(window.UIHelper.immediateZoomToScale):

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

4 months ago[ews-build] view layout test results option should be displayed next to layout-test...
aakash_jain@apple.com [Wed, 21 Aug 2019 23:56:24 +0000 (23:56 +0000)]
[ews-build] view layout test results option should be displayed next to layout-test build step
https://bugs.webkit.org/show_bug.cgi?id=200048

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(ExtractTestResults.getLastBuildStepByName): Method to return the last build-step matching the step name.
(ExtractTestResults.addCustomURLs): Add urls to corresponding layout-test step.

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

4 months ago[ews] Fix capitalization in Found x new Test failure message
aakash_jain@apple.com [Wed, 21 Aug 2019 23:51:34 +0000 (23:51 +0000)]
[ews] Fix capitalization in Found x new Test failure message
https://bugs.webkit.org/show_bug.cgi?id=201004

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/ews-build/steps.py:
(AnalyzeLayoutTestsResults.report_failure):
(AnalyzeAPITestsResults.analyzeResults):
* BuildSlaveSupport/ews-build/steps_unittest.py: Updated unit-tests accordingly.

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

4 months ago[Mail] Tapping top of message scrolls back to copied text instead of top of the message
timothy_horton@apple.com [Wed, 21 Aug 2019 23:05:26 +0000 (23:05 +0000)]
[Mail] Tapping top of message scrolls back to copied text instead of top of the message
https://bugs.webkit.org/show_bug.cgi?id=200999
<rdar://problem/54564878>

Reviewed by Wenson Hsieh.

Source/WebCore:

Test: editing/selection/ios/change-selection-by-tapping-with-existing-selection.html

* page/EditorClient.h:
(WebCore::EditorClient::shouldAllowSingleClickToChangeSelection const):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEventSingleClick):
Instead of encoding platform behaviors in EventHandler, defer to EditorClient.

Source/WebKit:

In the case where you have a WebCore selection but are not first responder,
when you tap the WKWebView to become first responder, EventHandler would
bail from setting the selection, assuming UIKit was going to do it. This
behavior was introduced in r233311.

However, since we are not first responder, UIKit does not change the
selection, since it considers the view to not be editable.

Fix this by letting WebCore set the selection in this case, as it used to.

* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
(WebKit::WebEditorClient::shouldAllowSingleClickToChangeSelection const):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::isShowingInputViewForFocusedElement const):
Copy the logic from EventHandler, with the added caveat (which fixes the
aforementioned behavior) that we will allow EventHandler to change the
selection if we don't have a focused node in the UIKit sense, because
we know that the platform text interaction code will *not* change the
selection if that is the case, so it's up to us.

Source/WebKitLegacy/mac:

* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::shouldAllowSingleClickToChangeSelection const):
Copy the existing behavior from EventHandler.
We do not fix the bug in WebKitLegacy for a multitude of reasons, primarily
because we do not know of any user impact.

LayoutTests:

* editing/selection/ios/change-selection-by-tapping-with-existing-selection-expected.txt: Added.
* editing/selection/ios/change-selection-by-tapping-with-existing-selection.html: Added.

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

4 months agoCrash under NetworkCache::Data::mapToFile()
cdumez@apple.com [Wed, 21 Aug 2019 23:01:41 +0000 (23:01 +0000)]
Crash under NetworkCache::Data::mapToFile()
https://bugs.webkit.org/show_bug.cgi?id=200996
<rdar://problem/54570421>

Reviewed by Geoffrey Garen.

Make sure NetworkCache::Data::mapToFile() calls makeSafeToUseMemoryMapForPath() between
creating the file and calling mmap().

* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
(WebKit::NetworkCache::BlobStorage::add):
* NetworkProcess/cache/NetworkCacheData.cpp:
(WebKit::NetworkCache::Data::mapToFile const):

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

4 months agoAssign ews117 to EWS High-Sierra Debug queues
aakash_jain@apple.com [Wed, 21 Aug 2019 22:48:36 +0000 (22:48 +0000)]
Assign ews117 to EWS High-Sierra Debug queues
https://bugs.webkit.org/show_bug.cgi?id=200993

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/config.json:

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

4 months agoCrash under StringImpl::endsWith() in SQLiteIDBBackingStore::fullDatabaseDirectoryWit...
cdumez@apple.com [Wed, 21 Aug 2019 22:45:46 +0000 (22:45 +0000)]
Crash under StringImpl::endsWith() in SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade()
https://bugs.webkit.org/show_bug.cgi?id=200990
<rdar://problem/54566439>

Reviewed by Alex Christensen.

Make sure we call isolatedCopy() on SQLiteIDBBackingStore::m_databaseRootDirectory before using
it from background threads.

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade):
(WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
(WebCore::IDBServer::SQLiteIDBBackingStore::databaseRootDirectory const):

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

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

Reviewed by Simon Fraser.

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

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

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

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

4 months agoCrash under StringImpl::~StringImpl() in IDBServer::computeSpaceUsedForOrigin()
cdumez@apple.com [Wed, 21 Aug 2019 22:32:23 +0000 (22:32 +0000)]
Crash under StringImpl::~StringImpl() in IDBServer::computeSpaceUsedForOrigin()
https://bugs.webkit.org/show_bug.cgi?id=200989
<rdar://problem/54565546>

Reviewed by Alex Christensen.

Make sure we call isolatedCopy() on IDBServer::m_databaseDirectoryPath before using it from
background threads.

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::createBackingStore):
(WebCore::IDBServer::IDBServer::performGetAllDatabaseNames):
(WebCore::IDBServer::IDBServer::removeDatabasesModifiedSinceForVersion):
(WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince):
(WebCore::IDBServer::IDBServer::removeDatabasesWithOriginsForVersion):
(WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
(WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin):
(WebCore::IDBServer::IDBServer::upgradeFilesIfNecessary):
* Modules/indexeddb/server/IDBServer.h:
(WebCore::IDBServer::IDBServer::databaseDirectoryPath const):

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

4 months agoCrash under StringImpl::endsWith() in RegistrationDatabase::openSQLiteDatabase()
cdumez@apple.com [Wed, 21 Aug 2019 22:17:49 +0000 (22:17 +0000)]
Crash under StringImpl::endsWith() in RegistrationDatabase::openSQLiteDatabase()
https://bugs.webkit.org/show_bug.cgi?id=200991
<rdar://problem/54566689>

Reviewed by Geoffrey Garen.

Make sure we call isolatedCopy() on RegistrationDatabase::m_databaseDirectory before using
it from background threads.

* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::openSQLiteDatabase):
(WebCore::RegistrationDatabase::clearAll):
* workers/service/server/RegistrationDatabase.h:
(WebCore::RegistrationDatabase::databaseDirectory const):

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

4 months agoDisabling text autosizing should prevent text autosizing
achristensen@apple.com [Wed, 21 Aug 2019 22:03:02 +0000 (22:03 +0000)]
Disabling text autosizing should prevent text autosizing
https://bugs.webkit.org/show_bug.cgi?id=200955
<rdar://problem/48095374>

Reviewed by Simon Fraser.

Source/WebCore:

Before this change there was no way to reliably change the text size on iOS when a -webkit-text-size-adjust:none style was applied
because it would ignore the WKPreferences value for _textAutosizingEnabled.  Now that value has the desired effect when laying out.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::checkForTextSizeAdjust):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/TextSize.mm: Added.
(TEST):

LayoutTests:

* fast/text-autosizing/ios/text-size-adjust-inline-style.html:
The comment was incorrect because we call WKPreferencesSetTextAutosizingEnabled(preferences, false) in TestController::platformResetPreferencesToConsistentValues.
In order to test the effect of text autosizing in this test, we need to explicitly turn it on.  The disabling of text autosizing didn't do anything before this
patch, so it wasn't needed before now.

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

4 months ago[GTK][WPE] Make debug-test-runner work
aperez@igalia.com [Wed, 21 Aug 2019 21:49:00 +0000 (21:49 +0000)]
[GTK][WPE] Make debug-test-runner work
https://bugs.webkit.org/show_bug.cgi?id=193576

Reviewed by Michael Catanzaro.

* Scripts/webkitdirs.pm:
(wrapperPrefixIfNeeded): Only add the wrapper prefix when not running inside a Flatpak sandbox.
(setupUnixWebKitEnvironment): Added, sets TEST_RUNNER_INJECTED_BUNDLE_FILENAME and
TEST_RUNNER_TEST_PLUGIN_PATH in the environment.
(execUnixAppForDebugging): Added.
(debugWebKitTestRunner): Alternatively, use execUnixAppForDebugging() for the WPE and GTK+ ports.

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

4 months agoUnreviewed test gardening, land test expectations for rdar://54561673.
ryanhaddad@apple.com [Wed, 21 Aug 2019 21:38:22 +0000 (21:38 +0000)]
Unreviewed test gardening, land test expectations for rdar://54561673.

* platform/ios/TestExpectations:
* platform/ios-12/TestExpectations:

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

4 months agoHave NetworkCache::store() null check its completion handler before calling it
cdumez@apple.com [Wed, 21 Aug 2019 21:30:03 +0000 (21:30 +0000)]
Have NetworkCache::store() null check its completion handler before calling it
https://bugs.webkit.org/show_bug.cgi?id=200994

Reviewed by Geoffrey Garen.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
Stop passing nullptr for the completion handler now that the parameter has a default value.
Note that passing nullptr here was likely wrong since the NetworkCache::store() implementation
did not null-check the completion handler before calling it.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::store):
Have NetworkCache::store() null check its completion handler before calling it as calling
a null WTF::Function crashes.

* NetworkProcess/cache/NetworkCache.h:
Use nullptr as default parameter value for the completion handler.

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

4 months agoAdopt AVSystemController_ActiveAudioRouteDidChangeNotification
jer.noble@apple.com [Wed, 21 Aug 2019 21:29:52 +0000 (21:29 +0000)]
Adopt AVSystemController_ActiveAudioRouteDidChangeNotification
https://bugs.webkit.org/show_bug.cgi?id=200992
<rdar://problem/54408993>

Reviewed by Eric Carlson.

When the system notifies us that the active audio route has changed in such a way
that necessitates pausing, pause all media sessions, exempting those that are
associated with WebRTC, since "pausing" an active audio conference isn't really
possible.

* Modules/mediastream/MediaStream.h:
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::shouldOverridePauseDuringRouteChange const):
* platform/audio/PlatformMediaSession.h:
(WebCore::PlatformMediaSessionClient::shouldOverridePauseDuringRouteChange const):
* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::activeRouteDidChange):
(-[WebMediaSessionHelper initWithCallback:]):
(-[WebMediaSessionHelper activeAudioRouteDidChange:]):

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

4 months agoVerify Prefetch and credential behavior
commit-queue@webkit.org [Wed, 21 Aug 2019 20:26:54 +0000 (20:26 +0000)]
Verify Prefetch and credential behavior
https://bugs.webkit.org/show_bug.cgi?id=200000

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

Source/WebKit:

Cancel cross-origin prefetches for Vary: Cookie.

Test: http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
(WebKit::NetworkResourceLoader::didReceiveResponse):
* NetworkProcess/cache/PrefetchCache.cpp:
(WebKit::PrefetchCache::take):

LayoutTests:

Add a test to verify that navigating to a prefetched main resource
that sets Vary: Cookie does send cookies.

* http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie-expected.txt: Added.
* http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html: Added.
* http/wpt/prefetch/resources/main-resource-cross-origin-set-cookie.py: Added.
(main):
* http/wpt/prefetch/resources/main-resource-cross-origin-vary-cookie.py: Added.
(main):
* http/wpt/prefetch/resources/navigate-cross-origin-vary-cookie.html: Added.
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

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

4 months agoPut keygen element behind a runtime flag and disable it by default
rniwa@webkit.org [Wed, 21 Aug 2019 20:25:10 +0000 (20:25 +0000)]
Put keygen element behind a runtime flag and disable it by default
https://bugs.webkit.org/show_bug.cgi?id=200850

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Re-sycned htmlformcontrolscollection.html as of ffc0fba7d4063f0fb063b9a215dd9ef7fedefebd.

* web-platform-tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements-expected.txt:
Rebaselined due to the whitespace change due to the keygen element rendering differently.
* web-platform-tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements-xhtml-expected.txt:
Ditto.
* web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection-expected.txt:
* web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html:
* web-platform-tests/html/semantics/forms/the-label-element/labelable-elements-expected.txt: Rebaselined now that the test for keygen is passing.

Source/WebCore:

The HTML keygen element has been removed from Chrome, Firefox, and the HTML specification in 2017.
This patch disables the keygen element by default by adding a runtime enabled flag which is disabled by default.

* bindings/js/WebCoreBuiltinNames.h:
* html/HTMLKeygenElement.idl:
* html/HTMLTagNames.in:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setKeygenElementEnabled):
(WebCore::RuntimeEnabledFeatures::keygenElementEnabled const):

Source/WebKit:

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetKeygenElementEnabled):
(WKPreferencesGetKeygenElementEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:

Source/WebKitLegacy/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences keygenElementEnabled]):
(-[WebPreferences setKeygenElementEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKitLegacy/win:

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::keygenElementEnabled):
(WebPreferences::setKeygenElementEnabled):
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

Tools:

Added the support for enableKeygenElement test runner option, which enables keygen element in layout tests.

* DumpRenderTree/TestOptions.cpp:
(TestOptions::TestOptions):
* DumpRenderTree/TestOptions.h:
* DumpRenderTree/mac/DumpRenderTree.mm:
(setWebPreferencesForTestOptions):
* DumpRenderTree/win/DumpRenderTree.cpp:
(setWebPreferencesForTestOptions):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):

LayoutTests:

Deployed enableKeygenElement test runner option to keep the layout tests running.

* accessibility/content-changed-notification-causes-crash.html:
* accessibility/contenteditable-table-check-causes-crash.html:
* accessibility/duplicate-axrenderobject-crash.html:
* fast/block/float/float-not-removed-from-first-letter.html:
* fast/block/float/split-inline-sibling-of-float-crash.html:
* fast/css/pseudo-required-optional-unapplied.html:
* fast/dom/HTMLFormElement/associated-elements-after-index-assertion-fail1.html:
* fast/dom/HTMLKeygenElement/keygen-keytype.html:
* fast/dom/HTMLKeygenElement/keygen.html:
* fast/dom/adopt-node-crash-2.html:
* fast/dom/attribute-set-before-element-in-tree.html:
* fast/dom/domstring-attribute-reflection.html:
* fast/dom/set-custom-validity-with-too-few-arguments.html:
* fast/dom/tabindex-defaults.html:
* fast/dom/wrapper-classes.html:
* fast/dynamic/insertAdjacentHTML-allowed-parents.html:
* fast/flexbox/crash-button-keygen.html:
* fast/forms/ValidityState-001.html:
* fast/forms/autofocus-keygen.html:
* fast/forms/checkValidity-001.html:
* fast/forms/fieldset/fieldset-elements-htmlcollection.html:
* fast/forms/fieldset/fieldset-elements.html:
* fast/forms/form-associated-element-crash3.html:
* fast/forms/form-attribute.html:
* fast/forms/form-collection-elements-order.html:
* fast/forms/form-collection-elements.html:
* fast/forms/form-collection-radio-node-list.html:
* fast/forms/label/labelable-elements.html:
* fast/forms/label/labels-add-htmlFor-label.html:
* fast/forms/label/labels-add-parent-label.html:
* fast/forms/label/labels-change-htmlFor-attribute.html:
* fast/forms/label/labels-multiple-sibling-labels.html:
* fast/forms/label/labels-parent-and-sibling-labels.html:
* fast/forms/label/labels-remove-htmlFor-attribute.html:
* fast/forms/label/labels-remove-htmlFor-label.html:
* fast/forms/label/labels-remove-parent-label.html:
* fast/forms/label/labels-set-htmlFor-attribute.html:
* fast/forms/large-parts.html:
* fast/forms/scrollheight-with-mutation-crash.html:
* fast/forms/setCustomValidity-arguments.html:
* fast/forms/setCustomValidity-existence.html:
* fast/forms/setCustomValidity-null-parameter.html:
* fast/forms/state-restore-skip-stateless.html:
* fast/forms/update-form-owner-in-moved-subtree-assertion-failure.html:
* fast/forms/validationMessage.html:
* fast/forms/willvalidate.html:
* fast/html/clone-keygen.html:
* fast/html/keygen.html:
* fast/html/marquee-reparent-check.html:
* fast/invalid/residual-style-expected.html:
* fast/invalid/residual-style.html:
* fast/multicol/span/positioned-child-not-removed-crash.html:
* fast/ruby/float-object-doesnt-crash.html:
* fast/shadow-dom/keygen-shadow-manipulation.html:
* fast/table/crash-splitColumn-2.html:
* fast/table/multiple-captions-crash3-expected.html:
* fast/table/multiple-captions-crash3.html:
* http/tests/misc/resources/check-keygen-post.php:
* http/tests/misc/submit-post-keygen.html:
* imported/blink/fast/dom/shadow/shadowdom-for-keygen-only-shadow-expected.html:
* imported/blink/fast/dom/shadow/shadowdom-for-keygen-only-shadow.html:
* imported/blink/fast/text/international-iteration-simple-text.html:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interfaces-expected.txt: Rebaselined
now that the test case for keygen is passing.
* platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/interfaces-expected.txt: Ditto.
* svg/dom/css-animate-input-foucs-crash.html:

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

4 months agoCrash under StringImpl::~StringImpl() in NetworkProcess::deleteWebsiteDataForRegistra...
cdumez@apple.com [Wed, 21 Aug 2019 20:02:35 +0000 (20:02 +0000)]
Crash under StringImpl::~StringImpl() in NetworkProcess::deleteWebsiteDataForRegistrableDomains()
https://bugs.webkit.org/show_bug.cgi?id=200986
<rdar://problem/32850192>

Reviewed by Brent Fulgham.

Code was calling postStorageTask() with a lambda that captures Strings that are not isolated copied.
The lambda would get executed on another thread so this is not safe. The CrossThreadTask constructor
does not take care of this for you, despite its name (the createCrossThreadTask() function does though).

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
(WebKit::NetworkProcess::registrableDomainsWithWebsiteData):

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

4 months agoGet rid of m_weakThis data members now that we have a safe way to call makeWeakPtr...
cdumez@apple.com [Wed, 21 Aug 2019 19:50:58 +0000 (19:50 +0000)]
Get rid of m_weakThis data members now that we have a safe way to call makeWeakPtr() from various threads
https://bugs.webkit.org/show_bug.cgi?id=200981

Reviewed by Alex Christensen.

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
(WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
(WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/mediastream/libwebrtc/LibWebRTCDTMFSenderBackend.cpp:
(WebCore::LibWebRTCDTMFSenderBackend::LibWebRTCDTMFSenderBackend):
(WebCore::LibWebRTCDTMFSenderBackend::OnToneChange):
* platform/mediastream/libwebrtc/LibWebRTCDTMFSenderBackend.h:
* platform/network/cocoa/CookieStorageObserver.h:
* platform/network/cocoa/CookieStorageObserver.mm:
(WebCore::CookieStorageObserver::CookieStorageObserver):
(WebCore::CookieStorageObserver::cookiesDidChange):

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

4 months agoAdd internal setting to disable SecureContext checks
cdumez@apple.com [Wed, 21 Aug 2019 19:36:34 +0000 (19:36 +0000)]
Add internal setting to disable SecureContext checks
https://bugs.webkit.org/show_bug.cgi?id=200980
<rdar://problem/54438512>

Reviewed by Alex Christensen.

Source/WebCore:

Add internal setting to disable SecureContext checks, in order to facilitate development
for features like Service workers or device orientation / motion.

* dom/Document.cpp:
(WebCore::Document::isSecureContext const):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::secureContextChecksEnabled const):
(WebCore::RuntimeEnabledFeatures::setSecureContextChecksEnabled):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::isSecureContext const):

Source/WebKit:

Add internal setting to disable SecureContext checks, in order to facilitate development
for features like Service workers or device orientation / motion.

* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _secureContextChecksEnabled]):
(-[WKPreferences _setSecureContextChecksEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/DeviceOrientation.mm:
(log):
(requestPermission):

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

4 months agoregistrableDomainsToRemoveWebsiteDataFor() does not need to return a HashMap
cdumez@apple.com [Wed, 21 Aug 2019 19:24:34 +0000 (19:24 +0000)]
registrableDomainsToRemoveWebsiteDataFor() does not need to return a HashMap
https://bugs.webkit.org/show_bug.cgi?id=200985

Reviewed by John Wilander.

Source/WebKit:

registrableDomainsToRemoveWebsiteDataFor() does not need to return a HashMap. It is more
efficient to simply return a Vector since we never need to look up keys.

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor):
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
(WebKit::domainsToString):
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomains):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
(WebKit::NetworkProcess::deleteCookiesForTesting):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomains):
* NetworkProcess/NetworkSession.h:

Source/WTF:

Allow calling crossThreadCopy() on a std::pair<>.

* wtf/CrossThreadCopier.h:

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

4 months agoJSTests/stress/optional-chaining should not call shouldThrowTypeError in a loop
ross.kirsling@sony.com [Wed, 21 Aug 2019 19:17:14 +0000 (19:17 +0000)]
JSTests/stress/optional-chaining should not call shouldThrowTypeError in a loop
https://bugs.webkit.org/show_bug.cgi?id=200965

Reviewed by Saam Barati.

This has nothing to do with ?. in particular, but throwing >1M type errors takes 100s in Debug on my machine.
The main idea here was to JITify the simple success cases, so let's not run the simple failures so many times.

* stress/optional-chaining.js:

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

4 months ago[GTK][WPE] Gtk-Doc fails with build options which need cooperation between CFLAGS...
aperez@igalia.com [Wed, 21 Aug 2019 18:58:13 +0000 (18:58 +0000)]
[GTK][WPE] Gtk-Doc fails with build options which need cooperation between CFLAGS and LDFLAGS
https://bugs.webkit.org/show_bug.cgi?id=200987

Reviewed by Philippe Normand.

Only CFLAGS was being set before trying to generate the documentation
but not LDFLAGS, which could cause errors when gtk-doc tries to link
a generated program when the compiler flags would also require usage
of certain linker flags later on.

* Source/cmake/GtkDoc.cmake: Also set LDFLAGS in the environment when
invoking Tools/gtkdoc/generate-gtkdoc.

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

4 months agoUnreviewed, rolling out r248942.
russell_e@apple.com [Wed, 21 Aug 2019 18:47:59 +0000 (18:47 +0000)]
Unreviewed, rolling out r248942.

Causes multiple layout test crashes on MacOS Bots

Reverted changeset:

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

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

4 months ago[iOS] HLS streams disappear from Now Playing when paused on the lock screen
jer.noble@apple.com [Wed, 21 Aug 2019 18:19:23 +0000 (18:19 +0000)]
[iOS] HLS streams disappear from Now Playing when paused on the lock screen
https://bugs.webkit.org/show_bug.cgi?id=200951
<rdar://problem/54534301>

Reviewed by Eric Carlson.

The AVPlayerItemTracks will get recreated on occasion (during seeks, and when
changing buffering policy) which can result in a player which no longer reports
that it has audio, which in turn results in Now Playing no longer considering
the web page to be an eligable now playing application. Bridge this gap by also
taking AVPlayerItem.hasEnabledAudio into account when determining whether the
player has audio.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):

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

4 months ago[JSC] incorrent JIT lead to StackOverflow
msaboff@apple.com [Wed, 21 Aug 2019 18:08:48 +0000 (18:08 +0000)]
[JSC] incorrent JIT lead to StackOverflow
https://bugs.webkit.org/show_bug.cgi?id=197823

Reviewed by Tadeu Zagallo.

JSTests:

New test.

* stress/bound-function-stack-overflow.js: Added.
(foo):
(catch):

Source/JavaScriptCore:

Added stack overflow check to the bound function thunk generator.  Added a new C++ operation
throwStackOverflowErrorFromThunk() to throw the error.

* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jit/ThunkGenerators.cpp:
(JSC::boundThisNoArgsFunctionCallGenerator):

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

4 months agoRemove support for watchOS < 6.0
krollin@apple.com [Wed, 21 Aug 2019 18:02:02 +0000 (18:02 +0000)]
Remove support for watchOS < 6.0
https://bugs.webkit.org/show_bug.cgi?id=200937
<rdar://problem/54524009>

Reviewed by Darin Adler.

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

Source/WebCore/PAL:

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

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):

Source/WTF:

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

Tools:

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

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

4 months ago[GTK] Build failure due to unwieldy definition of “None” from X11 headers
aperez@igalia.com [Wed, 21 Aug 2019 17:23:32 +0000 (17:23 +0000)]
[GTK] Build failure due to unwieldy definition of “None” from X11 headers
https://bugs.webkit.org/show_bug.cgi?id=200984

Reviewed by Carlos Alberto Lopez Perez.

* SourcesGTK.txt: Mark AcceleratedBackingStore.cpp with @no-unify
because it includes AcceleratedSurfaceX11.h when building with
ENABLE_X11_TARGET=ON, which in turn will include the X11 headers.
It is just lucky that most of the time the order of the generated
#include statements in the unified sources has been masking this
problem.

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

4 months agoAdd some IDB performance tests
sihui_liu@apple.com [Wed, 21 Aug 2019 17:21:27 +0000 (17:21 +0000)]
Add some IDB performance tests
https://bugs.webkit.org/show_bug.cgi?id=200906

Reviewed by Geoffrey Garen.

Add test coverage for IDB performance, and organize IDB tests into two categories.

* IndexedDB/basic/index-count-key.html: Added.
* IndexedDB/basic/index-count.html: Added.
* IndexedDB/basic/index-cursor-advance.html: Added.
* IndexedDB/basic/index-cursor-continue.html: Added.
* IndexedDB/basic/index-cursor-continuePrimaryKey.html: Added.
* IndexedDB/basic/index-cursor-delete.html: Added.
* IndexedDB/basic/index-cursor-update.html: Added.
* IndexedDB/basic/index-get.html: Added.
* IndexedDB/basic/index-multientry.html: Renamed from PerformanceTests/IndexedDB/index-multientry.html.
* IndexedDB/basic/objectstore-add.html: Added.
* IndexedDB/basic/objectstore-clear.html: Added.
* IndexedDB/basic/objectstore-count.html: Added.
* IndexedDB/basic/objectstore-cursor-advance.html: Added.
* IndexedDB/basic/objectstore-cursor-continue.html: Added.
* IndexedDB/basic/objectstore-cursor-delete.html: Added.
* IndexedDB/basic/objectstore-cursor-update.html: Added.
* IndexedDB/basic/objectstore-cursor.html: Renamed from PerformanceTests/IndexedDB/objectstore-cursor.html.
* IndexedDB/basic/objectstore-delete.html: Renamed from PerformanceTests/IndexedDB/index-get.html.
* IndexedDB/basic/objectstore-get.html: Added.
* IndexedDB/basic/objectstore-put.html: Renamed from PerformanceTests/IndexedDB/objectstore-get.html.
* IndexedDB/stress/large-array-keys.html: Renamed from PerformanceTests/IndexedDB/large-array-keys.html.
* IndexedDB/stress/large-binary-keys.html: Renamed from PerformanceTests/IndexedDB/large-binary-keys.html.
* IndexedDB/stress/large-number-of-inserts-responsiveness.html: Renamed from PerformanceTests/IndexedDB/large-number-of-inserts-responsiveness.html.
* IndexedDB/stress/large-number-of-inserts.html: Renamed from PerformanceTests/IndexedDB/large-number-of-inserts.html.
* IndexedDB/stress/large-string-keys.html: Renamed from PerformanceTests/IndexedDB/large-string-keys.html.
* Skipped:

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

4 months ago[GStreamer] Clang warns about mismatched type tag in declarations for ImageOrientation
aperez@igalia.com [Wed, 21 Aug 2019 17:08:47 +0000 (17:08 +0000)]
[GStreamer] Clang warns about mismatched type tag in declarations for ImageOrientation
https://bugs.webkit.org/show_bug.cgi?id=200982

Reviewed by Carlos Alberto Lopez Perez.

No new tests needed.

* platform/graphics/gstreamer/VideoTextureCopierGStreamer.h: Change
type tag in the forward declaration to "struct", hence matching the
actual type definition.

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

4 months agoASSERTION FAILED: !s_isInvalidatingStyleWithRuleSets in com.apple.WebCore: WebCore...
antti@apple.com [Wed, 21 Aug 2019 17:05:46 +0000 (17:05 +0000)]
ASSERTION FAILED: !s_isInvalidatingStyleWithRuleSets in com.apple.WebCore: WebCore::DocumentRuleSets::collectFeatures const
https://bugs.webkit.org/show_bug.cgi?id=200919
<rdar://problem/53413013>

Reviewed by Zalan Bujtas.

Bots show that in some timing-dependent cases we may end up constructing a style resolver in the middle the class change invalidation.

This happens flakily on Pad bots in

media/track/track-node-add-remove.html
media/W3C/video/events/event_loadstart_manual.html
media/W3C/video/readyState/readyState_initial.html

and also reproes locally with lots of runs over these tests.

* style/StyleInvalidationFunctions.h:
(WebCore::Style::traverseRuleFeatures):

Ensure that for elements in shadow tree the host resolver is also always constructed before starting rule-based invalidation.

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

4 months agoREGRESSION: naver.com - Multiple taps are required to open email
commit-queue@webkit.org [Wed, 21 Aug 2019 16:52:45 +0000 (16:52 +0000)]
REGRESSION: naver.com - Multiple taps are required to open email
https://bugs.webkit.org/show_bug.cgi?id=200979
<rdar://problem/54295239>

Patch by Antoine Quint <graouts@apple.com> on 2019-08-21
Reviewed by Dean Jackson.

The "click" events on subjects in the message list are prevented by preventDefault() being called from a "mouseup" event listener.
This shouldn't actually happen, but due to how simulated mouse events are implemented, there is no current distinction between
"touchend" and "mouseup" events. It is safe however to opt mail.naver.com out of simulated mouse events altogether.

* page/Quirks.cpp:
(WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):

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

4 months agoWeb Inspector: Page: re-add enable/disable after r248454
drousso@apple.com [Wed, 21 Aug 2019 16:50:14 +0000 (16:50 +0000)]
Web Inspector: Page: re-add enable/disable after r248454
https://bugs.webkit.org/show_bug.cgi?id=200947

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

We shouldn't design the agent system with only Web Inspector in mind. Other clients may want
to have different functionality, not being told about frames creation/updates/destruction.
In these cases, we should have graceful error message failures for other agents that rely on
the Page agent.

* inspector/protocol/Page.json:

Source/WebCore:

We shouldn't design the agent system with only Web Inspector in mind. Other clients may want
to have different functionality, not being told about frames creation/updates/destruction.
In these cases, we should have graceful error message failures for other agents that rely on
the Page agent.

* inspector/agents/InspectorPageAgent.h:
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::didCreateFrontendAndBackend):
(WebCore::InspectorPageAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorPageAgent::enable): Added.
(WebCore::InspectorPageAgent::disable): Added.

* inspector/agents/InspectorApplicationCacheAgent.cpp:
(WebCore::InspectorApplicationCacheAgent::updateApplicationCacheStatus):
(WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
(WebCore::InspectorApplicationCacheAgent::assertFrameWithDocumentLoader):
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::createStyleSheet):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::highlightSelector):
(WebCore::InspectorDOMAgent::highlightFrame):
(WebCore::InspectorDOMAgent::buildObjectForNode):
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::setFrameIdentifier):
* inspector/agents/page/PageNetworkAgent.cpp:
(WebCore::PageNetworkAgent::loaderIdentifier):
(WebCore::PageNetworkAgent::frameIdentifier):
(WebCore::PageNetworkAgent::scriptExecutionContext):
* inspector/agents/page/PageRuntimeAgent.cpp:
(WebCore::PageRuntimeAgent::didCreateMainWorldContext):
(WebCore::PageRuntimeAgent::reportExecutionContextCreation):

Source/WebInspectorUI:

We shouldn't design the agent system with only Web Inspector in mind. Other clients may want
to have different functionality, not being told about frames creation/updates/destruction.
In these cases, we should have graceful error message failures for other agents that rely on
the Page agent.

* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.initializeTarget):

LayoutTests:

* http/tests/inspector/page/loading-iframe-document-node.html:
* inspector/css/getMatchedStylesForNode.html:
* inspector/css/getMatchedStylesForNode-expected.txt:
* inspector/page/archive.html:
* inspector/page/frameScheduledNavigation.html:
* inspector/page/frameScheduledNavigation-async-delegates.html:
* inspector/page/frameStartedLoading.html:
* inspector/page/media-query-list-listener-exception.html:
* inspector/timeline/line-column.html:

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

4 months agoVerify Prefetch and credential behavior
commit-queue@webkit.org [Wed, 21 Aug 2019 15:15:31 +0000 (15:15 +0000)]
Verify Prefetch and credential behavior
https://bugs.webkit.org/show_bug.cgi?id=200000

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

Source/WebKit:

Cancel cross-origin prefetches for Vary: Cookie.

Test: http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
(WebKit::NetworkResourceLoader::didReceiveResponse):
* NetworkProcess/cache/PrefetchCache.cpp:
(WebKit::PrefetchCache::take):

LayoutTests:

Add a test to verify that navigating to a prefetched main resource
that sets Vary: Cookie does send cookies.

* http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie-expected.txt: Added.
* http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html: Added.
* http/wpt/prefetch/resources/main-resource-cross-origin-set-cookie.py: Added.
(main):
* http/wpt/prefetch/resources/main-resource-cross-origin-vary-cookie.py: Added.
(main):
* http/wpt/prefetch/resources/navigate-cross-origin-vary-cookie.html: Added.
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

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

4 months ago[WPE] Build failure after r248846 ([WTF] Add makeUnique<T>, which ensures T is fast...
psaavedra@igalia.com [Wed, 21 Aug 2019 14:39:56 +0000 (14:39 +0000)]
[WPE] Build failure after r248846 ([WTF] Add makeUnique<T>, which ensures T is fast-allocated, makeUnique / makeUniqueWithoutFastMallocCheck part)
https://bugs.webkit.org/show_bug.cgi?id=200973

WPE fails to build with `-DENABLE_WPE_QT_API=ON` after changes done by r248846 in:

  Source/WebKit/UIProcess/API/wpe/qt/WPEQtView.cpp
  Source/WebKit/UIProcess/API/wpe/qt/WPEQtViewBackend.cpp

; to forces FastMalloc use.

Related to:

  https://bugs.webkit.org/show_bug.cgi?id=200611
  https://bugs.webkit.org/show_bug.cgi?id=200620

This patch puts WPEQt... classes into FastMalloc in the same way it
was done by many others in r248603.

Reviewed by Philippe Normand.

* UIProcess/API/wpe/qt/WPEQtView.cpp:
(WPEQtView::runJavaScript):
* UIProcess/API/wpe/qt/WPEQtViewBackend.h:
* UIProcess/API/wpe/qt/WPEQtViewLoadRequest.h:

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

4 months agoWeb Inspector: Sources: increase the filter bar's width when it's focused if a resour...
drousso@apple.com [Wed, 21 Aug 2019 10:30:57 +0000 (10:30 +0000)]
Web Inspector: Sources: increase the filter bar's width when it's focused if a resource type filter is active
https://bugs.webkit.org/show_bug.cgi?id=200940

Reviewed by Joseph Pecoraro.

* UserInterface/Views/FilterBar.js:
(WI.FilterBar.prototype._handleFilterChanged):
(WI.FilterBar.prototype.get indicatingProgress): Deleted.
(WI.FilterBar.prototype.set indicatingProgress): Deleted.
(WI.FilterBar.prototype.get indicatingActive): Deleted.
(WI.FilterBar.prototype.set indicatingActive): Deleted.
If escape is pressed when the <input> is empty, unfocus (blur) the <input>.
Drive-by: remove unused/unnecessary functions.
* UserInterface/Views/FilterBar.css:
(.filter-bar > input[type="search"]):
(:matches(.filter-bar, .search-bar) > input[type="search"]): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"]:matches(:focus, :not(:placeholder-shown))): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"]::-webkit-search-decoration): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"]::-webkit-search-results-button): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"]::placeholder): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"]:matches(:not(:focus), :placeholder-shown)::-webkit-search-cancel-button): Added.
(:matches(.filter-bar, .search-bar) > .navigation-bar + input[type="search"]): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"]:focus): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"] + :empty): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"]:focus ~ *): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"] + .navigation-bar > .item.scope-bar:last-child): Added.
(.filter-bar > input[type="search"] + .navigation-bar > .item.scope-bar:last-child): Deleted.
(.filter-bar > .navigation-bar + input[type="search"]): Deleted.
(.filter-bar > input[type="search"]::placeholder): Deleted.
(.filter-bar > input[type="search"]:focus): Deleted.
(.filter-bar > input[type="search"]::-webkit-search-decoration): Deleted.
(.filter-bar.active > input[type="search"]::-webkit-search-decoration): Deleted.
(.filter-bar.indicating-progress > input[type="search"]::-webkit-search-decoration): Deleted.
(.filter-bar > input[type="search"] + .navigation-bar:empty): Deleted.
When the <input> is `:focus`, hide the following `WI.NavigationBar` (if it's being used) so
that there's more room to show the filter text.
Drive-by: fix background, border, and text color styling when `:focus`.
* UserInterface/Views/SearchBar.css:
(.search-bar > input[type="search"]):
(.search-bar > input[type="search"]::placeholder): Deleted.
(.search-bar > input[type="search"]:focus): Deleted.
(.search-bar > input[type="search"]:not(:placeholder-shown)): Deleted.
(.search-bar > input[type="search"]:placeholder-shown::-webkit-search-cancel-button): Deleted.
(@media (prefers-color-scheme: dark)): Deleted.
(:matches(.search-bar, .filter-bar) > input[type="search"],): Deleted.
(:matches(.search-bar, .filter-bar) > input[type="search"]::placeholder): Deleted.
(:matches(.search-bar, .filter-bar) > input[type="search"]:focus): Deleted.
* UserInterface/Views/SearchSidebarPanel.css:
(.sidebar > .panel.navigation.search > .search-bar):
(.sidebar > .panel.navigation.search > .search-bar > input[type="search"]):
(.sidebar > .panel.navigation.search > .search-bar > .search-settings): Added.
(.sidebar > .panel.navigation.search > .search-bar > input[type="search"]::-webkit-search-results-button): Deleted.
* UserInterface/Views/Toolbar.css:
(.toolbar .search-bar > input[type="search"]::-webkit-textfield-decoration-container): Deleted.
Move shared styles to FilterBar.css as `WI.FilterBar` are more common.

* UserInterface/Views/Variables.css:
(:root):
(@media (prefers-color-scheme: dark) :root):
Expose some CSS variables in light mode that were previously only defined in dark mode.

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype._updateFilteredEntries):
(WI.NetworkTableContentView.prototype._updateURLFilterActiveIndicator): Deleted.
* UserInterface/Images/FilterFieldActiveGlyph.svg: Removed.

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

4 months agoWeb Inspector: Remove unnecessary properties on SVGs
pecoraro@apple.com [Wed, 21 Aug 2019 10:17:05 +0000 (10:17 +0000)]
Web Inspector: Remove unnecessary properties on SVGs
https://bugs.webkit.org/show_bug.cgi?id=200968

Reviewed by Devin Rousso.

* UserInterface/Images/EventPause.svg:
* UserInterface/Images/EventPlay.svg:
* UserInterface/Images/EventProcessing.svg:
* UserInterface/Images/EventStop.svg:
* UserInterface/Images/MediaInstrument.svg:

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

4 months agoIdentify memcpy loops in b3
justin_michaud@apple.com [Wed, 21 Aug 2019 06:30:05 +0000 (06:30 +0000)]
Identify memcpy loops in b3
https://bugs.webkit.org/show_bug.cgi?id=200181

Reviewed by Saam Barati.

JSTests:

* microbenchmarks/memcpy-loop.js: Added.
(doTest):
(let.arr1):
* microbenchmarks/memcpy-typed-loop-large.js: Added.
(doTest):
(let.arr1.new.Int32Array.1000000.let.arr2.new.Int32Array.1000000):
(arr2):
* microbenchmarks/memcpy-typed-loop-small.js: Added.
(doTest):
(16.let.arr1.new.Int32Array.size.let.arr2.new.Int32Array.size):
(16.arr2):
* microbenchmarks/memcpy-typed-loop-speculative.js: Added.
(doTest):
(let.arr1.new.Int32Array.10.let.arr2.new.Int32Array.10):
(arr2):
* microbenchmarks/memcpy-wasm-large.js: Added.
(typeof.WebAssembly.string_appeared_here.eq):
(typeof.WebAssembly.string_appeared_here.const.1.new.WebAssembly.Instance.new.WebAssembly.Module.new.Uint8Array):
* microbenchmarks/memcpy-wasm-medium.js: Added.
(typeof.WebAssembly.string_appeared_here.eq):
(typeof.WebAssembly.string_appeared_here.const.1.new.WebAssembly.Instance.new.WebAssembly.Module.new.Uint8Array):
* microbenchmarks/memcpy-wasm-small.js: Added.
(typeof.WebAssembly.string_appeared_here.eq):
(typeof.WebAssembly.string_appeared_here.const.1.new.WebAssembly.Instance.new.WebAssembly.Module.new.Uint8Array):
* microbenchmarks/memcpy-wasm.js: Added.
(typeof.WebAssembly.string_appeared_here.eq):
(typeof.WebAssembly.string_appeared_here.const.1.new.WebAssembly.Instance.new.WebAssembly.Module.new.Uint8Array):
* stress/memcpy-typed-loops.js: Added.
(noLoop):
(invalidStart):
(const.size.10.let.arr1.new.Int32Array.size.let.arr2.new.Int32Array.size):
(arr2):
* wasm/function-tests/memcpy-wasm-loop.js: Added.
(0.GetLocal.3.I32Const.1.I32Add.SetLocal.3.Br.1.End.End.End.WebAssembly):
(string_appeared_here):

Source/JavaScriptCore:

Add a new pass in B3 to identify one type of forward byte copy loop and replace it with a call to a custom version of memcpy
that will not cause GC tearing and have the correct behaviour when overlapping regions are passed in.

Microbenchmarks show memcpy-typed-loop-large is about 6x faster, and everything else is neutral. The optimization is disabled
on arm for now, until we add a memcpy implementation for it.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* b3/B3Generate.cpp:
(JSC::B3::generateToAir):
* b3/B3ReduceLoopStrength.cpp: Added.
(JSC::B3::fastForwardCopy32):
(JSC::B3::ReduceLoopStrength::AddrInfo::appendAddr):
(JSC::B3::ReduceLoopStrength::ReduceLoopStrength):
(JSC::B3::ReduceLoopStrength::reduceByteCopyLoopsToMemcpy):
(JSC::B3::ReduceLoopStrength::hoistValue):
(JSC::B3::ReduceLoopStrength::run):
(JSC::B3::reduceLoopStrength):
* b3/B3ReduceLoopStrength.h: Added.
* b3/testb3.h:
* b3/testb3_1.cpp:
(run):
* b3/testb3_8.cpp:
(testFastForwardCopy32):
(testByteCopyLoop):
(testByteCopyLoopStartIsLoopDependent):
(testByteCopyLoopBoundIsLoopDependent):
(addCopyTests):

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

4 months agoUnreviewed, speculative build fix for High Sierra after r248925
drousso@apple.com [Wed, 21 Aug 2019 05:25:34 +0000 (05:25 +0000)]
Unreviewed, speculative build fix for High Sierra after r248925

* inspector/JSInjectedScriptHost.cpp:
(Inspector::HeapHolderFinder::dump):

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

4 months agonextElementWithGreaterTabIndex should use shadowAdjustedTabIndex
rniwa@webkit.org [Wed, 21 Aug 2019 01:41:51 +0000 (01:41 +0000)]
nextElementWithGreaterTabIndex should use shadowAdjustedTabIndex
https://bugs.webkit.org/show_bug.cgi?id=200943

Reviewed by Wenson Hsieh.

Use shadowAdjustedTabIndex instead of tabIndexForElement in nextElementWithGreaterTabIndex.

Because nextElementWithGreaterTabIndex is only called to find an element with a tab index
set to a greater value than the argument tabIndex, which is always a positive integer,
whether we call shadowAdjustedTabIndex or tabIndexForElement has no effect on an element
with a shadow root or on a slot element. Furthermore, none of the elements with
an isKeyboardFocusable override can have a author defined shadow root attached either.

As a result, this refactoring will have no observable behavioral change.

No new tests since there should be no observable behavior change.

* page/FocusController.cpp:
(WebCore::tabIndexForElement): Merged into shadowAdjustedTabIndex.
(WebCore::shadowAdjustedTabIndex):
(WebCore::nextElementWithGreaterTabIndex):

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

4 months agoRemove MathMLElement::defaultTabIndex()
rniwa@webkit.org [Wed, 21 Aug 2019 01:39:54 +0000 (01:39 +0000)]
Remove MathMLElement::defaultTabIndex()
https://bugs.webkit.org/show_bug.cgi?id=200944

Reviewed by Frédéric Wang.

Removed MathMLElement::defaultTabIndex since it doesn't have any observable effect since
MathMLElement doesn't expose tabIndex IDL attribute, and sequential (tab key) focus navigation
checks MathMLElement::isKeyboardFocusable, which doesn't rely on defaultTabIndex, anyway.

* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::defaultTabIndex const): Deleted.
* mathml/MathMLElement.h:

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

4 months agoMake it easier to pass pointers to WTFCrashWithInfo.
mark.lam@apple.com [Wed, 21 Aug 2019 01:36:41 +0000 (01:36 +0000)]
Make it easier to pass pointers to WTFCrashWithInfo.
https://bugs.webkit.org/show_bug.cgi?id=200960

Reviewed by Saam Barati and Yusuke Suzuki.

Now, we don't have to explicitly cast them to uint64_ts first.  The template
wrappers will take care of it for us.

* wtf/Assertions.h:
(wtfCrashArg):
(WTFCrashWithInfo):
(WTF::isIntegralOrPointerType):
(WTF::isIntegralType): Deleted.

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

4 months agoRemove superfluous size argument to allocateCell() for fixed size objects.
mark.lam@apple.com [Wed, 21 Aug 2019 01:13:02 +0000 (01:13 +0000)]
Remove superfluous size argument to allocateCell() for fixed size objects.
https://bugs.webkit.org/show_bug.cgi?id=200958

Reviewed by Yusuke Suzuki.

The size is already automatically computed by the allocateCell() template's default
arguments.  Removing these superfluous arguments will make it easier for us to
grep for cases where we do allocate variable size cells (for later analysis work).

* jsc.cpp:
(JSC::Masquerader::create):
(JSCMemoryFootprint::create):
* tools/JSDollarVM.cpp:
(JSC::JSDollarVMCallFrame::create):
(JSC::Element::create):
(JSC::Root::create):
(JSC::SimpleObject::create):
(JSC::ImpureGetter::create):
(JSC::CustomGetter::create):
(JSC::DOMJITNode::create):
(JSC::DOMJITGetter::create):
(JSC::DOMJITGetterComplex::create):
(JSC::DOMJITFunctionObject::create):
(JSC::DOMJITCheckSubClassObject::create):
(JSC::DOMJITGetterBaseJSObject::create):
(JSC::JSTestCustomGetterSetter::create):
(JSC::WasmStreamingParser::create):

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

4 months ago[iOS] REGRESSION (248501): gmail.com images are still not shown on some versions...
commit-queue@webkit.org [Wed, 21 Aug 2019 00:54:48 +0000 (00:54 +0000)]
[iOS] REGRESSION (248501): gmail.com images are still not shown on some versions of iPhone iOS13
https://bugs.webkit.org/show_bug.cgi?id=200948

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-08-20
Reviewed by Tim Horton.

Apply the gmail.com quirk for all iPhone iOS versions till the gmail.com
bug is fixed.

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

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

4 months agoJSBigInt::m_length should be immutable.
mark.lam@apple.com [Wed, 21 Aug 2019 00:39:02 +0000 (00:39 +0000)]
JSBigInt::m_length should be immutable.
https://bugs.webkit.org/show_bug.cgi?id=200956

Reviewed by Yusuke Suzuki.

This is because the JSBigInt cell size is allocated with that length.  Changing
the length after construction does not change the size of the cell, and hence,
makes no sense.

This patch removes the setLength() method, and decorates the m_length field with
const to enforce that it is immutable after construction.

* runtime/JSBigInt.h:

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

4 months ago[results.webkit.org Webkit.css] Add right sidebar
zhifei_fang@apple.com [Wed, 21 Aug 2019 00:26:52 +0000 (00:26 +0000)]
[results.webkit.org Webkit.css] Add right sidebar
https://bugs.webkit.org/show_bug.cgi?id=200946

Reviewed by Jonathan Bedard.

* resultsdbpy/resultsdbpy/view/static/library/css/webkit.css:
(@media screen and (min-width: 600px) and (orientation: landscape)):
(.main.left):
(@media screen and (min-width: 768px) and (orientation: landscape)):
(.sidebar.right):

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

4 months agoWeb Inspector: Implement `queryHolders` Command Line API
drousso@apple.com [Wed, 21 Aug 2019 00:24:27 +0000 (00:24 +0000)]
Web Inspector: Implement `queryHolders` Command Line API
https://bugs.webkit.org/show_bug.cgi?id=200458

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

Call `queryHolders(object)` from the Console to return an array of objects that strongly
reference the given `object`. This could be very useful for finding JavaScript "leaks".

* inspector/InjectedScriptSource.js:
(queryHolders): Added.
* inspector/JSInjectedScriptHost.h:
* inspector/JSInjectedScriptHost.cpp:
(Inspector::HeapHolderFinder::HeapHolderFinder): Added.
(Inspector::HeapHolderFinder::holders): Added.
(Inspector::HeapHolderFinder::analyzeEdge): Added.
(Inspector::HeapHolderFinder::analyzePropertyNameEdge): Added.
(Inspector::HeapHolderFinder::analyzeVariableNameEdge): Added.
(Inspector::HeapHolderFinder::analyzeIndexEdge): Added.
(Inspector::HeapHolderFinder::analyzeNode): Added.
(Inspector::HeapHolderFinder::setOpaqueRootReachabilityReasonForCell): Added.
(Inspector::HeapHolderFinder::setWrappedObjectForCell): Added.
(Inspector::HeapHolderFinder::setLabelForCell): Added.
(Inspector::HeapHolderFinder::dump): Added.
(Inspector::JSInjectedScriptHost::queryHolders): Added.
* inspector/JSInjectedScriptHostPrototype.cpp:
(Inspector::JSInjectedScriptHostPrototype::finishCreation):
(Inspector::jsInjectedScriptHostPrototypeFunctionQueryHolders): Added.

* heap/HeapAnalyzer.h: Added.
Create an abstract base class for analyzing the Heap during a GC. Rather than create an
entire `HeapSnapshot` for `queryHolders`, the `HeapHolderFinder` can just walk the Heap and
only save the information it needs to determine the holders of the given `object`.

* heap/Heap.h:
* heap/Heap.cpp:
(JSC::Heap::isAnalyzingHeap const): Added.
(JSC::GatherExtraHeapData::GatherExtraHeapData): Added.
(JSC::GatherExtraHeapData::operator() const): Added.
(JSC::Heap::gatherExtraHeapData): Added.
(JSC::Heap::didFinishCollection): Added.
(JSC::Heap::isHeapSnapshotting const): Deleted.
(JSC::GatherHeapSnapshotData::GatherHeapSnapshotData): Deleted.
(JSC::GatherHeapSnapshotData::operator() const): Deleted.
(JSC::Heap::gatherExtraHeapSnapshotData): Deleted.
* heap/SlotVisitor.h:
(JSC::SlotVisitor::isAnalyzingHeap const): Added.
(JSC::SlotVisitor::heapAnalyzer const): Added.
(JSC::SlotVisitor::isBuildingHeapSnapshot const): Deleted.
(JSC::SlotVisitor::heapSnapshotBuilder const): Deleted.
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::didStartMarking):
(JSC::SlotVisitor::reset):
(JSC::SlotVisitor::appendSlow):
(JSC::SlotVisitor::visitChildren):
* heap/SlotVisitorInlines.h:
(JSC::SlotVisitor::appendUnbarriered):
* heap/WeakBlock.cpp:
(JSC::WeakBlock::specializedVisit):
* runtime/Structure.cpp:
(JSC::Structure::visitChildren):
Rename `HeapAnalyzer` functions to be less specific to building a `HeapSnapshot`.

* heap/HeapProfiler.h:
(JSC::HeapProfiler::activeHeapAnalyzer const): Added.
(JSC::HeapProfiler::activeSnapshotBuilder const): Deleted.
* heap/HeapProfiler.cpp:
(JSC::HeapProfiler::setActiveHeapAnalyzer): Added.
(JSC::HeapProfiler::setActiveSnapshotBuilder): Deleted.
* heap/HeapSnapshotBuilder.h:
* heap/HeapSnapshotBuilder.cpp:
(JSC::HeapSnapshotBuilder::HeapSnapshotBuilder):
(JSC::HeapSnapshotBuilder::buildSnapshot):
(JSC::HeapSnapshotBuilder::analyzeNode): Added.
(JSC::HeapSnapshotBuilder::analyzeEdge): Added.
(JSC::HeapSnapshotBuilder::analyzePropertyNameEdge): Added.
(JSC::HeapSnapshotBuilder::analyzeVariableNameEdge): Added.
(JSC::HeapSnapshotBuilder::analyzeIndexEdge): Added.
(JSC::HeapSnapshotBuilder::appendNode): Deleted.
(JSC::HeapSnapshotBuilder::appendEdge): Deleted.
(JSC::HeapSnapshotBuilder::appendPropertyNameEdge): Deleted.
(JSC::HeapSnapshotBuilder::appendVariableNameEdge): Deleted.
(JSC::HeapSnapshotBuilder::appendIndexEdge): Deleted.

* inspector/InjectedScriptManager.h:
* inspector/agents/InspectorRuntimeAgent.cpp:

* runtime/ClassInfo.h:
* runtime/JSCell.h:
* runtime/JSCell.cpp:
(JSC::JSCell::analyzeHeap): Added.
(JSC::JSCell::heapSnapshot): Deleted.
* runtime/JSLexicalEnvironment.h:
* runtime/JSLexicalEnvironment.cpp:
(JSC::JSLexicalEnvironment::analyzeHeap): Added.
(JSC::JSLexicalEnvironment::heapSnapshot): Deleted.
* runtime/JSObject.h:
* runtime/JSObject.cpp:
(JSC::JSObject::analyzeHeap): Added.
(JSC::JSObject::heapSnapshot): Deleted.
* runtime/JSSegmentedVariableObject.h:
* runtime/JSSegmentedVariableObject.cpp:
(JSC::JSSegmentedVariableObject::analyzeHeap): Added.
(JSC::JSSegmentedVariableObject::heapSnapshot): Deleted.
Rename `heapSnapshot` to `analyzeHeap`.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:

Source/WebCore:

Call `queryHolders(object)` from the Console to return an array of objects that strongly
reference the given `object`. This could be very useful for finding JavaScript "leaks".

Test: inspector/console/queryHolders.html

* inspector/CommandLineAPIModuleSource.js:
(CommandLineAPIImpl.prototype.queryHolders): Added.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* bindings/js/DOMGCOutputConstraint.cpp:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::analyzeHeap): Added.
(WebCore::JSDOMWindow::heapSnapshot): Deleted.
* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::analyzeHeap): Added.
(WebCore::JSDocument::heapSnapshot): Deleted.
* bindings/scripts/test/JS/*:
Rename `heapSnapshot` to `analyzeHeap` to match JavaScriptCore changes.

Source/WebInspectorUI:

Call `queryHolders(object)` from the Console to return an array of objects that strongly
reference the given `object`. This could be very useful for finding JavaScript "leaks".

* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:

LayoutTests:

* inspector/console/queryHolders.html: Added.
* inspector/console/queryHolders-expected.txt: Added.
* http/tests/inspector/dom/cross-domain-inspected-node-access-expected.txt:
* TestExpectations:
* platform/mac-wk1/TestExpectations:

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

4 months agoRevert the unintended test change in r248914.
rniwa@webkit.org [Wed, 21 Aug 2019 00:10:02 +0000 (00:10 +0000)]
Revert the unintended test change in r248914.

* web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html:

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

4 months agoWeb Inspector: Address a few Esprima issues preventing pretty printing of resources
pecoraro@apple.com [Tue, 20 Aug 2019 23:47:03 +0000 (23:47 +0000)]
Web Inspector: Address a few Esprima issues preventing pretty printing of resources
https://bugs.webkit.org/show_bug.cgi?id=200935

Reviewed by Timothy Hatcher.

Address a few Esprima issues:

    Issue #1991 - Failure to parse template literal with destructuring assignment expression
    https://github.com/jquery/esprima/issues/1991

    Issue #1920 - Invalid Left Hand Side in for-in
    https://github.com/jquery/esprima/issues/1920

* UserInterface/External/Esprima/esprima.js:

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

4 months agoWeb Inspector: Update CodeMirror to support numeric separators in JavaScript numbers
pecoraro@apple.com [Tue, 20 Aug 2019 23:44:39 +0000 (23:44 +0000)]
Web Inspector: Update CodeMirror to support numeric separators in JavaScript numbers
https://bugs.webkit.org/show_bug.cgi?id=200942

Cherry-pick a few CodeMirror changes:

    [javascript mode] Support numeric separators
    https://github.com/codemirror/CodeMirror/commit/beab8ed123683416bfec934df73d13401ec086b5#diff-9812850bb71d31e8dd60b476abb2bae8

    [javascript mode] fix tokenizing of underscore properties
    https://github.com/codemirror/CodeMirror/commit/463ea2c34ab442c0cae1d9732305219ca9b04dfe#diff-9812850bb71d31e8dd60b476abb2bae8

Reviewed by Timothy Hatcher.

* UserInterface/External/CodeMirror/javascript.js:

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

4 months ago[WHLSL] We need to null check when emitting native code for operator&.<field-name>
sbarati@apple.com [Tue, 20 Aug 2019 23:11:41 +0000 (23:11 +0000)]
[WHLSL] We need to null check when emitting native code for operator&.<field-name>
https://bugs.webkit.org/show_bug.cgi?id=200846

Reviewed by Myles C. Maxfield.

Source/WebCore:

Test: webgpu/whlsl/structure-field-access-on-null.html

* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
(WebCore::WHLSL::Metal::inlineNativeFunction):

LayoutTests:

* webgpu/whlsl/structure-field-access-on-null-expected.txt: Added.
* webgpu/whlsl/structure-field-access-on-null.html: Added.

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

4 months ago[WASM-References] Enable by default
justin_michaud@apple.com [Tue, 20 Aug 2019 22:35:28 +0000 (22:35 +0000)]
[WASM-References] Enable by default
https://bugs.webkit.org/show_bug.cgi?id=200931

Reviewed by Saam Barati.

* runtime/Options.h:

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

4 months agoWebSQLiteDatabaseTracker does not ensure it is still alive after dispatching to the...
cdumez@apple.com [Tue, 20 Aug 2019 22:18:23 +0000 (22:18 +0000)]
WebSQLiteDatabaseTracker does not ensure it is still alive after dispatching to the main thread
https://bugs.webkit.org/show_bug.cgi?id=200925

Reviewed by Geoffrey Garen.

WebSQLiteDatabaseTracker does not ensure it is still alive after dispatching to the main thread,
which is not safe. Use WeakPtr to address the issue.

* Shared/WebSQLiteDatabaseTracker.cpp:
(WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
(WebKit::WebSQLiteDatabaseTracker::willBeginFirstTransaction):
(WebKit::WebSQLiteDatabaseTracker::didFinishLastTransaction):
* Shared/WebSQLiteDatabaseTracker.h:

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

4 months agoUpdating Expectations for Multiple Newly Passing Tests.
russell_e@apple.com [Tue, 20 Aug 2019 21:33:06 +0000 (21:33 +0000)]
Updating Expectations for Multiple Newly Passing Tests.

Unreviewed Test Gardening.

* platform/ios-12/TestExpectations:
* platform/ios-wk1/TestExpectations:
* platform/ios/TestExpectations:

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

4 months agoWeb Inspector: Sources: move the resource type scope bar to be next to the filter
drousso@apple.com [Tue, 20 Aug 2019 21:11:11 +0000 (21:11 +0000)]
Web Inspector: Sources: move the resource type scope bar to be next to the filter
https://bugs.webkit.org/show_bug.cgi?id=200891

Reviewed by Joseph Pecoraro.

It's odd to have UI for controlling the active filters in two different places. Move the
resource type `WI.ScopeBar` to the filter bar area, and "promote" the resource grouping mode
items from a context menu to an always visible `WI.ScopeBar` in the space left by the
resource type `WI.ScopeBar` (switching between grouping modes quickly is a useful workflow).

* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype.hasCustomFilters):
(WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeScopeBarSelectionChanged): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeChanged):
(WI.SourcesNavigationSidebarPanel.prototype._populateResourceGroupingModeContextMenu.addOption): Deleted.
(WI.SourcesNavigationSidebarPanel.prototype._populateResourceGroupingModeContextMenu): Deleted.
* UserInterface/Views/SourcesNavigationSidebarPanel.css:
(.sidebar > .panel.navigation.sources > .filter-bar .sources-resource-type-scope-bar.default-item-selected:not(:hover)): Added.
(.sidebar > .panel.navigation.sources > .filter-bar .sources-resource-type-scope-bar.default-item-selected:hover): Added.

* UserInterface/Views/FilterBar.js:
(WI.FilterBar.prototype.addFilterNavigationItem): Added.
(WI.FilterBar.prototype.addFilterBarButton):
* UserInterface/Views/FilterBar.css:
(.filter-bar > .navigation-bar > .item):
(.filter-bar > .navigation-bar > .item.button): Added.
(.filter-bar > .navigation-bar > .item.scope-bar): Added.
(.filter-bar > input[type="search"] + .navigation-bar > .item.scope-bar:last-child): Added.
Provide a way to add arbitrary `WI.NavigationItem` to the contained `WI.NavigationBar`.
Slightly adjust the spacing of the items (depending on their type) in the `WI.NavigationBar`
so they are all centered.

* UserInterface/Views/ScopeBar.css:
(.scope-bar):
(.scope-bar > li):
(.scope-bar > li::after):
(.scope-bar > li:not(.selected):hover): Added.
(body[dir=ltr] .scope-bar > li.multiple > select):
(body[dir=rtl] .scope-bar > li.multiple > select):
(.scope-bar > li:not(.selected):hover::after): Added.
Introduce CSS variables for `margin`, `padding`, and `opacity` that callers can override to
customize the appearance of the `WI.ScopeBar`.

* Localizations/en.lproj/localizedStrings.js:

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

4 months agoUnreviewed comment follow-up for https://bugs.webkit.org/show_bug.cgi?id=200752.
justin_fan@apple.com [Tue, 20 Aug 2019 20:40:32 +0000 (20:40 +0000)]
Unreviewed comment follow-up for https://bugs.webkit.org/show_bug.cgi?id=200752.

* html/canvas/GPUBasedCanvasRenderingContext.h:

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

4 months agoThe default tab index of output and fieldset should be -1
rniwa@webkit.org [Tue, 20 Aug 2019 19:59:00 +0000 (19:59 +0000)]
The default tab index of output and fieldset should be -1
https://bugs.webkit.org/show_bug.cgi?id=200834

Reviewed by Alex Christensen.

Source/WebCore:

This patch updates the default tab index of output and fieldset to -1 to match the behavior of
Chrome and Firefox as well as the latest HTML specification:
https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute

To do that, this patch replaces HTMLFormControlElement::defaultTabIndex with defaultTabIndex
implementation in each one of its concrete subclass such as HTMLButtonElement to mirror
the language of the specification as follows:

HTMLFormControlElement
    HTMLButtonElement -> 0
    HTMLFieldSetElement -> -1
    HTMLFormControlElementWithState
        HTMLKeygenElement -> 0 - Not specified anywhere but preserving the existing behavior.
        HTMLSelectElement -> 0
        HTMLTextFormControlElement
            HTMLInputElement -> 0
            HTMLTextAreaElement -> 0
    HTMLOutputElement -> -1

Even though Element::shouldBeIgnoredInSequentialFocusNavigation() checks the value of
defaultTabIndex, this patch does not affect the actual sequential (tab) focus navigation:
Beacuse HTMLOutputElement and HTMLFieldSetElement have supportsFocus overrides to call
HTMLElement::supportsFocus instead of HTMLFormControlElement::supportsFocus, these two
elements are focusable only when tabindex is set or it's a root content editable element.
But all root editable elements are focusable anyway and the default tab index does not
matter when tabindex is set.

Test: fast/dom/tabindex-defaults.html

* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::defaultTabIndex const): Added.
* html/HTMLButtonElement.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::defaultTabIndex const): Deleted.
* html/HTMLFormControlElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::defaultTabIndex const): Added.
* html/HTMLKeygenElement.h:
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::defaultTabIndex const): Added.
* html/HTMLKeygenElement.h:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::defaultTabIndex const): Added.
* html/HTMLSelectElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::defaultTabIndex const): Added.
* html/HTMLTextAreaElement.h:

LayoutTests:

Added test cases for output, fieldset, and keygen.

* fast/dom/tabindex-defaults-expected.txt:
* fast/dom/tabindex-defaults.html:

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

4 months agoUnreviewed. Followup to r248903. It's not valid to remove
sbarati@apple.com [Tue, 20 Aug 2019 19:45:43 +0000 (19:45 +0000)]
Unreviewed. Followup to r248903. It's not valid to remove
hasOverflowed() checks from appendCharacters.

* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::appendCharacters):

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

4 months agoWeb Inspector: Sources: Give Origins their own icon in the Sources sidebar
pecoraro@apple.com [Tue, 20 Aug 2019 19:17:59 +0000 (19:17 +0000)]
Web Inspector: Sources: Give Origins their own icon in the Sources sidebar
https://bugs.webkit.org/show_bug.cgi?id=200683
<rdar://problem/54269044>

Reviewed by Devin Rousso.

* UserInterface/Images/Origin.svg: Added.
* UserInterface/Main.html:
New resources.

* UserInterface/Views/FolderIcon.css:
(.origin-icon .icon):
Light and Dark appearances for Origin icons.

(@media (prefers-color-scheme: dark)):
* UserInterface/Views/OriginTreeElement.js:
(WI.OriginTreeElement):
Very much like a folder with different classes.

* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype.matchTreeElementAgainstCustomFilters.match):
(WI.SourcesNavigationSidebarPanel.prototype.matchTreeElementAgainstCustomFilters):
(WI.SourcesNavigationSidebarPanel.prototype._compareTreeElements):
(WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeChanged):
Use OriginTreeElement in a few places.

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

4 months ago[ContentChangeObserver] isConsideredClickable should be able to process elements...
zalan@apple.com [Tue, 20 Aug 2019 18:58:12 +0000 (18:58 +0000)]
[ContentChangeObserver] isConsideredClickable should be able to process elements with no renderers
https://bugs.webkit.org/show_bug.cgi?id=200926
<rdar://problem/54519579>

Reviewed by Simon Fraser.

Source/WebCore:

This patch fixes the crash when the visible->hidden change triggers an isConsideredClickable() call with a 'display: none' element.

Test: fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden-crash.html

* page/ios/ContentChangeObserver.cpp:
(WebCore::isConsideredClickable):

LayoutTests:

* fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden-crash-expected.txt: Added.
* fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden-crash.html: Added.

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

4 months agoresults.webkit.org: Add ToolTips
jbedard@apple.com [Tue, 20 Aug 2019 18:55:34 +0000 (18:55 +0000)]
results.webkit.org: Add ToolTips
https://bugs.webkit.org/show_bug.cgi?id=200801

Rubber-stamped by Aakash Jain.

When dots or scale labels are hovered over, we should display a tool tip with additional information about
The specific element.

* resultsdbpy/resultsdbpy/view/static/css/tooltip.css: Added.
(.tooltip): Add class for ToolTip text box.
(.tooltip-arrow-up): Add class for ToolTip arrow pointing up.
(.tooltip-arrow-down): Add class for ToolTip arrow pointing down.
* resultsdbpy/resultsdbpy/view/static/js/commit.js:
(_CommitBank.prototype.commitsDuringUuid): Return a list of commits which were the trunk of their respective
repositories at a given time.
* resultsdbpy/resultsdbpy/view/static/js/timeline.js:
(xAxisFromScale): Add callbacks triggered when the mouse enters or leaves elements in the scale canvas.
(TimelineFromEndpoint.render): Add callbacks triggered when the mouse enters or leaves dot elements.
* resultsdbpy/resultsdbpy/view/static/js/tooltip.js: Added.
(isPointInElement): Given an element and a point, return true if that point is within the bounds of the element.
(_ToolTip):
(_ToolTip.prototype.set): Set the content and location of the ToolTip.
(_ToolTip.prototype.toString): Return the html needed to render the ToolTip.
(_ToolTip.prototype.unset): Clear and hide the ToolTip.
(_ToolTip.prototype.isIn): Check if a given point is contained within the ToolTip.
* resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js:
(Timeline.CanvasSeriesComponent): Convert onHover events to onEnter/onLeave events. Add toolTips points to both
dot and scale elements.
* resultsdbpy/resultsdbpy/view/templates/search.html: Add ToolTip.
* resultsdbpy/resultsdbpy/view/templates/suite_results.html: Ditto.

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

4 months agoClicking the search icon on ae.com hangs the web content process
wenson_hsieh@apple.com [Tue, 20 Aug 2019 18:46:36 +0000 (18:46 +0000)]
Clicking the search icon on ae.com hangs the web content process
https://bugs.webkit.org/show_bug.cgi?id=200889
<rdar://problem/54359330>

Reviewed by Ryosuke Niwa.

Source/WebCore:

The hang occurs under FrameSelection::selectionAtSentenceStart, while computing an EditorState to send to the UI
process. This act of determining whether the given positon is at the start of sentence entails moving backwards
from the start of the current visible selection until the start of a paragraph or sentence is found, using
VisiblePosition::previous to iterate backwards through VisiblePositions.

However, on this website, VisiblePosition::previous ends up just returning the current position, and we loop
infinitely as a result because we never actually move backwards. This happens because VisiblePosition::previous
first uses previousVisuallyDistinctCandidate to find a candidate Position before the current position, but when
the position is canonicalized to create a VisiblePosition, it is moved back to its original Position as the deep
equivalent.

In the attached test case (which is representative of the relevant part of the DOM on ae.com), we try to find
the previous VisiblePosition from (#c, 0). The previous visually distinct candidate we initially find is
(#b, 0), since:

1. The enclosing renderer is a RenderBlock with a non-zero height.
2. The enclosing renderer has no rendered children.
3. The position is at the first editing position in the node (i.e. the span element).

However, when canonicalizing the position, we find that neither the upstream nor the downstream position is a
candidate because both the upstream and downstream nodes end up well outside of the span (the upstream node ends
up being at the start of the body element, and the downstream position ends up right before the start of #c's
container). The downstream position is at the end of a text node with a leading newline, it's not a candidate
because its last caret offset is less than the length of the text node.

As a result, even though the given position (#b, 0) is a candidate itself, its downstream and upstream positions
are not. Thus, VisiblePosition::canonicalPosition expands the scope of its candidate positions to the next
closest candidate positions; the next candidate position is (#c, 0). Both of these candidates are outside of the
containing block, so we (somewhat arbitrarily) break the tie by choosing the next visible position, bringing us
back to (#c, 0).

There are several ways to fix this, one of which involves fixing the downstream/upstream positions of (#b, 0) so
that they no longer jump out of the containing block of #b and cause (#b, 0) to be an invalid visible position
despite being a candidate position. This can be achieved by adjusting the heuristic in
endsOfNodeAreVisuallyDistinctPositions (used when moving upstream or downstream). Currently, this helper
function returns false for #b because they contain a single (non-rendered) whitespace character. Removing this
extraneous whitespace character actually causes the problem to stop reproducing, since #b and #c no longer
contain any child nodes. This is important because the heuristic in Position::downstream attempts to keep the
downstream position within the confines of the enclosing visual boundary, which (currently) ends up being the
entire body element because endsOfNodeAreVisuallyDistinctPositions returns false for #b.

To avoid this scenario, we teach endsOfNodeAreVisuallyDistinctPositions to treat inline-block containers that
are empty (that is, contain no rendered content) but may have children for editing in the same way as inline-
block containers that don't have any children; in both scenarios, they may contain a candidate position, so we
should treat the ends of the container node as being visually distinct.

Doing so causes the downstream position of (#b, 0) to be kept within the immediate containing span element,
which then allows (#b, 0) to be a canonical VisiblePosition.

Tests:  fast/events/focus-anchor-with-tabindex-hang.html
        editing/selection/modify-backward-inline-block-containers.html

* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::previous const):

LayoutTests:

* editing/selection/modify-backward-inline-block-containers-expected.txt: Added.
* editing/selection/modify-backward-inline-block-containers.html: Added.

Add a layout test to ensure that the selection may be moved through empty inline-block containers that span the
width of the page.

* fast/events/focus-anchor-with-tabindex-hang-expected.txt: Added.
* fast/events/focus-anchor-with-tabindex-hang.html: Added.

Add a layout test to ensure that clicking an empty span under a focusable anchor element moves focus to the
anchor element instead of hanging the web content process or hitting a debug assertion.

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

4 months agoWeb Inspector: Support for JavaScript BigInt
ryanhaddad@apple.com [Tue, 20 Aug 2019 17:54:02 +0000 (17:54 +0000)]
Web Inspector: Support for JavaScript BigInt
https://bugs.webkit.org/show_bug.cgi?id=180731

Unreviewed test gardening.

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

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

4 months ago[FTW] Fix scrolling in modern WebKit views
bfulgham@apple.com [Tue, 20 Aug 2019 17:50:09 +0000 (17:50 +0000)]
[FTW] Fix scrolling in modern WebKit views
https://bugs.webkit.org/show_bug.cgi?id=200923

Reviewed by Don Olmstead.

The initial implementation of scrolling in Direct2D had errors that
caused hilarious rendering glitches. This patch corrects the logic
so that page scroll is correct.
Source/WebCore:

* platform/graphics/win/BackingStoreBackendDirect2D.h:
* platform/graphics/win/BackingStoreBackendDirect2DImpl.cpp:
(WebCore::BackingStoreBackendDirect2DImpl::scroll):
(WebCore::BackingStoreBackendDirect2DImpl::bitmapBrush):
* platform/graphics/win/BackingStoreBackendDirect2DImpl.h:
* platform/graphics/win/Direct2DOperations.cpp:
(WebCore::Direct2D::drawNativeImage):
* platform/graphics/win/Direct2DUtilities.cpp:
(WebCore::Direct2D::copyRectFromOneSurfaceToAnother):
(WebCore::Direct2D::writeImageToDiskAsPNG): Added diagnostic utility to
dump textures to disk for review.
* platform/graphics/win/Direct2DUtilities.h:
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoderDirect2D::systemImagingFactory): Switch to more
recent factory with additional features.
* platform/graphics/win/ImageDecoderDirect2D.h:

Source/WebKit:

This patch also fixes a bug that would trigger when resizing windows.

* Shared/win/ShareableBitmapDirect2D.cpp:
(WebKit::ShareableBitmap::paint):
* UIProcess/BackingStore.h:
(WebKit::BackingStore::renderTarget): Deleted.
* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
(WebKit::DrawingAreaProxyCoordinatedGraphics::sizeDidChange):
(WebKit::DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange):
* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h:
* UIProcess/win/BackingStoreDirect2D.cpp:
(WebKit::BackingStore::paint):
(WebKit::BackingStore::incorporateUpdate):
(WebKit::BackingStore::scroll):
* UIProcess/win/WebView.cpp:
(WebKit::WebView::paint):
(WebKit::WebView::onSizeEvent):

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

4 months ago[JSC] Array.prototype.toString should not get "join" function each time
ysuzuki@apple.com [Tue, 20 Aug 2019 17:37:07 +0000 (17:37 +0000)]
[JSC] Array.prototype.toString should not get "join" function each time
https://bugs.webkit.org/show_bug.cgi?id=200905

Reviewed by Mark Lam.

JSTests:

* stress/array-prototype-join-change.js: Added.
(shouldBe):
(array2.join):
(DerivedArray):
(DerivedArray.prototype.join):
(array3.__proto__.join):
(Array.prototype.join):

Source/JavaScriptCore:

We avoid looking up `join` every time Array#toString is called. This patch implements the most profitable and easy
case first as we are doing optimization for Array#slice: non-modified original Array. Configuring watchpoint for
Array.prototype.join change and use this information and structure information to determine whether `join` lookup
in Array.prototype.toString is unnecessary. This improves JetStream2/3d-raytrace-SP score by 1.6%

    ToT:     363.56
    Patched: 369.26

This patch also renames InlineWatchpointSet fields from Watchpoint to WatchpointSet since they are not Watchpoint.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::isWatchingArrayIteratorProtocolWatchpoint):
(JSC::DFG::Graph::isWatchingNumberToStringWatchpoint):
* runtime/ArrayPrototype.cpp:
(JSC::speciesWatchpointIsValid):
(JSC::canUseDefaultArrayJoinForToString):
(JSC::arrayProtoFuncToString):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::JSGlobalObject):
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::tryInstallArraySpeciesWatchpoint):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::arrayIteratorProtocolWatchpointSet):
(JSC::JSGlobalObject::mapIteratorProtocolWatchpointSet):
(JSC::JSGlobalObject::setIteratorProtocolWatchpointSet):
(JSC::JSGlobalObject::stringIteratorProtocolWatchpointSet):
(JSC::JSGlobalObject::mapSetWatchpointSet):
(JSC::JSGlobalObject::setAddWatchpointSet):
(JSC::JSGlobalObject::arraySpeciesWatchpointSet):
(JSC::JSGlobalObject::arrayJoinWatchpointSet):
(JSC::JSGlobalObject::numberToStringWatchpointSet):
(JSC::JSGlobalObject::arrayIteratorProtocolWatchpoint): Deleted.
(JSC::JSGlobalObject::mapIteratorProtocolWatchpoint): Deleted.
(JSC::JSGlobalObject::setIteratorProtocolWatchpoint): Deleted.
(JSC::JSGlobalObject::stringIteratorProtocolWatchpoint): Deleted.
(JSC::JSGlobalObject::mapSetWatchpoint): Deleted.
(JSC::JSGlobalObject::setAddWatchpoint): Deleted.
(JSC::JSGlobalObject::arraySpeciesWatchpoint): Deleted.
(JSC::JSGlobalObject::numberToStringWatchpoint): Deleted.
* runtime/JSGlobalObjectInlines.h:
(JSC::JSGlobalObject::isArrayPrototypeIteratorProtocolFastAndNonObservable):
(JSC::JSGlobalObject::isMapPrototypeIteratorProtocolFastAndNonObservable):
(JSC::JSGlobalObject::isSetPrototypeIteratorProtocolFastAndNonObservable):
(JSC::JSGlobalObject::isStringPrototypeIteratorProtocolFastAndNonObservable):
(JSC::JSGlobalObject::isMapPrototypeSetFastAndNonObservable):
(JSC::JSGlobalObject::isSetPrototypeAddFastAndNonObservable):

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

4 months agoFix InBounds speculation of typed array PutByVal and add extra step to integer range...
justin_michaud@apple.com [Tue, 20 Aug 2019 17:35:46 +0000 (17:35 +0000)]
Fix InBounds speculation of typed array PutByVal and add extra step to integer range optimization to search for equality relationships on the RHS value
https://bugs.webkit.org/show_bug.cgi?id=200782

Reviewed by Saam Barati.

JSTests:

Skip long memcpy test on debug, and try to fix flakiness for recompilation count tests by disabling cjit.

* microbenchmarks/memcpy-typed-loop.js:
* stress/int8-repeat-in-then-out-of-bounds.js:

Tools:

* Scripts/run-jsc-stress-tests:

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

4 months ago[WHLSL] Only take the pointer of a variable or global variable reference if it is...
sbarati@apple.com [Tue, 20 Aug 2019 17:19:04 +0000 (17:19 +0000)]
[WHLSL] Only take the pointer of a variable or global variable reference if it is used
https://bugs.webkit.org/show_bug.cgi?id=200908

Reviewed by Dean Jackson.

Previously, we would always emit Metal code to produce an lvalue pointer
even when it wasn't used. This patch adds a mechanism to lazily generate
such pointers when they're actually needed, since we often don't use them.
This is a 7% Metal compile time speedup on compute_boids with a p value of
0.0001.

* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendRightValueWithNullability):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendLeftValue):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastLeftValue):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
* Modules/webgpu/WHLSL/Metal/WHLSLMangledNames.h:
(WebCore::WHLSL::Metal::MangledVariableName::operator bool const):

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

4 months agoVariadic StringBuilder::append does not handle upconverting from 8-bit to 16-bit...
darin@apple.com [Tue, 20 Aug 2019 17:14:37 +0000 (17:14 +0000)]
Variadic StringBuilder::append does not handle upconverting from 8-bit to 16-bit correctly
https://bugs.webkit.org/show_bug.cgi?id=200921

Reviewed by Saam Barati.

Source/WTF:

* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::appendUninitialized8): Renamed from
appendUninitializedWithoutOverflowCheckForLChar and moved the length overflow
check in here to cut down on unnecessary inlining and code size.
(WTF::StringBuilder::appendUninitialized16): Renamed from
appendUninitializedWithoutOverflowCheckForUChar, moved the length overflow check
in here, and moved the necessary upconversion code from the const UChar* overload of
the appendCharacters function.
(WTF::StringBuilder::appendCharacters): Removed unneeded "length has already overflowed"
check at the start of the function since the code in the function already handles that
case correctly. Refactored the const UChar* overload to use the new appendCharacters16
function so it can share more code with StringBuilder::appendFromAdapters.

* wtf/text/StringBuilder.h:
(WTF::StringBuilder::appendFromAdapters): Updated the function names for the
two appendUninitialized functions, which now do a bit more than before. Removed the
overflow check since the appendUninitialized8/16 functions now handle that; better to
not make the inlined code larger to handle a failure case.

Tools:

* TestWebKitAPI/Tests/WTF/StringBuilder.cpp:
Changed tests to use EXPECT macros instead of ASSERT macros since we don't
need to abort after the first failure. Added three new tests to the VariadicAppend
test to cover various cases of upconverting from 8-bit to 16-bit strings.

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

4 months agoUnsafe usage of CookieStorageObserver from a background thread
cdumez@apple.com [Tue, 20 Aug 2019 16:53:21 +0000 (16:53 +0000)]
Unsafe usage of CookieStorageObserver from a background thread
https://bugs.webkit.org/show_bug.cgi?id=200920

Reviewed by Alex Christensen.

Source/WebCore:

Unsafe usage of CookieStorageObserver from a background thread. CookieStorageObserver gets
constructed / destructed on the main thread. However, CookieStorageObserver::cookiesDidChange()
gets called on a background thread and tries to ref |this|. Even though CookieStorageObserver
is ThreadSafeRefCounted, this is still unsafe because the CookieStorageObserver destructor may
already be running on the main thread when CookieStorageObserver::cookiesDidChange() gets called
on the background thread.

* platform/network/NetworkStorageSession.h:
* platform/network/cocoa/CookieStorageObserver.h:
* platform/network/cocoa/CookieStorageObserver.mm:
(WebCore::CookieStorageObserver::CookieStorageObserver):
(WebCore::CookieStorageObserver::cookiesDidChange):
(WebCore::CookieStorageObserver::create): Deleted.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::cookieStorageObserver const):

Source/WebKit:

* UIProcess/API/APIHTTPCookieStore.h:
* UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm:
(API::HTTPCookieStore::startObservingChangesToDefaultUIProcessCookieStore):

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

4 months agoUse a strongly typed identifier for StorageNamespace's identifier
cdumez@apple.com [Tue, 20 Aug 2019 16:34:56 +0000 (16:34 +0000)]
Use a strongly typed identifier for StorageNamespace's identifier
https://bugs.webkit.org/show_bug.cgi?id=200895

Reviewed by Alex Christensen and Youenn Fablet.

Source/WebCore:

* storage/StorageNamespace.h:

Source/WebKit:

Use a strongly typed identifier for StorageNamespace's identifier instead of uint64_t, to
avoid type confusion.

* NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
(WebKit::LocalStorageNamespace::LocalStorageNamespace):
* NetworkProcess/WebStorage/LocalStorageNamespace.h:
* NetworkProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::createSessionStorageNamespace):
(WebKit::StorageManager::destroySessionStorageNamespace):
(WebKit::StorageManager::cloneSessionStorageNamespace):
(WebKit::StorageManager::createLocalStorageArea):
(WebKit::StorageManager::createTransientLocalStorageArea):
(WebKit::StorageManager::createSessionStorageArea):
(WebKit::StorageManager::getOrCreateLocalStorageNamespace):
(WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
(WebKit::StorageManager::getOrCreateSessionStorageNamespace):
* NetworkProcess/WebStorage/StorageManager.h:
* NetworkProcess/WebStorage/StorageManagerSet.cpp:
(WebKit::StorageManagerSet::connectToLocalStorageArea):
(WebKit::StorageManagerSet::connectToTransientLocalStorageArea):
(WebKit::StorageManagerSet::connectToSessionStorageArea):
(WebKit::StorageManagerSet::cloneSessionStorageNamespace):
* NetworkProcess/WebStorage/StorageManagerSet.h:
* NetworkProcess/WebStorage/StorageManagerSet.messages.in:
* Scripts/webkit/messages.py:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setPrivateBrowsingEnabled):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_textAutoSizingAdjustmentTimer):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::sessionStorageNamespaceIdentifier const):
* WebProcess/WebPage/WebPageGroupProxy.h:
(WebKit::WebPageGroupProxy::localStorageNamespaceIdentifier const):
* WebProcess/WebStorage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::dispatchSessionStorageEvent):
(WebKit::StorageAreaMap::dispatchLocalStorageEvent):
* WebProcess/WebStorage/StorageNamespaceIdentifier.h: Copied from Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.h.
* WebProcess/WebStorage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
(WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
(WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
(WebKit::StorageNamespaceImpl::StorageNamespaceImpl):
(WebKit::StorageNamespaceImpl::copy):
(WebKit::StorageNamespaceImpl::sessionStoragePageID const):
(WebKit::StorageNamespaceImpl::pageGroupID const):
* WebProcess/WebStorage/StorageNamespaceImpl.h:
(WebKit::StorageNamespaceImpl::storageNamespaceID const):
* WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
(WebKit::WebStorageNamespaceProvider::getOrCreate):
(WebKit::WebStorageNamespaceProvider::WebStorageNamespaceProvider):
(WebKit::WebStorageNamespaceProvider::~WebStorageNamespaceProvider):
(WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
(WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):
(WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace):
* WebProcess/WebStorage/WebStorageNamespaceProvider.h:

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

4 months agoREGRESSION: Open in New Tab is missing from context menu
dino@apple.com [Tue, 20 Aug 2019 16:10:43 +0000 (16:10 +0000)]
REGRESSION: Open in New Tab is missing from context menu
https://bugs.webkit.org/show_bug.cgi?id=200909
<rdar://problem/54476169>

Reviewed by Simon Fraser.

Source/WebKit:

Don't assume the new API if webView:contextMenuWillPresentForElement:
is implemented.

* UIProcess/ios/WKContentViewInteraction.mm:
(needsDeprecatedPreviewAPI):

Tools:

Add a new test that runs through the legacy context menu
flow, and verifies that it will be called if there aren't
appropriate delegates for the new API.

* TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm:
(contextMenuWebViewDriver):
(-[TestContextMenuUIDelegate webView:contextMenuConfigurationForElement:completionHandler:]):
(TEST):
(-[LegacyPreviewViewController previewActionItems]):
(-[LegacyContextMenuUIDelegate webView:shouldPreviewElement:]):
(-[LegacyContextMenuUIDelegate webView:previewingViewControllerForElement:defaultActions:]):
(-[LegacyContextMenuUIDelegate webView:contextMenuWillPresentForElement:]):
(-[LegacyContextMenuUIDelegate _webView:contextMenuDidEndForElement:]):
* TestWebKitAPI/cocoa/TestContextMenuDriver.h:

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

4 months agoMake IDB quota check lambdas take a weak of UniqueIDBDatabaseTransaction instead...
youenn@apple.com [Tue, 20 Aug 2019 13:26:06 +0000 (13:26 +0000)]
Make IDB quota check lambdas take a weak of UniqueIDBDatabaseTransaction instead of a ref
https://bugs.webkit.org/show_bug.cgi?id=196696

Reviewed by Alex Christensen.

Refing the transaction in the lambdas extend their lifetime.
Taking a weak pointer of them is better as this will not extend their lifetime.
In particular, if the database is deleted, the corresponding transactions might be deleted.
This makes quota checks less intrusive in IDB lifetime management.
Covered by existing tests.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::createIndex):
(WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
(WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
(WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:

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

4 months agoWeb Inspector: Support for JavaScript BigInt
pecoraro@apple.com [Tue, 20 Aug 2019 10:41:33 +0000 (10:41 +0000)]
Web Inspector: Support for JavaScript BigInt
https://bugs.webkit.org/show_bug.cgi?id=180731
<rdar://problem/36298748>

Source/JavaScriptCore:

Reviewed by Devin Rousso.

* inspector/InjectedScriptSource.js:
(toStringDescription):
(isSymbol):
(isBigInt):
(let.InjectedScript.prototype._fallbackWrapper):
(let.RemoteObject):
(let.RemoteObject.subtype):
(let.RemoteObject.describe):
(let.RemoteObject.prototype._appendPropertyPreviews):
(let.RemoteObject.set _isPreviewableObjectInternal):
(let.RemoteObject.prototype._isPreviewableObject.set add):
* inspector/protocol/Runtime.json:
New RemoteObject type and preview support.

* runtime/RuntimeType.cpp:
(JSC::runtimeTypeForValue):
(JSC::runtimeTypeAsString):
* runtime/RuntimeType.h:
* runtime/TypeSet.cpp:
(JSC::TypeSet::displayName const):
(JSC::TypeSet::inspectorTypeSet const):
New type for the type profiler.

* heap/HeapSnapshotBuilder.cpp:
(JSC::HeapSnapshotBuilder::json):
* inspector/agents/InspectorHeapAgent.cpp:
(Inspector::InspectorHeapAgent::getPreview):
* runtime/JSBigInt.cpp:
(JSC::JSBigInt::toString):
(JSC::JSBigInt::tryGetString):
(JSC::JSBigInt::toStringBasePowerOfTwo):
(JSC::JSBigInt::toStringGeneric):
* runtime/JSBigInt.h:
BigInts are not tied to a GlobalObject, so provide a way to get a
String for HeapSnapshot previews that are not tied to an ExecState.

Source/WebInspectorUI:

Reviewed by Devin Rousso.

* UserInterface/External/CodeMirror/javascript.js:
(expressionAllowed):
Cherry-pick BigInt JavaScript mode support from CodeMirror:
https://github.com/codemirror/CodeMirror/pull/5411

* UserInterface/Images/TypeBigInt.svg: Added.
* UserInterface/Views/Variables.css:
(:root):
(@media (prefers-color-scheme: dark)):
* UserInterface/Views/CodeMirrorAdditions.js:
* UserInterface/Views/SyntaxHighlightingDefaultTheme.css:
(.cm-s-default .cm-number.cm-bigint,):
* UserInterface/Views/ObjectTreePropertyTreeElement.css:
(.object-tree-property.bigint > .icon):
* UserInterface/Views/HeapSnapshotInstancesContentView.css:
(.heap-snapshot .icon.bigint):
Style BigInt similiar but different from numbers but with
a [B] icon instead of [N].

* UserInterface/Views/FormattedValue.css:
(.formatted-bigint):
* UserInterface/Views/FormattedValue.js:
(WI.FormattedValue.hasSimpleDisplay):
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression.populate):
(WI.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression):
Simple value formatting for the new type.

* UserInterface/Models/TypeSet.js:
(WI.TypeSet):
(WI.TypeSet.prototype.get primitiveTypeNames):
* UserInterface/Views/TypeTokenView.css:
(.type-token-bigint):
* UserInterface/Views/TypeTokenView.js:
(WI.TypeTokenView.prototype._displayTypeName):
(WI.TypeTokenView):
New type handling for the Type profiler.

* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject):
(WI.RemoteObject.createBigIntFromDescriptionString):
* UserInterface/Views/HeapSnapshotClusterContentView.js:
(WI.HeapSnapshotClusterContentView.iconStyleClassNameForClassName):
* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WI.HeapSnapshotInstanceDataGridNode.prototype._populatePreview):
BigInt values are not tied to a GlobalObject, so do some special casing
in the Heap output (like Strings) so we get a preview.

Source/WebKit:

Reviewed by Devin Rousso.

* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::WebInspectorUI):
Enable BigInt in the Web Inspector process. It only makes use of
`globalThis.BigInt(...)` to hold the value.

LayoutTests:

Reviewed by Devin Rousso.

* inspector/model/remote-object-expected.txt:
* inspector/model/remote-object.html:
* inspector/model/resources/remote-object-utilities.js:
Include simple tests for a BigInt value and preview.

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

4 months agoRemove DeferredPromise::sessionID()
youenn@apple.com [Tue, 20 Aug 2019 09:48:20 +0000 (09:48 +0000)]
Remove DeferredPromise::sessionID()
https://bugs.webkit.org/show_bug.cgi?id=200616

Reviewed by Alex Christensen.

Calling sessionID() on DeferredPromise is valid if the DeferredPromise is not suspended.
Since this might not always be true in call sites, add a resolve promise that is passed a function that returns
the value to resolve.
This function is taking a ScriptExecutionContext from which the session ID can be retrieved.
This is safe since the function will only be called if the DeferredPromise is not suspended.
Update call sites accordingly.
No change of behavior.

* Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::resolveWithTypeAndData):
(WebCore::FetchBodyConsumer::resolve):
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::blob):
* bindings/js/JSDOMPromiseDeferred.h:
(WebCore::DeferredPromise::resolveCallbackValueWithNewlyCreated):
(WebCore::DeferredPromise::sessionID const): Deleted.

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

4 months agoPendingActivationMediaStream does not need to be refcounted
youenn@apple.com [Tue, 20 Aug 2019 09:39:25 +0000 (09:39 +0000)]
PendingActivationMediaStream does not need to be refcounted
https://bugs.webkit.org/show_bug.cgi?id=200879

Reviewed by Alex Christensen.

No observable change of behavior.

* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::allow):
(WebCore::UserMediaRequest::mediaStreamDidFail):
No need to asynchronously remove the observer since MediaStreamPrivate handles that properply now.
* Modules/mediastream/UserMediaRequest.h:

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

4 months agoWeb Inspector: Use URL constructor to better handle all kinds of URLs
drousso@apple.com [Tue, 20 Aug 2019 07:04:02 +0000 (07:04 +0000)]
Web Inspector: Use URL constructor to better handle all kinds of URLs
https://bugs.webkit.org/show_bug.cgi?id=165155

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

* UserInterface/Base/URLUtilities.js:
(parseURL):

LayoutTests:

* inspector/unit-tests/url-utilities.html:
* inspector/unit-tests/url-utilities-expected.txt:

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

4 months agoWeb Inspector: Debugger: add a global breakpoint for pausing in the next microtask
drousso@apple.com [Tue, 20 Aug 2019 06:58:15 +0000 (06:58 +0000)]
Web Inspector: Debugger: add a global breakpoint for pausing in the next microtask
https://bugs.webkit.org/show_bug.cgi?id=200652

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/Debugger.json:
Add `setPauseOnMicrotasks` command.

* inspector/agents/InspectorDebuggerAgent.h:
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::disable):
(Inspector::InspectorDebuggerAgent::setPauseOnMicrotasks): Added.
(Inspector::InspectorDebuggerAgent::willRunMicrotask): Added.
(Inspector::InspectorDebuggerAgent::didRunMicrotask): Added.

* debugger/Debugger.h:
(JSC::Debugger::willRunMicrotask): Added.
(JSC::Debugger::didRunMicrotask): Added.
* inspector/ScriptDebugListener.h:
* inspector/ScriptDebugServer.h:
* inspector/ScriptDebugServer.cpp:
(Inspector::ScriptDebugServer::evaluateBreakpointAction):
(Inspector::ScriptDebugServer::sourceParsed):
(Inspector::ScriptDebugServer::willRunMicrotask): Added.
(Inspector::ScriptDebugServer::didRunMicrotask): Added.
(Inspector::ScriptDebugServer::canDispatchFunctionToListeners const): ADded.
(Inspector::ScriptDebugServer::dispatchFunctionToListeners): ADded.
(Inspector::ScriptDebugServer::handlePause):
(Inspector::ScriptDebugServer::dispatchDidPause): Deleted.
(Inspector::ScriptDebugServer::dispatchBreakpointActionLog): Deleted.
(Inspector::ScriptDebugServer::dispatchBreakpointActionSound): Deleted.
(Inspector::ScriptDebugServer::dispatchBreakpointActionProbe): Deleted.
(Inspector::ScriptDebugServer::dispatchDidContinue): Deleted.
(Inspector::ScriptDebugServer::dispatchDidParseSource): Deleted.
(Inspector::ScriptDebugServer::dispatchFailedToParseSource): Deleted.
Unify the various `dispatch*` functions to use lambdas so state management is centralized.

* runtime/JSMicrotask.cpp:
(JSC::JSMicrotask::run):

* inspector/agents/JSGlobalObjectDebuggerAgent.h:

Source/WebCore:

Test: inspector/debugger/setPauseOnMicrotasks.html

* inspector/agents/page/PageDebuggerAgent.h:
* inspector/agents/worker/WorkerDebuggerAgent.h:

* inspector/agents/InspectorTimelineAgent.h:
(WebCore::InspectorTimelineAgent::willRunMicrotask): Added.
(WebCore::InspectorTimelineAgent::didRunMicrotask): Added.

Source/WebInspectorUI:

* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager):
(WI.DebuggerManager.prototype.initializeTarget):
(WI.DebuggerManager.prototype.get allMicrotasksBreakpoint): ADded.
(WI.DebuggerManager.prototype.isBreakpointSpecial):
(WI.DebuggerManager.prototype._pauseReasonFromPayload):
(WI.DebuggerManager.prototype._breakpointDisabledStateDidChange):

* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel):
(WI.DebuggerSidebarPanel.prototype.saveStateToCookie):
(WI.DebuggerSidebarPanel.prototype.restoreStateFromCookie):
(WI.DebuggerSidebarPanel.prototype._addBreakpoint):
(WI.DebuggerSidebarPanel.prototype._addTreeElement):
(WI.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
(WI.DebuggerSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.DebuggerSidebarPanel.prototype._populateCreateBreakpointContextMenu):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._insertDebuggerTreeElement):
(WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):
(WI.SourcesNavigationSidebarPanel.prototype._updatePauseReasonSection):
(WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu):

* UserInterface/Views/BreakpointTreeElement.css:
(.breakpoint-microtask-icon .icon): Added.
* UserInterface/Images/Microtask.svg: Added.

* UserInterface/Base/Setting.js:
* Localizations/en.lproj/localizedStrings.js:

LayoutTests:

* inspector/debugger/setPauseOnMicrotasks.html: Added.
* inspector/debugger/setPauseOnMicrotasks-expected.txt: Added.

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

4 months agoWeb Inspector: REGRESSION(r248682): Elements: Computed: go-to arrows in the Variables...
drousso@apple.com [Tue, 20 Aug 2019 06:09:34 +0000 (06:09 +0000)]
Web Inspector: REGRESSION(r248682): Elements: Computed: go-to arrows in the Variables section are misaligned
https://bugs.webkit.org/show_bug.cgi?id=200841

Reviewed by Joseph Pecoraro.

The Variables section uses a different CSS class since it's identifier changed in r248682.

* UserInterface/Views/ComputedStyleDetailsPanel.css:
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables)): Added.
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) .property): Added.
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) .property .go-to-arrow): Added.
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) .property:not(:hover) .go-to-arrow): Added.
(.sidebar > .panel.details.css-style > .content > .computed .computed-style-properties): Deleted.
(.sidebar > .panel.details.css-style > .content > .computed .computed-style-properties .property .go-to-arrow): Deleted.
(.sidebar > .panel.details.css-style > .content > .computed .computed-style-properties .property:hover .go-to-arrow): Deleted.

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

4 months ago[WHLSL] Make generated Metal code should be indented properly to ease reading while...
weinig@apple.com [Tue, 20 Aug 2019 05:47:38 +0000 (05:47 +0000)]
[WHLSL] Make generated Metal code should be indented properly to ease reading while debugging
https://bugs.webkit.org/show_bug.cgi?id=200870

Reviewed by Saam Barati.

Source/WebCore:

Adds indentation of generated Metal code using the new WTF::Indentation and WTF::IndentationScope
classes. This makes reading the generated Metal code much easier while debugging it, and does not
seem to introduce any performance regression (I measured no difference on compute_boids.html test).

* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
(WebCore::WHLSL::Metal::EntryPointScaffolding::emitResourceHelperTypes):
(WebCore::WHLSL::Metal::EntryPointScaffolding::emitUnpackResourcesAndNamedBuiltIns):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::emitHelperTypes):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::emitSignature):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::emitUnpack):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::emitPack):
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::emitHelperTypes):
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::emitSignature):
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::emitUnpack):
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::emitPack):
(WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::emitHelperTypes):
(WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::emitSignature):
(WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::emitUnpack):
(WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::emitPack):
* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::emitLoop):
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
(WebCore::WHLSL::Metal::inlineNativeFunction):
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
(WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):

Source/WTF:

Adds simple Indentation class to allow programatic indenting compatible with StringTypeAdapter
aware functions/class (e.g. makeString and StringBuilder). Templatized on the number of spaces
to indent.

Also adds IndentationScope, which uses RAII to increment/decrement the indentation value.

* wtf/text/StringConcatenate.h:
(WTF::Indentation::operator++):
(WTF::Indentation::operator--):
(WTF::IndentationScope::IndentationScope):
(WTF::IndentationScope::~IndentationScope):

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

4 months agoWeb Inspector: Debugger: pause on assertion failures breakpoint doesn't work when...
drousso@apple.com [Tue, 20 Aug 2019 05:19:41 +0000 (05:19 +0000)]
Web Inspector: Debugger: pause on assertion failures breakpoint doesn't work when inspecting a JSContext
https://bugs.webkit.org/show_bug.cgi?id=200874

Reviewed by Joseph Pecoraro.

* inspector/JSGlobalObjectConsoleClient.cpp:
(Inspector::JSGlobalObjectConsoleClient::messageWithTypeAndLevel):

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

4 months agoWeb Inspector: have more aggressive checks for dataURLs provided to `console.screenshot`
drousso@apple.com [Tue, 20 Aug 2019 04:22:03 +0000 (04:22 +0000)]
Web Inspector: have more aggressive checks for dataURLs provided to `console.screenshot`
https://bugs.webkit.org/show_bug.cgi?id=200747

Reviewed by Joseph Pecoraro.

Source/WebCore:

Always send any /data:*+/ strings to the frontend and have it render there. If that doesn't
work, have the frontend "spoof" an error message look and feel.

Test: inspector/console/console-screenshot.html

* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::screenshot):

Source/WebInspectorUI:

Always send any /data:*+/ strings to the frontend and have it render there. If that doesn't
work, have the frontend "spoof" an error message look and feel.

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

* Localizations/en.lproj/localizedStrings.js:

LayoutTests:

* inspector/console/console-screenshot.html:
* inspector/console/console-screenshot-expected.txt:

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

4 months agoWeb Inspector: RTL: Network headers values should be preserved
nvasilyev@apple.com [Tue, 20 Aug 2019 04:10:39 +0000 (04:10 +0000)]
Web Inspector: RTL: Network headers values should be preserved
https://bugs.webkit.org/show_bug.cgi?id=200873

Reviewed by Joseph Pecoraro.

Replace spans with bdi elements, which have `unicode-bidi: isolate` User Agent style.
This works well with both LTR and RTL values.

* UserInterface/Views/ResourceDetailsSection.js:
(WI.ResourceDetailsSection.prototype.appendKeyValuePair):
Drive-by: remove unnecessary if/else statement and use `append` instead.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248889 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[CMake] WebKit2.dll can't link because of missing PAL's import symbols for WinCairo...
Hironori.Fujii@sony.com [Tue, 20 Aug 2019 03:33:46 +0000 (03:33 +0000)]
[CMake] WebKit2.dll can't link because of missing PAL's import symbols for WinCairo port
https://bugs.webkit.org/show_bug.cgi?id=200910

Unreviewed build fix for Windows port.

* CMakeLists.txt: Added -DSTATICALLY_LINKED_WITH_PAL=1 if PAL_LIBRARY_TYPE is STATIC.

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

4 months agoUnreviewed build fix for WinCairo port.
Hironori.Fujii@sony.com [Tue, 20 Aug 2019 03:25:04 +0000 (03:25 +0000)]
Unreviewed build fix for WinCairo port.

The base class of NetworkDataTask has been changed in r248874.

* NetworkProcess/curl/NetworkDataTaskCurl.h:
(ref):
(deref):
Call 'ref' and 'deref' of NetworkDataTask instead of RefCounted<NetworkDataTask>.

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

4 months agoSource/WebCore:
jer.noble@apple.com [Tue, 20 Aug 2019 02:16:43 +0000 (02:16 +0000)]
Source/WebCore:
[Cocoa] Fix misspelling of -preventsDisplaySleepForVideoPlayback
https://bugs.webkit.org/show_bug.cgi?id=200774
<rdar://problem/54321071>

Reviewed by Eric Carlson.

Only declare the API on platforms where that API is undefined, so as
to catch this kind of misspelling at compile time.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):

Source/WebCore/PAL:
[Cocoa] Adopt -preventDisplaySleepForVideoPlayback
https://bugs.webkit.org/show_bug.cgi?id=200774
<rdar://problem/54321071>

Reviewed by Eric Carlson.

* pal/spi/mac/AVFoundationSPI.h:

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

4 months ago[WinCairo][WK1] A browser window starts as an inactive window because AcceleratedComp...
Hironori.Fujii@sony.com [Tue, 20 Aug 2019 01:57:56 +0000 (01:57 +0000)]
[WinCairo][WK1] A browser window starts as an inactive window because AcceleratedCompositingContext::acceleratedCompositingAvailable creates temporary window
https://bugs.webkit.org/show_bug.cgi?id=200493

Reviewed by Ross Kirsling.

Reverted r179962.

* WebCoreSupport/AcceleratedCompositingContext.cpp:
(AcceleratedCompositingContext::acceleratedCompositingAvailable): Deleted.
* WebCoreSupport/AcceleratedCompositingContext.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

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

4 months agoUnreviewed build fix for security entitlements.
krollin@apple.com [Tue, 20 Aug 2019 01:08:11 +0000 (01:08 +0000)]
Unreviewed build fix for security entitlements.

Bug 200242 (r248164) changed the way that entitlements were generated
and applied during the build. In that refactoring, the codesign
parameter "-o library" was dropped. This change adds it back.

* Configurations/BaseXPCService.xcconfig:

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

4 months agoProxy constructor should throw if handler is revoked Proxy
commit-queue@webkit.org [Tue, 20 Aug 2019 00:56:08 +0000 (00:56 +0000)]
Proxy constructor should throw if handler is revoked Proxy
https://bugs.webkit.org/show_bug.cgi?id=198755

Patch by Alexey Shvayka <shvaikalesh@gmail.com> on 2019-08-19
Reviewed by Saam Barati.

JSTests:

* stress/proxy-revoke.js: Adjust error message.
* test262/expectations.yaml: Mark 2 test cases as passing.

Source/JavaScriptCore:

Reword error message and check if handler is revoked Proxy.
(step 4 of https://tc39.es/ecma262/#sec-proxycreate)

* runtime/ProxyObject.cpp:
(JSC::ProxyObject::finishCreation): Add isRevoked check.

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

4 months agoWebGPU layers don't show up sometimes
justin_fan@apple.com [Tue, 20 Aug 2019 00:37:55 +0000 (00:37 +0000)]
WebGPU layers don't show up sometimes
https://bugs.webkit.org/show_bug.cgi?id=200752

Reviewed by Dean Jackson.

Ensure HTML canvas is properly notified of WebGPU updates. Fixes alpha WebGPU MotionMark benchmark no-show issue.

Normal WebGPU behavior unaffected and covered by existing tests.

* Modules/webgpu/GPUCanvasContext.cpp:
(WebCore::GPUCanvasContext::configureSwapChain):
(WebCore::GPUCanvasContext::reshape):
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
(WebCore::WHLSL::Metal::inlineNativeFunction):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* html/canvas/GPUBasedCanvasRenderingContext.cpp: Added.
(WebCore::GPUBasedCanvasRenderingContext::GPUBasedCanvasRenderingContext):
(WebCore::GPUBasedCanvasRenderingContext::htmlCanvas const):
(WebCore::GPUBasedCanvasRenderingContext::notifyCanvasContentChanged):
* html/canvas/GPUBasedCanvasRenderingContext.h:
(WebCore::GPUBasedCanvasRenderingContext::GPUBasedCanvasRenderingContext): Deleted.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::reshape):
(WebCore::WebGLRenderingContextBase::htmlCanvas): Deleted.
* html/canvas/WebGLRenderingContextBase.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::contentChanged):

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