WebKit-https.git
4 months ago[BigInt] Add ValueBitRShift into DFG
ticaiolima@gmail.com [Tue, 24 Sep 2019 19:09:03 +0000 (19:09 +0000)]
[BigInt] Add ValueBitRShift into DFG
https://bugs.webkit.org/show_bug.cgi?id=192663

Reviewed by Robin Morisset.

JSTests:

* stress/big-int-right-shift-jit-osr.js: Added.
* stress/big-int-right-shift-jit-untyped.js: Added.
* stress/big-int-right-shift-jit.js: Added.
* stress/value-rshift-ai-rule.js: Added.

PerformanceTests:

* BigIntBench/big-int-simple-rshift.js: Added.
(bigInt):

Source/JavaScriptCore:

We are introducing a new node called ValueBitRShift that is
responsible to handle speculation of `UntypedUse` and `BigIntUse` during
DFG. Following the approach of other bitwise operations, we
now have 2 nodes to handle ">>" operator during JIT, mainly because
of the introduction of BigInt, that makes this operator result into
Int32 or BigInt. We renamed `BitRShift` to `ArithBitRShift` and such
node handles Integers and Numbers speculation and can only return
Int32 values.

* bytecode/BytecodeList.rb:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
* bytecode/Opcode.h:

Adding support to ValueProfile to `op_rshift` to be used during
prediction propagation.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::handleConstantBinaryBitwiseOp):
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

Adding support to still do constant propagation of ValueBitRShift when
it is `UntypedUse`.

* dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwo):
(JSC::DFG::BackwardsPropagationPhase::propagate):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):

`ValueBitRshift` can trigger GC when it is `BigIntUse` because the
operation `JSBigInt::signedRightShift` potentially allocates new
JSBigInts. It also can trigger GC when it is `UntypedUse` because it
can execute arbitrary code.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):

The fixup rule of `ValueBitRShift` checks if it should fixup for
`BigIntUse` or `UntypedUse`. If those checks fail, we fallback to
`ArithBitRShift`.

* dfg/DFGNode.h:
(JSC::DFG::Node::hasNumericResult):
(JSC::DFG::Node::hasHeapPrediction):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:

We are using the same rule used by `ValueBitLShift` to propagate
types. We try to propagate the type based on operation's input, but
fallback to `getHeapPrediction()` if this is not possible.

* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::emitUntypedRightShiftBitOp):
(JSC::DFG::SpeculativeJIT::compileValueBitRShift):
(JSC::DFG::SpeculativeJIT::compileShiftOp):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::shiftOp):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileValueBitRShift):
(JSC::FTL::DFG::LowerDFGToB3::compileArithBitRShift):
(JSC::FTL::DFG::LowerDFGToB3::compileBitRShift): Deleted.
* llint/LowLevelInterpreter64.asm:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):

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

4 months agoMove HSTS storage directory to LegacyGlobalSettings
achristensen@apple.com [Tue, 24 Sep 2019 18:54:38 +0000 (18:54 +0000)]
Move HSTS storage directory to LegacyGlobalSettings
https://bugs.webkit.org/show_bug.cgi?id=202059

Reviewed by Tim Horton.

I continue my lamentation begun in r245075.
Remove the glib setting of it on the WebKitWebContext because they use it on the WebsiteDataStore.  We should do that too when we can.

* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration setHSTSStorageDirectory:]):
(-[_WKProcessPoolConfiguration hstsStorageDirectory]):
* UIProcess/LegacyGlobalSettings.h:
(WebKit::LegacyGlobalSettings::setHSTSStorageDirectory):
(WebKit::LegacyGlobalSettings::hstsStorageDirectory const):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):

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

4 months agoRemove some support for < iOS 13
krollin@apple.com [Tue, 24 Sep 2019 18:42:52 +0000 (18:42 +0000)]
Remove some support for < iOS 13
https://bugs.webkit.org/show_bug.cgi?id=201969
<rdar://problem/55505586>

Reviewed by Jonathan Bedard.

Remove some support for iOS versions less than 13.0.

Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
values >= 130000. This means that expressions like
"__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
"__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.

This removal is part of a series of patches effecting the removal of
dead code for old versions of iOS. This particular pass involves
changes in which Jonathan Bedard was involved. These changes are
isolated from other similar changes in order to facilitate the
reviewing process.

* pal/spi/cocoa/CoreTextSPI.h:
* pal/spi/cocoa/QuartzCoreSPI.h:
* pal/spi/ios/UIKitSPI.h:

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

4 months agoCoalesce or remove PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
krollin@apple.com [Tue, 24 Sep 2019 18:03:30 +0000 (18:03 +0000)]
Coalesce or remove PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
https://bugs.webkit.org/show_bug.cgi?id=202119
<rdar://problem/55638792>

Reviewed by Alex Christensen.

After refactoring and other code evolution, some platform checks have
ended up looking like PLATFORM(MAC) || PLATFORM(IOS_FAMILY) (or
vice-versa). These can be converted into the equivalent
PLATFORM(COCOA). Where the instance occurs in a Cocoa-only file, the
check can be removed altogether (along with any "#else" branches).

Source/WebCore:

No new tests -- no new or changed functionality.

* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::subLocality):
(WebCore::setSubLocality):
(WebCore::subAdministrativeArea):
(WebCore::setSubAdministrativeArea):
* css/parser/CSSPropertyParser.cpp:
(WebCore::isAppleLegacyCssValueKeyword):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaSessionTitle const):
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::platform):
* page/FrameView.cpp:
(WebCore::FrameView::updateBackgroundRecursively):
* platform/Timer.cpp:
* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::initialize):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::displayP3ColorSpaceRef):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const):

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:
* pal/spi/cocoa/NEFilterSourceSPI.h:
* pal/spi/mac/AVFoundationSPI.h:

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
* WebProcess/WebCoreSupport/WebChromeClient.h:

Source/WTF:

* wtf/Platform.h:
* wtf/text/TextBreakIterator.h:

Tools:

* DumpRenderTree/AccessibilityTextMarker.h:
* DumpRenderTree/AccessibilityUIElement.cpp:
(AccessibilityUIElement::setValue):

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

4 months agoAdd tests for Ref.js.
zhifei_fang@apple.com [Tue, 24 Sep 2019 17:48:20 +0000 (17:48 +0000)]
Add tests for Ref.js.
https://bugs.webkit.org/show_bug.cgi?id=201778.

Reviewed by Jonathan Bedard.

* resultsdbpy/resultsdbpy/view/static/library/js/Ref.js:
(applyStateDiff): null, 0, false are all valid state
(Ref.prototype.setState): We should do nothing for undefined stateDiff
* resultsdbpy/resultsdbpy/view/static/library/js/Test.js: Added.
(AssertFailedError):
(Expect): Perform assertions during unit tests.
(Expect.prototype.isType):
(Expect.prototype.equalToValue):
(Expect.prototype.equalToHtmlWithoutRef):
(Expect.prototype.notEqualToValue):
(Expect.prototype.greaterThan):
(Expect.prototype.greaterThanOrEqualTo):
(Expect.prototype.lessThan):
(Expect.prototype.lessThanOrEqualTo):
(TestSuite): Common TestSuite class for user to extend.
(TestSuite.prototype.expect):
(TestSuite.prototype.sleep): Test will sleep for certain ms
(TestSuite.prototype.waitForSignal): Wait until we receive a certain signal with timeout
(TestSuite.prototype.waitForRefMounted): Wait until we receive ref object's onElementMount signal with timeout
(TestSuite.prototype.waitForRefUnmounted): Wait until we receive ref object's onElementUnmount signal with timeout
(TestSuite.prototype.waitForStateUpdated):Wait until we receive ref object's onStateUpdate signal with timeout
(TestSuite.prototype.async.setup): Common interface for setup a test suite
(TestSuite.prototype.async.clearUp): Common interface for clear up a test suite
(getTestFucntionNames): Collect all the test method of a test instance.
(TestResult):
(TestResult.prototype.catchException):
(async.getTestResult): Run the test and generate a TestResult object
(TestController):
(TestController.prototype.addResultHandler): Test controller will send notification of a test result to result handler
(TestController.prototype.addSetupArgs): This gives some additional args for the common setup method for each test class,
it is the best place to setup something like a root element, a fake data source, etc
(TestController.prototype.collect): This method used for collect the test classes.
(TestController.prototype.async.collectFile): It will import the file as a module dynamicly and collect all the test classes that module export
(TestController.prototype.async.runTest): It will run a test method of a test class
(TestController.prototype.async.run): It will run all test or a test class or a test method
* resultsdbpy/resultsdbpy/view/static/library/js/components/TestComponents.js: components for test app.
* resultsdbpy/resultsdbpy/view/static/library/js/test/RefTest.js: Ref.js test cases.
* resultsdbpy/resultsdbpy/view/static/library/js/test/index.html: Test app entry.

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

4 months agoFocusPreservationTests.ChangingFocusedNodeResetsFocusPreservationState triggers a...
wenson_hsieh@apple.com [Tue, 24 Sep 2019 17:25:05 +0000 (17:25 +0000)]
FocusPreservationTests.ChangingFocusedNodeResetsFocusPreservationState triggers a debug assertion
https://bugs.webkit.org/show_bug.cgi?id=202145
<rdar://problem/51273128>

Reviewed by Tim Horton.

Source/WebKit:

Fixes an assertion in -tableView:cellForRowAtIndexPath: to only require the cell to have a non-zero
width in the case where the table view itself has a non-empty width. When run under TestWebKitAPI,
this assertion currently fires because the view controller used to show the popover isn't actually
presented, so the view controller's view (i.e. the UITableView) ends up being empty. This causes all
of its table view cells to subsequently become empty upon reuse.

* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):

Tools:

Fixes this API test to work on iPad as well as iPhone. Importantly, we show a popover when focusing
select elements on iPad, which means that there is no -inputView present on WKContentView, and upon
dismissing the form accessory view, the select element is still focused.

* TestWebKitAPI/Tests/ios/FocusPreservationTests.mm:

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

4 months ago[Web Animations] Unflake web-animations/timing-model/animations/updating-the-finished...
graouts@webkit.org [Tue, 24 Sep 2019 17:02:13 +0000 (17:02 +0000)]
[Web Animations] Unflake web-animations/timing-model/animations/updating-the-finished-state.html WPT test
https://bugs.webkit.org/show_bug.cgi?id=181121

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/web-animations/timing-model/animations/updating-the-finished-state-expected.txt:

Source/WebCore:

When running the "update animations and send events" steps (https://drafts.csswg.org/web-animations/#update-animations-and-send-events)
we assemble a list of animations to remove after updating their relevance based on the new timeline current time. However, we wouldn't
account for the fact that we would *then* dispatch events which could update the timing properties of animations that had been marked
for removal at this point.

In this specific WPT test, there were two individual tests that would rewind animations within a "finish" event handler and we would
not consider the fact that they had been rewound. We now check a second time before removing an animation that it should indeed be
removed.

* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents):

LayoutTests:

* TestExpectations:

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

4 months agoAdd Cathie Chen as WebKit committer
cathiechen@igalia.com [Tue, 24 Sep 2019 16:39:06 +0000 (16:39 +0000)]
Add Cathie Chen as WebKit committer

Unreviewed.

* Scripts/webkitpy/common/config/contributors.json:

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

4 months agoMixed content blocking is bypassed for WebSockets in Workers (159726)
cdumez@apple.com [Tue, 24 Sep 2019 15:31:55 +0000 (15:31 +0000)]
Mixed content blocking is bypassed for WebSockets in Workers (159726)
https://bugs.webkit.org/show_bug.cgi?id=159726
<rdar://problem/27326438>

Patch by Kate Cheney <katherine_cheney@apple.com> on 2019-09-24
Reviewed by Brady Eidson.

Source/WebCore:

Tests: http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https-with-embedded-http.html
       http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https.html
       http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-https-with-embedded-http-with-embedded-https.https.html
       http/tests/websocket/tests/hybi/non-document-mixed-content-blocked.https.html

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect):
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::WorkerThreadableWebSocketChannel::Bridge::connect):
* loader/MixedContentChecker.cpp:
(WebCore::MixedContentChecker::checkForMixedContentInFrameTree):
* loader/MixedContentChecker.h:
Patch to block insecure WebSocket URL connection attempts by Workers
on secure pages. If the URL is ws, and any embedding iframe has protocol
https, and the context is a Worker, the connection should be blocked.

I was unable to write a test case to hit the case where a document
does not have a frame and tries to communicate via a worker to
connect to a WebSocket because after removing the subframe from its
parent, the subframe is unable to perform a postMessage to a worker
even in the same script execution to tell the worker to connect
to a WebSocket.

LayoutTests:

Added 4 test cases and 2 html resources utilized by the tests.
The cases test the following:
1. an https page with a worker trying to connect via ws: url -->
fails.
2. an https page embedded in an http page trying to connect via ws
:url (through a worker) --> fails.
3. an http page embedded in an https page with an http top frame
trying to connect via an insecure ws url fails.
4. an https page embedded in an http page embedded in an https page
trying to connect to a ws :url via a worker --> fails.

* http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https-expected.txt: Added.
* http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https-with-embedded-http-expected.txt: Added.
* http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https-with-embedded-http.html: Added.
* http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-http-with-embedded-https.html: Added.
* http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-https-with-embedded-http-with-embedded-https.https-expected.txt: Added.
* http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-https-with-embedded-http-with-embedded-https.https.html: Added.
* http/tests/websocket/tests/hybi/non-document-mixed-content-blocked.https-expected.txt: Added.
* http/tests/websocket/tests/hybi/non-document-mixed-content-blocked.https.html: Added.
* http/tests/websocket/tests/hybi/resources/non-document-mixed-content-blocked-embedded-http.https.html: Added.
* http/tests/websocket/tests/hybi/resources/non-document-mixed-content-blocked-embedding-https.js: Added.
(handleConnect.self.postMessage):
(handleConnect):
(runTests.ws.onopen):
(runTests.ws.onerror):
(runTests):
* http/tests/websocket/tests/hybi/resources/non-document-mixed-content-blocked.html: Added.
* http/tests/websocket/tests/hybi/resources/non-document-mixed-content-blocked.js: Added.
(handleConnect.self.postMessage):
(handleConnect):
(runTests.ws.onopen):
(runTests.ws.onerror):
(runTests):
* http/tests/workers/service/resources/serviceworker-websocket-worker.js:
(async.doTest):
Updated previous test which was hitting the fix to use a wss url

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

4 months ago[LFC][IFC] Line::Content should use LineBox
zalan@apple.com [Tue, 24 Sep 2019 15:30:17 +0000 (15:30 +0000)]
[LFC][IFC] Line::Content should use LineBox
https://bugs.webkit.org/show_bug.cgi?id=202128
<rdar://problem/55649079>

Reviewed by Antti Koivisto.

Replace Line::Content's m_logicalRect, m_baseline and m_baselineOffset with LineBox.

* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
(WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
* layout/inlineformatting/InlineFormattingContextQuirks.cpp:
(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
(WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints const):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::close):
(WebCore::Layout::Line::adjustBaselineAndLineHeight):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::Content::lineBox const):
(WebCore::Layout::Line::Content::setLineBox):
(WebCore::Layout::Line::baselineOffset const):
(WebCore::Layout::Line::Content::isEmpty const): Deleted.
(WebCore::Layout::Line::Content::logicalTop const): Deleted.
(WebCore::Layout::Line::Content::logicalLeft const): Deleted.
(WebCore::Layout::Line::Content::logicalRight const): Deleted.
(WebCore::Layout::Line::Content::logicalBottom const): Deleted.
(WebCore::Layout::Line::Content::logicalWidth const): Deleted.
(WebCore::Layout::Line::Content::logicalHeight const): Deleted.
(WebCore::Layout::Line::Content::baseline const): Deleted.
(WebCore::Layout::Line::Content::baselineOffset const): Deleted.
(WebCore::Layout::Line::Content::setLogicalRect): Deleted.
(WebCore::Layout::Line::Content::setBaseline): Deleted.
(WebCore::Layout::Line::Content::setBaselineOffset): Deleted.
* layout/inlineformatting/InlineLineBox.h:
(WebCore::Layout::LineBox::Baseline::height const):
(WebCore::Layout::LineBox::LineBox):
(WebCore::Layout::LineBox::baselineOffset const):
(WebCore::Layout::LineBox::Baseline::Baseline):
(WebCore::Layout::LineBox::Baseline::setAscent):
(WebCore::Layout::LineBox::Baseline::setDescent):
(WebCore::Layout::LineBox::Baseline::reset):
(WebCore::Layout::LineBox::Baseline::ascent const):
(WebCore::Layout::LineBox::Baseline::descent const):

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

4 months ago[GTK] ANGLE's eglplatform.h is build broken with -DENABLE_X11_PLATFORM=OFF
aperez@igalia.com [Tue, 24 Sep 2019 14:58:49 +0000 (14:58 +0000)]
[GTK] ANGLE's eglplatform.h is build broken with -DENABLE_X11_PLATFORM=OFF
https://bugs.webkit.org/show_bug.cgi?id=198621

Reviewed by Carlos Garcia Campos.

* PlatformGTK.cmake: Define WL_EGL_PLATFORM to prefer Wayland type
definitions with ENABLE_WAYLAND_TARGET=ON and ENABLE_X11_TARGET=OFF
to avoid ANGLE's eglplatform.h from trying to include the X11 headers.

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

4 months ago[LFC][IFC] Move line constraints computation to a dedicated function
zalan@apple.com [Tue, 24 Sep 2019 14:39:57 +0000 (14:39 +0000)]
[LFC][IFC] Move line constraints computation to a dedicated function
https://bugs.webkit.org/show_bug.cgi?id=202121
<rdar://problem/55640742>

Reviewed by Antti Koivisto.

* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::LineLayout::LineLayout):
(WebCore::Layout::LineLayout::close):
(WebCore::Layout::LineLayout::placeInlineItem):
(WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
(WebCore::Layout::InlineFormattingContext::InlineLayout::initialConstraintsForLine):
(WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
* layout/inlineformatting/InlineLine.h:

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

4 months agoImport navigation-timing WPT tests that don't time out
commit-queue@webkit.org [Tue, 24 Sep 2019 14:09:55 +0000 (14:09 +0000)]
Import navigation-timing WPT tests that don't time out
https://bugs.webkit.org/show_bug.cgi?id=202131

Patch by Alex Christensen <achristensen@webkit.org> on 2019-09-24
Reviewed by Youenn Fablet.

* web-platform-tests/navigation-timing/buffered-flag.window.js: Added.
(async_test.t):
* web-platform-tests/navigation-timing/idlharness.window.js: Added.
* web-platform-tests/navigation-timing/nav2_test_document_open-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_document_open.html: Added.
* web-platform-tests/navigation-timing/nav2_test_document_replaced-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_document_replaced.html: Added.
* web-platform-tests/navigation-timing/nav2_test_frame_removed-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_frame_removed.html: Added.
* web-platform-tests/navigation-timing/nav2_test_instance_accessible_from_the_start-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_instance_accessible_from_the_start.html: Added.
* web-platform-tests/navigation-timing/nav2_test_navigate_within_document-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_navigate_within_document.html: Added.
* web-platform-tests/navigation-timing/nav2_test_navigation_type_backforward-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_navigation_type_backforward.html: Added.
* web-platform-tests/navigation-timing/nav2_test_navigation_type_reload-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_navigation_type_reload.html: Added.
* web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in.html: Added.
* web-platform-tests/navigation-timing/nav2_test_redirect_server-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_redirect_server.html: Added.
* web-platform-tests/navigation-timing/nav2_test_redirect_xserver-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_redirect_xserver.html: Added.
* web-platform-tests/navigation-timing/resources: Added.
* web-platform-tests/navigation-timing/resources/blank_page_green.html: Added.
* web-platform-tests/navigation-timing/resources/blank_page_green_with_onunload.html: Added.
* web-platform-tests/navigation-timing/resources/blank_page_meta_redirect.html: Added.
* web-platform-tests/navigation-timing/resources/blank_page_unload.html: Added.
* web-platform-tests/navigation-timing/resources/blank_page_yellow.html: Added.
* web-platform-tests/navigation-timing/resources/blank_page_yellow_with_onunload.html: Added.
* web-platform-tests/navigation-timing/resources/performance_attribute_sender.html: Added.
* web-platform-tests/navigation-timing/resources/secure-connection-interim.html: Added.
* web-platform-tests/navigation-timing/resources/secure-connection-interim.html.headers: Added.
* web-platform-tests/navigation-timing/resources/secure-connection-test.html: Added.
* web-platform-tests/navigation-timing/resources/webperftestharness.js: Added.
(test_namespace):
(test_timing_order):
(test_timing_equals):
(sleep_milliseconds):
(test_greater_than):
(test_greater_or_equals):
* web-platform-tests/navigation-timing/secure_connection_start_non_zero.https-expected.txt: Added.
* web-platform-tests/navigation-timing/secure_connection_start_non_zero.https.html: Added.
* web-platform-tests/navigation-timing/supported_navigation_type.window.js: Added.
(test):
(typeof.PerformanceObserver.supportedEntryTypes.string_appeared_here.PerformanceObserver.supportedEntryTypes.includes.promise_test.):
(typeof.PerformanceObserver.supportedEntryTypes.string_appeared_here.PerformanceObserver.supportedEntryTypes.includes):
* web-platform-tests/navigation-timing/test_document_open-expected.txt: Added.
* web-platform-tests/navigation-timing/test_document_open.html: Added.
* web-platform-tests/navigation-timing/test_document_readiness_exist-expected.txt: Added.
* web-platform-tests/navigation-timing/test_document_readiness_exist.html: Added.
* web-platform-tests/navigation-timing/test_navigate_within_document-expected.txt: Added.
* web-platform-tests/navigation-timing/test_navigate_within_document.html: Added.
* web-platform-tests/navigation-timing/test_navigation_attributes_exist-expected.txt: Added.
* web-platform-tests/navigation-timing/test_navigation_attributes_exist.html: Added.
* web-platform-tests/navigation-timing/test_navigation_redirectCount_none-expected.txt: Added.
* web-platform-tests/navigation-timing/test_navigation_redirectCount_none.html: Added.
* web-platform-tests/navigation-timing/test_navigation_type_backforward-expected.txt: Added.
* web-platform-tests/navigation-timing/test_navigation_type_backforward.html: Added.
* web-platform-tests/navigation-timing/test_navigation_type_enums-expected.txt: Added.
* web-platform-tests/navigation-timing/test_navigation_type_enums.html: Added.
* web-platform-tests/navigation-timing/test_navigation_type_reload-expected.txt: Added.
* web-platform-tests/navigation-timing/test_navigation_type_reload.html: Added.
* web-platform-tests/navigation-timing/test_no_previous_document-expected.txt: Added.
* web-platform-tests/navigation-timing/test_no_previous_document.html: Added.
* web-platform-tests/navigation-timing/test_performance_attributes.sub-expected.txt: Added.
* web-platform-tests/navigation-timing/test_performance_attributes.sub.html: Added.
* web-platform-tests/navigation-timing/test_performance_attributes_exist-expected.txt: Added.
* web-platform-tests/navigation-timing/test_performance_attributes_exist.html: Added.
* web-platform-tests/navigation-timing/test_performance_attributes_exist_in_object-expected.txt: Added.
* web-platform-tests/navigation-timing/test_performance_attributes_exist_in_object.html: Added.
* web-platform-tests/navigation-timing/test_readwrite-expected.txt: Added.
* web-platform-tests/navigation-timing/test_readwrite.html: Added.
* web-platform-tests/navigation-timing/test_timing_attributes_exist-expected.txt: Added.
* web-platform-tests/navigation-timing/test_timing_attributes_exist.html: Added.
* web-platform-tests/navigation-timing/test_timing_attributes_order-expected.txt: Added.
* web-platform-tests/navigation-timing/test_timing_attributes_order.html: Added.
* web-platform-tests/navigation-timing/test_timing_client_redirect-expected.txt: Added.
* web-platform-tests/navigation-timing/test_timing_client_redirect.html: Added.
* web-platform-tests/navigation-timing/test_timing_reload-expected.txt: Added.
* web-platform-tests/navigation-timing/test_timing_reload.html: Added.
* web-platform-tests/navigation-timing/test_timing_server_redirect-expected.txt: Added.
* web-platform-tests/navigation-timing/test_timing_server_redirect.html: Added.
* web-platform-tests/navigation-timing/test_timing_xserver_redirect-expected.txt: Added.
* web-platform-tests/navigation-timing/test_timing_xserver_redirect.html: Added.
* web-platform-tests/navigation-timing/test_unique_performance_objects-expected.txt: Added.
* web-platform-tests/navigation-timing/test_unique_performance_objects.html: Added.
* web-platform-tests/navigation-timing/unload-event-same-origin-check-expected.txt: Added.
* web-platform-tests/navigation-timing/unload-event-same-origin-check.html: Added.

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

4 months agoRequire a WebsiteDataStore when creating or resuming downloads
achristensen@apple.com [Tue, 24 Sep 2019 13:58:40 +0000 (13:58 +0000)]
Require a WebsiteDataStore when creating or resuming downloads
https://bugs.webkit.org/show_bug.cgi?id=202081

Reviewed by Youenn Fablet.

Source/WebKit:

No change in behavior, but I'll have to move Safari to the new SPI.
This makes it so there are no cases where we guess we need to use the default session,
and it allows downloads to function correctly once there is a NetworkProcess singleton.
Removing the unused WebProcessPool& in the callbacks will allow us to eventually have
downloads only associated with a WebsiteDataStore and not a WebProcessPool.

* UIProcess/API/APIDownloadClient.h:
(API::DownloadClient::didStart):
(API::DownloadClient::didReceiveAuthenticationChallenge):
(API::DownloadClient::didReceiveResponse):
(API::DownloadClient::didReceiveData):
(API::DownloadClient::decideDestinationWithSuggestedFilename):
(API::DownloadClient::didCreateDestination):
(API::DownloadClient::didFinish):
(API::DownloadClient::didFail):
(API::DownloadClient::didCancel):
(API::DownloadClient::processDidCrash):
(API::DownloadClient::willSendRequest):
* UIProcess/API/C/WKContext.cpp:
(WKContextSetDownloadClient):
(WKContextDownloadURLRequest):
(WKContextResumeDownload):
* UIProcess/API/C/WKContext.h:
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _setDownloadDelegate:]):
(-[WKProcessPool _downloadURLRequest:originatingWebView:]):
(-[WKProcessPool _resumeDownloadFromData:path:originatingWebView:]):
(-[WKProcessPool _downloadURLRequest:websiteDataStore:originatingWebView:]):
(-[WKProcessPool _resumeDownloadFromData:websiteDataStore:path:originatingWebView:]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/glib/WebKitDownloadClient.cpp:
* UIProcess/API/glib/WebKitWebContext.cpp:
(webkitWebContextDispose):
(webkitWebContextStartDownload):
* UIProcess/Cocoa/DownloadClient.h:
* UIProcess/Cocoa/DownloadClient.mm:
(WebKit::DownloadClient::didStart):
(WebKit::DownloadClient::didReceiveResponse):
(WebKit::DownloadClient::didReceiveData):
(WebKit::DownloadClient::didReceiveAuthenticationChallenge):
(WebKit::DownloadClient::didCreateDestination):
(WebKit::DownloadClient::processDidCrash):
(WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
(WebKit::DownloadClient::didFinish):
(WebKit::DownloadClient::didFail):
(WebKit::DownloadClient::didCancel):
(WebKit::DownloadClient::willSendRequest):
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::create):
(WebKit::DownloadProxy::DownloadProxy):
(WebKit::DownloadProxy::invalidate):
(WebKit::DownloadProxy::processDidClose):
(WebKit::DownloadProxy::didStart):
(WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
(WebKit::DownloadProxy::willSendRequest):
(WebKit::DownloadProxy::didReceiveResponse):
(WebKit::DownloadProxy::didReceiveData):
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
(WebKit::DownloadProxy::didCreateDestination):
(WebKit::DownloadProxy::didFinish):
(WebKit::DownloadProxy::didFail):
(WebKit::DownloadProxy::didCancel):
* UIProcess/Downloads/DownloadProxy.h:
* UIProcess/Downloads/DownloadProxyMap.cpp:
(WebKit::DownloadProxyMap::createDownloadProxy):
* UIProcess/Downloads/DownloadProxyMap.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::createDownloadProxy):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::contextMenuItemSelected):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::WebProcessPool):
(WebKit::WebProcessPool::setDownloadClient):
(WebKit::WebProcessPool::download):
(WebKit::WebProcessPool::resumeDownload):
(WebKit::WebProcessPool::createDownloadProxy):
* UIProcess/WebProcessPool.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/DownloadProgress.mm:
(-[DownloadProgressTestRunner startDownload:expectedLength:]):

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

4 months agoDelay capture sandbox extension revocation to after the page close message is sent
youenn@apple.com [Tue, 24 Sep 2019 13:36:17 +0000 (13:36 +0000)]
Delay capture sandbox extension revocation to after the page close message is sent
https://bugs.webkit.org/show_bug.cgi?id=202133

Reviewed by Eric Carlson.

This ensures that the sandbox extension is removed once no longer useful
and makes our WebProcess assertions fine.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):

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

4 months agoAudioTrackPrivateMediaStreamCocoa does not need to manipulate the audio unit in play...
youenn@apple.com [Tue, 24 Sep 2019 08:42:03 +0000 (08:42 +0000)]
AudioTrackPrivateMediaStreamCocoa does not need to manipulate the audio unit in play/pause methods
https://bugs.webkit.org/show_bug.cgi?id=202097
<rdar://problem/51548144>

Reviewed by Eric Carlson.

Instead of manipulating the audio unit in play/pause methods, it is more convenient to do so in audioSamplesAvailable.
play/pause methods only update boolean values that audioSamplesAvailable will read.
In particular, m_autoPlay and m_isPlaying are no longer modified in the audio thread.

Behavior was racy so difficult to reproduce.

* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::playInternal):
(WebCore::AudioTrackPrivateMediaStreamCocoa::pause):
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:

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

4 months agoRefactor cellSize() out of VMInspector::verifyCellSize().
mark.lam@apple.com [Tue, 24 Sep 2019 07:43:24 +0000 (07:43 +0000)]
Refactor cellSize() out of VMInspector::verifyCellSize().
https://bugs.webkit.org/show_bug.cgi?id=202132

Reviewed by Saam Barati.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* runtime/CellSize.h: Added.
(JSC::isDynamicallySizedType):
(JSC::cellSize):
* runtime/DirectArguments.h:
* runtime/JSBigInt.h:
* runtime/JSModuleNamespaceObject.h:
* runtime/JSType.h:
(JSC::isDynamicallySizedType): Deleted.
* tools/VMInspectorInlines.h:
(JSC::VMInspector::verifyCellSize):

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

4 months agoSupport sync-xhr feature policy
youenn@apple.com [Tue, 24 Sep 2019 06:59:52 +0000 (06:59 +0000)]
Support sync-xhr feature policy
https://bugs.webkit.org/show_bug.cgi?id=202098

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Update test to use hosts[alt][].

* web-platform-tests/xhr/xmlhttprequest-sync-default-feature-policy.sub-expected.txt:
* web-platform-tests/xhr/xmlhttprequest-sync-default-feature-policy.sub.html:

Source/WebCore:

Add support for sync-xhr feature policy parsing.
Use this feature policy to control use of sync XHR in documents
as per https://xhr.spec.whatwg.org/#the-send()-method step 12.

Covered by updated test.

* html/FeaturePolicy.cpp:
(WebCore::FeaturePolicy::parse):
(WebCore::FeaturePolicy::allows const):
* html/FeaturePolicy.h:
* xml/XMLHttpRequest.cpp:
(WebCore::isSyncXHRAllowedByFeaturePolicy):
(WebCore::XMLHttpRequest::createRequest):

LayoutTests:

* TestExpectations: enable test.
* platform/mac-wk1/imported/w3c/web-platform-tests/xhr/xmlhttprequest-sync-default-feature-policy.sub-expected.txt: Deleted.

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

4 months agoDrop unnecessary SessionID.h header includes
cdumez@apple.com [Tue, 24 Sep 2019 06:28:45 +0000 (06:28 +0000)]
Drop unnecessary SessionID.h header includes
https://bugs.webkit.org/show_bug.cgi?id=202129

Reviewed by Alex Christensen.

Source/WebCore:

* Modules/fetch/FetchBodyConsumer.h:
* Modules/indexeddb/IDBDatabaseIdentifier.h:
* bindings/js/SerializedScriptValue.h:
* dom/DataTransfer.h:
* editing/WebCorePasteboardFileReader.h:
* fileapi/FileReaderLoader.h:
* fileapi/ThreadableBlobRegistry.h:
* html/FileListCreator.h:
* loader/CookieJar.h:
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoaderClient.h:
* loader/LoaderStrategy.h:
* page/CacheStorageProvider.h:
* page/Frame.h:
* page/PageGroup.h:
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* platform/network/CacheValidation.h:
* platform/network/FormData.h:
* platform/network/NetworkStorageSession.cpp:
* platform/network/StorageSessionProvider.h:
* workers/WorkerGlobalScopeProxy.h:
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerProvider.h:
* workers/service/server/RegistrationDatabase.h:
* workers/service/server/SWServer.h:
* workers/service/server/SWServerToContextConnection.h:
* worklets/WorkletGlobalScope.h:

Source/WebKit:

* NetworkProcess/AdClickAttributionManager.h:
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/RemoteNetworkingContext.h:
* NetworkProcess/cache/CacheStorageEngine.cpp:
* NetworkProcess/cache/CacheStorageEngine.h:
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/webrtc/NetworkRTCProvider.h:
* Shared/ApplePay/WebPaymentCoordinatorProxy.h:
* Shared/Authentication/AuthenticationManager.h:
* Shared/WebCoreArgumentCoders.cpp:
* Shared/WebProcessCreationParameters.h:
* UIProcess/API/APIPageConfiguration.h:
* WebProcess/Cache/WebCacheStorageProvider.h:
* WebProcess/Databases/WebDatabaseProvider.cpp:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
* WebProcess/InjectedBundle/InjectedBundle.h:
* WebProcess/Network/WebSocketChannel.h:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
* WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h:
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
* WebProcess/WebPage/WebFrame.h:

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

4 months agorun-web-platform-tests: remove support for in-repository manifest, expectation management
zandobersek@gmail.com [Tue, 24 Sep 2019 06:16:41 +0000 (06:16 +0000)]
run-web-platform-tests: remove support for in-repository manifest, expectation management
https://bugs.webkit.org/show_bug.cgi?id=202037

Reviewed by Carlos Alberto Lopez Perez.

.:

Remove the test expecations JSON and test manifest file that were used
for managing and generating the necessary wptrunner metadata.

* WebPlatformTests/gtk/TestExpectations.json: Removed.
* WebPlatformTests/gtk/TestManifest.ini: Removed.

Tools:

Instead of keeping wpt metadata inside the WebKit repository or have it
generated on-the-fly, provide additional option flags for the
run-web-platform-tests script that allows detailed specification of the
metadata, manifest and include manifest locations, if necessary.

If the metadata location is not provided, the wptrunner tool will simply
not rely on any metadata to adjust expected results. With no manifest
path specified, the manifest will be generated inside the wpt checkout.
If no include manifest is specified, all the tests will be initially
selected for running (until they're possibly filtered through additional
command line arguments).

* Scripts/webkitpy/common/config/ports_mock.py:
(MockPort.run_bindings_tests_command):
(MockPort.wpt_metadata_directory): Deleted.
(MockPort.wpt_manifest_file): Deleted.
* Scripts/webkitpy/port/base.py:
(Port.default_results_directory):
(Port.wpt_metadata_directory): Deleted.
(Port.wpt_manifest_file): Deleted.
* Scripts/webkitpy/w3c/wpt_runner.py:
(parse_args):
(WPTRunner.prepare_wpt_checkout):
(WPTRunner.run):
(WPTRunner._generate_metadata_directory): Deleted.
(WPTRunner._wpt_run_paths): Deleted.
* Scripts/webkitpy/w3c/wpt_runner_unittest.py:
(WPTRunnerTest.TestInstance.__init__):
(WPTRunnerTest.test_prepare_wpt_checkout_specified_path):
(WPTRunnerTest.test_run):
(WPTRunnerTest.test_run_with_specified_options):
(WPTRunnerTest.test_run_with_args):
(WPTRunnerTest.TestInstance.prepare_mock_files_for_run): Deleted.
(WPTRunnerTest.test_generate_metadata_directory): Deleted.

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

4 months agoIntroducing Integrity audit functions.
mark.lam@apple.com [Tue, 24 Sep 2019 06:02:30 +0000 (06:02 +0000)]
Introducing Integrity audit functions.
https://bugs.webkit.org/show_bug.cgi?id=202085

Reviewed by Saam Barati.

This patch's main goal is to introduce the Integrity audit functions.  They can
be used wherever we want to audit a cell to probabilistically ensure it is not
corrupted.  However, to keep this patch small, we will only introduce the audit
tool here with one example use in SlotVisitor.  We'll follow up later with more
patches to deploy this tool throughout the VM.

1. Introduced Integrity audit functions that can be configured at several
   AuditLevels:
       None - don't do any audits.
       Minimal - do a minimal quick audit (minimize perf impact).
       Full - do a full audit of the many aspects of a cell.
       Random - randomly do a full audit with a probability dictated by
            Options::randomIntegrityAuditRate() between 0.0 (never audit) and
            1.0 (audit at every chance).

   The default AuditLevel for Debug builds is Random.
   The default AuditLevel for Release builds is None.
   The default Options::randomIntegrityAuditRate() is 0.05.

   How full audits work?
   ====================
   The full audit uses the VMInspector::verifyCell() template function to do its
   job.  The reason for keeping this separate is to allow the template function
   to be used later for debug checks that want to take some custom action on
   verification failure instead of crashing with a RELEASE_ASSERT.

   Full audit of a cell pointer includes:
   a. Verify that a cell designated as a LargeAllocation is in the heap's
      set of LargeAllocations.

   b. Verify that a cell not designated as a LargeAllocation is actually in its
      MarkedBlock's bounds.

   c. Verify that the cell's container (LargeAllocation / MarkedBlock) actually
      belongs to the current VM.

   d. Verify that a cell in a MarkedBlock is properly aligned on the block's
      allocation unit size.

   e. If the cell is not an ImmutableButterfly, verify that it is not located in
      the Gigacage.

   f. Verify that the cell's JSType matches its StructureBlob's JSType.

   g. Verify that the cell size as dictated by the cell ClassInfo does not exceed
      the size of the allocation unit size (as expected by the container
      MarkedBlock or LargeAllocation).

      Some cells are dynamically size (see isDynamicallySizedType()).  For these
      cells, we compute their sizes and verify that the size does not exceed the
      allocation unit size.  Their sizes should also be greater or equal to the
      static cell size as dictated by their ClassInfo.

   h. If a cell has a butterfly, verify that the butterfly is in its the JSValue
      Gigacage.

   We can add more verifications later, or make some these more robust, but this
   is a start for now.

   How random audits work?
   ======================
   Random audits are triggered by the m_triggerBits bits in VM::m_integrityRandom.
   m_triggerBits is a 64-bit bitfield.

   If Options::randomIntegrityAuditRate() is 0, m_triggerBits will always be 0,
   and no audits will be done.

   If Options::randomIntegrityAuditRate() is non-zero, m_triggerBits will be
   initialized as follows:

        | 1 reload bit | ... 63 trigger bits ... |

   The reload bit is always set (more details below).
   Each of the 63 trigger bits are randomly set depending if the following is true
   for the bit:

        VM::random() <= Options::randomIntegrityAuditRate() * UINT_MAX

   When Integrity::auditCell() is called, we take the bottom bit as the trigger
   bit for the current cell, and shifts the rest down by 1.

   If m_triggerBits is non-null after the shift, the taken trigger bit will dictate
   whether we do a full audit on the current cell or not.

   Once the reload bit reaches the bottom, we call a reload function to
   re-initialize m_triggerBits.  The reload function also returns a bool
   indicating whether to trigger a full audit of the current cell.

   With this scheme, we only need to call the reload function once every 64 calls
   to Integrity::auditCell(), and can efficiently determine whether to trigger
   the audit the other 63 times with the probability specified in
   Options::randomIntegrityAuditRate().

2. Embedded the C++ class size of JSCells into their ClassInfo.  This is used in
   the full audits to verify cell sizes.

3. Added isDynamicallySizedType() to check if a JSType has a dynamic size allocation
   i.e. the size of instances of this type is not determined by the static C++
   size of its class, but rather, depends on some runtime variable.

4. Made the VMInspector a friend of several classes so that it can access their
   private methods and fields.

5. Moved the inline function JSBigInt::allocationSize() from BigInt.cpp to its
   header file so that we can use it in VMInspector::verifyCellSize().

6. Gave the JSModuleNamespaceObject() its own JSType so that we can identify it
   as a dynamically sized object.

7. Increased the randomness of VM::random() (which is implemented with WeakRandom)
   by re-seeding it with a cryptographically random number each GC.

8. Called Integrity::auditCell() on SlotVisitor::appendJSCellOrAuxiliary()'s cell
   as an example use of auditCell().  More uses will be added in later patches to
   follow.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* heap/Heap.cpp:
(JSC::Heap::runBeginPhase):
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::appendJSCellOrAuxiliary):
* runtime/ClassInfo.h:
* runtime/DirectArguments.h:
* runtime/JSBigInt.cpp:
(JSC::JSBigInt::allocationSize): Deleted.
* runtime/JSBigInt.h:
(JSC::JSBigInt::allocationSize):
* runtime/JSModuleNamespaceObject.h:
* runtime/JSType.cpp:
(WTF::printInternal):
* runtime/JSType.h:
(JSC::isDynamicallySizedType):
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):
* runtime/OptionsList.h:
* runtime/Structure.h:
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
(JSC::VM::random):
(JSC::VM::integrityRandom):
* tools/Integrity.cpp: Added.
(JSC::Integrity::Random::Random):
(JSC::Integrity::Random::reloadAndCheckShouldAuditSlow):
(JSC::Integrity::auditCellFully):
(JSC::Integrity::auditCellMinimallySlow):
* tools/Integrity.h: Added.
(JSC::Integrity::auditCell):
* tools/IntegrityInlines.h: Added.
(JSC::Integrity::Random::shouldAudit):
(JSC::Integrity::auditCellMinimally):
(JSC::Integrity::auditCellRandomly):
* tools/VMInspector.h:
(JSC::VMInspector::unusedVerifier):
(JSC::VMInspector::verifyCellSize):
* tools/VMInspectorInlines.h: Added.
(JSC::VMInspector::verifyCellSize):
(JSC::VMInspector::verifyCell):

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

4 months agoFix WPT test html/browsers/offline/application-cache-api/api_swapcache_error.https...
commit-queue@webkit.org [Tue, 24 Sep 2019 05:25:11 +0000 (05:25 +0000)]
Fix WPT test html/browsers/offline/application-cache-api/api_swapcache_error.https.html
https://bugs.webkit.org/show_bug.cgi?id=202056
<rdar://problem/55523986>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-09-23
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/html/browsers/offline/application-cache-api/api_swapcache_error.https-expected.txt:

Source/WebCore:

The test makes sure we throw an exception when we are in an invalid state, which we should definitely do.

* loader/appcache/ApplicationCache.cpp:
(WebCore::ApplicationCache::setGroup):
(WebCore::ApplicationCache::setManifestResource):
* loader/appcache/ApplicationCache.h:
(WebCore::ApplicationCache::manifestResource const):
(WebCore::ApplicationCache::group const):
* loader/appcache/ApplicationCacheGroup.h:
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::candidateApplicationCacheGroup const):
(WebCore::ApplicationCacheHost::failedLoadingMainResource):
(WebCore::ApplicationCacheHost::setCandidateApplicationCacheGroup):
(WebCore::ApplicationCacheHost::swapCache):
* loader/appcache/ApplicationCacheHost.h:
(WebCore::ApplicationCacheHost::candidateApplicationCacheGroup const): Deleted.
* loader/appcache/ApplicationCacheResource.h:

