WebKit-https.git
6 months agoUnreviewed, rolling out r241182.
commit-queue@webkit.org [Tue, 12 Feb 2019 19:20:51 +0000 (19:20 +0000)]
Unreviewed, rolling out r241182.
https://bugs.webkit.org/show_bug.cgi?id=194547

causes a 2-3% Speedometer2 regression. (Requested by
keith_miller on #webkit).

Reverted changeset:

"bmalloc uses more memory on iOS compared to macOS due to
physical page size differences"
https://bugs.webkit.org/show_bug.cgi?id=192389
https://trac.webkit.org/changeset/241182

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

6 months ago[WPE][GTK] Unsafe g_unsetenv() use in WebProcessPool::platformInitialize
mcatanzaro@igalia.com [Tue, 12 Feb 2019 18:45:31 +0000 (18:45 +0000)]
[WPE][GTK] Unsafe g_unsetenv() use in WebProcessPool::platformInitialize
https://bugs.webkit.org/show_bug.cgi?id=194370

Reviewed by Darin Adler.

Source/JavaScriptCore:

Change a couple WTFLogAlways to use g_warning, for good measure. Of course this isn't
necessary, but it will make errors more visible.

* inspector/remote/glib/RemoteInspectorGlib.cpp:
(Inspector::RemoteInspector::start):
(Inspector::dbusConnectionCallAsyncReadyCallback):
* inspector/remote/glib/RemoteInspectorServer.cpp:
(Inspector::RemoteInspectorServer::start):

Source/WebKit:

It is incorrect to use g_unsetenv() here because it is MT-Unsafe. We know that it is
impossible and unreasonable to expect the application has not started other threads at this
point, and threads will be calling getenv(). WebKit itself has probably already started
threads of its own.

Fortunately, the remote inspector in the web process is already prepared to deal with
failure to connect to the inspector server, so we don't need to do anything except stop
messing with the environment.

Note these files are copies of each other. I'll merge them together in a follow-up patch.

* UIProcess/gtk/WebProcessPoolGtk.cpp:
(WebKit::initializeRemoteInspectorServer):
(WebKit::WebProcessPool::platformInitialize):
* UIProcess/wpe/WebProcessPoolWPE.cpp:
(WebKit::initializeRemoteInspectorServer):
(WebKit::WebProcessPool::platformInitialize):

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

6 months agoEnsure old binaries have old snapshotting behaviors
bdakin@apple.com [Tue, 12 Feb 2019 18:23:43 +0000 (18:23 +0000)]
Ensure old binaries have old snapshotting behaviors
https://bugs.webkit.org/show_bug.cgi?id=194449
-and corresponding-
rdar://problem/47931954

Reviewed by Darin Adler.

Make sure that a nil configuration behaves the same way that it used to on apps
that were linked before FirstWithSnapshotAfterScreenUpdates

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
* UIProcess/Cocoa/VersionChecks.h:

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

6 months agoWeb Inspector: Timelines: clicking on an empty space in the overview should deselect...
drousso@apple.com [Tue, 12 Feb 2019 18:22:40 +0000 (18:22 +0000)]
Web Inspector: Timelines: clicking on an empty space in the overview should deselect any selected record bar
https://bugs.webkit.org/show_bug.cgi?id=194365
<rdar://problem/47868426>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TimelineRecordBar.js:
(WI.TimelineRecordBar.prototype._handleClick):
Mark the "click" event so that later listeners know it was handled by `WI.TimelineRecordBar`.

* UserInterface/Views/TimelineOverview.js:
(WI.TimelineOverview):
(WI.TimelineOverview.prototype._instrumentAdded):
(WI.TimelineOverview.prototype._instrumentRemoved):
(WI.TimelineOverview.prototype._handleGraphsContainerClick): Added.
(WI.TimelineOverview.prototype._handleOverviewGraphRecordSelected): Added.
(WI.TimelineOverview.prototype._recordSelected):
Listen for "click" on the graph container and deselect all records when fired, unless the
click was marked by a `WI.TimelineRecordBar`.

* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView.prototype._recordSelected):
Ensure that all `WI.TimelineView` update their selected record whenever it changes for any
other `WI.TimelineView` (or if there is no selected record).

* UserInterface/Views/TimelineOverviewGraph.js:
(WI.TimelineOverviewGraph.prototype.didLayoutSubtree): Added.
Drive-by: since `WI.TimelineRecordBar` are reused when combining, we need to re-determine
which one holds the currently selected record.

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

6 months agoWeb Inspector: Remove unused maxUsage in CPUTimelineView
commit-queue@webkit.org [Tue, 12 Feb 2019 18:21:58 +0000 (18:21 +0000)]
Web Inspector: Remove unused maxUsage in CPUTimelineView
https://bugs.webkit.org/show_bug.cgi?id=194526

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

* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView):
(WI.CPUTimelineView.prototype.shown):

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

6 months agoAdd some null checks in JSNodeCustom.h's root() and generated isReachableFromOpaqueRo...
mark.lam@apple.com [Tue, 12 Feb 2019 18:21:45 +0000 (18:21 +0000)]
Add some null checks in JSNodeCustom.h's root() and generated isReachableFromOpaqueRoots() functions.
https://bugs.webkit.org/show_bug.cgi?id=194530
<rdar://problem/47973274>

Reviewed by Chris Dumez.

This is needed to fix a null pointer dereference that arises from the following scenario:
1. a Document detaches from its StyleSheetList.
2. the JSStyleSheetList that is associated with the detached StyleSheetList has yet
   to be scanned and collected by the GC.
3. the GC eventually looks for the opaque root of the StyleSheetList's owner, and
   discovers a null owner pointer.

This patch fixes this issue by applying the following null checks:

1. Add a null check in JSNodeCustom.h's root().

   root() is called from a isReachableFromOpaqueRoots() generated by CodeGeneratorJS.pm.
   isReachableFromOpaqueRoots() calls a ownerNode() method and passes its result
   to root().  However, depending on which class the ownerNode() method belongs to,
   it can either return a pointer or a reference.  The null check only makes sense
   in the pointer case.

   To accommodate the 2 forms, root() itself is has an overload that takes a
   reference instead of a pointer.

   Since CodeGeneratorJS.pm can't tell what the generated class' ownerNode()
   returns, it can't discern when the result is a pointer and apply the null check.
   Instead, we just add the null check to the version of root() that takes a
   pointer.  If the node pointer is null, we'll return a null opaque root.

2. Fix CodeGeneratorJS.pm to null check the opaque root before using it.

* bindings/js/JSNodeCustom.h:
(WebCore::root):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):

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

6 months ago[iOSMac] Enable Parental Controls Content Filtering
aestes@apple.com [Tue, 12 Feb 2019 17:43:37 +0000 (17:43 +0000)]
[iOSMac] Enable Parental Controls Content Filtering
https://bugs.webkit.org/show_bug.cgi?id=194521
<rdar://39732376>

Reviewed by Tim Horton.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:
* platform/ContentFilterUnblockHandler.h:
* platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
* platform/cocoa/ParentalControlsContentFilter.mm:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/Platform.h:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

6 months agoUnreviewed WPE gardening. Unskip content extensions tests after r241283
aperez@igalia.com [Tue, 12 Feb 2019 17:38:42 +0000 (17:38 +0000)]
Unreviewed WPE gardening. Unskip content extensions tests after r241283

* platform/wpe/TestExpectations: Unskip content extensions tests, and list
as failing those known to not pass due to missing expectaions or timeouts.

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

6 months agoSource/WebCore:
jer.noble@apple.com [Tue, 12 Feb 2019 16:53:12 +0000 (16:53 +0000)]
Source/WebCore:
Unreviewed build fix; add a HAVE_CELESTIAL guard around Celestial framework usage.

* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::providePresentingApplicationPIDIfNecessary):

Source/WebCore/PAL:
Unreviewed build fix; add a HAVE_CELESTIAL guard around the CelestialSPI.h contents.

* pal/spi/ios/CelestialSPI.h:

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

6 months agoCrash in WebCore::ScrollingTree::updateTreeFromStateNode
antti@apple.com [Tue, 12 Feb 2019 16:22:18 +0000 (16:22 +0000)]
Crash in WebCore::ScrollingTree::updateTreeFromStateNode
https://bugs.webkit.org/show_bug.cgi?id=194538
<rdar://problem/47841926>

Reviewed by Zalan Bujtas.

* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::updateTreeFromStateNode):

Make sure we don't leave node entry behind in m_nodeMap in case we failed to add it to the parent.

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

6 months ago[LFC] Remove redundant InlineFormattingContext::computeBorderAndPadding
zalan@apple.com [Tue, 12 Feb 2019 15:59:16 +0000 (15:59 +0000)]
[LFC] Remove redundant InlineFormattingContext::computeBorderAndPadding
https://bugs.webkit.org/show_bug.cgi?id=194540

Reviewed by Antti Koivisto.

Use FormattingContext::computeBorderAndPadding instead.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeBorderAndPadding const):
* layout/FormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:

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

6 months ago[LFC][IFC] Add intrinsic width support for float boxes.
zalan@apple.com [Tue, 12 Feb 2019 15:34:36 +0000 (15:34 +0000)]
[LFC][IFC] Add intrinsic width support for float boxes.
https://bugs.webkit.org/show_bug.cgi?id=194528

Reviewed by Antti Koivisto.

Source/WebCore:

This patch implements a very simple float box support for intrinsic width.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFloatBox const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForInlineBlock const):
(WebCore::Layout::InlineFormattingContext::computeMargin const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:

Tools:

Expand tests coverage (2 new tests -> 800).
(This is the correct test ordering --runs-singly --child-processes=1)

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

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

6 months agoImplement serializing in MIME type parser
commit-queue@webkit.org [Tue, 12 Feb 2019 10:04:38 +0000 (10:04 +0000)]
Implement serializing in MIME type parser
https://bugs.webkit.org/show_bug.cgi?id=193909

Patch by Rob Buis <rbuis@igalia.com> on 2019-02-12
Reviewed by Darin Adler.

Source/WebCore:

Implement serializing in MIME type parser [1], to preserve the parameter
order the Vector m_parameterNames is introduced, since HashMaps do not
guarantee any order.

Test: ParsedContentType.Serialize

[1] https://mimesniff.spec.whatwg.org/#serializing-a-mime-type

* platform/network/ParsedContentType.cpp:
(WebCore::skipSpaces):
(WebCore::parseQuotedString):
(WebCore::ParsedContentType::parseContentType):
(WebCore::ParsedContentType::parameterValueForName const):
(WebCore::ParsedContentType::parameterCount const):
(WebCore::ParsedContentType::setContentType):
(WebCore::ParsedContentType::setContentTypeParameter):
(WebCore::ParsedContentType::serialize const):
* platform/network/ParsedContentType.h:

Tools:

Add various tests involving upper case, non-ASCII, control/null characters,
various HTTP whitespace, single quotes and an unpaired surrogate.

* TestWebKitAPI/Tests/WebCore/ParsedContentType.cpp:
(TestWebKitAPI::escapeNonASCIIPrintableCharacters):
(TestWebKitAPI::serializeIfValid):
(TestWebKitAPI::TEST):

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

6 months ago[WPE][GTK] Sleep disabler code should inhibit idle when a "System" sleep disabler...
mcatanzaro@igalia.com [Tue, 12 Feb 2019 09:29:46 +0000 (09:29 +0000)]
[WPE][GTK] Sleep disabler code should inhibit idle when a "System" sleep disabler is requested
https://bugs.webkit.org/show_bug.cgi?id=194500

Reviewed by Carlos Garcia Campos.

There are three things wrong with the comment at the top of SleepDisablerGLib's constructor:

(1) Nowadays, GNOME suspends the computer automatically on inactivity, and we actually do
    want to prevent that.

(2) Inhibiting idle does affect the autosuspend countdown. So the current code should
    prevent automatic suspend, just not manual suspend. (I think I stand by my comment that
    we do not want to inhibit normal suspend, since that would just be annoying.)

(3) I don't know why I thought HTMLMediaElement::shouldDisableSleep was suspicious.

Anyway, the behavior we want is to ignore the Type argument and just always inhibit idle.
That is, treat type=System the same way we current treat type=Display.

* pal/system/glib/SleepDisablerGLib.cpp:
(PAL::SleepDisablerGLib::SleepDisablerGLib):

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

6 months agoAXObjectCache::childrenChanged shouldn't update layout or style during another style...
cfleizach@apple.com [Tue, 12 Feb 2019 09:28:44 +0000 (09:28 +0000)]
AXObjectCache::childrenChanged shouldn't update layout or style during another style recalc
https://bugs.webkit.org/show_bug.cgi?id=182280
<rdar://problem/37018386>

Reviewed by Alan Bujtas.

Source/WebCore:

Remove the possibility that changing children calls back into updating layout by
handling children changes in a deferred manner.

This follows the same architecture as many other deferred changes, but also requires us to check deferred changes
in updateBackingStore, because things like aria-hidden changes won't trigger a layout, but will require us to update children.

A few tests had to be modified to no longer change the tree and then check the children immediately.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::childrenChanged):
(WebCore::AXObjectCache::prepareForDocumentDestruction):
(WebCore::AXObjectCache::performDeferredCacheUpdate):
* accessibility/AXObjectCache.h:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::updateBackingStore):
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(convertToNSArray):
(-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):

LayoutTests:

* accessibility/aria-hidden-update.html:
* accessibility/aria-hidden-updates-alldescendants.html:
* accessibility/image-load-on-delay.html:
* accessibility/mac/aria-hidden-changes-for-non-ignored-elements.html:
* accessibility/removed-anonymous-block-child-causes-crash.html:

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

6 months ago[Cocoa] Ask platform for generic font family mappings
mmaxfield@apple.com [Tue, 12 Feb 2019 02:19:19 +0000 (02:19 +0000)]
[Cocoa] Ask platform for generic font family mappings
https://bugs.webkit.org/show_bug.cgi?id=187723
<rdar://problem/41892438>

Reviewed by Brent Fulgham.

Source/WebCore:

WebKit API allows setting the generic font families for the USCRIPT_COMMON script.
When trying to style a character with a generic font family, we first look to see if
we have a mapping for the particular script the character is rendered with, and if we
don't find a match, we then check USCRIPT_COMMON.

In the Cocoa ports, the only way families get set for non-USCRIPT_COMMON scripts (aka
the only scripts which won't use the API families) is in
SettingsBase::initializeDefaultFontFamilies(). That function only sets the families
for the CJK scripts.

The mappings inside SettingsBase are incorrect and conflict with our policy regarding
user-installed fonts. Instead, we should be consulting with the platform for some of
these mappings, by calling CTFontDescriptorCreateForCSSFamily(). However, the WebKit
API still has to work to set the mappings for untagged content. Therefore, we use the
system mappings for language-tagged content, and the API mappings for non-language-tagged
content. This is a good balance that makes sure we always have a good mapping for every
language, but API clients can still set the mappings, too.

Test: fast/text/ja-sans-serif.html

* css/CSSComputedStyleDeclaration.cpp:
* css/CSSFontSelector.cpp:
(WebCore::resolveGenericFamily):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontFamily):
* page/cocoa/SettingsBaseCocoa.mm:
(WebCore::SettingsBase::initializeDefaultFontFamilies):
(WebCore::osakaMonoIsInstalled): Deleted.
* platform/graphics/FontDescription.cpp:
(WebCore::FontDescription::platformResolveGenericFamily):
* platform/graphics/FontDescription.h:
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::computeSpecializedChineseLocale):
(WebCore::cachedSpecializedChineseLocale):
(WebCore::languageChanged):
(WebCore::FontDescription::platformResolveGenericFamily):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::SystemFontDatabaseCoreText::clear):
(WebCore::genericFamily):
(WebCore::SystemFontDatabaseCoreText::serifFamily):
(WebCore::SystemFontDatabaseCoreText::sansSerifFamily):
(WebCore::SystemFontDatabaseCoreText::cursiveFamily):
(WebCore::SystemFontDatabaseCoreText::fantasyFamily):
(WebCore::SystemFontDatabaseCoreText::monospaceFamily):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.h:

Source/WebCore/PAL:

* pal/spi/cocoa/CoreTextSPI.h:

Source/WTF:

Add an ENABLE in Platform.

* wtf/Platform.h:

Tools:

Allow testing infrastructure to use fonts that are returned from CTFontDescriptorCreateForCSSFamily().

* DumpRenderTree/mac/DumpRenderTree.mm:
(allowedFontFamilySet):
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::allowedFontFamilySet):

LayoutTests:

Update the tests to work with this new model.

