WebKit-https.git
6 months agoChange the name of libANGLE in the shared workspace.
dino@apple.com [Thu, 23 Jan 2020 18:50:57 +0000 (18:50 +0000)]
Change the name of libANGLE in the shared workspace.

* WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme:

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

6 months agoContentFilter should access DocumentLoader through an interface
achristensen@apple.com [Thu, 23 Jan 2020 18:50:55 +0000 (18:50 +0000)]
ContentFilter should access DocumentLoader through an interface
https://bugs.webkit.org/show_bug.cgi?id=206564

Reviewed by Andy Estes.

This will make it easier to move, like to the NetworkProcess where there are no DocumentLoaders.
Also use WTF::Function instead of std::function and UniqueRef instead of std::unique_ptr.
No change in behavior.

* WebCore.xcodeproj/project.pbxproj:
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::types):
(WebCore::ContentFilter::create):
(WebCore::ContentFilter::ContentFilter):
(WebCore::ContentFilter::continueAfterWillSendRequest):
(WebCore::ContentFilter::continueAfterResponseReceived):
(WebCore::ContentFilter::continueAfterDataReceived):
(WebCore::ContentFilter::continueAfterNotifyFinished):
(WebCore::ContentFilter::forEachContentFilterUntilBlocked):
(WebCore::ContentFilter::didDecide):
(WebCore::ContentFilter::deliverResourceData):
(WebCore::ContentFilter::handleProvisionalLoadFailure):
(): Deleted.
* loader/ContentFilter.h:
* loader/ContentFilterClient.h: Added.
(WebCore::ContentFilterClient::~ContentFilterClient):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::handleProvisionalLoadFailure):
(WebCore::DocumentLoader::didBlock):
* loader/DocumentLoader.h:
* platform/cocoa/NetworkExtensionContentFilter.h:
* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::create):
* platform/cocoa/ParentalControlsContentFilter.h:
* platform/cocoa/ParentalControlsContentFilter.mm:
(WebCore::ParentalControlsContentFilter::create):

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

6 months agoStop capturing telemetry for well-understood sandbox rules (206562)
bfulgham@apple.com [Thu, 23 Jan 2020 18:15:30 +0000 (18:15 +0000)]
Stop capturing telemetry for well-understood sandbox rules (206562)
https://bugs.webkit.org/show_bug.cgi?id=206562
<rdar://problem/58778970>

Reviewed by Per Arne Vollan.

Remove logging of sandbox rules that are now understood, and either confirmed to be needed for proper WebKit operation
or identified for removal through a future update.

No new tests. No change in behavior.

* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

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

6 months agoUpdate ANGLE
dino@apple.com [Thu, 23 Jan 2020 18:05:27 +0000 (18:05 +0000)]
Update ANGLE
https://bugs.webkit.org/show_bug.cgi?id=206318

Several important changes to fix layout test failures and timeouts in this update.
- Made expensive validation non-default in debug mode to reduce timeouts.
- Optimize disabling ARB_texture_rectangle to make shader compilation much faster.
- Flush before texture deletion to work around Mac Intel driver bug.

Patch by James Darpinian <jdarpinian@chromium.org> on 2020-01-22
Reviewed by Dean Jackson.

* ANGLE.plist: update commit hash
* ANGLE.xcodeproj/project.pbxproj: Add/remove files
* Compiler.cmake: Translated from compiler.gni
* GLESv2.cmake: Translated from libGLESv2.gni
* changes.diff: Now lists all changes from upstream.
* update-angle.sh: Diff command was wrong.
* Plus a whole lot of changes from upstream.

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

6 months ago[GTK] Gardening, rebaselines and update TestExpectations
dpino@igalia.com [Thu, 23 Jan 2020 17:53:10 +0000 (17:53 +0000)]
[GTK] Gardening, rebaselines and update TestExpectations
https://bugs.webkit.org/show_bug.cgi?id=206660

Unreviewed gardening.

* platform/gtk/TestExpectations:
* platform/gtk/imported/w3c/web-platform-tests/media-source/mediasource-remove-expected.txt: Added.

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

6 months agoActually fix history link directs on dashboard and results.html
jlewis3@apple.com [Thu, 23 Jan 2020 17:51:45 +0000 (17:51 +0000)]
Actually fix history link directs on dashboard and results.html
https://bugs.webkit.org/show_bug.cgi?id=206666

Reviewed by Jonathan Bedard.

* fast/harness/results.html:
* legacy-animation-engine/fast/harness/results.html:

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

6 months agoFix iOS 13.2 iphoneos build
jbedard@apple.com [Thu, 23 Jan 2020 16:23:26 +0000 (16:23 +0000)]
Fix iOS 13.2 iphoneos build
https://bugs.webkit.org/show_bug.cgi?id=206618

Reviewed by Alexey Proskuryakov.

* Scripts/webkitdirs.pm:
(XcodeOptions): Relax provisioning profile rules on embedded SDKs.

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

6 months ago[LFC][IFC] Do not special case formatting root layout
zalan@apple.com [Thu, 23 Jan 2020 16:15:15 +0000 (16:15 +0000)]
[LFC][IFC] Do not special case formatting root layout
https://bugs.webkit.org/show_bug.cgi?id=206641
<rdar://problem/58823548>

Reviewed by Antti Koivisto.

Let's move out all the formatting context layout logic from layoutFormattingContextRoot.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot): Deleted.
(WebCore::Layout::InlineFormattingContext::computeHorizontalAndVerticalGeometry): Deleted.
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isInlineTableBox const):
(WebCore::Layout::Box::isInlineLevelBox const):
* layout/layouttree/LayoutBox.h:

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

6 months agofast/css/first-letter-and-float-crash.html asserts under ComplexLineLayout::createLin...
antti@apple.com [Thu, 23 Jan 2020 16:05:36 +0000 (16:05 +0000)]
fast/css/first-letter-and-float-crash.html asserts under ComplexLineLayout::createLineBoxes
https://bugs.webkit.org/show_bug.cgi?id=206651
<rdar://problem/54889982>

Reviewed by Anders Carlsson.

Source/WebCore:

Take care that the first-letter style has the correct styleType set even when getCachedPseudoStyle failed.
This is used for checking if there is an existing first letter renderer.

* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::styleForFirstLetter):

LayoutTests:

* fast/css/first-letter-and-float-crash.html:

Force an additional layout in the test to make the issue easily reproducible.

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

6 months agoUnreviewed, fix calculation of kindBits
ysuzuki@apple.com [Thu, 23 Jan 2020 12:48:57 +0000 (12:48 +0000)]
Unreviewed, fix calculation of kindBits
https://bugs.webkit.org/show_bug.cgi?id=206650

* bytecode/Operands.h:

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

6 months ago[GTK] Gardening, update platform baselines for failing tests
dpino@igalia.com [Thu, 23 Jan 2020 11:50:17 +0000 (11:50 +0000)]
[GTK] Gardening, update platform baselines for failing tests
https://bugs.webkit.org/show_bug.cgi?id=206644

Unreviewed gardening.

* platform/gtk/fast/dom/Range/getBoundingClientRect-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/ecdh_bits.https.any.worker-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/ecdh_keys.https.any.worker-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/dom/events/Event-dispatch-redispatch-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/dom/nodes/Document-createEvent.https-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/svg/import/paths-dom-01-f-manual-expected.txt:

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

6 months agoKeyedDecoderGeneric crashes when it accesses a data with empty string key.
commit-queue@webkit.org [Thu, 23 Jan 2020 10:58:48 +0000 (10:58 +0000)]
KeyedDecoderGeneric crashes when it accesses a data with empty string key.
https://bugs.webkit.org/show_bug.cgi?id=206572

Patch by Takashi Komori <Takashi.Komori@sony.com> on 2020-01-23
Reviewed by Fujii Hironori.

Source/WebCore:

Changed null string which was used for HasMap key to empty string.

Test: TestWebKitAPI/Tests/WebCore/KeyedCoding.cpp

* platform/generic/KeyedDecoderGeneric.cpp:
(WebCore::readString):

Tools:

* TestWebKitAPI/Tests/WebCore/KeyedCoding.cpp:
(TestWebKitAPI::TEST):

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

6 months agonomodule scripts are fetched in some cases (with empty cache or in new tab)
ysuzuki@apple.com [Thu, 23 Jan 2020 09:51:58 +0000 (09:51 +0000)]
nomodule scripts are fetched in some cases (with empty cache or in new tab)
https://bugs.webkit.org/show_bug.cgi?id=194337
<rdar://problem/49700924>

Reviewed by Ryosuke Niwa.

Source/WebCore:

The preloader attempt to preload "src" of script tags. However, script tag attributed with "nomodule"
will never be executed by WebKit since it already supports modules. Avoid loading this content in
the preloader.

Test: http/wpt/preload/classic-script-with-nomodule.html

* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
(WebCore::TokenPreloadScanner::StartTagScanner::shouldPreload):

LayoutTests:

* http/wpt/preload/classic-script-with-nomodule-expected.txt: Added.
* http/wpt/preload/classic-script-with-nomodule.html: Added.
* http/wpt/preload/resources/classic.js: Added.
* http/wpt/preload/resources/module.js: Added.

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

6 months agoIt should be possible to build JavaScriptCore with LLVM Source-based Code Coverage...
commit-queue@webkit.org [Thu, 23 Jan 2020 09:46:40 +0000 (09:46 +0000)]
It should be possible to build JavaScriptCore with LLVM Source-based Code Coverage, run the tests and see the coverage data
https://bugs.webkit.org/show_bug.cgi?id=206389

Patch by Tuomas Karkkainen <tuomas.webkit@apple.com> on 2020-01-23
Reviewed by Alexey Proskuryakov.

* Scripts/run-javascriptcore-tests:
* Scripts/set-webkit-configuration:
* Scripts/webkitdirs.pm:
* coverage/coverage.xcconfig: Added.

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

6 months ago[JSC] Bits from Operand should fit in bits reserved in AbstractHeap's Payload
ysuzuki@apple.com [Thu, 23 Jan 2020 09:39:11 +0000 (09:39 +0000)]
[JSC] Bits from Operand should fit in bits reserved in AbstractHeap's Payload
https://bugs.webkit.org/show_bug.cgi?id=206619
<rdar://problem/58270260>

Reviewed by Keith Miller.

JSTests:

* stress/operand-should-fit-in-abstract-heap-encoded-payload-format.js: Added.

Source/JavaScriptCore:

We extended JSC::Operand to have an additional field representing OperandKind.
However, we have restriction in DFG::AbstractHeap's Payload that Operand's raw
bits format need to fit in reserved bits in Payload's raw bits format, 49 bits.
Since we ordered fields of Operand "m_kind" and "m_operand", in little endian
architecture, raw bits format of Operand can exceed 49 bits if m_operand is
large enough.

This patch fixes the order to ensure that Operand's raw bit format always fits
in 49 bits.

* bytecode/Operands.h:
(JSC::Operand::Operand):
(JSC::Operand::asBits const):
* dfg/DFGAbstractHeap.h:

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

6 months ago[GTK] Navigation gesture creates CSS nodes and doesn't remove them
commit-queue@webkit.org [Thu, 23 Jan 2020 09:29:10 +0000 (09:29 +0000)]
[GTK] Navigation gesture creates CSS nodes and doesn't remove them
https://bugs.webkit.org/show_bug.cgi?id=206591

Patch by Alexander Mikhaylenko <alexm@gnome.org> on 2020-01-23
Reviewed by Carlos Garcia Campos.

Even though foreign drawing uses a temporary GtkStyleContext, calling
gtk_style_context_set_parent() adds all its CSS nodes to the global
hierarchy, and then they aren't cleaned up. This shouldn't happen.

* UIProcess/gtk/ViewGestureControllerGtk.cpp:
(WebKit::ViewGestureController::createStyleContext):Stop setting GtkStyleContext parent.

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

6 months ago[GTK] Gardening HTTP tests
commit-queue@webkit.org [Thu, 23 Jan 2020 06:50:35 +0000 (06:50 +0000)]
[GTK] Gardening HTTP tests
https://bugs.webkit.org/show_bug.cgi?id=206640

Unreviewed test gardening.

Patch by Lauro Moura <lmoura@igalia.com> on 2020-01-22

* platform/gtk/TestExpectations:
* platform/gtk/http/tests/security/xss-DENIED-xsl-external-entity-redirect-expected.txt: Added.

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

6 months ago[WinCairo] Some of combining family glyphs are replaced by space glyphs
Hironori.Fujii@sony.com [Thu, 23 Jan 2020 06:46:11 +0000 (06:46 +0000)]
[WinCairo] Some of combining family glyphs are replaced by space glyphs
https://bugs.webkit.org/show_bug.cgi?id=205485

Reviewed by Myles C. Maxfield.

Source/WebCore:

Although ComplexTextControllerUniscribe requires
glyph-to-character mapping (stringIndices), Uniscribe returns
character-to-glyph mapping (clusters). So, we are converting it.
And, this is not simple task due to the following reasons.

1. ComplexTextControllerUniscribe replaces glyphs, which are
corresponding to space characters, with space glyphs.

For example, 👨‍👦 (man+boy, U+1F468 ZWJ U+1F466) consists of a 5
length UTF-16 string.

Uniscribe returns:

glyphs: [6368 6318] (father and boy glyphs)
clusters:  [0 0 1 1 1]

This means U+1F468 is mapping to the father glyph, and ZWJ U+1F466
are mapping to the boy glyph. If one simply converts this to
glyph-to-character mapping, it would be [0 2]. This means the
father glyph is mapping to U+1F468, and the boy glyph is mapping
to ZWJ. As the result, ComplexTextControllerUniscribe replaces the
boy glyph with a space glyph because it is mapped to ZWJ. So, by
somehow skipping space characters, we need to convert the clusters
to a glyph-to-character mapping [0 3].

2. Uniscribe returns the rightmost glyphs for combining glyphs in
RTL text even though it returns the leftmost one for LTR.

For example, if a string "abc" are generating combining glyphs "AB",
Uniscribe returns clusters [0 0] for LTR text, but [1 1] for RTL text.

Test: fast/text/emoji-single-parent-family-3.html