LayoutTests:

* TestExpectations:

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

4 months agoPlugInClient::didStartFromOrigin() does not need a sessionID
cdumez@apple.com [Tue, 24 Sep 2019 04:37:45 +0000 (04:37 +0000)]
PlugInClient::didStartFromOrigin() does not need a sessionID
https://bugs.webkit.org/show_bug.cgi?id=202127

Reviewed by Geoffrey Garen.

Source/WebCore:

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
* page/PlugInClient.h:

Source/WebKit:

* WebProcess/WebCoreSupport/WebPlugInClient.cpp:
(WebKit::WebPlugInClient::didStartFromOrigin):
* WebProcess/WebCoreSupport/WebPlugInClient.h:

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

4 months agoFrameSpecificStorageAccessIdentifier does not need a sessionID
cdumez@apple.com [Tue, 24 Sep 2019 04:26:29 +0000 (04:26 +0000)]
FrameSpecificStorageAccessIdentifier does not need a sessionID
https://bugs.webkit.org/show_bug.cgi?id=202093

Reviewed by Geoffrey Garen.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::requestStorageAccess):

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

4 months ago[Win][WebKitTestRunner] Implement EventSenderProxy::keyDown
Hironori.Fujii@sony.com [Tue, 24 Sep 2019 03:54:13 +0000 (03:54 +0000)]
[Win][WebKitTestRunner] Implement EventSenderProxy::keyDown
https://bugs.webkit.org/show_bug.cgi?id=201913

Reviewed by Ross Kirsling.

Implemented eventSender.keyDown for Windows WebKitTestRunner based
on DumpRenderTree implementation.

There is a difference between them. Only WTR truns KF_UP and
KF_REPEAT flags on for WM_KEYUP event.
EventSenderProxy::dispatchMessage is used in WTR. It calls
TranslateMessage, this introduces the difference. If I didn't turn
those bits, TranslateMessage posts WM_CHAR even for WM_KEYUP.
According the spec, WM_KEYUP needs those bits.
<https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-keyup>
DRT doesn't need the those bits becasuse it doesn't use
TranslateMessage for WM_KEYUP.

* WebKitTestRunner/win/EventSenderProxyWin.cpp:
(WTR::makeKeyDataForScanCode): Added.
(WTR::pumpMessageQueue): Added.
(WTR::EventSenderProxy::keyDown): Implemented by using DRT code.

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

4 months agoUnreviewed, rolling out r250262.
commit-queue@webkit.org [Tue, 24 Sep 2019 02:13:39 +0000 (02:13 +0000)]
Unreviewed, rolling out r250262.
https://bugs.webkit.org/show_bug.cgi?id=202126

"Breaks Win64 builds because of MSVC bug" (Requested by mlam|a
on #webkit).

Reverted changeset:

"Reduce the amount of memory needed to store Options."
https://bugs.webkit.org/show_bug.cgi?id=202105
https://trac.webkit.org/changeset/250262

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

4 months agoWeb Inspector: Canvas: WebGPU compute shaders aren't syntax highlighted
drousso@apple.com [Tue, 24 Sep 2019 00:51:35 +0000 (00:51 +0000)]
Web Inspector: Canvas: WebGPU compute shaders aren't syntax highlighted
https://bugs.webkit.org/show_bug.cgi?id=202030

Reviewed by Joseph Pecoraro.

* UserInterface/Views/CodeMirrorAdditions.js:
`CodeMirror.defineMIME` expects a "spec" object, which can't just be another MIME type.
Instead, get the "spec" of the defined "x-shader/x-vertex" and "x-shader/x-fragment" modes
and use that when defining MIMEs for the WebGPU shader pipeline modes.

* UserInterface/Views/ShaderProgramContentView.js:
(WI.ShaderProgramContentView):
Get the `contextType` off of the shader's canvas, which is where it actually lives.

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

4 months agoImport SVG web-platform-tests
commit-queue@webkit.org [Tue, 24 Sep 2019 00:46:14 +0000 (00:46 +0000)]
Import SVG web-platform-tests
https://bugs.webkit.org/show_bug.cgi?id=202017

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

* TestExpectations:
* imported/w3c/resources/import-expectations.json:
* imported/w3c/web-platform-tests/resources/SVGAnimationTestCase-testharness.js:
* imported/w3c/web-platform-tests/svg: Added.
* platform/ios-simulator/imported/w3c/web-platform-tests/svg: Added.
* platform/mac/imported/w3c/web-platform-tests/svg: Added.
* tests-options.json:

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

4 months agoArray methods should throw TypeError upon attempting to modify a string
ross.kirsling@sony.com [Tue, 24 Sep 2019 00:26:29 +0000 (00:26 +0000)]
Array methods should throw TypeError upon attempting to modify a string
https://bugs.webkit.org/show_bug.cgi?id=201910

Reviewed by Keith Miller.

JSTests:

* stress/array-methods-should-not-modify-string.js: Added.

* mozilla/js1_6/Array/regress-304828.js:
Fix test. Original copy was changed similarly seven years ago:
https://searchfox.org/mozilla-central/source/js/src/tests/non262/Array/regress-304828.js

* stress/phantom-insertion-live-range-should-agree-with-arguments-forwarding.js:
Fix test. `Object.__proto__ = []; Object.shift();` shouldn't be valid JS.

Source/JavaScriptCore:

We currently allow Array prototype methods to modify strings that they are called upon in certain cases.
(In particular, we're inconsistent about permitting writes to the length property.)

According to section 22.1.3 of the ES spec, this should result in a TypeError.
https://tc39.es/ecma262/#sec-properties-of-the-array-prototype-object
(Test262 cases are needed, but the key is that all such methods use Set(..., true) which throws on failure.)

* runtime/ArrayPrototype.cpp:
(JSC::putLength):
(JSC::setLength):
Never update the length property of a non-JSArray without checking whether we're actually allowed to.

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

4 months agoLazy JSGlobalObject property materialization should not use putDirectWithoutTransition.
mark.lam@apple.com [Mon, 23 Sep 2019 23:33:36 +0000 (23:33 +0000)]
Lazy JSGlobalObject property materialization should not use putDirectWithoutTransition.
https://bugs.webkit.org/show_bug.cgi?id=202122
<rdar://problem/55535249>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/lazy-global-object-property-materialization-should-not-putDirectWithoutTransition.js: Added.

Source/JavaScriptCore:

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):

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

4 months ago[Web Animations] Update WPT tests
graouts@webkit.org [Mon, 23 Sep 2019 23:00:56 +0000 (23:00 +0000)]
[Web Animations] Update WPT tests
https://bugs.webkit.org/show_bug.cgi?id=202110

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/web-animations/README.md:
* web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/property-list.js:
* web-platform-tests/web-animations/animation-model/animation-types/property-types.js:
* web-platform-tests/web-animations/animation-model/combining-effects/effect-composition-expected.txt:
* web-platform-tests/web-animations/animation-model/combining-effects/effect-composition.html:
* web-platform-tests/web-animations/animation-model/keyframe-effects/computed-keyframes-shorthands-expected.txt: Added.
* web-platform-tests/web-animations/animation-model/keyframe-effects/computed-keyframes-shorthands.html: Added.
* web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-context-filling-expected.txt: Added.
* web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-context-filling.html: Added.
* web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation.html:
* web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-replaced-animations-expected.txt: Added.
* web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-replaced-animations.html: Added.
* web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-transformed-distance-expected.txt:
* web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-transformed-distance.html:
* web-platform-tests/web-animations/interfaces/Animatable/animate-expected.txt:
* web-platform-tests/web-animations/interfaces/Animatable/animate.html:
* web-platform-tests/web-animations/interfaces/Animatable/getAnimations-expected.txt:
* web-platform-tests/web-animations/interfaces/Animatable/getAnimations.html:
* web-platform-tests/web-animations/interfaces/Animation/commitStyles-expected.txt: Added.
* web-platform-tests/web-animations/interfaces/Animation/commitStyles.html: Added.
* web-platform-tests/web-animations/interfaces/Animation/persist-expected.txt: Added.
* web-platform-tests/web-animations/interfaces/Animation/persist.html: Added.
* web-platform-tests/web-animations/interfaces/Animation/style-change-events-expected.txt: Added.
* web-platform-tests/web-animations/interfaces/Animation/style-change-events.html: Added.
* web-platform-tests/web-animations/interfaces/AnimationEffect/updateTiming-expected.txt:
* web-platform-tests/web-animations/interfaces/Document/getAnimations-expected.txt:
* web-platform-tests/web-animations/interfaces/Document/getAnimations.html:
* web-platform-tests/web-animations/interfaces/DocumentTimeline/constructor.html:
* web-platform-tests/web-animations/interfaces/DocumentTimeline/style-change-events-expected.txt: Added.
* web-platform-tests/web-animations/interfaces/DocumentTimeline/style-change-events.html: Added.
* web-platform-tests/web-animations/interfaces/KeyframeEffect/constructor-expected.txt:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/getKeyframes-expected.txt: Added.
* web-platform-tests/web-animations/interfaces/KeyframeEffect/getKeyframes.html: Added.
* web-platform-tests/web-animations/interfaces/KeyframeEffect/setKeyframes-expected.txt:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/style-change-events-expected.txt: Added.
* web-platform-tests/web-animations/interfaces/KeyframeEffect/style-change-events.html: Added.
* web-platform-tests/web-animations/interfaces/KeyframeEffect/target-expected.txt:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/target.html:
* web-platform-tests/web-animations/resources/easing-tests.js:
* web-platform-tests/web-animations/resources/keyframe-tests.js:
* web-platform-tests/web-animations/resources/timing-override.js: Added.
* web-platform-tests/web-animations/testcommon.js:
* web-platform-tests/web-animations/timing-model/animations/canceling-an-animation-expected.txt:
* web-platform-tests/web-animations/timing-model/animations/canceling-an-animation.html:
* web-platform-tests/web-animations/timing-model/animations/finishing-an-animation.html:
* web-platform-tests/web-animations/timing-model/animations/pausing-an-animation.html:
* web-platform-tests/web-animations/timing-model/animations/setting-the-start-time-of-an-animation.html:
* web-platform-tests/web-animations/timing-model/animations/the-current-time-of-an-animation.html:
* web-platform-tests/web-animations/timing-model/animations/updating-the-finished-state.html:
* web-platform-tests/web-animations/timing-model/time-transformations/transformed-progress-expected.txt:
* web-platform-tests/web-animations/timing-model/time-transformations/transformed-progress.html:
* web-platform-tests/web-animations/timing-model/timelines/document-timelines-expected.txt:
* web-platform-tests/web-animations/timing-model/timelines/document-timelines.html:
* web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-expected.txt:
* web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-replacement-expected.txt: Added.
* web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-replacement.html: Added.
* web-platform-tests/web-animations/timing-model/timelines/update-and-send-events.html:

LayoutTests:

* TestExpectations:
* platform/ios/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-expected.txt:
* platform/ios/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt:
* platform/ios/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:
* platform/mac/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-expected.txt: Removed.
* platform/mac/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt: Removed.
* platform/mac/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt: Removed.

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

4 months agoReduce the amount of memory needed to store Options.
mark.lam@apple.com [Mon, 23 Sep 2019 22:56:26 +0000 (22:56 +0000)]
Reduce the amount of memory needed to store Options.
https://bugs.webkit.org/show_bug.cgi?id=202105

Reviewed by Yusuke Suzuki.

The size of the JSC::Config needed to store the Options is now reduced to 4K
instead of 16K, enabled by constexpr template magic.

1. Instead of all options in a large array of OptionEntry (which is a union of
   all the option types), we now have separate arrays for each of the types of
   options.  For example,

        Removed g_jscConfig.options[].
        Added g_jscConfig.typeBoolOptions[].
        Added g_jscConfig.typeInt32Options[].
        Added g_jscConfig.typeDoubleOptions[].
        ...

   We used to find the storage for the option using g_jscConfig.options[Options::ID].
   We now find the storage for each type of option using
   g_jscConfig.options[optionTypeSpecificIndex<OptionTypeID, OptionID>()].  For
   example, Options::useJIT() used to be implemented as:

       inline bool& Options::useJIT()
       {
            return g_jscConfig.options[Options::useJITID];
       }

   ... which is now replaced with:

       inline bool& Options::useJIT()
       {
            return g_jscConfig.typeBoolOptions[optionTypeSpecificIndex<OptionTypeID::Bool, OptionID::useJIT>()];
       }

2. Introduce the optionTypeSpecificIndex() constexpr template function for
   computing the index of each option in their respective type specific options
   array.

3. Introduce OptionTypes, OptionTypeID, and OptionID.

   The OptionTypes namespace replaces OptionEntry as the container of option types.
   The OptionID enum class replaces Options::ID.
   The OptionTypeID enum class is new and is used together with OptionID in
       constexpr templates to compute the typeSpecificIndex of options.

4. Removed the OptionEntry struct and OptionEntry.h.  After (1), this struct is
   only used in the Option class.  We just moved the union of option types (that
   OptionEntry embeds) into the Option class.

   Moved class OptionRange into OptionsList.h.

5. Removed the large OptionEntry arrays from JSC::Config.
   Added type specific options arrays.
   Also ordered these arrays to maximize compactness and minimize internal fragmentation.

6. Changed scaleJITPolicy() to go directly to g_jscConfig.typeInt32Options[]
   instead of going through the Option wrapper object.  This allows us to simplify
   things and make the Option class a read only interface of options.

7. Changed Options::initialize() to only compute the option default value once.
   The default value specified in the OptionsList may not always be a constant.
   Sometimes, it is a function call.

8. The Option class now only gives read only access to the options.

   The Option class' role is to provide an interface for reading an option at any
   given OptionID without first knowing about the type of the specific option.
   It is useful for iterating options, and is currently only used by
   Options::dumpOption().

   Technically, we could merge all the Option class code into its single client.
   We opted not to do this because the amount of code is non-trivial, and the
   Option class does a good job of encapsulating this functionality.

* API/glib/JSCOptions.cpp:
(jscOptionsSetValue):
(jscOptionsGetValue):
(jsc_options_foreach):
(jsc_options_get_option_group):
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* runtime/JSCConfig.h:
* runtime/OptionEntry.h: Removed.
* runtime/Options.cpp:
(JSC::Options::isAvailable):
(JSC::overrideOptionWithHeuristic):
(JSC::scaleJITPolicy):
(JSC::recomputeDependentOptions):
(JSC::Options::initialize):
(JSC::Options::setOptionWithoutAlias):
(JSC::Options::dumpAllOptions):
(JSC::Options::dumpOption):
(JSC::Option::Option):
(JSC::Option::defaultOption const):
(JSC::Option::dump const):
(JSC::Option::operator== const):
* runtime/Options.h:
(JSC::Option::id const):
(JSC::Option::name const):
(JSC::Option::description const):
(JSC::Option::type const):
(JSC::Option::availability const):
(JSC::Option::isOverridden const):
(JSC::Option::Option):
(JSC::Option::idIndex const):
(JSC::Option::defaultOption const): Deleted.
(JSC::Option::boolVal): Deleted.
(JSC::Option::unsignedVal): Deleted.
(JSC::Option::doubleVal): Deleted.
(JSC::Option::int32Val): Deleted.
(JSC::Option::optionRangeVal): Deleted.
(JSC::Option::optionStringVal): Deleted.
(JSC::Option::gcLogLevelVal): Deleted.
* runtime/OptionsList.h:
(JSC::OptionRange::operator= ):
(JSC::OptionRange::rangeString const):
(JSC::optionTypeSpecificIndex):
(JSC::countNumberOfJSCOptionsOfType):

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

4 months agoLayout test webaudio/silence-after-playback.html is failing
commit-queue@webkit.org [Mon, 23 Sep 2019 22:54:35 +0000 (22:54 +0000)]
Layout test webaudio/silence-after-playback.html is failing
https://bugs.webkit.org/show_bug.cgi?id=202116

Patch by Peng Liu <peng.liu6@apple.com> on 2019-09-23
Reviewed by Jer Noble.

Rebasing a webaudio layout test expected result because of a bug fix in Catalina.

* platform/mac-mojave/webaudio/silence-after-playback-expected.wav: Copied from LayoutTests/platform/mac/webaudio/silence-after-playback-expected.wav.
* platform/mac/TestExpectations:
* platform/mac/webaudio/silence-after-playback-expected.wav:

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

4 months agomacOS: <datalist> dropdown shadow is cropped, looks nothing like NSComboBox
timothy_horton@apple.com [Mon, 23 Sep 2019 22:42:22 +0000 (22:42 +0000)]
macOS: <datalist> dropdown shadow is cropped, looks nothing like NSComboBox
https://bugs.webkit.org/show_bug.cgi?id=199350

Reviewed by Wenson Hsieh.

Improve the appearance of the macOS <datalist> dropdown, adopting the
roundly-cornered and backdrop-ful appearance of the current NSComboBox style.

Use the proper window shadow instead of our own inside the window, both
so that we match the system and so that it doesn't get clipped.

Allow vertical rubber-banding, because NSComboBox does.

Don't highlight on hover, because NSComboBox doesn't. Do use NSTableView's
selection mechanism instead of rolling our own for highlights driven by
keyboard-based navigation.

Make use of NSTableCellView, since it has some smarts around pixel alignment
that we don't need to duplicate (and things are blurry on 1x displays without).

Also rename some classes to make it a bit more clear what's going on:
WKDataListSuggestionCell -> WKDataListSuggestionView (it's a NSView, not an NSCell)
WKDataListSuggestionsView -> WKDataListSuggestionsController (it's not a view at all)

* Platform/spi/mac/AppKitSPI.h:
* UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
(WebKit::WebDataListSuggestionsDropdownMac::show):
(-[WKDataListSuggestionWindow initWithContentRect:styleMask:backing:defer:]):
(-[WKDataListSuggestionWindow canBecomeKeyWindow]):
(-[WKDataListSuggestionWindow hasKeyAppearance]):
(-[WKDataListSuggestionWindow shadowOptions]):
(-[WKDataListSuggestionView initWithFrame:]):
(-[WKDataListSuggestionView setText:]):
(-[WKDataListSuggestionView setBackgroundStyle:]):
(-[WKDataListSuggestionTableRowView drawSelectionInRect:]):
(-[WKDataListSuggestionTableView initWithElementRect:]):
(-[WKDataListSuggestionTableView layout]):
(-[WKDataListSuggestionTableView reload]):
(-[WKDataListSuggestionsController initWithInformation:inView:]):
(-[WKDataListSuggestionsController currentSelectedString]):
(-[WKDataListSuggestionsController updateWithInformation:]):
(-[WKDataListSuggestionsController moveSelectionByDirection:]):
(-[WKDataListSuggestionsController invalidate]):
(-[WKDataListSuggestionsController dropdownRectForElementRect:]):
(-[WKDataListSuggestionsController showSuggestionsDropdown:]):
(-[WKDataListSuggestionsController tableView:rowViewForRow:]):
(-[WKDataListSuggestionsController tableView:viewForTableColumn:row:]):
(-[WKDataListSuggestionCell initWithFrame:]): Deleted.
(-[WKDataListSuggestionCell setText:]): Deleted.
(-[WKDataListSuggestionCell setActive:]): Deleted.
(-[WKDataListSuggestionCell drawRect:]): Deleted.
(-[WKDataListSuggestionCell mouseEntered:]): Deleted.
(-[WKDataListSuggestionCell mouseExited:]): Deleted.
(-[WKDataListSuggestionCell acceptsFirstResponder]): Deleted.
(-[WKDataListSuggestionTable initWithElementRect:]): Deleted.
(-[WKDataListSuggestionTable setVisibleRect:]): Deleted.
(-[WKDataListSuggestionTable currentActiveRow]): Deleted.
(-[WKDataListSuggestionTable setActiveRow:]): Deleted.
(-[WKDataListSuggestionTable reload]): Deleted.
(-[WKDataListSuggestionTable acceptsFirstResponder]): Deleted.
(-[WKDataListSuggestionTable enclosingScrollView]): Deleted.
(-[WKDataListSuggestionTable removeFromSuperviewWithoutNeedingDisplay]): Deleted.
(-[WKDataListSuggestionsView initWithInformation:inView:]): Deleted.
(-[WKDataListSuggestionsView currentSelectedString]): Deleted.
(-[WKDataListSuggestionsView updateWithInformation:]): Deleted.
(-[WKDataListSuggestionsView moveSelectionByDirection:]): Deleted.
(-[WKDataListSuggestionsView invalidate]): Deleted.
(-[WKDataListSuggestionsView dropdownRectForElementRect:]): Deleted.
(-[WKDataListSuggestionsView showSuggestionsDropdown:]): Deleted.
(-[WKDataListSuggestionsView selectedRow:]): Deleted.
(-[WKDataListSuggestionsView numberOfRowsInTableView:]): Deleted.
(-[WKDataListSuggestionsView tableView:heightOfRow:]): Deleted.
(-[WKDataListSuggestionsView tableView:viewForTableColumn:row:]): Deleted.

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

4 months agoWeb Inspector: Canvas: show WebGPU shader pipelines
drousso@apple.com [Mon, 23 Sep 2019 22:27:20 +0000 (22:27 +0000)]
Web Inspector: Canvas: show WebGPU shader pipelines
https://bugs.webkit.org/show_bug.cgi?id=201675
<rdar://problem/55543450>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/Canvas.json:
Add a `ProgramType` enum that conveys the type of shader program/pipeline when notifying the
frontend of a new program

Source/WebCore:

Tests: inspector/canvas/requestShaderSource-webgpu.html
       inspector/canvas/shaderProgram-add-remove-webgpu.html
       inspector/canvas/updateShader-webgpu.html

Create common base classes for `WebGPUPipeline` and `GPUPipeline` so that Web Inspector can
instrument both render and compute shader pipelines.

Refactor `InspectorShaderProgram` to support both `WebGLProgram` and `WebGPUPipeline` so
that the same object can be used for all types of shader "program"s.

Keep a copy of each shader module's source, and allow the shader module to be updated.

* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::WebGPUDevice):
(WebCore::WebGPUDevice::~WebGPUDevice):
(WebCore::WebGPUDevice::createShaderModule const):
(WebCore::WebGPUDevice::createRenderPipeline): Added.
(WebCore::WebGPUDevice::createComputePipeline): Added.
(WebCore::WebGPUDevice::createRenderPipeline const): Deleted.
(WebCore::WebGPUDevice::createComputePipeline const): Deleted.

* Modules/webgpu/WebGPUPipeline.h: Added.
(WebCore::WebGPUPipeline::isRenderPipeline const):
(WebCore::WebGPUPipeline::isComputePipeline const):
(WebCore::WebGPUPipeline::scriptExecutionContext const):
* Modules/webgpu/WebGPUPipeline.cpp: Added.
(WebCore::WebGPUPipeline::instancesMutex):
(WebCore::WebGPUPipeline::WebGPUPipeline):
(WebCore::WebGPUPipeline::~WebGPUPipeline):
* platform/graphics/gpu/GPUPipeline.cpp: Added.
* platform/graphics/gpu/GPUPipeline.h: Added.
(WebCore::GPUPipeline::isRenderPipeline const):
(WebCore::GPUPipeline::isComputePipeline const):

* Modules/webgpu/WebGPUComputePipeline.idl:
* Modules/webgpu/WebGPUComputePipeline.h:
(WebCore::WebGPUComputePipeline::computePipeline const): Deleted.
* Modules/webgpu/WebGPUComputePipeline.cpp:
(WebCore::WebGPUComputePipeline::create):
(WebCore::WebGPUComputePipeline::WebGPUComputePipeline):
(WebCore::WebGPUComputePipeline::recompile): Added.
* platform/graphics/gpu/GPUComputePipeline.h:
(WebCore::GPUComputePipeline::isComputePipeline): Added.
* platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
(WebCore::GPUComputePipeline::tryCreate):
(WebCore::GPUComputePipeline::GPUComputePipeline):
(WebCore::GPUComputePipeline::recompile): Added.

* Modules/webgpu/WebGPURenderPipeline.idl:
* Modules/webgpu/WebGPURenderPipeline.h:
(WebCore::WebGPURenderPipeline::renderPipeline const): Deleted.
* Modules/webgpu/WebGPURenderPipeline.cpp:
(WebCore::WebGPURenderPipeline::create):
(WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
(WebCore::WebGPURenderPipeline::recompile): Added.
* platform/graphics/gpu/GPURenderPipeline.h:
(WebCore::GPURenderPipeline::isRenderPipeline): Added.
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::tryCreateMtlRenderPipelineState):
(WebCore::GPURenderPipeline::tryCreate):
(WebCore::GPURenderPipeline::GPURenderPipeline):
(WebCore::GPURenderPipeline::recompile): Added.

* Modules/webgpu/WebGPUShaderModule.h:
(WebCore::WebGPUShaderModule::source const): Added.
* Modules/webgpu/WebGPUShaderModule.cpp:
(WebCore::WebGPUShaderModule::update): Added.
* Modules/webgpu/WebGPUProgrammableStageDescriptor.h:
* platform/graphics/gpu/GPUProgrammableStageDescriptor.h:
(WebCore::GPUProgrammableStageDescriptor::GPUProgrammableStageDescriptor):

* inspector/InspectorShaderProgram.h:
* inspector/InspectorShaderProgram.cpp:
(WebCore::InspectorShaderProgram::create):
(WebCore::InspectorShaderProgram::InspectorShaderProgram):
(WebCore::InspectorShaderProgram::program const): Added.
(WebCore::InspectorShaderProgram::pipeline const): Added.
(WebCore::shaderForType): Added.
(WebCore::InspectorShaderProgram::requestShaderSource): Added.
(WebCore::InspectorShaderProgram::updateShader): Added.
(WebCore::InspectorShaderProgram::context const): Deleted.
(WebCore::InspectorShaderProgram::shaderForType): Deleted.

* inspector/agents/InspectorCanvasAgent.h:
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
(WebCore::InspectorCanvasAgent::discardAgent):
(WebCore::InspectorCanvasAgent::enable):
(WebCore::InspectorCanvasAgent::disable):
(WebCore::InspectorCanvasAgent::requestShaderSource):
(WebCore::InspectorCanvasAgent::updateShader):
(WebCore::InspectorCanvasAgent::setShaderProgramDisabled):
(WebCore::InspectorCanvasAgent::setShaderProgramHighlighted):
(WebCore::InspectorCanvasAgent::frameNavigated):
(WebCore::InspectorCanvasAgent::didCreateWebGLProgram): Added.
(WebCore::InspectorCanvasAgent::willDestroyWebGLProgram): Added.
(WebCore::InspectorCanvasAgent::isWebGLProgramDisabled): Added.
(WebCore::InspectorCanvasAgent::isWebGLProgramHighlighted): Added.
(WebCore::InspectorCanvasAgent::didCreateWebGPUPipeline): Added.
(WebCore::InspectorCanvasAgent::willDestroyWebGPUPipeline): Added.
(WebCore::InspectorCanvasAgent::programDestroyedTimerFired): Added.
(WebCore::InspectorCanvasAgent::reset): Added.
(WebCore::InspectorCanvasAgent::unbindProgram):
(WebCore::InspectorCanvasAgent::findInspectorProgram):
(WebCore::InspectorCanvasAgent::didCreateProgram): Deleted.
(WebCore::InspectorCanvasAgent::willDeleteProgram): Deleted.
(WebCore::InspectorCanvasAgent::isShaderProgramDisabled): Deleted.
(WebCore::InspectorCanvasAgent::isShaderProgramHighlighted): Deleted.
(WebCore::InspectorCanvasAgent::clearCanvasData): Deleted.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didCreateWebGLProgram): Added.
(WebCore::InspectorInstrumentation::willDestroyWebGLProgram): Added.
(WebCore::InspectorInstrumentation::isWebGLProgramDisabled): Added.
(WebCore::InspectorInstrumentation::isWebGLProgramHighlighted): Added.
(WebCore::InspectorInstrumentation::didCreateWebGPUPipeline): Added.
(WebCore::InspectorInstrumentation::willDestroyWebGPUPipeline): Added.
(WebCore::InspectorInstrumentation::didCreateProgram): Deleted.
(WebCore::InspectorInstrumentation::willDeleteProgram): Deleted.
(WebCore::InspectorInstrumentation::isShaderProgramDisabled): Deleted.
(WebCore::InspectorInstrumentation::isShaderProgramHighlighted): Deleted.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didCreateWebGLProgramImpl): Added.
(WebCore::InspectorInstrumentation::willDestroyWebGLProgramImpl): Added.
(WebCore::InspectorInstrumentation::isWebGLProgramDisabledImpl): Added.
(WebCore::InspectorInstrumentation::isWebGLProgramHighlightedImpl): Added.
(WebCore::InspectorInstrumentation::didCreateWebGPUPipelineImpl): Added.
(WebCore::InspectorInstrumentation::willDestroyWebGPUPipelineImpl): Added.
(WebCore::InspectorInstrumentation::didCreateProgramImpl): Deleted.
(WebCore::InspectorInstrumentation::willDeleteProgramImpl): Deleted.
(WebCore::InspectorInstrumentation::isShaderProgramDisabledImpl): Deleted.
(WebCore::InspectorInstrumentation::isShaderProgramHighlightedImpl): Deleted.