* fast/text/international/font-fallback-to-common-script-expected.html: Removed.
* fast/text/international/font-fallback-to-common-script.html: Removed.
* fast/text/international/lang-sensitive-fonts-expected.html:
* fast/text/international/lang-sensitive-fonts-xml-expected.html:
* fast/text/international/lang-sensitive-fonts-xml.xhtml:
* fast/text/international/lang-sensitive-fonts.html:
* fast/text/international/locale-sensitive-fonts-expected.html:
* fast/text/international/locale-sensitive-fonts.html:
* fast/text/ja-sans-serif-expected-mismatch.html: Added.
* fast/text/ja-sans-serif.html: Added.
* platform/ios/fast/block/float/016-expected.txt:

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

6 months agoRemove noisy and unnecessary logs added in r241223
achristensen@apple.com [Tue, 12 Feb 2019 01:50:34 +0000 (01:50 +0000)]
Remove noisy and unnecessary logs added in r241223
https://bugs.webkit.org/show_bug.cgi?id=194427

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
Errors occur all the time in the XPC connection's event handler, like when a process terminates.
We don't need to print an "error" every time any process terminates.

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

6 months agoUpdating for all of Mac WK2 for flaky test
commit-queue@webkit.org [Tue, 12 Feb 2019 01:16:19 +0000 (01:16 +0000)]
Updating for all of Mac WK2 for flaky test
https://bugs.webkit.org/show_bug.cgi?id=185994

Unreviewed test gardening.

Patch by Shawn Roberts <sroberts@apple.com> on 2019-02-11

* platform/mac-wk2/TestExpectations:

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

6 months ago[Cocoa] Web Automation: client callbacks are not called if delegate does not override
bburg@apple.com [Tue, 12 Feb 2019 01:15:49 +0000 (01:15 +0000)]
[Cocoa] Web Automation: client callbacks are not called if delegate does not override
https://bugs.webkit.org/show_bug.cgi?id=194519
<rdar://problem/47981961>

Reviewed by Joseph Pecoraro.

Call the completion handler directly if the delegate does not implement the relevant method.

* UIProcess/Cocoa/AutomationSessionClient.mm:
(WebKit::AutomationSessionClient::requestNewPageWithOptions):
(WebKit::AutomationSessionClient::requestSwitchToPage):
(WebKit::AutomationSessionClient::requestHideWindowOfPage):
(WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
(WebKit::AutomationSessionClient::requestMaximizeWindowOfPage):

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

6 months ago[iOS] Adopt SPI to support Emacs bindings: transpose and delete to end of paragraph
dbates@webkit.org [Tue, 12 Feb 2019 01:04:16 +0000 (01:04 +0000)]
[iOS] Adopt SPI to support Emacs bindings: transpose and delete to end of paragraph
https://bugs.webkit.org/show_bug.cgi?id=194505
<rdar://problem/47743533>

Reviewed by Tim Horton.

Source/WebKit:

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _deleteToEndOfParagraph]): Added.
(-[WKContentView _transpose]): Added.

LayoutTests:

Add tests to ensure that Control + t and Control + k perform a transpose and delete to the
end of the line/paragraph. Skip the tests for now until we have the UIKit fix <rdar://problem/44928156>.

* fast/events/ios/key-command-delete-to-end-of-paragraph-expected.txt: Added.
* fast/events/ios/key-command-delete-to-end-of-paragraph.html: Added.
* fast/events/ios/key-command-transpose-expected.txt: Added.
* fast/events/ios/key-command-transpose.html: Added.
* platform/ios/TestExpectations: Skip tests for now.

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

6 months ago[GTK][WPE] Add content extensions support in WKTR and unskip layout tests
aperez@igalia.com [Tue, 12 Feb 2019 00:07:21 +0000 (00:07 +0000)]
[GTK][WPE] Add content extensions support in WKTR and unskip layout tests
https://bugs.webkit.org/show_bug.cgi?id=193622

Reviewed by Michael Catanzaro.

.:

* Source/cmake/OptionsGTK.cmake: Enable CONTENT_EXTENSIONS by default.
* Source/cmake/OptionsWPE.cmake: Ditto.
* Source/cmake/WebKitFeatures.cmake: Add a private CONTENT_EXTENSIONS option.

Source/WebCore:

No new tests needed.

* SourcesCocoa.txt: Remove loader/ResourceLoadInfo.cpp, it's not Cocoa-specific anymore.
* Sources.txt: Add loader/ResourceLoadInfo.cpp, all ports use it now.

Source/WebKit:

* NetworkProcess/cache/NetworkCacheData.h: Define an adoptAndMapFile() implementation
for GFileIOStream objects.
* NetworkProcess/cache/NetworkCacheDataSoup.cpp:
(WebKit::NetworkCache::adoptAndMapFile): Added implementation, which extracts the file
descriptor from a GFileIOStream, as it inherits from GFileDescriptorBased, and then
reuses the version of adoptAndMapFile() which takes a file descritor for the actual work.
* NetworkProcess/NetworkLoadChecker.cpp:
(Webkit::NetworkLoadChecker::checkRequest): Use "this" when referring to
processContentExtensionRulesForLoad() in order to avoid ambiguity.
* Sources.txt: Add WKUserContentExtensionStoreRef.cpp, all ports use it now.
* SourcesCocoa.txt: Remove WKUserContentExtensionStoreRef.cpp, because it is not
Cocoa-specific anymore.
* SourcesGTK.txt: Add APIContentRuleListStoreGLib.cpp.
* SourcesWPE.txt: Ditto.
* UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
(WKUserContentExtensionStoreCreate): Added.
(toResult): Added.
(WKUserContentExtensionStoreCompile): Added.
(WKUserContentExtensionStoreLookup): Added.
(WKUserContentExtensionStoreRemove): Added.
* UIProcess/API/C/WKUserContentExtensionStoreRef.h: Add declarations for the new C API
functions and for the WKUserContentExtensionStoreResult status enum.
* UIProcess/API/glib/APIContentRuleListStoreGLib.cpp: Added.
(API::ContentRuleListStore::defaultStorePath): Add a dummy implementation. The public API
for the GLib based ports (GTK+ and WPE) will not allow using the default store and will
always indicating a path.

Tools:

This adds support for loading content extension rule sets from the JSON files which
accompany the corresponding layout test, using the C API. The Cocoa specific parts
of WKTR for this could be removed, but that is left for a follow-up patch with
cleanups.

* Scripts/webkitperl/FeatureList.pm: Add an option to toggle CONTENT_EXTENSIONS.
* WebKitTestRunner/TestController.cpp:
(WTR::testPath): Subtract one from the length when constructing the result std::string to
avoid having the null-terminator copied into the result.
(WTR::TestController::configureViewForTest): Call configureContentExtensionForTest() as
part of the preparations to run a test.
(WTR::ContentExtensionStoreCallbackContext::ContentExtensionStoreCallbackContext): Added.
(WTR::contentExtensionStoreCallback): Added.
(WTR::contentExtensionJSONPath): Used to calculate the path to the JSON rule set to be
used for content extensions test.
(WTR::TestController::configureContentExtensionForTest): Added, handles enabling content
extensions and compiling the JSON rule set for tests involving content extensions.
(WTR::TestController::resetContentExtensions): Removes the content extension built for
testing and disables content extensions.
(WTR::TestController::resetPreferencesToConsistentValues): Add a call to
resetContentExtensions().
(WTR::TestController::userContentController): Added implementation for ports other than Cocoa.
* WebKitTestRunner/TestController.h: Add declarations for resetContentExtensions(),
configureContentExtensionForTest(), and userContentController().

LayoutTests:

* platform/gtk/TestExpectations: Un-skip tests for content extensions and add expectations.

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

6 months ago[iOS] Mouse/Touch/Pointer events are missing modifier keys
dbates@webkit.org [Mon, 11 Feb 2019 23:24:23 +0000 (23:24 +0000)]
[iOS] Mouse/Touch/Pointer events are missing modifier keys
https://bugs.webkit.org/show_bug.cgi?id=191446
<rdar://problem/45929460>

Reviewed by Tim Horton.

Source/WebCore:

Extract the modifier flags from the WebEvent. This code is only used by Legacy WebKit
on iOS and we will need to fix <rdar://problem/47929759> in order for modifier flags
to be passed to WebKit.

Tests: fast/events/touch/ios/mouse-events-with-modifiers.html
       fast/events/touch/ios/pointer-events-with-modifiers.html
       fast/events/touch/ios/touch-events-with-modifiers.html

* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
(-[WebEvent initWithMouseEventType:timeStamp:location:]):
(-[WebEvent initWithMouseEventType:timeStamp:location:modifiers:]):

Source/WebKit:

Make use of UIKit SPI to retreive the modifier flags when dispatching mouse and touch events.
Add new WebKit SPI for iOS, -[WKNavigationAction modifierFlags], to retrieve the the modifier
flags held when a navigation action was initiated.

* Platform/spi/ios/UIKitSPI.h: Expose SPI.
* Shared/NativeWebTouchEvent.h: Re-arrange macro guards so that we can expose the helper function
WebKit::webEventModifierFlags(). This is a bit more involved that usual since this header is included
from both C++ and Objective-C source files. It only makes sense to expose this function when
compiling as part of an Objective-C source file.
* Shared/ios/NativeWebTouchEventIOS.mm:
(WebKit::NativeWebTouchEvent::NativeWebTouchEvent): Modified to take the modifier flags held down
when the platform touch event was received and pass them through to the base constructor.
(WebKit::webEventModifierFlags): Added. Converts from the platform-speciifc UIKeyModifierFlags to
OptionSet<WebKit::WebEvent::Modifier>.
* Shared/ios/WebIOSEventFactory.h:
* Shared/ios/WebIOSEventFactory.mm:
(WebIOSEventFactory::toUIKeyModifierFlags): Added. Converts from OptionSet<WebKit::WebEvent::Modifier>
to the platform-specific UIKeyModifierFlags.
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(-[WKNavigationAction modifierFlags]): Added.
* UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(gestureRecognizerModifierFlags): Added.

(-[WKContentView _webTouchEventsRecognized:]):
(-[WKContentView _highlightLongPressRecognized:]):
(-[WKContentView _twoFingerSingleTapGestureRecognized:]):
(-[WKContentView _singleTapCommited:]):
Pass modifier flags through.

(-[WKContentView _attemptClickAtLocation:modifierFlags:]): Added.
(-[WKContentView actionSheetAssistant:openElementAtLocation:]): This is invoked when a person opens a link
via the action sheet. We don't have access to the modifier flags to pass. It also seems like an implementation
detail that this action is implemented via mouse click and we should re-evaluate this decision in light of
the fact tht the action sheet is browser UI and we tend to be very reserved on what UI actions are visible
to the page. On Mac, opening a link via the context menu is not visible to the page, at least from a mouse
event perspective.
(webEventFlagsForUIKeyModifierFlags): Added.
(-[WKContentView _hoverGestureRecognizerChanged:]): Pass modifier flags through.
(-[WKContentView _attemptClickAtLocation:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
(WebKit::WebPageProxy::commitPotentialTap):
(WebKit::WebPageProxy::handleTap):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
(WebKit::WebPage::completeSyntheticClick):
(WebKit::WebPage::handleTap):
(WebKit::WebPage::handleTwoFingerTapAtPoint):
(WebKit::WebPage::commitPotentialTap):
Pass modifier flags through.

Tools:

Add support infrastructure for testing touch and stylus taps when holding modifier keys.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::singleTapAtPointWithModifiers): Added.
(WTR::UIScriptController::stylusTapAtPointWithModifiers): Added.
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::singleTapAtPointWithModifiers): Added.
(WTR::UIScriptController::stylusTapAtPointWithModifiers): Added.
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::arrayLength):
(WTR::parseModifierArray):
(WTR::UIScriptController::singleTapAtPoint): Implemented in terms of singleTapAtPointWithModifiers().
(WTR::UIScriptController::singleTapAtPointWithModifiers): Added.
(WTR::UIScriptController::stylusTapAtPoint): Implemented in terms of stylusTapAtPointWithModifiers().
(WTR::UIScriptController::stylusTapAtPointWithModifiers): Added.

LayoutTests:

Refactor existing iOS key events tests to share code. Add new tests to ensure touch and mouse events
have accurate modifier key details.

* fast/events/ios/key-events-meta-alt-combinations.html:
* fast/events/ios/resources/key-tester.js:
(computeSubsets.compareByModifierOrder): Deleted.
* fast/events/resources/compute-subsets.js: Added.
(computeSubsets.compareByOriginalArrayOrder):
(computeSubsets):
* fast/events/touch/ios/mouse-events-with-modifiers-expected.txt: Added.
* fast/events/touch/ios/mouse-events-with-modifiers.html: Added.
* fast/events/touch/ios/pointer-events-with-modifiers-expected.txt: Added.
* fast/events/touch/ios/pointer-events-with-modifiers.html: Added.
* fast/events/touch/ios/touch-events-with-modifiers-expected.txt: Added.
* fast/events/touch/ios/touch-events-with-modifiers.html: Added.
* http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt: Update expected result
due to changes to ui-helper.js.
* http/tests/security/anchor-download-block-crossorigin-expected.txt: Ditto.
* platform/ios/TestExpectations:
* resources/ui-helper.js:
(window.UIHelper.tapAt.return.new.Promise):
(window.UIHelper.tapAt):
(window.UIHelper.stylusTapAt.return.new.Promise):
(window.UIHelper.stylusTapAt):

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

6 months ago[Cocoa] Notify AVSystemController of our presenting PID before registering as a Now...
jer.noble@apple.com [Mon, 11 Feb 2019 22:52:18 +0000 (22:52 +0000)]
[Cocoa] Notify AVSystemController of our presenting PID before registering as a Now Playing app.
https://bugs.webkit.org/show_bug.cgi?id=194504

Reviewed by Eric Carlson.

Source/WebCore:

This allows the MediaRemote framework to associate the WebContent process with its host application.

* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::start):
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::prepareToSendUserMediaPermissionRequest):
* platform/audio/cocoa/MediaSessionManagerCocoa.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(MediaSessionManagerCocoa::prepareToSendUserMediaPermissionRequest):
(MediaSessionManagerCocoa::providePresentingApplicationPIDIfNecessary):
(MediaSessionManagerCocoa::updateNowPlayingInfo):

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj:
* pal/spi/ios/CelestialSPI.h: Renamed from Source/WebKit/Platform/spi/ios/CelestialSPI.h.

Source/WebKit:

* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
(WebKit::WebUserMediaClient::requestUserMediaAccess):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::prepareToSendUserMediaPermissionRequest): Deleted.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::userMediaPermissionRequestManager):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::prepareToSendUserMediaPermissionRequest): Deleted.

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

6 months agoRandomize insertion of deallocated StructureIDs into the StructureIDTable's free...
mark.lam@apple.com [Mon, 11 Feb 2019 22:44:17 +0000 (22:44 +0000)]
Randomize insertion of deallocated StructureIDs into the StructureIDTable's free list.
https://bugs.webkit.org/show_bug.cgi?id=194512
<rdar://problem/47975465>

Reviewed by Yusuke Suzuki.

* runtime/StructureIDTable.cpp:
(JSC::StructureIDTable::StructureIDTable):
(JSC::StructureIDTable::allocateID):
(JSC::StructureIDTable::deallocateID):
* runtime/StructureIDTable.h:

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

6 months agoWeb Inspector: add context menu items to copy a resource's HTTP request/response...
drousso@apple.com [Mon, 11 Feb 2019 22:27:37 +0000 (22:27 +0000)]
Web Inspector: add context menu items to copy a resource's HTTP request/response data
https://bugs.webkit.org/show_bug.cgi?id=194261
<rdar://problem/21693696>

Reviewed by Joseph Pecoraro.

* UserInterface/Models/Resource.js:
(WI.Resource.prototype.stringifyHTTPRequest): Added.
(WI.Resource.prototype.stringifyHTTPResponse): Added.
Don't include the request/response data, as that can be very large, and can easily be
accessed by actually selecting the resource in the Resources/Network tab.

* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForSourceCode):

* Localizations/en.lproj/localizedStrings.js:

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

6 months agoUnreviewed, rolling out r241272 and r241276.
commit-queue@webkit.org [Mon, 11 Feb 2019 21:55:14 +0000 (21:55 +0000)]
Unreviewed, rolling out r241272 and r241276.
https://bugs.webkit.org/show_bug.cgi?id=194514