* platform/graphics/win/ComplexTextControllerUniscribe.cpp:
(WebCore::BidiRange::BidiRange): Added.
(WebCore::BidiRange::Iterator::Iterator):
(WebCore::BidiRange::Iterator::operator++):
(WebCore::BidiRange::Iterator::operator*):
(WebCore::BidiRange::Iterator::operator==):
(WebCore::BidiRange::Iterator::operator!=):
(WebCore::BidiRange::Iterator::index):
(WebCore::BidiRange::begin const):
(WebCore::BidiRange::end const):
(WebCore::stringIndicesFromClusters): Added.
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):

LayoutTests:

* fast/text/emoji-single-parent-family-3-expected-mismatch.html: Added.
* fast/text/emoji-single-parent-family-3.html: Added.
* platform/win/TestExpectations: Marked fast/text/emoji-single-parent-family-3.html as ImageOnlyFailure.
* platform/wincairo/TestExpectations: Changed the bug number for fast/text/stale-TextLayout-from-first-line.html.

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

6 months ago[Media in GPU process] Pipe more MediaPlayerPrivate and client methods
jonlee@apple.com [Thu, 23 Jan 2020 06:31:34 +0000 (06:31 +0000)]
[Media in GPU process] Pipe more MediaPlayerPrivate and client methods
https://bugs.webkit.org/show_bug.cgi?id=206468

Reviewed by Eric Carlson.

Source/WebCore:

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::currentPlaybackTargetIsWirelessChanged):
* platform/graphics/MediaPlayer.h: Add resourceNotSupported() to call up to the client.
(WebCore::MediaPlayerClient::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::playbackTargetIsWirelessChanged):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget):

Source/WebKit:

Pipe more of the media player and client functions. Generally, these are void functions
that require no parameters.

Also, the client *changed() functions, when implemented, tend to call the accessor of the property
that just changed. This seems rather circuitous. The client methods ought to just also pass along
the value of the new changed value. This patch refactors mediaPlayerCurrentPlaybackTargetIsWirelessChanged
to do exactly that.

* GPUProcess/media/RemoteMediaPlayerProxy.cpp:
(WebKit::RemoteMediaPlayerProxy::mediaPlayerResourceNotSupported):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerEngineUpdated):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerActiveSourceBuffersChanged):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerWaitingForKeyChanged):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
(WebKit::RemoteMediaPlayerProxy::setWirelessVideoPlaybackDisabled):
(WebKit::RemoteMediaPlayerProxy::setShouldPlayToPlaybackTarget):
(WebKit::RemoteMediaPlayerProxy::keyAdded):
(WebKit::RemoteMediaPlayerProxy::beginSimulatedHDCPError):
(WebKit::RemoteMediaPlayerProxy::endSimulatedHDCPError):
(WebKit::RemoteMediaPlayerProxy::notifyActiveSourceBuffersChanged):
(WebKit::RemoteMediaPlayerProxy::applicationWillResignActive):
(WebKit::RemoteMediaPlayerProxy::applicationDidBecomeActive):
* GPUProcess/media/RemoteMediaPlayerProxy.h:
* GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
* WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::setWirelessVideoPlaybackDisabled):
(WebKit::MediaPlayerPrivateRemote::currentPlaybackTargetIsWirelessChanged): Cache value in new member variable.
(WebKit::MediaPlayerPrivateRemote::isCurrentPlaybackTargetWireless const): Return value.
(WebKit::MediaPlayerPrivateRemote::setShouldPlayToPlaybackTarget):
(WebKit::MediaPlayerPrivateRemote::keyAdded):
(WebKit::MediaPlayerPrivateRemote::waitingForKeyChanged):
(WebKit::MediaPlayerPrivateRemote::beginSimulatedHDCPError):
(WebKit::MediaPlayerPrivateRemote::endSimulatedHDCPError):
(WebKit::MediaPlayerPrivateRemote::notifyActiveSourceBuffersChanged):
(WebKit::MediaPlayerPrivateRemote::applicationWillResignActive):
(WebKit::MediaPlayerPrivateRemote::applicationDidBecomeActive):
(WebKit::MediaPlayerPrivateRemote::resourceNotSupported):
(WebKit::MediaPlayerPrivateRemote::engineUpdated):
(WebKit::MediaPlayerPrivateRemote::activeSourceBuffersChanged):
* WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
* WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in:

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

6 months agoUnreviewed, rolling out r254955.
jiewen_tan@apple.com [Thu, 23 Jan 2020 04:54:28 +0000 (04:54 +0000)]
Unreviewed, rolling out r254955.

Broke internal builds

Reverted changeset:

"WebKitTestRunner: move code sign configurations from
WebKitTestRunner.xcconfig to DebugRelease.xcconfig"
https://bugs.webkit.org/show_bug.cgi?id=206607
https://trac.webkit.org/changeset/254955

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

6 months agoRestore nullification of DFG::Plan::m_vm when the plan is cancelled.
mark.lam@apple.com [Thu, 23 Jan 2020 04:50:23 +0000 (04:50 +0000)]
Restore nullification of DFG::Plan::m_vm when the plan is cancelled.
https://bugs.webkit.org/show_bug.cgi?id=206633
<rdar://problem/58811967>

Reviewed by Robin Morisset.

In r253243, I replaced the nullification of Plan::m_vm in Plan::cancel() with
code to decorate the m_vm pointer with a nuke bit.  The thinking is that keeping
the VM pointer in nuked form allows us to do certain assertions, as well as
implementing code in support of keeping Box<Identifier>s alive.  It is only
correct to use the nuked VM pointer if and only if the VM is guaranteed to
outlive the Plan.  r253243 guarantees this condition.

In r254464, I replaced the use of Box<Identifier> with CacheableIdentifier.
This obviated all the support code added above, and rolled out most of it.
However, I opted to keep the nuked VM pointer in the DFG::Plan to as a debugging
aid (it's nice to be able to know which VM the Plan came from).

However, r254464 also undid the guarantee that the VM will outlive the Plan.
As a result, a nuked VM pointer is no longer guaranteed to point to a valid VM.
Some worker layout tests, run on an ASAN build, detected that the pointer is
pointing to an already freed VM and failed with a crash.

This patch fixes this issue by completely reverting the nuked VM pointer code,
and restores nullification of the m_vm pointer in Plan::cancel().

* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::computeCompileTimes const):
(JSC::DFG::Plan::cancel):
* dfg/DFGPlan.h:
(JSC::DFG::Plan::vm const):
(JSC::DFG::Plan::unnukedVM const): Deleted.
(JSC::DFG::Plan::nuke): Deleted.
(JSC::DFG::Plan::unnuke): Deleted.

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

6 months ago[LFC][IFC] Use "inline box" or "atomic inline level box" instead of inline container
zalan@apple.com [Thu, 23 Jan 2020 04:49:27 +0000 (04:49 +0000)]
[LFC][IFC] Use "inline box" or "atomic inline level box" instead of inline container
https://bugs.webkit.org/show_bug.cgi?id=206592
<rdar://problem/58799970>

Reviewed by Antti Koivisto.

Inline container is not a spec term.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeHorizontalAndVerticalGeometry):
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::InlineFormattingContext::collectInlineContentIfNeeded):
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isInlineBox const):
(WebCore::Layout::Box::isAtomicInlineLevelBox const):
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::isContainer const):
(WebCore::Layout::Box::isBlockContainer const): Deleted.
(WebCore::Layout::Box::isInlineContainer const): Deleted.
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputLayoutBox):

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

6 months agoRemove DFGAbstractHeap::typeInfoType since it's immutable
keith_miller@apple.com [Thu, 23 Jan 2020 03:52:05 +0000 (03:52 +0000)]
Remove DFGAbstractHeap::typeInfoType since it's immutable
https://bugs.webkit.org/show_bug.cgi?id=206638

Reviewed by Yusuke Suzuki.

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

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

6 months agoInternalField and CheckNeutered DFG nodes are not always safe to execute
keith_miller@apple.com [Thu, 23 Jan 2020 02:58:51 +0000 (02:58 +0000)]
InternalField and CheckNeutered DFG nodes are not always safe to execute
https://bugs.webkit.org/show_bug.cgi?id=206632

Reviewed by Saam Barati.

JSTests:

* stress/for-of-bad-internal-field-hoist.js: Added.
(foo):

Source/JavaScriptCore:

We currently mark (Get/Set)InternalField/CheckNeutered nodes as safe to execute everywhere. However,
GetInternalField, etc. rely on a proof that the cell passed to it is a subclass of InteralFieldObject.
This combination means we may hoist the nodes past the check guarding them.

Also, remove a bogus assertion that we will have proven the value passed to CheckNeutered is a TypedArray.
It's not valid to require that AI preserve a precise model of all invariants since phases can make changes
that AI doesn't understand.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileCheckNeutered):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCheckNeutered):

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

6 months ago[OpenSSL] Add stubs and build for Web Crypto
don.olmstead@sony.com [Thu, 23 Jan 2020 02:45:17 +0000 (02:45 +0000)]
[OpenSSL] Add stubs and build for Web Crypto
https://bugs.webkit.org/show_bug.cgi?id=206449

Reviewed by Jiewen Tan.

.:

Enable Web Crypto as an experiment for WinCairo and PlayStation. Add the USE_OPENSSL
definition to platforms using OpenSSL.

* Source/cmake/OptionsFTW.cmake:
* Source/cmake/OptionsPlayStation.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/OptionsWinCairo.cmake:

Source/WebCore:

Add stubs for an OpenSSL implementation of Web Crypto. Add the associated CMake
files for OpenSSL platforms and reference them on the platforms using OpenSSL.

Tests will be enabled as functionality lands.

