WebKit-https.git
6 months ago[LFC][BFC] Add support for block replaced intrinsic width.
zalan@apple.com [Sat, 16 Feb 2019 12:56:11 +0000 (12:56 +0000)]
[LFC][BFC] Add support for block replaced intrinsic width.
https://bugs.webkit.org/show_bug.cgi?id=194705

Reviewed by Simon Fraser.

Source/WebCore:

Replaced boxes should report their intrinsic width as preferred widths.

Test: fast/block/block-only/replaced-intrinsic-width-simple.html

* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):

Tools:

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

LayoutTests:

* fast/block/block-only/replaced-intrinsic-width-simple-expected.html: Added.
* fast/block/block-only/replaced-intrinsic-width-simple.html: Added.

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

6 months ago[LFC] Apply min/max width constraints to preferred width computation
zalan@apple.com [Sat, 16 Feb 2019 12:54:01 +0000 (12:54 +0000)]
[LFC] Apply min/max width constraints to preferred width computation
https://bugs.webkit.org/show_bug.cgi?id=194739

Reviewed by Simon Fraser.

Source/WebCore:

Ensure that both min-height and max-height are taken into account while computing the preferred width.

Test: fast/block/block-only/min-max-and-preferred-width-simple.html

* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):

Tools:

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

LayoutTests:

* fast/block/block-only/min-max-and-preferred-width-simple-expected.html: Added.
* fast/block/block-only/min-max-and-preferred-width-simple.html: Added.

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

6 months ago[JSC] Shrink UnlinkedFunctionExecutable
ysuzuki@apple.com [Sat, 16 Feb 2019 08:58:36 +0000 (08:58 +0000)]
[JSC] Shrink UnlinkedFunctionExecutable
https://bugs.webkit.org/show_bug.cgi?id=194733

Reviewed by Mark Lam.

UnlinkedFunctionExecutable has sourceURLDirective and sourceMappingURLDirective. These
directives can be found in the comment of non typical function's source code (Program,
Eval code, and Global function from function constructor etc.), and tricky thing is that
SourceProvider's directives are updated by Parser. The reason why we have these fields in
UnlinkedFunctionExecutable is that we need to update the SourceProvider's directives even
if we skip parsing by using CodeCache. These fields are effective only if (1)
UnlinkedFunctionExecutable is for non typical function things, and (2) it has sourceURLDirective
or sourceMappingURLDirective. This is rare enough to purge them to a separated
UnlinkedFunctionExecutable::RareData to make UnlinkedFunctionExecutable small.
sizeof(UnlinkedFunctionExecutable) is very important since it is super frequently allocated
cell. Furthermore, the current JSC allocates two MarkedBlocks for UnlinkedFunctionExecutable
in JSGlobalObject initialization, but the usage of the second MarkedBlock is quite low (8%).
If we can reduce the size of UnlinkedFunctionExecutable, we can make them one MarkedBlock.
Since UnlinkedFunctionExecutable is allocated from IsoSubspace, we do not need to fit it to
one of size class.

This patch adds RareData to UnlinkedFunctionExecutable and move some rare datas into RareData.
And kill one MarkedBlock allocation in JSC initialization phase.

* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
(JSC::UnlinkedFunctionExecutable::ensureRareDataSlow):
* bytecode/UnlinkedFunctionExecutable.h:
* debugger/DebuggerLocation.cpp:
(JSC::DebuggerLocation::DebuggerLocation):
* inspector/ScriptDebugServer.cpp:
(Inspector::ScriptDebugServer::dispatchDidParseSource):
* parser/Lexer.h:
(JSC::Lexer::sourceURLDirective const):
(JSC::Lexer::sourceMappingURLDirective const):
(JSC::Lexer::sourceURL const): Deleted.
(JSC::Lexer::sourceMappingURL const): Deleted.
* parser/Parser.h:
(JSC::Parser<LexerType>::parse):
* parser/SourceProvider.h:
(JSC::SourceProvider::sourceURLDirective const):
(JSC::SourceProvider::sourceMappingURLDirective const):
(JSC::SourceProvider::setSourceURLDirective):
(JSC::SourceProvider::setSourceMappingURLDirective):
(JSC::SourceProvider::sourceURL const): Deleted. We rename it from sourceURL to sourceURLDirective
since it is the correct name.
(JSC::SourceProvider::sourceMappingURL const): Deleted. We rename it from sourceMappingURL to
sourceMappingURLDirective since it is the correct name.
* runtime/CachedTypes.cpp:
(JSC::CachedSourceProviderShape::encode):
(JSC::CachedFunctionExecutableRareData::encode):
(JSC::CachedFunctionExecutableRareData::decode const): CachedFunctionExecutable did not have
sourceMappingURL to sourceMappingURLDirective. So this patch keeps the same logic.
(JSC::CachedFunctionExecutable::rareData const):
(JSC::CachedFunctionExecutable::encode):
(JSC::CachedFunctionExecutable::decode const):
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
* runtime/CodeCache.cpp:
(JSC::CodeCache::getUnlinkedGlobalCodeBlock):
(JSC::CodeCache::getUnlinkedGlobalFunctionExecutable):
* runtime/CodeCache.h:
(JSC::generateUnlinkedCodeBlockImpl):
* runtime/FunctionExecutable.h:
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::StackFrame::url):

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

6 months ago[JSC] Remove unused global private variables
ysuzuki@apple.com [Sat, 16 Feb 2019 07:41:20 +0000 (07:41 +0000)]
[JSC] Remove unused global private variables
https://bugs.webkit.org/show_bug.cgi?id=194741

Reviewed by Joseph Pecoraro.

There are some private functions and constants that are no longer referenced from builtin JS code.
This patch cleans up them.

* builtins/BuiltinNames.h:
* builtins/ObjectConstructor.js:
(entries):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):

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

6 months agoWeb Inspector: Logging a native function to the console, such as `alert`, produces...
commit-queue@webkit.org [Sat, 16 Feb 2019 06:41:55 +0000 (06:41 +0000)]
Web Inspector: Logging a native function to the console, such as `alert`, produces unhandled rejection
https://bugs.webkit.org/show_bug.cgi?id=194740

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-02-15
Reviewed by Matt Baker.

* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.prototype.findFunctionSourceCodeLocation):
In case of a protocol error (common when attempting to get a location
for a native function) produce the NoSourceFound result.

* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._appendLocationLink):
Simplify with an arrow function.

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

6 months agoWeb Inspector: Some timelines views work, show Legacy CPU timeline
commit-queue@webkit.org [Sat, 16 Feb 2019 05:29:36 +0000 (05:29 +0000)]
Web Inspector: Some timelines views work, show Legacy CPU timeline
https://bugs.webkit.org/show_bug.cgi?id=194738

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-02-15
Reviewed by Yusuke Suzuki.

* UserInterface/Views/ContentView.js:
(WI.ContentView.createFromRepresentedObject):

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

6 months agoNetworkDataTask should check its client before calling shouldCaptureExtraNetworkLoadM...
youenn@apple.com [Sat, 16 Feb 2019 04:57:09 +0000 (04:57 +0000)]
NetworkDataTask should check its client before calling shouldCaptureExtraNetworkLoadMetrics
https://bugs.webkit.org/show_bug.cgi?id=194732

Reviewed by Geoffrey Garen.

NetworkDataTask may be kept alive if refing it after its NetworkLoad is gone.
This might happen for instance in DownloadManager or when checking for TLS certificates.
In that case, if the NetworkLoad gets destroyed, it clears the client of the NetworkDataTask.
To ensure that NetworkDataTask does not try to use its client, add a null check.

* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics const):

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

6 months ago[JSC] Lazily create empty RegExp
ysuzuki@apple.com [Sat, 16 Feb 2019 04:32:42 +0000 (04:32 +0000)]
[JSC] Lazily create empty RegExp
https://bugs.webkit.org/show_bug.cgi?id=194735

Reviewed by Keith Miller.

Some scripts do not have any RegExp. In that case, allocating MarkedBlock for RegExp is costly.
Previously, there was always one RegExp, "empty RegExp". This patch lazily creates it and drop
one MarkedBlock.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/RegExpCache.cpp:
(JSC::RegExpCache::ensureEmptyRegExpSlow):
(JSC::RegExpCache::initialize): Deleted.
* runtime/RegExpCache.h:
(JSC::RegExpCache::ensureEmptyRegExp):
(JSC::RegExpCache::emptyRegExp const): Deleted.
* runtime/RegExpCachedResult.cpp:
(JSC::RegExpCachedResult::lastResult):
* runtime/RegExpCachedResult.h:
* runtime/VM.cpp:
(JSC::VM::VM):

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

6 months agoAX: Audit tab should have built-in accessibility tests.
aaron_chu@apple.com [Sat, 16 Feb 2019 03:51:41 +0000 (03:51 +0000)]
AX: Audit tab should have built-in accessibility tests.
https://bugs.webkit.org/show_bug.cgi?id=194005
<rdar://problem/47657503>

Updated built-in accessibility audits test suite.

Reviewed by Devin Rousso.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Controllers/AuditManager.js:
(WI.AuditManager.prototype.addDefaultTestsIfNeeded):
(WI.AuditManager):
(WI.AuditManager.prototype.addDefaultTestsIfNeeded.): Deleted.

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

6 months agoWeb Inspector: Dark Mode: commas in CSS selectors are too dim
nvasilyev@apple.com [Sat, 16 Feb 2019 02:03:32 +0000 (02:03 +0000)]
Web Inspector: Dark Mode: commas in CSS selectors are too dim
https://bugs.webkit.org/show_bug.cgi?id=194729
<rdar://problem/48128592>

Reviewed by Matt Baker.

Use `--text-color-tertiary` for both light and dark modes.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
(.spreadsheet-style-declaration-editor):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
(.spreadsheet-css-declaration):
(.spreadsheet-css-declaration .selector > span):
(@media (prefers-color-scheme: dark)):
* UserInterface/Views/Variables.css:
(:root):

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

6 months ago[JSC] Make builtin objects more lazily initialized under non-JIT mode
ysuzuki@apple.com [Sat, 16 Feb 2019 01:38:17 +0000 (01:38 +0000)]
[JSC] Make builtin objects more lazily initialized under non-JIT mode
https://bugs.webkit.org/show_bug.cgi?id=194727

Reviewed by Saam Barati.

Source/JavaScriptCore:

Boolean, Symbol, and Number constructors and prototypes are initialized eagerly, but this is largely
because concurrent compiler can touch NumberPrototype etc. when traversing object's prototypes. This
means that eager initialization is not necessary under non-JIT mode. While we can investigate all the
accesses to these prototypes from the concurrent compiler threads, this "lazily initialize under non-JIT"
is safe and beneficial to non-JIT mode. This patch lazily initializes them under non-JIT mode, and
drop some @Number references to avoid eager initialization. This removes some object allocations and 1
MarkedBlock allocation just for Symbols.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::numberToStringWatchpoint):
(JSC::JSGlobalObject::booleanPrototype const):
(JSC::JSGlobalObject::numberPrototype const):
(JSC::JSGlobalObject::symbolPrototype const):
(JSC::JSGlobalObject::booleanObjectStructure const):
(JSC::JSGlobalObject::symbolObjectStructure const):
(JSC::JSGlobalObject::numberObjectStructure const):
(JSC::JSGlobalObject::stringObjectStructure const):

Source/WebCore:

* Modules/streams/ReadableByteStreamInternals.js:
(privateInitializeReadableByteStreamController):
(readableByteStreamControllerRespond):

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

6 months agoUnreviewed, fix intentation.
nvasilyev@apple.com [Sat, 16 Feb 2019 01:21:47 +0000 (01:21 +0000)]
Unreviewed, fix intentation.

* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.css:
(.sidebar > .panel.details.css-style .rules):
(.sidebar > .panel.details.css-style > .content > .rules .section-header):

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

6 months ago[PSON] Allow tweaking WebProcess cache parameters via user defaults
cdumez@apple.com [Sat, 16 Feb 2019 01:18:25 +0000 (01:18 +0000)]
[PSON] Allow tweaking WebProcess cache parameters via user defaults
https://bugs.webkit.org/show_bug.cgi?id=194731
<rdar://problem/48125377>

Reviewed by Geoffrey Garen.

Allow tweaking WebProcess cache parameters via user defaults like so:
$ defaults write com.apple.Safari WebProcessCacheCachedProcessLifetimeInSeconds 120
-> Cached processes will be evicted after 2 minutes (instead of 30)

$ defaults write com.apple.Safari WebProcessCacheClearingDelayAfterApplicationResignsActiveInSeconds 60
-> Web process cache will be cleared if Safari is no longer active for 1 minutes (instead of 5).

* SourcesCocoa.txt:
* UIProcess/Cocoa/WebProcessCacheCocoa.mm: Copied from Source/WebKit/UIProcess/WebProcessCache.h.
(WebKit::WebProcessCache::platformInitialize):
* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::WebProcessCache):
(WebKit::WebProcessCache::platformInitialize):
* UIProcess/WebProcessCache.h:
* WebKit.xcodeproj/project.pbxproj:

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

6 months agoRELEASE_ASSERT at com.apple.JavaScriptCore: JSC::jsSubstringOfResolved
msaboff@apple.com [Sat, 16 Feb 2019 01:13:57 +0000 (01:13 +0000)]
RELEASE_ASSERT at com.apple.JavaScriptCore: JSC::jsSubstringOfResolved
https://bugs.webkit.org/show_bug.cgi?id=194558

Reviewed by Saam Barati.

JSTests:

New regression test.

* stress/regexp-unicode-within-string.js: Added.

Source/JavaScriptCore:

Added an in bounds check before the read of the next character for Unicode regular expressions
for pattern generation that didn't already have such checks.

* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::generatePatternCharacterOnce):
(JSC::Yarr::YarrGenerator::generatePatternCharacterFixed):
(JSC::Yarr::YarrGenerator::generateCharacterClassOnce):
(JSC::Yarr::YarrGenerator::generateCharacterClassFixed):

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

6 months agoAllow emulation of user gestures from Web Inspector console
dino@apple.com [Sat, 16 Feb 2019 00:52:56 +0000 (00:52 +0000)]
Allow emulation of user gestures from Web Inspector console
https://bugs.webkit.org/show_bug.cgi?id=194725
<rdar://problem/48126604>

Reviewed by Joseph Pecoraro and Devin Rousso.

Source/JavaScriptCore:

* inspector/agents/InspectorRuntimeAgent.cpp: Add a new optional parameter, emulateUserGesture,
to the evaluate function, and mark the function as override so that PageRuntimeAgent
can change the behaviour.
(Inspector::InspectorRuntimeAgent::evaluate):
* inspector/agents/InspectorRuntimeAgent.h:
* inspector/protocol/Runtime.json:

Source/WebCore:

Test: inspector/runtime/evaluate-userGestureEmulation.html

* inspector/agents/page/PageRuntimeAgent.cpp: Override the emulate method and create
a UserGestureIndicator based on the emulateUserGesture option.
(WebCore::PageRuntimeAgent::evaluate):
* inspector/agents/page/PageRuntimeAgent.h:

Source/WebInspectorUI:

Add some UI for emulating a User Gesture when evaluating in the console. This
allows the developer to do things that would otherwise require actual interaction
with the page, such as start playback of media on iOS.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Setting.js: Add a new setting for this option.
* UserInterface/Controllers/JavaScriptLogViewController.js:
(WI.JavaScriptLogViewController.prototype.consolePromptTextCommitted):
* UserInterface/Controllers/RuntimeManager.js: Call evaluate with this new option.
(WI.RuntimeManager.prototype.evaluateInInspectedWindow):
* UserInterface/Views/LogContentView.js: Add a new checkbox in the upper bar
that allows the user to toggle the setting.
(WI.LogContentView):
(WI.LogContentView.prototype.get navigationItems):
(WI.LogContentView.prototype._handleEmulateInUserGestureSettingChanged):

* UserInterface/Views/NetworkTableContentView.js: Two drive-by typo fixes :)
(WI.NetworkTableContentView): perserve -> preserve
(WI.NetworkTableContentView.prototype.get navigationItems): checkboxs -> checkboxes

LayoutTests:

* inspector/runtime/evaluate-userGestureEmulation-expected.txt: Added.
* inspector/runtime/evaluate-userGestureEmulation.html: Added.

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

6 months agoSample domainsVisited diagnostic logging
cdumez@apple.com [Sat, 16 Feb 2019 00:36:06 +0000 (00:36 +0000)]
Sample domainsVisited diagnostic logging
https://bugs.webkit.org/show_bug.cgi?id=194657

Reviewed by Ryosuke Niwa.

Sample domainsVisited diagnostic logging, we are getting a lot of data from
this key and this is hurting our other keys.

* page/Page.cpp:
(WebCore::Page::logNavigation):

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

6 months ago[PSON] Disable WebContent process cache on devices with less than 3GB of RAM
cdumez@apple.com [Sat, 16 Feb 2019 00:35:05 +0000 (00:35 +0000)]
[PSON] Disable WebContent process cache on devices with less than 3GB of RAM
https://bugs.webkit.org/show_bug.cgi?id=194726
<rdar://problem/48126255>

Reviewed by Geoffrey Garen.

* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::updateCapacity):

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

6 months ago[JSC] Do not initialize Wasm related data if Wasm is not enabled
ysuzuki@apple.com [Sat, 16 Feb 2019 00:18:54 +0000 (00:18 +0000)]
[JSC] Do not initialize Wasm related data if Wasm is not enabled
https://bugs.webkit.org/show_bug.cgi?id=194728

Reviewed by Mark Lam.

Under non-JIT mode, these data structures are unnecessary. Should not allocate extra memory for that.

* runtime/InitializeThreading.cpp:
(JSC::initializeThreading):
* runtime/JSLock.cpp:
(JSC::JSLock::didAcquireLock):

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

6 months agoCrash in the hit testing code via HTMLPlugInElement::isReplacementObscured()
rniwa@webkit.org [Fri, 15 Feb 2019 23:49:56 +0000 (23:49 +0000)]
Crash in the hit testing code via HTMLPlugInElement::isReplacementObscured()
https://bugs.webkit.org/show_bug.cgi?id=194691

Reviewed by Simon Fraser.

Source/WebCore:

The crash was caused by HTMLPlugInElement::isReplacementObscured updating the document
without updating the layout of ancestor documents (i.e. documents in which frame owner
elements appear) even though it hit-tests against the top-level document's RenderView.

Fixed the bug by updating the layout of the top-level document as needed.

Test: plugins/unsupported-plugin-with-replacement-in-iframe-crash.html

* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::isReplacementObscured):

LayoutTests:

Added a regression test. It hits the newly added debug assertion without the fix.

* platform/mac-wk1/TestExpectations: Skip the test since DumpRenderTree doesn't support
testRunner.setPluginSupportedMode.
* plugins/unsupported-plugin-with-replacement-in-iframe-crash-expected.txt: Added.
* plugins/unsupported-plugin-with-replacement-in-iframe-crash.html: Added.

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

6 months ago[iOS] Stop setting a background color on the PDF host view
aestes@apple.com [Fri, 15 Feb 2019 23:45:54 +0000 (23:45 +0000)]
[iOS] Stop setting a background color on the PDF host view
https://bugs.webkit.org/show_bug.cgi?id=194722
<rdar://48124152>

Reviewed by Wenson Hsieh.

PDFKit already sets a background color on this view, so there‚Äôs no need (and some harm) in
us doing it too.

* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView web_setContentProviderData:suggestedFilename:]):

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

6 months agoWeb Inspector: Styles: valid values in style attributes are reported as unsupported...
nvasilyev@apple.com [Fri, 15 Feb 2019 23:44:15 +0000 (23:44 +0000)]
Web Inspector: Styles: valid values in style attributes are reported as unsupported property values
https://bugs.webkit.org/show_bug.cgi?id=194619
<rdar://problem/47917373>

Source/WebInspectorUI:

Reviewed by Devin Rousso.

Payload of inline styles may contain `range` that doesn't match
the actual text of the payload - it has an extra empty line at the end.
Mismatching ranges caused data corruption.

* UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles.prototype._parseStylePropertyPayload):

LayoutTests:

Reviewed by Devin Rousso and Joseph Pecoraro.

* inspector/css/modify-inline-style-expected.txt: Added.
* inspector/css/modify-inline-style.html: Added.

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

6 months agoUpdate IPC code generator unit test expectations after r241611
achristensen@apple.com [Fri, 15 Feb 2019 23:39:27 +0000 (23:39 +0000)]
Update IPC code generator unit test expectations after r241611
https://bugs.webkit.org/show_bug.cgi?id=194678

* Scripts/webkit/LegacyMessages-expected.h:
* Scripts/webkit/Messages-expected.h:
* Scripts/webkit/MessagesSuperclass-expected.h:

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

6 months agoWeb Inspector: remove unused parameter in _parseStylePropertyPayload
nvasilyev@apple.com [Fri, 15 Feb 2019 23:37:51 +0000 (23:37 +0000)]
Web Inspector: remove unused parameter in _parseStylePropertyPayload
https://bugs.webkit.org/show_bug.cgi?id=194642

Reviewed by Devin Rousso.

* UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles.prototype._parseStyleDeclarationPayload):
The `styleText` parameter was never used

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

6 months ago[WTF] Add environment variable helpers
ross.kirsling@sony.com [Fri, 15 Feb 2019 22:47:26 +0000 (22:47 +0000)]
[WTF] Add environment variable helpers
https://bugs.webkit.org/show_bug.cgi?id=192405

Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

* inspector/remote/glib/RemoteInspectorGlib.cpp:
(Inspector::RemoteInspector::RemoteInspector):
(Inspector::RemoteInspector::start):
* jsc.cpp:
(startTimeoutThreadIfNeeded):
* runtime/Options.cpp:
(JSC::overrideOptionWithHeuristic):
(JSC::Options::overrideAliasedOptionWithHeuristic):
(JSC::Options::initialize):
* runtime/VM.cpp:
(JSC::enableAssembler):
(JSC::VM::VM):
* tools/CodeProfiling.cpp:
(JSC::CodeProfiling::notifyAllocator):
Utilize WTF::Environment where possible.

Source/WebCore:

* platform/NotImplemented.h:
* platform/cocoa/SystemVersion.mm:
(WebCore::createSystemMarketingVersion):
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::initializeGStreamer):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/nicosia/NicosiaPaintingEngine.cpp:
(Nicosia::PaintingEngine::create):
* platform/graphics/texmap/TextureMapperFPSCounter.cpp:
(WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::create):
* platform/gtk/RenderThemeWidget.cpp:
(WebCore::RenderThemeScrollbar::RenderThemeScrollbar):
* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlContext::CurlContext):
(WebCore::EnvironmentVariableReader::read): Deleted.
(WebCore::EnvironmentVariableReader::defined): Deleted.
(WebCore::EnvironmentVariableReader::readAs): Deleted.
(WebCore::EnvironmentVariableReader::sscanTemplate): Deleted.
(WebCore::EnvironmentVariableReader::sscanTemplate<signed>): Deleted.
(WebCore::EnvironmentVariableReader::sscanTemplate<unsigned>): Deleted.
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::defaultCookieJarPath):
* platform/network/playstation/CurlSSLHandlePlayStation.cpp:
(WebCore::getCACertPathEnv):
* platform/network/win/CurlSSLHandleWin.cpp:
(WebCore::getCACertPathEnv):
* platform/text/hyphen/HyphenationLibHyphen.cpp:
(WebCore::topLevelPath):
(WebCore::webkitBuildDirectory):
* platform/unix/LoggingUnix.cpp:
(WebCore::logLevelString):
* platform/win/LoggingWin.cpp:
(WebCore::logLevelString):
Utilize WTF::Environment where possible.

Source/WebCore/PAL:

* pal/unix/LoggingUnix.cpp:
(PAL::logLevelString):
* pal/win/LoggingWin.cpp:
(PAL::logLevelString):
Utilize WTF::Environment where possible.

Source/WebKit:

* NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
(main):
* Platform/unix/LoggingUnix.cpp:
(WebKit::logLevelString):
* Platform/win/LoggingWin.cpp:
(WebKit::logLevelString):
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::shouldCallRealDebugger):
* Shared/Plugins/unix/PluginSearchPath.cpp:
(WebKit::pluginsDirectories):
* Shared/glib/ProcessExecutablePathGLib.cpp:
(WebKit::findWebKitProcess):
* UIProcess/API/glib/WebKitSettings.cpp:
(webKitSettingsConstructed):
(webKitSettingsSetProperty):
* UIProcess/API/glib/WebKitWebContext.cpp:
(injectedBundleDirectory):
(webkitWebContextConstructed):
* UIProcess/API/gtk/WebKitWebViewGtk.cpp:
(webkitWebViewMaximizeWindow):
(webkitWebViewRestoreWindow):
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::m_backend):
* UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::getLaunchOptions):
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::XDGDBusProxyLauncher::launch):
(WebKit::bindDBusSession):
(WebKit::bindX11):
(WebKit::bindWayland):
(WebKit::bindPulse):
(WebKit::bindPathVar):
(WebKit::bindGStreamerData):
(WebKit::bubblewrapSpawn):
* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::systemDirectoryPath):
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::memoryPressureMonitorDisabled):
(WebKit::WebProcessPool::platformInitialize):
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/gtk/HardwareAccelerationManager.cpp:
(WebKit::HardwareAccelerationManager::HardwareAccelerationManager):
* WebProcess/EntryPoint/unix/WebProcessMain.cpp:
(main):
* WebProcess/gtk/WebProcessMainGtk.cpp:
* WebProcess/wpe/WebProcessMainWPE.cpp:
Utilize WTF::Environment where possible.

Source/WebKitLegacy/ios:

* Misc/WebUIKitSupport.mm:
(WebKitPlatformSystemRootDirectory):
Utilize WTF::Environment where possible.

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView _initWithFrame:frameName:groupName:]):
Utilize WTF::Environment where possible.

Source/WTF:

Create a new Environment API as a platform-independent, thread-safe(r)
way to get and set environment variables.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Environment.h: Added.
* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformMac.cmake:
* wtf/PlatformPlayStation.cmake:
* wtf/PlatformWPE.cmake:
* wtf/PlatformWin.cmake:
* wtf/posix/EnvironmentPOSIX.cpp: Added.
* wtf/win/EnvironmentWin.cpp: Added.
Introduce WTF::Environment.

* wtf/Threading.cpp:
(WTF::threadingIsInitialized):
(WTF::initializeThreading):
* wtf/Threading.h:
Introduce WTF::threadingIsInitialized() so that we can ASSERT that it's
false before setting an environment variable through the new API.

* wtf/DataLog.cpp:
(WTF::initializeLogFileOnce):
* wtf/NumberOfCores.cpp:
(WTF::numberOfProcessorCores):
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::openTemporaryFile):
Utilize WTF::Environment where possible.

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(libraryPathForDumpRenderTree):
* DumpRenderTree/win/DumpRenderTree.cpp:
(libraryPathForDumpRenderTree):
* TestRunnerShared/IOSLayoutTestCommunication.cpp:
(setUpIOSLayoutTestCommunication):
* TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp:
(beforeAll):
* TestWebKitAPI/glib/WebKitGLib/TestMain.cpp:
(main):
* TestWebKitAPI/glib/WebKitGLib/WebKitTestBus.cpp:
(WebKitTestBus::run):
* WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp:
(WTR::getOutputDir):
(WTR::initializeFontConfigSetting):
* WebKitTestRunner/InjectedBundle/gtk/InjectedBundleGtk.cpp:
(WTR::InjectedBundle::platformInitialize):
* WebKitTestRunner/InjectedBundle/gtk/InjectedBundleUtilities.cpp:
(WTR::topLevelPath):
* WebKitTestRunner/InjectedBundle/wpe/ActivateFontsWPE.cpp:
(WTR::topLevelPath):
(WTR::getOutputDir):
(WTR::activateFonts):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::libraryPathForTesting):
(WTR::TestController::generateContextConfiguration const):
(WTR::TestController::generatePageConfiguration):
(WTR::TestController::decideDestinationWithSuggestedFilename):
(WTR::TestController::platformAdjustContext):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::cocoaPlatformInitialize):
(WTR::TestController::platformAdjustContext):
* WebKitTestRunner/gtk/main.cpp:
(main):
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::TestController::configureContentExtensionForTest):
* WebKitTestRunner/wpe/main.cpp:
(main):
Utilize WTF::Environment where possible.

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

6 months agoAdd SPI version of WKPreferences.safeBrowsingEnabled
achristensen@apple.com [Fri, 15 Feb 2019 22:19:04 +0000 (22:19 +0000)]
Add SPI version of WKPreferences.safeBrowsingEnabled
https://bugs.webkit.org/show_bug.cgi?id=194718
<rdar://problem/48122993>