* html/canvas/WebGLProgram.h:
* html/canvas/WebGLProgram.cpp:
(WebCore::WebGLProgram::WebGLProgram):
(WebCore::WebGLProgram::~WebGLProgram):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::InspectorScopedShaderProgramHighlight::showHightlight):
(WebCore::WebGLRenderingContextBase::createProgram):
(WebCore::WebGLRenderingContextBase::deleteProgram):
(WebCore::WebGLRenderingContextBase::drawArrays):
(WebCore::WebGLRenderingContextBase::drawElements):
Rename WebGL program instrumentation points to be less ambiguous.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

Source/WebInspectorUI:

Show WebGPU shader pipelines ("programs") underneath each corresponding WebGPU device.

Allow editing of attached shader modules for each WebGPU shader pipeline, but don't allow
highlighting/disabling, as WebGPU pipelines don't have those capabilities/concepts yet.

* UserInterface/Protocol/CanvasObserver.js:
(WI.CanvasObserver.prototype.programCreated):
* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.programCreated):

* UserInterface/Models/Canvas.js:
(WI.Canvas.prototype.nextShaderProgramDisplayNumberForProgramType): Added.
(WI.Canvas.prototype.nextShaderProgramDisplayNumber): Deleted.

* UserInterface/Models/ShaderProgram.js:
(WI.ShaderProgram):
(WI.ShaderProgram.contextTypeSupportsProgramType): Added.
(WI.ShaderProgram.programTypeSupportsShaderType): Added.
(WI.ShaderProgram.prototype.get programType): Added.
(WI.ShaderProgram.prototype.get displayName):
(WI.ShaderProgram.prototype.set disabled):
(WI.ShaderProgram.prototype.requestShaderSource):
(WI.ShaderProgram.prototype.updateShader):
(WI.ShaderProgram.prototype.showHighlight):
(WI.ShaderProgram.prototype.hideHighlight):
(WI.ShaderProgram.prototype.requestVertexShaderSource): Deleted.
(WI.ShaderProgram.prototype.requestFragmentShaderSource): Deleted.
(WI.ShaderProgram.prototype.updateVertexShader): Deleted.
(WI.ShaderProgram.prototype.updateFragmentShader): Deleted.
(WI.ShaderProgram.prototype._requestShaderSource): Deleted.
(WI.ShaderProgram.prototype._updateShader): Deleted.

* UserInterface/Views/ShaderProgramContentView.js:
(WI.ShaderProgramContentView):
(WI.ShaderProgramContentView.prototype.get navigationItems): Added.
(WI.ShaderProgramContentView.prototype.shown):
(WI.ShaderProgramContentView.prototype.hidden):
(WI.ShaderProgramContentView.prototype.get saveData):
(WI.ShaderProgramContentView.prototype._refreshContent):
(WI.ShaderProgramContentView.prototype._updateShader):
(WI.ShaderProgramContentView.prototype._contentDidChange):
* UserInterface/Views/ShaderProgramContentView.css:
(.content-view.shader-program > .shader): Added.
(.content-view.shader-program > .shader.compute): Added.
(body[dir=ltr] .content-view.shader-program > .shader.vertex,): Added.
(body[dir=ltr] .content-view.shader-program > .shader.fragment,): Added.
(.content-view.shader-program > .shader + .shader): Added.
(.content-view.shader-program > .shader > header > *): Added.
(.content-view.shader-program > .shader > header > .shader-type): Added.
(@media (prefers-color-scheme: dark) .content-view.shader-program > .shader > header): Added.
(.content-view.shader-program > .text-editor.shader): Deleted.
(body[dir=ltr] .content-view.shader-program > .text-editor.shader.vertex,): Deleted.
(body[dir=ltr] .content-view.shader-program > .text-editor.shader.fragment,): Deleted.
(body[dir=ltr] .content-view.shader-program > .text-editor.shader + .text-editor.shader): Deleted.
(body[dir=rtl] .content-view.shader-program > .text-editor.shader + .text-editor.shader): Deleted.
(.content-view.shader-program > .text-editor.shader > .type-title): Deleted.
(.content-view.shader-program > .text-editor.shader > .CodeMirror): Deleted.
* UserInterface/Views/CodeMirrorAdditions.js:

* UserInterface/Views/ShaderProgramTreeElement.js:
(WI.ShaderProgramTreeElement):
(WI.ShaderProgramTreeElement.prototype.onattach):
(WI.ShaderProgramTreeElement.prototype.ondetach):
(WI.ShaderProgramTreeElement.prototype.canSelectOnMouseDown):
(WI.ShaderProgramTreeElement.prototype.populateContextMenu):

* Localizations/en.lproj/localizedStrings.js:

LayoutTests:

Split existing shader tests into WebGL and WebGPU sub-tests for different platforms.

* inspector/canvas/requestShaderSource.html:
* inspector/canvas/requestShaderSource-expected.txt:
* inspector/canvas/updateShader.html:
* inspector/canvas/updateShader-expected.txt:

* inspector/canvas/resources/shaderProgram-utilities-webgpu.js: Added.
* inspector/canvas/requestShaderSource-webgpu.html: Added.
* inspector/canvas/requestShaderSource-webgpu-expected.txt: Added.
* inspector/canvas/shaderProgram-add-remove-webgpu.html: Added.
* inspector/canvas/shaderProgram-add-remove-webgpu-expected.txt: Added.
* inspector/canvas/updateShader-webgpu-expected.txt: Added.
* inspector/canvas/updateShader-webgpu.html: Added.

* inspector/canvas/resources/shaderProgram-utilities-webgl.js: Renamed from LayoutTests/inspector/canvas/resources/shaderProgram-utilities.js.
* inspector/canvas/console-record-webgl.html:
* inspector/canvas/console-record-webgl2.html:
* inspector/canvas/recording-webgl-frameCount.html:
* inspector/canvas/recording-webgl-full.html:
* inspector/canvas/recording-webgl-memoryLimit.html:
* inspector/canvas/recording-webgl-snapshots.html:
* inspector/canvas/recording-webgl2-frameCount.html:
* inspector/canvas/recording-webgl2-full.html:
* inspector/canvas/recording-webgl2-memoryLimit.html:
* inspector/canvas/recording-webgl2-snapshots.html:
* inspector/canvas/requestShaderSource-webgl.html: Added.
* inspector/canvas/requestShaderSource-webgl-expected.txt: Added.
* inspector/canvas/setShaderProgramDisabled.html:
* inspector/canvas/setShaderProgramHighlighted.html:
* inspector/canvas/shaderProgram-add-remove-webgl.html:
* inspector/canvas/shaderProgram-add-remove-webgl2.html:
* inspector/canvas/updateShader-webgl.html: Added.
* inspector/canvas/updateShader-webgl-expected.txt: Added.

* platform/gtk/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:
* platform/wpe/TestExpectations:

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

4 months ago[EWS] Rename CompileJSCOnly to CompileJSC
aakash_jain@apple.com [Mon, 23 Sep 2019 22:25:54 +0000 (22:25 +0000)]
[EWS] Rename CompileJSCOnly to CompileJSC
https://bugs.webkit.org/show_bug.cgi?id=202118

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/factories.py:
(JSCTestsFactory.__init__): Renamed CompileJSCOnly to CompileJSC.
* BuildSlaveSupport/ews-build/steps.py:
(CompileWebKit.evaluateCommand): Ditto.
(AnalyzeCompileWebKitResults.start): Ditto.
(CompileJSC): Changed step-name to 'compile-jsc' to better match with similar steps like 'compile-webkit'.
(CompileJSCToT): Ditto for 'compile-jsc-tot'.
* BuildSlaveSupport/ews-build/steps_unittest.py: Renamed CompileJSCOnly to CompileJSC and CompileJSCOnlyToT to CompileJSCToT.

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

4 months ago[iOS] Drop animation when dragging images from Photos to WebKit2 Mail compose is...
wenson_hsieh@apple.com [Mon, 23 Sep 2019 22:16:47 +0000 (22:16 +0000)]
[iOS] Drop animation when dragging images from Photos to WebKit2 Mail compose is incorrect
https://bugs.webkit.org/show_bug.cgi?id=201674
<rdar://problem/51250952>

Reviewed by Tim Horton.

Source/WebCore:

Adds new helper methods on DragController to support the new image placeholder drop codepath. See WebKit
ChangeLog for more details.

Tests:  WKAttachmentTestsIOS.TargetedPreviewsWhenDroppingImages
        WKAttachmentTestsIOS.TargetedPreviewIsClippedWhenDroppingTallImage

* editing/WebContentReader.h:

Fix the Windows build after including WebContentReader.h in DragController.cpp.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::isDroppedImagePlaceholder const):
(WebCore::HTMLImageElement::setIsDroppedImagePlaceholder):

Add a flag to HTMLImageElement, indicating whether it is a dropped image placeholder. If so, we have special
logic to remove some temporary inline style properties from the image after it has finished loading (see
finalizeDroppedImagePlaceholder).

Note that this doesn't increase the size of HTMLImageElement.

* page/DragController.cpp:
(WebCore::DragController::dragEnded):

Clean up any stale placeholders after the drag ends.

(WebCore::DragController::performDragOperation):
(WebCore::DragController::removeAllDroppedImagePlaceholders):

Add a private helper to clean up any dropped image placeholders after failing to update dropped image
placeholders for any reason.

(WebCore::DragController::tryToUpdateDroppedImagePlaceholders):

Invoked when performing the drag operation, after image data has been loaded; this function attempts to update
the list of image placeholder elements tracked by DragController that were previously inserted using
insertDroppedImagePlaceholdersAtCaret, and updates the source attribute of each element (as well as any backed
attachment element, if attachment elements are enabled). It achieves this by reading the dropped data as web
content, and matching up the images in the resulting fragment against the placeholder images. If each image in
the fragment can correspond to exactly one placeholder, we update the source of each placeholder image,
migrate attachment elements over to the placeholder images if needed, and finally discard the fragment.

A return value of false indicates that this process failed, in which case we clean up the placeholders and fall
back to handling the drop normally.

(WebCore::DragController::insertDroppedImagePlaceholdersAtCaret):

Invoked when handling the drop, before any image data has been loaded; this function takes a list of sizes
representing the preferred presentation sizes of each item provider that will be loaded as an image, and uses
ReplaceSelectionCommand to insert a list of (initially blank) placeholder images at the drop caret, sized
accordingly to each item provider's preferredPresentationSize.

To make this compatible with Mail compose (and all other known internal clients that use the _editable SPI), we
additionally enforce a max-width of 100% on each image and preserve the aspect ratio of the image by adjusting
the height if needed.

(WebCore::DragController::finalizeDroppedImagePlaceholder):
* page/DragController.h:

Have DragController keep track of the list of dropped image placeholders (in DOM order), as well as the dropped
image placeholder range. This information is used once item provider data arrives and the drag operation is
being performed, to update the source of each dropped image placeholder.

(WebCore::DragController::droppedImagePlaceholders const):
(WebCore::DragController::droppedImagePlaceholderRange const):
* platform/network/mac/UTIUtilities.h:

Mark an existing helper function as WEBCORE_EXPORT.

Source/WebKit:

Our current logic for handling dropped content in editable elements on iOS works like this in the ideal case:

(1)     UIKit asks us for a targeted preview for each UIDragItem. We don't know (and can't determine this
        synchronously without blocking on the web process) so we simply retarget the preview to animate to the
        last known caret location.

(2)     Soonafter, UIKit hands us a drop preview update block, which may be used to retarget the drop preview
        once, as long as the drop animation is less than 90% complete. We stash these update blocks for now.

(3)     -dropInteraction:performDrop: is then called, and we start loading item provider data right away.

(4)     When the data has finished loading, we perform the drop in the web process. After any inserted images
        have finished loading, we take snapshots (of the dropped content as well as surrounding web content
        minus the dropped content), and deliver these images to the UI process via TextIndicatorData.

(5)     Upon receiving the TextIndicatorData sent in (4), we use the image data to create updated targeted drag
        previews, and use these to invoke the preview update blocks we stored earlier in (2). We also obscure
        the entire web view with a snapshot of the view minus any dropped content, such that the updated drop
        previews may animate into place without also showing the final content.

(6)     When the drop animation ends, we remove the unselected content snapshot view added in (5) simultaneously
        as the targeted previews disappear, revealing the actual dropped content on the page. The drop is now
        complete.

However, note that the drag update block we invoke in (5) doesn't work if the drop animation is already more
than 90% complete. Since the lifecycle of the drop animation is distinct from that of item provider loading, if
the delay between (3) and (4) exceeds 90% of the total drop animation time, we'll fail to update the targeted
previews, such that the user only sees the initial drag preview fly on top of the caret and disappear. While we
typically win this race for data dragged from other WebKit apps, we almost always lose when dragging from Photos
and end up with a janky drop animation. This is especially true for any images that aren't locally available,
and need to be fetched from iCloud. An additional problem is that in step (5), we use the same final snapshot to
update the drop preview of every item, since we don't have a snapshot for the fragment corresponding to each
individual dropped item.

To address these issues for Mail in the case where the user drops images with known sizes (i.e. -[NSItemProvider
preferredPresentationSize] is specified), we introduce an alternate codepath for handling dropped images that
performs the drop immediately upon receiving -dropInteraction:performDrop: in the UI process. Since the data has
yet to arrive, we instead handle the drop by inserting placeholder image elements at the drag caret position,
which initially have no source but are sized to fit their expected final image sizes. After doing so, we
snapshot the page (minus the dropped content range, as usual) and deliver this snapshot to the UI process, along
with the rects (in root view coordinates) of each placeholder image that was inserted. In the UI process, we
then take this snapshot and obscure the content view with it, and also use each of the placeholder rects to
provide an updated target for each drag preview, such that the drop previews now animate to their final
locations on the page.

When the data eventually arrives, we handle the drop by detecting the placeholder elements we inserted earlier,
and using the dropped data to update the source attribute and attachment backing for each of these placeholder
elements instead of attempting to insert new content.

Note that this codepath is currently only enabled for SPI clients that set -[WKWebView _editable] to YES, since
it involves us performing the editing action for the drop (thus changing the DOM) prior to the preventable drop
event, and prior to us having any data at all. However, the drop event can't come before the editing action,
since we need to have already loaded data from the item providers to expose it via the dataTransfer of the drop
event. This contradiction means that this image placeholder hack is only for _editable SPI clients that, at the
very least, will not require preventing default behavior when dropping only images with predetermined sizes.

Covered by 2 new API tests. See comments below for more detail.

* UIProcess/WebPageProxy.h:
* UIProcess/ios/DragDropInteractionState.h:
* UIProcess/ios/DragDropInteractionState.mm:
(WebKit::DragDropInteractionState::setDefaultDropPreview):

Add a way to keep track of default drop previews that we observed during each call to
-dropInteraction:previewForDroppingItem:withDefault:. In the image placeholder drop scenario, we use these
default drop previews later on to create retargeted drop previews after the placeholders have been inserted.

(WebKit::DragDropInteractionState::defaultDropPreview const):
(WebKit::DragDropInteractionState::deliverDelayedDropPreview):