* PlatformFTW.cmake:
* PlatformPlayStation.cmake:
* PlatformWinCairo.cmake:
* crypto/keys/CryptoKeyEC.h:
* crypto/keys/CryptoKeyRSA.h:
* crypto/openssl/CryptoAlgorithmAES_CBCOpenSSL.cpp: Added.
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/openssl/CryptoAlgorithmAES_CFBOpenSSL.cpp: Added.
(WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
* crypto/openssl/CryptoAlgorithmAES_CTROpenSSL.cpp: Added.
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
* crypto/openssl/CryptoAlgorithmAES_GCMOpenSSL.cpp: Added.
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/openssl/CryptoAlgorithmAES_KWOpenSSL.cpp: Added.
(WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
(WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
* crypto/openssl/CryptoAlgorithmECDHOpenSSL.cpp: Added.
(WebCore::CryptoAlgorithmECDH::platformDeriveBits):
* crypto/openssl/CryptoAlgorithmECDSAOpenSSL.cpp: Added.
(WebCore::CryptoAlgorithmECDSA::platformSign):
(WebCore::CryptoAlgorithmECDSA::platformVerify):
* crypto/openssl/CryptoAlgorithmHKDFOpenSSL.cpp: Added.
(WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
* crypto/openssl/CryptoAlgorithmHMACOpenSSL.cpp: Added.
(WebCore::CryptoAlgorithmHMAC::platformSign):
(WebCore::CryptoAlgorithmHMAC::platformVerify):
* crypto/openssl/CryptoAlgorithmPBKDF2OpenSSL.cpp: Added.
(WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
* crypto/openssl/CryptoAlgorithmRSAES_PKCS1_v1_5OpenSSL.cpp: Added.
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
* crypto/openssl/CryptoAlgorithmRSASSA_PKCS1_v1_5OpenSSL.cpp: Added.
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
* crypto/openssl/CryptoAlgorithmRSA_OAEPOpenSSL.cpp: Added.
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
* crypto/openssl/CryptoAlgorithmRSA_PSSOpenSSL.cpp: Added.
(WebCore::CryptoAlgorithmRSA_PSS::platformSign):
(WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
* crypto/openssl/CryptoAlgorithmRegistryOpenSSL.cpp: Added.
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
* crypto/openssl/CryptoKeyECOpenSSL.cpp: Added.
(WebCore::CryptoKeyEC::keySizeInBits const):
(WebCore::CryptoKeyEC::platformSupportedCurve):
(WebCore::CryptoKeyEC::platformGeneratePair):
(WebCore::CryptoKeyEC::platformImportRaw):
(WebCore::CryptoKeyEC::platformImportJWKPublic):
(WebCore::CryptoKeyEC::platformImportJWKPrivate):
(WebCore::CryptoKeyEC::platformImportSpki):
(WebCore::CryptoKeyEC::platformImportPkcs8):
(WebCore::CryptoKeyEC::platformExportRaw const):
(WebCore::CryptoKeyEC::platformAddFieldElements const):
(WebCore::CryptoKeyEC::platformExportSpki const):
(WebCore::CryptoKeyEC::platformExportPkcs8 const):
* crypto/openssl/CryptoKeyRSAOpenSSL.cpp: Added.
(WebCore::CryptoKeyRSA::create):
(WebCore::CryptoKeyRSA::isRestrictedToHash const):
(WebCore::CryptoKeyRSA::keySizeInBits const):
(WebCore::CryptoKeyRSA::generatePair):
(WebCore::CryptoKeyRSA::importSpki):
(WebCore::CryptoKeyRSA::importPkcs8):
(WebCore::CryptoKeyRSA::exportSpki const):
(WebCore::CryptoKeyRSA::exportPkcs8 const):
(WebCore::CryptoKeyRSA::exportData const):
* crypto/openssl/SerializedCryptoKeyWrapOpenSSL.cpp: Added.
(WebCore::getDefaultWebCryptoMasterKey):
(WebCore::wrapSerializedCryptoKey):
(WebCore::unwrapSerializedCryptoKey):
* platform/OpenSSL.cmake: Added.

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

6 months agoAdd an option for logging total phase times
sbarati@apple.com [Thu, 23 Jan 2020 02:27:26 +0000 (02:27 +0000)]
Add an option for logging total phase times
https://bugs.webkit.org/show_bug.cgi?id=206623

Reviewed by Robin Morisset and Keith Miller.

* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThreadImpl):
* jsc.cpp:
(runJSC):
* runtime/OptionsList.h:
* tools/CompilerTimingScope.cpp:
(JSC::CompilerTimingScope::CompilerTimingScope):
(JSC::CompilerTimingScope::~CompilerTimingScope):
(JSC::logTotalPhaseTimes):
* tools/CompilerTimingScope.h:

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

6 months agouniqueLogIdentifier() should generate a unique identifiers
eric.carlson@apple.com [Thu, 23 Jan 2020 02:25:23 +0000 (02:25 +0000)]
uniqueLogIdentifier() should generate a unique identifiers
https://bugs.webkit.org/show_bug.cgi?id=206612

Reviewed by Brent Fulgham.

* wtf/LoggerHelper.h:
(WTF::LoggerHelper::uniqueLogIdentifier):

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

6 months agoWebKitTestRunner: move code sign configurations from WebKitTestRunner.xcconfig to...
jiewen_tan@apple.com [Thu, 23 Jan 2020 02:14:54 +0000 (02:14 +0000)]
WebKitTestRunner: move code sign configurations from WebKitTestRunner.xcconfig to DebugRelease.xcconfig
https://bugs.webkit.org/show_bug.cgi?id=206607
<rdar://problem/56087327>

Reviewed by Alexey Proskuryakov.

* WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig:

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

6 months agopreprocess-idls.pl: CygwinPathIfNeeded should use Cygwin::win_to_posix_path instead...
Hironori.Fujii@sony.com [Thu, 23 Jan 2020 01:53:18 +0000 (01:53 +0000)]
preprocess-idls.pl: CygwinPathIfNeeded should use Cygwin::win_to_posix_path instead of invoking cygpath
https://bugs.webkit.org/show_bug.cgi?id=206407

Reviewed by Chris Dumez.

preprocess-idls.pl was invoking cygpath command for all input IDL
files. Use Cygwin::win_to_posix_path function instead.

* bindings/scripts/preprocess-idls.pl: Changed the way to load idlFilesList as well as generate-bindings-all.pl does.
(CygwinPathIfNeeded): Copied from CygwinPathIfNeeded of generate-bindings-all.pl.

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

6 months agoREGRESSION (r253926): webgl/1.0.3/conformance/rendering/many-draw-calls.html is much...
dino@apple.com [Thu, 23 Jan 2020 00:27:43 +0000 (00:27 +0000)]
REGRESSION (r253926): webgl/1.0.3/conformance/rendering/many-draw-calls.html is much slower, times out in debug
https://bugs.webkit.org/show_bug.cgi?id=205668

Disable asserts when compiling ANGLE in release mode by defining
NDEBUG.

Patch by James Darpinian <jdarpinian@chromium.org> on 2020-01-22
Reviewed by Dean Jackson.

* Configurations/ANGLE.xcconfig:

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

6 months agoLegacy WebKit: Add SPI variant of -setSelectedDOMRange that can perform the selection...
dbates@webkit.org [Thu, 23 Jan 2020 00:24:24 +0000 (00:24 +0000)]
Legacy WebKit: Add SPI variant of -setSelectedDOMRange that can perform the selection as if triggered by the user
https://bugs.webkit.org/show_bug.cgi?id=206622

Reviewed by Wenson Hsieh.

Add a new -setSelectedDOMRange SPI variant that takes a boolean to indicate whether the selection
was triggered by the user.

While I am here, I simplified and modernized the code. This includes moving the null check of
Frame::page() to the top of the function. This let me eliminate the null check for Frame::view()
because every frame that has a page must have a non-null view. I imported WebEditorClient.h
to get WebKit::core(NSSelectionAffinity) and remove a C-style cast to WebCore::EAffinity.
I also used more "auto".

* WebView/WebFrame.mm:
(-[WebFrame setSelectedDOMRange:affinity:closeTyping:]): Modified to call the newly added variant,
passing "userTriggered:NO" to keep the current behavior.
(-[WebFrame setSelectedDOMRange:affinity:closeTyping:userTriggered:]): Added.
* WebView/WebFramePrivate.h:

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

6 months agoMake a Ref to WindowEventLoop when the timer to run tasks fires
rniwa@webkit.org [Thu, 23 Jan 2020 00:20:24 +0000 (00:20 +0000)]
Make a Ref to WindowEventLoop when the timer to run tasks fires
https://bugs.webkit.org/show_bug.cgi?id=206568

Reviewed by Antti Koivisto.

Keep WindowEventLoop alive explicitly while invoking EventLoop::run.

* dom/WindowEventLoop.cpp:
(WebCore::WindowEventLoop::WindowEventLoop):
(WebCore::WindowEventLoop::didReachTimeToRun):
* dom/WindowEventLoop.h:

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

6 months agoREGRESSION (r253519): [WKWebView evaluateJavaScript:completionHandler:] gives a non...
beidson@apple.com [Wed, 22 Jan 2020 23:48:29 +0000 (23:48 +0000)]
REGRESSION (r253519): [WKWebView evaluateJavaScript:completionHandler:] gives a non-nil, non-Error result even when JavaScript cannot be evaluated
<rdar://problem/58544942> and https://bugs.webkit.org/show_bug.cgi?id=206608

Reviewed by Alex Christensen.

Source/WebCore:

Covered by new API test.

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeScriptInWorld): Address a FIXME added in 253519 which had predicted this problem.

Tools:

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

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

6 months agoREGRESSION: [ Mac WK2 ] webgpu/vertex-buffer-triangle-strip.html is a flakey image...
tsavell@apple.com [Wed, 22 Jan 2020 23:38:21 +0000 (23:38 +0000)]
REGRESSION: [ Mac WK2 ] webgpu/vertex-buffer-triangle-strip.html is a flakey image failure
https://bugs.webkit.org/show_bug.cgi?id=198942

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

6 months agoRemove unused enable macro ENABLE_JIT_CONSTANT_BLINDING
commit-queue@webkit.org [Wed, 22 Jan 2020 23:25:46 +0000 (23:25 +0000)]
Remove unused enable macro ENABLE_JIT_CONSTANT_BLINDING
https://bugs.webkit.org/show_bug.cgi?id=206415

Patch by Sam Weinig <weinig@apple.com> on 2020-01-22
Reviewed by Anders Carlsson.

* wtf/PlatformEnable.h:
ENABLE_JIT_CONSTANT_BLINDING is not used anywhere in WebKit so can be removed.

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

6 months ago[32-bits][JIT] Fix build issues.
ticaiolima@gmail.com [Wed, 22 Jan 2020 23:12:57 +0000 (23:12 +0000)]
[32-bits][JIT] Fix build issues.
https://bugs.webkit.org/show_bug.cgi?id=206603

Reviewed by Yusuke Suzuki.

This patch is adjusting places to use VirtualRegister instead of
offset directly, to make 32-bit JIT compilable again. Original authors
of this patch are Paulo Matos and Guillaume Emont.

* jit/JIT.h:
* jit/JITArithmetic32_64.cpp:
(JSC::JIT::emit_compareAndJump):
(JSC::JIT::emit_compareUnsignedAndJump):
(JSC::JIT::emit_compareUnsigned):
(JSC::JIT::emit_compareAndJumpSlow):
(JSC::JIT::emit_op_unsigned):
(JSC::JIT::emit_op_inc):
(JSC::JIT::emit_op_dec):
(JSC::JIT::emitBinaryDoubleOp):
* jit/JITCall32_64.cpp:
(JSC::JIT::emitPutCallResult):
(JSC::JIT::emit_op_ret):
(JSC::JIT::compileSetupFrame):
(JSC::JIT::compileCallEvalSlowCase):
(JSC::JIT::compileOpCall):
* jit/JITInlines.h:
(JSC::JIT::emitLoadTag):
(JSC::JIT::emitLoadPayload):
(JSC::JIT::emitGetVirtualRegister):
(JSC::JIT::emitJumpSlowCaseIfNotJSCell):
(JSC::JIT::getOperandConstantInt):
(JSC::JIT::emitGet): Deleted.
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_mov):
(JSC::JIT::emit_op_end):
(JSC::JIT::emit_op_new_object):
(JSC::JIT::emitSlow_op_new_object):
(JSC::JIT::emit_op_overrides_has_instance):
(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof_custom):
(JSC::JIT::emit_op_is_empty):
(JSC::JIT::emit_op_is_undefined):
(JSC::JIT::emit_op_is_undefined_or_null):
(JSC::JIT::emit_op_is_boolean):
(JSC::JIT::emit_op_is_number):
(JSC::JIT::emit_op_is_cell_with_type):
(JSC::JIT::emit_op_is_object):
(JSC::JIT::emit_op_to_primitive):
(JSC::JIT::emit_op_set_function_name):
(JSC::JIT::emit_op_not):
(JSC::JIT::emit_op_jfalse):
(JSC::JIT::emit_op_jtrue):
(JSC::JIT::emit_op_jeq_null):
(JSC::JIT::emit_op_jneq_null):
(JSC::JIT::emit_op_jundefined_or_null):
(JSC::JIT::emit_op_jnundefined_or_null):
(JSC::JIT::emit_op_jneq_ptr):
(JSC::JIT::emit_op_eq):
(JSC::JIT::emitSlow_op_eq):
(JSC::JIT::emit_op_jeq):
(JSC::JIT::emit_op_neq):
(JSC::JIT::emitSlow_op_neq):
(JSC::JIT::emit_op_jneq):
(JSC::JIT::compileOpStrictEq):
(JSC::JIT::compileOpStrictEqJump):
(JSC::JIT::emit_op_eq_null):
(JSC::JIT::emit_op_neq_null):
(JSC::JIT::emit_op_throw):
(JSC::JIT::emit_op_to_number):
(JSC::JIT::emit_op_to_numeric):
(JSC::JIT::emit_op_to_string):
(JSC::JIT::emit_op_to_object):
(JSC::JIT::emit_op_catch):
(JSC::JIT::emit_op_get_parent_scope):
(JSC::JIT::emit_op_switch_imm):
(JSC::JIT::emit_op_switch_char):
(JSC::JIT::emit_op_switch_string):
(JSC::JIT::emit_op_enter):
(JSC::JIT::emit_op_get_scope):
(JSC::JIT::emit_op_create_this):
(JSC::JIT::emit_op_to_this):
(JSC::JIT::emit_op_check_tdz):
(JSC::JIT::emit_op_has_structure_property):
(JSC::JIT::emit_op_has_indexed_property):
(JSC::JIT::emitSlow_op_has_indexed_property):
(JSC::JIT::emit_op_get_direct_pname):
(JSC::JIT::emit_op_enumerator_structure_pname):
(JSC::JIT::emit_op_enumerator_generic_pname):
(JSC::JIT::emit_op_profile_type):
(JSC::JIT::emit_op_log_shadow_chicken_prologue):
(JSC::JIT::emit_op_log_shadow_chicken_tail):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_put_getter_by_id):
(JSC::JIT::emit_op_put_setter_by_id):
(JSC::JIT::emit_op_put_getter_setter_by_id):
(JSC::JIT::emit_op_put_getter_by_val):
(JSC::JIT::emit_op_put_setter_by_val):
(JSC::JIT::emit_op_del_by_id):
(JSC::JIT::emit_op_del_by_val):
(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::emitSlow_op_get_by_val):
(JSC::JIT::emit_op_put_by_val):
(JSC::JIT::emitGenericContiguousPutByVal):
(JSC::JIT::emitArrayStoragePutByVal):
(JSC::JIT::emitPutByValWithCachedId):
(JSC::JIT::emitSlow_op_put_by_val):
(JSC::JIT::emit_op_try_get_by_id):
(JSC::JIT::emitSlow_op_try_get_by_id):
(JSC::JIT::emit_op_get_by_id_direct):
(JSC::JIT::emitSlow_op_get_by_id_direct):
(JSC::JIT::emit_op_get_by_id):
(JSC::JIT::emitSlow_op_get_by_id):
(JSC::JIT::emit_op_get_by_id_with_this):
(JSC::JIT::emitSlow_op_get_by_id_with_this):
(JSC::JIT::emit_op_put_by_id):
(JSC::JIT::emitSlow_op_put_by_id):
(JSC::JIT::emit_op_in_by_id):
(JSC::JIT::emitSlow_op_in_by_id):
(JSC::JIT::emitResolveClosure):
(JSC::JIT::emit_op_resolve_scope):
(JSC::JIT::emitLoadWithStructureCheck):
(JSC::JIT::emitGetClosureVar):
(JSC::JIT::emit_op_get_from_scope):
(JSC::JIT::emitSlow_op_get_from_scope):
(JSC::JIT::emitPutGlobalVariable):
(JSC::JIT::emitPutGlobalVariableIndirect):
(JSC::JIT::emitPutClosureVar):
(JSC::JIT::emit_op_put_to_scope):
(JSC::JIT::emit_op_get_from_arguments):
(JSC::JIT::emit_op_put_to_arguments):
(JSC::JIT::emit_op_get_internal_field):
(JSC::JIT::emit_op_put_internal_field):
* jit/JSInterfaceJIT.h:
(JSC::JSInterfaceJIT::emitJumpIfNotJSCell):
(JSC::JSInterfaceJIT::emitLoadInt32):
(JSC::JSInterfaceJIT::emitLoadDouble):

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

6 months agoUnreviewed, fix build with recent SDKs.
cdumez@apple.com [Wed, 22 Jan 2020 22:31:58 +0000 (22:31 +0000)]
Unreviewed, fix build with recent SDKs.

* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
(WebCore::MediaPlaybackTargetPickerMac::externalOutputDeviceAvailable):
(WebCore::MediaPlaybackTargetPickerMac::devicePicker):
(WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):

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

6 months agoAutomatic link replacement via "Smart links" should emit "insertLink" input events
commit-queue@webkit.org [Wed, 22 Jan 2020 22:00:43 +0000 (22:00 +0000)]
link replacement via "Smart links" should emit "insertLink" input events
https://bugs.webkit.org/show_bug.cgi?id=191306
Source/WebCore:

<rdar://problem/58491514>

Patch by Nikos Mouchtaris <nmouchtaris@apple.com> on 2020-01-22
Reviewed by Wenson Hsieh.

Added support for outputting "insertLink" for input type and the url for the
data of the input event when smart link is used.

Test: fast/events/input-event-insert-link.html

* editing/CreateLinkCommand.h:
* editing/EditCommand.cpp:
(WebCore::inputTypeNameForEditingAction):

LayoutTests:

Patch by Nikos Mouchtaris <nmouchtaris@apple.com> on 2020-01-22
Reviewed by Wenson Hsieh.

Due to webkit.org/b/162081 this test is skipped for WebKit2.

* fast/events/input-event-insert-link-expected.txt: Added.
* fast/events/input-event-insert-link.html: Added.
* platform/gtk/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:

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

6 months agowebkitpy: WebSocket server doesn't support Python 3 (Workaround)
jbedard@apple.com [Wed, 22 Jan 2020 21:58:37 +0000 (21:58 +0000)]
webkitpy: WebSocket server doesn't support Python 3 (Workaround)
https://bugs.webkit.org/show_bug.cgi?id=206546

Reviewed by Alexey Proskuryakov.

websocket_server.py doesn't support Python 3, and needs to be run with
Python 2.

* Scripts/webkitpy/layout_tests/servers/websocket_server.py:
(PyWebSocket._prepare_config): Use Python 2 explicitly.

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

6 months ago[ARMv7] Assembler is generating wrong instruction for ldr r2, [r3, #7]
ticaiolima@gmail.com [Wed, 22 Jan 2020 21:42:58 +0000 (21:42 +0000)]
[ARMv7] Assembler is generating wrong instruction for ldr r2, [r3, #7]
https://bugs.webkit.org/show_bug.cgi?id=206231

Reviewed by Mark Lam.

When generating code for `ldr` on ARMv7, we were encoding immediates not
multiple of 4 using Encoding T1, which only accepts multiple of 4 as
immediates. This patch fixes such issue and allow us generate proper
code when offset imemdiates are not multiple of 4.

* assembler/ARMv7Assembler.h:
(JSC::ARMv7Assembler::ldr):

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

6 months ago[build-webkit] Add option for toggling unified build
basuke.suzuki@sony.com [Wed, 22 Jan 2020 21:33:19 +0000 (21:33 +0000)]
[build-webkit] Add option for toggling unified build
https://bugs.webkit.org/show_bug.cgi?id=206597

Reviewed by Adrian Perez de Castro.

Added command line option for build-webkit script to toggle unified build.

* Scripts/webkitperl/FeatureList.pm:

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

6 months agoRemove ImageBuffer::sizeForDestinationSize()
commit-queue@webkit.org [Wed, 22 Jan 2020 21:32:11 +0000 (21:32 +0000)]
Remove ImageBuffer::sizeForDestinationSize()
https://bugs.webkit.org/show_bug.cgi?id=206541

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2020-01-22
Reviewed by Tim Horton.

-- Remove ImageBuffer::sizeForDestinationSize() since it is currently
   doing nothing. For CG and D2D ports, it scales a rect by the ratio
   backingStoreSize / internalSize which is always 1. The constructor
   ImageBuffer::ImageBuffer() sets m_size and m_data.backingStoreSize
   to the same value always.

-- Remove ImageBuffer::isCompatibleWithContext() since it is not used.

-- Remove ImageBuffer::fastCopyImageMode() since it returns
   DontCopyBackingStore on all ports.

* html/CustomPaintCanvas.cpp:
(WebCore::CustomPaintCanvas::copiedImage const):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::texSubImage2D):
(WebCore::WebGLRenderingContextBase::texImage2D):
(WebCore::WebGLRenderingContextBase::drawImageIntoBuffer):
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::sizeForDestinationSize const): Deleted.
(WebCore::ImageBuffer::isCompatibleWithContext const): Deleted.
* platform/graphics/ImageBuffer.h:
(WebCore::ImageBuffer::logicalSize const):
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::fastCopyImageMode): Deleted.
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::clipToImageBuffer):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::ImageBuffer):
(WebCore::createBitmapImageAfterScalingIfNeeded):
(WebCore::ImageBuffer::copyImage const):
(WebCore::ImageBuffer::sinkIntoImage):
(WebCore::ImageBuffer::toCFData const):
(WebCore::scaleSizeToUserSpace): Deleted.
(WebCore::ImageBuffer::sizeForDestinationSize const): Deleted.
(WebCore::ImageBuffer::fastCopyImageMode): Deleted.
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::scaleSizeToUserSpace): Deleted.
(WebCore::ImageBuffer::sizeForDestinationSize const): Deleted.
(WebCore::ImageBuffer::fastCopyImageMode): Deleted.

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