Rubber-stamped by Brady Eidson.

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _isSafeBrowsingEnabled]):
(-[WKPreferences _setSafeBrowsingEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

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

6 months agoAdd a method to dispatch a PointerEvent based on a PlatformTouchEvent
graouts@webkit.org [Fri, 15 Feb 2019 22:18:36 +0000 (22:18 +0000)]
Add a method to dispatch a PointerEvent based on a PlatformTouchEvent
https://bugs.webkit.org/show_bug.cgi?id=194702
<rdar://problem/48109355>

Reviewed by Dean Jackson.

* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchPointerEventForTouchAtIndex):
* page/EventHandler.h:

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

6 months agoWeb Inspector: Canvas: all actions after an offscreen path modification are marked...
drousso@apple.com [Fri, 15 Feb 2019 22:14:29 +0000 (22:14 +0000)]
Web Inspector: Canvas: all actions after an offscreen path modification are marked as offscreen path errors
https://bugs.webkit.org/show_bug.cgi?id=194684

Reviewed by Joseph Pecoraro.

* UserInterface/Models/RecordingAction.js:
(WI.RecordingAction.prototype.process):

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

6 months agoSamplingProfiler::stackTracesAsJSON() should escape strings.
mark.lam@apple.com [Fri, 15 Feb 2019 21:41:15 +0000 (21:41 +0000)]
SamplingProfiler::stackTracesAsJSON() should escape strings.
https://bugs.webkit.org/show_bug.cgi?id=194649
<rdar://problem/48072386>

Reviewed by Saam Barati.

JSTests:

* stress/sampling-profiler-stack-trace-with-double-quote-in-function-name.js: Added.
* stress/type-profiler-with-double-quote-in-constructor-name.js: Added.
* stress/type-profiler-with-double-quote-in-field-name.js: Added.
* stress/type-profiler-with-double-quote-in-optional-field-name.js: Added.

Source/JavaScriptCore:

Ditto for TypeSet::toJSONString() and TypeSet::toJSONString().

* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::stackTracesAsJSON):
* runtime/TypeSet.cpp:
(JSC::TypeSet::toJSONString const):
(JSC::StructureShape::toJSONString const):

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

6 months ago[iOS] WKWebView callout bar is missing Change Writing Direction item
wenson_hsieh@apple.com [Fri, 15 Feb 2019 21:35:52 +0000 (21:35 +0000)]
[iOS] WKWebView callout bar is missing Change Writing Direction item
https://bugs.webkit.org/show_bug.cgi?id=190015
<rdar://problem/44810366>

Reviewed by Tim Horton.

Source/WebKit:

Support -makeTextWritingDirectionLeftToRight: and -makeTextWritingDirectionRightToLeft: in WKWebView on iOS.
To match behavior in native UITextViews on iOS, we implement these methods by changing the *base* writing
direction, rather than the text writing direction (this is in contrast to macOS, which has different
NSResponder methods for changing the base writing direction as opposed to the text writing direction).

Additionally fixes the implementation of -makeTextWritingDirectionNatural:, which currently attempts to change
the text writing direction instead of the base writing direction.

* Platform/spi/ios/UIKitSPI.h:

Add a forward declaration for keyboards SPI to determine whether the user has an active RTL keyboard.

* Shared/EditorState.cpp:
(WebKit::EditorState::PostLayoutData::encode const):
(WebKit::EditorState::PostLayoutData::decode):
(WebKit::operator<<):
* Shared/EditorState.h:

Plumb the base writing direction to the UI process through EditorState.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView makeTextWritingDirectionNaturalForWebView:]):
(-[WKContentView makeTextWritingDirectionLeftToRightForWebView:]):
(-[WKContentView makeTextWritingDirectionRightToLeftForWebView:]):

Implement the new SPI (see above for more details).

(-[WKContentView canPerformActionForWebView:withSender:]):

Implement -canPerformAction: for LTR and RTL actions. To match existing UIWebView behavior, we only enable
these actions if either the base writing direction is RTL, or the user has an active RTL keyboard. This means,
for instance, that in the case where a user with only an English keyboard is editing LTR content, we would never
show an option to convert to RTL.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::editorState const):

Tools:

Make an existing API test that exercises platform SPI to change the inline text writing direction run only on
macOS, and add a new API test that uses similarly named SPI on iOS to change the base writing direction.

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

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

6 months ago[JSC] CodeBlock::jettison should clear related watchpoints
rmorisset@apple.com [Fri, 15 Feb 2019 21:34:19 +0000 (21:34 +0000)]
[JSC] CodeBlock::jettison should clear related watchpoints
https://bugs.webkit.org/show_bug.cgi?id=194544

Reviewed by Mark Lam.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::jettison):
* dfg/DFGCommonData.h:
(JSC::DFG::CommonData::clearWatchpoints): Added.
* dfg/CommonData.cpp:
(JSC::DFG::CommonData::clearWatchpoints): Added.

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

6 months agoMove bytecode cache-related filesystem code out of CodeCache
tzagallo@apple.com [Fri, 15 Feb 2019 21:27:54 +0000 (21:27 +0000)]
Move bytecode cache-related filesystem code out of CodeCache
https://bugs.webkit.org/show_bug.cgi?id=194675

Reviewed by Saam Barati.

That code is only used for the bytecode-cache tests, so it should live in
jsc.cpp rather than in the CodeCache.

* jsc.cpp:
(CliSourceProvider::create):
(CliSourceProvider::~CliSourceProvider):
(CliSourceProvider::cachePath const):
(CliSourceProvider::loadBytecode):
(CliSourceProvider::CliSourceProvider):
(jscSource):
(GlobalObject::moduleLoaderFetch):
(functionDollarEvalScript):
(runWithOptions):
* parser/SourceProvider.h:
(JSC::SourceProvider::cacheBytecode const):
* runtime/CodeCache.cpp:
(JSC::writeCodeBlock):
* runtime/CodeCache.h:
(JSC::CodeCacheMap::fetchFromDiskImpl):

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

6 months agoMake WebPaymentCoordinatorProxy more robust and modern
achristensen@apple.com [Fri, 15 Feb 2019 21:25:28 +0000 (21:25 +0000)]
Make WebPaymentCoordinatorProxy more robust and modern
https://bugs.webkit.org/show_bug.cgi?id=194678

Reviewed by Andy Estes.

Use WeakPtr instead of storing raw pointers in lambdas or the global activePaymentCoordinatorProxy to avoid UAF problems.
Call CompletionHandlers in all code paths to avoid hangs.
Use Delayed instead of LegacySync for synchronous messaging to progress towards removing LegacySync messages.

* Scripts/webkit/messages.py:
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::activePaymentCoordinatorProxy):
(WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy):
(WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):
(WebKit::WebPaymentCoordinatorProxy::canMakePayments):
(WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
(WebKit::WebPaymentCoordinatorProxy::didReachFinalState):
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
* UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
* UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):

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

6 months ago[JSC] DFG, FTL, and Wasm worklist creation should be fenced
ysuzuki@apple.com [Fri, 15 Feb 2019 21:21:44 +0000 (21:21 +0000)]
[JSC] DFG, FTL, and Wasm worklist creation should be fenced
https://bugs.webkit.org/show_bug.cgi?id=194714

Reviewed by Mark Lam.

Let's consider about the following extreme case.

1. VM (A) is created.
2. Another VM (B) is created on a different thread.
3. (A) is being destroyed. It calls DFG::existingWorklistForIndexOrNull in a destructor.
4. At the same time, (B) starts using DFG Worklist and it is instantiated in call_once.
5. But (A) reads the pointer directly through DFG::existingWorklistForIndexOrNull.
6. (A) sees the half-baked worklist, which may be in the middle of creation.

This patch puts store-store fence just before putting a pointer to a global variable.
This fence is executed only three times at most, for DFG, FTL, and Wasm worklist initializations.

* dfg/DFGWorklist.cpp:
(JSC::DFG::ensureGlobalDFGWorklist):
(JSC::DFG::ensureGlobalFTLWorklist):
* wasm/WasmWorklist.cpp:
(JSC::Wasm::ensureWorklist):

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

6 months agoMake ServiceWorkerClientFetch closer to WebResourceLoader
youenn@apple.com [Fri, 15 Feb 2019 21:18:47 +0000 (21:18 +0000)]
Make ServiceWorkerClientFetch closer to WebResourceLoader
https://bugs.webkit.org/show_bug.cgi?id=194651

Unreviewed, build fix for WPE.

* WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:

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

6 months ago[WebVTT] Inline WebVTT styles should start with '::cue'
pvollan@apple.com [Fri, 15 Feb 2019 21:13:06 +0000 (21:13 +0000)]
[WebVTT] Inline WebVTT styles should start with '::cue'
https://bugs.webkit.org/show_bug.cgi?id=194227

Reviewed by Eric Carlson.

Source/WebCore:

The original fix in r241203 is not sufficient, since it only checks if the CSS string starts
with '::cue'. Before accepting a CSS string from a WebVTT file, it should be checked that
all selectors starts with '::cue'.

Test: media/track/track-cue-css.html

* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::checkAndStoreStyleSheet):

LayoutTests:

Add invalid 'STYLE' blocks which the WebVTT parser should reject.

* media/track/captions-webvtt/css-styling.vtt:

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

6 months agoAdd binding tests for ContextAllowsMediaDevices and ContextHasServiceWorkerScheme
youenn@apple.com [Fri, 15 Feb 2019 21:09:47 +0000 (21:09 +0000)]
Add binding tests for ContextAllowsMediaDevices and ContextHasServiceWorkerScheme
https://bugs.webkit.org/show_bug.cgi?id=194713

Reviewed by Eric Carlson.

Binding tests covering mediaDevices and serviceWorker attributes.

* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjPrototype::finishCreation):
(WebCore::jsTestObjMediaDevices1Getter):
(WebCore::jsTestObjMediaDevices1):
(WebCore::jsTestObjMediaDevices2Getter):
(WebCore::jsTestObjMediaDevices2):
(WebCore::jsTestObjServiceWorkers1Getter):
(WebCore::jsTestObjServiceWorkers1):
(WebCore::jsTestObjServiceWorkers2Getter):
(WebCore::jsTestObjServiceWorkers2):
* bindings/scripts/test/TestObj.idl:

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

6 months agoRegression(PSON) Navigating quickly back and forth can lead to getting 'about:blank...
cdumez@apple.com [Fri, 15 Feb 2019 21:03:53 +0000 (21:03 +0000)]
Regression(PSON) Navigating quickly back and forth can lead to getting 'about:blank' in the backforward list
https://bugs.webkit.org/show_bug.cgi?id=194717
<rdar://problem/47884404>

Reviewed by Brady Eidson.

Source/WebKit:

When the client does a history navigation, the UIProcess sends a WebPage::GoToBackForwardItem IPC to the
WebProcess and the WebProcess sends a WebPageProxy::BackForwardGoToItem IPC back to the UIProcess to
update the current item in the BackForwardList. This means that there is a slight delay between the
point a client requests a history navigation and the point where the BackForwardList's current item gets
update. This delay is pre-existing behavior and not new to PSON.

However, with PSON enabled, if we decide to process-swap for the history navigation, we'll tell the
previous (committed) process to ignore the load and we ask a new (provisional) process to do the history
navigation. When the previous process receives the request to ignore the history navigation, it restores
the History's current item to the one previous the navigation, which sends a WebPageProxy::GoToBackForwardItem
IPC to the UIProcess to update the BackForwardList as well. In parallel, the new process starts the
history navigation and also sends a WebPageProxy::GoToBackForwardItem to update the BackForwardList's
current item as well. We end up with a race between the 2 GoToBackForwardItem IPC messages coming from
the old and new process. If the old process's message loses the race, we end up with the wrong current
history item getting set in the UIProcess. Later, when we commit the provisional load and try to suspend
the previous page, we would save the SuspendedPage on the *wrong* BackForwardList item. If one tries to
load this BackForwardList item later, we'll use its SuspendedPage and try to unsuspend it. However,
because the PageCache entry is saved on another HistoryItem than the one getting loaded in the WebProcess
side, we attempt to do a regular load instead of a PageCache restore. We end up failing the load because
pages cannot trigger new loads while in page cache. Because the load fails, we end up loading the
initial empty document and this is how we end up with 'about:blank' in the back forward list.

To address the issue, update WebPageProxy::backForwardGoToItem() to ignore messages from the old/committed
WebProcess when there is a pending provisional load. If the committed processes starts a legit new
load, it would clear any existing pending provisional load before attempting the call backForwardGoToItem().
As a result, ignoring such messages from the old processes when there is a pending provisional load is
safe.

In the future, we should probably move more of the history / backForwardList management to the UIProcess
to avoid this sort of issues. This would be a much larger refactoring though so I am going with this
simpler fix that is easily cherry-pickable for now.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::suspendCurrentPageIfPossible):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
(WebKit::WebPageProxy::backForwardGoToItem):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

6 months agoBuild fix.
bdakin@apple.com [Fri, 15 Feb 2019 21:00:01 +0000 (21:00 +0000)]
Build fix.

* rendering/RenderThemeIOS.mm:
(WebCore::iconForAttachment):

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

6 months agoUpdate IPC code generator unit test expectations after r241595
achristensen@apple.com [Fri, 15 Feb 2019 20:55:34 +0000 (20:55 +0000)]
Update IPC code generator unit test expectations after r241595
https://bugs.webkit.org/show_bug.cgi?id=194679

* Scripts/webkit/LegacyMessageReceiver-expected.cpp:
(WebKit::WebPage::didReceiveSyncWebPageMessage):
* Scripts/webkit/MessageReceiver-expected.cpp:
(WebKit::WebPage::didReceiveSyncMessage):

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

6 months agoMake ServiceWorkerClientFetch closer to WebResourceLoader
youenn@apple.com [Fri, 15 Feb 2019 20:25:02 +0000 (20:25 +0000)]
Make ServiceWorkerClientFetch closer to WebResourceLoader
https://bugs.webkit.org/show_bug.cgi?id=194651

Reviewed by Alex Christensen.

Source/WebCore:

Check for redirection response and if so call a specific client API.
Ensure ServiceWorkerFetch::Client gets called in the service worker thread proxy
so that its m_connection is only accessed on that thread.

Covered by existing tests.