Broke the Apple Internal build and the fix requires human
intervention :( (Requested by dydz on #webkit).

Reverted changesets:

"[iOS] Mouse/Touch/Pointer events are missing modifier keys"
https://bugs.webkit.org/show_bug.cgi?id=191446
https://trac.webkit.org/changeset/241272

"Fix internal iOS build after r241272"
https://bugs.webkit.org/show_bug.cgi?id=191446
https://trac.webkit.org/changeset/241276

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

6 months agoUnreviewed, rolling out r241269.
tsavell@apple.com [Mon, 11 Feb 2019 21:47:56 +0000 (21:47 +0000)]
Unreviewed, rolling out r241269.

Caused 5 layout tests crashes on Mac WK1

Reverted changeset:

"DumpRenderTree should report unknown options"
https://bugs.webkit.org/show_bug.cgi?id=191303
https://trac.webkit.org/changeset/241269

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

6 months agoFix internal iOS build after r241272
achristensen@apple.com [Mon, 11 Feb 2019 20:43:03 +0000 (20:43 +0000)]
Fix internal iOS build after r241272
https://bugs.webkit.org/show_bug.cgi?id=191446

* Platform/spi/ios/UIKitSPI.h:
Declare the _modifierFlags when using the internal SDK also.

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

6 months agofast/forms/ios/force-gregorian-calendar-for-credit-card-expiry.html does not work...
wenson_hsieh@apple.com [Mon, 11 Feb 2019 19:30:05 +0000 (19:30 +0000)]
fast/forms/ios/force-gregorian-calendar-for-credit-card-expiry.html does not work on iPad
https://bugs.webkit.org/show_bug.cgi?id=194313

Reviewed by Tim Horton.

Source/WebKit:

Make `-dateTimePickerCalendarType` work on iPad by handling the case where the date picker control is a
WKDateTimePopover. This fixes UIScriptController::calendarType() returning null on iPad.

* UIProcess/ios/forms/WKFormInputControl.mm:
(-[WKFormInputControl dateTimePickerCalendarType]):
(-[WKDateTimePopover calendarType]):

Tools:

Add a helper to determine whether the web view is presenting modal UI.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::isPresentingModally const):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::isPresentingModally const):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/UIScriptControllerCocoa.mm:
(WTR::UIScriptController::calendarType const): Deleted.
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::isPresentingModally const):
(WTR::UIScriptController::calendarType const):
* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::calendarType const):

LayoutTests:

Adjusts an existing layout test to work on both iPhone and iPad simulators.

* fast/forms/ios/force-gregorian-calendar-for-credit-card-expiry-expected.txt:
* fast/forms/ios/force-gregorian-calendar-for-credit-card-expiry.html:

Make this test wait after blurring the currently focused element, such that tapping to focus the next form
control doesn't fail. Notably on iPad, not waiting for the popover to dismiss meant that subsequent taps would
be dispatched too soon, and hit-test to the popover view being dismissed rather than WKWebView.

* platform/ipad/TestExpectations:

Unskip the test on iPad.

* resources/ui-helper.js:

Add helpers to query whether or not the keyboard is shown, and whether or not a view controller is being modally
presented over the current root view controller (this is the case when interacting with date pickers on iPad).

(window.UIHelper.isShowingKeyboard):
(window.UIHelper.isPresentingModally):
(window.UIHelper.deactivateFormControl):

Add a new helper method to blur the given form control element and wait for web view chrome to finish dismissing
(on iOS, this is either the date picker input view in the keyboard on iPhone, or the date picker popover view
controller on iPad).

(window.UIHelper.isShowingDataListSuggestions):

Drive-by fix: remove an extraneous ternary conditional statement.

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

6 months agoGCHeapInspector: Show the retained sizes in more places
commit-queue@webkit.org [Mon, 11 Feb 2019 19:25:50 +0000 (19:25 +0000)]
GCHeapInspector: Show the retained sizes in more places
https://bugs.webkit.org/show_bug.cgi?id=194464

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-02-11
Reviewed by Simon Fraser.

* GCHeapInspector/gc-heap-inspector.html:
* GCHeapInspector/script/interface.js:
(HeapInspectorUtils.humanReadableSize):
(HeapInspectorUtils.spanForNode.let.nodeHTML.node.className.span):
(HeapInspectorUtils.spanForNode.span.span):
(HeapSnapshotInspector.prototype.buildAllObjectsByType):
(HeapSnapshotInspector.prototype.buildRoots):

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

6 months agoStop using setDefersLoading from WebCore
achristensen@apple.com [Mon, 11 Feb 2019 19:02:49 +0000 (19:02 +0000)]
Stop using setDefersLoading from WebCore
https://bugs.webkit.org/show_bug.cgi?id=194315

Reviewed by Jer Noble.

That is what CompletionHandlers are for.

* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::responseReceived):
(WebCore::MediaResource::setDefersLoading): Deleted.
* loader/MediaResourceLoader.h:
* platform/graphics/PlatformMediaResourceLoader.h:
(WebCore::PlatformMediaResourceClient::responseReceived):
(WebCore::PlatformMediaResource::stop):
(WebCore::PlatformMediaResource::setDefersLoading): Deleted.
* platform/network/cocoa/WebCoreNSURLSession.mm:
(WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
(-[WebCoreNSURLSessionDataTask resource:receivedResponse:completionHandler:]):
(-[WebCoreNSURLSessionDataTask _setDefersLoading:]): Deleted.
(-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Deleted.

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

6 months ago[iOS] Mouse/Touch/Pointer events are missing modifier keys
dbates@webkit.org [Mon, 11 Feb 2019 19:01:55 +0000 (19:01 +0000)]
[iOS] Mouse/Touch/Pointer events are missing modifier keys
https://bugs.webkit.org/show_bug.cgi?id=191446
<rdar://problem/45929460>

Reviewed by Tim Horton.

Source/WebCore:

Extract the modifier flags from the WebEvent. This code is only used by Legacy WebKit
on iOS and we will need to fix <rdar://problem/47929759> in order for modifier flags
to be passed to WebKit.

Tests: fast/events/touch/ios/mouse-events-with-modifiers.html
       fast/events/touch/ios/pointer-events-with-modifiers.html
       fast/events/touch/ios/touch-events-with-modifiers.html

* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
(-[WebEvent initWithMouseEventType:timeStamp:location:]):
(-[WebEvent initWithMouseEventType:timeStamp:location:modifiers:]):

Source/WebKit:

Make use of UIKit SPI to retreive the modifier flags when dispatching mouse and touch events.
Add new WebKit SPI for iOS, -[WKNavigationAction modifierFlags], to retrieve the the modifier
flags held when a navigation action was initiated.

* Platform/spi/ios/UIKitSPI.h: Expose SPI.
* Shared/NativeWebTouchEvent.h: Re-arrange macro guards so that we can expose the helper function
WebKit::webEventModifierFlags(). This is a bit more involved that usual since this header is included
from both C++ and Objective-C source files. It only makes sense to expose this function when
compiling as part of an Objective-C source file.
* Shared/ios/NativeWebTouchEventIOS.mm:
(WebKit::NativeWebTouchEvent::NativeWebTouchEvent): Modified to take the modifier flags held down
when the platform touch event was received and pass them through to the base constructor.
(WebKit::webEventModifierFlags): Added. Converts from the platform-speciifc UIKeyModifierFlags to
OptionSet<WebKit::WebEvent::Modifier>.
* Shared/ios/WebIOSEventFactory.h:
* Shared/ios/WebIOSEventFactory.mm:
(WebIOSEventFactory::toUIKeyModifierFlags): Added. Converts from OptionSet<WebKit::WebEvent::Modifier>
to the platform-specific UIKeyModifierFlags.
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(-[WKNavigationAction modifierFlags]): Added.
* UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(gestureRecognizerModifierFlags): Added.

(-[WKContentView _webTouchEventsRecognized:]):
(-[WKContentView _highlightLongPressRecognized:]):
(-[WKContentView _twoFingerSingleTapGestureRecognized:]):
(-[WKContentView _singleTapCommited:]):
Pass modifier flags through.

(-[WKContentView _attemptClickAtLocation:modifierFlags:]): Added.
(-[WKContentView actionSheetAssistant:openElementAtLocation:]): This is invoked when a person opens a link
via the action sheet. We don't have access to the modifier flags to pass. It also seems like an implementation
detail that this action is implemented via mouse click and we should re-evaluate this decision in light of
the fact tht the action sheet is browser UI and we tend to be very reserved on what UI actions are visible
to the page. On Mac, opening a link via the context menu is not visible to the page, at least from a mouse
event perspective.
(webEventFlagsForUIKeyModifierFlags): Added.
(-[WKContentView _hoverGestureRecognizerChanged:]): Pass modifier flags through.
(-[WKContentView _attemptClickAtLocation:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
(WebKit::WebPageProxy::commitPotentialTap):
(WebKit::WebPageProxy::handleTap):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
(WebKit::WebPage::completeSyntheticClick):
(WebKit::WebPage::handleTap):
(WebKit::WebPage::handleTwoFingerTapAtPoint):
(WebKit::WebPage::commitPotentialTap):
Pass modifier flags through.

Tools:

Add support infrastructure for testing touch and stylus taps when holding modifier keys.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::singleTapAtPointWithModifiers): Added.
(WTR::UIScriptController::stylusTapAtPointWithModifiers): Added.
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::singleTapAtPointWithModifiers): Added.
(WTR::UIScriptController::stylusTapAtPointWithModifiers): Added.
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::arrayLength):
(WTR::parseModifierArray):
(WTR::UIScriptController::singleTapAtPoint): Implemented in terms of singleTapAtPointWithModifiers().
(WTR::UIScriptController::singleTapAtPointWithModifiers): Added.
(WTR::UIScriptController::stylusTapAtPoint): Implemented in terms of stylusTapAtPointWithModifiers().
(WTR::UIScriptController::stylusTapAtPointWithModifiers): Added.

LayoutTests:

Refactor existing iOS key events tests to share code. Add new tests to ensure touch and mouse events
have accurate modifier key details.

* fast/events/ios/key-events-meta-alt-combinations.html:
* fast/events/ios/resources/key-tester.js:
(computeSubsets.compareByModifierOrder): Deleted.
* fast/events/resources/compute-subsets.js: Added.
(computeSubsets.compareByOriginalArrayOrder):
(computeSubsets):
* fast/events/touch/ios/mouse-events-with-modifiers-expected.txt: Added.
* fast/events/touch/ios/mouse-events-with-modifiers.html: Added.
* fast/events/touch/ios/pointer-events-with-modifiers-expected.txt: Added.
* fast/events/touch/ios/pointer-events-with-modifiers.html: Added.
* fast/events/touch/ios/touch-events-with-modifiers-expected.txt: Added.
* fast/events/touch/ios/touch-events-with-modifiers.html: Added.
* http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt: Update expected result
due to changes to ui-helper.js.
* http/tests/security/anchor-download-block-crossorigin-expected.txt: Ditto.
* platform/ios/TestExpectations:
* resources/ui-helper.js:
(window.UIHelper.tapAt.return.new.Promise):
(window.UIHelper.tapAt):
(window.UIHelper.stylusTapAt.return.new.Promise):
(window.UIHelper.stylusTapAt):

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

6 months agoSeparate out outline-style: auto user-agent appearance from Mac animated focus ring...
dbates@webkit.org [Mon, 11 Feb 2019 19:00:08 +0000 (19:00 +0000)]
Separate out outline-style: auto user-agent appearance from Mac animated focus ring drawing
https://bugs.webkit.org/show_bug.cgi?id=193591

Reviewed by Simon Fraser.

Untangle the Mac-specific concept of animated focus ring drawing from the concepts of using
the fancy shrink-wrapped focus ring appearance and using the platform focus ring color when
outline-style: auto.

No functionality changed. So, no new tests.

* platform/graphics/GraphicsContext.h:
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::drawFocusRing):
(WebCore::drawFocusRingToContextAtTime):
Change some macro guards.

* rendering/RenderElement.cpp:
(WebCore::usePlatformFocusRingColorForOutlineStyleAuto): Added.
(WebCore::useShrinkWrappedFocusRingForOutlineStyleAuto): Added.
(WebCore::drawFocusRing): Added.
(WebCore::RenderElement::paintFocusRing): Write in terms of drawFocusRing().

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

6 months agoFilter out Overconstrainederror.constraint when getUserMedia is not granted
youenn@apple.com [Mon, 11 Feb 2019 18:49:10 +0000 (18:49 +0000)]
Filter out Overconstrainederror.constraint when getUserMedia is not granted
https://bugs.webkit.org/show_bug.cgi?id=194240

Reviewed by Eric Carlson.

Source/WebKit:

Make sure in UIProcess to filter out constraint if either the page was not granted gum access or it has no persistent access.

Refactor UserMediaPermissionRequestManagerProxy to make the implementation easier to understand.

Covered by added test.

* UIProcess/UserMediaPermissionCheckProxy.cpp:
(WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
(WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
(WebKit::UserMediaPermissionRequestManagerProxy::getRequestAction):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
(WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
(WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess):
(WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest): Deleted.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
* UIProcess/UserMediaPermissionRequestProxy.h:
(WebKit::UserMediaPermissionRequestProxy::isPending const):
(WebKit::UserMediaPermissionRequestProxy::setEligibleVideoDeviceUIDs):
(WebKit::UserMediaPermissionRequestProxy::setEligibleAudioDeviceUIDs):
(WebKit::UserMediaPermissionRequestProxy::hasAudioDevice const):
(WebKit::UserMediaPermissionRequestProxy::hasVideoDevice const):
(WebKit::UserMediaPermissionRequestProxy::hasPersistentAccess const):
(WebKit::UserMediaPermissionRequestProxy::setHasPersistentAccess):
(WebKit::UserMediaPermissionRequestProxy::userMediaID const):
(WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin const):
(WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin const):
(WebKit::UserMediaPermissionRequestProxy::userRequest const):
(WebKit::UserMediaPermissionRequestProxy::setDeviceIdentifierHashSalt):
(WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt const):
(WebKit::UserMediaPermissionRequestProxy::audioDevice const):
(WebKit::UserMediaPermissionRequestProxy::videoDevice const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
* UIProcess/WebPageProxy.h:

LayoutTests:

* fast/mediastream/overconstrainederror-constraint-expected.txt: Added.
* fast/mediastream/overconstrainederror-constraint.html: Added.

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

6 months agoDumpRenderTree should report unknown options
commit-queue@webkit.org [Mon, 11 Feb 2019 18:32:42 +0000 (18:32 +0000)]
DumpRenderTree should report unknown options
https://bugs.webkit.org/show_bug.cgi?id=191303

Patch by Darshan Kadu <dkadu@igalia.com> on 2019-02-11
Reviewed by Frédéric Wang.

Added RELEASE_ASSERT_NOT_REACHED for DumpRenderTree/TestOptions.cpp
to report unknown options.
Added and assigned test options which are currently used in tests.

* DumpRenderTree/TestOptions.cpp:
(TestOptions::TestOptions):

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

6 months agoUnreviewed, rolling out r241229.
tsavell@apple.com [Mon, 11 Feb 2019 18:22:18 +0000 (18:22 +0000)]
Unreviewed, rolling out r241229.

Revision broke internal builds for watchOS.

Reverted changeset:

"[Cocoa] Ask platform for generic font family mappings"
https://bugs.webkit.org/show_bug.cgi?id=187723
https://trac.webkit.org/changeset/241229

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

6 months agoRemove the RELEASE_ASSERT check for duplicate cases in the BinarySwitch constructor.
mark.lam@apple.com [Mon, 11 Feb 2019 18:10:25 +0000 (18:10 +0000)]
Remove the RELEASE_ASSERT check for duplicate cases in the BinarySwitch constructor.
https://bugs.webkit.org/show_bug.cgi?id=194493
<rdar://problem/36380852>

Reviewed by Yusuke Suzuki.

Having duplicate cases in the BinarySwitch is not a correctness issue.  It is
however not good for performance and memory usage.  As such, a debug ASSERT will
do.  We'll also do an audit of the clients of BinarySwitch to see if it's
possible to be instantiated with duplicate cases in
https://bugs.webkit.org/show_bug.cgi?id=194492 later.

Also added some value dumps to the RELEASE_ASSERT to help debug the issue when we
see duplicate cases.

* jit/BinarySwitch.cpp:
(JSC::BinarySwitch::BinarySwitch):

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

6 months ago[WinCairo][MiniBrowser] Basic authentication always fails.
commit-queue@webkit.org [Mon, 11 Feb 2019 17:29:39 +0000 (17:29 +0000)]
[WinCairo][MiniBrowser] Basic authentication always fails.
https://bugs.webkit.org/show_bug.cgi?id=194496

Patch by Takashi Komori <Takashi.Komori@sony.com> on 2019-02-11
Reviewed by Don Olmstead.

* MiniBrowser/win/DialogHelper.h:
(Dialog::getText):

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

6 months agoMake Request constructor throw if FetchRequestInit.signal is not undefined, null...
youenn@apple.com [Mon, 11 Feb 2019 17:20:07 +0000 (17:20 +0000)]
Make Request constructor throw if FetchRequestInit.signal is not undefined, null or an AbortSignal object
https://bugs.webkit.org/show_bug.cgi?id=194404
<rdar://problem/47891915>

Reviewed by Geoffrey Garen.

Source/WebCore:

Align with the spec, except for known problematic web sites.
Covered by updated test.

* Modules/fetch/FetchRequest.cpp:
(WebCore::needsSignalQuirk):
(WebCore::processInvalidSignal):
(WebCore::FetchRequest::initializeWith):

LayoutTests:

* http/wpt/fetch/request-abort-expected.txt:

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

6 months ago[LFC] FormattingContext::Geometry::floatingHeightAndMargin should take UsedHorizontal...
zalan@apple.com [Mon, 11 Feb 2019 16:23:03 +0000 (16:23 +0000)]
[LFC] FormattingContext::Geometry::floatingHeightAndMargin should take UsedHorizontalValues
https://bugs.webkit.org/show_bug.cgi?id=194490

Reviewed by Antti Koivisto.

This is in preparation for adding floating preferred width computation support. It requires height computaiton
which uses containing block width to resolve vertical margins.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeBorderAndPadding const):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin):
* layout/FormattingContextQuirks.cpp:
(WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
* layout/LayoutUnits.h:
(WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):

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

6 months ago[LFC] FormattingContext::intrinsicWidthConstraints should compute and save the intrin...
zalan@apple.com [Mon, 11 Feb 2019 16:19:36 +0000 (16:19 +0000)]
[LFC] FormattingContext::intrinsicWidthConstraints should compute and save the intrinsic widths consistently.
https://bugs.webkit.org/show_bug.cgi?id=194483

Reviewed by Antti Koivisto.

Rename intrinsicWidthConstraints to computeIntrinsicWidthConstraints (it does not return the width values anymore).

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

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

6 months ago[WPE] Do not try to create empty egl windows
carlosgc@webkit.org [Mon, 11 Feb 2019 14:08:00 +0000 (14:08 +0000)]
[WPE] Do not try to create empty egl windows
https://bugs.webkit.org/show_bug.cgi?id=194497

Reviewed by Žan Doberšek.

In AcceleratedSurfaceWPE we ensure the size we pass to wpe is at least 0x0, but wl_egl_window_create() returns
nullptr if 0 is passed as width or height. We should use at least 1x1 instead.

* WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
(WebKit::AcceleratedSurfaceWPE::initialize):
(WebKit::AcceleratedSurfaceWPE::clientResize):

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

6 months ago[GStreamer] GstMappedBuffer testsuite build fails
commit-queue@webkit.org [Mon, 11 Feb 2019 12:14:50 +0000 (12:14 +0000)]
[GStreamer] GstMappedBuffer testsuite build fails
https://bugs.webkit.org/show_bug.cgi?id=194495

Patch by Philippe Normand <pnormand@igalia.com> on 2019-02-11
Reviewed by Carlos Garcia Campos.

Fix the build by explicitely adding the gstreamer1.0-audio include
directories to the include path.

* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/PlatformWPE.cmake:

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

6 months ago[WPE] Do not use a sync IPC message to send the host FD to the web process
carlosgc@webkit.org [Mon, 11 Feb 2019 08:12:04 +0000 (08:12 +0000)]
[WPE] Do not use a sync IPC message to send the host FD to the web process
https://bugs.webkit.org/show_bug.cgi?id=194216

Reviewed by Darin Adler.

It can be sent as a web page creation parameter instead.

* PlatformWPE.cmake:
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* SourcesWPE.txt:
* UIProcess/API/wpe/CompositingManagerProxy.cpp: Removed.
* UIProcess/API/wpe/CompositingManagerProxy.h: Removed.
* UIProcess/API/wpe/CompositingManagerProxy.messages.in: Removed.
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::hostFileDescriptor):
* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::m_backend):
* UIProcess/API/wpe/WPEView.h:
(WKWPE::View::create):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_hostFileDescriptor):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::releaseHostFileDescriptor):
* WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
(WebKit::AcceleratedSurfaceWPE::AcceleratedSurfaceWPE):
(WebKit::AcceleratedSurfaceWPE::initialize):
* WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h:
* WebProcess/WebPage/wpe/CompositingManager.cpp: Removed.
* WebProcess/WebPage/wpe/CompositingManager.h: Removed.

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