6 months agoShare InjectedBundleController::platformInitialize
don.olmstead@sony.com [Wed, 22 Jan 2020 21:21:58 +0000 (21:21 +0000)]
Share InjectedBundleController::platformInitialize
https://bugs.webkit.org/show_bug.cgi?id=206598

Reviewed by Konstantin Tokarev.

Add a stub for platformInitialize in InjectedBundleController.cpp which is
used for non-Cocoa ports. Remove the platform specific stubs.

* TestWebKitAPI/InjectedBundleController.cpp:
(TestWebKitAPI::InjectedBundleController::platformInitialize):
* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/PlatformWPE.cmake:
* TestWebKitAPI/PlatformWin.cmake:
* TestWebKitAPI/gtk/InjectedBundleControllerGtk.cpp: Removed.
* TestWebKitAPI/win/InjectedBundleControllerWin.cpp: Removed.
* TestWebKitAPI/wpe/InjectedBundleControllerWPE.cpp: Removed.

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

6 months ago[JSC] DateMath should accept more ISO-8601 timezone designators even if they are...
ysuzuki@apple.com [Wed, 22 Jan 2020 20:55:31 +0000 (20:55 +0000)]
[JSC] DateMath should accept more ISO-8601 timezone designators even if they are not included in ECMA262 to produce expected results in the wild code
https://bugs.webkit.org/show_bug.cgi?id=160287

Reviewed by Ross Kirsling.

JSTests:

* stress/relaxed-timezone-designators.js: Added.
(shouldBe):
(parsedDate):

Source/WTF:

While ECMA262[1] always requires ":" in a timezone designator between hours and minutes (like, "hh:mm"),
ISO-8601 can accept additional forms, "+hh" and "+hhmm". This patch relaxes our Date parsing to accept this
type of timezone designators so that we can accept wider forms of date time formats. This addition does not
break the existing parsing rules since '+-' prefix can clarify that following sequences are timezones.

[1]: https://tc39.es/ecma262/#sec-date-time-string-format
[2]: https://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators

* wtf/DateMath.cpp:
(WTF::parseES5TimePortion):
(WTF::parseES5DateFromNullTerminatedCharacters):

LayoutTests:

* js/date-parse-test-expected.txt:
* js/script-tests/date-parse-test.js:

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

6 months agoFix SDK availability macros
krollin@apple.com [Wed, 22 Jan 2020 20:52:50 +0000 (20:52 +0000)]
Fix SDK availability macros
https://bugs.webkit.org/show_bug.cgi?id=206463
<rdar://problem/58581906>

Reviewed by Timothy Hatcher.

Bug 197841 updated WebKit.xcconfig with regards to when it runs a
header post-processing script. This post-processing script grovels
over our exported headers, changing macros like WK_API_AVAILABLE to
the standard API_AVAILABLE. Because of the change in Bug 197841, the
script was no longer being run when preparing macOS 10.15 SDKs, which
was breaking those SDKs. Fix this by reverting the change, allowing
the macros to be replaced for macOS 10.15.

We also need to touch WKFoundation.h in order to support incremental
builds. If we don't, then the version of WKFoundation.h that was
exported in the previous build and that was incorrectly post-processed
would remain incorrectly post-processed. Touch the file so that it
will get re-exported and re-post-processed.

No new tests - no added or changed functionality.

* Configurations/WebKit.xcconfig:
* Shared/API/Cocoa/WKFoundation.h:

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

6 months ago[GTK] Gardening, update TestExpectations
dpino@igalia.com [Wed, 22 Jan 2020 20:49:13 +0000 (20:49 +0000)]
[GTK] Gardening, update TestExpectations
https://bugs.webkit.org/show_bug.cgi?id=206590

Unreviewed gardening.

* platform/gtk/TestExpectations:

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

6 months ago[JSC] Add CheckArrayOrEmpty to handle the case when hoisting CheckArray for places...
ysuzuki@apple.com [Wed, 22 Jan 2020 20:45:37 +0000 (20:45 +0000)]
[JSC] Add CheckArrayOrEmpty to handle the case when hoisting CheckArray for places where input can be empty
https://bugs.webkit.org/show_bug.cgi?id=206571
<rdar://problem/58757016>

Reviewed by Saam Barati.

JSTests:

* stress/check-array-or-empty.js: Added.
(C):

Source/JavaScriptCore:

Since we hoist CheckArray too in DFGTypeCheckHoistingPhase, we have the same problem to CheckStructureOrEmpty: we
could insert CheckArray where the input can include Empty. We should have CheckArrayOrEmpty as we have CheckStructureOrEmpty
for CheckStructure: CheckArrayOrEmpty accepts empty or cell with specified array-modes.

* dfg/DFGAbstractInterpreter.h:
(JSC::DFG::AbstractInterpreter::filterArrayModes):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
(JSC::DFG::AbstractInterpreter<AbstractStateType>::filterArrayModes):
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::filterArrayModes):
* dfg/DFGAbstractValue.h:
* dfg/DFGArgumentsEliminationPhase.cpp:
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::convertCheckArrayOrEmptyToCheckArray):
(JSC::DFG::Node::hasArrayMode):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::checkArray):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGTypeCheckHoistingPhase.cpp:
(JSC::DFG::TypeCheckHoistingPhase::run):
* dfg/DFGValidate.cpp:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileCheckArrayOrEmpty):

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

6 months ago[WebGL] Skip tests on WebGL bot that are skipped on trunk/master
dino@apple.com [Wed, 22 Jan 2020 20:39:09 +0000 (20:39 +0000)]
[WebGL] Skip tests on WebGL bot that are skipped on trunk/master
https://bugs.webkit.org/show_bug.cgi?id=206609

Reviewed by Antoine Quint.

These three tests fail when trying to get external resources.

* webgl/TestExpectations:

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

6 months ago[JSC] Attempt to fix BytecodeIndex handling in 32bit
ysuzuki@apple.com [Wed, 22 Jan 2020 20:31:33 +0000 (20:31 +0000)]
[JSC] Attempt to fix BytecodeIndex handling in 32bit
https://bugs.webkit.org/show_bug.cgi?id=206577

Reviewed by Keith Miller.

This patch mechanically lists up places using Instruction* as BytecodeIndex and fixes it,
since 32bit also starts using an offset as BytecodeIndex. This patch also fixes several
places where LLInt PB is not handled correctly in 32bit after we start using PB register
even in 32bit.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::bytecodeIndexFromCallSiteIndex):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::reifyInlinedCallFrames):
(JSC::DFG::adjustAndJumpToTarget):
* jit/JITCall32_64.cpp:
(JSC::JIT::compileOpCall):
* jit/JITInlines.h:
(JSC::JIT::updateTopCallFrame):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_log_shadow_chicken_tail):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::emitPutByValWithCachedId):
(JSC::JIT::emit_op_try_get_by_id):
(JSC::JIT::emit_op_get_by_id_direct):
(JSC::JIT::emit_op_get_by_id):
(JSC::JIT::emit_op_get_by_id_with_this):
(JSC::JIT::emit_op_put_by_id):
(JSC::JIT::emit_op_in_by_id):
* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):
* llint/LowLevelInterpreter.cpp:
(JSC::CLoop::execute):
* runtime/SamplingProfiler.cpp:
(JSC::tryGetBytecodeIndex):
(JSC::SamplingProfiler::processUnverifiedStackTraces):

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

6 months ago[LFC] Do not create a FormattingContext to compute intrinsic width unless there's...
zalan@apple.com [Wed, 22 Jan 2020 19:45:59 +0000 (19:45 +0000)]
[LFC] Do not create a FormattingContext to compute intrinsic width unless there's some content.
https://bugs.webkit.org/show_bug.cgi?id=206581
<rdar://problem/58798593>

Reviewed by Antti Koivisto.

We should only construct a formatting context when it has some content.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::FormattingContext):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):

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

6 months agoREGRESSION (r254923): [mac-wk1] http/tests/inspector/network/har/har-page.html crashi...
zalan@apple.com [Wed, 22 Jan 2020 19:45:23 +0000 (19:45 +0000)]
REGRESSION (r254923): [mac-wk1] http/tests/inspector/network/har/har-page.html crashing in WebCore::Display::Box::contentBox()
https://bugs.webkit.org/show_bug.cgi?id=206600

Unreviewed.

r254923 missed this one place to turn off LFC integration.

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):

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

6 months agoFrequent NetworkConnectionToWebProcess::CookiesEnabled sync IPC when browsing reddit.com
cdumez@apple.com [Wed, 22 Jan 2020 19:31:15 +0000 (19:31 +0000)]
Frequent NetworkConnectionToWebProcess::CookiesEnabled sync IPC when browsing reddit.com
https://bugs.webkit.org/show_bug.cgi?id=206450

Reviewed by Darin Adler.

Source/WebCore:

Move HTTPCookieAcceptPolicy.h header from WebKit to WebCore so that the HTTPCookieAcceptPolicy enum
can be used in NetworkStorageSession. Replace NetworkStorageSession::cookiesEnabled() with a more
detailed NetworkStorageSession::cookieAcceptPolicy() method.

* WebCore.xcodeproj/project.pbxproj:
* loader/CookieJar.cpp:
(WebCore::CookieJar::cookiesEnabled const):
* platform/network/HTTPCookieAcceptPolicy.h: Renamed from Source/WebKit/Shared/HTTPCookieAcceptPolicy.h.
* platform/network/NetworkStorageSession.cpp:
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNetWin.cpp:
(WebCore::NetworkStorageSession::cookieAcceptPolicy const):
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::cookieAcceptPolicy const):
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::NetworkStorageSession::cookieAcceptPolicy const):
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::cookieAcceptPolicy const):

Source/WebKit:

Frequent NetworkConnectionToWebProcess::CookiesEnabled sync IPC when browsing reddit.com. This
happens every time the page script calls navigator.cookieEnabled. To address the issue, we now
store the "cookie accept policy" on the WebContent process side. This allows us to know
synchronously on the WebContent process if cookies are enabled or not and without any IPC to
the network process. To achieve this, I added a new cookieAcceptPolicy member to
NetworkProcessConnectionInfo so that the WebContent process is aware of the initial policy when
it connects to the network process. The policy on the WebContent process side is then kept up
to date via IPCs from the network process to the WebContent processes whenever the cookie
accept policy changes.