Add an alternate version of deliverDelayedDropPreview that is used when inserting image placeholders. Rather
than use text indicator data of the final dropped content on the page, use the root-view-coordinate rects of
each of the placeholder elements to reposition the default drop previews.

There's additional logic here to handle the case where the final image is taller than the height of the
unobscured content rect, in which case we clip the drop preview using UIDragPreviewParameter's visiblePath to
prevent the drop preview from being shown outside of the bounds of the web view.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _deliverDelayedDropPreviewIfPossible:]):
(sizesOfPlaceholderElementsToInsertWhenDroppingItems):

Collects the list of expected image sizes for the dropped item providers, or an empty list in the case where
any of the item providers may not be represented as inline images or do not have predetermined sizes.

(-[WKContentView _handleDropByInsertingImagePlaceholders:session:]):

If possible, handles the drop by inserting image placeholders instead of waiting for the data to finish loading
before dropping. Returns whether or not we decided to proceed with the image placeholder drop.

(-[WKContentView dropInteraction:performDrop:]):
(-[WKContentView dropInteraction:item:willAnimateDropWithAnimator:]):

Fixes a bug where the unselected content snapshot view could linger around on the web view forever after a drop
where the data doesn't load in time for the drop to finish by keeping track of whether there is an actively
animating drag item, and only applying the unselected content snapshot if so.

(-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]):

Stash the default drop preview away here.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::insertDroppedImagePlaceholders):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::insertDroppedImagePlaceholders):

See WebCore ChangeLog for more information.

(WebKit::WebPage::didFinishLoadingImageForElement):

If the image that finished loading is a dropped image placeholder, allow DragController to "finalize" it by
stripping away some styles that were temporarily added.

Tools:

Add a couple of new API tests to exercise the new image placeholder drop codepath, in addition to testing
infrastructure to simulate the timing of drop animation delegate calls.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(-[NSArray _attachmentWithName:]):
(-[TestWKWebView allBoundingClientRects:]):

Add some new API testing helper methods.

(TestWebKitAPI::targetedImageDragPreview):
(TestWebKitAPI::TEST):

Add two new tests, to:
(1) verify that images are dropped as attachment-backed placeholder image elements when the web view is editable
    and enables attachment elements, and
(2) verify that when dropping an image taller than the web view, the bottom portion of the drop preview is
    clipped using the targeted preview parameter's visiblePath.

* TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
(-[NSItemProvider registerDataRepresentationForTypeIdentifier:withData:]): Deleted.
* TestWebKitAPI/cocoa/DragAndDropSimulator.h:
* TestWebKitAPI/cocoa/NSItemProviderAdditions.h: Added.
* TestWebKitAPI/cocoa/NSItemProviderAdditions.mm: Added.

Move some common helpers for registering data on a NSItemProvider to a separate file, so that it can be used in
both WKAttachmentTests and DragAndDropTests.

(-[NSItemProvider registerDataRepresentationForTypeIdentifier:withData:]):
(-[NSItemProvider registerDataRepresentationForTypeIdentifier:withData:loadingDelay:]):
* TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm:
(-[DragAndDropSimulator initWithWebView:]):
(-[DragAndDropSimulator _concludeDropAndPerformOperationIfNecessary]):
(-[DragAndDropSimulator clearExternalDragInformation]):
(-[DragAndDropSimulator setExternalItemProviders:defaultDropPreviews:]):

Add a new method to allow tests to specify both a list of externally dragged item providers, as well as default
targeted previews for each of the corresponding items. These default previews are used when invoking the drop
interaction delegate's preview generation methods.

(-[DragAndDropSimulator addAnimations:]):

Not implemented yet; for now, this simply asserts.

(-[DragAndDropSimulator addCompletion:]):

Queues a completion handler, which is invoked when the drop animation for each item completes. Depending on the
value of DragAndDropSimulator's -dropAnimationTiming, this may occur either before or after handling the drop.
By default, these will be invoked after the drop completes, which represents the common case where data can be
loaded quickly relative to the drop animation.

(-[DragAndDropSimulator _invokeDropAnimationCompletionBlocksAndConcludeDrop]):
(-[DragAndDropSimulator _webView:dataInteractionOperationWasHandled:forSession:itemProviders:]):

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

4 months agoImprove CSP inheritance semantics
dbates@webkit.org [Mon, 23 Sep 2019 21:56:43 +0000 (21:56 +0000)]
Improve CSP inheritance semantics
https://bugs.webkit.org/show_bug.cgi?id=201884
<rdar://problem/50172407>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

Update expected results now that we pass more sub-tests.

* web-platform-tests/content-security-policy/inheritance/iframe-all-local-schemes-inherit-self.sub-expected.txt:
* web-platform-tests/content-security-policy/inheritance/window-expected.txt:

Source/WebCore:

Update the CSP inheritance semantics to more closely match the logic in section Initialize a Document's CSP list
of the CSP3 spec., <https://w3c.github.io/webappsec-csp/#initialize-document-csp>.

Towards this, move more of the inheritance logic out of Document::initContentSecurityPolicy() and into
DocumentWriter::begin() where details about the document being replaced live. This lets us remove the
need to track the previous content security policy to pass it to Document::initContentSecurityPolicy().
Moreover, DocumentWriter::begin() knows the owner document that will be replaced with the result of
executing a JavaScript URL. This is needed in order to fix up inheritance of CSP for such documents.

Tests: http/tests/security/contentSecurityPolicy/iframe-allowed-when-loaded-via-javascript-url.html
       http/tests/security/contentSecurityPolicy/iframe-blocked-when-loaded-via-javascript-url.html
       http/tests/security/contentSecurityPolicy/iframe-blocked-when-loaded-via-javascript-url2.html

* dom/Document.cpp:
(WebCore::Document::initSecurityContext): If we are inheriting the security origin from the owner
document then inherit its CSP policy. We copy over both the CSP state from the owner as well as
update 'self' to match the owner's origin so that CSP source expressions that include 'self' work
correctly even from about:blank documents.
(WebCore::Document::initContentSecurityPolicy): Move most of the logic from here into DocumentWriter::begin()
to take advantage of the fact that DocumentWriter::begin() knows about the outgoing document (if there
is one) as well as whether the outgoing document is being replaced with a new document that is the result
of evaluating a JavaScript URL. We need do know both these things in order to inherit the correct CSP
policy. This function only exists to copy some upgrade-insecure-requests state and to fix up plugin documents
as we currently do.
(WebCore::Document::shouldInheritContentSecurityPolicy const): Deleted.
* dom/Document.h:
* dom/SecurityContext.cpp:
(WebCore::SecurityContext::setContentSecurityPolicy): Modified to take its param by rvalue-reference
to make it less error prone to use.
* dom/SecurityContext.h: Expose setContentSecurityPolicy() so that we can invoke it from DocumentWriter::begin().
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::begin): For documents being replaced with the result of a JavaScript URL (i.e. ownerDocument
is non-null) inherit the CSP from the owner document. Similarly, if we have an existing document in the frame
and the protocol of the new document's URL is data: or blob: then inherit the CSP from the existing page. The latter
is what we currently do just moved from Document::initContentSecurityPolicy() and re-written in terms of the
existingDocument instead of previousContentSecurityPolicy. Also call setInsecureNavigationRequestsToUpgrade()
both when we have a non-null ownerDocument as well as when we have a non-null existingDocument. The former fixes
the block-all-mixed-content feature for documents loaded via JavaScript URLs and the latter is what we do now.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument): Remove parameter previousContentSecurityPolicy as the logic that
made use of it moved to DocumentWriter::begin().
* loader/FrameLoader.h:
* page/csp/ContentSecurityPolicy.h:

LayoutTests:

Add some more tests and update expected results of existing tests now that we pass more sub-tests.

* http/tests/security/contentSecurityPolicy/iframe-allowed-when-loaded-via-javascript-url-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/iframe-allowed-when-loaded-via-javascript-url.html: Added.
* http/tests/security/contentSecurityPolicy/iframe-blocked-when-loaded-via-javascript-url-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/iframe-blocked-when-loaded-via-javascript-url.html: Added.
* http/tests/security/contentSecurityPolicy/iframe-blocked-when-loaded-via-javascript-url2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/iframe-blocked-when-loaded-via-javascript-url2.html: Added.
* http/tests/security/contentSecurityPolicy/user-style-sheet-font-crasher-expected.txt: I don't understand
why there is another duplicte console log message emitted, but there are already two such messages, which is
already one too many. The duplicate messages are more cosmetic than functional though there may be implications
with respect to CSP reporting. Filed <https://bugs.webkit.org/show_bug.cgi?id=202004> to track this issue.
* platform/mac-wk1/http/tests/security/contentSecurityPolicy/user-style-sheet-font-crasher-expected.txt:
* platform/win/http/tests/security/contentSecurityPolicy/user-style-sheet-font-crasher-expected.txt:

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

4 months agoREGRESSION(250143) Disk cache should be enabled for Safari
achristensen@apple.com [Mon, 23 Sep 2019 21:08:31 +0000 (21:08 +0000)]
REGRESSION(250143) Disk cache should be enabled for Safari
https://bugs.webkit.org/show_bug.cgi?id=202117

Reviewed by Brady Eidson.

r250143 made it so in Safari, when setCacheModel is called for the first time in NetworkProcess::initializeNetworkProcess,
it didn't have a path to check available disk space.  This resulted in disabling the disk cache in Safari, which caused a
huge performance regression.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::setCacheModel):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::setCacheModel):
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::setCacheModel):

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

4 months agoresults.webkit.org: Collapse results with the same version name (Follow-up fix)
jbedard@apple.com [Mon, 23 Sep 2019 20:50:59 +0000 (20:50 +0000)]
results.webkit.org: Collapse results with the same version name (Follow-up fix)
https://bugs.webkit.org/show_bug.cgi?id=201779

Rubber-stamped by Aakash Jain.

* resultsdbpy/resultsdbpy/view/static/js/configuration.js:
(Configuration.prototype.compare): Correctly compare constructed version names.

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

4 months agoSkip stress/regexp-unicode-surrogate-pair-increment-should-involve-length-check.js...
ticaiolima@gmail.com [Mon, 23 Sep 2019 20:42:14 +0000 (20:42 +0000)]
Skip stress/regexp-unicode-surrogate-pair-increment-should-involve-length-check.js into ARMv7 and MIPS
https://bugs.webkit.org/show_bug.cgi?id=202113

Unreviewed test gardening, skipped test in ARMv7 and MIPS.

It is going to be fixed in
https://bugs.webkit.org/show_bug.cgi?id=202041

* stress/regexp-unicode-surrogate-pair-increment-should-involve-length-check.js:

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

4 months ago[WebAuthn] LocalAuthenticator tests are failing on internal bots
jiewen_tan@apple.com [Mon, 23 Sep 2019 20:18:05 +0000 (20:18 +0000)]
[WebAuthn] LocalAuthenticator tests are failing on internal bots
https://bugs.webkit.org/show_bug.cgi?id=201844
<rdar://problem/54278693>

Reviewed by Brent Fulgham.

Source/WebKit:

This patch adds a way for mock tests to select a credential in getAssertion
ceremonies such that a test can ensure it always uses the credential it manages.
Credentials managed by other test could be deleted at anytime.

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::getAssertion):
* UIProcess/WebAuthentication/Cocoa/LocalConnection.h:
* UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
(WebKit::LocalConnection::selectCredential const):
* UIProcess/WebAuthentication/Mock/MockLocalConnection.h:
* UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
(WebKit::MockLocalConnection::selectCredential const):
* UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:

Tools:

LocalAuthenticator tests utilize Keychain for mock testing. Unlike iOS simulator tests which
each test runner is running in different simulator containers, all test runners are running
in the same macOS container in macOS. Therefore, Keychain is shared among all test runners
in macOS while it is not in iOS simulators. And therefore, race conditions would happen in
macOS which make the current tests flaky given they don't consider race conditions.

This patch then makes each test generate a random credential, and thus no other tests would
be able to access it, and therefore eliminate any race condition. To support this, a few new
functionalities are introduced to the mock test infrastructure as well:
1) TestRunner.cleanUpKeychain accepts a new parameter to more precisely identify an item.
2) WebAuthenticationMockConfiguration.Local has a new member to uniquely select a credential
for getAssertion ceremony when multiple presents.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setWebAuthenticationMockConfiguration):
(WTR::TestRunner::cleanUpKeychain):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::cleanUpKeychain):
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::cleanUpKeychain):

LayoutTests:

This patch makes each test to generate their own credentials to avoid race conditions in Keychain
accesses when multiple test runners present.

* http/wpt/credential-management/credentialscontainer-store-basics.https.html:
* http/wpt/webauthn/idl.https.html:
These two tests are changed to use hid authenticator instead of local to avoid any future Keychain issues.
* http/wpt/webauthn/public-key-credential-create-failure-local-silent.https.html:
* http/wpt/webauthn/public-key-credential-create-failure-local.https.html:
* http/wpt/webauthn/public-key-credential-create-success-local.https.html:
* http/wpt/webauthn/public-key-credential-get-failure-local-silent.https.html:
* http/wpt/webauthn/public-key-credential-get-failure-local.https.html:
* http/wpt/webauthn/public-key-credential-get-success-local.https.html:
* http/wpt/webauthn/resources/util.js:
* platform/mac-wk2/TestExpectations:

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

4 months ago[iOS] REGRESSION(r250151): Occasional assertion failures in ShareableBitmap::~Shareab...
david_quesada@apple.com [Mon, 23 Sep 2019 20:15:19 +0000 (20:15 +0000)]
[iOS] REGRESSION(r250151): Occasional assertion failures in ShareableBitmap::~ShareableBitmap()
https://bugs.webkit.org/show_bug.cgi?id=202112
rdar://problem/55624598

Reviewed by Chris Dumez.

* Shared/cg/ShareableBitmapCG.cpp:
(WebKit::ShareableBitmap::releaseDataProviderData):
It is possible and valid for a UIImage created from a ShareableBitmap's CGImage representation
to be deallocated on a background thread. When this happens, releaseDataProviderData() should
ensure it's running on the main thread before deref'ing the ShareableBitmap. Otherwise the
bitmap can be deallocated on the background thread, violating an assertion added in r250151.

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

4 months agoUnreviewed build fix after r250173: tvOS build broken due to unused function.
krollin@apple.com [Mon, 23 Sep 2019 19:15:37 +0000 (19:15 +0000)]
Unreviewed build fix after r250173: tvOS build broken due to unused function.

* platform/network/cocoa/CookieCocoa.mm:
(WebCore::Cookie::operator NSHTTPCookie * _Nullable  const):

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

4 months agoWeb Inspector: Improve the Uncaught Exception View file a bug link
joepeck@webkit.org [Mon, 23 Sep 2019 18:06:18 +0000 (18:06 +0000)]
Web Inspector: Improve the Uncaught Exception View file a bug link
https://bugs.webkit.org/show_bug.cgi?id=201717

Reviewed by Devin Rousso.

Source/WebInspectorUI:

* UserInterface/Debug/UncaughtExceptionReporter.js:
Allow the link to be clicked. Use openInNewTab on click to also
bring the new tab to the foreground. Also update the content.

Source/WebKit:

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::bringInspectedPageToFront):
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebInspectorProxy.messages.in:
Provide a way to bring the inspected page to the foreground.

* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::openInNewTab):
Use it when opening a new tab beside the inspected page.

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

4 months agoUnreviewed build fix after r250169 and r250236.
bfulgham@apple.com [Mon, 23 Sep 2019 18:00:22 +0000 (18:00 +0000)]
Unreviewed build fix after r250169 and r250236.

* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::createCurlRequest):
* UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.cpp:
(WKWebsiteDataStoreEnableDefaultNetworkProxySettings):
(WKWebsiteDataStoreEnableCustomNetworkProxySettings):
(WKWebsiteDataStoreDisableNetworkProxySettings):

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

4 months agoUnreviewed WinCairo/FTW Build fix after r250192.
bfulgham@apple.com [Mon, 23 Sep 2019 17:53:39 +0000 (17:53 +0000)]
Unreviewed WinCairo/FTW Build fix after r250192.

* platform/network/curl/CurlDownload.cpp:
(WebCore::CurlDownload::createCurlRequest):

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

4 months ago[LFC][IFC] Merge inline box compute functions
zalan@apple.com [Mon, 23 Sep 2019 17:21:22 +0000 (17:21 +0000)]
[LFC][IFC] Merge inline box compute functions
https://bugs.webkit.org/show_bug.cgi?id=202092
<rdar://problem/55607748>

Reviewed by Antti Koivisto.

Make InlineFormattingContext::layoutInFlowContent() logic simpler.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
(WebCore::Layout::InlineFormattingContext::computeHorizontalAndVerticalGeometry):
(WebCore::Layout::InlineFormattingContext::initializeMarginBorderAndPaddingForGenericInlineBox): Deleted.
(WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:

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

4 months agoclang-tidy: Fix unnecessary copy/ref churn of for loop variables in WebKit
ddkilzer@apple.com [Mon, 23 Sep 2019 17:04:54 +0000 (17:04 +0000)]
clang-tidy: Fix unnecessary copy/ref churn of for loop variables in WebKit
<https://webkit.org/b/202096>

Reviewed by Darin Adler.

Fix unwanted copying/ref churn of loop variables by making them
const references.

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::domainsToString):
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant presentationRectForElementUsingClosestIndicatedRect]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _singleTapDidReset:]):
* UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
(-[WKDataListSuggestionsControl textSuggestions]):

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

4 months agoREGRESSION (r249855): Remove debug logging from WebCore::RenderImage::paintIntoRect()
ddkilzer@apple.com [Mon, 23 Sep 2019 16:48:25 +0000 (16:48 +0000)]
REGRESSION (r249855): Remove debug logging from WebCore::RenderImage::paintIntoRect()
<https://webkit.org/b/202103>

Reviewed by Zalan Bujtas.

* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect): Remove debug logging
statements.

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

4 months agoWebPage::sessionID() does not need to get the sessionID from there WebCore Page
cdumez@apple.com [Mon, 23 Sep 2019 16:31:15 +0000 (16:31 +0000)]
WebPage::sessionID() does not need to get the sessionID from there WebCore Page
https://bugs.webkit.org/show_bug.cgi?id=202094

Reviewed by Youenn Fablet.

WebPage::sessionID() does not need to get the sessionID from there WebCore Page, it can
simply get the sessionID from the WebProcess singleton, now that we have a single session
per WebProcess. This will avoid potential crashes trying to dereference m_page to get the
sessionID, since m_page can be null.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::sessionID const):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::sessionID const): Deleted.

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

4 months ago[LFC][IFC] Pass in the Used*Values to inline layout functions.
zalan@apple.com [Mon, 23 Sep 2019 16:14:21 +0000 (16:14 +0000)]
[LFC][IFC] Pass in the Used*Values to inline layout functions.
https://bugs.webkit.org/show_bug.cgi?id=202091
<rdar://problem/55601987>

Reviewed by Antti Koivisto.

Only the top level layout functions should generate constraint values.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
(WebCore::Layout::InlineFormattingContext::computeHorizontalMargin):
(WebCore::Layout::InlineFormattingContext::computeWidthAndMargin):
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::InlineLayout::widthConstraint const):
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::InlineLayout::InlineLayout):
(WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
(WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):

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

4 months agoRefcount simple line layout
antti@apple.com [Mon, 23 Sep 2019 15:54:58 +0000 (15:54 +0000)]
Refcount simple line layout
https://bugs.webkit.org/show_bug.cgi?id=202104

Reviewed by Zalan Bujtas.

Make SimpleLineLayout::Layout refcounted for safety and ease of use.

* dom/Position.cpp:
(WebCore::Position::upstream const):
(WebCore::Position::downstream const):
* editing/TextIterator.cpp:
(WebCore::TextIterator::handleTextNode):
(WebCore::TextIterator::handleTextBox):
(WebCore::TextIterator::handleTextNodeFirstLetter):
* editing/TextIterator.h:
* rendering/RenderBlockFlow.h:
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):
(WebCore::write):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::create):
(WebCore::SimpleLineLayout::Layout::create):
* rendering/SimpleLineLayout.h:
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::outputLineLayoutForFlow):
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::Run::rect const):
(WebCore::SimpleLineLayout::RunResolver::Iterator::Iterator):

Iterator now refs the layout. Since the resolver is owned by the layout, it is guaranteed to stay alive too.

(WebCore::SimpleLineLayout::RunResolver::Iterator::advanceLines):
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::Iterator::layout const):
(WebCore::SimpleLineLayout::RunResolver::Run::computeBaselinePosition const):
(WebCore::SimpleLineLayout::RunResolver::Iterator::simpleRun const):
(WebCore::SimpleLineLayout::RunResolver::Iterator::inQuirksMode const): Deleted.
(WebCore::SimpleLineLayout::runResolver): Deleted.

Always use the cached resolver owned by SimpleLineLayout::Layout.

* rendering/line/LineLayoutInterfaceTextBoxes.cpp:
(WebCore::LineLayoutInterface::firstTextBoxInVisualOrderFor):
(WebCore::LineLayoutInterface::firstTextBoxInTextOrderFor):
(WebCore::LineLayoutInterface::textBoxRangeFor):
(WebCore::LineLayoutInterface::Provider::firstTextBoxInVisualOrderFor): Deleted.
(WebCore::LineLayoutInterface::Provider::firstTextBoxInTextOrderFor): Deleted.
(WebCore::LineLayoutInterface::Provider::textBoxRangeFor): Deleted.

There is no need for a separate Provider class anymore as the iterator keeps SimpleLineLayout::Layout
and Resolver instances alive itself.

* rendering/line/LineLayoutInterfaceTextBoxes.h:
(WebCore::LineLayoutInterface::hasTextBoxes):
(WebCore::LineLayoutInterface::Provider::firstTextBoxFor): Deleted.

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

4 months agoSimplify UserMediaPermissionRequestManager management of UserMediaRequest
youenn@apple.com [Mon, 23 Sep 2019 14:16:44 +0000 (14:16 +0000)]
Simplify UserMediaPermissionRequestManager management of UserMediaRequest
https://bugs.webkit.org/show_bug.cgi?id=201688

Reviewed by Eric Carlson.

Source/WebCore:

Covered by existing tests and modified test.

* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::UserMediaRequest):
* Modules/mediastream/UserMediaRequest.h:
(WebCore::UserMediaRequest::identifier const):
Add an identifier generated for each request.

Source/WebKit:

Instead of having two maps to go from ID to request and request to ID,
Make request own its ID and keep a single ID to request map.
Rename it to m_ongoingUserMediaRequests.

Rename requests that are not processed because the document cannot start media as m_pendingUserMediaRequests.
In case the request is cancelled following the stopping of active dom objects, we just remove it from m_pendingUserMediaRequests
instead of denying the request. This matches Chrome and Firefox behavior.

* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::startUserMediaRequest):
(WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
(WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest):
(WebKit::UserMediaPermissionRequestManager::mediaCanStart):
(WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted):
(WebKit::UserMediaPermissionRequestManager::userMediaAccessWasDenied):
(WebKit::UserMediaPermissionRequestManager::addDeviceChangeObserver):
(WebKit::generateRequestID): Deleted.
(WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps): Deleted.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:

LayoutTests:

* http/tests/media/media-stream/disconnected-frame-permission-denied-expected.txt:
* http/tests/media/media-stream/disconnected-frame-permission-denied.html:

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

4 months agotestmasm: integer operands loaded as unsigned values
zandobersek@gmail.com [Mon, 23 Sep 2019 14:08:07 +0000 (14:08 +0000)]
testmasm: integer operands loaded as unsigned values
https://bugs.webkit.org/show_bug.cgi?id=202099

Reviewed by Mark Lam.

Suppress GCC warnings about comparing signed and unsigned values in
test cases introduced in r247913 by using signed integer types for
loading 32-bit and 64-bit integer operand values.

* assembler/testmasm.cpp:
(JSC::testBranchTestBit32RegReg):
(JSC::testBranchTestBit32RegImm):
(JSC::testBranchTestBit32AddrImm):
(JSC::testBranchTestBit64RegReg):
(JSC::testBranchTestBit64RegImm):
(JSC::testBranchTestBit64AddrImm):

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

4 months ago[GTK][WPE] Don't use prgname in dbus-proxy socket path
pgriffis@igalia.com [Mon, 23 Sep 2019 13:59:49 +0000 (13:59 +0000)]
[GTK][WPE] Don't use prgname in dbus-proxy socket path
https://bugs.webkit.org/show_bug.cgi?id=201979

The path length for the socket is limited to 108 bytes so it is easy for a long
prgname to cause it to get truncated and fail. Since we only allow the socket
path into the sandbox the unique directory isn't necessary.

Reviewed by Michael Catanzaro.

* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::XDGDBusProxyLauncher::setAddress):

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

4 months ago[GStreamer] isAVC1CodecSupported is crashing several media source tests due to avc1...
cturner@igalia.com [Mon, 23 Sep 2019 10:31:24 +0000 (10:31 +0000)]
[GStreamer] isAVC1CodecSupported is crashing several media source tests due to avc1.4d4001 codec type
https://bugs.webkit.org/show_bug.cgi?id=201870

Reviewed by Xabier Rodriguez-Calvar.

The GStreamer codec-utils package expects all level_idc's to be
multiples of 10 from the spec idc, i.e., 1.1 -> 11, 3.1 -> 31, 1
-> 10, etc.

In the WPT tests, there is some confusion of this *10 multiplier,
and the level_idc is given in several places as simply "1". This
causes the get_level codec helper to return NULL, which the
registry scanner was not handling properly, and crashing on.

Fix this by special casing "web level idc's" that violate the *10
rule in isAVC1CodecSupported.

There is prior art along these lines in Gecko:
https://searchfox.org/mozilla-central/source/dom/media/VideoUtils.cpp#453
I assume Chrome/IE/etc must do something similar. The fix does not
belong in GStreamer since these are actually invalid inputs to the
get_level function.

Tested by imported/w3c/web-platform-tests/media-source

* platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::isAVC1CodecSupported const):
Special case levels 1..5, even though these *should* be
represented as 10 through 50 respectively, they are not in
web-land. The two-byte local storage trick was contributed to me
by Adrian Perez de Castro.

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

4 months ago[SOUP] Stop setting G_TLS_GNUTLS_PRIORITY
mcatanzaro@igalia.com [Mon, 23 Sep 2019 09:05:16 +0000 (09:05 +0000)]
[SOUP] Stop setting G_TLS_GNUTLS_PRIORITY
https://bugs.webkit.org/show_bug.cgi?id=172154

Reviewed by Carlos Garcia Campos.

Nowadays, I maintain glib-networking. WebKit doesn't need to override its defaults to be
secure anymore. By overriding glib-networking's default priority, WebKit is force-reenabling
TLS 1.0 and TLS 1.1 even when glib-networking has disabled them.

* NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
(main):
* WebProcess/EntryPoint/unix/WebProcessMain.cpp:
(main):

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

4 months agoSync operator dictionary
commit-queue@webkit.org [Mon, 23 Sep 2019 08:49:11 +0000 (08:49 +0000)]
Sync operator dictionary
https://bugs.webkit.org/show_bug.cgi?id=201974

Patch by Rob Buis <rbuis@igalia.com> on 2019-09-23
Reviewed by Frédéric Wang.

LayoutTests/imported/w3c:

Update improved test results.

* web-platform-tests/mathml/presentation-markup/operators/operator-dictionary-001-expected.txt:

Source/WebCore:

Sync with operator dictionary list from
https://mathml-refresh.github.io/mathml-core/#operator-dictionary

Test: imported/w3c/web-platform-tests/mathml/presentation-markup/operators/operator-dictionary-001.html

* mathml/MathMLOperatorDictionary.cpp:

LayoutTests:

* platform/ios-wk2/imported/w3c/web-platform-tests/mathml/relations/css-styling/ignored-properties-001-expected.txt: Added.
* platform/win/TestExpectations:

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

4 months agoclang-tidy: Fix unnecessary copy/ref churn of for loop variables in WebCore
ddkilzer@apple.com [Mon, 23 Sep 2019 03:46:57 +0000 (03:46 +0000)]
clang-tidy: Fix unnecessary copy/ref churn of for loop variables in WebCore
<https://webkit.org/b/202090>

Reviewed by Daniel Bates.

Fix unwanted copying/ref churn of loop variables by making them
const references.

* Modules/encryptedmedia/InitDataRegistry.cpp:
(WebCore::InitDataRegistry::extractKeyIDsCenc):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::getMisspellingRange const):
(WebCore::AccessibilityObject::performTextOperation):
* html/HTMLSlotElement.cpp:
(WebCore::flattenAssignedNodes):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::checkAndStoreStyleSheet):
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::updateSupportedTypeIdentifiers):
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard allDroppedFileURLs]):
* svg/SVGStringList.h:
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnection::GetTransceivers const):
Also call transceivers.reserve() to optimize allocations.

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

4 months ago[JSC] Int52Rep(DoubleRepAnyIntUse) should not call operation function
ysuzuki@apple.com [Sun, 22 Sep 2019 09:57:48 +0000 (09:57 +0000)]
[JSC] Int52Rep(DoubleRepAnyIntUse) should not call operation function
https://bugs.webkit.org/show_bug.cgi?id=202072

Reviewed by Mark Lam.

JSTests:

* stress/int52rep-with-double-checks-int52-range.js: Added.
(shouldBe):
(test):

Source/JavaScriptCore:

Inline doubleToStrictInt52 in FTL since it is very simple function.
This change improves JetStream2/stanford-crypto-sha256 by ~5%.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::doubleToStrictInt52):
* ftl/FTLOutput.cpp:
(JSC::FTL::Output::doubleToInt64):
* ftl/FTLOutput.h:

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

4 months agoUnreviewed, follow-up change after r250198
ysuzuki@apple.com [Sun, 22 Sep 2019 09:08:28 +0000 (09:08 +0000)]
Unreviewed, follow-up change after r250198
https://bugs.webkit.org/show_bug.cgi?id=201633

* b3/testb3_5.cpp:
(testCheckAddRemoveCheckWithSExt16):

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

4 months ago[JSC] Remove CheckAdd in JetStream2/async-fs's Math.random function
ysuzuki@apple.com [Sun, 22 Sep 2019 07:19:43 +0000 (07:19 +0000)]
[JSC] Remove CheckAdd in JetStream2/async-fs's Math.random function
https://bugs.webkit.org/show_bug.cgi?id=201633

Reviewed by Mark Lam.

Int52Rep is used in DFG and FTL to calculate Int52 things faster. This is typically used when user code see uint32_t type.
In JS, we handles Int32 well, but if the value exceeds Int32 range (like, using 0xffffffff), we use Int52 instead not to fallback to Double.

The problem is that we do not have optimizations for Int52's overflow checks. This emits many ArithAdd(Int52Rep x 2, CheckOverflow). Each
of them emits OSR exit, which prevents dead-store-elimination in B3, and makes ValueToInt32(Int52) alive if it is referenced from some variable which
can be seen if OSR exit occurs.

In this patch, we perform strength-reduction for CheckAdd, converting to Add. We already have such a thing. But the existing one does not handle instructions
well emitted when Int52 is used.

When Int52 is used, we typically have the sequence like,

    Int64 @78 = SExt32(@73, DFG:@67<Int52>) // Widen Int32 to Int64
    Int64 @81 = Shl(@78, $12(@80), DFG:@162<Int52>) // Convert Int32 to Int52

While we have Shl handling for integer-range optimization in B3ReduceStrength, we lack handling of SExt32 while it is very easy.
This patch adds SExt8, SExt16, SExt32, and ZExt32 handling to B3ReduceStrength's integer range analysis.
This converts many CheckAdd in JetStream2/async-fs's hot function to simple Add, and removes a bunch of unnecessary instructions which exist because of this OSR exit.
We can see ~5% improvement in JetStream2/async-fs.

* b3/B3ReduceStrength.cpp:
* b3/testb3.h:
(int16Operands):
(int8Operands):
* b3/testb3_1.cpp:
(run):
* b3/testb3_5.cpp:
(testCheckAddRemoveCheckWithSExt8):
(testCheckAddRemoveCheckWithSExt16):
(testCheckAddRemoveCheckWithSExt32):
(testCheckAddRemoveCheckWithZExt32):

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

4 months agoFix an assertion failure introduced in r250186.
mitz@apple.com [Sun, 22 Sep 2019 06:12:57 +0000 (06:12 +0000)]
Fix an assertion failure introduced in r250186.

* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes): Corrected the
  assertion.

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

4 months agoReduce use of SessionID::defaultSessionID() in WebKit
cdumez@apple.com [Sun, 22 Sep 2019 06:04:48 +0000 (06:04 +0000)]
Reduce use of SessionID::defaultSessionID() in WebKit
https://bugs.webkit.org/show_bug.cgi?id=202080

Reviewed by Alex Christensen.

Source/WebCore:

Reduce use of SessionID::defaultSessionID() in WebKit. Falling back to the default session
when you don't know which session to use is never a good idea and a potential privacy issue.

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::connect):
* dom/Document.cpp:
(WebCore::Document::logger):
* dom/Document.h:
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAdClickAttribution const):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::continueAfterContentPolicy):
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoaderClient.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
(WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::revalidateResource):
(WebCore::CachedResourceLoader::loadResource):
* loader/cache/CachedResourceLoader.h:
(WebCore::CachedResourceLoader::clearDocumentLoader):
* page/Frame.cpp:
* page/Frame.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::isAlwaysOnLoggingAllowed const):

Source/WebKit:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::convertMainResourceLoadToDownload):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::convertMainResourceLoadToDownload):
* WebProcess/WebPage/WebFrame.h:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::convertMainResourceLoadToDownload):

Source/WebKitLegacy/win:

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::convertMainResourceLoadToDownload):
* WebCoreSupport/WebFrameLoaderClient.h:

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

4 months agoServiceWorkerContextData does not need a sessionID
cdumez@apple.com [Sun, 22 Sep 2019 05:17:38 +0000 (05:17 +0000)]
ServiceWorkerContextData does not need a sessionID
https://bugs.webkit.org/show_bug.cgi?id=202087

Reviewed by Alex Christensen.

* workers/service/ServiceWorkerContextData.cpp:
(WebCore::ServiceWorkerContextData::isolatedCopy const):
* workers/service/ServiceWorkerContextData.h:
(WebCore::ServiceWorkerContextData::encode const):
(WebCore::ServiceWorkerContextData::decode):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::RegistrationDatabase):
(WebCore::RegistrationDatabase::importRecords):
* workers/service/server/RegistrationDatabase.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::updateWorker):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::contextData const):

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

4 months agoDrop unnecessary NetworkProcess::m_sessionByConnection
cdumez@apple.com [Sun, 22 Sep 2019 05:17:00 +0000 (05:17 +0000)]
Drop unnecessary NetworkProcess::m_sessionByConnection
https://bugs.webkit.org/show_bug.cgi?id=202088

Reviewed by Alex Christensen.

* NetworkProcess/NetworkProcess.cpp:
* NetworkProcess/NetworkProcess.h:

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

4 months agoWebIDBConnectionToClient does not need to be RefCounted or a SessionID
cdumez@apple.com [Sun, 22 Sep 2019 05:16:23 +0000 (05:16 +0000)]
WebIDBConnectionToClient does not need to be RefCounted or a SessionID
https://bugs.webkit.org/show_bug.cgi?id=202089

Reviewed by Alex Christensen.

Source/WebCore:

Drop some dead code.

* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:

Source/WebKit:

WebIDBConnectionToClient does not need to be RefCounted, the ref() / deref() virtual function
it implemented from its interface were dead code. We now stop subclassing RefCounted and have
the NetworkConnectionToWebProcess fully own the WebIDBConnectionToClient. Instead of the
WebIDBConnectionToClient having 3 data members for the NetworkProcess, the sessionID and the IPC
connection, use a single data member to its NetworkConnectionToWebProcess parent. It can get
everything it needs from its parent.

* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
(WebKit::WebIDBConnectionToClient::idbServer):
(WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
(WebKit::WebIDBConnectionToClient::messageSenderConnection const):
(WebKit::WebIDBConnectionToClient::connectionToClient):
(WebKit::WebIDBConnectionToClient::deleteDatabase):
(WebKit::WebIDBConnectionToClient::openDatabase):
(WebKit::WebIDBConnectionToClient::abortTransaction):
(WebKit::WebIDBConnectionToClient::commitTransaction):
(WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
(WebKit::WebIDBConnectionToClient::createObjectStore):
(WebKit::WebIDBConnectionToClient::deleteObjectStore):
(WebKit::WebIDBConnectionToClient::renameObjectStore):
(WebKit::WebIDBConnectionToClient::clearObjectStore):
(WebKit::WebIDBConnectionToClient::createIndex):
(WebKit::WebIDBConnectionToClient::deleteIndex):
(WebKit::WebIDBConnectionToClient::renameIndex):
(WebKit::WebIDBConnectionToClient::putOrAdd):
(WebKit::WebIDBConnectionToClient::getRecord):
(WebKit::WebIDBConnectionToClient::getAllRecords):
(WebKit::WebIDBConnectionToClient::getCount):
(WebKit::WebIDBConnectionToClient::deleteRecord):
(WebKit::WebIDBConnectionToClient::openCursor):
(WebKit::WebIDBConnectionToClient::iterateCursor):
(WebKit::WebIDBConnectionToClient::establishTransaction):
(WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
(WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
(WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
(WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
(WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
(WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
(WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
* NetworkProcess/NetworkConnectionToWebProcess.h:

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

4 months ago[CURL] CurlRequest does not need a sessionID
cdumez@apple.com [Sun, 22 Sep 2019 05:15:45 +0000 (05:15 +0000)]
[CURL] CurlRequest does not need a sessionID
https://bugs.webkit.org/show_bug.cgi?id=202086

Reviewed by Alex Christensen.

* platform/network/curl/CurlFormDataStream.cpp:
(WebCore::CurlFormDataStream::CurlFormDataStream):
* platform/network/curl/CurlFormDataStream.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::CurlRequest):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::create):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::createCurlRequest):

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

4 months agoCookieRequestHeaderFieldProxy does not need a SessionID
cdumez@apple.com [Sun, 22 Sep 2019 05:15:13 +0000 (05:15 +0000)]
CookieRequestHeaderFieldProxy does not need a SessionID
https://bugs.webkit.org/show_bug.cgi?id=202084

Reviewed by Alex Christensen.

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::didOpenSocketStream):
* loader/CookieJar.cpp:
(WebCore::CookieJar::cookieRequestHeaderFieldProxy):
* loader/CookieJar.h:
* platform/network/CookieRequestHeaderFieldProxy.h:
(WebCore::CookieRequestHeaderFieldProxy::encode const):
(WebCore::CookieRequestHeaderFieldProxy::decode):

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

4 months agoDocumentLoader::m_temporaryServiceWorkerClient does not need a sessionID
cdumez@apple.com [Sun, 22 Sep 2019 05:14:26 +0000 (05:14 +0000)]
DocumentLoader::m_temporaryServiceWorkerClient does not need a sessionID
https://bugs.webkit.org/show_bug.cgi?id=202083

Reviewed by Alex Christensen.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
(WebCore::DocumentLoader::unregisterTemporaryServiceWorkerClient):
* loader/DocumentLoader.h:

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

4 months agoMove JSLexicalEnvironment, DirectArguments, and ScopedArguments cells out of the...
mark.lam@apple.com [Sun, 22 Sep 2019 04:01:23 +0000 (04:01 +0000)]
Move JSLexicalEnvironment, DirectArguments, and ScopedArguments cells out of the Gigacage.
https://bugs.webkit.org/show_bug.cgi?id=202082

Reviewed by Tadeu Zagallo.

They are not being caged anyway.

* runtime/DirectArguments.h:
* runtime/JSLexicalEnvironment.h:
(JSC::JSLexicalEnvironment::subspaceFor):
* runtime/ScopedArguments.h:
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

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

4 months ago[FTW] Resolve crashes found while running canvas tests
bfulgham@apple.com [Sun, 22 Sep 2019 02:40:44 +0000 (02:40 +0000)]
[FTW] Resolve crashes found while running canvas tests
https://bugs.webkit.org/show_bug.cgi?id=202062

Reviewed by Don Olmstead.

* platform/graphics/Pattern.h:
* platform/graphics/win/Direct2DOperations.cpp:
(WebCore::Direct2D::FillSource::FillSource): Take GraphicsContext as argument, rather than
a PlatformContextDirect2D since downstream operations require the former.
(WebCore::Direct2D::StrokeSource::StrokeSource): Ditto.
(WebCore::Direct2D::clip): Use new 'pushClip' helper function.
* platform/graphics/win/Direct2DOperations.h:
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::drawPath):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
(WebCore::GraphicsContext::strokeRect):
* platform/graphics/win/GraphicsContextImplDirect2D.cpp:
(WebCore::GraphicsContextImplDirect2D::fillRect): Update to pass GraphicsContext.
(WebCore::GraphicsContextImplDirect2D::fillRectWithRoundedHole): Ditto.
(WebCore::GraphicsContextImplDirect2D::fillPath): Ditto.
(WebCore::GraphicsContextImplDirect2D::strokeRect): Ditto.
(WebCore::GraphicsContextImplDirect2D::strokePath): Ditto.
(WebCore::GraphicsContextImplDirect2D::drawGlyphs): Ditto.
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::copyRectFromSourceToData): Correct return behavior.
(WebCore::ImageBufferData::compatibleBitmap): Make a copy if the render target is
backed by the ID2D1Bitmap we are trying to draw with.
* platform/graphics/win/PatternDirect2D.cpp:
(WebCore::Pattern::createPlatformPattern const): Remove 'PlatformContextDirect2D' contructor,
since we always need a GraphicsContext for the Image class.
* platform/graphics/win/PlatformContextDirect2D.cpp:
(WebCore::PlatformContextDirect2D::clipLayer const): Added.
(WebCore::PlatformContextDirect2D::clearClips): Added.
(WebCore::PlatformContextDirect2D::restore): Update to use m_stateStack, rather than
the m_renderStates vector.
(WebCore::PlatformContextDirect2D::save): Ditto.
(WebCore::PlatformContextDirect2D::pushRenderClip): Ditto.
(WebCore::PlatformContextDirect2D::setActiveLayer): Ditto.
(WebCore::PlatformContextDirect2D::endDraw): Ditto.
(WebCore::PlatformContextDirect2D::notifyPostDrawObserver): Ditto.
(WebCore::PlatformContextDirect2D::pushClip): Ditto.
* platform/graphics/win/PlatformContextDirect2D.h:
(WebCore::PlatformContextDirect2D::hasSavedState const):
(WebCore::PlatformContextDirect2D::clipLayer const): Deleted.

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

4 months agoRegression(iOS 13) web views do not deal properly with their window's UIScene changing
cdumez@apple.com [Sat, 21 Sep 2019 23:13:47 +0000 (23:13 +0000)]
Regression(iOS 13) web views do not deal properly with their window's UIScene changing
https://bugs.webkit.org/show_bug.cgi?id=202070
<rdar://problem/55580699>

Reviewed by Tim Horton.

Web views do not deal properly with their window's UIScene changing. If a Safari window is in the
background for 1 minute, its UIScene will be detached and the window will get a new UIScene if
the user later switches to this window. Our web views listen to UIScene notifications to determine
their visibility and currently stop receiving visibility updates once the window’s UIScene has
changed. This causes view freezes because our WebContent process does not know its view is visible
and keeps its layer tree frozen.

Previously, when our view would be added to a window, we would get this window's UIScene and listen
for UISceneDidEnterBackgroundNotification / UISceneWillEnterForegroundNotification for this UIScene
object. Instead, we now listen to these notifications for ALL the application's UIScenes. Our handler
then checks if the notification's UIScene object matches the current window's UIScene before
forwarding the notification to the rest of WebKit.

* UIProcess/ApplicationStateTracker.mm:
(WebKit::ApplicationStateTracker::ApplicationStateTracker):
(WebKit::ApplicationStateTracker::~ApplicationStateTracker):

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

4 months agoSafari 13 may launch leftover 32-bit plug-in process from Safari 12’s WebKit, which...
mitz@apple.com [Sat, 21 Sep 2019 22:57:46 +0000 (22:57 +0000)]
Safari 13 may launch leftover 32-bit plug-in process from Safari 12’s WebKit, which crashes
https://bugs.webkit.org/show_bug.cgi?id=202077
<rdar://problem/55547063>

Reviewed by Sam Weinig.

* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::getPluginArchitecture): Removed support for i386 plug-ins.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName): Assert that the requested process type is not Plugin32.

* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes): Assert that the
  plug-in architecture is x86_64.

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