6 months agoUnreviewed WPE gardening. Adding additional baselines after font variations
zandobersek@gmail.com [Mon, 11 Feb 2019 08:06:48 +0000 (08:06 +0000)]
Unreviewed WPE gardening. Adding additional baselines after font variations
enablement. Additionally rebaselining a couple other WPT and WebGL tests.

* platform/wpe/TestExpectations:
* platform/wpe/fast/css/getComputedStyle: Added.
* platform/wpe/fast/css/getComputedStyle/computed-style-expected.txt: Added.
* platform/wpe/fast/css/getComputedStyle/computed-style-font-family-expected.txt: Added.
* platform/wpe/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: Added.
* platform/wpe/fast/dom/52776-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.any-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.any.worker-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt:
* platform/wpe/svg/css/getComputedStyle-basic-expected.txt: Added.
* platform/wpe/webgl/2.0.0/conformance/canvas/buffer-offscreen-test-expected.txt:
* platform/wpe/webgl/2.0.0/conformance/canvas/buffer-preserve-test-expected.txt:
* platform/wpe/webgl/2.0.0/conformance/context/context-attribute-preserve-drawing-buffer-expected.txt:

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

6 months ago[GTK][WPE] Add enable-javascript-markup setting
carlosgc@webkit.org [Mon, 11 Feb 2019 06:36:04 +0000 (06:36 +0000)]
[GTK][WPE] Add enable-javascript-markup setting
https://bugs.webkit.org/show_bug.cgi?id=193439

Reviewed by Michael Catanzaro.

Source/WebKit:

Expose JavaScriptMarkupEnabled setting in the GLib API.

* UIProcess/API/glib/WebKitSettings.cpp:
(webKitSettingsSetProperty):
(webKitSettingsGetProperty):
(webkit_settings_class_init):
(webkit_settings_get_enable_javascript_markup):
(webkit_settings_set_enable_javascript_markup):
* UIProcess/API/gtk/WebKitSettings.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/wpe/WebKitSettings.h:
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt:

Tools:

Add test cases to check the new setting.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp:
(testWebKitSettings):
(testWebKitSettingsJavaScriptMarkup):
(beforeAll):

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

6 months ago[LFC] Fix spelling error.
zalan@apple.com [Mon, 11 Feb 2019 06:17:53 +0000 (06:17 +0000)]
[LFC] Fix spelling error.
https://bugs.webkit.org/show_bug.cgi?id=194489

Reviewed by Simon Fraser.

instrinsic -> intrinsic

* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
* layout/FormattingState.h:
(WebCore::Layout::FormattingState::setIntrinsicWidthConstraints):
(WebCore::Layout::FormattingState::clearIntrinsicWidthConstraints):
(WebCore::Layout::FormattingState::intrinsicWidthConstraints const):
(WebCore::Layout::FormattingState::setInstrinsicWidthConstraints): Deleted.
(WebCore::Layout::FormattingState::clearInstrinsicWidthConstraints): Deleted.
(WebCore::Layout::FormattingState::instrinsicWidthConstraints const): Deleted.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::intrinsicWidthConstraints const):
(WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraintsNeedChildrenWidth):
(WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
(WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraintsNeedChildrenWidth): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints): Deleted.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::intrinsicWidthConstraints const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:

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

6 months agoSwitch uses of StringBuilder with String::format for hex numbers to use HexNumber...
darin@apple.com [Mon, 11 Feb 2019 06:02:05 +0000 (06:02 +0000)]
Switch uses of StringBuilder with String::format for hex numbers to use HexNumber.h instead
https://bugs.webkit.org/show_bug.cgi?id=194485

Reviewed by Daniel Bates.

Source/JavaScriptCore:

* heap/HeapSnapshotBuilder.cpp:
(JSC::HeapSnapshotBuilder::json): Use appendUnsignedAsHex along with
reinterpret_cast<uintptr_t> to replace uses of String::format with "%p".

* runtime/JSGlobalObjectFunctions.cpp:
(JSC::encode): Removed some unneeded casts in StringBuilder code,
including one in a call to appendByteAsHex.
(JSC::globalFuncEscape): Ditto.

Source/WebCore:

* Modules/websockets/WebSocket.cpp:
(WebCore::encodeProtocolString): Use appendUnsignedAsHexFixedSize instead of String::format.

* css/parser/CSSParserToken.cpp:
(WebCore::CSSParserToken::serialize const): Fixed style of many return statements
that called a function returning void; doesn't match WebKit's prevailing style.
Also use break instead of return. Used appendLiteral instead of append in many
cases, and append character instead of single-character literal in others.
Use appendUnsignedAsHex instead of String::format.

* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::generateHashedName): Use appendUnsignedAsHex instad of appendUnsigned64AsHex.
Should come back here and use makeString once we make HexNumber.h work with that.

* platform/mac/WebCoreNSURLExtras.mm: Removed unnecessary include of HexNumber.h.

* rendering/RenderTreeAsText.cpp:
(WebCore::quoteAndEscapeNonPrintables): Use appendLiteral instead of multiple calls
to character append. Touched because it was next to a call to appendUnsignedAsHex.

Source/WebKit:

* UIProcess/DeviceIdHashSaltStorage.cpp:
(WebKit::DeviceIdHashSaltStorage::completeDeviceIdHashSaltForOriginCall): Use
appendUnsignedAsHex instead of appendUnsigned64AsHex.

* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::loggingString): Use appendUnsignedAsHex and
reinterpret_cast<uintptr_t> instead of String::format and "%p".

Source/WTF:

* wtf/HexNumber.h: Removed unused functions placeByteAsHexCompressIfPossible and
placeByteAsHex. Can always bring them back if someone needs them. Updated
appendUnsignedAsHex to be a template so we can use it on any integer type,
got rid of unnecessary use of Vector and unnecessary reversing, and got rid of
appendUnsigned64AsHex since callers can now just use appendUnsignedAsHex.
Rewrote appendUnsignedAsHexFixedSize to share mode code rather than replicating.

* wtf/Logger.h: Use appendUnsignedAsHex instead of appendUnsigned64AsHex.

* wtf/URL.cpp: Removed unnecessary include of HexNumber.h.

* wtf/cocoa/NSURLExtras.h: Added missing include of Foundation.h that was
worked around in NSURLExtras.mm.
* wtf/cocoa/NSURLExtras.mm: Removed unnecessary includes of HexNumber.h
and Foundation.h.

Tools:

* WebKitTestRunner/TestController.cpp: Removed unnecessary include of HexNumber.h.

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

6 months agoUnreviewed, rolling out r241230.
commit-queue@webkit.org [Mon, 11 Feb 2019 04:10:08 +0000 (04:10 +0000)]
Unreviewed, rolling out r241230.
https://bugs.webkit.org/show_bug.cgi?id=194488

"It regressed JetStream2 by ~6%" (Requested by saamyjoon on
#webkit).

Reverted changeset:

"We should only make rope strings when concatenating strings
long enough."
https://bugs.webkit.org/show_bug.cgi?id=194465
https://trac.webkit.org/changeset/241230

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

6 months agoBBQ-Air: Emit better code for switch
sbarati@apple.com [Mon, 11 Feb 2019 03:25:52 +0000 (03:25 +0000)]
BBQ-Air: Emit better code for switch
https://bugs.webkit.org/show_bug.cgi?id=194053

Reviewed by Yusuke Suzuki.

Instead of emitting a linear set of jumps for Switch, this patch
makes the BBQ-Air backend emit a binary switch.

* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::addSwitch):

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

6 months agolibWPEWebKit-0.1.so: undefined reference to `JSC::JSValue::asCell() const
commit-queue@webkit.org [Mon, 11 Feb 2019 00:29:36 +0000 (00:29 +0000)]
libWPEWebKit-0.1.so: undefined reference to `JSC::JSValue::asCell() const
https://bugs.webkit.org/show_bug.cgi?id=194484

Patch by Pablo Saavedra <psaavedra@igalia.com> on 2019-02-10
Reviewed by Darin Adler.

* bindings/js/JSUndoItemCustom.cpp:

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

6 months agoUnreviewed, rolling out r241167.
commit-queue@webkit.org [Sun, 10 Feb 2019 19:44:33 +0000 (19:44 +0000)]
Unreviewed, rolling out r241167.
https://bugs.webkit.org/show_bug.cgi?id=194482

Broke the GTK mediastream tests (Requested by philn on
#webkit).

Reverted changeset:

"Filter out Overconstrainederror.constraint when getUserMedia
is not granted"
https://bugs.webkit.org/show_bug.cgi?id=194240
https://trac.webkit.org/changeset/241167

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

6 months agoUnreviewed, GTK Debug build fix after r241148.
philn@webkit.org [Sun, 10 Feb 2019 19:34:10 +0000 (19:34 +0000)]
Unreviewed, GTK Debug build fix after r241148.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::removeSamplesFromTrackBuffer):
SourceBuffer::logClassName and friends are declared for
!RELEASE_LOG_DISABLED builds so adapt calling sites accordingly.

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

6 months ago[LFC][IFC] Add intrinsic width support for inline-block boxes
zalan@apple.com [Sun, 10 Feb 2019 18:03:52 +0000 (18:03 +0000)]
[LFC][IFC] Add intrinsic width support for inline-block boxes
https://bugs.webkit.org/show_bug.cgi?id=194479

Reviewed by Antti Koivisto.

Compute the intrinsic width for the inline-block (formatting context root) and set it as the content box width while
laying out the content for the min/max width.

<div style="position: absolute">before<span id=inline-block style="display: inline-block">inline_block content<span>after</div>

The "inline-block" formatting root returns "inline_block" width for the minimum and "inline_block width" for
the maximum width. These min/max values are used to figure out the intrinsic width for the parent <div>.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::computeMargin const):
* layout/inlineformatting/InlineFormattingContext.h:
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

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

6 months ago[LFC][IFC] Add intrinsic width support for replaced boxes
zalan@apple.com [Sun, 10 Feb 2019 16:53:41 +0000 (16:53 +0000)]
[LFC][IFC] Add intrinsic width support for replaced boxes
https://bugs.webkit.org/show_bug.cgi?id=194478

Reviewed by Antti Koivisto.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
(WebCore::Layout::InlineFormattingContext::computeMargin const):
(WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const):
(WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:

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

6 months ago[MSE][GStreamer] Add missing return type to lambda
aboya@igalia.com [Sun, 10 Feb 2019 14:38:26 +0000 (14:38 +0000)]
[MSE][GStreamer] Add missing return type to lambda
https://bugs.webkit.org/show_bug.cgi?id=194414

Reviewed by Darin Adler.

Since g_signal_connect() is untyped, a compiler error was not
generated when a lambda with a missing GstFlowReturn return type was
provided for a signal that expects it.

This used to work before r240784 because a recent function call had
set GST_FLOW_OK in the return value register and it happened to
survive until the lambda function call ended. Starting on that commit
such return value was removed and it stopped working on debug.

Of course, the actual problem is in the signature of the lambda
function, and this patch fixes that.

* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline):

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

6 months agoAdd more tests for clampTo<>()
benjamin@webkit.org [Sun, 10 Feb 2019 00:41:55 +0000 (00:41 +0000)]
Add more tests for clampTo<>()
https://bugs.webkit.org/show_bug.cgi?id=194462

Reviewed by Geoffrey Garen.

Darin suggested to test the very last floating point number
at the boundaries when truncating to integer.
I added test for max/min and max-1/min-1.

* TestWebKitAPI/Tests/WTF/MathExtras.cpp:
(TestWebKitAPI::TEST):

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

6 months agoUnreviewed, Lexer should use isLatin1 implementation in WTF
ysuzuki@apple.com [Sat, 9 Feb 2019 23:16:01 +0000 (23:16 +0000)]
Unreviewed, Lexer should use isLatin1 implementation in WTF
https://bugs.webkit.org/show_bug.cgi?id=194466

Follow-up after r241233 pointed by Darin.

* parser/Lexer.cpp:
(JSC::isLatin1): Deleted.

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

6 months agoFix change log dates; I thought webkit-patch land would do it for me
darin@apple.com [Sat, 9 Feb 2019 21:00:10 +0000 (21:00 +0000)]
Fix change log dates; I thought webkit-patch land would do it for me

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

6 months agoEliminate unnecessary String temporaries by using StringConcatenateNumbers
darin@apple.com [Sat, 9 Feb 2019 21:00:05 +0000 (21:00 +0000)]
Eliminate unnecessary String temporaries by using StringConcatenateNumbers
https://bugs.webkit.org/show_bug.cgi?id=194021

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* inspector/agents/InspectorConsoleAgent.cpp:
(Inspector::InspectorConsoleAgent::count): Remove String::number and let
makeString do the conversion without allocating/destroying a String.
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::objectGroupForBreakpointAction): Ditto.
(Inspector::InspectorDebuggerAgent::setBreakpointByUrl): Ditto.
(Inspector::InspectorDebuggerAgent::setBreakpoint): Ditto.
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::defineOwnProperty): Ditto.
* runtime/NumberPrototype.cpp:
(JSC::numberProtoFuncToFixed): Use String::numberToStringFixedWidth instead
of calling numberToFixedWidthString to do the same thing.
(JSC::numberProtoFuncToPrecision): Use String::number instead of calling
numberToFixedPrecisionString to do the same thing.
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::reportTopFunctions): Ditto.