* NetworkProcess/Cookies/WebCookieManager.cpp:
(WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
(WebKit::WebCookieManager::getHTTPCookieAcceptPolicy):
* NetworkProcess/Cookies/WebCookieManager.h:
* NetworkProcess/Cookies/WebCookieManager.messages.in:
* NetworkProcess/Cookies/curl/WebCookieManagerCurl.cpp:
* NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
* NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::cookieAcceptPolicyChanged):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
(WebKit::NetworkProcess::cookieAcceptPolicyChanged):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkProcessCreationParameters.h:
* Shared/WebProcessCreationParameters.h:
* UIProcess/API/APIHTTPCookieStore.cpp:
(API::HTTPCookieStore::setHTTPCookieAcceptPolicy):
(API::HTTPCookieStore::setHTTPCookieAcceptPolicyInDefaultUIProcessCookieStore):
* UIProcess/API/APIHTTPCookieStore.h:
* UIProcess/API/C/WKAPICast.h:
(WebKit::toHTTPCookieAcceptPolicy):
(WebKit::toAPI):
* UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm:
(API::toNSHTTPCookieAcceptPolicy):
(API::HTTPCookieStore::setHTTPCookieAcceptPolicyInDefaultUIProcessCookieStore):
* UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
* UIProcess/API/Cocoa/WKProcessPool.mm:
(toHTTPCookieAcceptPolicy):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::openNetworkProcessConnection):
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebProcessPool.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::NetworkProcessConnection):
(WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
(WebKit::NetworkProcessConnection::cookiesEnabled):
(WebKit::NetworkProcessConnection::cookieAcceptPolicyChanged):
* WebProcess/Network/NetworkProcessConnection.h:
(WebKit::NetworkProcessConnection::create):
* WebProcess/Network/NetworkProcessConnection.messages.in:
* WebProcess/Network/NetworkProcessConnectionInfo.h:
(WebKit::NetworkProcessConnectionInfo::encode const):
(WebKit::NetworkProcessConnectionInfo::decode):
* WebProcess/WebPage/WebCookieJar.cpp:
(WebKit::WebCookieJar::cookiesEnabled const):
- Return false early if the document has no frame / page (cookie-averse as per spec)
- Return false early if ITP is enabled and it is a third-party iframe without storage
  access. This bypasses the sync IPC call completely for such iframes.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::ensureNetworkProcessConnection):

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

6 months agoStop doing synchronous DecidePolicyForNavigationActionSync IPCs for initially empty...
cdumez@apple.com [Wed, 22 Jan 2020 19:29:49 +0000 (19:29 +0000)]
Stop doing synchronous DecidePolicyForNavigationActionSync IPCs for initially empty document loads
https://bugs.webkit.org/show_bug.cgi?id=206458

Reviewed by Alex Christensen.

Stop doing synchronous DecidePolicyForNavigationActionSync IPCs for initially empty document loads. Instead, we
now do regular asynchronous DecidePolicyForNavigationAction IPCs for such loads and we ignore the response from
the client, allowing WebCore to proceed with the load synchronously.

* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):

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

6 months agowebkitpy: Make logging during ImageDiff crashes accurate
jbedard@apple.com [Wed, 22 Jan 2020 18:55:45 +0000 (18:55 +0000)]
webkitpy: Make logging during ImageDiff crashes accurate
https://bugs.webkit.org/show_bug.cgi?id=206542

Reviewed by Aakash Jain.

When ImageDiff crashes, the generated logs are not accurate, they
reference a crash in test output when the test will actually fail
with an Image failure. The owner of a ServerProcess should be able
to customize this error message.

* Scripts/webkitpy/port/image_diff.py:
(ImageDiffer._start): Pass ImageDiff specific crash message.
* Scripts/webkitpy/port/port_testcase.py:
(PortTestCase.test_diff_image.make_proc): Match ImageDiff calcite.
(PortTestCase.test_diff_image_passed): Ditto.
(PortTestCase.test_diff_image_failed): Ditto.
(PortTestCase.test_diff_image_crashed.make_proc): Ditto.
* Scripts/webkitpy/port/server_process.py:
(ServerProcess.__init__): Support a custom message when the process crashes.
(ServerProcess.write): Ditto.
(ServerProcess._wait_for_data_and_update_buffers_using_select): Ditto.
(ServerProcess.has_crashed): Ditto.
* Scripts/webkitpy/port/server_process_mock.py:
(MockServerProcess.__init__): Match the ServerProcess constructor.
* Scripts/webkitpy/port/simulator_process.py:
(SimulatorProcess.__init__): Support a custom message when the process crashes.

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

6 months agoFlaky Test: svg/wicd/rightsizing-grid.xhtml
ryanhaddad@apple.com [Wed, 22 Jan 2020 18:19:22 +0000 (18:19 +0000)]
Flaky Test: svg/wicd/rightsizing-grid.xhtml
https://bugs.webkit.org/show_bug.cgi?id=203222

Unreviewed test gardening.

* platform/ios/TestExpectations: Mark test as flaky.
* platform/mac/TestExpectations: Ditto.

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

6 months ago[LFC] Do not create a FormattingContext unless there's content to layout.
zalan@apple.com [Wed, 22 Jan 2020 17:07:27 +0000 (17:07 +0000)]
[LFC] Do not create a FormattingContext unless there's content to layout.
https://bugs.webkit.org/show_bug.cgi?id=206570
<rdar://problem/58785735>

Reviewed by Antti Koivisto.

We still construct "no-op" FormattingContexts through the computeIntrinsicWidth* codepath (see webkit.org/b/206581).

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::FormattingContext):
(WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutTableCellBox):

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

6 months agoThrow away baseline code if there is an optimized replacement
sbarati@apple.com [Wed, 22 Jan 2020 17:06:32 +0000 (17:06 +0000)]
Throw away baseline code if there is an optimized replacement
https://bugs.webkit.org/show_bug.cgi?id=202503
<rdar://problem/58552041>

Reviewed by Yusuke Suzuki.

This patch's goal is to help us save JIT executable memory by throwing
away baseline code when it has an optimized replacement. To make it
easy to reason about, we do this when finalizing a GC, when the CodeBlock
is not on the stack, and when no OSR exits are linked to jump to the baseline
code. Also, as a measure to combat a performance regression, we only throw
away code on the second GC cycle in which it is eligible for this.
When we downgrade Baseline to LLInt, we also throw away all JIT data
and unlink all incoming calls.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::finalizeUnconditionally):
(JSC::CodeBlock::resetJITData):
(JSC::CodeBlock::optimizedReplacement):
(JSC::CodeBlock::hasOptimizedReplacement):
(JSC::CodeBlock::tallyFrequentExitSites):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::setJITCode):
* dfg/DFGDriver.cpp:
(JSC::DFG::compileImpl):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::callerReturnPC):
(JSC::DFG::adjustAndJumpToTarget):
* heap/CodeBlockSet.cpp:
(JSC::CodeBlockSet::isCurrentlyExecuting):
* heap/CodeBlockSet.h:
* heap/Heap.cpp:
(JSC::Heap::finalizeUnconditionalFinalizers):
(JSC::Heap::runEndPhase):

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

6 months agoTest history links on the dashboard should go to the new results database
jlewis3@apple.com [Wed, 22 Jan 2020 16:59:30 +0000 (16:59 +0000)]
Test history links on the dashboard should go to the new results database
https://bugs.webkit.org/show_bug.cgi?id=205821

Reviewed by Jonathan Bedard.

Made changes to the various locations that we use the old database in the main dashboard
and test results pages.

* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui.js:
(ui.urlForFlakinessDashboard):
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results.js:
(ui.results.FlakinessData.base._handleMessage):
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/WebKitTestHistory.js:
(TestHistory):
(TestHistory.prototype.historyPageURLForTest):
* BuildSlaveSupport/build.webkit.org-config/templates/root.html:

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

6 months ago[IPC Hardening] Only process Messages::NetworkProcess messages when sent by the UIProcess
cdumez@apple.com [Wed, 22 Jan 2020 16:51:12 +0000 (16:51 +0000)]
[IPC Hardening] Only process Messages::NetworkProcess messages when sent by the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=206558

Unreviewed post-landing review comments from Darin Adler after r254892.

* Platform/IPC/StringReference.h:
(IPC::operator==):
(IPC::operator!=):
(IPC::StringReference::Hash::equal):
(IPC::StringReference::operator==): Deleted.
(IPC::StringReference::operator!=): Deleted.

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

6 months ago[LFC][Integration] Disable integration to see performance impact
antti@apple.com [Wed, 22 Jan 2020 15:43:38 +0000 (15:43 +0000)]
[LFC][Integration] Disable integration to see performance impact
https://bugs.webkit.org/show_bug.cgi?id=206576
<rdar://problem/58562185>

Reviewed by Zalan Bujtas.

Source/WebCore:

Disable by default for now to get a clearer picture of the performance impact.

* page/RuntimeEnabledFeatures.h:

Source/WebKit:

* Shared/WebPreferences.yaml:

Tools:

* DumpRenderTree/TestOptions.h:

LayoutTests:

* fast/dom/Range/getBoundingClientRect-expected.txt:
* platform/ios/fast/text/whitespace/pre-break-word-expected.txt:
* platform/ios/fast/text/word-break-expected.txt:
* platform/mac/fast/text/hyphenate-limit-lines-expected.txt:
* platform/mac/fast/text/whitespace/pre-break-word-expected.txt:
* platform/mac/fast/text/word-break-expected.txt:

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

6 months ago[LFC][BFC] No need to special case formatting context root layout
zalan@apple.com [Wed, 22 Jan 2020 15:40:47 +0000 (15:40 +0000)]
[LFC][BFC] No need to special case formatting context root layout
https://bugs.webkit.org/show_bug.cgi?id=206569
<rdar://problem/58784767>

Reviewed by Antti Koivisto.

Let's move out all the formatting context layout logic from layoutFormattingContextRoot.

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot): Deleted.
* layout/blockformatting/BlockFormattingContext.h:

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

6 months ago[LFC][BFC] Move float avoider special available width handling to BlockFormattingCont...
zalan@apple.com [Wed, 22 Jan 2020 15:19:12 +0000 (15:19 +0000)]
[LFC][BFC] Move float avoider special available width handling to BlockFormattingContext::computeWidthAndMargin
https://bugs.webkit.org/show_bug.cgi?id=206567
<rdar://problem/58783979>

Reviewed by Antti Koivisto.

Now we can move the compute* functions from layoutFormattingContextRoot to the main loop in layoutInFlowContent.

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot):
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
* layout/blockformatting/BlockFormattingContext.h:

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

6 months agoFix fetch/api/policies/referrer-origin-worker.html
commit-queue@webkit.org [Wed, 22 Jan 2020 14:48:42 +0000 (14:48 +0000)]
Fix fetch/api/policies/referrer-origin-worker.html
 https://bugs.webkit.org/show_bug.cgi?id=206520

Patch by Rob Buis <rbuis@igalia.com> on 2020-01-22
Reviewed by Youenn Fablet.

Revert, it was the wrong way to fix this

* web-platform-tests/fetch/api/policies/referrer-origin-worker-expected.txt:
* web-platform-tests/fetch/api/policies/referrer-origin-worker.html.headers: Removed.

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

6 months agoAdd logging of the source of a response used to respond a fetch event
youenn@apple.com [Wed, 22 Jan 2020 14:26:10 +0000 (14:26 +0000)]
Add logging of the source of a response used to respond a fetch event
https://bugs.webkit.org/show_bug.cgi?id=206426

Reviewed by Darin Adler.

Source/WebCore:

Add a DOMCache response source value.
This is set on responses created by DOMCache.
Update code that checks the source to handle this new value similary to ApplicationCache.
No change of behavior.

Add an internal test to verify a fetch response grabbed from DOM cache has the right source.

* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::updateRecords):
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::responseSource):
* loader/ResourceLoader.cpp:
(WebCore::logResourceResponseSource):
* platform/network/ResourceResponseBase.h:
* testing/Internals.cpp:
(WebCore::responseSourceToString):
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::processResponse):
Remove setting of the source to service worker, this is done in NetworkProcess
just before sending the response to the WebProcess.

Source/WebKit:

* NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
(WebKit::ServiceWorkerFetchTask::didReceiveResponse):
Log the source of the response.
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::havePerformedSecurityChecks const):
Add case of DOMCache, similar to ServiceWorker.

LayoutTests:

* http/wpt/cache-storage/cache-put-keys.https.any.js:
(cache_test):

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

6 months agoREGRESSION (r254893): Apple Win 10 Debug build failure
ddkilzer@apple.com [Wed, 22 Jan 2020 13:15:20 +0000 (13:15 +0000)]
REGRESSION (r254893): Apple Win 10 Debug build failure

Introduced by:
    Make RenderingMode and AlphaPremultiplication enum classes and move them to separate headers
    https://bugs.webkit.org/show_bug.cgi?id=206516

* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::ImageBuffer): Use RenderingMode::Unaccelerated.

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

6 months agoMove ImageBuffer utilities function to separate files
commit-queue@webkit.org [Wed, 22 Jan 2020 07:00:16 +0000 (07:00 +0000)]
Move ImageBuffer utilities function to separate files
https://bugs.webkit.org/show_bug.cgi?id=206519

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2020-01-21
Reviewed by Tim Horton.

These utilities function are merely related to the ImageData.

* SourcesGTK.txt:
* html/HTMLCanvasElement.cpp:
* platform/SourcesCairo.txt:
* platform/graphics/ImageBuffer.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::toData const):
(WebCore::writeFunction): Deleted.
(WebCore::encodeImage): Deleted.
* platform/graphics/cairo/ImageBufferUtilitiesCairo.cpp: Added.
(WebCore::writeFunction):
(WebCore::encodeImage):
(WebCore::data):
* platform/graphics/cairo/ImageBufferUtilitiesCairo.h: Added.
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::jpegUTI): Deleted.
(WebCore::utiFromImageBufferMIMEType): Deleted.
(WebCore::encodeImage): Deleted.
(WebCore::dataURL): Deleted.
(WebCore::dataVector): Deleted.
(WebCore::cfData): Deleted.
(WebCore::data): Deleted.
* platform/graphics/cg/ImageBufferDataCG.h:
* platform/graphics/cg/ImageBufferUtilitiesCG.cpp:
(WebCore::jpegUTI):
(WebCore::utiFromImageBufferMIMEType):
(WebCore::encodeImage):
(WebCore::cfData):
(WebCore::dataURL):
(WebCore::dataVector):
(WebCore::data):
* platform/graphics/cg/ImageBufferUtilitiesCG.h:
* platform/graphics/gtk/ImageBufferGtk.cpp: Removed.

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