* platform/network/FormData.h:
* platform/network/ResourceErrorBase.h:
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::processResponse):
* workers/service/context/ServiceWorkerFetch.h:
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::cancelFetch):
(WebCore::ServiceWorkerThreadProxy::continueDidReceiveFetchResponse):
* workers/service/context/ServiceWorkerThreadProxy.h:

Source/WebKit:

The goal of this refactoring is to, at some point use the regular network process load path for service worker loads.
This should simplify things and allow less IPC exchanges, for instance in the case of fetch not handled by service worker.

Introduce two IPC messages for supporting redirect responses and allow the didReceiveResponse/continueDidReceiveResponse
handshake for navigation loads.

This makes ServiceWorker having to buffer load information for this particular case.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::didReceiveFetchRedirectResponse):
(WebKit::NetworkProcess::didReceiveFetchResponse):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::continueDidReceiveFetchResponse):
(WebKit::WebSWServerConnection::didReceiveFetchRedirectResponse):
(WebKit::WebSWServerConnection::didReceiveFetchResponse):
* NetworkProcess/ServiceWorker/WebSWServerConnection.h:
* NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
(WebKit::ServiceWorkerClientFetch::start):
(WebKit::ServiceWorkerClientFetch::didReceiveRedirectResponse):
(WebKit::ServiceWorkerClientFetch::didReceiveResponse):
(WebKit::ServiceWorkerClientFetch::didReceiveData):
(WebKit::ServiceWorkerClientFetch::didFinish):
(WebKit::ServiceWorkerClientFetch::didFail):
(WebKit::ServiceWorkerClientFetch::didNotHandle):
(WebKit::ServiceWorkerClientFetch::cancel):
* WebProcess/Storage/ServiceWorkerClientFetch.h:
* WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::startFetch):
(WebKit::WebSWClientConnection::cancelFetch):
(WebKit::WebSWClientConnection::continueDidReceiveFetchResponse):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::continueDidReceiveFetchResponse):
(WebKit::WebSWContextManagerConnection::startFetch):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.messages.in:
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
(WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveRedirection):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveResponse):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish):
(WebKit::WebServiceWorkerFetchTaskClient::didFail):
(WebKit::WebServiceWorkerFetchTaskClient::didFinish):
(WebKit::WebServiceWorkerFetchTaskClient::continueDidReceiveResponse):
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:

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

6 months agoMake navigator.mediaDevices SecureContext
youenn@apple.com [Fri, 15 Feb 2019 19:22:35 +0000 (19:22 +0000)]
Make navigator.mediaDevices SecureContext
https://bugs.webkit.org/show_bug.cgi?id=194666

Reviewed by Eric Carlson.

Source/WebCore:

Make navigator.mediaDevices SecureContext.
This can still be enabled for unsecure context using the existing page settings.
To cover that case, introduce ContextHasMediaDevices custom IDL keyword.

Covered by API test.

* Modules/mediastream/NavigatorMediaDevices.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateRuntimeEnableConditionalString):
* bindings/scripts/IDLAttributes.json:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::hasMediaDevices const):
(WebCore::ScriptExecutionContext::hasServiceWorkerScheme const):
* dom/ScriptExecutionContext.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/UserMediaDisabled.mm:
(MediaCaptureDisabledTest::loadTestAndWaitForMessage):
(TEST_F):

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

6 months agoWeb Inspector: Canvas: taking a second recording doesn't select the Initial State...
drousso@apple.com [Fri, 15 Feb 2019 19:12:20 +0000 (19:12 +0000)]
Web Inspector: Canvas: taking a second recording doesn't select the Initial State by default
https://bugs.webkit.org/show_bug.cgi?id=194685

Reviewed by Matt Baker.

* UserInterface/Views/CanvasSidebarPanel.js:
(WI.CanvasSidebarPanel.prototype._recordingChanged):

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

6 months agoLayout Test accessibility/loading-iframe-sends-notification.html is timing out
pvollan@apple.com [Fri, 15 Feb 2019 19:09:34 +0000 (19:09 +0000)]
Layout Test accessibility/loading-iframe-sends-notification.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=194712

Unreviewed test gardening.

* platform/win/TestExpectations:

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

6 months agoWebSocket should not fire events after being stopped
youenn@apple.com [Fri, 15 Feb 2019 19:08:06 +0000 (19:08 +0000)]
WebSocket should not fire events after being stopped
https://bugs.webkit.org/show_bug.cgi?id=194690

Reviewed by Geoffrey Garen.

dispatchOrQueueErrorEvent is scheduled using RunLoop::main().dispatch or dispatch_async.
This makes it possible to dispatch an event while WebSocket is already stopped.
Instead, use Document::postTask so that the task is only executed if WebSocket is not stopped.

As a refactoring, make use of PendingActivity to keep track of setPendingActivity/unsetPendingActivity more easily.

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::stop):
(WebCore::WebSocket::connect):
* Modules/websockets/WebSocket.h:

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

6 months agoPerformance should not fire events when its context is stopped
youenn@apple.com [Fri, 15 Feb 2019 19:06:47 +0000 (19:06 +0000)]
Performance should not fire events when its context is stopped
https://bugs.webkit.org/show_bug.cgi?id=194689

Reviewed by Alex Christensen.

Stop the timer when its context is destroyed.
Add an assertion to ensure the timer does not fire after context is destroyed.

* page/Performance.cpp:
(WebCore::Performance::stop):

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

6 months ago[Mac] WebInspectorUI.framework does not need to be soft-linked anymore
bburg@apple.com [Fri, 15 Feb 2019 19:01:52 +0000 (19:01 +0000)]
[Mac] WebInspectorUI.framework does not need to be soft-linked anymore
https://bugs.webkit.org/show_bug.cgi?id=194411
<rdar://problem/47787614>

Reviewed by Joseph Pecoraro.

Source/WebKit:

* Configurations/WebKit.xcconfig:
Conditionalize weak linking to WebInspectorUI.framework for Mac only.

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::inspectorPageURL):
(WebKit::WebInspectorProxy::inspectorTestPageURL):
(WebKit::WebInspectorProxy::inspectorBaseURL):
* WebProcess/WebPage/mac/WebInspectorUIMac.mm:
(WebKit::webInspectorUILocalizedStringsURL):
Rewrite uses of the bundle to exit early if bundle couldn't be loaded.

Source/WebKitLegacy/mac:

* Configurations/WebKitLegacy.xcconfig:
Conditionalize weak linking to WebInspectorUI.framework for Mac only.

* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorFrontendClient::localizedStringsURL):
(-[WebInspectorWindowController inspectorPagePath]):
(-[WebInspectorWindowController inspectorTestPagePath]):
Rewrite uses of the bundle to exit early if bundle couldn't be loaded.

Source/WTF:

* wtf/cocoa/SoftLinking.h:
Remove macro that now has no uses.

Tools:

Remove unnecessary soft linking macro usage.

* DumpRenderTree/mac/TestRunnerMac.mm:
(TestRunner::inspectorTestStubURL):
(SOFT_LINK_STAGED_FRAMEWORK): Deleted.
* WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm:
(WTR::TestRunner::inspectorTestStubURL):

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

6 months agoLayout Test fast/replaced/encrypted-pdf-as-object-and-embed.html is failing
pvollan@apple.com [Fri, 15 Feb 2019 19:01:50 +0000 (19:01 +0000)]
Layout Test fast/replaced/encrypted-pdf-as-object-and-embed.html is failing
https://bugs.webkit.org/show_bug.cgi?id=194711

Unreviewed test gardening.

* platform/win/TestExpectations:

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

6 months agoIPC code should support messages with both Delayed and WantsConnection attributes
achristensen@apple.com [Fri, 15 Feb 2019 18:53:02 +0000 (18:53 +0000)]
IPC code should support messages with both Delayed and WantsConnection attributes
https://bugs.webkit.org/show_bug.cgi?id=194679

Reviewed by Geoffrey Garen.

* Platform/IPC/HandleMessage.h:
(IPC::callMemberFunctionImpl):
(IPC::callMemberFunction):
(IPC::handleMessageDelayedWantsConnection):
* Scripts/webkit/messages.py:
* UIProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::getValues):
* UIProcess/WebStorage/StorageManager.h:
* UIProcess/WebStorage/StorageManager.messages.in:

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

6 months agoREGRESSION: ( r240978-r240985 ) [ iOS Release ] Layout Test imported/w3c/web-platform...
achristensen@apple.com [Fri, 15 Feb 2019 18:51:09 +0000 (18:51 +0000)]
REGRESSION: ( r240978-r240985 ) [ iOS Release ] Layout Test imported/w3c/web-platform-tests/xhr/send-redirect-post-upload.htm is crashing
https://bugs.webkit.org/show_bug.cgi?id=194523

Reviewed by Geoffrey Garen.

The scope of the FormCreationContext was limited to the scope of createHTTPBodyCFReadStream,
so when it was used in formCreate it was lucky to get the same context if the stack hadn't been overwritten
and if the FormData hadn't been freed.  Instead, keep it alive with new/delete like we do the FormStreamFields.
A younger me should've noticed this when reviewing r218517.

* platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::formCreate):
(WebCore::createHTTPBodyCFReadStream):

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

6 months agoUnreviewed, rolling out r241559 and r241566.
commit-queue@webkit.org [Fri, 15 Feb 2019 18:26:16 +0000 (18:26 +0000)]
Unreviewed, rolling out r241559 and r241566.
https://bugs.webkit.org/show_bug.cgi?id=194710

Causes layout test crashes under GuardMalloc (Requested by
ryanhaddad on #webkit).

Reverted changesets:

"[WTF] Add environment variable helpers"
https://bugs.webkit.org/show_bug.cgi?id=192405
https://trac.webkit.org/changeset/241559

"Unreviewed build fix for WinCairo Debug after r241559."
https://trac.webkit.org/changeset/241566

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

6 months agoStop the endpoint synchronously in RTCPeerConnection::close
youenn@apple.com [Fri, 15 Feb 2019 18:25:24 +0000 (18:25 +0000)]
Stop the endpoint synchronously in RTCPeerConnection::close
https://bugs.webkit.org/show_bug.cgi?id=194688

Reviewed by Eric Carlson.

In the case where the peer connection is being closed, it was asynchronously stopping the endpoint.
But the endpoint, before being stopped, could try to fire an event.
If the context is gone in between, we end up with a null pointer dereference.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::close):

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

6 months ago[LFC] Out-of-flow box is never a float box
zalan@apple.com [Fri, 15 Feb 2019 18:04:48 +0000 (18:04 +0000)]
[LFC] Out-of-flow box is never a float box
https://bugs.webkit.org/show_bug.cgi?id=194704

Reviewed by Antti Koivisto.

Source/WebCore:

We can't have it both ways. Absolute positioning wins.

Test: fast/block/block-only/out-of-flow-is-never-float-box.html

* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isFloatingPositioned const):
(WebCore::Layout::Box::isLeftFloatingPositioned const):
(WebCore::Layout::Box::isRightFloatingPositioned const):

Tools:

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

LayoutTests:

* fast/block/block-only/out-of-flow-is-never-float-box-expected.html: Added.
* fast/block/block-only/out-of-flow-is-never-float-box.html: Added.

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

6 months ago[GStreamer] Simplify GObject class name check
commit-queue@webkit.org [Fri, 15 Feb 2019 17:26:16 +0000 (17:26 +0000)]
[GStreamer] Simplify GObject class name check
https://bugs.webkit.org/show_bug.cgi?id=194537

Patch by Philippe Normand <pnormand@igalia.com> on 2019-02-15
Reviewed by Michael Catanzaro.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback):
Use G_OBJECT_TYPE_NAME() to filter out uridecodebin child
elements.

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

6 months ago[WPE][GTK] Defer sandboxing APIs to 2.26
mcatanzaro@igalia.com [Fri, 15 Feb 2019 17:14:59 +0000 (17:14 +0000)]
[WPE][GTK] Defer sandboxing APIs to 2.26
https://bugs.webkit.org/show_bug.cgi?id=194274

Reviewed by Carlos Garcia Campos.

The web process sandbox has not been widely-tested yet, so we should defer the new APIs to
2.26.

* UIProcess/API/glib/WebKitWebContext.cpp:

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

6 months agoRefactor EditingStyle::textDirection to return an Optional<WritingDirection> instead...
wenson_hsieh@apple.com [Fri, 15 Feb 2019 16:52:33 +0000 (16:52 +0000)]
Refactor EditingStyle::textDirection to return an Optional<WritingDirection> instead of a bool
https://bugs.webkit.org/show_bug.cgi?id=194686

Reviewed by Ryosuke Niwa.

Changes EditingStyle::textDirection to return an Optional<WritingDirection>, instead of taking a reference to
the resulting WritingDirection. No change in behavior.

* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
(WebCore::ApplyStyleCommand::applyInlineStyle):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::textDirection const):
(WebCore::EditingStyle::textDirectionForSelection):
* editing/EditingStyle.h:

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

6 months agoReplace more uses of String::format with StringConcatenate (mostly non-Apple platform...
darin@apple.com [Fri, 15 Feb 2019 16:19:15 +0000 (16:19 +0000)]
Replace more uses of String::format with StringConcatenate (mostly non-Apple platform-specific cases)
https://bugs.webkit.org/show_bug.cgi?id=194487

Reviewed by Daniel Bates.

Source/WebCore:

* accessibility/win/AccessibilityObjectWrapperWin.cpp:
(WebCore::AccessibilityObjectWrapper::accessibilityAttributeValue): Use makeString
instead of String::format.

* page/linux/ResourceUsageOverlayLinux.cpp:
(WebCore::formatByteNumber): Use String::number instead of String::format.

* platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
(WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
Use makeString instead of String::format.
* platform/glib/UserAgentGLib.cpp:
(WebCore::platformVersionForUAString): Ditto.
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::simpleBusMessageCallback): Ditto.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Ditto.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline): Ditto.
(WebCore::AppendPipeline::handleStateChangeMessage): Ditto.
(WebCore::AppendPipeline::resetParserState): Ditto.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::load): Ditto.
(WebCore::MediaPlayerPrivateGStreamerMSE::doSeek): Ditto.

* platform/graphics/gtk/ImageBufferGtk.cpp:
(WebCore::encodeImage): Use String::number instead of String::format.

* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
(WebCore::GStreamerAudioCaptureSource::create): Use makeString instead of
String::format.
* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
(WebCore::GStreamerCaptureDeviceManager::addDevice): Ditto.
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(WebCore::webkitMediaStreamSrcAddPad): Ditto.
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::create): Ditto.
* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::verifySchemaVersion): Ditto.
* platform/win/SearchPopupMenuDB.cpp:
(WebCore::SearchPopupMenuDB::verifySchemaVersion): Ditto.

Source/WebKit:

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::switchToNewTestingSession): Use makeString instead of String::format.
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::buildAcceptLanguages): Ditto.
* UIProcess/API/glib/IconDatabase.cpp:
(WebKit::IconDatabase::performURLImport): Ditto.
* UIProcess/gtk/InputMethodFilter.cpp:
(WebKit::InputMethodFilter::logConfirmCompositionForTesting): Ditto.
(WebKit::InputMethodFilter::logSetPreeditForTesting): Ditto.

Source/WebKitLegacy/win:

* WebView.cpp:
(webKitVersionString): Use makeString instead of String::format.

Tools:

* DumpRenderTree/win/DumpRenderTree.cpp:
(applicationId): Use makeString instead of String::format.
(main): Ditto.
* TestWebKitAPI/win/PlatformUtilitiesWin.cpp:
(TestWebKitAPI::Util::createURLForResource): Ditto.
* WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:
(WTR::AccessibilityNotificationHandler::connectAccessibilityCallbacks): Ditto.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::attributeSetToString): Use StringBuilder functions directly instead of g_strconcat.
(WTR::attributesOfElement): Use StringBuilder functions directly instead of String::format.
(WTR::createStringWithAttributes): Use appendLiteral.
(WTR::AccessibilityUIElement::helpText const): Ditto.
(WTR::AccessibilityUIElement::attributedStringForRange): Use StringBuilder functions
directly instead of using String::format.
(WTR::AccessibilityUIElement::url): Use makeString instead of String::format.
(WTR::stringAtOffset): Use StringBuilder::appendNumber instead of String::format.

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

6 months agoUnreviewed, rolling out r241564.
tsavell@apple.com [Fri, 15 Feb 2019 16:11:06 +0000 (16:11 +0000)]
Unreviewed, rolling out r241564.

Caused 50+ Timeouts on Mac WK2, mostly in the http/ directory

Reverted changeset:

"[Mac] WebInspectorUI.framework does not need to be soft-
linked anymore"
https://bugs.webkit.org/show_bug.cgi?id=194411
https://trac.webkit.org/changeset/241564

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

6 months agoDecoding media-capabilities configuration initial support https://bugs.webkit.org...
philn@webkit.org [Fri, 15 Feb 2019 14:24:21 +0000 (14:24 +0000)]
Decoding media-capabilities configuration initial support https://bugs.webkit.org/show_bug.cgi?id=191191

Reviewed by Xabier Rodriguez-Calvar.

This patch enables basic platform probing for GStreamer decoders,
optionally using Hardware decoding capabilities. The previous code
for decoders/demuxers probing partially duplicated between the MSE
player and its parent class was moved to a new module called
GStreamerRegistryScanner. There is one instance of it for the MSE player
and one for the parent class.

The scanner can check for the presence of the GstElement Hardware
metadata classifier in decoders and thus advise the
MediaEngineConfigurationFactoryGStreamer that hardware decoding is
supported or not. This is only a first step though. The scanner
should also probably attempt a NULL->READY transition on decoders
to validate specific input caps are supported. As this might
require changes in GStreamer, this part of the patch wasn't
included.

This patch is covered by the existing media tests.

* platform/GStreamer.cmake: New files.
* platform/graphics/MediaPlayer.cpp: Add support for converting
SupportsType enum to string.
(WebCore::convertEnumerationToString):
* platform/graphics/MediaPlayer.h: Ditto.
* platform/graphics/MediaPlayerEnums.h: Ditto.
* platform/graphics/gstreamer/GStreamerCommon.cpp: Move
gstRegistryHasElementForMediaType to GStreamerRegistryScanner.
* platform/graphics/gstreamer/GStreamerCommon.h: Ditto.
* platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: Added.
(WebCore::GStreamerRegistryScanner::singleton):
(WebCore::GStreamerRegistryScanner::GStreamerRegistryScanner): Initialize
supported mime-types and codecs from the GStreamer registry.
(WebCore::GStreamerRegistryScanner::~GStreamerRegistryScanner): Free the element factories.
(WebCore::GStreamerRegistryScanner::gstRegistryHasElementForMediaType):
Check the input caps are supported, optionally using hardware
device.
(WebCore::GStreamerRegistryScanner::fillMimeTypeSetFromCapsMapping):
Moved from MediaPlayerPrivateGStreamer{,MSE}.
(WebCore::GStreamerRegistryScanner::initialize): Ditto.
(WebCore::GStreamerRegistryScanner::supportsCodec const): Ditto.
(WebCore::GStreamerRegistryScanner::supportsAllCodecs const): Ditto.
(WebCore::GStreamerRegistryScanner::isDecodingSupported const): Check
the given configuration is supported. For now hardware support is
checked for video configurations only as it is quite uncommon
anyway to have hardware-enabled audio decoders.
* platform/graphics/gstreamer/GStreamerRegistryScanner.h: Added.
(WebCore::GStreamerRegistryScanner::mimeTypeSet):
(WebCore::GStreamerRegistryScanner::supportsContainerType const):
(WebCore::GStreamerRegistryScanner::RegistryLookupResult::operator bool const):
* platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.cpp: Added.
(WebCore::createMediaPlayerDecodingConfigurationGStreamer):
* platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.h: Added.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
Rely on new GStreamerRegistryScanner and add some debugging macros.
(WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes):
(WebCore::MediaPlayerPrivateGStreamer::supportsType):
* platform/graphics/gstreamer/mse/AppendPipeline.cpp: Ditto. Also
plug qtdemux for AAC containers, this is an explicit consequence
of finer-grained codecs probing.
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
* platform/graphics/gstreamer/mse/GStreamerRegistryScannerMSE.cpp: Added.
(WebCore::GStreamerRegistryScannerMSE::singleton):
(WebCore::GStreamerRegistryScannerMSE::GStreamerRegistryScannerMSE):
* platform/graphics/gstreamer/mse/GStreamerRegistryScannerMSE.h: Added.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
Rely on new GStreamerRegistryScanner and add some debugging macros.
(WebCore::MediaPlayerPrivateGStreamerMSE::getSupportedTypes):
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
* platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
(WebCore::factories): GStreamer support.

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

6 months agoUnreviewed. Fix GTK+ build after r241556
commit-queue@webkit.org [Fri, 15 Feb 2019 13:49:48 +0000 (13:49 +0000)]
Unreviewed. Fix GTK+ build after r241556

I guess this is due to unified builds after a new file being added in r241556.

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2019-02-15

* UIProcess/API/C/WKAuthenticationDecisionListener.cpp:
* UIProcess/API/C/WKPage.cpp:

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

6 months agoFix deadlock on Linux/x64 between SamplingProfiler and VMTraps
dinfuehr@igalia.com [Fri, 15 Feb 2019 13:41:45 +0000 (13:41 +0000)]
Fix deadlock on Linux/x64 between SamplingProfiler and VMTraps
https://bugs.webkit.org/show_bug.cgi?id=194014

Reviewed by Michael Catanzaro.

Do not block SIGUSR1 when installing signal handlers, since this signal
is used to suspend/resume machine threads on Linux.

ftl-ai-filter-phantoms-should-clear-clear-value.js deadlocked with
enabled watchdog and sampling.

Deadlock happened in the following situation:

Thread 1 (Sampling): SamplingProfiler.cpp:takeSample takes all needed locks
and then tries to suspend the main thread.

Thread 2 (Watchdog/VMTraps): Before the Sampling-Thread suspends the main thread
a signal is caught and the signal handler is invoked (VMTraps.cpp:SignalSender).
SignalSender tries to lock codeBlockSet, but this is already locked by the
SamplingProfiler.

The SamplingProfiler can only give up the lock when it suspends
the thread. However since the VMTraps signal handler is active, all other signals blocked,
therefore the SamplingProfiler also waits until its signal handler is invoked.

This patch fixes this by not blocking SIGUSR1 in installSignalHandler, since
it is used to suspend/resume threads on Linux.

* wtf/Threading.h:
* wtf/posix/ThreadingPOSIX.cpp:
* wtf/threads/Signals.cpp:
(WTF::installSignalHandler):

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

6 months ago[JSC] Do not even allocate JIT worklists in non-JIT mode
ysuzuki@apple.com [Fri, 15 Feb 2019 09:27:42 +0000 (09:27 +0000)]
[JSC] Do not even allocate JIT worklists in non-JIT mode
https://bugs.webkit.org/show_bug.cgi?id=194693

Reviewed by Mark Lam.

Heap always allocates JIT worklists for Baseline, DFG, and FTL. While they do not have actual threads, Worklist itself already allocates some memory.
And we do not perform any GC operations that are only meaningful in JIT environment.

1. We add VM::canUseJIT() check in Heap's ensureXXXWorklist things to prevent them from being allocated.
2. We remove DFG marking constraint in non-JIT mode.
3. We do not gather conservative roots from scratch buffers under the non-JIT mode (BTW, # of scratch buffers are always zero in non-JIT mode)
4. We do not visit JITStubRoutineSet.
5. Align JITWorklist function names to the other worklists.

* dfg/DFGOSRExitPreparation.cpp:
(JSC::DFG::prepareCodeOriginForOSRExit):
* dfg/DFGPlan.h:
* dfg/DFGWorklist.cpp:
(JSC::DFG::markCodeBlocks): Deleted.
* dfg/DFGWorklist.h:
* heap/Heap.cpp:
(JSC::Heap::completeAllJITPlans):
(JSC::Heap::iterateExecutingAndCompilingCodeBlocks):
(JSC::Heap::gatherScratchBufferRoots):
(JSC::Heap::removeDeadCompilerWorklistEntries):
(JSC::Heap::stopThePeriphery):
(JSC::Heap::suspendCompilerThreads):
(JSC::Heap::resumeCompilerThreads):
(JSC::Heap::addCoreConstraints):
* jit/JITWorklist.cpp:
(JSC::JITWorklist::existingGlobalWorklistOrNull):
(JSC::JITWorklist::ensureGlobalWorklist):
(JSC::JITWorklist::instance): Deleted.
* jit/JITWorklist.h:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::jitCompileAndSetHeuristics):
* runtime/VM.cpp:
(JSC::VM::~VM):
(JSC::VM::gatherScratchBufferRoots):
(JSC::VM::gatherConservativeRoots): Deleted.
* runtime/VM.h:

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

6 months ago[bmalloc] NSBundle-based application name check should be executed after debug-heap...
ysuzuki@apple.com [Fri, 15 Feb 2019 09:09:57 +0000 (09:09 +0000)]
[bmalloc] NSBundle-based application name check should be executed after debug-heap environment variable check
https://bugs.webkit.org/show_bug.cgi?id=194694

Reviewed by Mark Lam.

Interestingly, NSBundle allocates fair amount of memory and keeps it for a process-long time. For example, it
allocates global NSConcreteHashTable, which takes 2.5KB. This patch changes the order of gigacage-check, we
first check "Malloc=1" status, and then check the process name through NSBundle. This allows us to remove NSBundle
related allocation in JSC initialization in the system malloc mode.

* bmalloc/Gigacage.cpp:
(Gigacage::shouldBeEnabled):

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

6 months ago[bmalloc] Do not start scavenger thread if we use system malloc
ysuzuki@apple.com [Fri, 15 Feb 2019 08:43:07 +0000 (08:43 +0000)]
[bmalloc] Do not start scavenger thread if we use system malloc
https://bugs.webkit.org/show_bug.cgi?id=194674

Reviewed by Mark Lam.

We always start the scavenger thread even if system malloc is used by the environment variable like "Malloc=1".
Because bmalloc allocation goes to the system malloc if "Malloc=1" is set, we do not need to scavenge. This patch
changes it not to start the scavenger thread.

* bmalloc/Scavenger.cpp:
(bmalloc::Scavenger::Scavenger):

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

6 months ago[WebAssembly] Write a new register allocator for Air O0 and make BBQ use it
sbarati@apple.com [Fri, 15 Feb 2019 08:26:17 +0000 (08:26 +0000)]
[WebAssembly] Write a new register allocator for Air O0 and make BBQ use it
https://bugs.webkit.org/show_bug.cgi?id=194036

Reviewed by Yusuke Suzuki.

JSTests:

* stress/tail-call-many-arguments.js: Added.
(foo):
(bar):

Source/JavaScriptCore:

This patch adds a new Air-O0 backend. Air-O0 runs fewer passes and doesn't
use linear scan for register allocation. Instead of linear scan, Air-O0 does
mostly block-local register allocation, and it does this as it's emitting
code directly. The register allocator uses liveness analysis to reduce
the number of spills. Doing register allocation as we're emitting code
allows us to skip editing the IR to insert spills, which saves a non trivial
amount of compile time. For stack allocation, we give each Tmp its own slot.
This is less than ideal. We probably want to do some trivial live range analysis
in the future. The reason this isn't a deal breaker for Wasm is that this patch
makes it so that we reuse Tmps as we're generating Air IR in the AirIRGenerator.
Because Wasm is a stack machine, we trivially know when we kill a stack value (its last use).

This patch is another 25% Wasm startup time speedup. It seems to be worth
another 1% on JetStream2.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp: Added.
(JSC::B3::Air::GenerateAndAllocateRegisters::GenerateAndAllocateRegisters):
(JSC::B3::Air::GenerateAndAllocateRegisters::buildLiveRanges):
(JSC::B3::Air::GenerateAndAllocateRegisters::insertBlocksForFlushAfterTerminalPatchpoints):
(JSC::B3::Air::callFrameAddr):
(JSC::B3::Air::GenerateAndAllocateRegisters::flush):
(JSC::B3::Air::GenerateAndAllocateRegisters::spill):
(JSC::B3::Air::GenerateAndAllocateRegisters::alloc):
(JSC::B3::Air::GenerateAndAllocateRegisters::freeDeadTmpsIfNeeded):
(JSC::B3::Air::GenerateAndAllocateRegisters::assignTmp):
(JSC::B3::Air::GenerateAndAllocateRegisters::isDisallowedRegister):
(JSC::B3::Air::GenerateAndAllocateRegisters::prepareForGeneration):
(JSC::B3::Air::GenerateAndAllocateRegisters::generate):
* b3/air/AirAllocateRegistersAndStackAndGenerateCode.h: Added.
* b3/air/AirCode.cpp:
* b3/air/AirCode.h:
* b3/air/AirGenerate.cpp:
(JSC::B3::Air::prepareForGeneration):
(JSC::B3::Air::generateWithAlreadyAllocatedRegisters):
(JSC::B3::Air::generate):
* b3/air/AirHandleCalleeSaves.cpp:
(JSC::B3::Air::handleCalleeSaves):
* b3/air/AirHandleCalleeSaves.h:
* b3/air/AirTmpMap.h:
* runtime/Options.h:
* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::didKill):
(JSC::Wasm::AirIRGenerator::newTmp):
(JSC::Wasm::AirIRGenerator::AirIRGenerator):
(JSC::Wasm::parseAndCompileAir):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncUF64>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncUF32>):
* wasm/WasmAirIRGenerator.h:
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::didKill):
* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::compileFunctions):
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::parseBody):
(JSC::Wasm::FunctionParser<Context>::parseExpression):
* wasm/WasmValidate.cpp:
(JSC::Wasm::Validate::didKill):