Source/WebCore:

For floating point numbers, String::number gives a fixed precision result,
stripping trailing zeroes. When possible, I changed the code to instead use the
equivalent of String::numberToStringECMAScript, which is what makeString does by
default for floating point, gives the same results for many cases, and gives
better results in many others. However, for floats, we do not yet have a good
implementation, so instead I used FormattedNumber::fixedPrecision to match
the old behavior.

* Modules/indexeddb/shared/IDBTransactionInfo.cpp:
(WebCore::IDBTransactionInfo::loggingString const): Remove String::number and let
makeString do the conversion without allocating/destroying a String.
* Modules/websockets/ThreadableWebSocketChannel.cpp:
(WebCore::ThreadableWebSocketChannel::create): Ditto.
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect): Ditto. Added a cast to "unsigned" to sidestep the
ambiguity with 16-bit unsigned types that are sometimes used for numbers (uint16_t)
and sometimes used for UTF-16 code units (UChar) and can be the same type.

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::didFailSocketStream): Use ASCIILiteral when intializing
a string instead of just a normal C literal. Switched to makeString so we could
remove String::number and do the conversion without allocating/destroying a String.
(WebCore::WebSocketChannel::didFail): Ditto.
(WebCore::WebSocketChannel::processFrame): Ditto.
* Modules/websockets/WebSocketFrame.cpp:
(WebCore::WebSocketFrame::parseFrame): Ditto.
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::readServerHandshake): Ditto.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::positionalDescriptionForMSAA const): Ditto.
* bindings/js/JSDOMConvertNumbers.cpp:
(WebCore::rangeErrorString): Ditto.
* css/CSSAspectRatioValue.cpp:
(WebCore::CSSAspectRatioValue::customCSSText const): Ditto. Used
FormattedNumber::fixedPrecision since these are floats.

* css/DOMMatrixReadOnly.cpp:
(WebCore::DOMMatrixReadOnly::toString const): Use
StringBuilder::builder.appendECMAScriptNumber instead of
String::numberToStringECMAScript so we can do it without allocating/destroying
a String.
* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::toString const): Ditto.

* dom/MessagePortIdentifier.h:
(WebCore::MessagePortIdentifier::logString const): Remove String::number and let
makeString do the conversion without allocating/destroying a String.

* editing/cocoa/DataDetection.mm:
(WebCore::dataDetectorStringForPath): Remove unnecessary type casts on values
passed to String::number and to StringBuilder::appendNumber. These could do
harm if the values were out of range, and should not be necessary.

* history/BackForwardItemIdentifier.h:
(WebCore::BackForwardItemIdentifier::logString const): Remove String::number
and let makeString do the conversion without allocating/destroying a String.
* html/FTPDirectoryDocument.cpp:
(WebCore::processFileDateString): Ditto.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::getUniformLocation): Ditto.
(WebCore::WebGLRenderingContextBase::checkTextureCompleteness): Ditto.
* inspector/agents/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::didReceiveResponse): Ditto.
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::loadResourceSynchronously): Ditto.
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didFailLoadingManifest): Ditto.
* page/PageSerializer.cpp:
(WebCore::PageSerializer::urlForBlankFrame): Ditto.
* page/PrintContext.cpp:
(WebCore::PrintContext::pageProperty): Ditto.
(WebCore::PrintContext::pageSizeAndMarginsInPixels): Ditto.

* page/WheelEventTestTrigger.cpp:
(WebCore::dumpState): Use StringBuilder::appendNumber instead of
String::number so we can do it without allocating/destroying a String.
Also use StringBuilder::appendLiteral on a literal.

* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::ResourceUsageOverlay::platformDraw): Pass explicit
KeepTrailingZeros to FormattedNumber::fixedPrecision to preserve behavior,
since default is now to truncate trailing zeros.

* platform/graphics/Color.cpp:
(WebCore::Color::cssText): Use StringBuilder::appendNumber instead of
calling numberToFixedPrecisionString to do the same thing.
* platform/graphics/ExtendedColor.cpp:
(WebCore::ExtendedColor::cssText): Ditto.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::animationIdentifier): Remove String::number and let makeString
do the conversion without allocating/destroying a String. Had to add
a typecast to convert the enumeration into an integer.
* platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
(WebCore::PlatformCAFilters::setFiltersOnLayer): Ditto.
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::description const): Ditto.

* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockMediaSample::MockMediaSample): Use AtomicString::number
instead of String::number to avoid unneccessarily allocating an additional
temporary String when an AtomicString already exists.

* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::reportErrorToClient): Remove String::number
and let makeString do the conversion without allocating/destroying a String.
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::setMaximumSize): Ditto.
(WebCore::SQLiteDatabase::setSynchronous): Ditto. Had to add a typecast to
convert the enumeration into an integer.
* svg/SVGAngleValue.cpp:
(WebCore::SVGAngleValue::valueAsString const): Ditto.
* svg/SVGLengthValue.cpp:
(WebCore::SVGLengthValue::valueAsString const): Ditto.
* testing/Internals.cpp:
(WebCore::Internals::configurationForViewport): Ditto. Used
FormattedNumber::fixedPrecision since these are floats.
(WebCore::Internals::getCurrentCursorInfo): Use StringBuilder::appendNumber
instead of calling numberToFixedPrecisionString to do the same thing.
(WebCore::Internals::queueMicroTask): Remove String::number and let makeString
do the conversion without allocating/destroying a String.
(WebCore::appendOffsets): Use StringBuilder::appendNumber instead of
String::number so we can do it without allocating/destroying a String.

* workers/service/ServiceWorkerClientIdentifier.h:
(WebCore::ServiceWorkerClientIdentifier::toString const): Remove String::number
and let makeString do the conversion without allocating/destroying a String.
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::databaseFilenameFromVersion): Ditto.

Source/WebKit:

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::escapeIDForJSON): Use an ASCIILiteral to create a String.

* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::makeVersionedDirectoryPath): Remove String::number and let
makeString do the conversion without allocating/destroying a String.

* NetworkProcess/mac/RemoteNetworkingContext.mm: Removed "using namespace WebCore".
(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): Remove String::number
and let makeString do the conversion without allocating/destroying a String.

* NetworkProcess/webrtc/NetworkMDNSRegister.cpp: Removed "using namespace WebCore".
(WebKit::registerMDNSNameCallback): Added explicit WebCore prefix as needed.
(WebKit::NetworkMDNSRegister::registerMDNSName): Ditto. Also remove String::number
and let makeString do the conversion without allocating/destroying a String.

* UIProcess/WebPageGroup.cpp:
(WebKit::pageGroupData): Remove String::number and let makeString do the conversion
without allocating/destroying a String.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::createInspectorTargets): Ditto.
* UIProcess/ios/WKLegacyPDFView.mm:
(-[WKLegacyPDFView _URLForLinkAnnotation:]): Ditto.
* WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
(WebKit::uniqueWorldName): Ditto.
* WebProcess/WebPage/WebPageInspectorTarget.cpp:
(WebKit::WebPageInspectorTarget::identifier const): Ditto.

Source/WTF:

* wtf/URL.cpp:
(WTF::URL::setPort): Remove String::number and let makeString do the conversion
without allocating/destroying a String. Added a cast to "unsigned" to sidestep the
ambiguity with 16-bit unsigned types that are sometimes used for numbers (uint16_t)
and sometimes used for UTF-16 code units (UChar) and can be the same type.

* wtf/text/StringConcatenateNumbers.h:
Changed FormattedNumber::fixedPrecision to more closely match String::number and
StringBuilder::appendNumber by defaulting to truncating trailing zeros and using
a named enumeration for the truncation policy rather than a boolean.

Tools:

* TestWebKitAPI/Tests/WTF/StringConcatenate.cpp:
(TestWebKitAPI::TEST): Change tests to use EXPECT_STREQ so failure messages are easier
to understand. Updated tests for changes to FormattedNumber::fixedPrecision.

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

6 months ago[LFC][IFC] Add intrinsic width support for basic inline containers
zalan@apple.com [Sat, 9 Feb 2019 20:37:03 +0000 (20:37 +0000)]
[LFC][IFC] Add intrinsic width support for basic inline containers
https://bugs.webkit.org/show_bug.cgi?id=194473

Reviewed by Antti Koivisto.

Source/WebCore:

Preferred width computation logic is very similar to normal layout.
One of the main difference is that the preferred width codepath does not provide valid containing block width.
This patch implement basic inline container support by passing nullopt containing block width in UsedHorizontalValues.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
(WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const):
(WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const):
* layout/inlineformatting/InlineFormattingContext.h:

Tools:

Expand tests coverage (11 new tests -> 798)

* LayoutReloaded/misc/LFC-passing-tests.txt: not sure why run-singly keeps producing different ordering.

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

6 months agoUnreviewed, rolling in r241237 again
ysuzuki@apple.com [Sat, 9 Feb 2019 19:44:06 +0000 (19:44 +0000)]
Unreviewed, rolling in r241237 again
https://bugs.webkit.org/show_bug.cgi?id=194469

Source/JavaScriptCore:

* runtime/JSString.h:
(JSC::jsSubstring):

Source/WTF:

After the measurement, this patch was unrelated to recent regression.

* wtf/text/StringImpl.h:
(WTF::StringImpl::isSubString const):
(WTF::StringImpl::createSubstringSharingImpl):

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

6 months agoUnreviewed, rolling out r241237.
commit-queue@webkit.org [Sat, 9 Feb 2019 17:52:38 +0000 (17:52 +0000)]
Unreviewed, rolling out r241237.
https://bugs.webkit.org/show_bug.cgi?id=194474

Shows significant memory increase in WSL (Requested by
yusukesuzuki on #webkit).

Reverted changeset:

"[WTF] Use BufferInternal StringImpl if substring StringImpl
takes more memory"
https://bugs.webkit.org/show_bug.cgi?id=194469
https://trac.webkit.org/changeset/241237

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

6 months ago[GTK] Fix typo in the newly added API
mcatanzaro@igalia.com [Sat, 9 Feb 2019 16:04:09 +0000 (16:04 +0000)]
[GTK] Fix typo in the newly added API
https://bugs.webkit.org/show_bug.cgi?id=194472

Patch by Alexander Mikhaylenko <exalm7659@gmail.com> on 2019-02-09
Reviewed by Michael Catanzaro.

Fix a typo: enableed -> enabled.

* UIProcess/API/glib/WebKitSettings.cpp:
(webkit_settings_set_enable_back_forward_navigation_gestures):
* UIProcess/API/gtk/WebKitSettings.h:

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

6 months agoWeb Inspector: fix typos in tests
nvasilyev@apple.com [Sat, 9 Feb 2019 09:39:20 +0000 (09:39 +0000)]
Web Inspector: fix typos in tests

Unreviewed test gardening.

* inspector/css/force-page-appearance.html:

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

6 months agoFix MiniBrowser's entitlements
benjamin@webkit.org [Sat, 9 Feb 2019 08:11:04 +0000 (08:11 +0000)]
Fix MiniBrowser's entitlements
https://bugs.webkit.org/show_bug.cgi?id=192431

Reviewed by Joseph Pecoraro.

MiniBrowser's Extensions Manager was broken. The entitlement was missing for opening
files, making it impossible to load any extension.

* MiniBrowser/MiniBrowser.entitlements:

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

6 months ago[WTF] Use BufferInternal StringImpl if substring StringImpl takes more memory
ysuzuki@apple.com [Sat, 9 Feb 2019 07:58:01 +0000 (07:58 +0000)]
[WTF] Use BufferInternal StringImpl if substring StringImpl takes more memory
https://bugs.webkit.org/show_bug.cgi?id=194469

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* runtime/JSString.h:
(JSC::jsSubstring):

Source/WTF:

Because pointer is large and aligned in 64bit in 64bit architecture, BufferSubstring StringImpl
implementation takes more memory than BufferInternal StringImpl implementation for small strings.
And BufferInternal StringImpl does not have a problem like, small substring StringImpl keeps super
large owner StringImpl. This patch calculates the required size of memory and selects the more efficient one.

* wtf/text/StringImpl.h:
(WTF::StringImpl::isSubString const):
(WTF::StringImpl::createSubstringSharingImpl):

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

6 months ago[JSC] CachedTypes should use jsString instead of JSString::create
ysuzuki@apple.com [Sat, 9 Feb 2019 07:43:26 +0000 (07:43 +0000)]
[JSC] CachedTypes should use jsString instead of JSString::create
https://bugs.webkit.org/show_bug.cgi?id=194471

Reviewed by Mark Lam.

Use jsString() here because JSString::create is a bit low-level API and it requires some invariant like "length is not zero".

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

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

6 months agoSpeculative fix for Mojave API test after r241223
achristensen@apple.com [Sat, 9 Feb 2019 07:04:47 +0000 (07:04 +0000)]
Speculative fix for Mojave API test after r241223
https://bugs.webkit.org/show_bug.cgi?id=194427

* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(WebKit::XPCInitializationHandler):
(WebKit::XPCServiceMain):
Set the __APPLEEVENTSSERVICENAME environment variable before handling any xpc messages like we used to.
I'll worry about making things right in the daemon later.

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

6 months ago[JSC] Increase StructureIDTable initial capacity
ysuzuki@apple.com [Sat, 9 Feb 2019 07:01:14 +0000 (07:01 +0000)]
[JSC] Increase StructureIDTable initial capacity
https://bugs.webkit.org/show_bug.cgi?id=194468

Reviewed by Mark Lam.

Currently, # of structures just after initializing JSGlobalObject (precisely, initializing GlobalObject in
JSC shell), 281, already exceeds the current initial value 256. We should increase the capacity since
unnecessary resizing requires more operations, keeps old StructureID array until GC happens, and makes
more memory dirty. We also remove some structures that are no longer used.

* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::callbackObjectStructure const):
(JSC::JSGlobalObject::propertyNameIteratorStructure const): Deleted.
* runtime/StructureIDTable.h:
* runtime/VM.h:

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

6 months ago[JSC] String.fromCharCode's slow path always generates 16bit string
ysuzuki@apple.com [Sat, 9 Feb 2019 04:40:22 +0000 (04:40 +0000)]
[JSC] String.fromCharCode's slow path always generates 16bit string
https://bugs.webkit.org/show_bug.cgi?id=194466

Reviewed by Keith Miller.

JSTests:

* stress/string-from-char-code-slow-path.js: Added.
(shouldBe):
(testWithLength):

Source/JavaScriptCore:

String.fromCharCode(a1) has a fast path and the most frequently used. And String.fromCharCode(a1, a2, ...)
goes to the slow path. However, in the slow path, we always create 16bit string. 16bit string takes 2x memory,
and even worse, taints ropes 16bit if 16bit string is included in the given rope. We find that acorn-wtb
creates very large strings multiple times with String.fromCharCode, and String.fromCharCode always produces
16bit string. However, only few strings are actually 16bit strings. This patch attempts to make 8bit string
as much as possible.

It improves non JIT acorn-wtb's peak and current memory footprint by 6% and 3% respectively.

* runtime/StringConstructor.cpp:
(JSC::stringFromCharCode):

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

6 months ago[WK2][macOS] Avoid creating new CVDisplayLink objects for each WebProcess
cdumez@apple.com [Sat, 9 Feb 2019 04:36:57 +0000 (04:36 +0000)]
[WK2][macOS] Avoid creating new CVDisplayLink objects for each WebProcess
https://bugs.webkit.org/show_bug.cgi?id=194463

Reviewed by Tim Horton.

Avoid creating new CVDisplayLink objects for each WebProcess. We really only need one per
display, creating such object is expensive and it is even worse in a PSON world where we
swap process on navigation.

This patch moves the DisplayLink storing from WebProcessProxy to WebProcessPool. Also,
a DisplayLink can now be associated to several IPC connections instead of having a 1:1
mapping. When a DisplayLink no longer has any observers, we now merely stop it instead
of destroying it.

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::startDisplayLink):
(WebKit::WebProcessPool::stopDisplayLink):
(WebKit::WebProcessPool::stopDisplayLinks):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::~WebProcessProxy):
(WebKit::WebProcessProxy::processWillShutDown):
(WebKit::WebProcessProxy::shutDown):
* UIProcess/WebProcessProxy.h:
* UIProcess/mac/DisplayLink.cpp:
(WebKit::DisplayLink::DisplayLink):
(WebKit::DisplayLink::addObserver):
(WebKit::DisplayLink::removeObserver):
(WebKit::DisplayLink::removeObservers):
(WebKit::DisplayLink::hasObservers const):
(WebKit::DisplayLink::displayLinkCallback):
* UIProcess/mac/DisplayLink.h:
* UIProcess/mac/WebProcessProxyMac.mm:
(WebKit::WebProcessProxy::startDisplayLink):
(WebKit::WebProcessProxy::stopDisplayLink):

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