6 months ago[JSC] Date parse logic should be less redundant
ross.kirsling@sony.com [Wed, 22 Jan 2020 03:11:39 +0000 (03:11 +0000)]
[JSC] Date parse logic should be less redundant
https://bugs.webkit.org/show_bug.cgi?id=206560

Reviewed by Darin Adler.

Source/JavaScriptCore:

Our date parsing logic is doing an excessive amount of NaN-checking;
let's streamline this by having one JSC-side helper function instead of two.

* runtime/JSDateMath.cpp:
(JSC::parseDate):
(JSC::parseDateFromNullTerminatedCharacters): Deleted.
(JSC::parseES5DateFromNullTerminatedCharacters): Deleted.

Source/WTF:

* wtf/DateMath.cpp:
(WTF::parseDateFromNullTerminatedCharacters):
* wtf/DateMath.h:
Align function signature with parseES5DateFromNullTerminatedCharacters.
Namely, drop the integer out param and flip the boolean one.

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

6 months agoA partially selected RTL text is placed at a wrong vertical position if it has a...
Hironori.Fujii@sony.com [Wed, 22 Jan 2020 01:59:34 +0000 (01:59 +0000)]
A partially selected RTL text is placed at a wrong vertical position if it has a vertical initial advance
https://bugs.webkit.org/show_bug.cgi?id=205990

Reviewed by Darin Adler.

Source/WebCore:

FontCascade::getGlyphsAndAdvancesForComplexText returned only X
position of the first glyph, but Y position.

Because GlyphBuffer is using glyph advances instead glyph
positions, it's not simple to get the first glyph position of the
part of a RTL texts.
FontCascade::getGlyphsAndAdvancesForComplexText is calculating the
X position of it by subtracting right side part width from the
total width. It should do same for Y position.

macOS and iOS ports don't use the code to draw selected texts.

Test: fast/text/initial-advance-selected-text.html

* platform/graphics/ComplexTextController.cpp:
(WebCore::ComplexTextController::offsetForPosition):
(WebCore::ComplexTextController::adjustGlyphsAndAdvances):
* platform/graphics/ComplexTextController.h: Replaced m_totalWidth with m_totalAdvance.
(WebCore::ComplexTextController::totalWidth const): Removed.
(WebCore::ComplexTextController::totalAdvance const): Added.
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::glyphBufferForTextRun const): Changed the return type from float to FloatSize.
(WebCore::FontCascade::drawText const):
(WebCore::FontCascade::displayListForTextRun const):
(WebCore::FontCascade::getGlyphsAndAdvancesForComplexText const): Changed the return type from float to FloatSize.
(WebCore::FontCascade::drawGlyphBuffer const):
(WebCore::FontCascade::floatWidthForComplexText const):
(WebCore::FontCascade::adjustSelectionRectForComplexText const):
(WebCore::FontCascade::drawEmphasisMarksForComplexText const):
(WebCore::FontCascade::dashesForIntersectionsWithRect const):
* platform/graphics/FontCascade.h:
* platform/graphics/GlyphBuffer.h:
(WebCore::toFloatSize): Added.

Tools:

* TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp:
Replaced all "controller.totalWidth()" with "controller.totalAdvance().width()".

LayoutTests:

* fast/text/initial-advance-selected-text-expected.html: Added.
* fast/text/initial-advance-selected-text.html: Added.

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

6 months ago[Win][WK2] Pressing space key on text input form scrolls the page
Hironori.Fujii@sony.com [Wed, 22 Jan 2020 01:54:38 +0000 (01:54 +0000)]
[Win][WK2] Pressing space key on text input form scrolls the page
https://bugs.webkit.org/show_bug.cgi?id=201632

Reviewed by Ross Kirsling.

r223262 was add WebPage::performDefaultBehaviorForKeyEvent for
Windows port by copying GTK port's implementation. But, Windows
port is using unique key event processing. It dispatches
WebEvent::RawKeyDown and WebEvent::Char separately even though
other ports dispatch only WebEvent::KeyDown by unifying them.

Because WebPage::performDefaultBehaviorForKeyEvent handled
WebEvent::RawKeyDown of space key to scroll page, and consumed the
event, the keypress event of space key wasn't dispatched.

The keypress event of a space key is handled in
EventHandler::defaultSpaceEventHandler.
performDefaultBehaviorForKeyEvent don't need to do it.

Tests: Coverted by fast/events/space-scroll-event.html

* WebProcess/WebPage/win/WebPageWin.cpp:
(WebKit::WebPage::performDefaultBehaviorForKeyEvent): Don't handle VK_SPACE.

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

6 months ago[EME] Only emit an array of persistent-usage-records when we discover > 1
commit-queue@webkit.org [Wed, 22 Jan 2020 01:45:27 +0000 (01:45 +0000)]
[EME] Only emit an array of persistent-usage-records when we discover > 1
https://bugs.webkit.org/show_bug.cgi?id=206205
<rdar://problem/58691769>

Patch by Jer Noble <jer.noble@apple.com> on 2020-01-21
Reviewed by Eric Carlson.

The persistent-usage-record cache should never have more than one record per sessionId, but
that assumption is not enforced in the file format. To not break clients that aren't
expecting a serialized plist array, only emit an array when more than one matching data item
is found.

* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):

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

6 months agoAdd missing NS_NOESCAPE to CFNetwork SPI
achristensen@apple.com [Wed, 22 Jan 2020 01:30:05 +0000 (01:30 +0000)]
Add missing NS_NOESCAPE to CFNetwork SPI
https://bugs.webkit.org/show_bug.cgi?id=206561
<rdar://problem/58774422>

Reviewed by Joe Pecoraro.

Source/WebCore:

* platform/network/cocoa/NetworkStorageSessionCocoa.mm:

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:

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

6 months ago[WebAuthn] Incorporate more detailed UnknownError messages for LocalAuthenticator
jiewen_tan@apple.com [Wed, 22 Jan 2020 01:25:57 +0000 (01:25 +0000)]
[WebAuthn] Incorporate more detailed UnknownError messages for LocalAuthenticator
https://bugs.webkit.org/show_bug.cgi?id=191530

Reviewed by Brent Fulgham.

Source/WebKit:

This patch replaces UnknownError messages within LocalAuthenticator with the LOG_ERROR
messages. At the meantime, it enhances MockLocalConnection::getAttestation to return
errors instead of assertions.

* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::makeCredential):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
(WebKit::LocalAuthenticator::getAssertion):
(WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
* UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
(WebKit::MockLocalConnection::getAttestation const):

LayoutTests:

* http/wpt/webauthn/public-key-credential-create-failure-local.https.html:

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

6 months agoMake RenderingMode and AlphaPremultiplication enum classes and move them to separate...
commit-queue@webkit.org [Wed, 22 Jan 2020 00:26:24 +0000 (00:26 +0000)]
Make RenderingMode and AlphaPremultiplication enum classes and move them to separate headers
https://bugs.webkit.org/show_bug.cgi?id=206516

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2020-01-21
Reviewed by Tim Horton.

Source/WebCore:

RenderingMode and AlphaPremultiplication need to be encoded and decoded
when they are sent from the WebProcess to the GPUProcess.

* Headers.cmake:
* Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp:
(WebCore::ClipboardItemBindingsDataSource::ClipboardItemTypeLoader::sanitizeDataIfNeeded):
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readImageBitmap):
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::image):
* html/CustomPaintCanvas.cpp:
(WebCore::CustomPaintCanvas::copiedImage const):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createImageBuffer const):
* html/ImageBitmap.cpp:
* html/OffscreenCanvas.cpp:
(WebCore::OffscreenCanvas::transferToImageBitmap):
(WebCore::OffscreenCanvas::createImageBuffer const):
(WebCore::OffscreenCanvas::takeImageBuffer const):
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::createCompositingBuffer):
(WebCore::CanvasRenderingContext2DBase::createPattern):
* html/canvas/ImageBitmapRenderingContext.cpp:
(WebCore::ImageBitmapRenderingContext::isAccelerated const):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::LRUImageBufferCache::imageBuffer):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
* page/FrameSnapshotting.cpp:
(WebCore::snapshotFrameRectWithClip):
* platform/graphics/AlphaPremultiplication.h: Added.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::nativeImageForCurrentFrameRespectingOrientation):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::renderingMode const):
* platform/graphics/GraphicsTypes.cpp:
* platform/graphics/GraphicsTypes.h:
* platform/graphics/ImageBuffer.h:
* platform/graphics/RenderingMode.h: Added.
* platform/graphics/ShadowBlur.cpp:
(WebCore::ScratchBuffer::getScratchBuffer):
(WebCore::ShadowBlur::drawRectShadowWithoutTiling):
(WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
(WebCore::ShadowBlur::drawRectShadowWithTiling):
(WebCore::ShadowBlur::drawInsetShadowWithTiling):
(WebCore::ShadowBlur::drawShadowLayer):
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBufferData::~ImageBufferData):
(WebCore::ImageBuffer::ImageBuffer):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::ImageBuffer):
* platform/graphics/cg/ImageBufferDataCG.h:
* platform/graphics/filters/Filter.h:
* platform/graphics/texmap/BitmapTexture.cpp:
(WebCore::BitmapTexture::updateContents):
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::ImageBuffer):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::imageBuffer const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
* rendering/shapes/Shape.cpp:
(WebCore::Shape::createRasterShape):
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::applyClippingToContext):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::applyResource):
* rendering/svg/RenderSVGResourceMasker.cpp:
(WebCore::RenderSVGResourceMasker::applyResource):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::nativeImageForCurrentFrame):

Source/WebKitLegacy/mac:

* WebCoreSupport/WebContextMenuClient.mm:
(WebContextMenuClient::imageForCurrentSharingServicePickerItem):

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

6 months ago[IPC Hardening] Only process Messages::NetworkProcess messages when sent by the UIProcess
cdumez@apple.com [Wed, 22 Jan 2020 00:08:40 +0000 (00:08 +0000)]
[IPC Hardening] Only process Messages::NetworkProcess messages when sent by the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=206558
<rdar://problem/58733679>

Reviewed by Alex Christensen.

Port UpdateQuotaBasedOnSpaceUsageForTesting IPC from the NetworkProcess to the NetworkConnectionToWebProcess
since it is sent by the WebContent process. As a result, we can now stop forwarding all Messages::NetworkProcess
IPC messages from the WebContent process to the NetworkProcess class.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
(WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
(WebKit::NetworkConnectionToWebProcess::updateQuotaBasedOnSpaceUsageForTesting):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::didReceiveMessage):
(WebKit::NetworkProcess::didReceiveSyncMessage):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* Platform/IPC/StringReference.h:
(IPC::StringReference::operator!=):
* WebProcess/Cache/WebCacheStorageConnection.cpp:
(WebKit::WebCacheStorageConnection::updateQuotaBasedOnSpaceUsage):

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

6 months agoUnreviewed, rolling out r254807 and r254849.
commit-queue@webkit.org [Tue, 21 Jan 2020 23:38:50 +0000 (23:38 +0000)]
Unreviewed, rolling out r254807 and r254849.
https://bugs.webkit.org/show_bug.cgi?id=206559

Broke page up/page down on macOW (Requested by smfr on
#webkit).

Reverted changesets:

"Add support for scroll behavior relies on ScrollAnimation of
the Web process"
https://bugs.webkit.org/show_bug.cgi?id=204882
https://trac.webkit.org/changeset/254807

"Add support for scroll behavior relies on ScrollAnimation of
the Web process"
https://bugs.webkit.org/show_bug.cgi?id=204882
https://trac.webkit.org/changeset/254849

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

6 months agoimported/w3c/web-platform-tests/html/dom/idlharness.worker.html is timing out on...
ryanhaddad@apple.com [Tue, 21 Jan 2020 23:32:57 +0000 (23:32 +0000)]
imported/w3c/web-platform-tests/html/dom/idlharness.worker.html is timing out on Mojave wk1 debug EWS
https://bugs.webkit.org/show_bug.cgi?id=206503

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations: Mark the test as failing to speed up EWS while we investigate.

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

6 months agoBuild fix.
achristensen@apple.com [Tue, 21 Jan 2020 23:27:11 +0000 (23:27 +0000)]
Build fix.

* rendering/updating/RenderTreeBuilderInline.cpp:
Add missing include.

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

6 months agoAdd Legacy WebKit SPI and WebKit IPI to show and hide placeholder
dbates@webkit.org [Tue, 21 Jan 2020 23:10:27 +0000 (23:10 +0000)]
Add Legacy WebKit SPI and WebKit IPI to show and hide placeholder
https://bugs.webkit.org/show_bug.cgi?id=206459
<rdar://problem/58700534>

Reviewed by Wenson Hsieh.

Source/WebCore:

Adds setter and getter to update whether the placeholder can be shown.

Test: fast/forms/placeholder-show-and-hide-via-setCanShowPlaceholder.html

* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::HTMLTextFormControlElement): Initialize state. Default to can show
the placeholder to keep the behavior we have currently.
(WebCore::HTMLTextFormControlElement::placeholderShouldBeVisible const): Modified to account for m_canShowPlaceholder.
(WebCore::HTMLTextFormControlElement::setCanShowPlaceholder): Added. Update state and invalidate style.
* html/HTMLTextFormControlElement.h:
(WebCore::HTMLTextFormControlElement::canShowPlaceholder const): Added.
* testing/Internals.cpp:
(WebCore::Internals::setCanShowPlaceholder): Added. For testing purposes.
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

Add Modern WebKit IPI to control whether the placeholder can be shown or not when a form
control is empty. This is for aesthetics.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setCanShowPlaceholder): Added.
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setCanShowPlaceholder): Added. Maps the input text to its element. If it's
a HTML text form control element then calls through to HTMLTextFormControlElement::setCanShowPlaceholder().
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
Added new message.

Source/WebKitLegacy/mac:

Add Legacy WebKit SPI to allow a client to control whether the placeholder can be shown or
not when a form control is empty. This is for aesthetics.

* DOM/DOMHTMLInputElement.mm:
(-[DOMHTMLInputElement canShowPlaceholder]): Added.
(-[DOMHTMLInputElement setCanShowPlaceholder:]): Added.
* DOM/DOMHTMLInputElementPrivate.h:
* DOM/DOMHTMLTextAreaElement.mm:
(-[DOMHTMLTextAreaElement canShowPlaceholder]): Added.
(-[DOMHTMLTextAreaElement setCanShowPlaceholder:]): Added.
* DOM/DOMHTMLTextAreaElementPrivate.h:

LayoutTests:

Adds a new test to ensure that HTMLTextFormControlElement::setCanShowPlaceholder() works.

* fast/forms/placeholder-show-and-hide-via-setCanShowPlaceholder-expected.txt: Added.
* fast/forms/placeholder-show-and-hide-via-setCanShowPlaceholder.html: Added.

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

6 months agoREGRESSION (r254856?): [Win] http/tests/security/same-origin-websql-blocked.html...
sihui_liu@apple.com [Tue, 21 Jan 2020 22:57:01 +0000 (22:57 +0000)]
REGRESSION (r254856?): [Win] http/tests/security/same-origin-websql-blocked.html and 2 fast/dom/Window/window-function-* tests failing
https://bugs.webkit.org/show_bug.cgi?id=206552

Unreviewed fix after r254856. r254856 wanted to enable WebSQL on layout tests but enableWebSQL was set to false.

* DumpRenderTree/TestOptions.h:

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

6 months agoProvisionalPageProxy::loadData should pass last navigation's shouldOpenExternalURLsPo...
jiewen_tan@apple.com [Tue, 21 Jan 2020 22:51:41 +0000 (22:51 +0000)]
ProvisionalPageProxy::loadData should pass last navigation's shouldOpenExternalURLsPolicy flag to WebPageProxy
https://bugs.webkit.org/show_bug.cgi?id=206462
<rdar://problem/57468718>

Reviewed by Chris Dumez.

Source/WebKit:

Covered by API tests.

This patch also does it for ProvisionalPageProxy::loadRequest.

* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::loadData):
(WebKit::ProvisionalPageProxy::loadRequest):
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::continueNavigationInNewProcess):

Tools:

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

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

6 months agoAdd build flag for stale-while-revalidate
commit-queue@webkit.org [Tue, 21 Jan 2020 22:33:03 +0000 (22:33 +0000)]
Add build flag for stale-while-revalidate
https://bugs.webkit.org/show_bug.cgi?id=204169

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

.:

Add build flag for stale-while-revalidate to make it
independent from the NETWORK_CACHE_SPECULATIVE_REVALIDATION build flag.

* Source/cmake/OptionsFTW.cmake:
* Source/cmake/OptionsMac.cmake:
* Source/cmake/WebKitFeatures.cmake:

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:
* NetworkProcess/cache/AsyncRevalidation.cpp:
* NetworkProcess/cache/AsyncRevalidation.h:
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::responseNeedsRevalidation):
(WebKit::NetworkCache::makeStoreDecision):
(WebKit::NetworkCache::Cache::retrieve):
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

6 months agoIPC::Decoder should use nullptr as invalid value
ddkilzer@apple.com [Tue, 21 Jan 2020 22:13:18 +0000 (22:13 +0000)]
IPC::Decoder should use nullptr as invalid value
<https://webkit.org/b/203880>
<rdar://problem/53159906>

Follow-up fix noticed by Chris Dumez.

* Platform/IPC/Decoder.cpp:
(IPC::alignedBufferIsLargeEnoughToContain): Fix typo in comment.

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

6 months ago[WTF] AtomStringTable should be small
ysuzuki@apple.com [Tue, 21 Jan 2020 22:05:43 +0000 (22:05 +0000)]
[WTF] AtomStringTable should be small
https://bugs.webkit.org/show_bug.cgi?id=206400

Reviewed by Sam Weinig.

Source/WebCore:

* dom/GCReachableRef.h:
(WebCore::GCReachableRef::GCReachableRef):
* dom/QualifiedName.h:
(WebCore::QualifiedName::hashTableDeletedValue):

Source/WTF:

AtomStringTable is the largest hashtable typically. It takes more
than 256KB per WebProcess (sometimes, it took 1MB or more).
This patch leverages PackedPtr to compact it from 8 bytes per entry
to 6 bytes per entry.

While this is still large, we should investigate how to compact C++
pointers in 4 bytes[1] to shrink memory footprint, since WebKit
memory is used by Vector and HashTable fulfilled with pointers.

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

* wtf/DumbPtrTraits.h:
(WTF::DumbPtrTraits::hashTableDeletedValue):
(WTF::DumbPtrTraits::isHashTableDeletedValue):
* wtf/Forward.h:
* wtf/HashTraits.h:
* wtf/Packed.h:
(WTF::Packed<T::Packed):
(WTF::Packed<T::isHashTableDeletedValue const):
(WTF::GetPtrHelper<PackedPtr<T>>::getPtr):
(WTF::PackedPtrTraits::hashTableDeletedValue):
(WTF::PackedPtrTraits::isHashTableDeletedValue):
(WTF::alignof): Deleted.
* wtf/Ref.h:
(WTF::Ref::Ref):
(WTF::Ref::isHashTableDeletedValue const):
(WTF::Ref::hashTableDeletedValue): Deleted.
* wtf/RefPtr.h:
(WTF::RefPtr::RefPtr):
(WTF::RefPtr::isHashTableDeletedValue const):
(WTF::RefPtr::hashTableDeletedValue): Deleted.
* wtf/text/AtomStringImpl.cpp:
(WTF::addToStringTable):
(WTF::CStringTranslator::equal):
(WTF::CStringTranslator::translate):
(WTF::UCharBufferTranslator::equal):
(WTF::UCharBufferTranslator::translate):
(WTF::HashAndUTF8CharactersTranslator::equal):
(WTF::HashAndUTF8CharactersTranslator::translate):
(WTF::SubstringTranslator::translate):
(WTF::SubstringTranslator8::equal):
(WTF::SubstringTranslator16::equal):
(WTF::LCharBufferTranslator::equal):
(WTF::LCharBufferTranslator::translate):
(WTF::BufferFromStaticDataTranslator::equal):
(WTF::BufferFromStaticDataTranslator::translate):
(WTF::AtomStringImpl::addSlowCase):
(WTF::AtomStringImpl::remove):
(WTF::AtomStringImpl::lookUpSlowCase):
(WTF::AtomStringImpl::lookUp):
* wtf/text/AtomStringTable.cpp:
(WTF::AtomStringTable::~AtomStringTable):
* wtf/text/AtomStringTable.h:
(WTF::AtomStringTable::table):
(): Deleted.
* wtf/text/StringHash.h:
(WTF::StringHash::hash):
(WTF::StringHash::equal):
(WTF::ASCIICaseInsensitiveHash::hash):
(WTF::ASCIICaseInsensitiveHash::equal):
* wtf/text/StringImpl.h:

Tools:

* TestWebKitAPI/Tests/WTF/HashMap.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/HashSet.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/Packed.cpp:
(TestWebKitAPI::TEST):

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

6 months ago[macOS] Add managed preference to allow synchronous XHR during page dismissal
cdumez@apple.com [Tue, 21 Jan 2020 22:04:13 +0000 (22:04 +0000)]
[macOS] Add managed preference to allow synchronous XHR during page dismissal
https://bugs.webkit.org/show_bug.cgi?id=206540
<rdar://problem/58644447>

Reviewed by Alex Christensen.

Add managed preference to allow synchronous XHR during page dismissal. This is temporarily needed by some
enterprise products until they can update their code.

* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.cpp:
(WebKit::defaultDisallowSyncXHRDuringPageDismissalEnabled):
* Shared/WebPreferencesDefaultValues.h:

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

6 months agoUnreviewed, rolling out r254876.
ryanhaddad@apple.com [Tue, 21 Jan 2020 22:02:34 +0000 (22:02 +0000)]
Unreviewed, rolling out r254876.

Broke Catalina builds.

Reverted changeset:

"Fix SDK availability macros"
https://bugs.webkit.org/show_bug.cgi?id=206463
https://trac.webkit.org/changeset/254876

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

6 months ago[iPad] YouTube does not automatically AirPlay when a route is selected from Control...
commit-queue@webkit.org [Tue, 21 Jan 2020 21:44:00 +0000 (21:44 +0000)]
[iPad] YouTube does not automatically AirPlay when a route is selected from Control Center
https://bugs.webkit.org/show_bug.cgi?id=206539
Source/WebCore:

Patch by Jer Noble <jer.noble@apple.com> on 2020-01-21
Reviewed by Eric Carlson.

No new tests; change affects an interaction with two platform features (local AirPlay
route picking and actual remote playback over AirPlay routes) that is not testable in
an automated fashion.

The underlying source of the bug is the difference in how the platform communitcates that an
AirPlay route was picked between iOS and macOS. On iOS, route changes are global and are
generally pushed up from AVPlayer notifications. On macOS, route changes are local to the
app and are pushed down from the UIProcess. But when MSE playback was enabled on iPadOS,
there was now a limbo where media playback was no longer using an AVPlayer, but at the same
time, route changes could be initiated globally. The end result is that MSE-based media
elements are never notified that they "should play to playback target", and no remote
playback events are ever fired.

To re-create the same macOS behavior when MSE-backed media elements are used on iPadOS,
re-use the existing route change detection logic in MediaSessionManageriOS to query whether
the newly established route supports AirPlay Video, and if so, send a message to the "now
playing" media element that it should begin AirPlaying, which will fail, but will trigger
the YouTube player to switch to a HLS-backed media element.

This requires renaming MediaPlaybackTargetMac -> MediaPlaybackTargetCocoa.

* SourcesCocoa.txt:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::activeVideoRouteDidChange):
(-[WebMediaSessionHelper activeAudioRouteDidChange:]):
* platform/graphics/avfoundation/MediaPlaybackTargetCocoa.h: Renamed from Source/WebCore/platform/graphics/avfoundation/MediaPlaybackTargetMac.h.
(WebCore::MediaPlaybackTargetCocoa::outputContext const):
* platform/graphics/avfoundation/MediaPlaybackTargetCocoa.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/MediaPlaybackTargetMac.mm.
(WebCore::MediaPlaybackTargetCocoa::create):
(WebCore::MediaPlaybackTargetCocoa::MediaPlaybackTargetCocoa):
(WebCore::MediaPlaybackTargetCocoa::~MediaPlaybackTargetCocoa):
(WebCore::MediaPlaybackTargetCocoa::targetContext const):
(WebCore::MediaPlaybackTargetCocoa::hasActiveRoute const):
(WebCore::MediaPlaybackTargetCocoa::deviceName const):
(WebCore::toMediaPlaybackTargetCocoa):
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
(WebCore::MediaPlaybackTargetPickerMac::playbackTarget):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):

Source/WebKit:

<rdar://problem/54173689>

Patch by Jer Noble <jer.noble@apple.com> on 2020-01-21
Reviewed by Eric Carlson.

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::playbackTargetSelected const):

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

6 months agoAdd SPI on WKURLSchemeTask to access WKFrameInfo of originating frame
commit-queue@webkit.org [Tue, 21 Jan 2020 21:25:31 +0000 (21:25 +0000)]
Add SPI on WKURLSchemeTask to access WKFrameInfo of originating frame
https://bugs.webkit.org/show_bug.cgi?id=204265
<rdar://57193883>

Patch by Alex Christensen <achristensen@webkit.org> on 2020-01-21
Reviewed by Brady Eidson.

Source/WebKit:

Covered by API tests.

* Shared/URLSchemeTaskParameters.cpp:
(WebKit::URLSchemeTaskParameters::encode const):
(WebKit::URLSchemeTaskParameters::decode):
* Shared/URLSchemeTaskParameters.h:
* UIProcess/API/Cocoa/WKURLSchemeTask.mm:
(-[WKURLSchemeTaskImpl _frame]):
* UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::startURLSchemeTaskShared):
(WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
* UIProcess/WebURLSchemeHandler.cpp:
(WebKit::WebURLSchemeHandler::startTask):
* UIProcess/WebURLSchemeHandler.h:
* UIProcess/WebURLSchemeTask.cpp:
(WebKit::WebURLSchemeTask::create):
(WebKit::WebURLSchemeTask::WebURLSchemeTask):
* UIProcess/WebURLSchemeTask.h:
(WebKit::WebURLSchemeTask::frameInfo const):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler):
* WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
(WebKit::WebURLSchemeHandlerProxy::startNewTask):
* WebProcess/WebPage/WebURLSchemeHandlerProxy.h:
* WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
(WebKit::WebURLSchemeTaskProxy::WebURLSchemeTaskProxy):
(WebKit::WebURLSchemeTaskProxy::startLoading):
(WebKit::WebURLSchemeTaskProxy::stopLoading):
(WebKit::WebURLSchemeTaskProxy::didComplete):
(WebKit::WebURLSchemeTaskProxy::hasLoader):
* WebProcess/WebPage/WebURLSchemeTaskProxy.h:
(WebKit::WebURLSchemeTaskProxy::create):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm:
(-[FrameSchemeHandler waitForAllRequests]):
(-[FrameSchemeHandler setExpectedWebView:]):
(-[FrameSchemeHandler webView:startURLSchemeTask:]):
(-[FrameSchemeHandler webView:stopURLSchemeTask:]):

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

6 months agoFix SDK availability macros
krollin@apple.com [Tue, 21 Jan 2020 21:12:12 +0000 (21:12 +0000)]
Fix SDK availability macros
https://bugs.webkit.org/show_bug.cgi?id=206463
<rdar://problem/58581906>

Reviewed by Timothy Hatcher.

Bug 197841 updated WebKit.xcconfig with regards to when it runs a
header post-processing script. This post-processing script grovels
over our exported headers, changing macros like WK_API_AVAILABLE to
the standard API_AVAILABLE. Because of the change in Bug 197841, the
script was no longer being run when preparing macOS 10.15 SDKs, which
was breaking those SDKs. Fix this by reverting the change, allowing
the macros to be replaced for macOS 10.15.

No new tests - no added or changed functionality.

* Configurations/WebKit.xcconfig:

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

6 months ago[LFC] Typed accessors for formatting states
antti@apple.com [Tue, 21 Jan 2020 21:08:55 +0000 (21:08 +0000)]
[LFC] Typed accessors for formatting states
https://bugs.webkit.org/show_bug.cgi?id=206538

Reviewed by Zalan Bujtas.

Almost all clients know what sort of formatting state they want and immediately cast it.

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::createFormattingContext):
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::formattingStateForBox const):
(WebCore::Layout::LayoutState::establishedFormattingState const):
(WebCore::Layout::LayoutState::establishedInlineFormattingState const):
(WebCore::Layout::LayoutState::establishedBlockFormattingState const):
(WebCore::Layout::LayoutState::establishedTableFormattingState const):