4 months agostress/test-out-of-memory.js is not throwing OOM into ARMv7 and MIPS
ticaiolima@gmail.com [Sat, 21 Sep 2019 20:20:56 +0000 (20:20 +0000)]
stress/test-out-of-memory.js is not throwing OOM into ARMv7 and MIPS
https://bugs.webkit.org/show_bug.cgi?id=202011

Reviewed by Mark Lam.

We are skipping this test into MIPS and ARMv7 because some of its assumptions
are not valid for them. The current behavior of the test in those architectures
is that it does not throw during `new ArrayBuffer(1000)` allocation site,
because eden collection keeps happening between iterations. The collection
is triggered on those architectures because the amount of stress
`new Promise` generates into GC limits is not enough to avoid them
while loop is executing.

Changing the size of `UInt8Array` from `80000000` to `160000000` can
be an alternative fix to avoid collection happening during `ArrayBuffer`
allocation loop, but we can't guarantee this test is always going to execute
without error when Gigacage is disabled, given we can reach an OOM state in
some allocations that need to succeed, making this test flaky for those
architectures.

* stress/test-out-of-memory.js:

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

4 months agoAccessCase should strongly visit its dependencies while on stack
tzagallo@apple.com [Sat, 21 Sep 2019 18:30:29 +0000 (18:30 +0000)]
AccessCase should strongly visit its dependencies while on stack
https://bugs.webkit.org/show_bug.cgi?id=201986
<rdar://problem/55521953>

Reviewed by Saam Barati and Yusuke Suzuki.

JSTests:

* stress/ftl-put-by-id-setter-exception-interesting-live-state-2.js: Added.
(foo):
(warmup):

Source/JavaScriptCore:

AccessCase::doesCalls is responsible for specifying the cells it depends on, so that
MarkingGCAwareJITStubRoutine can strongly visit them while the stub is on stack. However,
it was missing most of its dependencies, which led to it being collected while on stack.
This manifested in the flaky test stress/ftl-put-by-id-setter-exception-interesting-live-state.js
as the PolymorphicAccess being collected and removing its exception handler from the code
block, which led to exception propagating past the try/catch.

In order to fix this, we abstract the dependency gathering logic from AccessCase into
forEachDependentCell and use it to implement visitWeak as well as doesCalls in order to
guarantee that their implementation is consistent.

* bytecode/AccessCase.cpp:
(JSC::AccessCase::forEachDependentCell const):
(JSC::AccessCase::doesCalls const):
(JSC::AccessCase::visitWeak const):
* bytecode/AccessCase.h:
* bytecode/CallLinkInfo.cpp:
(JSC::CallLinkInfo::lastSeenCallee const):
(JSC::CallLinkInfo::haveLastSeenCallee const):
(JSC::CallLinkInfo::lastSeenCallee): Deleted.
(JSC::CallLinkInfo::haveLastSeenCallee): Deleted.
* bytecode/CallLinkInfo.h:
(JSC::CallLinkInfo::isDirect const):
(JSC::CallLinkInfo::isLinked const):
(JSC::CallLinkInfo::stub const):
(JSC::CallLinkInfo::forEachDependentCell const):
(JSC::CallLinkInfo::isLinked): Deleted.
(JSC::CallLinkInfo::stub): Deleted.
* bytecode/ObjectPropertyCondition.cpp:
(JSC::ObjectPropertyCondition::isStillLive const):
* bytecode/ObjectPropertyCondition.h:
(JSC::ObjectPropertyCondition::forEachDependentCell const):
* bytecode/ObjectPropertyConditionSet.cpp:
(JSC::ObjectPropertyConditionSet::areStillLive const):
* bytecode/ObjectPropertyConditionSet.h:
(JSC::ObjectPropertyConditionSet::forEachDependentCell const):
* bytecode/PropertyCondition.cpp:
(JSC::PropertyCondition::isStillLive const):
* bytecode/PropertyCondition.h:
(JSC::PropertyCondition::forEachDependentCell const):
* jit/PolymorphicCallStubRoutine.cpp:
(JSC::PolymorphicCallStubRoutine::visitWeak):
* jit/PolymorphicCallStubRoutine.h:
(JSC::PolymorphicCallStubRoutine::forEachDependentCell):

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

4 months ago[Pointer Events] touch-action set to pan-x or pan-y alone should disable scrolling...
graouts@webkit.org [Sat, 21 Sep 2019 16:08:34 +0000 (16:08 +0000)]
[Pointer Events] touch-action set to pan-x or pan-y alone should disable scrolling altogether if the intial gesture is in the disallowed direction
https://bugs.webkit.org/show_bug.cgi?id=202053
<rdar://problem/54542190>

Reviewed by Tim Horton.

Source/WebKit:

Although the Pointer Events specification does not specify this clearly (see https://github.com/w3c/pointerevents/issues/303), setting "touch-action" to a value
that only allows scrolling a specific direction ("pan-x" or "pan-y") should disable scrolling in the specified direction if the panning gesture initially is directed
in the opposite direction. In practice, this means that setting "touch-action: pan-y" on an element should disable scrolling if the user initially pans horizontally,
even if later on in the gesture the user pans vertically. This allows for sites that want to offer a programmatic horizontal scroller to disable vertical scrolling
if the user pans horizontally.

In order to support this, we add four UISwipeGestureRecognizers, one for each direction, and we selectively allows touches to be recognizer for them based on the
"touch-action" value specified at the initial touch location for a given gesture. In the case of "touch-action: pan-y" we only allow the left and right swipe recognizers
to be enabled, and in the case of "touch-action: pan-x" we only allow the up and down swipe recognizers to be enabled. If any of those gesture recognizers is recognized,
scrolling will be disabled for the duration of this gesture. If a UIScrollView panning gesture recognizer is recognized prior to a swipe, they won't have a chance to be
recognized.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView gestureRecognizer:shouldReceiveTouch:]):

LayoutTests:

Add new tests checking that setting "touch-action: pan-y" on an element and initiating a horizontal panning gesture will disallow scrolling vertically
if a vertical scrolling gesture follows. We test both the case where scrolling would apply to the whole page and the case where scrolling would apply
to an "overflow: scroll" element.

* pointerevents/ios/touch-action-pan-y-horizontal-gesture-prevents-vertical-scrolling-expected.txt: Added.
* pointerevents/ios/touch-action-pan-y-horizontal-gesture-prevents-vertical-scrolling.html: Added.
* pointerevents/ios/touch-action-pan-y-in-overflow-scroll-horizontal-gesture-prevents-vertical-scrolling-expected.txt: Added.
* pointerevents/ios/touch-action-pan-y-in-overflow-scroll-horizontal-gesture-prevents-vertical-scrolling.html: Added.

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

4 months agoreleasePointerCapture() not working for implicit capture; can't opt-in to pointerente...
graouts@webkit.org [Sat, 21 Sep 2019 15:34:43 +0000 (15:34 +0000)]
releasePointerCapture() not working for implicit capture; can't opt-in to pointerenter/leave for touches
https://bugs.webkit.org/show_bug.cgi?id=199803
<rdar://problem/53127223>

Reviewed by Dean Jackson.

Source/WebCore:

In order to dispatch boundary events (pointerover/out/enter/leave) when the implicit pointer capture is released on iOS,
we need to track the target of the pointer events that was dispatched last for a given pointer id. Then we compare that
target with the current target when dispatching a new pointer event and determine whether we should dispatch boundary
events using the exact same approach used to dispatch mouse boundary events in EventHandler::updateMouseEventTargetNode().

Tests: pointerevents/ios/boundary-events-through-hierarchy-without-pointer-capture.html
       pointerevents/ios/boundary-events-without-pointer-capture.html

* page/PointerCaptureController.cpp:
(WebCore::hierarchyHasCapturingEventListeners):
(WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):
(WebCore::PointerCaptureController::pointerEventWillBeDispatched):
(WebCore::PointerCaptureController::ensureCapturingDataForPointerEvent):
(WebCore::PointerCaptureController::cancelPointer):
* page/PointerCaptureController.h:

LayoutTests:

Add new tests that check we correctly dispatch boundary events on iOS when pointer capture is disabled.

* pointerevents/ios/boundary-events-through-hierarchy-without-pointer-capture-expected.txt: Added.
* pointerevents/ios/boundary-events-through-hierarchy-without-pointer-capture.html: Added.
* pointerevents/ios/boundary-events-without-pointer-capture-expected.txt: Added.
* pointerevents/ios/boundary-events-without-pointer-capture.html: Added.
* pointerevents/utils.js:

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

4 months ago[LFC] LayoutContext::m_formattingContextRootListForLayout should be a WeakHashSet
zalan@apple.com [Sat, 21 Sep 2019 13:51:17 +0000 (13:51 +0000)]
[LFC] LayoutContext::m_formattingContextRootListForLayout should be a WeakHashSet
https://bugs.webkit.org/show_bug.cgi?id=202068
<rdar://problem/55579352>

Reviewed by Alex Christensen.

* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::layout):
(WebCore::Layout::LayoutContext::styleChanged):
(WebCore::Layout::LayoutContext::markNeedsUpdate):
* layout/LayoutContext.h:
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

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

4 months agoclang-tidy: Fix unnecessary copy/ref churn of for loop variables in WTF/JavaScriptCore
ddkilzer@apple.com [Sat, 21 Sep 2019 11:39:57 +0000 (11:39 +0000)]
clang-tidy: Fix unnecessary copy/ref churn of for loop variables in WTF/JavaScriptCore
<https://webkit.org/b/202069>

Reviewed by Mark Lam.

Fix unwanted copying/ref churn of loop variables by making them
const references.

Source/JavaScriptCore:

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::setConstantIdentifierSetRegisters):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::prepareLexicalScopeForNextForLoopIteration):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
* inspector/agents/InspectorAgent.cpp:
(Inspector::InspectorAgent::activateExtraDomains):
* inspector/remote/cocoa/RemoteInspectorCocoa.mm:
(Inspector::RemoteInspector::stopInternal):
(Inspector::RemoteInspector::xpcConnectionFailed):
(Inspector::RemoteInspector::pushListingsNow):
* parser/Parser.h:
(JSC::Scope::computeLexicallyCapturedVariablesAndPurgeCandidates):
* runtime/ProxyObject.cpp:
(JSC::ProxyObject::performGetOwnPropertyNames):
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::registerForReportAtExit):
(JSC::SamplingProfiler::reportTopFunctions):
(JSC::SamplingProfiler::reportTopBytecodes):
* runtime/TypeSet.cpp:
(JSC::StructureShape::inspectorRepresentation):
(JSC::StructureShape::merge):

Source/WTF:

* wtf/AggregateLogger.h:
(WTF::AggregateLogger::log const):

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

4 months ago[Apple Pay] Clean up handling of summary items and payment method updates
aestes@apple.com [Sat, 21 Sep 2019 06:37:34 +0000 (06:37 +0000)]
[Apple Pay] Clean up handling of summary items and payment method updates
https://bugs.webkit.org/show_bug.cgi?id=202018
<rdar://problem/55470632>

Reviewed by Tim Horton.

Source/WebCore:

Replaced the PaymentMethodUpdate struct with a class that knows how to convert from
ApplePayPaymentMethodUpdate structs to PKPaymentRequestPaymentMethodUpdate instances.

Moved some scattered-around free functions for converting payment summary items into
PaymentSummaryItems{.h,Cocoa.mm}.

* Modules/applepay/ApplePayPaymentMethodUpdate.h:
* Modules/applepay/ApplePaySession.cpp:
(WebCore::finishConverting):
(WebCore::convertAndValidateTotal):
(WebCore::convertAndValidate):
* Modules/applepay/ApplePaySessionPaymentRequest.h:
* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentCoordinatorClient.h:
* Modules/applepay/PaymentHeaders.h:
* Modules/applepay/PaymentMethodUpdate.h: Added.
* Modules/applepay/PaymentSummaryItems.h: Added.
* Modules/applepay/cocoa/PaymentMethodUpdateCocoa.mm: Added.
(WebCore::PaymentMethodUpdate::PaymentMethodUpdate):
(WebCore::PaymentMethodUpdate::totalAndLineItems const):
(WebCore::PaymentMethodUpdate::platformUpdate const):
* Modules/applepay/cocoa/PaymentSummaryItemsCocoa.mm: Added.
(WebCore::toDecimalNumber):
(WebCore::toPKPaymentSummaryItemType):
(WebCore::toPKPaymentSummaryItem):
(WebCore::platformSummaryItems):
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::completePaymentMethodSelection):

Source/WebKit:

Now that PaymentMethodUpdate knows how to convert itself to a
PKPaymentRequestPaymentMethodUpdate, PaymentAuthorizationPresenter can merely pass the
converted update directly to the platform delegate rather than passing the individual
components and relying on the delegate to instantiate the platform update itself. Added
FIXMEs for applying a similar treatment to ShippingContactUpdate and ShippingMethodUpdate.

* Platform/cocoa/PaymentAuthorizationPresenter.h:
* Platform/cocoa/PaymentAuthorizationPresenter.mm:
(WebKit::PaymentAuthorizationPresenter::completePaymentMethodSelection):
(WebKit::PaymentAuthorizationPresenter::completeShippingContactSelection):
(WebKit::PaymentAuthorizationPresenter::completeShippingMethodSelection):
* Platform/cocoa/WKPaymentAuthorizationDelegate.h:
* Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
(-[WKPaymentAuthorizationDelegate completePaymentMethodSelection:]):
(-[WKPaymentAuthorizationDelegate completeShippingContactSelection:]):
(-[WKPaymentAuthorizationDelegate completeShippingMethodSelection:]):
(-[WKPaymentAuthorizationDelegate _didSelectPaymentMethod:completion:]):
(-[WKPaymentAuthorizationDelegate _didSelectShippingContact:completion:]):
(-[WKPaymentAuthorizationDelegate _didSelectShippingMethod:completion:]):
(-[WKPaymentAuthorizationDelegate completeShippingContactSelection:summaryItems:shippingMethods:errors:]): Deleted.
* Shared/ApplePay/WebPaymentCoordinatorProxy.h:
* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest):
(WebKit::toPKPaymentSummaryItemType): Deleted.
(WebKit::toPKPaymentSummaryItem): Deleted.
(WebKit::toPKPaymentSummaryItems): Deleted.
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::encode):
(IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):

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

4 months agoeliding a move in Air O0 needs to mark the dest's old reg as available
keith_miller@apple.com [Sat, 21 Sep 2019 02:11:37 +0000 (02:11 +0000)]
eliding a move in Air O0 needs to mark the dest's old reg as available
https://bugs.webkit.org/show_bug.cgi?id=202066

Reviewed by Saam Barati.

Also adds a new release method that handles all the invariants of
returning a register to the available register pool.

* b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp:
(JSC::B3::Air::GenerateAndAllocateRegisters::release):
(JSC::B3::Air::GenerateAndAllocateRegisters::spill):
(JSC::B3::Air::GenerateAndAllocateRegisters::freeDeadTmpsIfNeeded):
(JSC::B3::Air::GenerateAndAllocateRegisters::generate):
* b3/air/AirAllocateRegistersAndStackAndGenerateCode.h:

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

4 months agoAssertion fires when animating a discrete property with values range and multiple...
commit-queue@webkit.org [Sat, 21 Sep 2019 01:24:45 +0000 (01:24 +0000)]
Assertion fires when animating a discrete property with values range and multiple animators
https://bugs.webkit.org/show_bug.cgi?id=201926

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-09-20
Reviewed by Darin Adler.

Source/WebCore:

The first animator of a property is considered the result element. The
other animators will be just contributers to the first animator. For the
first animator and in SVGSMILElement::progress(), we call resetAnimatedType()
which creates m_animator in SVGAnimateElementBase::animator(). But for
the other animators we do not call resetAnimatedType(). So their m_animator
will stay null until they are used for the first time.

If SVGAnimationElement::startedActiveInterval() calls calculateToAtEndOfDurationValue()
for a discrete property this will have no effect and the call should be
ignored. So SVGAnimateElementBase::calculateToAtEndOfDurationValue()
should bail out early if isDiscreteAnimator() is true.

The bug is isDiscreteAnimator() will return false if the m_animator is
null even if the animated property is discrete, e.g. SVGAnimatedString.
The fix is to make isDiscreteAnimator() ensure m_animator is created.

Unrelated change:
Make most of the protected methods of SVGAnimateElementBase be private.

Test: svg/animations/multiple-discrete-values-animate.svg

* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::calculateFromAndByValues):
(WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):

LayoutTests:

Animate a discrete property, such as SVGAnimatedString. There should be
multiple animators and the range of animation has to be set by the 'values'
attribute.

* svg/animations/multiple-discrete-values-animate-expected.txt: Added.
* svg/animations/multiple-discrete-values-animate.svg: Added.

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

4 months ago[EWS] JSC queues should re-build ToT and compare results on build failure
aakash_jain@apple.com [Sat, 21 Sep 2019 01:07:49 +0000 (01:07 +0000)]
[EWS] JSC queues should re-build ToT and compare results on build failure
https://bugs.webkit.org/show_bug.cgi?id=201999

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/factories.py:
(JSCTestsFactory.__init__): Do not add the UnApplyPatchIfRequired and CompileJSCOnlyToT step here, as
these are dynamically added (if required) in steps.py in CompileWebKit.evaluateCommand() using addStepsAfterCurrentStep().
Also setting skipUpload=False since we don't need to upload the archive for this queue. Building and testing is done in same build.
* BuildSlaveSupport/ews-build/steps.py:
(CompileWebKit.evaluateCommand): Add CompileJSCOnlyToT or CompileWebKitToT build-step based on 'group' property.
(AnalyzeCompileWebKitResults.start): Ditto.
(CompileJSCOnly.start): Set the 'group' property to 'jsc'.
(CompileJSCOnlyToT.evaluateCommand): Over-ride evaluateCommand, so that base-class' (CompileWebKit) evaluateCommand is
not used, base class evaluateCommand adds build-steps dynamically.

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

4 months agoRemove dead code for a specific macOS and iOS SDK
krollin@apple.com [Sat, 21 Sep 2019 00:36:06 +0000 (00:36 +0000)]
Remove dead code for a specific macOS and iOS SDK
https://bugs.webkit.org/show_bug.cgi?id=202054
<rdar://problem/55569619>

Reviewed by Zalan Bujtas.

ComplexTextController::collectComplexTextRunsForCharacters in
ComplexTextControllerCoreText.mm has some code for compatibility with
specifically macOS 10.14.0 and iOS 12.0 (see Bug 186571). We don't
build for these targets any more (when we build for macOS 10.14, it's
for a later minor revision), so this code can be removed.

No new tests -- no new or changed functionality.

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

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

4 months agoHarden assertion in StructureIDTable::get().
mark.lam@apple.com [Sat, 21 Sep 2019 00:29:13 +0000 (00:29 +0000)]
Harden assertion in StructureIDTable::get().
https://bugs.webkit.org/show_bug.cgi?id=202067
<rdar://problem/55577923>

Reviewed by Keith Miller.

* runtime/StructureIDTable.h:
(JSC::StructureIDTable::get):

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

4 months agoRemove some support for < iOS 13
krollin@apple.com [Sat, 21 Sep 2019 00:17:27 +0000 (00:17 +0000)]
Remove some support for < iOS 13
https://bugs.webkit.org/show_bug.cgi?id=202027
<rdar://problem/55547109>

Reviewed by Alex Christensen.

Remove some support for iOS versions less than 13.0.

Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
values >= 130000. This means that expressions like
"__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
"__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.

After version checks have been removed, there are some cases where the
preprocessor conditional looks like "#if PLATFORM(MAC) ||
PLATFORM(IOS_FAMILY)". These can be collapsed into "#if
PLATFORM(COCOA)". This additional cleanup will be performed in a
subsequent patch.

This removal is part of a series of patches effecting the removal of
dead code for old versions of iOS. This particular pass involves
changes in which Joe Pecoraro was involved. These changes are isolated
from other similar changes in order to facilitate the reviewing
process.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):

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

4 months agoRemove unnecessary abstractions around WebsiteDataStore
achristensen@apple.com [Sat, 21 Sep 2019 00:13:24 +0000 (00:13 +0000)]
Remove unnecessary abstractions around WebsiteDataStore
https://bugs.webkit.org/show_bug.cgi?id=201655

Reviewed by Chris Dumez.

Source/WebCore:

* Modules/webdatabase/cocoa/DatabaseManagerCocoa.mm:
(WebCore::DatabaseManager::platformInitialize):

Source/WebKit:

* PlatformFTW.cmake:
* PlatformWin.cmake:
* Sources.txt:
* SourcesCocoa.txt:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/APIHTTPCookieStore.cpp:
* UIProcess/API/APIHTTPCookieStore.h:
* UIProcess/API/APIPageConfiguration.cpp:
(API::PageConfiguration::websiteDataStore):
(API::PageConfiguration::setWebsiteDataStore):
* UIProcess/API/APIPageConfiguration.h:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
* UIProcess/API/APIWebsiteDataStore.cpp: Removed.
* UIProcess/API/APIWebsiteDataStore.h: Removed.
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::WebsitePolicies):
(API::WebsitePolicies::setWebsiteDataStore):
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextSetCacheModel):
(WKContextGetCacheModel):
* UIProcess/API/C/WKFramePolicyListener.cpp:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreGetTypeID):
(WKWebsiteDataStoreGetDefaultDataStore):
(WKWebsiteDataStoreCreateNonPersistentDataStore):
(WKWebsiteDataStoreCreateWithConfiguration):
(WKWebsiteDataStoreGetHTTPCookieStore):
(WKWebsiteDataStoreSetResourceLoadStatisticsDebugModeWithCompletionHandler):
(WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode):
(WKWebsiteDataStoreSetStatisticsLastSeen):
(WKWebsiteDataStoreSetStatisticsPrevalentResource):
(WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
(WKWebsiteDataStoreDumpResourceLoadStatistics):
(WKWebsiteDataStoreIsStatisticsPrevalentResource):
(WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
(WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder):
(WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
(WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
(WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
(WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
(WKWebsiteDataStoreSetStatisticsGrandfathered):
(WKWebsiteDataStoreIsStatisticsGrandfathered):
(WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
(WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
(WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
(WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
(WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
(WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
(WKWebsiteDataStoreSetStatisticsCrossSiteLoadWithLinkDecoration):
(WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
(WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
(WKWebsiteDataStoreStatisticsUpdateCookieBlocking):
(WKWebsiteDataStoreStatisticsSubmitTelemetry):
(WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
(WKWebsiteDataStoreSetStatisticsIsRunningTest):
(WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
(WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured):
(WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
(WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
(WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
(WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
(WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval):
(WKWebsiteDataStoreStatisticsDeleteCookiesForTesting):
(WKWebsiteDataStoreStatisticsHasLocalStorage):
(WKWebsiteDataStoreSetStatisticsCacheMaxAgeCap):
(WKWebsiteDataStoreStatisticsHasIsolatedSession):
(WKWebsiteDataStoreStatisticsResetToConsistentState):
(WKWebsiteDataStoreRemoveAllFetchCaches):
(WKWebsiteDataStoreRemoveFetchCacheForOrigin):
(WKWebsiteDataStoreRemoveAllIndexedDatabases):
(WKWebsiteDataStoreRemoveLocalStorage):
(WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
(WKWebsiteDataStoreGetFetchCacheOrigins):
(WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
(WKWebsiteDataStoreCopyServiceWorkerRegistrationDirectory):
(WKWebsiteDataStoreSetServiceWorkerRegistrationDirectory):
(WKWebsiteDataStoreClearAllDeviceOrientationPermissions):
(WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
(WKWebsiteDataStoreClearAdClickAttributionsThroughWebsiteDataRemoval):
* UIProcess/API/C/WKWebsitePolicies.cpp:
* UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: Removed.
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(+[WKWebsiteDataStore defaultDataStore]):
(+[WKWebsiteDataStore nonPersistentDataStore]):
(-[WKWebsiteDataStore dealloc]):
(-[WKWebsiteDataStore httpCookieStore]):
(-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
(-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
(+[WKWebsiteDataStore _defaultDataStoreExists]):
(+[WKWebsiteDataStore _deleteDefaultDataStoreForTesting]):
(-[WKWebsiteDataStore _initWithConfiguration:]):
(-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
(-[WKWebsiteDataStore _resourceLoadStatisticsEnabled]):
(-[WKWebsiteDataStore _setResourceLoadStatisticsEnabled:]):
(-[WKWebsiteDataStore _resourceLoadStatisticsDebugMode]):
(-[WKWebsiteDataStore _setResourceLoadStatisticsDebugMode:]):
(-[WKWebsiteDataStore _cacheStorageDirectory]):
(-[WKWebsiteDataStore _setCacheStorageDirectory:]):
(-[WKWebsiteDataStore _serviceWorkerRegistrationDirectory]):
(-[WKWebsiteDataStore _setServiceWorkerRegistrationDirectory:]):
(-[WKWebsiteDataStore _setBoundInterfaceIdentifier:]):
(-[WKWebsiteDataStore _boundInterfaceIdentifier]):
(-[WKWebsiteDataStore _setAllowsCellularAccess:]):
(-[WKWebsiteDataStore _allowsCellularAccess]):
(-[WKWebsiteDataStore _setProxyConfiguration:]):
(-[WKWebsiteDataStore _sourceApplicationBundleIdentifier]):
(-[WKWebsiteDataStore _setSourceApplicationBundleIdentifier:]):
(-[WKWebsiteDataStore _sourceApplicationSecondaryIdentifier]):
(-[WKWebsiteDataStore _setSourceApplicationSecondaryIdentifier:]):
(-[WKWebsiteDataStore _proxyConfiguration]):
(-[WKWebsiteDataStore _indexedDBDatabaseDirectory]):
(-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldSubmitTelemetry:]):
(-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
(-[WKWebsiteDataStore _getAllStorageAccessEntriesFor:completionHandler:]):
(-[WKWebsiteDataStore _scheduleCookieBlockingUpdate:]):
(-[WKWebsiteDataStore _setPrevalentDomain:completionHandler:]):
(-[WKWebsiteDataStore _getIsPrevalentDomain:completionHandler:]):
(-[WKWebsiteDataStore _clearPrevalentDomain:completionHandler:]):
(-[WKWebsiteDataStore _processStatisticsAndDataRecords:]):
(-[WKWebsiteDataStore _hasRegisteredServiceWorker]):
(-[WKWebsiteDataStore _delegate]):
(-[WKWebsiteDataStore set_delegate:]):
* UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h:
* UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: Removed.
* UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
(webkitWebsiteDataManagerSetProperty):
(webkitWebsiteDataManagerGetDataStore):
(webkit_website_data_manager_get_local_storage_directory):
(webkit_website_data_manager_get_disk_cache_directory):
(webkit_website_data_manager_get_offline_application_cache_directory):
(webkit_website_data_manager_get_indexeddb_directory):
(webkit_website_data_manager_get_websql_directory):
(webkit_website_data_manager_get_hsts_cache_directory):
(webkit_website_data_manager_fetch):
(webkit_website_data_manager_remove):
(webkit_website_data_manager_clear):
(webkitWebsiteDataManagerCreate): Deleted.
* UIProcess/API/glib/WebKitWebsiteDataManagerPrivate.h:
* UIProcess/API/win/APIWebsiteDataStoreWin.cpp: Removed.
* UIProcess/Cocoa/NavigationState.mm:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::NetworkProcessProxy):
(WebKit::NetworkProcessProxy::websiteDataStoreFromSessionID):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebFramePolicyListenerProxy.cpp:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
* UIProcess/WebProcessPool.cpp:
(WebKit::m_webProcessCache):
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
(WebKit::WebProcessPool::tryTakePrewarmedProcess):
(WebKit::WebProcessPool::processDidFinishLaunching):
(WebKit::WebProcessPool::processForRegistrableDomain):
(WebKit::WebProcessPool::createWebPage):
(WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::defaultApplicationCacheDirectory):
(WebKit::WebsiteDataStore::defaultCacheStorageDirectory):
(WebKit::WebsiteDataStore::defaultNetworkCacheDirectory):
(WebKit::WebsiteDataStore::defaultMediaCacheDirectory):
(WebKit::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
(WebKit::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
(WebKit::WebsiteDataStore::defaultLocalStorageDirectory):
(WebKit::WebsiteDataStore::defaultMediaKeysStorageDirectory):
(WebKit::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
(WebKit::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
(WebKit::WebsiteDataStore::defaultJavaScriptConfigurationDirectory):
(WebKit::WebsiteDataStore::tempDirectoryFileSystemRepresentation):
(WebKit::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
(WebKit::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::globalDefaultDataStore):
(WebKit::WebsiteDataStore::defaultDataStore):
(WebKit::WebsiteDataStore::deleteDefaultDataStoreForTesting):
(WebKit::WebsiteDataStore::defaultDataStoreExists):
(WebKit::WebsiteDataStore::defaultDataStoreConfiguration):
(WebKit::WebsiteDataStore::isAssociatedProcessPool const):
(WebKit::WebsiteDataStore::defaultMediaCacheDirectory):
(WebKit::WebsiteDataStore::defaultJavaScriptConfigurationDirectory):
(WebKit::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
* UIProcess/WebsiteData/WebsiteDataStore.h:
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
* UIProcess/WebsiteData/win/WebsiteDataStoreWin.cpp:
(WebKit::WebsiteDataStore::defaultApplicationCacheDirectory):
(WebKit::WebsiteDataStore::defaultCacheStorageDirectory):
(WebKit::WebsiteDataStore::defaultNetworkCacheDirectory):
(WebKit::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
(WebKit::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
(WebKit::WebsiteDataStore::defaultLocalStorageDirectory):
(WebKit::WebsiteDataStore::defaultMediaKeysStorageDirectory):
(WebKit::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
(WebKit::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
(WebKit::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
(WebKit::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
* UIProcess/glib/WebProcessProxyGLib.cpp:
(WebKit::WebProcessProxy::platformGetLaunchOptions):
* UIProcess/glib/WebsiteDataStoreGLib.cpp: Copied from Source/WebKit/UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp.
(API::WebsiteDataStore::defaultApplicationCacheDirectory): Deleted.
(API::WebsiteDataStore::defaultNetworkCacheDirectory): Deleted.
(API::WebsiteDataStore::defaultCacheStorageDirectory): Deleted.
(API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory): Deleted.
(API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory): Deleted.
(API::WebsiteDataStore::defaultLocalStorageDirectory): Deleted.
(API::WebsiteDataStore::defaultMediaKeysStorageDirectory): Deleted.
(API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
(API::WebsiteDataStore::defaultWebSQLDatabaseDirectory): Deleted.
(API::WebsiteDataStore::defaultHSTSDirectory): Deleted.
(API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory): Deleted.
(API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation): Deleted.
(API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation): Deleted.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
(WebKit::WebMediaKeyStorageManager::setWebsiteDataStore):

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

4 months ago[resource-timing] Report performance entries with all HTTP status codes
commit-queue@webkit.org [Fri, 20 Sep 2019 23:59:02 +0000 (23:59 +0000)]
[resource-timing] Report performance entries with all HTTP status codes
https://bugs.webkit.org/show_bug.cgi?id=202040

Patch by Alex Christensen <achristensen@webkit.org> on 2019-09-20
Reviewed by Joseph Pecoraro.

LayoutTests/imported/w3c:

* web-platform-tests/resource-timing/resource_ignore_failures-expected.txt: Removed.
* web-platform-tests/resource-timing/resource_ignore_failures.html: Removed.
This test is no longer in wpt and it would regress with this change, so we remove it.
* web-platform-tests/resource-timing/resources/status-code.py: Added.
(main):
* web-platform-tests/resource-timing/status-codes-create-entry-expected.txt: Added.
* web-platform-tests/resource-timing/status-codes-create-entry.html: Added.

Source/WebCore:

This follows a Chromium change at https://chromium-review.googlesource.com/c/chromium/src/+/1796544
The spec change is being discussed at https://github.com/w3c/resource-timing/issues/165

Test: imported/w3c/web-platform-tests/resource-timing/status-codes-create-entry.html

I had to slightly modify the test to make sure the entry count was > 0 instead of == 1 to reduce flakyness because sometimes we load the 200 image twice.
I'll submit a PR to WPT, too.

* loader/ResourceTimingInformation.cpp:
(WebCore::ResourceTimingInformation::shouldAddResourceTiming):

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

4 months agoREGRESSION (iOS 13): rAF stops firing when navigating away cross-origin and then...
cdumez@apple.com [Fri, 20 Sep 2019 23:46:45 +0000 (23:46 +0000)]
REGRESSION (iOS 13): rAF stops firing when navigating away cross-origin and then back
https://bugs.webkit.org/show_bug.cgi?id=201767
<rdar://problem/55350854>

Reviewed by Tim Horton.

Source/WebKit:

This is a follow-up to r249961 to address crashes when navigating back cross-origin to a page
that uses requestAnimationFrame. r249961 took care of moving RemoteLayerTreeDisplayRefreshMonitor
objects from one RemoteLayerTreeDrawingArea to another but failed to tell those monitors
about their new drawingArea. As a result, RemoteLayerTreeDrawingArea::willDestroyDisplayRefreshMonitor()
would not get called on the new drawing area when it should have.

* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
(WebKit::RemoteLayerTreeDisplayRefreshMonitor::updateDrawingArea):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::adoptDisplayRefreshMonitorsFromDrawingArea):

LayoutTests:

Call finishJSTest() on a timer to make it more likely to reproduce the bug.

* http/tests/navigation/page-cache-requestAnimationFrame.html:

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

4 months agoRemove check of setSourceAppPid selector that's no longer needed
krollin@apple.com [Fri, 20 Sep 2019 22:58:55 +0000 (22:58 +0000)]
Remove check of setSourceAppPid selector that's no longer needed
https://bugs.webkit.org/show_bug.cgi?id=201971
<rdar://problem/55505761>

Reviewed by Andy Estes.

Bug 172152 introduced a check of the NEFilterSource selector
setSourceAppPid in order to support OS's that didn't support it. All
supported Cocoa platforms now support it, so the check can be removed.

Source/WebCore:

No new tests -- no new or changed functionality.

* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::initialize):

Source/WebCore/PAL:

* pal/spi/cocoa/NEFilterSourceSPI.h:

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

4 months agoRemove some support for < iOS 13
krollin@apple.com [Fri, 20 Sep 2019 22:19:55 +0000 (22:19 +0000)]
Remove some support for < iOS 13
https://bugs.webkit.org/show_bug.cgi?id=201967
<rdar://problem/55504738>

Reviewed by Andy Estes.

Remove some support for iOS versions less than 13.0.

Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
values >= 130000. This means that expressions like
"__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
"__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.

After version checks have been removed, there are some cases where the
preprocessor conditional looks like "#if PLATFORM(MAC) ||
PLATFORM(IOS_FAMILY)". These can be collapsed into "#if
PLATFORM(COCOA)". This additional cleanup will be performed in a
subsequent patch.

This removal is part of a series of patches effecting the removal of
dead code for old versions of iOS. This particular pass involves
changes in which Andy Estes was involved. These changes are isolated
from other similar changes in order to facilitate the reviewing
process.

Source/WebCore:

No new tests -- no new or changed functionality.

* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::initialize):

Source/WebCore/PAL:

* pal/spi/cocoa/NEFilterSourceSPI.h:

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _dataForPreviewItemController:atPosition:type:]):
* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKPDFView.mm: Removed.

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

4 months agoSanitize suggested filenames used for saving PDFs
timothy_horton@apple.com [Fri, 20 Sep 2019 21:49:30 +0000 (21:49 +0000)]
Sanitize suggested filenames used for saving PDFs
https://bugs.webkit.org/show_bug.cgi?id=202034
<rdar://problem/53183075>

Reviewed by Chris Dumez.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFinishLoadingDataForCustomContentProvider):
(WebKit::WebPageProxy::saveDataToFileInDownloadsFolder):
(WebKit::WebPageProxy::savePDFToFileInDownloadsFolder):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw): Deleted.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication):
(WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw): Deleted.
Sanitize suggested filenames to ensure that they comprise only one path component
when concatenated with their destination directory.

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

4 months agoBegin moving WebsiteDataStore setters to WebsiteDataStoreConfiguration
achristensen@apple.com [Fri, 20 Sep 2019 21:45:53 +0000 (21:45 +0000)]
Begin moving WebsiteDataStore setters to WebsiteDataStoreConfiguration
https://bugs.webkit.org/show_bug.cgi?id=202025

Reviewed by Chris Dumez.

One expected change in behavior is that the resource load statistics directory is not created on startup with an ephemeral session any more
because we call the constructor of WebsiteDataStoreConfiguration inside _WKWebsiteDataStoreConfiguration and set the default directory like we do the other directories.

* TestWebKitAPI/Tests/WebKitCocoa/StorageQuota.mm:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::websiteDataStore):
(WTR::TestController::generatePageConfiguration):

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

4 months agoAdd release logging for when a view is added / removed from a window
cdumez@apple.com [Fri, 20 Sep 2019 21:40:23 +0000 (21:40 +0000)]
Add release logging for when a view is added / removed from a window
https://bugs.webkit.org/show_bug.cgi?id=202050

Reviewed by Tim Horton.

Add release logging for when a view is added / removed from a window to help determine the
view's visibility in the logs.

* UIProcess/ios/WKApplicationStateTrackingView.mm:
(-[WKApplicationStateTrackingView willMoveToWindow:]):
(-[WKApplicationStateTrackingView didMoveToWindow]):

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

4 months agoApplicationStateTracker::m_isBackground initialization does not account for UIScenes
cdumez@apple.com [Fri, 20 Sep 2019 21:37:24 +0000 (21:37 +0000)]
ApplicationStateTracker::m_isBackground initialization does not account for UIScenes
https://bugs.webkit.org/show_bug.cgi?id=202048

Reviewed by Geoffrey Garen.

ApplicationStateTracker::m_isBackground initialization does not account for UIScenes, it merely checks
the visibility state of the whole app. It should instead check the visibility state of the window's
UIScene.

This patch also refactors the code a little bit to reduce #ifdef'ing.

* UIProcess/ApplicationStateTracker.mm:
(WebKit::ApplicationStateTracker::ApplicationStateTracker):

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

4 months agoDocument no longer needs to store a SessionID
cdumez@apple.com [Fri, 20 Sep 2019 21:35:58 +0000 (21:35 +0000)]
Document no longer needs to store a SessionID
https://bugs.webkit.org/show_bug.cgi?id=202024

Reviewed by Geoffrey Garen.

Document no longer needs to store a SessionID, now that we have a single
session per WebProcess. It can simply get its sessionID from its Page.

Source/WebCore:

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::create):
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::didOpenSocketStream):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* dom/DOMImplementation.cpp:
(WebCore::createXMLDocument):
(WebCore::DOMImplementation::createDocument):
(WebCore::DOMImplementation::createHTMLDocument):
* dom/DOMImplementation.h:
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::m_undoManager):
(WebCore::Document::create):
(WebCore::Document::createNonRenderedPlaceholder):
(WebCore::Document::cloneDocumentWithoutChildren const):
(WebCore::Document::sessionID const):
(WebCore::Document::privateBrowsingStateDidChange):
(WebCore::Document::ensureTemplateDocument):
(WebCore::Document::logger):
(WebCore::Document::didLogMessage):
* dom/Document.h:
(WebCore::Document::create):
* dom/XMLDocument.h:
(WebCore::XMLDocument::create):
(WebCore::XMLDocument::createXHTML):
(WebCore::XMLDocument::XMLDocument):
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocument::FTPDirectoryDocument):
* html/FTPDirectoryDocument.h:
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAdClickAttribution const):
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::createSynthesizedDocument):
(WebCore::HTMLDocument::HTMLDocument):
(WebCore::HTMLDocument::cloneDocumentWithoutChildren const):
* html/HTMLDocument.h:
(WebCore::HTMLDocument::create):
* html/ImageDocument.cpp:
(WebCore::ImageDocument::ImageDocument):
* html/MediaDocument.cpp:
(WebCore::MediaDocument::MediaDocument):
* html/MediaDocument.h:
* html/PluginDocument.cpp:
(WebCore::PluginDocument::PluginDocument):
* html/TextDocument.cpp:
(WebCore::TextDocument::TextDocument):
* html/TextDocument.h:
* inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::patchDocument):
* loader/CookieJar.cpp:
(WebCore::CookieJar::cookieRequestHeaderFieldProxy):
(WebCore::CookieJar::cookieRequestHeaderFieldValue const):
* loader/CookieJar.h:
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::createDocument):
* loader/SinkDocument.cpp:
(WebCore::SinkDocument::SinkDocument):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::setResponse):
(WebCore::CachedResource::varyHeaderValuesMatch):
* loader/cache/CachedSVGDocument.cpp:
(WebCore::CachedSVGDocument::finishLoading):
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::ensureCustomFontData):
* page/Page.cpp:
(WebCore::Page::configureLoggingChannel):
* platform/network/CacheValidation.cpp:
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::collectVaryingRequestHeaders):
(WebCore::verifyVaryingRequestHeaders):
* platform/network/CacheValidation.h:
* svg/SVGDocument.cpp:
(WebCore::SVGDocument::SVGDocument):
(WebCore::SVGDocument::cloneDocumentWithoutChildren const):
* svg/SVGDocument.h:
(WebCore::SVGDocument::create):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::isAlwaysOnLoggingAllowed const):
* worklets/WorkletGlobalScope.cpp:
(WebCore::WorkletGlobalScope::WorkletGlobalScope):
* worklets/WorkletGlobalScope.h:
* xml/DOMParser.cpp:
(WebCore::DOMParser::parseFromString):
* xml/DOMParser.h:
* xml/DOMParser.idl:
* xml/XMLHttpRequest.cpp:
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::createDocumentFromSource):

Source/WebKit:

* WebProcess/WebPage/WebCookieJar.cpp:
(WebKit::WebCookieJar::cookieRequestHeaderFieldValue const):
* WebProcess/WebPage/WebCookieJar.h:

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

4 months agoWeb Inspector: HTML Formatter - better indentation/newline handling for self closing...
drousso@apple.com [Fri, 20 Sep 2019 21:23:20 +0000 (21:23 +0000)]
Web Inspector: HTML Formatter - better indentation/newline handling for self closing tags
https://bugs.webkit.org/show_bug.cgi?id=202036

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

* UserInterface/Workers/Formatter/HTMLFormatter.js:
(HTMLFormatter.prototype._before):

LayoutTests:

* inspector/formatting/formatting-xml.html:
* inspector/formatting/formatting-xml-expected.txt:
* inspector/formatting/resources/xml-tests/self-closing.xml: Added.
* inspector/formatting/resources/xml-tests/self-closing-expected.xml: Added.

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

4 months ago[iOS] ASSERTION FAILED: Unsafe to ref/deref of ShareableBitmap from different threads
cdumez@apple.com [Fri, 20 Sep 2019 21:06:26 +0000 (21:06 +0000)]
[iOS] ASSERTION FAILED: Unsafe to ref/deref of ShareableBitmap from different threads
https://bugs.webkit.org/show_bug.cgi?id=201712
<rdar://problem/55289916>

Reviewed by Tim Horton.

Make sure ShareableBitmap objects are always ref'd / deref'd on the main thread by dispatching to
the main thread in ShareableBitmap::releaseBitmapContextData() before calling deref().

* Shared/ShareableBitmap.cpp:
(WebKit::ShareableBitmap::ShareableBitmap):
(WebKit::ShareableBitmap::~ShareableBitmap):
* Shared/cg/ShareableBitmapCG.cpp:
(WebKit::ShareableBitmap::createGraphicsContext):
(WebKit::ShareableBitmap::releaseBitmapContextData):

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