Source/WTF:

* wtf/IndexMap.h:
(WTF::IndexMap::at):
(WTF::IndexMap::at const):
(WTF::IndexMap::operator[]):
(WTF::IndexMap::operator[] const):

Tools:

* Scripts/run-jsc-stress-tests:

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

6 months agolowerStackArgs should lower Lea32/64 on ARM64 to Add
sbarati@apple.com [Fri, 15 Feb 2019 06:37:50 +0000 (06:37 +0000)]
lowerStackArgs should lower Lea32/64 on ARM64 to Add
https://bugs.webkit.org/show_bug.cgi?id=194656

Reviewed by Yusuke Suzuki.

On arm64, Lea is just implemented as an add. However, Air treats it as an
address with a given width. Because of this width, we were incorrectly
computing whether or not this immediate could fit into the instruction itself
or it needed to be explicitly put into a register. This patch makes
AirLowerStackArgs lower Lea to Add on arm64.

* b3/air/AirLowerStackArgs.cpp:
(JSC::B3::Air::lowerStackArgs):
* b3/air/AirOpcode.opcodes:
* b3/air/testair.cpp:

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

6 months agoREGRESSION (r240446): Storage Access API does not handle domains consistently
bfulgham@apple.com [Fri, 15 Feb 2019 01:55:26 +0000 (01:55 +0000)]
REGRESSION (r240446): Storage Access API does not handle domains consistently
https://bugs.webkit.org/show_bug.cgi?id=194664

Reviewed by Alex Christensen.

During my refactoring of the ResourceLoadStatistics code, I introduced two bugs:
(1) I neglected to be consistent in my use of 'primaryDomain', causing some Storage
Access API code paths to store approves under one domain (e.g., 'www.example.com'),
while checking status under the eTLD+1 (e.g., 'example.com'). The exact string matching
requirement caused these to get missed.

(2) I used a move operator before a final set of copies of domain names, leading to
some empty strings being passed to Storage Access API calls.

Both issues are corrected in this patch.

* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode): Always make the
domain comply with our 'primaryDomain' logic.
(WebKit::WebResourceLoadStatisticsStore::hasStorageAccess): Ditto.
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted): Ditto.
(WebKit::WebResourceLoadStatisticsStore::logFrameNavigation): Ditto.
(WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading): Ditto.
(WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading): Ditto.
(WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect): Ditto.
(WebKit::WebResourceLoadStatisticsStore::logUserInteraction): Ditto.
(WebKit::WebResourceLoadStatisticsStore::clearUserInteraction): Ditto.
(WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction): Ditto.
(WebKit::WebResourceLoadStatisticsStore::setLastSeen): Ditto.
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResource): Ditto.
(WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource): Ditto.
(WebKit::WebResourceLoadStatisticsStore::isPrevalentResource): Ditto.
(WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource): Ditto.
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder): Ditto.
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder): Ditto.
(WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo): Ditto.
(WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource): Ditto.
(WebKit::WebResourceLoadStatisticsStore::setGrandfathered): Ditto.
(WebKit::WebResourceLoadStatisticsStore::isGrandfathered): Ditto.
(WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): Ditto.
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): Ditto.
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo): Ditto.
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom): Ditto.
(WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo): Ditto.
(WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom): Ditto.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::hasStorageAccess): Always make the
domain comply with our 'primaryDomain' logic.
(WebKit::WebsiteDataStore::requestStorageAccess): Ditto. Also make copy of domain
names before moving them to the completion handler.
(WebKit::WebsiteDataStore::grantStorageAccess): Ditto.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::hasStorageAccess):  Always make the domain comply with our
'primaryDomain' logic.
(WebKit::WebPage::requestStorageAccess): Ditto.

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

6 months agoFix the build.
timothy_horton@apple.com [Fri, 15 Feb 2019 00:51:59 +0000 (00:51 +0000)]
Fix the build.

* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::drawSquareInEditableImage):
* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(TestWebKitAPI::drawSquareInEditableImage):

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

6 months agoUnreviewed, rolling out r241497.
commit-queue@webkit.org [Fri, 15 Feb 2019 00:19:22 +0000 (00:19 +0000)]
Unreviewed, rolling out r241497.
https://bugs.webkit.org/show_bug.cgi?id=194676

New test times out (Requested by NVI on #webkit).

Reverted changeset:

"Web Inspector: Styles: valid values in style attributes are
reported as unsupported property values"
https://bugs.webkit.org/show_bug.cgi?id=194619
https://trac.webkit.org/changeset/241497

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

6 months agoCache the results of BytecodeGenerator::getVariablesUnderTDZ
sbarati@apple.com [Fri, 15 Feb 2019 00:06:30 +0000 (00:06 +0000)]
Cache the results of BytecodeGenerator::getVariablesUnderTDZ
https://bugs.webkit.org/show_bug.cgi?id=194583
<rdar://problem/48028140>

Reviewed by Yusuke Suzuki.

JSTests:

* microbenchmarks/cache-get-variables-under-tdz-in-bytecode-generator.js: Added.

Source/JavaScriptCore:

This patch makes it so that getVariablesUnderTDZ caches a result of
CompactVariableMap::Handle. getVariablesUnderTDZ is costly when
it's called in an environment where there are a lot of variables.
This patch makes it so we cache its results. This is profitable when
getVariablesUnderTDZ is called repeatedly with the same environment
state. This is common since we call this every time we encounter a
function definition/expression node.

* builtins/BuiltinExecutables.cpp:
(JSC::BuiltinExecutables::createExecutable):
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
* bytecode/UnlinkedFunctionExecutable.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::popLexicalScopeInternal):
(JSC::BytecodeGenerator::liftTDZCheckIfPossible):
(JSC::BytecodeGenerator::pushTDZVariables):
(JSC::BytecodeGenerator::getVariablesUnderTDZ):
(JSC::BytecodeGenerator::restoreTDZStack):
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::makeFunction):
* parser/VariableEnvironment.cpp:
(JSC::CompactVariableMap::Handle::Handle):
(JSC::CompactVariableMap::Handle::operator=):
* parser/VariableEnvironment.h:
(JSC::CompactVariableMap::Handle::operator bool const):
* runtime/CodeCache.cpp:
(JSC::CodeCache::getUnlinkedGlobalFunctionExecutable):

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

6 months agoFix the build.
timothy_horton@apple.com [Fri, 15 Feb 2019 00:01:53 +0000 (00:01 +0000)]
Fix the build.

* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView renderedDrawing]):

* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::drawSquareInEditableImage):
* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(TestWebKitAPI::drawSquareInEditableImage):

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

6 months agoWeb Inspector: Occasional crash under WebCore::CSSStyleSheet::item called from Inspector
commit-queue@webkit.org [Thu, 14 Feb 2019 23:39:59 +0000 (23:39 +0000)]
Web Inspector: Occasional crash under WebCore::CSSStyleSheet::item called from Inspector
https://bugs.webkit.org/show_bug.cgi?id=194671
<rdar://problem/47628191>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-02-14
Reviewed by Devin Rousso.

* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::item):
A crash may happen if the m_childRuleCSSOMWrappers Vector gets out of
sync with the m_contents list of rules. In particular if the wrappers
vector is shorter than the rule list. We tried exercising code paths
that modify these lists but were not able to reproduce the crash.
To avoid a crash we can make this access safer and avoid the original
overflow. At the same time we will keep and promote the assertion that
would catch the lists getting out of sync in debug builds.

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

6 months agoUnreviewed build fix for WinCairo Debug after r241559.
ross.kirsling@sony.com [Thu, 14 Feb 2019 23:06:06 +0000 (23:06 +0000)]
Unreviewed build fix for WinCairo Debug after r241559.

* platform/network/curl/CurlContext.cpp:
(WebCore::CurlContext::CurlContext):

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

6 months agoASSERTION FAILED: m_caches.isEmpty() || !m_pendingInitializationCallbacks.isEmpty...
youenn@apple.com [Thu, 14 Feb 2019 22:55:24 +0000 (22:55 +0000)]
ASSERTION FAILED: m_caches.isEmpty() || !m_pendingInitializationCallbacks.isEmpty() in WebKit::CacheStorage::Caches::clearMemoryRepresentation()
https://bugs.webkit.org/show_bug.cgi?id=188393
<rdar://problem/43025665>

Reviewed by Alex Christensen.

In case Caches::dispose is called, clearMemoryRepresentation might be called if there is no active cache.
We also ensure to not clear the memory representation if there is any remaining removed cache.
Update the clearMemoryRepresentation assertion to take that into account.

In case a Caches is cleared twice, the clearMemoryRepresentation assertion will assert while it should not.
In that case m_storage is null the second time. Update the assertion accordingly.

* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::hasActiveCache const):
(WebKit::CacheStorage::Caches::dispose):
(WebKit::CacheStorage::Caches::clearMemoryRepresentation):
* NetworkProcess/cache/CacheStorageEngineCaches.h:

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

6 months ago[Mac] WebInspectorUI.framework does not need to be soft-linked anymore
bburg@apple.com [Thu, 14 Feb 2019 22:32:21 +0000 (22:32 +0000)]
[Mac] WebInspectorUI.framework does not need to be soft-linked anymore
https://bugs.webkit.org/show_bug.cgi?id=194411
<rdar://problem/47787614>

Reviewed by Joseph Pecoraro.

Source/WebKit:

* Configurations/WebKit.xcconfig:
Conditionalize weak linking to WebInspectorUI.framework for Mac only.

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::inspectorPageURL):
(WebKit::WebInspectorProxy::inspectorTestPageURL):
(WebKit::WebInspectorProxy::inspectorBaseURL):
* WebProcess/WebPage/mac/WebInspectorUIMac.mm:
(WebKit::webInspectorUILocalizedStringsURL):
Rewrite uses of the bundle to exit early if bundle couldn't be loaded.

Source/WebKitLegacy/mac:

* Configurations/WebKitLegacy.xcconfig:
Conditionalize weak linking to WebInspectorUI.framework for Mac only.

* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorFrontendClient::localizedStringsURL):
(-[WebInspectorWindowController inspectorPagePath]):
(-[WebInspectorWindowController inspectorTestPagePath]):
Rewrite uses of the bundle to exit early if bundle couldn't be loaded.

Source/WTF:

* wtf/cocoa/SoftLinking.h:
Remove macro that now has no uses.

Tools:

Remove unnecessary soft linking macro usage.

* DumpRenderTree/mac/TestRunnerMac.mm:
(TestRunner::inspectorTestStubURL):
(SOFT_LINK_STAGED_FRAMEWORK): Deleted.
* WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm:
(WTR::TestRunner::inspectorTestStubURL):

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

6 months ago[GTK] WebKitGTK+ -> WebKitGTK
mcatanzaro@igalia.com [Thu, 14 Feb 2019 22:11:19 +0000 (22:11 +0000)]
[GTK] WebKitGTK+ -> WebKitGTK
https://bugs.webkit.org/show_bug.cgi?id=194658

Reviewed by Alex Christensen.

This renames WebKitGTK+ to WebKitGTK in a few user-visible places: the API documentation,
the pkg-config, and an error message.

In a couple places where it's exposed in WPE documentation, WPE is now mentioned, or the
reference to "WebKitGTK+" is changed to just "WebKit."

* UIProcess/API/glib/WebKitSettings.cpp:
(webkit_settings_class_init):
* UIProcess/API/glib/WebKitWebView.cpp:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.h:
* gtk/webkit2gtk-web-extension.pc.in:
* gtk/webkit2gtk.pc.in:

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

6 months ago[ews-app] status bubble should fetch builder name info from BuilderMapping table
aakash_jain@apple.com [Thu, 14 Feb 2019 22:10:37 +0000 (22:10 +0000)]
[ews-app] status bubble should fetch builder name info from BuilderMapping table
https://bugs.webkit.org/show_bug.cgi?id=194599

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/views/statusbubble.py:
(StatusBubble._build_bubble):

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

6 months ago[ews-app] Set Foreign Key in Django build model
aakash_jain@apple.com [Thu, 14 Feb 2019 22:08:58 +0000 (22:08 +0000)]
[ews-app] Set Foreign Key in Django build model
https://bugs.webkit.org/show_bug.cgi?id=194667

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/models/build.py:
(Build):

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

6 months ago[JSC] Non-JIT entrypoints should share NativeJITCode per entrypoint type
ysuzuki@apple.com [Thu, 14 Feb 2019 21:35:14 +0000 (21:35 +0000)]
[JSC] Non-JIT entrypoints should share NativeJITCode per entrypoint type
https://bugs.webkit.org/show_bug.cgi?id=194659

Reviewed by Mark Lam.

Non-JIT entrypoints create NativeJITCode every time it is called. But it is meaningless since these entry point code are identical.
We should create one per entrypoint type (for function, we should have CodeForCall and CodeForConstruct) and continue to use them.
And we use NativeJITCode instead of DirectJITCode if it does not have difference between usual entrypoint and arity check entrypoint.

* dfg/DFGJITCode.h:
* dfg/DFGJITFinalizer.cpp:
(JSC::DFG::JITFinalizer::finalize):
(JSC::DFG::JITFinalizer::finalizeFunction):
* jit/JITCode.cpp:
(JSC::DirectJITCode::initializeCodeRefForDFG):
(JSC::DirectJITCode::initializeCodeRef): Deleted.
(JSC::NativeJITCode::initializeCodeRef): Deleted.
* jit/JITCode.h:
* llint/LLIntEntrypoint.cpp:
(JSC::LLInt::setFunctionEntrypoint):
(JSC::LLInt::setEvalEntrypoint):
(JSC::LLInt::setProgramEntrypoint):
(JSC::LLInt::setModuleProgramEntrypoint): Retagged is removed since the tag is the same.

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