6 months ago[Cocoa] CTLineGetGlyphRuns() might return nullptr
mmaxfield@apple.com [Sat, 9 Feb 2019 04:06:34 +0000 (04:06 +0000)]
[Cocoa] CTLineGetGlyphRuns() might return nullptr
https://bugs.webkit.org/show_bug.cgi?id=194467
<rdar://problem/42423999>

Reviewed by Simon Fraser.

Be somewhat defensive to try to make sure this sort of thing doesn't happen in the future.

Covered by find/text/find-backwards.html

* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):

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

6 months agoWe should only make rope strings when concatenating strings long enough.
keith_miller@apple.com [Sat, 9 Feb 2019 03:56:32 +0000 (03:56 +0000)]
We should only make rope strings when concatenating strings long enough.
https://bugs.webkit.org/show_bug.cgi?id=194465

Reviewed by Saam Barati.

This patch stops us from allocating a rope string if the resulting
rope would be smaller than the size of the JSRopeString object we
would need to allocate.

This patch also adds paths so that we don't unnecessarily allocate
JSString cells for primitives we are going to concatenate with a
string anyway.

* dfg/DFGOperations.cpp:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/JSString.h:
* runtime/Operations.cpp:
(JSC::jsAddSlowCase):
* runtime/Operations.h:
(JSC::jsString):
(JSC::jsAdd):

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

6 months ago[Cocoa] Ask platform for generic font family mappings
mmaxfield@apple.com [Sat, 9 Feb 2019 03:42:23 +0000 (03:42 +0000)]
[Cocoa] Ask platform for generic font family mappings
https://bugs.webkit.org/show_bug.cgi?id=187723
<rdar://problem/41892438>

Reviewed by Brent Fulgham.

Source/WebCore:

WebKit API allows setting the generic font families for the USCRIPT_COMMON script.
When trying to style a character with a generic font family, we first look to see if
we have a mapping for the particular script the character is rendered with, and if we
don't find a match, we then check USCRIPT_COMMON.

In the Cocoa ports, the only way families get set for non-USCRIPT_COMMON scripts (aka
the only scripts which won't use the API families) is in
SettingsBase::initializeDefaultFontFamilies(). That function only sets the families
for the CJK scripts.

The mappings inside SettingsBase are incorrect and conflict with our policy regarding
user-installed fonts. Instead, we should be consulting with the platform for some of
these mappings, by calling CTFontDescriptorCreateForCSSFamily(). However, the WebKit
API still has to work to set the mappings for untagged content. Therefore, we use the
system mappings for language-tagged content, and the API mappings for non-language-tagged
content. This is a good balance that makes sure we always have a good mapping for every
language, but API clients can still set the mappings, too.

Test: fast/text/ja-sans-serif.html

* css/CSSComputedStyleDeclaration.cpp:
* css/CSSFontSelector.cpp:
(WebCore::resolveGenericFamily):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontFamily):
* page/cocoa/SettingsBaseCocoa.mm:
(WebCore::SettingsBase::initializeDefaultFontFamilies):
(WebCore::osakaMonoIsInstalled): Deleted.
* platform/graphics/FontDescription.cpp:
(WebCore::FontDescription::platformResolveGenericFamily):
* platform/graphics/FontDescription.h:
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::computeSpecializedChineseLocale):
(WebCore::cachedSpecializedChineseLocale):
(WebCore::languageChanged):
(WebCore::FontDescription::platformResolveGenericFamily):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::SystemFontDatabaseCoreText::clear):
(WebCore::SystemFontDatabaseCoreText::serifFamily):
(WebCore::SystemFontDatabaseCoreText::sansSerifFamily):
(WebCore::SystemFontDatabaseCoreText::cursiveFamily):
(WebCore::SystemFontDatabaseCoreText::fantasyFamily):
(WebCore::SystemFontDatabaseCoreText::monospaceFamily):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.h:

Source/WebCore/PAL:

* pal/spi/cocoa/CoreTextSPI.h:

Tools:

Allow testing infrastructure to use fonts that are returned from CTFontDescriptorCreateForCSSFamily().

* DumpRenderTree/mac/DumpRenderTree.mm:
(allowedFontFamilySet):
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::allowedFontFamilySet):

LayoutTests:

Update the tests to work with this new model.

* fast/text/international/font-fallback-to-common-script-expected.html: Removed.
* fast/text/international/font-fallback-to-common-script.html: Removed. This test is no longer testing
anything relevant.
* fast/text/international/lang-sensitive-fonts-expected.html:
* fast/text/international/lang-sensitive-fonts-xml-expected.html:
* fast/text/international/lang-sensitive-fonts-xml.xhtml:
* fast/text/international/lang-sensitive-fonts.html:
* fast/text/international/locale-sensitive-fonts-expected.html:
* fast/text/international/locale-sensitive-fonts.html:
* fast/text/ja-sans-serif-expected-mismatch.html: Added.
* fast/text/ja-sans-serif.html: Added.

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

6 months agoNodes that rely on being dominated by CheckInBounds should have a child edge to it
sbarati@apple.com [Sat, 9 Feb 2019 03:05:40 +0000 (03:05 +0000)]
Nodes that rely on being dominated by CheckInBounds should have a child edge to it
https://bugs.webkit.org/show_bug.cgi?id=194334
<rdar://problem/47844327>

Reviewed by Mark Lam.

JSTests:

* stress/check-in-bounds-should-be-a-child-use.js: Added.
(func):

Source/JavaScriptCore:

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGArgumentsEliminationPhase.cpp:
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::convertToHasIndexedProperty):
* dfg/DFGIntegerCheckCombiningPhase.cpp:
(JSC::DFG::IntegerCheckCombiningPhase::handleBlock):
* dfg/DFGIntegerRangeOptimizationPhase.cpp:
* dfg/DFGNodeType.h:
* dfg/DFGSSALoweringPhase.cpp:
(JSC::DFG::SSALoweringPhase::lowerBoundsCheck):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileHasIndexedProperty):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCheckInBounds):
(JSC::FTL::DFG::LowerDFGToB3::compileHasIndexedProperty):

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

6 months agoWeb Inspector: Audit: show keyboard shortcut in export tooltip
drousso@apple.com [Sat, 9 Feb 2019 02:31:52 +0000 (02:31 +0000)]
Web Inspector: Audit: show keyboard shortcut in export tooltip
https://bugs.webkit.org/show_bug.cgi?id=194454

Reviewed by Matt Baker.

* UserInterface/Views/AuditTestContentView.js:
(WI.AuditTestContentView):
(WI.AuditTestContentView.prototype.get saveData):
(WI.AuditTestContentView.prototype._exportResult): Added.
(WI.AuditTestContentView.prototype._handleExportButtonNavigationItemClicked):
(WI.AuditTestContentView.prototype._exportAudit): Deleted.

* Localizations/en.lproj/localizedStrings.js:

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

6 months agoWeb Inspector: Styles: easier way to select a single line
nvasilyev@apple.com [Sat, 9 Feb 2019 01:47:08 +0000 (01:47 +0000)]
Web Inspector: Styles: easier way to select a single line
https://bugs.webkit.org/show_bug.cgi?id=193305

Reviewed by Devin Rousso.

Start property selection after mousedown when mouse cursor moves 8px,
which is ~1.5 times the width of a text character in the style editor.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleMouseDown):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleWindowMouseMove): Added.
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._stopSelection):

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

6 months agoWeb Inspector: Debugger Popover should work with value in template string `${identifier}`
commit-queue@webkit.org [Sat, 9 Feb 2019 01:30:16 +0000 (01:30 +0000)]
Web Inspector: Debugger Popover should work with value in template string `${identifier}`
https://bugs.webkit.org/show_bug.cgi?id=194459
<rdar://problem/47932564>

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

* UserInterface/Controllers/CodeMirrorTokenTrackingController.js:
(WI.CodeMirrorTokenTrackingController.prototype._processJavaScriptExpression):
When walking backwards to get the full expression we were walking outside
of the interpolation group `outside ${inside}`. Stop walking backwards once
we cross the boundary.

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

6 months ago[GTK] Implement back/forward touchpad gesture
commit-queue@webkit.org [Sat, 9 Feb 2019 01:29:22 +0000 (01:29 +0000)]
[GTK] Implement back/forward touchpad gesture
https://bugs.webkit.org/show_bug.cgi?id=193919

Patch by Alexander Mikhaylenko <exalm7659@gmail.com> on 2019-02-08
Reviewed by Michael Catanzaro.

Source/WebKit:

Move ViewSnapshotStore and ViewGestureController from Cocoa/Mac directory
to UIProcess/, also move some parts of mac/ViewGestreControllerMac.mm to
ViewGestureController.cpp, split up Mac- and iOS-specific parts of
ViewSnapshotStore.cpp into mac/ViewSnapshotMac.mm, then implement 2-finger
touchpad swipe back-forward gesture for GTK based on that.

To avoid name conflict, rename existing ViewGestureController class inside
UIProcess/API/gtk/WebKitWebViewBase.cpp into TouchGestureController.

Since GTK gestures can only work with 3 or 4 fingers, treat horizontal
scrolling events as a swipe as long as there's nowhere to scroll in that
direction and web page doesn't handle the scrolling.

This is only allowed for touchpads, even though it can theoretically work
with touch mice and trackpoints.

The gesture requires every item in back-forward list to have a snapshot.
There's already an existing infrastructure for that, so the patch changes
a bunch of #if PLATFORM(COCOA) statements to also check for GTK platform.
The snapshots have to be taken in sync, so the implementation draws webview
widget into a Cairo image surface.

The gesture is disabled by default, and can be enabled by setting the newly
added 'enable-back-forward-navigation-gestures' property in WebKitSettings to
true.

Gesture drawing is implemented via Cairo. When the gesture is active, the
actual page is drawn into a Cairo group, which is then drawn together with
a given snapshot, as well as dimming and a drop shadow over the "lower" layer.

Also add a memory pressure handler that clears snapshot store when low on memory.