Typed function for getting established states.

(WebCore::Layout::LayoutState::ensureFormattingState):
(WebCore::Layout::LayoutState::ensureInlineFormattingState):

Also add a fast path for integrated layout.

(WebCore::Layout::LayoutState::ensureBlockFormattingState):
(WebCore::Layout::LayoutState::ensureTableFormattingState):

Typed function for creating states.

(WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): Deleted.
* layout/LayoutState.h:
(WebCore::Layout::LayoutState::hasInlineFormattingState const):
(WebCore::Layout::LayoutState::hasFormattingState const): Deleted.
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const):
* layout/displaytree/DisplayPainter.cpp:
(WebCore::Display::paintSubtree):
(WebCore::Display::Painter::paintInlineFlow):
* layout/inlineformatting/InlineFormattingContextQuirks.cpp:
(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::alignContentVertically):
(WebCore::Layout::LineBuilder::adjustBaselineAndLineHeight):
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::LineLayout):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputInlineRuns):

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

6 months agomacCatalyst: Two-finger click is dispatched to DOM as left click
timothy_horton@apple.com [Tue, 21 Jan 2020 21:07:52 +0000 (21:07 +0000)]
macCatalyst: Two-finger click is dispatched to DOM as left click
https://bugs.webkit.org/show_bug.cgi?id=206549

Reviewed by Simon Fraser.

* UIProcess/ios/WKMouseGestureRecognizer.mm:
(-[WKMouseGestureRecognizer createMouseEventWithType:forEvent:]):
(-[WKMouseGestureRecognizer touchesBegan:withEvent:]):
(-[WKMouseGestureRecognizer touchesMoved:withEvent:]):
(-[WKMouseGestureRecognizer touchesEnded:withEvent:]):
(-[WKMouseGestureRecognizer _hoverEntered:withEvent:]):
(-[WKMouseGestureRecognizer _hoverMoved:withEvent:]):
(-[WKMouseGestureRecognizer _hoverExited:withEvent:]):
(-[WKMouseGestureRecognizer createMouseEventWithType:]): Deleted.
We correctly say button=2 for ctrl-click, but not for secondary-button click.

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

6 months agoRevert suppressesConnectionTerminationOnSystemChange part of r254081
achristensen@apple.com [Tue, 21 Jan 2020 20:58:11 +0000 (20:58 +0000)]
Revert suppressesConnectionTerminationOnSystemChange part of r254081
https://bugs.webkit.org/show_bug.cgi?id=205751
<rdar://problem/58725096>

There was an API client that still hadn't migrated to the replacement SPI.

* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration suppressesConnectionTerminationOnSystemChange]):
(-[_WKProcessPoolConfiguration setSuppressesConnectionTerminationOnSystemChange:]):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):

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

6 months agoPerformance tests fail if stderr logging is encountered
bfulgham@apple.com [Tue, 21 Jan 2020 20:34:43 +0000 (20:34 +0000)]
Performance tests fail if stderr logging is encountered
https://bugs.webkit.org/show_bug.cgi?id=206544
<rdar://problem/58714766>

Reviewed by Per Arne Vollan.

Switch to LOG_ERROR, rather than WTFLogAlways, to avoid confusing the PerformanceTests system.

* Shared/Cocoa/SandboxExtensionCocoa.mm:
(WebKit::SandboxExtension::createHandleForReadByAuditToken):

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

6 months ago[bmalloc] Make use of LockHolder strict in some methods of Scavenger
basuke.suzuki@sony.com [Tue, 21 Jan 2020 20:33:40 +0000 (20:33 +0000)]
[bmalloc] Make use of LockHolder strict in some methods of Scavenger
https://bugs.webkit.org/show_bug.cgi?id=206460

Reviewed by Darin Adler.

For instance, Scavenger::runHoldingLock() assume the caller has lock and express that by its function name. This rule can be
strict by passing LockHolder and that's the way as other code do.

Same change to runSoonHoldingLock and scheduleIfUnderMemoryPressureHoldingLock.

* bmalloc/Scavenger.cpp:
(bmalloc::Scavenger::run):
(bmalloc::Scavenger::runSoon):
(bmalloc::Scavenger::scheduleIfUnderMemoryPressure):
(bmalloc::Scavenger::schedule):
(bmalloc::Scavenger::runHoldingLock): Renamed.
(bmalloc::Scavenger::runSoonHoldingLock): Renamed.
(bmalloc::Scavenger::scheduleIfUnderMemoryPressureHoldingLock): Renamed.
* bmalloc/Scavenger.h:

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

6 months ago[ews] commit-queue should check cq+ flag
aakash_jain@apple.com [Tue, 21 Jan 2020 20:05:49 +0000 (20:05 +0000)]
[ews] commit-queue should check cq+ flag
https://bugs.webkit.org/show_bug.cgi?id=206530

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
ValidatePatch._is_patch_cq_plus): Method to check cq+ flag on patch.
(ValidatePatch.start):
* BuildSlaveSupport/ews-build/factories.py:
* BuildSlaveSupport/ews-build/factories_unittest.py: Updated unit-tests.

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

6 months ago[WebGL2] Sampler objects
justin_fan@apple.com [Tue, 21 Jan 2020 19:48:05 +0000 (19:48 +0000)]
[WebGL2] Sampler objects
https://bugs.webkit.org/show_bug.cgi?id=126941
<rdar://problem/15002402>

Source/WebCore:

Implement enough of Samplers to pass the "samplers" conformance tests with ANGLE enabled.

Reviewed by Dean Jackson.

Covered by webgl/2.0.0/conformance2/samplers directory of tests.

* bindings/js/JSDOMConvertWebGL.cpp:
(WebCore::convertToJSValue):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::WebGL2RenderingContext):
(WebCore::WebGL2RenderingContext::initializeSamplerCache):
(WebCore::WebGL2RenderingContext::createSampler):
(WebCore::WebGL2RenderingContext::deleteSampler):
(WebCore::WebGL2RenderingContext::isSampler):
(WebCore::WebGL2RenderingContext::bindSampler):
(WebCore::WebGL2RenderingContext::samplerParameteri):
(WebCore::WebGL2RenderingContext::samplerParameterf):
(WebCore::WebGL2RenderingContext::getSamplerParameter):
(WebCore::WebGL2RenderingContext::bindTransformFeedback):
(WebCore::WebGL2RenderingContext::getParameter):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGLAny.h:
* html/canvas/WebGLSampler.cpp:
(WebCore::WebGLSampler::WebGLSampler):
(WebCore::WebGLSampler::deleteObjectImpl):
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLOpenGL::createSampler):
(WebCore::GraphicsContextGLOpenGL::deleteSampler):
(WebCore::GraphicsContextGLOpenGL::isSampler):
(WebCore::GraphicsContextGLOpenGL::bindSampler):
(WebCore::GraphicsContextGLOpenGL::samplerParameteri):
(WebCore::GraphicsContextGLOpenGL::samplerParameterf):
(WebCore::GraphicsContextGLOpenGL::getSamplerParameterfv):
(WebCore::GraphicsContextGLOpenGL::getSamplerParameteriv):

LayoutTests:

Reviewed by Dean Jackson.

Update to passing expectations, though these tests remain skipped until ANGLE backend is enabled.

* webgl/2.0.0/conformance2/samplers/sampler-drawing-test-expected.txt:
* webgl/2.0.0/conformance2/samplers/samplers-expected.txt:

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

6 months agoFix tvOS values in SUPPORTED_PLATFORMS
krollin@apple.com [Tue, 21 Jan 2020 19:40:47 +0000 (19:40 +0000)]
Fix tvOS values in SUPPORTED_PLATFORMS
https://bugs.webkit.org/show_bug.cgi?id=206435
<rdar://problem/58674587>

Reviewed by Alexey Proskuryakov.

A number of targets in WebKit have 'tvos' and 'tvsimulator' in
SUPPORTED_PLATFORMS. The correct values are 'appletvos' and
'appletvsimulator'. These should be updated to the correct ones as the
wrong values prevent the tvOS run destination from being usable in the
UI to build for tvOS.

Source/ThirdParty:

* gtest/xcode/Config/General.xcconfig:

Source/WebInspectorUI:

* Configurations/Base.xcconfig:

Tools:

* DumpRenderTree/mac/Configurations/Base.xcconfig:
* ImageDiff/cg/Configurations/Base.xcconfig:
* MiniBrowser/Configurations/Base.xcconfig:
* WebKitTestRunner/Configurations/Base.xcconfig:

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

6 months agoProvide camera/microphone sandbox extensions to GPUProcess
youenn@apple.com [Tue, 21 Jan 2020 19:36:52 +0000 (19:36 +0000)]
Provide camera/microphone sandbox extensions to GPUProcess
https://bugs.webkit.org/show_bug.cgi?id=206531

Reviewed by Eric Carlson.

Send at creation of GPUProcess sandbox extensions to camera and microphone.
This is currently gated by the UIProcess application being Safari.
This should be changed to checks based on camera/microphone entitlements.

Extensions are provided at creation of the GPUProcess as it is as trusted as the UIProcess.
We do not make it conditional to getUserMedia being enabled as GPUProcess may be created for more than one configuration.

Relax the GPUProcess sandbox on MacOS to allow microphone access until we can use microphone sandbox extension for that purpose.

Manually tested by capturing audio/video with real devices.

* GPUProcess/GPUProcess.cpp:
(WebKit::GPUProcess::initializeGPUProcess):
* GPUProcess/GPUProcessCreationParameters.cpp:
(WebKit::GPUProcessCreationParameters::encode const):
(WebKit::GPUProcessCreationParameters::decode):
* GPUProcess/GPUProcessCreationParameters.h:
* GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in:
* UIProcess/GPU/GPUProcessProxy.cpp:
(WebKit::isSafari):
(WebKit::shouldCreateCameraSandboxExtension):
(WebKit::shouldCreateMicrophoneSandboxExtension):
(WebKit::GPUProcessProxy::singleton):

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

6 months agoJSTests:
tzagallo@apple.com [Tue, 21 Jan 2020 19:36:05 +0000 (19:36 +0000)]
JSTests:
Object allocation sinking is missing PutHint for allocations unreachable in the graph
https://bugs.webkit.org/show_bug.cgi?id=203799
<rdar://problem/56852162>

Reviewed by Saam Barati.

* stress/allocation-sinking-puthint-control-flow-2.js: Added.
(f.handler.construct):
(f):

Source/JavaScriptCore:
Object allocation sinking is missing PutHint for sunken allocations
https://bugs.webkit.org/show_bug.cgi?id=203799
<rdar://problem/56852162>

Reviewed by Saam Barati.

Consider the following graph:

    Block #0:
      1: PhantomCreateActivation()
      2: PhantomNewFunction()
      PutHint(@2, @1, FunctionActivationPLoc)
      Branch(#1, #2)

    Block #1:
      3: MaterializeCreateActivation()
      PutHint(@2, @3, FunctionActivationPLoc)
      Upsilon(@3, ^5)
      Jump(#3)

    Block #2:
      4: MaterializeCreateActivation()
      PutHint(@2, @4, FunctionActivationPLoc)
      Upsilon(@4, ^5)
      Jump(#3)

    Block #3:
      5: Phi()
      ExitOK()

On Block #3, we need to emit a PutHint after the Phi, since we might exit after it. However,
object allocation sinking skipped this Phi because it was checking whether the base of the
location that caused us to create this Phi (@2) was live, but it's dead in the graph (there
are no pointers to it).  The issue is that, even though there are no pointers to the base, the
location `PromotedHeapLocation(@2, FunctionActivationPLoc)` is still live, so we should PutHint
to it. We fix it by checking for liveness of the location rather than its base.

* dfg/DFGObjectAllocationSinkingPhase.cpp:

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

6 months agoDisallow setting SVGElement currentScale to non-finite values
commit-queue@webkit.org [Tue, 21 Jan 2020 18:58:36 +0000 (18:58 +0000)]
Disallow setting SVGElement currentScale to non-finite values
https://bugs.webkit.org/show_bug.cgi?id=206019

Align SVGElement currentScale definition to SVG2 section 5.14.2
(https://www.w3.org/TR/SVG2/struct.html#InterfaceSVGSVGElement)

Patch by Sunny He <sunny_he@apple.com> on 2020-01-21
Reviewed by Darin Adler.

Source/WebCore:

Test: svg/dom/set-currentScale-nonfinite.html

* svg/SVGSVGElement.idl:

LayoutTests:

* svg/dom/set-currentScale-nonfinite-expected.txt: Added.
* svg/dom/set-currentScale-nonfinite.html: Added.

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

6 months agoAPI::(User)ContentWorld cleanup
beidson@apple.com [Tue, 21 Jan 2020 18:42:40 +0000 (18:42 +0000)]
API::(User)ContentWorld cleanup
https://bugs.webkit.org/show_bug.cgi?id=206509

Reviewed by Darin Adler.

No behavior change.

- Give (User)ContentWorld a shared base class for upcoming work.
- Reference them by identifier instead of object instance whenever possible.
- Other shared class cleanup.

* UIProcess/API/APIContentWorld.cpp:
(API::ContentWorldBase::generateIdentifier):
(API::ContentWorld::ContentWorld):
(API::ContentWorld::~ContentWorld):
* UIProcess/API/APIContentWorld.h:
(API::ContentWorldBase::identifier const):
(API::ContentWorldBase::name const):
(API::ContentWorldBase::worldData const):
(API::ContentWorldBase::ContentWorldBase):
* UIProcess/API/APIUserContentWorld.cpp:
(API::UserContentWorld::UserContentWorld):
(API::UserContentWorld::generateIdentifier): Deleted.
* UIProcess/API/APIUserContentWorld.h:
* UIProcess/UserContent/WebScriptMessageHandler.h:
(WebKit::WebScriptMessageHandler::world):
(WebKit::WebScriptMessageHandler::userContentWorld const): Deleted.
(WebKit::WebScriptMessageHandler::userContentWorld): Deleted.
* UIProcess/UserContent/WebUserContentControllerProxy.cpp:
(WebKit::WebUserContentControllerProxy::addProcess):
(WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
(WebKit::WebUserContentControllerProxy::shouldSendRemoveUserContentWorldsMessage):
(WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
(WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
(WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
* UIProcess/UserContent/WebUserContentControllerProxy.h:

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