6 months ago[WTF] Add environment variable helpers
ross.kirsling@sony.com [Thu, 14 Feb 2019 20:03:28 +0000 (20:03 +0000)]
[WTF] Add environment variable helpers
https://bugs.webkit.org/show_bug.cgi?id=192405

Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

* inspector/remote/glib/RemoteInspectorGlib.cpp:
(Inspector::RemoteInspector::RemoteInspector):
(Inspector::RemoteInspector::start):
* jsc.cpp:
(startTimeoutThreadIfNeeded):
* runtime/Options.cpp:
(JSC::overrideOptionWithHeuristic):
(JSC::Options::overrideAliasedOptionWithHeuristic):
(JSC::Options::initialize):
* runtime/VM.cpp:
(JSC::enableAssembler):
(JSC::VM::VM):
* tools/CodeProfiling.cpp:
(JSC::CodeProfiling::notifyAllocator):
Utilize WTF::Environment where possible.

Source/WebCore:

* platform/NotImplemented.h:
* platform/cocoa/SystemVersion.mm:
(WebCore::createSystemMarketingVersion):
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::initializeGStreamer):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/nicosia/NicosiaPaintingEngine.cpp:
(Nicosia::PaintingEngine::create):
* platform/graphics/texmap/TextureMapperFPSCounter.cpp:
(WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::create):
* platform/gtk/RenderThemeWidget.cpp:
(WebCore::RenderThemeScrollbar::RenderThemeScrollbar):
* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlContext::CurlContext):
(WebCore::EnvironmentVariableReader::read): Deleted.
(WebCore::EnvironmentVariableReader::defined): Deleted.
(WebCore::EnvironmentVariableReader::readAs): Deleted.
(WebCore::EnvironmentVariableReader::sscanTemplate): Deleted.
(WebCore::EnvironmentVariableReader::sscanTemplate<signed>): Deleted.
(WebCore::EnvironmentVariableReader::sscanTemplate<unsigned>): Deleted.
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::defaultCookieJarPath):
* platform/network/playstation/CurlSSLHandlePlayStation.cpp:
(WebCore::getCACertPathEnv):
* platform/network/win/CurlSSLHandleWin.cpp:
(WebCore::getCACertPathEnv):
* platform/text/hyphen/HyphenationLibHyphen.cpp:
(WebCore::topLevelPath):
(WebCore::webkitBuildDirectory):
* platform/unix/LoggingUnix.cpp:
(WebCore::logLevelString):
* platform/win/LoggingWin.cpp:
(WebCore::logLevelString):
Utilize WTF::Environment where possible.

Source/WebCore/PAL:

* pal/unix/LoggingUnix.cpp:
(PAL::logLevelString):
* pal/win/LoggingWin.cpp:
(PAL::logLevelString):
Utilize WTF::Environment where possible.

Source/WebKit:

* NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
(main):
* Platform/unix/EnvironmentUtilities.cpp:
(WebKit::EnvironmentUtilities::stripValuesEndingWithString):
* Platform/unix/LoggingUnix.cpp:
(WebKit::logLevelString):
* Platform/win/LoggingWin.cpp:
(WebKit::logLevelString):
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::shouldCallRealDebugger):
* Shared/Plugins/unix/PluginSearchPath.cpp:
(WebKit::pluginsDirectories):
* Shared/glib/ProcessExecutablePathGLib.cpp:
(WebKit::findWebKitProcess):
* UIProcess/API/glib/WebKitSettings.cpp:
(webKitSettingsConstructed):
(webKitSettingsSetProperty):
* UIProcess/API/glib/WebKitWebContext.cpp:
(injectedBundleDirectory):
(webkitWebContextConstructed):
* UIProcess/API/gtk/WebKitWebViewGtk.cpp:
(webkitWebViewMaximizeWindow):
(webkitWebViewRestoreWindow):
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::m_backend):
* UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::getLaunchOptions):
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::XDGDBusProxyLauncher::launch):
(WebKit::bindDBusSession):
(WebKit::bindX11):
(WebKit::bindWayland):
(WebKit::bindPulse):
(WebKit::bindPathVar):
(WebKit::bindGStreamerData):
(WebKit::bubblewrapSpawn):
* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::systemDirectoryPath):
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::memoryPressureMonitorDisabled):
(WebKit::WebProcessPool::platformInitialize):
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/gtk/HardwareAccelerationManager.cpp:
(WebKit::HardwareAccelerationManager::HardwareAccelerationManager):
* WebProcess/EntryPoint/unix/WebProcessMain.cpp:
(main):
* WebProcess/gtk/WebProcessMainGtk.cpp:
* WebProcess/wpe/WebProcessMainWPE.cpp:
Utilize WTF::Environment where possible.

Source/WebKitLegacy/ios:

* Misc/WebUIKitSupport.mm:
(WebKitPlatformSystemRootDirectory):
Utilize WTF::Environment where possible.

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView _initWithFrame:frameName:groupName:]):
Utilize WTF::Environment where possible.

Source/WTF:

Create a new Environment API as a platform-independent, thread-safe(r)
way to get and set environment variables.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Environment.h: Added.
* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformMac.cmake:
* wtf/PlatformPlayStation.cmake:
* wtf/PlatformWPE.cmake:
* wtf/PlatformWin.cmake:
* wtf/posix/EnvironmentPOSIX.cpp: Added.
* wtf/win/EnvironmentWin.cpp: Added.
Introduce WTF::Environment.

* wtf/Threading.cpp:
(WTF::threadingIsInitialized):
(WTF::initializeThreading):
* wtf/Threading.h:
Introduce WTF::threadingIsInitialized() so that we can ASSERT that it's
false before setting an environment variable through the new API.

* wtf/DataLog.cpp:
(WTF::initializeLogFileOnce):
* wtf/NumberOfCores.cpp:
(WTF::numberOfProcessorCores):
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::openTemporaryFile):
Utilize WTF::Environment where possible.

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(libraryPathForDumpRenderTree):
* DumpRenderTree/win/DumpRenderTree.cpp:
(libraryPathForDumpRenderTree):
* TestRunnerShared/IOSLayoutTestCommunication.cpp:
(setUpIOSLayoutTestCommunication):
* TestWebKitAPI/Tests/WebKit/EnvironmentUtilitiesTest.cpp:
(TestWebKitAPI::strip):
* TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp:
(beforeAll):
* TestWebKitAPI/glib/WebKitGLib/TestMain.cpp:
(main):
* TestWebKitAPI/glib/WebKitGLib/WebKitTestBus.cpp:
(WebKitTestBus::run):
* WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp:
(WTR::getOutputDir):
(WTR::initializeFontConfigSetting):
* WebKitTestRunner/InjectedBundle/gtk/InjectedBundleGtk.cpp:
(WTR::InjectedBundle::platformInitialize):
* WebKitTestRunner/InjectedBundle/gtk/InjectedBundleUtilities.cpp:
(WTR::topLevelPath):
* WebKitTestRunner/InjectedBundle/wpe/ActivateFontsWPE.cpp:
(WTR::topLevelPath):
(WTR::getOutputDir):
(WTR::activateFonts):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::libraryPathForTesting):
(WTR::TestController::generateContextConfiguration const):
(WTR::TestController::generatePageConfiguration):
(WTR::TestController::decideDestinationWithSuggestedFilename):
(WTR::TestController::platformAdjustContext):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::cocoaPlatformInitialize):
(WTR::TestController::platformAdjustContext):
* WebKitTestRunner/gtk/main.cpp:
(main):
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::TestController::configureContentExtensionForTest):
* WebKitTestRunner/wpe/main.cpp:
(main):
Utilize WTF::Environment where possible.

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

6 months agoHandle _WKNavigationActionPolicyAllowWithoutTryingAppLink for LoadOptimizer
jiewen_tan@apple.com [Thu, 14 Feb 2019 19:54:19 +0000 (19:54 +0000)]
Handle _WKNavigationActionPolicyAllowWithoutTryingAppLink for LoadOptimizer
https://bugs.webkit.org/show_bug.cgi?id=194640
<rdar://problem/48064140>

Reviewed by Brent Fulgham.

* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):

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

7 months ago[JSC] Should have default NativeJITCode
ysuzuki@apple.com [Thu, 14 Feb 2019 19:10:15 +0000 (19:10 +0000)]
[JSC] Should have default NativeJITCode
https://bugs.webkit.org/show_bug.cgi?id=194634

Reviewed by Mark Lam.

In JSC_useJIT=false mode, we always create identical NativeJITCode for call and construct when we create NativeExecutable.
This is meaningless since we do not modify NativeJITCode after the creation. This patch adds singleton used as a default one.
Since NativeJITCode (& JITCode) is ThreadSafeRefCounted, we can just share it in a whole process level. This removes 446 NativeJITCode
allocations, which takes 14KB.

* runtime/VM.cpp:
(JSC::jitCodeForCallTrampoline):
(JSC::jitCodeForConstructTrampoline):
(JSC::VM::getHostFunction):

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

7 months ago[PSON] Introduce a WebContent Process cache
cdumez@apple.com [Thu, 14 Feb 2019 19:06:12 +0000 (19:06 +0000)]
[PSON] Introduce a WebContent Process cache
https://bugs.webkit.org/show_bug.cgi?id=194594
<rdar://problem/46793397>

Reviewed by Geoff Garen.

Source/WebCore:

Update localizable strings.

* en.lproj/Localizable.strings:

Source/WebKit:

Introduce a WebContent Process cache to reduce the number of process launches when
process swap on navigation is enabled, and to reduce the power cost of the feature.

If a WebProcess loaded pages from a single registrable domain then it is eligible
for the cache. When process-swapping on navigation to a new registrable domain, we
now attempt to retrieve a process from the cache for the domain in question instead
of always launching a new one.

The WebProcess cache currently has the following attributes:
- It may contains 4 processes per GB of RAM the machine has, up to 30 processes.
- WebProcesses automatically get evicted from the cache after 30 minutes.
- If the application is no longer the active app, then the cache will get cleared
  after 5 minutes.
- WebProcesses that are in the cache are reported as "(Cached)" in Activity Monitor.

The WebProcess cache is currently disabled by default and can by enabled by the
client via SPI.

* Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::WebBackForwardListItem):
* Shared/WebBackForwardListItem.h:
(WebKit::WebBackForwardListItem::lastProcessIdentifier const):
(WebKit::WebBackForwardListItem::setLastProcessIdentifier):
Add new lastProcessIdentifier data member that reflects which process this item
was last loaded in. It is normally identical to the identifier of the process
that created the item but it gets overriden in case of cross-site client-side
redirect, since a new process takes over the item in this case.

* Sources.txt:
Add new source file.

* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContextConfigurationRef.cpp:
(WKContextConfigurationUsesWebProcessCache):
(WKContextConfigurationSetUsesWebProcessCache):
* UIProcess/API/C/WKContextConfigurationRef.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration setUsesWebProcessCache:]):
(-[_WKProcessPoolConfiguration usesWebProcessCache]):
Add new SPI to enable the WebProcess cache.

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _webProcessCountIgnoringPrewarmedAndCached]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
Add new SPI for testing which returns the number of WebProcesses ignoring
both prewarmed and cached ones.

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::registerNotificationObservers):
(WebKit::WebProcessPool::unregisterNotificationObservers):
Add application active state observers as the WebProcess cache gets cleared
when the application resigns active state for more than 5 minutes.

* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::loadRequest):
When doing a load in a new process with the BackForwardList locked (i.e. client-side
redirect), make sure we update the last process identifier for the BackForwardListItem.
This is important because the logic in WebProcessPool::processForNavigation() relies on
this identifier to select which process to do the history navigation into, and we want
to do the load in the post-redirect process, not the pre-redirect one.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
Tell the WebProcess whenever a main frame provisional load is started, providing the URL.

* UIProcess/WebProcessCache.cpp: Added.
(WebKit::WebProcessCache::WebProcessCache):
(WebKit::WebProcessCache::addProcess):
(WebKit::WebProcessCache::takeProcess):
(WebKit::WebProcessCache::updateMaximumSize):
(WebKit::WebProcessCache::clear):
(WebKit::WebProcessCache::setApplicationIsActive):
(WebKit::WebProcessCache::evictProcess):
(WebKit::WebProcessCache::CachedProcess::CachedProcess):
(WebKit::WebProcessCache::CachedProcess::~CachedProcess):
(WebKit::WebProcessCache::CachedProcess::takeProcess):
(WebKit::WebProcessCache::CachedProcess::evictionTimerFired):
* UIProcess/WebProcessCache.h: Added.
(WebKit::WebProcessCache::maximumSize):
(WebKit::WebProcessCache::size const):
(WebKit::WebProcessCache::CachedProcess::process):
Add process cache implementation.

* UIProcess/WebProcessPool.cpp:
(WebKit::m_webProcessCache):
WebProcessCache is stored on the WebProcessPool via m_webProcessCache data member.

(WebKit::WebProcessPool::~WebProcessPool):
Clear the WebProcess cache in the destructor.

(WebKit::WebProcessPool::setApplicationIsActive):
Notify the WebProcessCache whenever the application's active state changes.

(WebKit::WebProcessPool::createWebPage):
If the state of PSON changes via the experimental features menu, dynamically
update the WebProcessCache's size. This is needed because the cache is disabled
when PSON is disabled.

(WebKit::WebProcessPool::handleMemoryPressureWarning):
Clear the WebProcess cache on memory pressure.

(WebKit::WebProcessPool::processForNavigationInternal):
Query the WebProcessCache before attempting to create a new WebProcess for a cross-site
navigation.

(WebKit::WebProcessPool::findReusableSuspendedPageProcess):
This logic was split out of processForNavigationInternal() to reduce the size
of the method.

* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::setIsInProcessCache):
Update the isInProcessCache flag on the WebProcessProxy and send an IPC to the WebContent
process so that it can update its name in Activity Monitor.
We also need to stop holding a strong reference to the WebProcessPool whenever the process
is in the cache, similarly to what we do for pre-warmed processes, given that such processes
should not keep the process pool alive.

(WebKit::WebProcessProxy::addExistingWebPage):
Assert that we never try to add a page to a cached process, it should be taken out of the
cache before use.