* DerivedSources-input.xcfilelist:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* Shared/SessionState.h: Add snapshot to back-forward items for GTK.
* Shared/WebBackForwardListItem.h: Add snapshot to back-forward items for GTK.
* SourcesCocoa.txt:
* SourcesGTK.txt:
* UIProcess/API/glib/WebKitSettings.cpp:
Added 'enable-back-forward-navigation-gestures' property for enabling the gesture.
(webKitSettingsSetProperty):
(webKitSettingsGetProperty):
(webkit_settings_class_init):
(webkit_settings_get_enable_back_forward_navigation_gestures): Added, GTK only.
(webkit_settings_set_enable_back_forward_navigation_gestures): Added, GTK only.
* UIProcess/API/glib/WebKitWebView.cpp:
(enableBackForwardNavigationGesturesChanged): Added, GTK only.
(webkitWebViewUpdateSettings):
(webkitWebViewDisconnectSettingsSignalHandlers):
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::setViewNeedsDisplay): Redraw the whole screen instead of a region during the gesture.
(WebKit::PageClientImpl::takeViewSnapshot): Added.
(WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore): Pass unhandled events to the gesture controller.
(WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot): Redraw the widget immediately after removing snapshot.
(WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame): Added, send a notification to the gesture controller.
(WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame):  Send a notification to the gesture controller.
(WebKit::PageClientImpl::didFinishLoadForMainFrame):  Send a notification to the gesture controller.
(WebKit::PageClientImpl::didFailLoadForMainFrame):  Added, send a notification to the gesture controller.
(WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame):  Send a notification to the gesture controller.
(WebKit::PageClientImpl::didRestoreScrollPosition):  Added, send a notification to the gesture controller.
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/gtk/WebKitSettings.h:
Add webkit_settings_get_enable_back_forward_navigation_gestures() and webkit_settings_get_enable_back_forward_navigation_gestures()
to public API.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseDraw): Pass drawing to ViewGestureController during the gesture.
(webkitWebViewBaseScrollEvent): Pass scroll events to ViewGestureController during the gesture.
(webkitWebViewBaseGestureController): Renamed ViewGestureController to TouchGestureController.
(webkitWebViewBaseViewGestureController): Added.
(webkitWebViewBaseCreateWebPage): Create an instance of ViewGestureController.
(webkitWebViewBaseTakeViewSnapshot): Added.
(webkitWebViewBaseDidStartProvisionalLoadForMainFrame): Added.
(webkitWebViewBaseDidFirstVisuallyNonEmptyLayoutForMainFrame): Added.
(webkitWebViewBaseDidFinishLoadForMainFrame): Added.
(webkitWebViewBaseDidFailLoadForMainFrame): Added.
(webkitWebViewBaseDidSameDocumentNavigationForMainFrame): Added.
(webkitWebViewBaseDidRestoreScrollPosition): Added.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Mentioned the added functions in docs.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitialize): Move the check from WebMemoryPressureHandlerCocoa.mm here.
* UIProcess/PageClient.h: Add takeViewSnapshot() for GTK.
* UIProcess/ViewGestureController.cpp: Renamed from Source/WebKit/UIProcess/Cocoa/ViewGestureController.cpp.
(WebKit::ViewGestureController::ViewGestureController):
(WebKit::ViewGestureController::~ViewGestureController):
(WebKit::ViewGestureController::disconnectFromProcess):
(WebKit::ViewGestureController::connectToProcess):
(WebKit::ViewGestureController::controllerForGesture):
(WebKit::ViewGestureController::takeNextGestureID):
(WebKit::ViewGestureController::willBeginGesture):
(WebKit::ViewGestureController::didEndGesture):
(WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
(WebKit::ViewGestureController::canSwipeInDirection const):
(WebKit::ViewGestureController::didStartProvisionalOrSameDocumentLoadForMainFrame):
(WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
(WebKit::ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame):
(WebKit::ViewGestureController::didRepaintAfterNavigation):
(WebKit::ViewGestureController::didHitRenderTreeSizeThreshold):
(WebKit::ViewGestureController::didRestoreScrollPosition):
(WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
(WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
(WebKit::ViewGestureController::checkForActiveLoads):
(WebKit::ViewGestureController::SnapshotRemovalTracker::SnapshotRemovalTracker):
(WebKit::ViewGestureController::SnapshotRemovalTracker::eventsDescription):
(WebKit::ViewGestureController::SnapshotRemovalTracker::log const):
(WebKit::ViewGestureController::SnapshotRemovalTracker::resume):
(WebKit::ViewGestureController::SnapshotRemovalTracker::start):
(WebKit::ViewGestureController::SnapshotRemovalTracker::reset):
(WebKit::ViewGestureController::SnapshotRemovalTracker::stopWaitingForEvent):
(WebKit::ViewGestureController::SnapshotRemovalTracker::eventOccurred):
(WebKit::ViewGestureController::SnapshotRemovalTracker::cancelOutstandingEvent):
(WebKit::ViewGestureController::SnapshotRemovalTracker::hasOutstandingEvent):
(WebKit::ViewGestureController::SnapshotRemovalTracker::fireRemovalCallbackIfPossible):
(WebKit::ViewGestureController::SnapshotRemovalTracker::fireRemovalCallbackImmediately):
(WebKit::ViewGestureController::SnapshotRemovalTracker::watchdogTimerFired):
(WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
(WebKit::deltaShouldCancelSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::handleEvent):
(WebKit::ViewGestureController::PendingSwipeTracker::eventWasNotHandledByWebCore):
(WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::reset):
(WebKit::ViewGestureController::startSwipeGesture):
(WebKit::ViewGestureController::isPhysicallySwipingLeft const):
(WebKit::ViewGestureController::shouldUseSnapshotForSize):
(WebKit::ViewGestureController::forceRepaintIfNeeded):
(WebKit::ViewGestureController::willEndSwipeGesture):
(WebKit::ViewGestureController::endSwipeGesture):
(WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded):
* UIProcess/ViewGestureController.h: Renamed from Source/WebKit/UIProcess/Cocoa/ViewGestureController.h.
(WebKit::ViewGestureController::wheelEventWasNotHandledByWebCore):
(WebKit::ViewGestureController::shouldIgnorePinnedState):
(WebKit::ViewGestureController::setShouldIgnorePinnedState):
(WebKit::ViewGestureController::hasActiveMagnificationGesture const):
(WebKit::ViewGestureController::setCustomSwipeViews):
(WebKit::ViewGestureController::setCustomSwipeViewsTopContentInset):
(WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback):
(WebKit::ViewGestureController::backgroundColorForCurrentSnapshot const):
(WebKit::ViewGestureController::didFinishLoadForMainFrame):
(WebKit::ViewGestureController::didFailLoadForMainFrame):
(WebKit::ViewGestureController::setSwipeGestureEnabled):
(WebKit::ViewGestureController::isSwipeGestureEnabled):
(WebKit::ViewGestureController::SnapshotRemovalTracker::pause):
(WebKit::ViewGestureController::SnapshotRemovalTracker::isPaused const):
(WebKit::ViewGestureController::SnapshotRemovalTracker::hasRemovalCallback const):
(WebKit::ViewGestureController::SnapshotRemovalTracker::renderTreeSizeThreshold const):
(WebKit::ViewGestureController::SnapshotRemovalTracker::setRenderTreeSizeThreshold):
(WebKit::ViewGestureController::PendingSwipeTracker::shouldIgnorePinnedState):
(WebKit::ViewGestureController::PendingSwipeTracker::setShouldIgnorePinnedState):
(WebKit::ViewGestureController::SwipeProgressTracker::progress const):
(WebKit::ViewGestureController::SwipeProgressTracker::direction const):
* UIProcess/ViewGestureController.messages.in: Renamed from Source/WebKit/UIProcess/Cocoa/ViewGestureController.messages.in.
* UIProcess/ViewSnapshotStore.cpp: Copied from Source/WebKit/UIProcess/mac/ViewSnapshotStore.mm.
(WebKit::ViewSnapshotStore::ViewSnapshotStore):
(WebKit::ViewSnapshotStore::~ViewSnapshotStore):
(WebKit::ViewSnapshotStore::singleton):
(WebKit::ViewSnapshotStore::didAddImageToSnapshot):
(WebKit::ViewSnapshotStore::willRemoveImageFromSnapshot):
(WebKit::ViewSnapshotStore::pruneSnapshots):
(WebKit::ViewSnapshotStore::recordSnapshot):
(WebKit::ViewSnapshotStore::discardSnapshotImages):
(WebKit::ViewSnapshot::~ViewSnapshot):
* UIProcess/ViewSnapshotStore.h: Renamed from Source/WebKit/UIProcess/mac/ViewSnapshotStore.h.
(WebKit::ViewSnapshot::setRenderTreeSize):
(WebKit::ViewSnapshot::renderTreeSize const):
(WebKit::ViewSnapshot::setBackgroundColor):
(WebKit::ViewSnapshot::backgroundColor const):
(WebKit::ViewSnapshot::setViewScrollPosition):
(WebKit::ViewSnapshot::viewScrollPosition const):
(WebKit::ViewSnapshot::setDeviceScaleFactor):
(WebKit::ViewSnapshot::deviceScaleFactor const):
(WebKit::ViewSnapshot::surface const):
(WebKit::ViewSnapshot::imageSizeInBytes const):
(WebKit::ViewSnapshot::size const):
(WebKit::ViewSnapshotStore::setDisableSnapshotVolatilityForTesting):
(WebKit::ViewSnapshotStore::disableSnapshotVolatilityForTesting const):
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::didRemoveItem): Unset snapshot for GTK.
* UIProcess/WebMemoryPressureHandler.cpp: Copied from Source/WebKit/UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.mm.
(WebKit::installMemoryPressureHandler):
* UIProcess/WebMemoryPressureHandler.h: Renamed from Source/WebKit/UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.h.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::recordNavigationSnapshot): Take snapshots for GTK.
* UIProcess/WebPageProxy.h:
* UIProcess/gtk/ViewGestureControllerGtk.cpp: Added. This is a port of
UIProcess/mac/ViewGestureControllerMac.mm. SwipeProgressTracker class is a
re-implementation of trackSwipeEventWithOptions.
(WebKit::isEventStop):
(WebKit::ViewGestureController::platformTeardown):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanStartSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanEndSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas):
(WebKit::ViewGestureController::handleScrollWheelEvent):
(WebKit::ViewGestureController::trackSwipeGesture):
(WebKit::ViewGestureController::SwipeProgressTracker::SwipeProgressTracker):
(WebKit::ViewGestureController::SwipeProgressTracker::startTracking):
(WebKit::ViewGestureController::SwipeProgressTracker::reset):
(WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
(WebKit::ViewGestureController::SwipeProgressTracker::startAnimation):
(WebKit::easeOutCubic):
(WebKit::ViewGestureController::SwipeProgressTracker::onAnimationTick):
(WebKit::ViewGestureController::SwipeProgressTracker::endAnimation):
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::handleSwipeGesture):
(WebKit::ViewGestureController::draw):
(WebKit::ViewGestureController::removeSwipeSnapshot):
(WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting):
(WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting):
* UIProcess/gtk/ViewSnapshotStoreGtk.cpp: Renamed from Source/WebKit/UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.mm.
(WebKit::ViewSnapshot::create):
(WebKit::ViewSnapshot::ViewSnapshot):
(WebKit::ViewSnapshot::hasImage const):
(WebKit::ViewSnapshot::clearImage):
(WebKit::ViewSnapshot::imageSizeInBytes const):
(WebKit::ViewSnapshot::size const):
* UIProcess/gtk/WebProcessPoolGtk.cpp:
(WebKit::memoryPressureMonitorDisabled): Added.
(WebKit::WebProcessPool::platformInitialize): Install memory pressure handler.
(WebKit::WebProcessPool::platformInitializeWebProcess): Use memoryPressureMonitorDisabled().
* UIProcess/mac/ViewGestureControllerMac.mm:
Moved many functions into UIProcess/ViewGestureController.cpp
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanStartSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanEndSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas):
(WebKit::ViewGestureController::trackSwipeGesture):
(WebKit::scrollEventCanInfluenceSwipe): Deleted.
(WebKit::deltaShouldCancelSwipe): Deleted.
(WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker): Deleted.
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe): Deleted.
(WebKit::ViewGestureController::PendingSwipeTracker::handleEvent): Deleted.
(WebKit::ViewGestureController::PendingSwipeTracker::eventWasNotHandledByWebCore): Deleted.
(WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe): Deleted.
(WebKit::ViewGestureController::PendingSwipeTracker::reset): Deleted.
(WebKit::ViewGestureController::willEndSwipeGesture): Deleted.
(WebKit::ViewGestureController::shouldUseSnapshotForSize): Deleted.
(WebKit::ViewGestureController::isPhysicallySwipingLeft const): Deleted.
(WebKit::ViewGestureController::endSwipeGesture): Deleted.
(WebKit::ViewGestureController::forceRepaintIfNeeded): Deleted.
(WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded): Deleted.
* UIProcess/mac/ViewSnapshotStoreMac.mm: Renamed from Source/WebKit/UIProcess/mac/ViewSnapshotStore.mm.
(WebKit::ViewSnapshotStore::snapshottingContext):
(WebKit::ViewSnapshot::create):
(WebKit::ViewSnapshot::ViewSnapshot):
(WebKit::ViewSnapshot::setSurface):
(WebKit::ViewSnapshot::hasImage const):
(WebKit::ViewSnapshot::clearImage):
(WebKit::ViewSnapshot::setVolatile):
(WebKit::ViewSnapshot::asLayerContents):
(WebKit::ViewSnapshot::asImageForTesting):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
Make SetRenderTreeSizeNotificationThreshold() cross-platform.
(WebKit::ViewGestureGeometryCollector::ViewGestureGeometryCollector):
(WebKit::ViewGestureGeometryCollector::computeMinimumAndMaximumViewportScales const):
(WebKit::ViewGestureGeometryCollector::mainFrameDidLayout):
* WebProcess/WebPage/ViewGestureGeometryCollector.h:
* WebProcess/WebPage/ViewGestureGeometryCollector.messages.in:
* WebProcess/WebPage/WebPage.cpp:
Start using ViewGestureGeometryCollector for GTK.
(WebKit::WebPage::mainFrameDidLayout):
* WebProcess/WebPage/WebPage.h:

Tools:

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp:
(testWebKitSettings): Add a test for 'enable-back-forward-navigation-gestures' property.

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

6 months agoAdd SPI to use networking daemon instead of XPC service
achristensen@apple.com [Sat, 9 Feb 2019 01:17:41 +0000 (01:17 +0000)]
Add SPI to use networking daemon instead of XPC service
https://bugs.webkit.org/show_bug.cgi?id=194427

Source/WebKit:

Reviewed by Geoffrey Garen.

There is still work to be done, but with the proper plist it starts and loads webpages!

* NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
(WebKit::DaemonMain):
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(WebKit::XPCEventHandler):
(WebKit::XPCInitializationHandler):
(WebKit::XPCServiceMain):
(WebKit::XPCServiceEventHandler): Deleted.
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration usesNetworkingDaemon]):
(-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]):
* UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::getLaunchOptions):
* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName):
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getLaunchOptions):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::usesNetworkingDaemon const):
* UIProcess/WebProcessPool.h:

Source/WTF:

Reviewed by Geoffrey Garen.

* wtf/spi/darwin/XPCSPI.h:
Instead of using XPC bootstrap SPI, we just send a separate message.
xpc_copy_bootstrap does not seem to work in  daemons.

Tools:

Reviewed by Geoffrey Garen

* MiniBrowser/MiniBrowser.entitlements:

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

6 months ago[JSC] Shrink sizeof(CodeBlock) more
ysuzuki@apple.com [Sat, 9 Feb 2019 00:29:21 +0000 (00:29 +0000)]
[JSC] Shrink sizeof(CodeBlock) more
https://bugs.webkit.org/show_bug.cgi?id=194419

Reviewed by Mark Lam.

Source/JavaScriptCore:

This patch further shrinks the size of CodeBlock, from 352 to 296 (304).

1. CodeBlock copies so many data from ScriptExecutable even if ScriptExecutable
has the same information. These data is not touched in CodeBlock::~CodeBlock,
so we can just use the data in ScriptExecutable instead of holding it in CodeBlock.

2. We remove m_instructions pointer since the ownership is managed by UnlinkedCodeBlock.
And we do not touch it in CodeBlock::~CodeBlock.

3. We move m_calleeSaveRegisters from CodeBlock to CodeBlock::JITData. For baseline and LLInt
cases, this patch offers RegisterAtOffsetList::llintBaselineCalleeSaveRegisters() which returns
singleton to `const RegisterAtOffsetList*` usable for LLInt and Baseline JIT CodeBlocks.

4. Move m_catchProfiles to RareData and materialize only when op_catch's slow path is called.

5. Drop ownerScriptExecutable. ownerExecutable() returns ScriptExecutable*.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::hash const):
(JSC::CodeBlock::sourceCodeForTools const):
(JSC::CodeBlock::dumpAssumingJITType const):
(JSC::CodeBlock::dumpSource):
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::propagateTransitions):
(JSC::CodeBlock::finalizeLLIntInlineCaches):
(JSC::CodeBlock::setCalleeSaveRegisters):
(JSC::CodeBlock::ensureCatchLivenessIsComputedForBytecodeOffset):
(JSC::CodeBlock::ensureCatchLivenessIsComputedForBytecodeOffsetSlow):
(JSC::CodeBlock::lineNumberForBytecodeOffset):
(JSC::CodeBlock::expressionRangeForBytecodeOffset const):
(JSC::CodeBlock::hasOpDebugForLineAndColumn):
(JSC::CodeBlock::newReplacement):
(JSC::CodeBlock::replacement):
(JSC::CodeBlock::computeCapabilityLevel):
(JSC::CodeBlock::jettison):
(JSC::CodeBlock::calleeSaveRegisters const):
(JSC::CodeBlock::calleeSaveSpaceAsVirtualRegisters):
(JSC::CodeBlock::updateOSRExitCounterAndCheckIfNeedToReoptimize):
(JSC::CodeBlock::getArrayProfile):
(JSC::CodeBlock::updateAllPredictionsAndCountLiveness):
(JSC::CodeBlock::notifyLexicalBindingUpdate):
(JSC::CodeBlock::tryGetValueProfileForBytecodeOffset):
(JSC::CodeBlock::validate):
(JSC::CodeBlock::outOfLineJumpTarget):
(JSC::CodeBlock::arithProfileForBytecodeOffset):
(JSC::CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::specializationKind const):
(JSC::CodeBlock::isStrictMode const):
(JSC::CodeBlock::isConstructor const):
(JSC::CodeBlock::codeType const):
(JSC::CodeBlock::isKnownNotImmediate):
(JSC::CodeBlock::instructions const):
(JSC::CodeBlock::ownerExecutable const):
(JSC::CodeBlock::thisRegister const):
(JSC::CodeBlock::source const):
(JSC::CodeBlock::sourceOffset const):
(JSC::CodeBlock::firstLineColumnOffset const):
(JSC::CodeBlock::createRareDataIfNecessary):
(JSC::CodeBlock::ownerScriptExecutable const): Deleted.
(JSC::CodeBlock::setThisRegister): Deleted.
(JSC::CodeBlock::calleeSaveRegisters const): Deleted.
* bytecode/EvalCodeBlock.h:
* bytecode/FunctionCodeBlock.h:
* bytecode/GlobalCodeBlock.h:
(JSC::GlobalCodeBlock::GlobalCodeBlock):
* bytecode/ModuleProgramCodeBlock.h:
* bytecode/ProgramCodeBlock.h:
* debugger/Debugger.cpp:
(JSC::Debugger::toggleBreakpoint):
* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::sourceID const):
(JSC::DebuggerCallFrame::sourceIDForCallFrame):
* debugger/DebuggerScope.cpp:
(JSC::DebuggerScope::location const):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::InlineStackEntry::executable):
(JSC::DFG::ByteCodeParser::inliningCost):
(JSC::DFG::ByteCodeParser::parseCodeBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::isSupportedForInlining):
(JSC::DFG::mightCompileEval):
(JSC::DFG::mightCompileProgram):
(JSC::DFG::mightCompileFunctionForCall):
(JSC::DFG::mightCompileFunctionForConstruct):
(JSC::DFG::canUseOSRExitFuzzing):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::executableFor):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compileFunction):
* dfg/DFGOSREntry.cpp:
(JSC::DFG::prepareOSREntry):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::restoreCalleeSavesFor):
(JSC::DFG::saveCalleeSavesFor):
(JSC::DFG::saveOrCopyCalleeSavesFor):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::handleExitCounts):
* dfg/DFGOperations.cpp:
* dfg/DFGToFTLDeferredCompilationCallback.cpp:
(JSC::DFG::ToFTLDeferredCompilationCallback::compilationDidComplete):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
* interpreter/CallFrame.cpp:
(JSC::CallFrame::callerSourceOrigin):
* interpreter/Interpreter.cpp:
(JSC::eval):
(JSC::UnwindFunctor::copyCalleeSavesToEntryFrameCalleeSavesBuffer const):
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::Frame::calleeSaveRegisters):
(JSC::StackVisitor::Frame::sourceURL const):
(JSC::StackVisitor::Frame::sourceID):
(JSC::StackVisitor::Frame::computeLineAndColumn const):
* interpreter/StackVisitor.h:
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::emitSaveCalleeSavesFor):
(JSC::AssemblyHelpers::emitSaveOrCopyCalleeSavesFor):
(JSC::AssemblyHelpers::emitRestoreCalleeSavesFor):
* jit/CallFrameShuffleData.cpp:
(JSC::CallFrameShuffleData::setupCalleeSaveRegisters):
* jit/JIT.cpp:
(JSC::JIT::compileWithoutLinking):
* jit/JITToDFGDeferredCompilationCallback.cpp:
(JSC::JITToDFGDeferredCompilationCallback::compilationDidComplete):
* jit/JITWorklist.cpp:
(JSC::JITWorklist::Plan::finalize):
(JSC::JITWorklist::compileNow):
* jit/RegisterAtOffsetList.cpp:
(JSC::RegisterAtOffsetList::llintBaselineCalleeSaveRegisters):
* jit/RegisterAtOffsetList.h:
(JSC::RegisterAtOffsetList::at const):
* runtime/ErrorInstance.cpp:
(JSC::appendSourceToError):
* runtime/ScriptExecutable.cpp:
(JSC::ScriptExecutable::newCodeBlockFor):
* runtime/StackFrame.cpp:
(JSC::StackFrame::sourceID const):
(JSC::StackFrame::sourceURL const):
(JSC::StackFrame::computeLineAndColumn const):

Source/WebCore:

* testing/Internals.cpp:
(WebCore::Internals::parserMetaData):

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

6 months ago[ews-build] Ensure that every builder in config.json has short name
aakash_jain@apple.com [Sat, 9 Feb 2019 00:28:19 +0000 (00:28 +0000)]
[ews-build] Ensure that every builder in config.json has short name
https://bugs.webkit.org/show_bug.cgi?id=194461

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/loadConfig.py:
* BuildSlaveSupport/ews-build/loadConfig_unittest.py: Updated unit-tests.

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