(WebKit::WebProcessProxy::hasProvisionalPageWithID const):
(WebKit::WebProcessProxy::isAllowedToUpdateBackForwardItem const):
(WebKit::WebProcessProxy::updateBackForwardItem):
In case of client-side redirects, the previous process would sometimes send an IPC causing
the UIProcess' backforward list item to get updated with the pre-redirect URL after we've
already redirected. This previously would be unlikely to occur because we do not suspend
client-redirect pages and their process would normally exit before getting a chance to send
the IPC. However, with the process cache, the bug became obvious as the process would stay
alive and send up the "bad" IPC. To address the issue, we now only let the IPC update the
item if the item's page is (still) associated with the process. In the future, we may want
to update the IPC so that it gets sent to the WebPageProxy instead of the WebProcessProxy.

(WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
If a cached WebProcess crashes, remove it from the cache so that we do not attempt to use
it for a load later.

(WebKit::WebProcessProxy::canBeAddedToWebProcessCache const):
Only cache WebProcesses that have loaded a single registrable domain. Also prevent caching
for service worker and inspector processes.

(WebKit::WebProcessProxy::maybeShutDown):
If the process is cacheable, add it to the cache instead of shutting it down right away.

(WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
Make sure we do not attempt to terminate a processes that is in the cache.

(WebKit::WebProcessProxy::didStartProvisionalLoadForMainFrame):
Whenever a main frame provisional load starts, make sure we update the process's associated
registrable domain. nullopt indicates that there is no associated domain yet. Null string
indicates that the process is associated with several registrable domain and is therefore
not eligible for caching.

* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::registrableDomain const):
(WebKit::WebProcessProxy::isInProcessCache const):
(WebKit::WebProcessProxy::provisionalPageCount const):
Add convenience getters.

* WebKit.xcodeproj/project.pbxproj:
Add new files to project.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setIsInProcessCache):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::updateProcessName):
Update the WebProcess' name in Activity Monitor whenever it goes into or out of the WebProcess
cache.

Tools:

Update API tests to turn on the WebContent Process cache.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

7 months ago[iOS] Open sandbox for certain calls.
pvollan@apple.com [Thu, 14 Feb 2019 18:55:22 +0000 (18:55 +0000)]
[iOS] Open sandbox for certain calls.
https://bugs.webkit.org/show_bug.cgi?id=194626

Reviewed by Brent Fulgham.

Reporting shows that certain calls needs to be allowed in the sandbox.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

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

7 months agoUnreviewed, build fix after r241480
jiewen_tan@apple.com [Thu, 14 Feb 2019 18:47:38 +0000 (18:47 +0000)]
Unreviewed, build fix after r241480

* TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm:
(-[DragAndDropSimulator initWithWebViewFrame:configuration:]):
(-[DragAndDropSimulator initWithWebView:]):

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

7 months agogenerateUnlinkedCodeBlockForFunctions shouldn't need to create a FunctionExecutable...
tzagallo@apple.com [Thu, 14 Feb 2019 18:12:23 +0000 (18:12 +0000)]
generateUnlinkedCodeBlockForFunctions shouldn't need to create a FunctionExecutable just to get its source code
https://bugs.webkit.org/show_bug.cgi?id=194576

Reviewed by Saam Barati.

Extract a new function, `linkedSourceCode` from UnlinkedFunctionExecutable::link
and use it in `generateUnlinkedCodeBlockForFunctions` instead.

* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::UnlinkedFunctionExecutable::linkedSourceCode const):
(JSC::UnlinkedFunctionExecutable::link):
* bytecode/UnlinkedFunctionExecutable.h:
* runtime/CodeCache.cpp:
(JSC::generateUnlinkedCodeBlockForFunctions):

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

7 months ago[l10n] Updated Italian translation of WebKitGTK+
mcatanzaro@igalia.com [Thu, 14 Feb 2019 18:12:19 +0000 (18:12 +0000)]
[l10n] Updated Italian translation of WebKitGTK+
https://bugs.webkit.org/show_bug.cgi?id=194652

Patch by Milo Casagrande <milo@milo.name> on 2019-02-14
Rubber-stamped by Michael Catanzaro.

* it.po:

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

7 months agoCachedBitVector's size must be converted from bits to bytes
tzagallo@apple.com [Thu, 14 Feb 2019 17:37:23 +0000 (17:37 +0000)]
CachedBitVector's size must be converted from bits to bytes
https://bugs.webkit.org/show_bug.cgi?id=194441

Reviewed by Saam Barati.

CachedBitVector used its size in bits for memcpy. That didn't cause any
issues when encoding, since the size in bits was also used in the allocation,
but would overflow the actual BitVector buffer when decoding.

* runtime/CachedTypes.cpp:
(JSC::CachedBitVector::encode):
(JSC::CachedBitVector::decode const):

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

7 months agoAX: ARIA Reflection was disabled in error
cfleizach@apple.com [Thu, 14 Feb 2019 17:27:19 +0000 (17:27 +0000)]
AX: ARIA Reflection was disabled in error
https://bugs.webkit.org/show_bug.cgi?id=194647
<rdar://problem/48068336>

Reviewed by Ryosuke Niwa.

Source/WebKit:

* Shared/WebPreferences.yaml:

Tools:

Remove test override now that this feature should be enabled by default.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

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

7 months agoUnreviewed, rolling out r241486.
commit-queue@webkit.org [Thu, 14 Feb 2019 17:10:13 +0000 (17:10 +0000)]
Unreviewed, rolling out r241486.
https://bugs.webkit.org/show_bug.cgi?id=194655

causing API failures in builds (Requested by ShawnRoberts on
#webkit).

Reverted changeset:

"[Cocoa] Media elements will restart network buffering just
before suspending"
https://bugs.webkit.org/show_bug.cgi?id=193691
https://trac.webkit.org/changeset/241486

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

7 months agoWeb Inspector: don't include accessibility role in DOM.Node object payloads
bburg@apple.com [Thu, 14 Feb 2019 17:06:03 +0000 (17:06 +0000)]
Web Inspector: don't include accessibility role in DOM.Node object payloads
https://bugs.webkit.org/show_bug.cgi?id=194623
<rdar://problem/36384037>

Reviewed by Devin Rousso.

Source/JavaScriptCore:

Remove property of DOM.Node that is no longer being sent.

* inspector/protocol/DOM.json:

Source/WebCore:

Accessibility properties are complicated to fetch at all the points where we want to build and push nodes immediately.
Turning on AX often indirectly causes style recalc and layout. This is bad because we are often building nodes in the
first place due to a DOM node tree update (i.e., NodeInserted).

It turns out that DOM.getAccessibilityPropertiesForNode is called every time we display
the computed role in the Elements Tab > Nodes Sidebar > Accessibility Section. So it is not
necessary to collect this information in a problematic way when initially pushing the node, as
it will be updated anyway.

No new tests, no change in behavior.

* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForNode):

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

7 months ago[LFC][BFC][MarginCollapse] Replaced boxes don't collapse through their margins
zalan@apple.com [Thu, 14 Feb 2019 16:44:41 +0000 (16:44 +0000)]
[LFC][BFC][MarginCollapse] Replaced boxes don't collapse through their margins
https://bugs.webkit.org/show_bug.cgi?id=194622

Reviewed by Antti Koivisto.

Source/WebCore:

Ensure that block replaced boxes don't collapse through their vertical margins.

Test: fast/block/block-only/block-replaced-with-vertical-margins.html

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

Tools:

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

LayoutTests:

* fast/block/block-only/block-replaced-with-vertical-margins-expected.html: Added.
* fast/block/block-only/block-replaced-with-vertical-margins.html: Added.

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

7 months ago[LFC] Shrink-to-fit-width should be constrained by min/max width
zalan@apple.com [Thu, 14 Feb 2019 16:32:55 +0000 (16:32 +0000)]
[LFC] Shrink-to-fit-width should be constrained by min/max width
https://bugs.webkit.org/show_bug.cgi?id=194653

Reviewed by Antti Koivisto.

Source/WebCore:

Use the fixed value of min-width/max-width to constrain the computed preferred width.

* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::constrainByMinMaxWidth):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):

Tools:

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

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

7 months agoDo not add a caches to its engine if the salt cannot be initialized
youenn@apple.com [Thu, 14 Feb 2019 15:51:47 +0000 (15:51 +0000)]
Do not add a caches to its engine if the salt cannot be initialized
https://bugs.webkit.org/show_bug.cgi?id=194604

Reviewed by Antti Koivisto.

This is a follow-up to https://bugs.webkit.org/show_bug.cgi?id=194588.
We should return early if initialize fails.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::readCachesFromDisk):

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

7 months ago[GTK] Use a scrolled window for script alerts text
carlosgc@webkit.org [Thu, 14 Feb 2019 10:11:11 +0000 (10:11 +0000)]
[GTK] Use a scrolled window for script alerts text
https://bugs.webkit.org/show_bug.cgi?id=184875

Reviewed by Michael Catanzaro.

To ensure long text doesn't make the dialog bigger.

* UIProcess/API/gtk/WebKitScriptDialogImpl.cpp:
(webkitScriptDialogImplConstructed): Use PANGO_ELLIPSIZE_END for the title and add a scrolled window for the body.
(webkitScriptDialogImplSetText): Helper function to set the dialog body, ensuring the scrolled window fills the
dialog available size.
(webkitScriptDialogImplNew): It now receives the maximum size and uses webkitScriptDialogImplSetText().
* UIProcess/API/gtk/WebKitScriptDialogImpl.h:
* UIProcess/API/gtk/WebKitWebViewGtk.cpp:
(webkitWebViewScriptDialog): Pass the 80% of the web view size as the maximum size of script dialogs.

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

7 months agoCrash in WKBundleFrameGetParentFrame when called inside didRemoveFrameFromHierarchy
rniwa@webkit.org [Thu, 14 Feb 2019 06:47:32 +0000 (06:47 +0000)]
Crash in WKBundleFrameGetParentFrame when called inside didRemoveFrameFromHierarchy
https://bugs.webkit.org/show_bug.cgi?id=194641

Reviewed by Geoffrey Garen.

Source/WebKit:

Fixed the bug by adding a null check to WebFrame::parentFrame.

* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::parentFrame const):

Tools:

Added a call to WKBundleFrameGetParentFrame to an existing test for didRemoveFrameFromHierarchy
so that the test would fail without this fix.

* TestWebKitAPI/Tests/WebKit/DidRemoveFrameFromHiearchyInPageCache_Bundle.cpp:
(TestWebKitAPI::didRemoveFrameFromHierarchyCallback):

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

7 months agoCrash in DOMTimer::fired
rniwa@webkit.org [Thu, 14 Feb 2019 06:43:13 +0000 (06:43 +0000)]
Crash in DOMTimer::fired
https://bugs.webkit.org/show_bug.cgi?id=194638

Reviewed by Brent Fulgham.

Source/WebCore:

This patch continues the saga of hunting down timer related crashes after r239814, r225985, r227934.

The crash was caused by the bug that we don't remove a DOMTimer from NestedTimersMap if a DOMTimer
is created & installed inside another DOMTimer's callback (via execute call in DOMTimer::fired).

Fixed the crash by using a Ref in NestedTimersMap. This will keep the timer alive until we exit
from DOMTimer::fired. Because DOMTimer::fired always calls stopTracking() which clears the map
we would not leak these DOM timers.

We could, alternatively, use WeakPtr in NestedTimersMap but that would unnecessarily increase the
size of DOMTimer for a very marginal benefit of DOMTimer objcets being deleted slightly earlier.
Deleting itself in DOMTimer's destructor involves more logic & house keeping in the timer code,
and is no longer the preferred approach when dealing with these classes of bugs in WebKit.

Test: fast/dom/timer-destruction-during-firing.html

* page/DOMTimer.cpp:
(WebCore::NestedTimersMap::add):
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::fired):

LayoutTests:

Added a regression test. It needs debug assertions without the fix.

* fast/dom/timer-destruction-during-firing-expected.txt: Added.
* fast/dom/timer-destruction-during-firing.html: Added.

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

7 months agoAllow some deprecations in WKDrawingView.
timothy@apple.com [Thu, 14 Feb 2019 05:33:04 +0000 (05:33 +0000)]
Allow some deprecations in WKDrawingView.
https://bugs.webkit.org/show_bug.cgi?id=194636

Reviewed by Wenson Hsieh.

* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView PNGRepresentation]):
(-[WKDrawingView loadDrawingFromPNGRepresentation:]):
(-[WKDrawingView _canvasViewWillBeginDrawing:]):
(-[WKDrawingView didChangeInk:]):

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

7 months agoWeb Inspector: Styles: valid values in style attributes are reported as unsupported...
nvasilyev@apple.com [Thu, 14 Feb 2019 05:32:37 +0000 (05:32 +0000)]
Web Inspector: Styles: valid values in style attributes are reported as unsupported property values
https://bugs.webkit.org/show_bug.cgi?id=194619
<rdar://problem/47917373>

Reviewed by Devin Rousso.

Source/WebInspectorUI:

Payload of inline styles may contain `range` that doesn't match
the actual text of the payload - it has an extra empty line at the end.
Mismatching ranges caused data corruption.

* UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles.prototype._parseStylePropertyPayload):

LayoutTests:

* inspector/css/modify-inline-style-expected.txt: Added.
* inspector/css/modify-inline-style.html: Added.

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

7 months agoWeb Inspector: Update combined and minified copyright header for 2018-2019
commit-queue@webkit.org [Thu, 14 Feb 2019 03:47:31 +0000 (03:47 +0000)]
Web Inspector: Update combined and minified copyright header for 2018-2019
https://bugs.webkit.org/show_bug.cgi?id=194635

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-02-13
Reviewed by Devin Rousso.

* Scripts/copy-user-interface-resources.pl:

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

7 months agoWeb Inspector: Crash when inspecting an element that constantly changes visibility
commit-queue@webkit.org [Thu, 14 Feb 2019 03:38:40 +0000 (03:38 +0000)]
Web Inspector: Crash when inspecting an element that constantly changes visibility
https://bugs.webkit.org/show_bug.cgi?id=194632
<rdar://problem/48060258>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-02-13
Reviewed by Matt Baker and Devin Rousso.

* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::processAccessibilityChildren):
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
Don't use rvalue-references as that was taking ownership and deleting
the object we want to keep around. Instead simplify this to just use
references so no ref counting changes happen.

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