6 months ago[Cocoa] Optimize ResourceResponse::platformLazyInit()
cdumez@apple.com [Sat, 9 Feb 2019 00:26:40 +0000 (00:26 +0000)]
[Cocoa] Optimize ResourceResponse::platformLazyInit()
https://bugs.webkit.org/show_bug.cgi?id=194438

Reviewed by Alex Christensen.

Optimize ResourceResponse::platformLazyInit(). Most of the CPU time currently goes into getting the
HTTP headers from CFNetwork:
"""
Sample Count, Samples %, CPU %, Symbol
46, 0.0%, 0.0%, WebCore::initializeHTTPHeaders(WebCore::OnlyCommonHeaders, NSHTTPURLResponse*, WebCore::HTTPHeaderMap&) (in WebCore)
34, 0.0%, 0.0%,     HTTPHeaderDict::copyAsOrdinaryDict(__CFAllocator const*) const (in CFNetwork)
11, 0.0%, 0.0%,     CFDictionaryApplyFunction (in CoreFoundation)
"""

We currently have 2 levels of initialization: CommonFieldsOnly & AllFields. With WebKit2, most ResourceResponses get sent over IPC
and thus end up getting initialized twice, once with CommonFieldsOnly and then with AllFields.
This would cause us to call the expensive HTTPHeaderDict::copyAsOrdinaryDict() twice instead of once, simply to initialize the common
HTTP headers first and then the uncommon ones later.

This patch updates ResourceResponse::platformLazyInit() to initialize all HTTP headers at once, as soon as CommonFieldsOnly
initialization is requested, so that we no longer copy all HTTP headers twice.

* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::initializeHTTPHeaders):
(WebCore::ResourceResponse::platformLazyInit):

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

6 months agoWeb Inspector: Import / Export Heap Snapshots
commit-queue@webkit.org [Sat, 9 Feb 2019 00:25:46 +0000 (00:25 +0000)]
Web Inspector: Import / Export Heap Snapshots
https://bugs.webkit.org/show_bug.cgi?id=194448
<rdar://problem/47928093>

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

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
New strings.

* UserInterface/Proxies/HeapSnapshotProxy.js:
(WI.HeapSnapshotProxy):
(WI.HeapSnapshotProxy.deserialize):
(WI.HeapSnapshotProxy.prototype.get imported):
(WI.HeapSnapshotProxy.prototype.get snapshotStringData):
(WI.HeapSnapshotProxy.prototype.set snapshotStringData):
Include an "imported" state on the HeapSnapshot and allow for
stashing the snapshotStringData on the main thread side.

* UserInterface/Proxies/HeapSnapshotWorkerProxy.js:
(WI.HeapSnapshotWorkerProxy.prototype.createImportedSnapshot):
* UserInterface/Workers/HeapSnapshot/HeapSnapshotWorker.js:
(HeapSnapshotWorker.prototype.clearSnapshots):
(HeapSnapshotWorker.prototype.createSnapshot):
Provide a specialized way to create an imported HeapSnapshot.
Track imported snapshots separately since they won't want to
be searched for live/dead objects due to active recording GCs.

* UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
(HeapSnapshot):
(HeapSnapshot.updateCategoriesAndMetadata):
(HeapSnapshot.allocationBucketCounts):
(HeapSnapshot.instancesWithClassName):
(HeapSnapshot.prototype.nodeWithIdentifier):
(HeapSnapshot.prototype.dominatedNodes):
(HeapSnapshot.prototype.retainedNodes):
(HeapSnapshot.prototype.retainers):
(HeapSnapshot.prototype.updateDeadNodesAndGatherCollectionData):
(HeapSnapshot.prototype.serialize):
(HeapSnapshot.prototype.serializeNode):
(HeapSnapshot.prototype._buildPostOrderIndexes):
(HeapSnapshot.prototype._buildDominatorIndexes):
(HeapSnapshot.prototype._buildRetainedSizes):
(HeapSnapshot.prototype._gcRootPathes.visitNode):
(HeapSnapshot.prototype._gcRootPathes):
Construct a HeapSnapshot knowinng whether or not it is imported.
Imported snapshots may be the "GCDebugging" snapshot type which
differs from "Inspector" by the number of node fields. So keep
the node field count a member instead of a global constant
in order to work with both snapshot types.

* UserInterface/Models/HeapAllocationsInstrument.js:
(WI.HeapAllocationsInstrument.prototype._takeHeapSnapshot):
* UserInterface/Protocol/ConsoleObserver.js:
(WI.ConsoleObserver.prototype.heapSnapshot):
* UserInterface/Protocol/HeapObserver.js:
(WI.HeapObserver.prototype.trackingStart):
(WI.HeapObserver.prototype.trackingComplete):
Stash the original string JSON data on the main thread side
where we already have the data.

* UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js:
(WI.HeapAllocationsTimelineOverviewGraph.prototype.layout):
Don't show [S] icons for imported snapshots with no timestamp.

* UserInterface/Views/HeapAllocationsTimelineView.js:
(WI.HeapAllocationsTimelineView):
(WI.HeapAllocationsTimelineView.prototype.get navigationItems):
(WI.HeapAllocationsTimelineView.prototype._importButtonNavigationItemClicked):
(WI.HeapAllocationsTimelineView.prototype._takeHeapSnapshotClicked):
Import button that just creates a new snapshot.

* UserInterface/Views/HeapSnapshotContentView.js:
(WI.HeapSnapshotContentView):
(WI.HeapSnapshotContentView.prototype.get navigationItems):
(WI.HeapSnapshotContentView.prototype.get supportsSave):
(WI.HeapSnapshotContentView.prototype.get saveData):
(WI.HeapSnapshotContentView.prototype._exportSnapshot):
Export button that saves the original data.

* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView.displayNameForRecord):
Specialized display string for imported snapshots.

LayoutTests:

* inspector/heap/imported-snapshot-expected.txt: Added.
* inspector/heap/imported-snapshot.html: Added.
* platform/mac/TestExpectations:

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

6 months ago[ews-build] Add short name to config.json
aakash_jain@apple.com [Sat, 9 Feb 2019 00:24:24 +0000 (00:24 +0000)]
[ews-build] Add short name to config.json
https://bugs.webkit.org/show_bug.cgi?id=194456

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/config.json: Added short name.
* BuildSlaveSupport/ews-build/loadConfig.py:
(loadBuilderConfig): Set the short name as the builder description.

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

6 months agoB3LowerMacros wrongly sets m_changed to true in the case of AtomicWeakCAS on x86
rmorisset@apple.com [Sat, 9 Feb 2019 00:21:56 +0000 (00:21 +0000)]
B3LowerMacros wrongly sets m_changed to true in the case of AtomicWeakCAS on x86
https://bugs.webkit.org/show_bug.cgi?id=194460

Reviewed by Mark Lam.

Trivial fix, should already be covered by testAtomicWeakCAS in testb3.cpp.

* b3/B3LowerMacros.cpp:

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

6 months agoWeb Inspector: Add Debug setting to show Internal Object Classes in Heap Snapshot
commit-queue@webkit.org [Fri, 8 Feb 2019 23:51:52 +0000 (23:51 +0000)]
Web Inspector: Add Debug setting to show Internal Object Classes in Heap Snapshot
https://bugs.webkit.org/show_bug.cgi?id=194445

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

* UserInterface/Base/Setting.js:
* UserInterface/Views/HeapSnapshotDataGridTree.js:
(WI.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createDebugSettingsView):

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

6 months agoUse maxSingleCharacterString in comparisons instead of literal constants.
mark.lam@apple.com [Fri, 8 Feb 2019 23:06:41 +0000 (23:06 +0000)]
Use maxSingleCharacterString in comparisons instead of literal constants.
https://bugs.webkit.org/show_bug.cgi?id=194452

Reviewed by Yusuke Suzuki.

This way, if we ever change maxSingleCharacterString, it won't break all this code
that relies on it being 0xff implicitly.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileStringSlice):
(JSC::DFG::SpeculativeJIT::compileGetByValOnString):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileStringCharAt):
(JSC::FTL::DFG::LowerDFGToB3::compileStringSlice):
* jit/ThunkGenerators.cpp:
(JSC::stringGetByValGenerator):
(JSC::charToString):

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

6 months agoFix DFG's doesGC() for CheckTierUp*, GetByVal, PutByVal*, and StringCharAt nodes.
mark.lam@apple.com [Fri, 8 Feb 2019 22:32:00 +0000 (22:32 +0000)]
Fix DFG's doesGC() for CheckTierUp*, GetByVal, PutByVal*, and StringCharAt nodes.
https://bugs.webkit.org/show_bug.cgi?id=194446
<rdar://problem/47926792>

Reviewed by Saam Barati.

Fix doesGC() for the following nodes:

    CheckTierUpAtReturn:
        Calls triggerTierUpNow(), which calls triggerFTLReplacementCompile(),
        which calls Worklist::completeAllReadyPlansForVM(), which uses DeferGC.

    CheckTierUpInLoop:
        Calls triggerTierUpNowInLoop(), which calls tierUpCommon(), which calls
        Worklist::completeAllReadyPlansForVM(), which uses DeferGC.

    CheckTierUpAndOSREnter:
        Calls triggerOSREntryNow(), which calls tierUpCommon(), which calls
        Worklist::completeAllReadyPlansForVM(), which uses DeferGC.

    GetByVal:
        case Array::String calls operationSingleCharacterString(), which calls
        jsSingleCharacterString(), which can allocate a string.

    PutByValDirect:
    PutByVal:
    PutByValAlias:
        For the DFG only, the integer TypeArrays calls compilePutByValForIntTypedArray(),
        which may call slow paths operationPutByValDirectStrict(), operationPutByValDirectNonStrict(),
        operationPutByValStrict(), or operationPutByValNonStrict().  All of these
        slow paths call putByValInternal(), which may create exception objects, or
        call the generic JSValue::put() which may execute arbitrary code.

    StringCharAt:
        Can call operationSingleCharacterString(), which calls jsSingleCharacterString(),
        which can allocate a string.

Also fix DFG::SpeculativeJIT::compileGetByValOnString() and FTL's compileStringCharAt()
to use the maxSingleCharacterString constant instead of a literal constant.

* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetByValOnString):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
(JSC::FTL::DFG::LowerDFGToB3::compilePutByVal):
(JSC::FTL::DFG::LowerDFGToB3::compileStringCharAt):

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

6 months agoWeb Inspector: Styles: close unbalanced quotes and parenthesis when editing values
nvasilyev@apple.com [Fri, 8 Feb 2019 22:17:56 +0000 (22:17 +0000)]
Web Inspector: Styles: close unbalanced quotes and parenthesis when editing values
https://bugs.webkit.org/show_bug.cgi?id=182523
<rdar://problem/37260209>

Reviewed by Devin Rousso.

Source/WebInspectorUI:

Close CSS comments, append missing closed quotes and right parenthesis.

* UserInterface/Models/CSSCompletions.js:
(WI.CSSCompletions.completeUnbalancedValue):
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype.set rawValue):

LayoutTests:

Test common cases of unmatched quotes, parenthesis, comments, and trailing backslashes.

* inspector/unit-tests/css-completions-expected.txt: Added.
* inspector/unit-tests/css-completions.html: Added.

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

6 months agoLayout Test accessibility/set-value-not-work-for-disabled-sliders.html is failing
pvollan@apple.com [Fri, 8 Feb 2019 22:11:12 +0000 (22:11 +0000)]
Layout Test accessibility/set-value-not-work-for-disabled-sliders.html is failing
https://bugs.webkit.org/show_bug.cgi?id=194451

Unreviewed test gardening.

* platform/win/TestExpectations:

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

6 months ago[Web GPU] Build fix for MTLStorageMode availability on different Cocoa platforms
ryanhaddad@apple.com [Fri, 8 Feb 2019 21:39:20 +0000 (21:39 +0000)]
[Web GPU] Build fix for MTLStorageMode availability on different Cocoa platforms
https://bugs.webkit.org/show_bug.cgi?id=194443

Unreviewed build fix.

For MTLTextures, MTLStorageModeManaged is only available on macOS. Other platforms,
if not using MTLStorageModePrivate, must use MTLStorageModeShared.

Behavior unchanged.

Patch by Justin Fan <justin_fan@apple.com> on 2019-02-08

* platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
(WebCore::storageModeForPixelFormatAndSampleCount):

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

6 months agoLayout Test media/audio-concurrent-supported.html is a flaky failure
ryanhaddad@apple.com [Fri, 8 Feb 2019 21:21:43 +0000 (21:21 +0000)]
Layout Test media/audio-concurrent-supported.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=188017

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations: The test is not flaky anymore. Remove expectation.

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

6 months agoUnreviewed, rolling out r241197.
tsavell@apple.com [Fri, 8 Feb 2019 21:19:32 +0000 (21:19 +0000)]
Unreviewed, rolling out r241197.

Broke iOS Simulator Debug build and casued 1 API failure on
High Sierra

Reverted changeset:

"Add SPI to use networking daemon instead of XPC service"
https://bugs.webkit.org/show_bug.cgi?id=194427
https://trac.webkit.org/changeset/241197

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

6 months agoAbstract and discussion comments needed for afterScreenUpdates
bdakin@apple.com [Fri, 8 Feb 2019 20:36:07 +0000 (20:36 +0000)]
Abstract and discussion comments needed for afterScreenUpdates
https://bugs.webkit.org/show_bug.cgi?id=194442

Reviewed by Wenson Hsieh.

Forgot to add these comments with https://bugs.webkit.org/show_bug.cgi?id=194362
* UIProcess/API/Cocoa/WKSnapshotConfiguration.h:

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

6 months ago[WebVTT] Inline WebVTT styles should start with '::cue'
pvollan@apple.com [Fri, 8 Feb 2019 19:48:04 +0000 (19:48 +0000)]
[WebVTT] Inline WebVTT styles should start with '::cue'
https://bugs.webkit.org/show_bug.cgi?id=194227
<rdar://problem/47791087>

Reviewed by Eric Carlson.

Source/WebCore:

Check that the CSS string starts with '::cue' and is successfully parsed before adding it
to the CSS stylesheet list. Also, the caption preferences CSS string should start with
'::cue', since it is added inside the video shadow root element.

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

* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::checkAndStoreStyleSheet):
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride const):

LayoutTests:

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

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

6 months agowebkitpy: CrashLogs.find_all_logs may return a string or a dictionary
jbedard@apple.com [Fri, 8 Feb 2019 19:46:11 +0000 (19:46 +0000)]
webkitpy: CrashLogs.find_all_logs may return a string or a dictionary
https://bugs.webkit.org/show_bug.cgi?id=194418

Reviewed by Lucas Forschler.

Do not include errors trying when finding crashlogs at the end of
a run-webkit-tests run since we don't process those errors.

* Scripts/webkitpy/port/darwin.py:
(DarwinPort._look_for_all_crash_logs_in_log_dir):
* Scripts/webkitpy/port/ios_device.py:
(IOSDevicePort._look_for_all_crash_logs_in_log_dir):
* Scripts/webkitpy/port/watch_device.py:
(WatchDevicePort._look_for_all_crash_logs_in_log_dir):

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

6 months ago[JSC] SourceProviderCacheItem should be small
ysuzuki@apple.com [Fri, 8 Feb 2019 19:18:14 +0000 (19:18 +0000)]
[JSC] SourceProviderCacheItem should be small
https://bugs.webkit.org/show_bug.cgi?id=194432

Reviewed by Saam Barati.

Some JetStream2 tests stress the JS parser. At that time, so many SourceProviderCacheItems are created.
While they are removed when full-GC happens, it significantly increases the peak memory usage.
This patch reduces the size of SourceProviderCacheItem from 56 to 32.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseFunctionInfo):
* parser/ParserModes.h:
* parser/ParserTokens.h:
* parser/SourceProviderCacheItem.h:
(JSC::SourceProviderCacheItem::endFunctionToken const):
(JSC::SourceProviderCacheItem::SourceProviderCacheItem):

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

6 months agoRunning RTCRtpSender.getCapabilities("video") before initial offer breaks VP8
youenn@apple.com [Fri, 8 Feb 2019 18:49:23 +0000 (18:49 +0000)]
Running RTCRtpSender.getCapabilities("video") before initial offer breaks VP8
https://bugs.webkit.org/show_bug.cgi?id=194380
<rdar://problem/47916514>

Reviewed by Eric Carlson.

Source/WebCore:

Set whether VP8 is supported at creation of the page.
This ensures that any call creating a peer connection factory will end up supporting the runtime flag configuration.

Add internal API to enable resetting the factory to enable proper testing.

Covered by updated test.

* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::createLibWebRTCPeerConnectionBackend):
* page/Page.cpp:
(WebCore::m_applicationManifest):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* testing/Internals.cpp:
(WebCore::Internals::clearPeerConnectionFactory):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* webrtc/video-mute-vp8-expected.txt:
* webrtc/video-mute-vp8.html:

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