WebKit-https.git
6 weeks agoLoad event must be fired only for the SVG structurally external elements and the...
commit-queue@webkit.org [Fri, 18 Oct 2019 18:29:11 +0000 (18:29 +0000)]
Load event must be fired only for the SVG structurally external elements and the outermost SVG element
https://bugs.webkit.org/show_bug.cgi?id=203044

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-10-18
Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

* web-platform-tests/svg/geometry/svg-image-intrinsic-size-with-cssstyle-auto-expected.txt:
The timeout issues are now fixed. webkit.org/b/202013 will fix the other
failures.

* web-platform-tests/svg/images/20x20.png: Added.
Add an image which is referenced by these tests:
    web-platform-tests/svg/import/styling-pres-02-f-manual.svg
    web-platform-tests/svg/import/struct-use-01-t-manual.svg
    web-platform-tests/svg/import/interact-events-02-b-manual.svg

* web-platform-tests/svg/linking/scripted/href-script-element-expected.txt:

Source/WebCore:

The SVG1.1 spec for SVGLoad event is:
    https://www.w3.org/TR/SVG11/interact.html

The SVG2 spec for the load event is:
    https://www.w3.org/TR/SVG/changes.html#interact
    https://www.w3.org/TR/SVG/interact.html

SVG2 removes the SVGExternalResourcesRequired interface. It also simplifies
the rules for firing the load event and made them consistent with the HTML
specs. The plan is to remove SVGExternalResourcesRequired in a following
patch. This patch makes SVGExternalResourcesRequired have no effect on the
load event firing rules. It moves all the functionalities to SVGURIReference
as a step towards removing the SVGExternalResourcesRequired interface.

Test: svg/custom/image-load-event.html

* dom/Document.cpp:
(WebCore::Document::implicitClose):
Do not use the SVGLoad term. It has been removed from the specs.

* dom/ScriptElement.cpp:
(WebCore::ScriptElement::ScriptElement):
* dom/ScriptElement.h:
(WebCore::ScriptElement::errorOccurred const):
(WebCore::ScriptElement::setErrorOccurred):
Add a method to track the occurrence  of loading error. errorOccurred()
|| haveFiredLoadEvent() means no pending loading activity.

* svg/SVGDocumentExtensions.cpp:
(WebCore::SVGDocumentExtensions::dispatchLoadEventToOutermostSVGElements):
(WebCore::SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements): Deleted.
* svg/SVGDocumentExtensions.h:
Do not use the SVGLoad term.

* svg/SVGElement.cpp:
(WebCore::SVGElement::sendLoadEventIfPossible):
(WebCore::SVGElement::loadEventTimerFired):
(WebCore::SVGElement::loadEventTimer):
(WebCore::SVGElement::finishParsingChildren):
(WebCore::SVGElement::sendSVGLoadEventIfPossible): Deleted.
(WebCore::SVGElement::sendSVGLoadEventIfPossibleAsynchronously): Deleted.
(WebCore::SVGElement::svgLoadEventTimerFired): Deleted.
(WebCore::SVGElement::svgLoadEventTimer): Deleted.
* svg/SVGElement.h:
finishParsingChildren() won't fire 'load' event anymore. The 'load' event
will be fired explicitly for the outermost SVG element from Document::implicitClose().

* svg/SVGExternalResourcesRequired.cpp:
(WebCore::SVGExternalResourcesRequired::svgAttributeChanged):
(WebCore::SVGExternalResourcesRequired::dispatchLoadEvent): Deleted.
(WebCore::SVGExternalResourcesRequired::insertedIntoDocument): Deleted.
(WebCore::SVGExternalResourcesRequired::finishParsingChildren): Deleted.
(WebCore::SVGExternalResourcesRequired::haveLoadedRequiredResources const): Deleted.
* svg/SVGExternalResourcesRequired.h:
(WebCore::SVGExternalResourcesRequired::setHaveFiredLoadEvent): Deleted.
(WebCore::SVGExternalResourcesRequired::isParserInserted const): Deleted.
(WebCore::SVGExternalResourcesRequired::haveFiredLoadEvent const): Deleted.
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::haveLoadedRequiredResources):
* svg/SVGImageLoader.cpp:
(WebCore::SVGImageLoader::dispatchLoadEvent):
The value of externalResourcesRequired() no longer controls firing the
'load' event.

* svg/SVGScriptElement.cpp:
(WebCore::SVGScriptElement::SVGScriptElement):
(WebCore::SVGScriptElement::insertedIntoAncestor):
(WebCore::SVGScriptElement::dispatchErrorEvent):
(WebCore::SVGScriptElement::finishParsingChildren): Deleted.
* svg/SVGScriptElement.h:
dispatchErrorEvent() is now a virtual function. Let SVGScriptElement
overrides it so it can track when the loader finishes its activity.

* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::SVGStyleElement):
* svg/SVGStyleElement.h:

* svg/SVGURIReference.cpp:
(WebCore::SVGURIReference::contextElement const):
(WebCore::SVGURIReference::parseAttribute):
(WebCore::SVGURIReference::haveLoadedRequiredResources const):
(WebCore::SVGURIReference::dispatchLoadEvent):
* svg/SVGURIReference.h:
(WebCore::SVGURIReference::haveFiredLoadEvent const):
(WebCore::SVGURIReference::setHaveFiredLoadEvent):
(WebCore::SVGURIReference::errorOccurred const):
(WebCore::SVGURIReference::setErrorOccurred):
SVGURIReference will decide whether the 'load' event can be fired or not.

* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::SVGUseElement):
(WebCore::SVGUseElement::insertedIntoAncestor):
(WebCore::SVGUseElement::notifyFinished):
(WebCore::SVGUseElement::finishParsingChildren): Deleted.
(WebCore::SVGUseElement::isValid const): Deleted.
(WebCore::SVGUseElement::haveLoadedRequiredResources): Deleted.
(WebCore::SVGUseElement::setHaveFiredLoadEvent): Deleted.
(WebCore::SVGUseElement::haveFiredLoadEvent const): Deleted.
(WebCore::SVGUseElement::svgLoadEventTimer): Deleted.
* svg/SVGUseElement.h:
SVGUseElement needs to track firing the load event or error occurrence
the same way SVGImageElement and SVGScriptElement do.

LayoutTests:

* fast/dom/crash-moving-subtree-between-documents.html:
* fast/dom/focus-style-resolution.html:
* fast/html/marquee-reparent-check.html:
The SVGElement element should not fire "load" event. Set the HTML <body>
element's "onload" event handler to be the function which was set to the
SVGElement's "onload" event handler.

* svg/custom/image-load-event-expected.html: Added.
* svg/custom/image-load-event.html: Added.
Images with external resources or data URIs must fire load events once
the data is loaded or decoded.

* svg/custom/loadevents-async-expected.txt: Removed.
* svg/custom/loadevents-async.html: Removed.
* svg/custom/loadevents-capturing-expected.txt: Removed.
* svg/custom/loadevents-capturing.svg: Removed.
* svg/custom/loadevents-externalresourcesrequired-displaynone-expected.txt: Removed.
* svg/custom/loadevents-externalresourcesrequired-displaynone.svg: Removed.
* svg/custom/loadevents-externalresourcesrequired-expected.txt: Removed.
* svg/custom/loadevents-externalresourcesrequired.svg: Removed.
* svg/custom/loadevents-normal-displaynone-expected.txt: Removed.
* svg/custom/loadevents-normal-displaynone.svg: Removed.
* svg/custom/loadevents-normal-expected.txt: Removed.
* svg/custom/loadevents-normal.svg: Removed.
These tests were implementing the SVG1.1 SVGLoad event interactivity:
https://www.w3.org/TR/SVG11/interact.html where every SVG element had to
fire the SVGLoad event once it parsed its closing tag. SVG structurally
external elements were firing load events when the corresponding external
resources had finished loading but only if externalResourcesRequired = true.

* svg/dom/SVGScriptElement/script-load-and-error-events.svg:
This test had two wrong assumptions:
1) The SVG structurally external element fires a load event when parsing
the children finishes. Then they may fire another load or error event if
externalResourcesRequired = true.
2) The outermost SVG element will not fire its load event unless all the
children fires their load events correctly.

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

6 weeks agoElementRuleCollector function signature cleanups
antti@apple.com [Fri, 18 Oct 2019 18:08:43 +0000 (18:08 +0000)]
ElementRuleCollector function signature cleanups
https://bugs.webkit.org/show_bug.cgi?id=203153

Reviewed by Zalan Bujtas.

Many functions in ElementRuleCollector take repetitive arguments that can be removed:

- Make includeEmptyRules argument a class member
- Remove RuleRange argument, update the ranges in rule transfer step.

* css/ElementRuleCollector.cpp:
(WebCore::MatchRequest::MatchRequest):
(WebCore::ElementRuleCollector::addMatchedRule):
(WebCore::ElementRuleCollector::collectMatchingRules):
(WebCore::ElementRuleCollector::sortAndTransferMatchedRules):
(WebCore::ElementRuleCollector::transferMatchedRules):
(WebCore::ElementRuleCollector::matchAuthorRules):
(WebCore::ElementRuleCollector::matchesAnyAuthorRules):
(WebCore::ElementRuleCollector::collectMatchingAuthorRules):
(WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
(WebCore::ElementRuleCollector::matchHostPseudoClassRules):
(WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
(WebCore::ElementRuleCollector::matchPartPseudoElementRules):
(WebCore::ElementRuleCollector::matchPartPseudoElementRulesForScope):
(WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
(WebCore::ElementRuleCollector::collectSlottedPseudoElementRulesForSlot):
(WebCore::ElementRuleCollector::matchUserRules):
(WebCore::ElementRuleCollector::matchUARules):
(WebCore::ElementRuleCollector::collectMatchingRulesForList):
(WebCore::ElementRuleCollector::matchAllRules):
(WebCore::ElementRuleCollector::hasAnyMatchingRules):
* css/ElementRuleCollector.h:
(WebCore::ElementRuleCollector::setIncludeEmptyRules):
(WebCore::ElementRuleCollector::transferMatchedRules):

Range update happens now here based on the supplied argument.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::pseudoStyleForElement):
(WebCore::StyleResolver::pseudoStyleRulesForElement):

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

6 weeks agoREGRESSION (r251262): Layout Test scrollingcoordinator/ios/non-stable-viewport-scroll...
russell_e@apple.com [Fri, 18 Oct 2019 17:35:21 +0000 (17:35 +0000)]
REGRESSION (r251262): Layout Test scrollingcoordinator/ios/non-stable-viewport-scroll.html is a Flaky Failure
https://bugs.webkit.org/show_bug.cgi?id=203157

Unreviewed Test Gardening.

* platform/ios-simulator-wk2/TestExpectations: Marked
scrollingcoordinator/ios/non-stable-viewport-scroll.html as flaky

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

6 weeks ago[iOS] Layout Test http/tests/resourceLoadStatistics/website-data-removal-for-site...
commit-queue@webkit.org [Fri, 18 Oct 2019 16:58:47 +0000 (16:58 +0000)]
[iOS] Layout Test http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html is frequently failing or timing out (198185)
https://bugs.webkit.org/show_bug.cgi?id=198185
<rdar://problem/51074251>

Patch by Kate Cheney <katherine_cheney@apple.com> on 2019-10-18
Reviewed by Youenn Fablet.

Fixes a flaky failure caused by test results being checked before data
records have finished processing. This patch uses a callback to
ensure data processing has finished before continuing.

* http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html:
* platform/ios-wk2/TestExpectations:

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

6 weeks agoREGRESSION: Layout Test webgl/many-contexts.html is a flaky timeout on Mojave
tsavell@apple.com [Fri, 18 Oct 2019 16:28:13 +0000 (16:28 +0000)]
REGRESSION: Layout Test webgl/many-contexts.html is a flaky timeout on Mojave
https://bugs.webkit.org/show_bug.cgi?id=198867

Unreviewed test gardening

* platform/mac/TestExpectations:

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

6 weeks ago[CSS Shadow Parts] :part rules should be able to override style attribute
antti@apple.com [Fri, 18 Oct 2019 16:20:17 +0000 (16:20 +0000)]
[CSS Shadow Parts] :part rules should be able to override style attribute
https://bugs.webkit.org/show_bug.cgi?id=202919

Reviewed by Zalan Bujtas.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-shadow-parts/simple-inline-expected.txt:

Source/WebCore:

Element inline style was simply appended to the matching declaration list and not sorted with the rest of the author style.
This used to work because before CSS Shadow Parts feature inline style would always win.

Fixing this involves refactoring the rule collection code to remove this assumption.

* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::addMatchedRule):

Both initialize and update ranges here.

(WebCore::ElementRuleCollector::clearMatchedRules):
(WebCore::ElementRuleCollector::addElementStyleProperties):

Both initialize and update ranges here.

(WebCore::ElementRuleCollector::sortAndTransferMatchedRules):

Split out transfering to a separate function.

(WebCore::ElementRuleCollector::transferMatchedRules):

Add a parameter to limit transfer to rules from a scope.

(WebCore::ElementRuleCollector::matchAuthorRules):
(WebCore::ElementRuleCollector::matchesAnyAuthorRules):

Replace hasMatchedRules() with a more specific function. This can use collectMatchingAuthorRules and avoids unnecessary sorting step.

(WebCore::ElementRuleCollector::collectMatchingAuthorRules):

Split out collecting the rules from matchAuthorRules. Like other collect functions, this doesn't do any sorting.

(WebCore::ElementRuleCollector::matchAllRules):

Add element inline style before transfering rules from the containing host scope.

(WebCore::ElementRuleCollector::addElementInlineStyleProperties):

Factor adding inline style into a function.

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

6 weeks ago[LFC][TFC] Include horizontal spacing when checking for the extra horizontal space
zalan@apple.com [Fri, 18 Oct 2019 16:14:28 +0000 (16:14 +0000)]
[LFC][TFC] Include horizontal spacing when checking for the extra horizontal space
https://bugs.webkit.org/show_bug.cgi?id=203154
<rdar://problem/56408032>

Reviewed by Antti Koivisto.

* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):

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

6 weeks ago[LFC][TFC] Fix table's total horizontal spacing computation
zalan@apple.com [Fri, 18 Oct 2019 16:12:44 +0000 (16:12 +0000)]
[LFC][TFC] Fix table's total horizontal spacing computation
https://bugs.webkit.org/show_bug.cgi?id=203151
<rdar://problem/56406930>

Reviewed by Antti Koivisto.

The horizontal spacing value sets the gaps between
1. first column and the left edge of the table's content box
2. between 2 columns
3. last column and the right edge of the table's content box
In case of 'n' columns, the number of gaps is 'n + 1'.

* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::totalHorizontalSpacing const):

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

6 weeks ago[LFC][TFC] Cache table's width constraint values.
zalan@apple.com [Fri, 18 Oct 2019 16:11:34 +0000 (16:11 +0000)]
[LFC][TFC] Cache table's width constraint values.
https://bugs.webkit.org/show_bug.cgi?id=203135
<rdar://problem/56396352>

Reviewed by Antti Koivisto.

This patch ensures that when computedIntrinsicWidthConstraints is called from both the preferred width and the actual layout codepaths during a layout frame, we don't
end up building up the grid twice.

* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
* layout/tableformatting/TableGrid.cpp:
(WebCore::Layout::TableGrid::widthConstraints):
(WebCore::Layout::TableGrid::widthConstraints const): Deleted.
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::hasComputedWidthConstraints const):

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

6 weeks ago[LFC][BFC] TableFormattingContext::computedIntrinsicWidthConstraints should not expec...
zalan@apple.com [Fri, 18 Oct 2019 16:09:41 +0000 (16:09 +0000)]
[LFC][BFC] TableFormattingContext::computedIntrinsicWidthConstraints should not expect a valid containing block's width
https://bugs.webkit.org/show_bug.cgi?id=203131
<rdar://problem/56394676>

Reviewed by Antti Koivisto.

When TableFormattingContext::computedIntrinsicWidthConstraints is called by the preferred width computation (<div style="float: left"><table>)
the containing block's width is not yet set (it gets computed based on the preferred width) so computedIntrinsicWidthConstraints should not be relying
on it. Let's move that logic out to TableFormattingContext::layoutInFlowContent() where it belongs.

* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutInFlowContent):
(WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::TableFormattingContext::ensureTableGrid):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
(WebCore::Layout::TableFormattingContext::computedTableWidth): Deleted.
(WebCore::Layout::TableFormattingContext::distributeExtraHorizontalSpace): Deleted.
* layout/tableformatting/TableFormattingContext.h:

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

6 weeks ago[LFC][BFC] Fix block level formatting root inflow box height computation
zalan@apple.com [Fri, 18 Oct 2019 14:54:47 +0000 (14:54 +0000)]
[LFC][BFC] Fix block level formatting root inflow box height computation
https://bugs.webkit.org/show_bug.cgi?id=203085
<rdar://problem/56372306>

Reviewed by Antti Koivisto.

Section 10.6.7 (https://www.w3.org/TR/CSS22/visudet.html#root-height) defines the height computation for block level formatting context roots.
We already use it for floats, out-of-flow and block level boxes when overflow computes to not "visible".
This patch makes generic in-flow non-replaced BFC roots (e.g. principal block container box for <table>) compute their heights according to 10.6.7.

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

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

6 weeks ago[Clipboard API] Support navigator.clipboard.read()
wenson_hsieh@apple.com [Fri, 18 Oct 2019 14:24:07 +0000 (14:24 +0000)]
[Clipboard API] Support navigator.clipboard.read()
https://bugs.webkit.org/show_bug.cgi?id=203021

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline a web platform test, now that Clipboard.read() no longer immediately rejects.

* web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https-expected.txt:

Source/WebCore:

Add support for navigator.clipboard.read(), which returns a promise that resolves to a list of ClipboardItems.
See below for more details.

Tests: editing/async-clipboard/clipboard-change-data-while-reading.html
       editing/async-clipboard/clipboard-read-basic.html

* Modules/async-clipboard/Clipboard.cpp:
(WebCore::Clipboard::read):

Implement read(). This makes two calls to the platform pasteboard: the first to get the current change count,
and if the change count is different from the changeCount used for the last read() call (or there are no
existing clipboard items being tracked), then we request pasteboard item information for all items on the
pasteboard, and use this information to create new clipboard items. Otherwise, if the changeCount is still valid
for the current list of clipboard items, simply return these clipboard items.

If the changeCount ends up being different in between the initial changeCount request and when the pasteboard
item information is received, we immediately bail with a NotAllowedError. The new layout test
clipboard-change-data-while-reading.html exercises this scenario.

(WebCore::Clipboard::getType):
(WebCore::Clipboard::frame const):
* Modules/async-clipboard/Clipboard.h:
* Modules/async-clipboard/ClipboardItem.cpp:
(WebCore::ClipboardItem::blobFromString):
(WebCore::ClipboardItem::ClipboardItem):
(WebCore::ClipboardItem::create):
(WebCore::ClipboardItem::navigator):

Refactor this so that each clipboard item itself has a WeakPtr to its Navigator. This avoids having to follow
the weak pointer to the Clipboard to get to the Clipboard's navigator during garbage collection when computing
reachability from opaque roots, since this may happen on a background (GC) thread.

(WebCore::ClipboardItem::clipboard):
* Modules/async-clipboard/ClipboardItem.h:
* Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp:
(WebCore::ClipboardItemBindingsDataSource::getType):
(WebCore::blobFromString): Deleted.

Move this to ClipboardItem, and make it a static method.

* Modules/async-clipboard/ClipboardItemPasteboardDataSource.cpp:
(WebCore::ClipboardItemPasteboardDataSource::ClipboardItemPasteboardDataSource):
(WebCore::ClipboardItemPasteboardDataSource::getType):
* Modules/async-clipboard/ClipboardItemPasteboardDataSource.h:

Move a couple of member variables (index and changeCount) out of ClipboardItem. Instead of having each
ClipboardItem keep track of this information, have the Clipboard that owns the ClipboardItem keep this
information. This means that reading data from ClipboardItem will (in a future patch) work by having the item
ask its Clipboard object to read data on its behalf.

* platform/Pasteboard.cpp:
(WebCore::Pasteboard::allPasteboardItemInfo const):
(WebCore::Pasteboard::pasteboardItemInfo const):
(WebCore::Pasteboard::readString):
(WebCore::Pasteboard::readBuffer):
(WebCore::Pasteboard::readURL):

Add some null checks to handle the case where there is no pasteboard strategy.

Tools:

Make adjustments to WebKitTestRunner and DumpRenderTree to support the new layout tests. See below for more
details.

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/mac/DumpRenderTreePasteboard.mm:
(-[LocalPasteboard pasteboardItems]):

Fixes an existing issue with the mock NSPasteboard used for layout tests. Currently, our logic for converting
the contents of the platform pasteboard to NSPasteboardItem simply writes the pasteboard data as-is to
NSPasteboardItems. However, these pasteboard types may be legacy pasteboard types, in which case
NSPasteboardItem will simply handle the call to `-setData:forType:` as a no-op. AppKit has logic in this
scenario to canonicalize these legacy pasteboard types to their modern counterparts, but this is absent in
DumpRenderTreePasteboard and WebKitTestRunnerPasteboard.

Address this by teaching the mock pasteboards to convert legacy types to modern types when generating platform
pasteboard items.

* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.h:
(WTR::UIScriptController::copyText):

Add a new UIScriptController method to write a string to the platform pasteboard. This patch adds support for
this new testing hook on macOS and iOS, in WebKit2 (WebKitTestRunner).

* TestRunnerShared/mac/NSPasteboardAdditions.h: Copied from Tools/WebKitTestRunner/mac/UIScriptControllerMac.h.
* TestRunnerShared/mac/NSPasteboardAdditions.mm: Added.
(+[NSPasteboard _modernPasteboardType:]):

Add a helper to convert legacy pasteboard types (and dynamic UTIs that map to legacy pasteboard types) to
modern pasteboard types, suitable for writing to NSPasteboardItems on macOS.

* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* WebKitTestRunner/ios/UIScriptControllerIOS.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptControllerIOS::copyText):
* WebKitTestRunner/mac/UIScriptControllerMac.h:
* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptControllerMac::copyText):
* WebKitTestRunner/mac/WebKitTestRunnerPasteboard.mm:

Apply the same fix for WebKitTestRunner's mock NSPasteboard.

(-[LocalPasteboard _clearContentsWithoutUpdatingChangeCount]):
(-[LocalPasteboard clearContents]):

Make -clearContents clear out all the contents on the mock pasteboard, instead of crashing in AppKit.

(-[LocalPasteboard declareTypes:owner:]):
(-[LocalPasteboard pasteboardItems]):

LayoutTests:

* editing/async-clipboard/clipboard-change-data-while-reading-expected.txt: Added.
* editing/async-clipboard/clipboard-change-data-while-reading.html: Added.

Add a new layout test to verify that if the platform pasteboard changes in the middle of a DOM paste access
request, the promise returned by Clipboard.read() should reject, and the page should not receive any clipboard
items.

* editing/async-clipboard/clipboard-read-basic-expected.txt: Added.
* editing/async-clipboard/clipboard-read-basic.html: Added.

Add a new layout test to exercise Clipboard.read(). Since we don't support reading data from clipboard items
yet, this only checks the types of each pasteboard item. This test additionally ensures that the ClipboardItems
returned from the API are the same between calls to Clipboard.read() if the data hasn't changed.

* editing/async-clipboard/resources/async-clipboard-helpers.js:
(writeToClipboardUsingDataTransfer):

Add a new helper to synchronously write data to the clipboard using execCommand and DataTransfer API.

(async.triggerProgrammaticPaste):

Add a new helper to trigger programmatic paste by activating the given element or location. Also receives an
array of options (which, for now, just supports a single option to change the pasteboard when granting DOM paste
access).

* platform/ios-wk1/TestExpectations: Skip clipboard-change-data-while-reading.html for now in WebKit1.
* platform/mac-wk1/TestExpectations: Skip clipboard-change-data-while-reading.html for now in WebKit1.
* platform/win/TestExpectations: Skip the new layout tests on Windows for now.

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

6 weeks agoAvoid crashes on GCC-compiled binaries by avoiding a use-after-move
zandobersek@gmail.com [Fri, 18 Oct 2019 10:40:34 +0000 (10:40 +0000)]
Avoid crashes on GCC-compiled binaries by avoiding a use-after-move
that's the result of differring call conventions.

Rubber-stamped by Carlos Garcia Campos.

* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::startFetch): Copy the SW identifier from
the ServiceWorkerFetchTask before it's moved into the lambda.

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

7 weeks agoUpdate libwebrtc third-party abseilcpp to M78
youenn@apple.com [Fri, 18 Oct 2019 08:35:09 +0000 (08:35 +0000)]
Update libwebrtc third-party abseilcpp to M78
https://bugs.webkit.org/show_bug.cgi?id=202726
<rdar://problem/56147823>

Unreviewed.

* Source/third_party/abseil-cpp/absl/strings/string_view.h:
(absl::string_view::CheckLengthInternal):
Build fix for debug bots.

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

7 weeks ago[Clang][Windows] Options.cpp(317,25): error: no matching function for call to 'option...
Hironori.Fujii@sony.com [Fri, 18 Oct 2019 08:29:51 +0000 (08:29 +0000)]
[Clang][Windows] Options.cpp(317,25): error: no matching function for call to 'optionTypeSpecificIndex'
https://bugs.webkit.org/show_bug.cgi?id=203142

Unreviewed build fix

clang-cl reported a compilation error for MSVC bug workaround code of optionTypeSpecificIndex.

runtime\Options.cpp(294,12): error: variables defined in a constexpr function must be initialized
    size_t index;
           ^
* runtime/Options.cpp:
(JSC::optionTypeSpecificIndex): Initialize the variable 'index'.

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

7 weeks agoDon't put pages that have not reached the non-visually empty layout milestone in...
cdumez@apple.com [Fri, 18 Oct 2019 05:01:50 +0000 (05:01 +0000)]
Don't put pages that have not reached the non-visually empty layout milestone in the back/forward cache
https://bugs.webkit.org/show_bug.cgi?id=203108
<rdar://problem/56375671>

Reviewed by Geoff Garen.

Source/WebCore:

We don't want to go back to a visually empty page on back/forward navigation.

* history/BackForwardCache.cpp:
(WebCore::canCacheFrame):
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::visuallyEmptyKey):
* page/DiagnosticLoggingKeys.h:

LayoutTests:

* http/tests/navigation/page-cache-pending-load.html:
Tweak test to add the stylesheet to the body instead of the head since a document
with a pending stylesheet before the body qualifies as visually empty. The test
would be flaky otherwise.

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

7 weeks agoAdd missing checks after calls to the sameValue() JSValue comparator.
mark.lam@apple.com [Fri, 18 Oct 2019 04:35:28 +0000 (04:35 +0000)]
Add missing checks after calls to the sameValue() JSValue comparator.
https://bugs.webkit.org/show_bug.cgi?id=203126
<rdar://problem/56366561>

Reviewed by Saam Barati.

JSTests:

* stress/validate-exception-check-in-proxy-object-put.js: Added.

Source/JavaScriptCore:

* runtime/JSFunction.cpp:
(JSC::JSFunction::defineOwnProperty):
* runtime/JSObject.cpp:
(JSC::JSObject::defineOwnIndexedProperty):
(JSC::validateAndApplyPropertyDescriptor):
* runtime/PropertyDescriptor.cpp:
(JSC::PropertyDescriptor::equalTo const):
* runtime/ProxyObject.cpp:
(JSC::performProxyGet):
(JSC::ProxyObject::performPut):
(JSC::ProxyObject::performSetPrototype):
(JSC::ProxyObject::performGetPrototype):
* runtime/RegExpObject.cpp:
(JSC::RegExpObject::defineOwnProperty):

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

7 weeks agoOnly include "deep color" in layer tree dumps if a tests requests it
simon.fraser@apple.com [Fri, 18 Oct 2019 04:24:09 +0000 (04:24 +0000)]
Only include "deep color" in layer tree dumps if a tests requests it
https://bugs.webkit.org/show_bug.cgi?id=203125

Reviewed by Tim Horton.
Source/WebCore:

Layer tree dumping tests can fail when run on different devices because the "deep color"
property on layers is device-dependent. Stop dumping this by default, and have one test
that sets the bit. iphone-7 is the only device we test that has deep color support.

Tests: compositing/contents-format/deep-color-backing-store.html
       compositing/contents-format/ipad/deep-color-backing-store.html
       compositing/contents-format/iphone-7/deep-color-backing-store.html

* page/Frame.h:
* platform/graphics/GraphicsLayerClient.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerTreeAsText):
* testing/Internals.cpp:
(WebCore::toLayerTreeFlags):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* TestExpectations:
* compositing/contents-format/deep-color-backing-store-expected.txt: Copied from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color-expected.txt.
* compositing/contents-format/deep-color-backing-store.html: Copied from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color.html.
* compositing/contents-format/ipad/deep-color-backing-store-expected.txt: Copied from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color-expected.txt.
* compositing/contents-format/ipad/deep-color-backing-store.html: Copied from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color.html.
* compositing/contents-format/iphone-7/deep-color-backing-store-expected.txt: Copied from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color-expected.txt.
* compositing/contents-format/iphone-7/deep-color-backing-store.html: Renamed from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color.html.
* platform/ipad/TestExpectations:
* platform/iphone-7/TestExpectations: Added.
* platform/mac-wk1/compositing/contents-format/deep-color-backing-store-expected.txt: Renamed from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color-expected.txt.

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

7 weeks agoREGRESSION (r243347) Layout tests fast/events/touch/ios/drag-block-without-overflow...
simon.fraser@apple.com [Fri, 18 Oct 2019 02:27:01 +0000 (02:27 +0000)]
REGRESSION (r243347) Layout tests fast/events/touch/ios/drag-block-without-overflow-scroll-and-passive-observer-on* are flakey
https://bugs.webkit.org/show_bug.cgi?id=203122
rdar://problem/50058173

Reviewed by Wenson Hsieh.

Rewrite these tests to wait for scrolling to finish, since the overflow is now accelerated and we need
to wait for momentum to end.

Also have them use UIHelper, factoring a function to work with overflow as well as document scroll.

* fast/events/touch/ios/drag-block-without-overflow-scroll-and-passive-observer-on-block-expected.txt:
* fast/events/touch/ios/drag-block-without-overflow-scroll-and-passive-observer-on-block.html:
* fast/events/touch/ios/drag-block-without-overflow-scroll-and-passive-observer-on-document-expected.txt:
* fast/events/touch/ios/drag-block-without-overflow-scroll-and-passive-observer-on-document.html:
* resources/ui-helper.js:
(window.UIHelper.callFunctionAndWaitForEvent):
(window.UIHelper.callFunctionAndWaitForScrollToFinish):
(window.UIHelper.callFunctionAndWaitForTargetScrollToFinish.return.new.Promise):
(window.UIHelper.callFunctionAndWaitForTargetScrollToFinish):
(window.UIHelper.callFunctionAndWaitForScrollToFinish.return.new.Promise): Deleted.

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

7 weeks agoGetByVal and PutByVal on ArrayStorage need to use the same AbstractHeap
sbarati@apple.com [Fri, 18 Oct 2019 00:42:25 +0000 (00:42 +0000)]
GetByVal and PutByVal on ArrayStorage need to use the same AbstractHeap
https://bugs.webkit.org/show_bug.cgi?id=203124
<rdar://problem/55988183>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/licm-array-storage-get-and-put-by-val.js: Added.
(assert):
(foo):

Source/JavaScriptCore:

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

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

7 weeks agoctx.font = "" asserts in CSS parser
dino@apple.com [Fri, 18 Oct 2019 00:29:33 +0000 (00:29 +0000)]
ctx.font = "" asserts in CSS parser
https://bugs.webkit.org/show_bug.cgi?id=203127
<rdar://problem/56391016>

Reviewed by Devin Rousso.

Source/WebCore:

The HTML specification says:
"values that cannot be parsed as CSS font values are ignored", so
return early if we get an empty string, otherwise the CSS parser
will assert. This was the only case I could find where we sidestepped
most of the parsing infrastructure and injected a raw string.

Test: http/wpt/2dcontext/text-styles/2d.text.font.parse.invalid.html

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setFont):

LayoutTests:

Copy the updated test from my WPT pull request. Once this
is merged into WPT, we won't need this version.

* http/wpt/2dcontext/text-styles/2d.text.font.parse.invalid-expected.txt: Added.
* http/wpt/2dcontext/text-styles/2d.text.font.parse.invalid.html: Added.
* http/wpt/resources/canvas-tests.css: Added.
* http/wpt/resources/canvas-tests.js: Added.

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

7 weeks agoIntegrate resize event with HTML5 event loop
rniwa@webkit.org [Fri, 18 Oct 2019 00:15:28 +0000 (00:15 +0000)]
Integrate resize event with HTML5 event loop
https://bugs.webkit.org/show_bug.cgi?id=202964

Reviewed by Geoffrey Garen.

Source/WebCore:

Dispatch resize events in "run the resize steps" during the "update the rendering":
https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering

Exisitng code in WebCore which was dispatching or scheduling dispatching of resize events now simply sets
a flag on document and schedules a rendering update. In Page::updateRendering, we fire resize events on
any documents with this flag set.

Test: fast/events/resize-subframe-in-rendering-update.html

* dom/Document.cpp:
(WebCore::Document::setNeedsDOMWindowResizeEvent): Added.
(WebCore::Document::setNeedsVisualViewportResize): Added.
(WebCore::Document::runResizeSteps): Added. https://drafts.csswg.org/cssom-view/#run-the-resize-steps
* dom/Document.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::resizeTo const):
* page/FrameView.cpp:
(WebCore::FrameView::sendResizeEventIfNeeded): Now sets m_needsDOMWindowResizeEvent on Document instead of
enqueuing a resize event.
* page/Page.cpp:
(WebCore::Page::updateRendering): Call runResizeSteps on each document.
(WebCore::Page::collectDocuments): Added.
* page/Page.h:
* page/VisualViewport.cpp:
(WebCore::VisualViewport::enqueueResizeEvent):

LayoutTests:

Added a regression test and fixed an existing test to work with the new behavior.

* fast/events/resize-subframe-in-rendering-update-expected.txt: Added.
* fast/events/resize-subframe-in-rendering-update.html: Added.
* fast/shadow-dom/trusted-event-scoped-flags.html:

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

7 weeks ago[bmalloc] Bug fix for wait time when it's in mini mode.
Basuke.Suzuki@sony.com [Fri, 18 Oct 2019 00:02:10 +0000 (00:02 +0000)]
[bmalloc] Bug fix for wait time when it's in mini mode.
https://bugs.webkit.org/show_bug.cgi?id=203121

Reviewed by Yusuke Suzuki.

Since r243144, m_waitTime is never changed on mini mode.

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

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

7 weeks agoUnreviewed, rolling out r251255.
cdumez@apple.com [Thu, 17 Oct 2019 23:42:09 +0000 (23:42 +0000)]
Unreviewed, rolling out r251255.

This is causing the existing back/forward tests to be flaky

Reverted changeset:

"Don't put pages that have not reached the non-visually empty
layout milestone in the back/forward cache"
https://bugs.webkit.org/show_bug.cgi?id=203108
https://trac.webkit.org/changeset/251255

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

7 weeks agoLand a missing test baseline
timothy_horton@apple.com [Thu, 17 Oct 2019 23:38:19 +0000 (23:38 +0000)]
Land a missing test baseline

* fast/forms/ios/inputmode-none-with-hardware-keyboard-expected.txt: Added.

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

7 weeks agoHave a CLI version of JetStream 2 to run on watchOS
sbarati@apple.com [Thu, 17 Oct 2019 22:53:44 +0000 (22:53 +0000)]
Have a CLI version of JetStream 2 to run on watchOS
https://bugs.webkit.org/show_bug.cgi?id=202998
<rdar://problem/56208554>

Reviewed by Tadeu Zagallo.

This patch adds a CLI version of JS2 to run on watchOS. We run most subtests
from the browser version of JS2, but skip a few tests that are particularly
long running, like WSL and some of WTB. We also don't run the Wasm tests
as we don't JIT on watchOS. Each test runs for fewer iterations in the watch
version. 15 is the default iteration count. This benchmark runs in 7 minutes on
a Series 4 watch.

* JetStream2/JetStreamDriver.js:
(getIterationCount):
(getWorstCaseCount):
(Driver.prototype.async.start):
(Driver.prototype.resultsJSON):
(Driver.prototype.dumpJSONResultsIfNeeded):
(Driver.prototype.async.reportScoreToRunBenchmarkRunner):
(DefaultBenchmark):
* JetStream2/RexBench/UniPoker/benchmark.js:
(Benchmark.prototype.validate):
(Benchmark):
* JetStream2/watch-cli.js: Added.

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

7 weeks agoHarden capacity checks in DFG::LocalCSEPhase::SmallMap.
mark.lam@apple.com [Thu, 17 Oct 2019 22:45:35 +0000 (22:45 +0000)]
Harden capacity checks in DFG::LocalCSEPhase::SmallMap.
https://bugs.webkit.org/show_bug.cgi?id=203123
<rdar://problem/56339943>

Change addPure() and addImpure() to use RELEASE_ASSERT in their capacity checks.

Reviewed by Keith Miller.

* dfg/DFGCSEPhase.cpp:

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

7 weeks agoUse constexpr in more places and remove some unnecessary external linkage.
mark.lam@apple.com [Thu, 17 Oct 2019 22:18:57 +0000 (22:18 +0000)]
Use constexpr in more places and remove some unnecessary external linkage.
https://bugs.webkit.org/show_bug.cgi?id=203115

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

* API/JSWrapperMap.mm:
* heap/MarkedBlock.cpp:
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::appendAPIBacktrace):
* inspector/ScriptCallStack.h:
* interpreter/CLoopStack.h:
* interpreter/CallFrame.h:
* interpreter/ShadowChicken.h:
* jit/AssemblyHelpers.cpp:
(JSC::emitRandomThunkImpl):
* jit/GPRInfo.cpp:
* jit/GPRInfo.h:
* jit/JIT.h:
* jit/PCToCodeOriginMap.cpp:
* jit/SpecializedThunkJIT.h:
* jit/ThunkGenerators.cpp:
(JSC::roundThunkGenerator):
* jit/UnusedPointer.h:
* llint/LLIntData.h:
* llint/LLIntPCRanges.h:
* parser/Lexer.h:
* parser/Nodes.h:
* runtime/CodeCache.cpp:
* runtime/CodeCache.h:
* runtime/ErrorInstance.h:
* runtime/JSAsyncFunction.h:
* runtime/JSAsyncGeneratorFunction.h:
* runtime/JSBoundFunction.h:
* runtime/JSCallee.h:
* runtime/JSFunction.h:
* runtime/JSGeneratorFunction.h:
* runtime/JSNativeStdFunction.h:
* runtime/JSRunLoopTimer.cpp:
(): Deleted.
* runtime/JSRunLoopTimer.h:
* runtime/ProxyObject.h:
* runtime/Watchdog.cpp:
(): Deleted.
* runtime/Watchdog.h:
* wasm/js/WebAssemblyFunction.h:
* wasm/js/WebAssemblyFunctionBase.h:
* wasm/js/WebAssemblyWrapperFunction.h:

Source/WebCore:

No new tests because this patch adds no new functionality.

* html/track/TextTrackCueGeneric.cpp:
* html/track/VTTCue.cpp:
* page/EventHandler.cpp:
(WebCore::SyntheticTouchPoint::SyntheticTouchPoint):
* page/FrameTree.h:
* page/scrolling/ScrollingMomentumCalculator.cpp:
(WebCore::projectedInertialScrollDistance):
* platform/graphics/FontTaggedSettings.h:
* platform/graphics/Region.cpp:
* platform/graphics/filters/FELighting.cpp:
* rendering/TableLayout.h:
* rendering/svg/SVGRenderingContext.h:

Source/WebKit:

* UIProcess/API/APIContentRuleListStore.h:
* WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:

Source/WTF:

Also removed unused lockSpinLimit in Threading.h.

* wtf/MD5.h:
* wtf/SHA1.h:
* wtf/StackBounds.h:
* wtf/Threading.h:

Tools:

* TestWebKitAPI/Tests/WTF/WeakPtr.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/mac/IsNavigationActionTrusted.mm:

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

7 weeks ago[ Mojave+ ] Layout Test compositing/fixed-with-main-thread-scrolling.html is a flaky...
simon.fraser@apple.com [Thu, 17 Oct 2019 22:15:09 +0000 (22:15 +0000)]
[ Mojave+ ] Layout Test compositing/fixed-with-main-thread-scrolling.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=198757

Reviewed by Tim Horton.

Source/WebCore:

WheelEventTestMonitor depends on "deferral reasons" getting added and removed, such that there is always
at least one reason active until scrolling quiesces.

WheelEventTestMonitor made the incorrect assumption that every call into ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent()
would result in a scroll change making it to the main thread, so it would defer "ScrollingThreadSyncNeeded" there,
and rely on AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll() to remove that deferral reason.
That assumption is wrong, because wheel events may coalesce, or have no impact on scroll position if already scrolled
to the max/min extent (e.g. when rubber banding).

Fix by adding a new "HandlingWheelEvent" deferral reason for the duration that the scrolling thread is processing an wheel event,
and then having ScrollingThreadSyncNeeded just represent the phase where any resulting scroll is being sent to the UI process.
These phases should always overlap.

This required moving isMonitoringWheelEvents() from the root scrolling node to the ScrollingTree.

* page/WheelEventTestMonitor.cpp:
(WebCore::operator<<):
* page/WheelEventTestMonitor.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::isMonitoringWheelEvents const):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):

LayoutTests:

Remove expectation for compositing/fixed-with-main-thread-scrolling.html.

* platform/mac-wk2/TestExpectations:

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

7 weeks agoUsing version 1 CFRunloopSource for faster task dispatch
sihui_liu@apple.com [Thu, 17 Oct 2019 22:05:24 +0000 (22:05 +0000)]
Using version 1 CFRunloopSource for faster task dispatch
https://bugs.webkit.org/show_bug.cgi?id=202874

Reviewed by Geoffrey Garen.

Source/WTF:

We used CFRunLoopWakeUp to wake up runloop to process source, which seems to be slow according to profiling. To
avoid calling CFRunLoopWakeUp, we should use version 1 CFRunloopSource instead of version 0. This patch brings
about 15% speedup for test PerformanceTests/IndexedDB/basic/objectstore-get.html.

* wtf/RunLoop.cpp:
(WTF::RunLoop::initializeWebRunLoop):
(WTF::RunLoop::web):
* wtf/RunLoop.h:
* wtf/cf/RunLoopCF.cpp:
(WTF::RunLoop::performWork):
(WTF::RunLoop::RunLoop):
(WTF::RunLoop::~RunLoop):
(WTF::RunLoop::wakeUp):
* wtf/cocoa/MainThreadCocoa.mm:
(WTF::initializeMainThreadPlatform):
(WTF::scheduleDispatchFunctionsOnMainThread):
(WTF::initializeWebThread):
(-[JSWTFMainThreadCaller call]): Deleted.

Tools:

Fix a flaky test.

* TestWebKitAPI/Tests/WebKit/getUserMedia.html:

LayoutTests:

Fix a flaky test.

* inspector/css/pseudo-creation-expected.txt:
* inspector/css/pseudo-creation.html:

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

7 weeks ago[Linux] Avoid usage of <sys/sysctl.h> in MallocBench
aperez@igalia.com [Thu, 17 Oct 2019 21:44:39 +0000 (21:44 +0000)]
[Linux] Avoid usage of <sys/sysctl.h> in MallocBench
https://bugs.webkit.org/show_bug.cgi?id=203109

Reviewed by Carlos Alberto Lopez Perez.

* MallocBench/MallocBench/CPUCount.cpp: Only include <sys/sysctl.h> if
the sysctl() function will be used.

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

7 weeks agoPython 3: Add support in webkitpy.common.net.buildbot
jbedard@apple.com [Thu, 17 Oct 2019 21:39:27 +0000 (21:39 +0000)]
Python 3: Add support in webkitpy.common.net.buildbot
https://bugs.webkit.org/show_bug.cgi?id=202466

Reviewed by Stephanie Lewis.

* Scripts/test-webkitpy-python3: Add webkitpy.common.net.buildbot to the test list.
* Scripts/webkitpy/common/net/buildbot/buildbot.py:
(Builder.url_encoded_name): Call compatible urllib quote.
(Builder.revision_build_pairs_with_results): Convert iterator to list before returning.
(Build.results_url): Call compatible urllib quote.
(BuildBot._parse_last_build_cell):renderContents needs to be decoded in Python 3.
(BuildBot._parse_current_build_cell): BeautifulSoup and bs4 render breaks differently.
(BuildBot._fetch_build_dictionary): Call compatible urllib quote.
* Scripts/webkitpy/common/net/regressionwindow.py:
(RegressionWindow.revisions): Convert range(...) to list.

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

7 weeks agoMake requestIdleCallback suspendable
rniwa@webkit.org [Thu, 17 Oct 2019 21:22:30 +0000 (21:22 +0000)]
Make requestIdleCallback suspendable
https://bugs.webkit.org/show_bug.cgi?id=203023

Reviewed by Chris Dumez.

Source/WebCore:

Make requestIdleCallback suspendable by making WindowEventLoop itself suspendable.
Because WindowEventLoop can be shared across documents, we don't want to make it an ActiveDOMObject.

Instead, we would make CachedFrameBase::restore and CachedFrame manually invoke suspend & resume.

Test: requestidlecallback/requestidlecallback-in-page-cache.html

* dom/Document.h:
(WebCore::Document::eventLoopIfExists): Added. This should probably go away once most of the event loop
is implemented since we're almost always going to have this object then.
* dom/WindowEventLoop.cpp:
(WebCore::WindowEventLoop::queueTask): Because m_tasks may contain tasks of suspended documents,
we check m_activeTaskCount, which is only positive when there is a task for non-suspended documents,
to decide whether we schedule a callback or not.
(WebCore::WindowEventLoop::suspend): Added. No-op for now.
(WebCore::WindowEventLoop::resume): Added. Schedule a callback if there is a task associated with
this document.
(WebCore::WindowEventLoop::run): Skip a task for a suspended document, and add it back to m_tasks along
with other tasks that got scheduled by running the current working set of tasks.
* dom/WindowEventLoop.h:
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore):
(WebCore::CachedFrame::CachedFrame):

LayoutTests:

* requestidlecallback/requestidlecallback-in-page-cache-expected.txt: Added.
* requestidlecallback/requestidlecallback-in-page-cache.html: Added.
* requestidlecallback/resources: Added.
* requestidlecallback/resources/page-cache-helper.html: Added.

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

7 weeks agoBuild fix for newer versions of MSVC.
bfulgham@apple.com [Thu, 17 Oct 2019 21:20:28 +0000 (21:20 +0000)]
Build fix for newer versions of MSVC.

Rubber stamped by Mark Lam.

Some versions of MSVC optimize the inline optimization of
index away, triggering an uninitialized variable error. This
change avoids this problem.

* runtime/Options.cpp:
(JSC::optionTypeSpecificIndex):

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

7 weeks ago[ews] status bubbles should show details from all the builds in case build is retried
aakash_jain@apple.com [Thu, 17 Oct 2019 21:02:45 +0000 (21:02 +0000)]
[ews] status bubbles should show details from all the builds in case build is retried
https://bugs.webkit.org/show_bug.cgi?id=203117

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-app/ews/views/statusbubble.py:
(StatusBubble._build_bubble): Display messages from all the builds (including retried builds) for a patch on a queue.
(StatusBubble._steps_messages_from_multiple_builds): Method to generate status using information from all the retried builds.
(StatusBubble.get_all_builds_for_queue): Method to get all the builds instead of just the latest one.
(StatusBubble.get_latest_build_for_queue): Modified to use the new get_all_builds_for_queue() method.

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

7 weeks agoDon't put pages that have not reached the non-visually empty layout milestone in...
cdumez@apple.com [Thu, 17 Oct 2019 20:31:36 +0000 (20:31 +0000)]
Don't put pages that have not reached the non-visually empty layout milestone in the back/forward cache
https://bugs.webkit.org/show_bug.cgi?id=203108

Reviewed by Geoffrey Garen.

We don't want to go back to a visually empty page on back/forward navigation.

* history/BackForwardCache.cpp:
(WebCore::canCacheFrame):
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::visuallyEmptyKey):
* page/DiagnosticLoggingKeys.h:

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

7 weeks agoWeb Inspector: Elements: selection shouldn't be dimmed by shadow trees
drousso@apple.com [Thu, 17 Oct 2019 20:21:19 +0000 (20:21 +0000)]
Web Inspector: Elements: selection shouldn't be dimmed by shadow trees
https://bugs.webkit.org/show_bug.cgi?id=203057

Reviewed by Joseph Pecoraro.

* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom li .selection-area):
(.tree-outline.dom li > span): Added.
Don't force the `.selection-area` to be behind (`z-index: -1;`) the rest of the content, as
that also puts it behind any `background-color`. Instead, we should make all the content in
every `WI.DOMTreeElement` be above (`z-index: 1;`) the rest of the content, including the
`.selection-area` and any parent's `background-color`.

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

7 weeks agoRemove duplicate MathML tests
commit-queue@webkit.org [Thu, 17 Oct 2019 19:23:22 +0000 (19:23 +0000)]
Remove duplicate MathML tests
https://bugs.webkit.org/show_bug.cgi?id=202979

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

Commit r251187 removed operators/mo-form-fallback-expected.html by
accident, add it again.

* web-platform-tests/mathml/presentation-markup/operators/mo-form-fallback-expected.html: Added.

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

7 weeks agotransform-box: content-box, stroke-box missing
commit-queue@webkit.org [Thu, 17 Oct 2019 19:21:39 +0000 (19:21 +0000)]
transform-box: content-box, stroke-box missing
https://bugs.webkit.org/show_bug.cgi?id=201892

Patch by Dirk Schulze <krit@webkit.org> on 2019-10-17
Reviewed by Simon Fraser.

Source/WebCore:

Added the keywords content-box and stroke-box to the
transform-box CSS property.
Those keywords were added to the spec after the implementation
in WebKit.

Test: transforms/transform-box.html

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator TransformBox const):
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* rendering/RenderLayer.cpp:
(WebCore::computeReferenceBox):
(WebCore::transformBoxToCSSBoxType):
(WebCore::RenderLayer::currentTransform const):
* rendering/style/RenderStyleConstants.h:
* svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::animatedLocalTransform const):

LayoutTests:

* fast/css/transform-box-parsing.html:
* svg/transforms/svg-transform-box-expected.html:
* svg/transforms/svg-transform-box.html:
* transforms/transform-box-expected.html: Added.
* transforms/transform-box.html: Added.

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

7 weeks ago[iOS Sim] Layout Test scrollingcoordinator/ios/ui-scroll-fixed.html is a flaky failure
simon.fraser@apple.com [Thu, 17 Oct 2019 19:06:21 +0000 (19:06 +0000)]
[iOS Sim] Layout Test scrollingcoordinator/ios/ui-scroll-fixed.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=196612
rdar://problem/49612867

Reviewed by Antti Koivisto.

This test hit a really obscure bug where a combination of an immediate scroll, and
an ancestor reposition left the layer position of a position:fixed layer unchanged.
The position of this layer in the UI process had been previously modified by
the scrolling tree for the scroll, but because the WebContent-side mutations left
the actual position unchanged, we'd never apply a new position via a commit, so left
the layer in the wrong location.

Removing the m_wasScrolledByDelegatedScrollingSincePreviousCommit check in ScrollingTree::applyLayerPositionsAfterCommit()
fixes this, but has perf implications. Alternative fixes require complex state tracking.
Since this is so hard to hit with noisy user scrolling, just change the test to avoid
the perfect storm of scrolls and offsets.

* platform/ios-simulator-wk2/TestExpectations:
* scrollingcoordinator/ios/ui-scroll-fixed-expected.html:
* scrollingcoordinator/ios/ui-scroll-fixed.html:

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

7 weeks ago[GTK] Explicitly use Python 2 in jhbuild-wrapper
emilio@crisal.io [Thu, 17 Oct 2019 18:49:46 +0000 (18:49 +0000)]
[GTK] Explicitly use Python 2 in jhbuild-wrapper
https://bugs.webkit.org/show_bug.cgi?id=202790

Reviewed by Adrian Perez de Castro.

jhbuildutils.py requires Python 2 for the moment, so using just
`python` fails in distros where Python 3 is the default.

* jhbuild/jhbuild-wrapper:

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

7 weeks agoSincResampler does not need to create a new AudioBus for each consumeSource call
youenn@apple.com [Thu, 17 Oct 2019 18:19:03 +0000 (18:19 +0000)]
SincResampler does not need to create a new AudioBus for each consumeSource call
https://bugs.webkit.org/show_bug.cgi?id=202983

Reviewed by Eric Carlson.

Allocate an internal AudioBus once and for all.
No observable change of behavior.

* platform/audio/SincResampler.cpp:
(WebCore::SincResampler::consumeSource):
* platform/audio/SincResampler.h:

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

7 weeks agoAdd libwebrtc third-party pfft
youenn@apple.com [Thu, 17 Oct 2019 18:18:56 +0000 (18:18 +0000)]
Add libwebrtc third-party pfft
https://bugs.webkit.org/show_bug.cgi?id=202733

Reviewed by Eric Carlson.

Initial check-in of pfft which is now used in libwebrtc.

* Source/third_party/pffft: Added.

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

7 weeks agoUnreviewed, rolling out r251231.
tsavell@apple.com [Thu, 17 Oct 2019 18:15:01 +0000 (18:15 +0000)]
Unreviewed, rolling out r251231.

This test is still very flakey on all platforms.

Reverted changeset:

"[GStreamer] media/video-seek-after-end.html is no longer
flakey"
https://bugs.webkit.org/show_bug.cgi?id=203079
https://trac.webkit.org/changeset/251231

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

7 weeks agoUnreviewed, rolling out r251245.
tsavell@apple.com [Thu, 17 Oct 2019 18:13:12 +0000 (18:13 +0000)]
Unreviewed, rolling out r251245.

Addressing this issue differently

Reverted changeset:

"Marking media/video-seek-after-end.html as failing"
https://bugs.webkit.org/show_bug.cgi?id=203111
https://trac.webkit.org/changeset/251245

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

7 weeks agoMarking media/video-seek-after-end.html as failing
tsavell@apple.com [Thu, 17 Oct 2019 17:52:18 +0000 (17:52 +0000)]
Marking media/video-seek-after-end.html as failing
https://bugs.webkit.org/show_bug.cgi?id=203111

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

7 weeks agoDeprecate ActiveDOMObject::canSuspendForDocumentSuspension()
cdumez@apple.com [Thu, 17 Oct 2019 17:35:26 +0000 (17:35 +0000)]
Deprecate ActiveDOMObject::canSuspendForDocumentSuspension()
https://bugs.webkit.org/show_bug.cgi?id=203086

Reviewed by Geoffrey Garen.

Rename ActiveDOMObject::canSuspendForDocumentSuspension() to shouldPreventEnteringBackForwardCache_DEPRECATED()
to make it clear that no new overrides should be added and that it is no longer OK to prevent the page from
entering the back/forward cache. Also provide a default implementation that returns false so that well-behaved
classes no longer need to override this.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::ApplePaySession::canSuspendForDocumentSuspension const): Deleted.
* Modules/applepay/ApplePaySession.h:
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::canSuspendForDocumentSuspension const): Deleted.
* Modules/cache/DOMCache.h:
* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::canSuspendForDocumentSuspension const): Deleted.
* Modules/cache/DOMCacheStorage.h:
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::MediaKeySession::canSuspendForDocumentSuspension const): Deleted.
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::WebKitMediaKeySession::canSuspendForDocumentSuspension const): Deleted.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
* Modules/entriesapi/FileSystemDirectoryReader.cpp:
(WebCore::FileSystemDirectoryReader::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::FileSystemDirectoryReader::canSuspendForDocumentSuspension const): Deleted.
* Modules/entriesapi/FileSystemDirectoryReader.h:
* Modules/entriesapi/FileSystemEntry.cpp:
(WebCore::FileSystemEntry::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::FileSystemEntry::canSuspendForDocumentSuspension const): Deleted.
* Modules/entriesapi/FileSystemEntry.h:
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::FetchRequest::canSuspendForDocumentSuspension const): Deleted.
* Modules/fetch/FetchRequest.h:
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::FetchResponse::canSuspendForDocumentSuspension const): Deleted.
* Modules/fetch/FetchResponse.h:
* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::page const):
(WebCore::Geolocation::canSuspendForDocumentSuspension const): Deleted.
* Modules/geolocation/Geolocation.h:
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::canSuspendForDocumentSuspension const): Deleted.
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::canSuspendForDocumentSuspension const): Deleted.
* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::canSuspendForDocumentSuspension const): Deleted.
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::canSuspendForDocumentSuspension const): Deleted.
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::canSuspendForDocumentSuspension const): Deleted.
* Modules/indexeddb/IDBTransaction.h:
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::MediaRecorder::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediarecorder/MediaRecorder.h:
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediasource/MediaSource.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediasource/SourceBuffer.h:
* Modules/mediasource/SourceBufferList.cpp:
(WebCore::SourceBufferList::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediasource/SourceBufferList.h:
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediastream/MediaDevices.h:
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::MediaStream::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::MediaStreamTrack::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/RTCDTMFSender.cpp:
(WebCore::RTCDTMFSender::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::RTCDTMFSender::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediastream/RTCDTMFSender.h:
* Modules/mediastream/RTCDataChannel.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::RTCPeerConnection::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::UserMediaRequest::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediastream/UserMediaRequest.h:
* Modules/notifications/Notification.cpp:
(WebCore::Notification::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::Notification::canSuspendForDocumentSuspension const): Deleted.
* Modules/notifications/Notification.h:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::PaymentRequest::canSuspendForDocumentSuspension const): Deleted.
* Modules/paymentrequest/PaymentRequest.h:
* Modules/paymentrequest/PaymentResponse.cpp:
(WebCore::PaymentResponse::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::PaymentResponse::canSuspendForDocumentSuspension const): Deleted.
* Modules/paymentrequest/PaymentResponse.h:
* Modules/pictureinpicture/PictureInPictureWindow.cpp:
(WebCore::PictureInPictureWindow::canSuspendForDocumentSuspension const): Deleted.
* Modules/pictureinpicture/PictureInPictureWindow.h:
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::AudioContext::canSuspendForDocumentSuspension const): Deleted.
* Modules/webaudio/AudioContext.h:
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::DatabaseContext::canSuspendForDocumentSuspension const): Deleted.
* Modules/webdatabase/DatabaseContext.h:
* Modules/webgpu/GPUCanvasContext.h:
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::canSuspendForDocumentSuspension const): Deleted.
* Modules/websockets/WebSocket.h:
* Modules/webvr/VRDisplay.cpp:
(WebCore::VRDisplay::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::VRDisplay::canSuspendForDocumentSuspension const): Deleted.
* Modules/webvr/VRDisplay.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::WebAnimation::canSuspendForDocumentSuspension const): Deleted.
* animation/WebAnimation.h:
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::canSuspendForDocumentSuspension const): Deleted.
* css/FontFaceSet.h:
* dom/ActiveDOMObject.h:
* dom/GenericEventQueue.cpp:
(WebCore::GenericEventQueueBase<T>::canSuspendForDocumentSuspension const): Deleted.
* dom/GenericEventQueue.h:
* dom/MessagePort.cpp:
(WebCore::MessagePort::canSuspendForDocumentSuspension const): Deleted.
* dom/MessagePort.h:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
* fileapi/FileReader.cpp:
(WebCore::FileReader::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::FileReader::canSuspendForDocumentSuspension const): Deleted.
* fileapi/FileReader.h:
* html/HTMLMarqueeElement.cpp:
(WebCore::HTMLMarqueeElement::canSuspendForDocumentSuspension const): Deleted.
* html/HTMLMarqueeElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canSuspendForDocumentSuspension const): Deleted.
* html/HTMLMediaElement.h:
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::canSuspendForDocumentSuspension const): Deleted.
* html/HTMLSourceElement.h:
* html/ImageBitmap.cpp:
* html/PublicURLManager.cpp:
(WebCore::PublicURLManager::canSuspendForDocumentSuspension const): Deleted.
* html/PublicURLManager.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::canSuspendForDocumentSuspension const): Deleted.
* html/canvas/WebGLRenderingContextBase.h:
* html/track/TrackListBase.cpp:
(WebCore::TrackListBase::canSuspendForDocumentSuspension const): Deleted.
* html/track/TrackListBase.h:
* page/EventSource.cpp:
(WebCore::EventSource::canSuspendForDocumentSuspension const): Deleted.
* page/EventSource.h:
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::canSuspendForDocumentSuspension const): Deleted.
* page/IntersectionObserver.h:
* page/ResizeObserver.cpp:
(WebCore::ResizeObserver::canSuspendForDocumentSuspension const): Deleted.
* page/ResizeObserver.h:
* page/SuspendableTimer.cpp:
(WebCore::SuspendableTimerBase::canSuspendForDocumentSuspension const): Deleted.
* page/SuspendableTimer.h:
* platform/SuspendableTaskQueue.cpp:
(WebCore::SuspendableTaskQueue::canSuspendForDocumentSuspension const): Deleted.
* platform/SuspendableTaskQueue.h:
* testing/Internals.cpp:
* workers/Worker.cpp:
(WebCore::Worker::canSuspendForDocumentSuspension const): Deleted.
* workers/Worker.h:
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::canSuspendForDocumentSuspension const): Deleted.
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::canSuspendForDocumentSuspension const): Deleted.
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::canSuspendForDocumentSuspension const): Deleted.
* workers/service/ServiceWorkerRegistration.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::XMLHttpRequest::canSuspendForDocumentSuspension const): Deleted.
* xml/XMLHttpRequest.h:

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

7 weeks ago[LFC][TFC] Table formatting context accesses geometry information from parent BFC
zalan@apple.com [Thu, 17 Oct 2019 17:08:11 +0000 (17:08 +0000)]
[LFC][TFC] Table formatting context accesses geometry information from parent BFC
https://bugs.webkit.org/show_bug.cgi?id=203082
<rdar://problem/56370827>

Reviewed by Antti Koivisto.

Tables are wrapped in a 2 level formatting context structure. A <table> element initiates a block formatting context for its principal table box
where the caption and the table content live. It also initiates a table wrapper box which establishes the table formatting context.
In many cases the TFC needs access to the parent (generated) BFC.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::geometryForBox const):
* layout/FormattingContext.h:
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computedTableWidth):

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

7 weeks agoTwo fast/scrolling/ios/touch-scroll* tests failing in iOS 13
simon.fraser@apple.com [Thu, 17 Oct 2019 17:02:41 +0000 (17:02 +0000)]
Two fast/scrolling/ios/touch-scroll* tests failing in iOS 13
https://bugs.webkit.org/show_bug.cgi?id=203070
rdar://problem/51756254

Reviewed by Wenson Hsieh.

For some reason the uiController.dragFromPointToPoint() in these tests was too long
to trigger scrolling (maybe an OS change). Fix them to use UIHelper and a shorter
duration, and also to not be sensitive to the exact distance scrolled.

* fast/scrolling/ios/touch-scroll-pointer-events-none-expected.txt:
* fast/scrolling/ios/touch-scroll-pointer-events-none.html:
* fast/scrolling/ios/touch-scroll-visibility-hidden-expected.txt:
* fast/scrolling/ios/touch-scroll-visibility-hidden.html:
* platform/ios-wk2/TestExpectations:
* resources/ui-helper.js:
(window.UIHelper.dragFromPointToPoint):

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

7 weeks agoREGRESSION (r245483) [iPad Simulator] 2 Layout tests fast/scrolling/ios/overflow...
simon.fraser@apple.com [Thu, 17 Oct 2019 16:52:26 +0000 (16:52 +0000)]
REGRESSION (r245483) [iPad Simulator] 2 Layout tests fast/scrolling/ios/overflow-scroll-inherited.html fast/scrolling/ios/overflow-scrolling-touch-enabled-stacking.html are failing
https://bugs.webkit.org/show_bug.cgi?id=203069
rdar://problem/51868813

Reviewed by Zalan Bujtas.

Add new result for overflow-scroll-inherited.html, since -webkit-overflow-scrolling:touch is a no-op
on iPad on iOS 13.

We can't have different image references for different devices, so keep overflow-scrolling-touch-enabled-stacking.html
as an image failure.

* platform/ipad-12/fast/scrolling/ios/overflow-scroll-inherited-expected.txt: Added.
* platform/ipad/TestExpectations:
* platform/ipad/fast/scrolling/ios/overflow-scroll-inherited-expected.txt: Added.

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

7 weeks agoMake fast/text/font-cursive-italic-cjk.html more robust
mmaxfield@apple.com [Thu, 17 Oct 2019 16:46:51 +0000 (16:46 +0000)]
Make fast/text/font-cursive-italic-cjk.html more robust
https://bugs.webkit.org/show_bug.cgi?id=203072

Reviewed by Alexey Proskuryakov.

Instead of naming STKaiti by name, we can just use an -expected-mismatch test.

* fast/text/font-cursive-italic-cjk-2-expected.html: Removed.
* fast/text/font-cursive-italic-cjk-2.html: Removed.
* fast/text/font-cursive-italic-cjk-expected-mismatch.html: Added.
* fast/text/font-cursive-italic-cjk-expected.html: Removed.
* fast/text/font-cursive-italic-cjk.html:
* platform/mac/TestExpectations:

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

7 weeks ago[LFC][Painting] Add support for image/background image painting
zalan@apple.com [Thu, 17 Oct 2019 16:38:57 +0000 (16:38 +0000)]
[LFC][Painting] Add support for image/background image painting
https://bugs.webkit.org/show_bug.cgi?id=203054
<rdar://problem/56347733>

Reviewed by Antti Koivisto.

In addition to image rendering, this patch also addresses various run/decoration painting issues.

* layout/displaytree/DisplayPainter.cpp:
(WebCore::Display::paintBoxDecoration):
(WebCore::Display::paintInlineContent):
(WebCore::Display::absoluteDisplayBox):
(WebCore::Display::paintBoxDecorationAndChildren):
(WebCore::Display::Painter::paint):
* layout/displaytree/DisplayRun.h:
(WebCore::Display::Run::setImage):
(WebCore::Display::Run::image const):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::appendReplacedInlineBox):
* layout/layouttree/LayoutReplaced.h:
(WebCore::Layout::Replaced::setCachedImage):
(WebCore::Layout::Replaced::cachedImage const):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createLayoutBox):

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

7 weeks ago[LFC][IFC] Add Display::Run/LineBox mapping
zalan@apple.com [Thu, 17 Oct 2019 16:28:43 +0000 (16:28 +0000)]
[LFC][IFC] Add Display::Run/LineBox mapping
https://bugs.webkit.org/show_bug.cgi?id=203051
<rdar://problem/56342487>

Reviewed by Antti Koivisto.

Mapping enables us to paint baseline aligned runs on the current line. This is temporary until after we figure out the final run/line structure.

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/displaytree/DisplayPainter.cpp:
(WebCore::Display::paintInlineContent):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
* layout/inlineformatting/InlineFormattingContextQuirks.cpp:
(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::addLineBox):
(WebCore::Layout::InlineFormattingState::lineBoxForRun const):
(WebCore::Layout::InlineFormattingState::addInlineRun):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::Run::Run):
(WebCore::Layout::Line::alignContentVertically):
(WebCore::Layout::Line::adjustBaselineAndLineHeight):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::Run::displayRun const):
(WebCore::Layout::Line::Run::logicalRect const):
(WebCore::Layout::Line::Run::adjustLogicalTop):
(WebCore::Layout::Line::Run::moveVertically):
(WebCore::Layout::Line::Run::moveHorizontally):
(WebCore::Layout::Line::Run::expand):
* layout/inlineformatting/InlineLineBox.h:
* layout/inlineformatting/InlineLineLayout.h:
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputInlineRuns):

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

7 weeks ago[Web Animations] Enable the Web Animations JavaScript API by default
commit-queue@webkit.org [Thu, 17 Oct 2019 16:24:49 +0000 (16:24 +0000)]
[Web Animations] Enable the Web Animations JavaScript API by default
https://bugs.webkit.org/show_bug.cgi?id=203075

Patch by Antoine Quint <graouts@apple.com> on 2019-10-17
Reviewed by Antti Koivisto.

Source/WebCore:

* page/RuntimeEnabledFeatures.h:

Source/WebKit:

* Shared/WebPreferences.yaml:

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

7 weeks agoUnreviewed, fix watchOS and tvOS builds after r251224
wenson_hsieh@apple.com [Thu, 17 Oct 2019 16:04:54 +0000 (16:04 +0000)]
Unreviewed, fix watchOS and tvOS builds after r251224

* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::shouldTreatAtLeastOneTypeAsFile):

Move the `shouldTreatAtLeastOneTypeAsFile` helper function out of the `PASTEBOARD_SUPPORTS_ITEM_PROVIDERS`
section, and into generic iOS-family code so that it can be used in `pasteboardMayContainFilePaths`.

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

7 weeks ago[GTK] Perf test IndexedDB/basic/index-cursor-delete.html timeouts
clopez@igalia.com [Thu, 17 Oct 2019 15:47:43 +0000 (15:47 +0000)]
[GTK] Perf test IndexedDB/basic/index-cursor-delete.html timeouts
https://bugs.webkit.org/show_bug.cgi?id=203083

Unreviewed gardening.

* Skipped: Skip a test that is timing out on the GTK perf bot.

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

7 weeks agoCheck values of variables before extracting index in perl
commit-queue@webkit.org [Thu, 17 Oct 2019 15:14:58 +0000 (15:14 +0000)]
Check values of variables before extracting index in perl
https://bugs.webkit.org/show_bug.cgi?id=202333

Patch by Paulo Matos <pmatos@igalia.com> on 2019-10-17
Reviewed by Jonathan Bedard.

If compiler doesn't properly report the host and target it was
compiled for, lacking better information we just go ahead and assume
there is no cross compilation involved.

* Scripts/webkitdirs.pm:
(isCrossCompilation):

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

7 weeks agoAdd a driver for MiniBrowser running with WPE for
psaavedra@igalia.com [Thu, 17 Oct 2019 15:08:19 +0000 (15:08 +0000)]
Add a driver for MiniBrowser running with WPE for
benchmark_runner
https://bugs.webkit.org/show_bug.cgi?id=202994

Reviewed by Žan Doberšek.

* Scripts/webkitpy/benchmark_runner/browser_driver/linux_minibrowserwpe_driver.py: Added.
(WPEMiniBrowserDriver):
(WPEMiniBrowserDriver.launch_url):
(WPEMiniBrowserDriver.launch_driver):

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

7 weeks agorun-buildbot-test: sqlalchemy exception when upgrading the database
clopez@igalia.com [Thu, 17 Oct 2019 14:51:21 +0000 (14:51 +0000)]
run-buildbot-test: sqlalchemy exception when upgrading the database
https://bugs.webkit.org/show_bug.cgi?id=202927

Reviewed by Adrian Perez de Castro.

Update the version of sqlalchemy-migrate for pip used for the test.
That fixes the exception when upgrading the database.

* BuildSlaveSupport/build.webkit.org-config/run-buildbot-test.py:

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

7 weeks ago[GStreamer] media/video-seek-after-end.html is no longer flakey
cturner@igalia.com [Thu, 17 Oct 2019 11:28:01 +0000 (11:28 +0000)]
[GStreamer] media/video-seek-after-end.html is no longer flakey
https://bugs.webkit.org/show_bug.cgi?id=203079

Unreviewed test gardening

* TestExpectations:

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

7 weeks agoMultiChannelResampler does not need to recreate a ChannelProvider for every process...
youenn@apple.com [Thu, 17 Oct 2019 10:29:51 +0000 (10:29 +0000)]
MultiChannelResampler does not need to recreate a ChannelProvider for every process call
https://bugs.webkit.org/show_bug.cgi?id=202982

Reviewed by Eric Carlson.

We no longer allocate a new ChannelProvider for every process call.
No observable change of behavior.

* platform/audio/MultiChannelResampler.cpp:
(WebCore::MultiChannelResampler::ChannelProvider::ChannelProvider):
(WebCore::MultiChannelResampler::ChannelProvider::setProvider):
(WebCore::MultiChannelResampler::MultiChannelResampler):
(WebCore::MultiChannelResampler::process):
* platform/audio/MultiChannelResampler.h:

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

7 weeks agoWeb Inspector: Network: updates when toggling resource caching should be sent to...
drousso@apple.com [Thu, 17 Oct 2019 09:05:45 +0000 (09:05 +0000)]
Web Inspector: Network: updates when toggling resource caching should be sent to every connected target
https://bugs.webkit.org/show_bug.cgi?id=203025

Reviewed by Joseph Pecoraro.

* UserInterface/Base/Main.js:
(WI._resourceCachingDisabledSettingChanged):

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

7 weeks ago[GTK][WPE] File and Directory Entries API is not enabled
clopez@igalia.com [Thu, 17 Oct 2019 08:12:11 +0000 (08:12 +0000)]
[GTK][WPE] File and Directory Entries API is not enabled
https://bugs.webkit.org/show_bug.cgi?id=202796

Reviewed by Adrian Perez de Castro.

Enable by default the DirectoryUpload runtime setting that is
used to enable the APIs of the File and Directory Entries API.

Enable also the DataTransferItemsEnabled runtime setting that
exposes the DataTransferItem API. This makes the manual tests
available at https://w3c-test.org/entries-api mostly pass on
platform GTK (those tests need also the DataTransferItem API
to enable the drag-and-drop).

The bug <https://webkit.org/b/98940> for DataTransferItem API
remains open because the layout test editing/pasteboard/data-transfer-items.html
is still not passing completely. However other manual tests for
DataTransferItem pass after enabling it.

* Shared/WebPreferencesDefaultValues.h:

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

7 weeks agoWeb Inspector: rework frontend agent construction to allow commands/events to be...
drousso@apple.com [Thu, 17 Oct 2019 08:00:46 +0000 (08:00 +0000)]
Web Inspector: rework frontend agent construction to allow commands/events to be controlled by the related target's type
https://bugs.webkit.org/show_bug.cgi?id=200384
<rdar://problem/53850352>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/scripts/codegen/generate_js_backend_commands.py:
(JSBackendCommandsGenerator.generate_domain):
(JSBackendCommandsGenerator.generate_domain.generate_parameter_object):
* inspector/scripts/codegen/models.py:
(validate_target_types): Added.
(Protocol.parse_domain):
(Protocol.parse_command):
(Protocol.parse_event):
(Domain.__init__):
(Domains):
(Command.__init__):
(Event.__init__):
* inspector/protocol/ApplicationCache.json:
* inspector/protocol/Audit.json:
* inspector/protocol/CPUProfiler.json:
* inspector/protocol/CSS.json:
* inspector/protocol/Canvas.json:
* inspector/protocol/Console.json:
* inspector/protocol/DOM.json:
* inspector/protocol/DOMDebugger.json:
* inspector/protocol/DOMStorage.json:
* inspector/protocol/Database.json:
* inspector/protocol/Debugger.json:
* inspector/protocol/Heap.json:
* inspector/protocol/IndexedDB.json:
* inspector/protocol/Inspector.json:
* inspector/protocol/LayerTree.json:
* inspector/protocol/Memory.json:
* inspector/protocol/Network.json:
* inspector/protocol/Page.json:
* inspector/protocol/Recording.json:
* inspector/protocol/Runtime.json:
* inspector/protocol/ScriptProfiler.json:
* inspector/protocol/Security.json:
* inspector/protocol/ServiceWorker.json:
* inspector/protocol/Target.json:
* inspector/protocol/Timeline.json:
* inspector/protocol/Worker.json:
Add `debuggableTypes` and `targetTypes` arrays to domains/commands/events that are used when
generating InspectorBackendCommands.js for more accurate compatibility checks.

* inspector/InspectorTarget.h:
* inspector/agents/InspectorTargetAgent.h:
* inspector/agents/InspectorTargetAgent.cpp:
(Inspector::targetTypeToProtocolType):
(Inspector::InspectorTargetAgent::exists): Deleted.
Remove `Target.exists` now that the frontend can do proper feature checking.

* inspector/remote/RemoteControllableTarget.h:
* inspector/remote/RemoteInspectionTarget.h:
* inspector/remote/RemoteInspectorConstants.h:
* inspector/remote/cocoa/RemoteInspectorCocoa.mm:
(Inspector::RemoteInspector::listingForInspectionTarget const):
* inspector/remote/glib/RemoteInspectorGlib.cpp:
(Inspector::RemoteInspector::listingForInspectionTarget const):
* inspector/remote/socket/RemoteInspectorSocket.cpp:
(Inspector::RemoteInspector::listingForInspectionTarget const):
Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy).

* inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result:
* inspector/scripts/tests/generic/command-targetType-matching-domain-debuggableType.json: Added.
* inspector/scripts/tests/generic/domain-availability.json: Removed.
* inspector/scripts/tests/generic/domain-debuggableTypes.json: Added.
* inspector/scripts/tests/generic/domain-targetType-matching-domain-debuggableType.json: Added.
* inspector/scripts/tests/generic/domain-targetTypes.json: Added.
* inspector/scripts/tests/generic/event-targetType-matching-domain-debuggableType.json: Added.
* inspector/scripts/tests/generic/expected/command-targetType-matching-domain-debuggableType.json-result: Added.
* inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/generic/expected/domain-debuggableTypes.json-result: Added.
* inspector/scripts/tests/generic/expected/domain-targetType-matching-domain-debuggableType.json-result: Added.
* inspector/scripts/tests/generic/expected/domain-targetTypes.json-result: Added.
* inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result:
* inspector/scripts/tests/generic/expected/enum-values.json-result:
* inspector/scripts/tests/generic/expected/event-targetType-matching-domain-debuggableType.json-result: Added.
* inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/generic/expected/fail-on-command-targetType-matching-domain-debuggableType.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-command-targetTypes-type.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-command-targetTypes-value.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-domain-availability-type.json-error: Removed.
* inspector/scripts/tests/generic/expected/fail-on-domain-availability-value.json-error: Removed.
* inspector/scripts/tests/generic/expected/fail-on-domain-availability.json-error: Removed.
* inspector/scripts/tests/generic/expected/fail-on-domain-debuggableTypes-type.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-domain-debuggableTypes-value.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-domain-targetType-matching-domain-debuggableType.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-domain-targetTypes-type.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-domain-targetTypes-value.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-event-targetType-matching-domain-debuggableType.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-event-targetTypes-type.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-event-targetTypes-value.json-error: Added.
* inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result:
* inspector/scripts/tests/generic/expected/version.json-result:
* inspector/scripts/tests/generic/fail-on-command-targetType-matching-domain-debuggableType.json: Added.
* inspector/scripts/tests/generic/fail-on-command-targetTypes-type.json: Added.
* inspector/scripts/tests/generic/fail-on-command-targetTypes-value.json: Added.
* inspector/scripts/tests/generic/fail-on-domain-debuggableTypes-type.json: Added.
* inspector/scripts/tests/generic/fail-on-domain-debuggableTypes-value.json: Added.
* inspector/scripts/tests/generic/fail-on-domain-targetType-matching-domain-debuggableType.json: Added.
* inspector/scripts/tests/generic/fail-on-domain-targetTypes-type.json: Added.
* inspector/scripts/tests/generic/fail-on-domain-targetTypes-value.json: Added.
* inspector/scripts/tests/generic/fail-on-event-targetType-matching-domain-debuggableType.json: Added.
* inspector/scripts/tests/generic/fail-on-event-targetTypes-type.json: Added.
* inspector/scripts/tests/generic/fail-on-event-targetTypes-value.json: Added.
* inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result:
Update test results, as well as added new tests for `debuggableTypes` and `targetTypes`.

Source/WebCore:

* inspector/InspectorFrontendClient.h:
(WebCore::InspectorFrontendClient::backendCommandsURL): Deleted.
(WebCore::InspectorFrontendClient::debuggableType): Deleted.
* inspector/InspectorFrontendClientLocal.h:
* page/PageDebuggable.h:
(WebCore::PageDebuggable::type const):
* testing/Internals.cpp:
(WebCore::InspectorStubFrontend::debuggableType const): Added.
Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy).

Source/WebInspectorUI:

`InspectorBackend.domains.${domain}` isn't a truly valid way to feature check, as it
indicates what's supported by the WebKit framework underlying whatever's currently being
inspected, not what the current inspection target supports.

As an example, inspecting an iOS `JSContext` will still show `InspectorBackend.domains.DOM`
as the `DOMAgent` is supported by WebKit, even though `JSContext`s have no concept of the
DOM. In this example, however, `window.DOMAgent` would NOT exist, as the `availability`
check for the `DOM` domain wouldn't pass, meaning that the agent never gets connected.

In order to do proper feature checking, `InspectorBackend.domains` needs to be accurate
depending on the debuggable type. Furthermore, each target underneath that debuggable needs
to be able to "choose" what commands/events are supported based on that target's type.

This patch modifies how InspectorBackendCommands.js ties into `InspectorBackend`. Rather
than directly creating an `InspectorBackend.Agent` for each domain, we now create more of a
"blueprint" of the domain, and wait to actually create an `InspectorBackend.Agent` until we
have a `WI.Target` (and therefore an `InspectorBackend.Connection`). Each "concept" of the
protocol now directly maps to an object.
 - InspectorBackend.Domain
 - InspectorBackend.Command
 - InspectorBackend.Event
 - InspectorBackend.Dispatcher
When a `WI.Target` is created, it gets the list of `InspectorBackend.Domain` that support
that `WI.Target`'s type (specified in the protocol JSON files) and generates an
`InspectorBackend.Agent` for each, which in turn generates an `InspectorBackend.Callable`
for each supported `InspectorBackend.Command` and instantiates `InspectorBackend.Dispatcher`.

Activating a `InspectorBackend.Domain` means it's visible for `InspectorBackend` feature
checking. This must be done this way for older ITML backends that will still appear as
"JSContext" targets and therefore go through the "extra domains" path. Ideally, the process
of registering a domain should be enough to activate it. <https://webkit.org/b/201150>

Feature checking can now only be done via `hasDomain`, `hasCommand`, and `hasEvent` on
`InspectorBackend` or a specific `WI.Target`, and there are different implications for each:
 - `InspectorBackend.hasDomain(DOM)` asks whether the `DOM` domain is supported by the
   current debuggable, but says nothing about whether any `WI.Target` support `DOM`.
 - `target.hasDomain("DOM")` asks whether the given `target` supports `DOM`, which is
   limited by `InspectorBackend.hasDomain("DOM")`.

Now that `InspectorBackend.Agent` is only created by a `WI.Target`, it's no longer valid to
write `window.DOMAgent`, as there is no "global" agent. All protocol logic _must_ go through
a `WI.Target`. <https://webkit.org/b/201149>

Debuggable Types:
 - JavaScript (JSC::JSGlobalObject)
 - Page (WebCore::Page)
 - ServiceWorker (WebCore::ServiceWorkerThreadProxy)
 - WebPage (WebKit::WebPageProxy)

Target Types:
 - JavaScript (direct connection)
 - Page (multi-target connection to any Worker)
 - ServiceWorker (direct connection)
 - WebPage (multi-target connection to 1+ Page)
 - Worker (direct connection, only available for Page debuggables)

* UserInterface/Base/DebuggableType.js:
* UserInterface/Base/TargetType.js: Copied from Source/WebInspectorUI/UserInterface/Base/DebuggableType.js.
* UserInterface/Protocol/Connection.js:
* UserInterface/Protocol/InspectorBackend.js:

* UserInterface/Protocol/ApplicationCacheObserver.js:
* UserInterface/Protocol/CPUProfilerObserver.js:
* UserInterface/Protocol/CSSObserver.js:
* UserInterface/Protocol/CanvasObserver.js:
* UserInterface/Protocol/ConsoleObserver.js:
* UserInterface/Protocol/DOMObserver.js:
* UserInterface/Protocol/DOMStorageObserver.js:
* UserInterface/Protocol/DatabaseObserver.js:
* UserInterface/Protocol/DebuggerObserver.js:
* UserInterface/Protocol/HeapObserver.js:
* UserInterface/Protocol/InspectorObserver.js:
* UserInterface/Protocol/LayerTreeObserver.js:
* UserInterface/Protocol/MemoryObserver.js:
* UserInterface/Protocol/NetworkObserver.js:
* UserInterface/Protocol/PageObserver.js:
* UserInterface/Protocol/RuntimeObserver.js:
* UserInterface/Protocol/ScriptProfilerObserver.js:
* UserInterface/Protocol/TargetObserver.js:
* UserInterface/Protocol/TimelineObserver.js:
* UserInterface/Protocol/WorkerObserver.js:
All observers now extend from `InspectorBackend.Dispatcher` and have a separate instance for
each `InspectorBackend.Agent`, each having their own `_target`.

* UserInterface/Protocol/Target.js:
* UserInterface/Protocol/DirectBackendTarget.js:
* UserInterface/Protocol/JavaScriptContextTarget.js: Removed.
* UserInterface/Protocol/MultiplexingBackendTarget.js:
* UserInterface/Protocol/PageTarget.js:
* UserInterface/Protocol/WorkerTarget.js:
Agents are now created per-target instead of copied from the "global" list. This means that
agents can have a different set of commands/events depending on the associated target.

* UserInterface/Base/Main.js:
* UserInterface/Base/Utilities.js:
* UserInterface/Controllers/AppController.js:
* UserInterface/Controllers/AppControllerBase.js:
* UserInterface/Controllers/ApplicationCacheManager.js:
* UserInterface/Controllers/AuditManager.js:
* UserInterface/Controllers/BreakpointPopoverController.js:
* UserInterface/Controllers/CSSManager.js:
* UserInterface/Controllers/CanvasManager.js:
* UserInterface/Controllers/ConsoleManager.js:
* UserInterface/Controllers/DOMDebuggerManager.js:
* UserInterface/Controllers/DOMManager.js:
* UserInterface/Controllers/DOMStorageManager.js:
* UserInterface/Controllers/DatabaseManager.js:
* UserInterface/Controllers/DebuggerManager.js:
* UserInterface/Controllers/HeapManager.js:
* UserInterface/Controllers/IndexedDBManager.js:
* UserInterface/Controllers/JavaScriptLogViewController.js:
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
* UserInterface/Controllers/LayerTreeManager.js:
* UserInterface/Controllers/MemoryManager.js:
* UserInterface/Controllers/NetworkManager.js:
* UserInterface/Controllers/RuntimeManager.js:
* UserInterface/Controllers/TargetManager.js:
* UserInterface/Controllers/TimelineManager.js:
* UserInterface/Controllers/WorkerManager.js:
* UserInterface/Main.html:
* UserInterface/Models/AuditTestBase.js:
* UserInterface/Models/AuditTestCase.js:
* UserInterface/Models/AuditTestCaseResult.js:
* UserInterface/Models/CPUInstrument.js:
* UserInterface/Models/CPUTimelineRecord.js:
* UserInterface/Models/CSSCompletions.js:
* UserInterface/Models/CSSStyleSheet.js:
* UserInterface/Models/Canvas.js:
* UserInterface/Models/DOMNode.js:
* UserInterface/Models/DOMNodeStyles.js:
* UserInterface/Models/DOMStorageObject.js:
* UserInterface/Models/DOMTree.js:
* UserInterface/Models/DatabaseObject.js:
* UserInterface/Models/FPSInstrument.js:
* UserInterface/Models/GarbageCollection.js:
* UserInterface/Models/HeapAllocationsInstrument.js:
* UserInterface/Models/Instrument.js:
* UserInterface/Models/MediaInstrument.js:
* UserInterface/Models/MemoryInstrument.js:
* UserInterface/Models/MemoryPressureEvent.js:
* UserInterface/Models/MemoryTimelineRecord.js:
* UserInterface/Models/Recording.js:
* UserInterface/Models/Resource.js:
* UserInterface/Models/ScriptInstrument.js:
* UserInterface/Models/ScriptSyntaxTree.js:
* UserInterface/Models/ScriptTimelineRecord.js:
* UserInterface/Models/ShaderProgram.js:
* UserInterface/Models/SourceMapResource.js:
* UserInterface/Models/TimelineRecording.js:
* UserInterface/Protocol/RemoteObject.js:
* UserInterface/Test.html:
* UserInterface/Test/FrontendTestHarness.js:
* UserInterface/Test/Test.js:
* UserInterface/Test/TestAppController.js:
* UserInterface/Views/AuditNavigationSidebarPanel.js:
* UserInterface/Views/AuditTabContentView.js:
* UserInterface/Views/CanvasTabContentView.js:
* UserInterface/Views/ContextMenuUtilities.js:
* UserInterface/Views/CookieStorageContentView.js:
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
* UserInterface/Views/DOMTreeContentView.js:
* UserInterface/Views/ElementsTabContentView.js:
* UserInterface/Views/IndexedDatabaseDetailsSidebarPanel.js:
* UserInterface/Views/Layers3DContentView.js:
* UserInterface/Views/LayersTabContentView.js:
* UserInterface/Views/LayoutTimelineView.js:
* UserInterface/Views/LogContentView.js:
* UserInterface/Views/NetworkTabContentView.js:
* UserInterface/Views/NetworkTableContentView.js:
* UserInterface/Views/NetworkTimelineView.js:
* UserInterface/Views/ObjectTreeView.js:
* UserInterface/Views/QuickConsole.js:
* UserInterface/Views/ResourceDetailsSidebarPanel.js:
* UserInterface/Views/ScriptClusterTimelineView.js:
* UserInterface/Views/ScriptDetailsTimelineView.js:
* UserInterface/Views/ScriptTreeElement.js:
* UserInterface/Views/SearchSidebarPanel.js:
* UserInterface/Views/SearchTabContentView.js:
* UserInterface/Views/SettingsTabContentView.js:
* UserInterface/Views/SourceCodeTextEditor.js:
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
* UserInterface/Views/SpreadsheetStyleProperty.js:
* UserInterface/Views/StorageTabContentView.js:
* UserInterface/Views/TimelineRecordingContentView.js:
* UserInterface/Views/TimelineTabContentView.js:
* UserInterface/Views/Toolbar.js:
* UserInterface/Views/WebSocketContentView.js:
* UserInterface/Views/WorkerTreeElement.js:
Replace all instances of `window.DomainAgent` with `target.DomainAgent`, where `target` is
either derived from an associated model object or `WI.assumingMainTarget()`.
Split the `WI.DebuggableType.Web` debuggable type into `WI.DebuggableType.Page` (WebCore::Page)
and `WI.DebuggableType.WebPage` (WebKit::WebPageProxy).

* UserInterface/Protocol/Legacy/*:
* Versions/*:
Update protocol files for older versions of iOS.

* .eslintrc:
* Localizations/en.lproj/localizedStrings.js:

Source/WebKit:

* WebProcess/WebPage/RemoteWebInspectorUI.h:
(WebKit::WebInspectorUI::backendCommandsURL const): Added.
(WebKit::WebInspectorUI::debuggableType const): Added.
(WebKit::WebInspectorUI::backendCommandsURL): Deleted.
(WebKit::WebInspectorUI::debuggableType): Deleted.
* WebProcess/WebPage/WebInspectorUI.h:
(WebKit::WebInspectorUI::backendCommandsURL const): Added.
(WebKit::WebInspectorUI::debuggableType const): Added.
* UIProcess/WebPageDebuggable.h:
(WebKit::WebPageDebuggable::type const):
* UIProcess/glib/RemoteInspectorClient.cpp:
(WebKit::RemoteInspectorClient::RemoteInspectorClient):
* UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
* UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
(debuggableTypeString):
Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy).

Source/WebKitLegacy/mac:

* WebCoreSupport/WebInspectorClient.h:
(WebInspectorFrontendClient::debuggableType const): Added.
Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy).

Source/WebKitLegacy/win:

* WebCoreSupport/WebInspectorClient.h:
(WebInspectorFrontendClient::debuggableType const): Added.
Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy).

LayoutTests:

* inspector/canvas/requestShaderSource-webgl.html:
* inspector/canvas/updateShader-webgl:
* inspector/page/overrideSetting.html:
* inspector/page/overrideSetting-ICECandidateFilteringEnabled.html:
* inspector/page/overrideSetting-MockCaptureDevicesEnabled.html:
* inspector/runtime/parse.html:
Replace all instances of `DomainAgent.Enum` with `InspectorBackend.domains.Domain.Enum`.

* inspector/audit/run.html:
* inspector/audit/version.html:
* inspector/recording/version.html:
Use new `InspectorBackend` methods.

* inspector/unit-tests/target-manager.html:
* inspector/unit-tests/target-manager-expected.txt:
* inspector/worker/console-basic.html:
* inspector/worker/debugger-pause.html:
* inspector/worker/debugger-scripts.html:
* inspector/worker/debugger-shared-breakpoint.html:
* inspector/worker/resources-in-worker.html:
* inspector/worker/resources/dom-debugger-utilities.js:
* inspector/worker/runtime-basic.html:
* http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts.html:
Replace `WI.Target.Type` with `WI.TargetType`.

* inspector/dom/inspect.html:
* inspector/dom/inspect-expected.txt:
Rewrite test since faking events from the backend now requires a target.

* inspector/unit-tests/set-utilities.html:
* inspector/unit-tests/set-utilities-expected.txt:
Add tests for `Set.prototype.addAll`.

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

7 weeks agoReduce the amount of memory needed to store Options.
mark.lam@apple.com [Thu, 17 Oct 2019 05:45:58 +0000 (05:45 +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>()];
       }

   MSVC has a bug where it cannot handle very large source files: see
   https://developercommunity.visualstudio.com/content/problem/653301/fatal-error-c1002-compiler-is-out-of-heap-space-in.html.
   This bug prevents this patch from building on MSVC.  To workaround this bug,
   we don't inline the Options accessors when COMPILER(MSVC).  This prevents MSVC
   from having to parse the large body of template code code to used to implement
   the inline accessors in every file that #include "Options.h".

   Also add the @no-unify attribute to Options.cpp (where we put the accessors)
   so that it doesn't trigger the MSVC bug also.

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:
* Sources.txt:
* runtime/JSCConfig.h:
* runtime/OptionEntry.h: Removed.
* runtime/Options.cpp:
(JSC::Options::isAvailable):
(JSC::overrideOptionWithHeuristic):
(JSC::optionTypeSpecificIndex):
(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::optionTypeSpecificIndex):
(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::countNumberOfJSCOptionsOfType):

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

7 weeks agoUnreviewed, fix iOS Debug build after r251220.
cdumez@apple.com [Thu, 17 Oct 2019 03:03:59 +0000 (03:03 +0000)]
Unreviewed, fix iOS Debug build after r251220.

* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

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

7 weeks ago[Clipboard API] [iOS] Refactor logic for suppressing URL data when the pasteboard...
wenson_hsieh@apple.com [Thu, 17 Oct 2019 02:59:26 +0000 (02:59 +0000)]
[Clipboard API] [iOS] Refactor logic for suppressing URL data when the pasteboard may contain files
https://bugs.webkit.org/show_bug.cgi?id=203065

Reviewed by Tim Horton.

Platform-specific pasteboard refactoring before tackling webkit.org/b/203021. See below for details. No new
tests, as there is no change in behavior.

* platform/Pasteboard.h:
(WebCore::Pasteboard::changeCount const):

Add a stub for Pasteboard::changeCount() on non-Cocoa platforms.

* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::safeTypeForDOMToReadAndWriteForPlatformType):

Move this helper function farther up the file, so it can be used in more places.

(WebCore::webSafeTypes):

Add a separate helper to compute the list of web-safe MIME types (for instance, "text/plain") given a list of
platform types, and a function to determine whether to avoid exposing a given URL to the DOM.

(WebCore::shouldTreatAtLeastOneTypeAsFile):

Split this out into a separate helper function, so that it can be invoked when determining whether a given
NSItemProvider is suspected to contain file paths. In the case where we're getting the full list of types that
are safe for the DOM to read, we want to pass in the entire pasteboard object and iterate through all of the
available types in search for something that could feasibly accompany a file URL.

In the case of computing the web-safe types per item, we only have an item provider, in which case we only
iterate through the types in that NSItemProvider. See call sites below for examples.

(WebCore::PlatformPasteboard::informationForItemAtIndex):

Invoke the new `webSafeTypes` helper method.

(WebCore::pasteboardMayContainFilePaths):
(WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):

Invoke the new `webSafeTypes` helper method.

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

7 weeks ago[Quick Look] Test that legacy web views load previews before deciding content policy
aestes@apple.com [Thu, 17 Oct 2019 02:45:08 +0000 (02:45 +0000)]
[Quick Look] Test that legacy web views load previews before deciding content policy
https://bugs.webkit.org/show_bug.cgi?id=202971

Reviewed by Alex Christensen.

* TestWebKitAPI/Tests/WebKitCocoa/QuickLook.mm:
(-[QuickLookLegacyDelegate webView:decidePolicyForMIMEType:request:frame:decisionListener:]):
(TEST):
(-[QuickLookFrameLoadDelegate webView:didFinishLoadForFrame:]): Deleted.

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

7 weeks agoPass network cache directory in WebsiteDataStore::parameters() for non-Cocoa platforms.
emilio@crisal.io [Thu, 17 Oct 2019 02:42:29 +0000 (02:42 +0000)]
Pass network cache directory in WebsiteDataStore::parameters() for non-Cocoa platforms.
https://bugs.webkit.org/show_bug.cgi?id=203043

This was causing various errors in the network process that were
visible in debug builds.

Reviewed by Alex Christensen.

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::parameters):

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

7 weeks ago[FTW] Correct radial gradient handling of various radius orderings
bfulgham@apple.com [Thu, 17 Oct 2019 01:53:17 +0000 (01:53 +0000)]
[FTW] Correct radial gradient handling of various radius orderings
https://bugs.webkit.org/show_bug.cgi?id=202815

Reviewed by Per Arne Vollan.

Revise the 'generateGradient' implementation to recognize that the
radius arguments might not be in increasing order. Direct2D's
implementation does expect this, so we need to swap order and
revise the gradient range to match.

Drive-by fix: Stop building unused image decoders if building with
the Apple stack.

* PlatformFTW.cmake: Stop building unused image decoders.
* platform/graphics/win/GradientDirect2D.cpp:
(WebCore::Gradient::generateGradient):

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

7 weeks agoRename PageCache to BackForwardCache
cdumez@apple.com [Thu, 17 Oct 2019 01:44:16 +0000 (01:44 +0000)]
Rename PageCache to BackForwardCache
https://bugs.webkit.org/show_bug.cgi?id=203048

Reviewed by Alex Christensen.

Rename PageCache to BackForwardCache for clarity and consistency with the UIProcess's WebBackForwardCache.

Source/WebCore:

* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::suspend):
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::canSuspendForDocumentSuspension const):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::suspend):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::suspend):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::canSuspendForDocumentSuspension const):
* bindings/js/WindowProxy.cpp:
(WebCore::WindowProxy::clearJSWindowProxiesNotMatchingDOMWindow):
* bindings/js/WindowProxy.h:
* dom/ActiveDOMObject.h:
* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::scheduleStyleRecalc):
(WebCore::Document::needsStyleRecalc const):
(WebCore::Document::invalidateMatchedPropertiesCacheAndForceStyleRecalc):
(WebCore::Document::createRenderTree):
(WebCore::Document::didBecomeCurrentDocumentInFrame):
(WebCore::Document::attachToCachedFrame):
(WebCore::Document::detachFromCachedFrame):
(WebCore::Document::prepareForDestruction):
(WebCore::Document::adjustFocusedNodeOnNodeRemoval):
(WebCore::Document::setFocusedElement):
(WebCore::Document::takeDOMWindowFrom):
(WebCore::Document::setBackForwardCacheState):
(WebCore::Document::suspend):
(WebCore::Document::resume):
(WebCore::Document::topDocument const):
* dom/Document.h:
(WebCore::Document::backForwardCacheState const):
* dom/FullscreenManager.cpp:
(WebCore::FullscreenManager::willEnterFullscreen):
(WebCore::FullscreenManager::didEnterFullscreen):
(WebCore::FullscreenManager::willExitFullscreen):
(WebCore::FullscreenManager::didExitFullscreen):
* dom/FullscreenManager.h:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
(WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
* history/BackForwardCache.cpp: Renamed from Source/WebCore/history/PageCache.cpp.
(WebCore::logBackForwardCacheFailureDiagnosticMessage):
(WebCore::canCacheFrame):
(WebCore::canCachePage):
(WebCore::BackForwardCache::singleton):
(WebCore::BackForwardCache::BackForwardCache):
(WebCore::BackForwardCache::dump const):
(WebCore::BackForwardCache::canCache const):
(WebCore::BackForwardCache::pruneToSizeNow):
(WebCore::BackForwardCache::setMaxSize):
(WebCore::BackForwardCache::frameCount const):
(WebCore::BackForwardCache::markPagesForDeviceOrPageScaleChanged):
(WebCore::BackForwardCache::markPagesForContentsSizeChanged):
(WebCore::BackForwardCache::markPagesForCaptionPreferencesChanged):
(WebCore::setBackForwardCacheState):
(WebCore::BackForwardCache::addIfCacheable):
(WebCore::BackForwardCache::take):
(WebCore::BackForwardCache::removeAllItemsForPage):
(WebCore::BackForwardCache::get):
(WebCore::BackForwardCache::remove):
(WebCore::BackForwardCache::prune):
* history/BackForwardCache.h: Renamed from Source/WebCore/history/PageCache.h.
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore):
(WebCore::CachedFrame::CachedFrame):
(WebCore::CachedFrame::clear):
(WebCore::CachedFrame::destroy):
* history/CachedFramePlatformData.h:
* history/HistoryItem.cpp:
(WebCore::HistoryItem::setCachedPage):
(WebCore::HistoryItem::setURL):
* history/HistoryItem.h:
(WebCore::HistoryItem::isInBackForwardCache const):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::suspend):
(WebCore::HTMLMediaElement::resume):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::createElementRenderer):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::suspend):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::autoplayPermitted const):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::addSubresourceLoader):
* loader/DocumentLoader.h:
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::closeURL):
(WebCore::FrameLoader::clear):
(WebCore::FrameLoader::stopAllLoaders):
(WebCore::FrameLoader::stopForBackForwardCache):
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::open):
(WebCore::FrameLoader::frameDetached):
(WebCore::FrameLoader::detachFromParent):
(WebCore::FrameLoader::receivedMainResourceError):
(WebCore::FrameLoader::shouldPerformFragmentNavigation):
(WebCore::FrameLoader::dispatchUnloadEvents):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
(WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
(WebCore::HistoryController::restoreScrollPositionAndViewState):
(WebCore::HistoryController::invalidateCurrentItemCachedPage):
(WebCore::HistoryController::updateForReload):
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::canCacheInBackForwardCache):
* loader/appcache/ApplicationCacheHost.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::suspendForBackForwardCache):
(WebCore::DOMWindow::resumeFromBackForwardCache):
(WebCore::DOMWindow::decrementScrollEventListenersCount):
* page/DOMWindow.h:
* page/DOMWindowExtension.cpp:
(WebCore::DOMWindowExtension::suspendForBackForwardCache):
(WebCore::DOMWindowExtension::resumeFromBackForwardCache):
* page/DOMWindowExtension.h:
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::backForwardCacheKey):
(WebCore::DiagnosticLoggingKeys::backForwardCacheFailureKey):
* page/DiagnosticLoggingKeys.h:
* page/EventSource.cpp:
(WebCore::EventSource::scheduleReconnect):
(WebCore::EventSource::didReceiveResponse):
(WebCore::EventSource::didReceiveData):
(WebCore::EventSource::didFinishLoading):
(WebCore::EventSource::didFail):
(WebCore::EventSource::abortConnectionAttempt):
(WebCore::EventSource::suspend):
(WebCore::EventSource::resume):
(WebCore::EventSource::dispatchMessageEvent):
* page/EventSource.h:
* page/Frame.cpp:
(WebCore::Frame::setView):
(WebCore::Frame::setDocument):
(WebCore::Frame::willDetachPage):
* page/FrameView.cpp:
(WebCore::FrameView::didRestoreFromBackForwardCache):
(WebCore::FrameView::setContentsSize):
* page/FrameView.h:
* page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::layout):
(WebCore::FrameViewLayoutContext::scheduleLayout):
* page/MemoryRelease.cpp:
(WebCore::releaseCriticalMemory):
(WebCore::releaseMemory):
* page/MemoryRelease.h:
* page/Page.cpp:
(WebCore::Page::~Page):
(WebCore::Page::setViewScaleFactor):
(WebCore::Page::setDeviceScaleFactor):
* page/Page.h:
* page/PageGroup.cpp:
(WebCore::PageGroup::captionPreferencesChanged):
* page/PerformanceLogging.cpp:
(WebCore::PerformanceLogging::memoryUsageStatistics):
* page/Settings.yaml:
* page/SettingsBase.cpp:
(WebCore::SettingsBase::usesBackForwardCacheChanged):
* page/SettingsBase.h:
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::setNeedsStyleRecalc):
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::updateAnimations):
(WebCore::CSSAnimationControllerPrivate::addElementChangeToDispatch):
(WebCore::CSSAnimationController::cancelAnimations):
(WebCore::CSSAnimationController::updateAnimations):
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::sendTransitionEvent):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::sendAnimationEvent):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::notifyContentAreaScrolled):
(WebCore::ScrollAnimatorMac::updateScrollerStyle):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintIntoLayer):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
(WebCore::RenderLayerCompositor::didAddScrollingLayer):
* rendering/RenderLayerCompositor.h:
* rendering/RenderObject.h:
* rendering/SimpleLineLayoutCoverage.cpp:
(WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
* testing/Internals.cpp:
(WebCore::Internals::clearBackForwardCache):
(WebCore::Internals::backForwardCacheSize const):
(WebCore::Internals::preventDocumentForEnteringBackForwardCache):
* testing/Internals.h:
* testing/Internals.idl:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::suspend):

Source/WebKit:

* Shared/CacheModel.cpp:
(WebKit::calculateMemoryCacheSizes):
* Shared/CacheModel.h:
* Shared/WebPreferences.yaml:
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::willGoToBackForwardListItem):
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetPageCacheEnabled):
(WKPreferencesGetPageCacheEnabled):
(WKPreferencesSetPageCacheSupportsPlugins):
(WKPreferencesGetPageCacheSupportsPlugins):
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setUsesPageCache:]):
(-[WKPreferences _usesPageCache]):
(-[WKPreferences _setPageCacheSupportsPlugins:]):
(-[WKPreferences _pageCacheSupportsPlugins]):
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration pageCacheEnabled]):
(-[_WKProcessPoolConfiguration setPageCacheEnabled:]):
* UIProcess/API/glib/WebKitSettings.cpp:
(webkit_settings_get_enable_page_cache):
(webkit_settings_set_enable_page_cache):
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::NavigationClient::willGoToBackForwardListItem):
(WebKit::NavigationState::NavigationClient::didStartProvisionalNavigation):
(WebKit::NavigationState::NavigationClient::didReceiveServerRedirectForProvisionalNavigation):
(WebKit::NavigationState::NavigationClient::didFailProvisionalNavigationWithError):
(WebKit::NavigationState::NavigationClient::didCommitNavigation):
(WebKit::NavigationState::NavigationClient::didFinishDocumentLoad):
(WebKit::NavigationState::NavigationClient::didFinishNavigation):
(WebKit::NavigationState::NavigationClient::didFailNavigationWithError):
(WebKit::NavigationState::NavigationClient::didSameDocumentNavigation):
* UIProcess/ViewGestureController.cpp:
(WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::shouldUseBackForwardCache const):
(WebKit::WebPageProxy::willGoToBackForwardListItem):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::updateBackForwardCacheCapacity):
* WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
(WKBundleBackForwardListItemIsInBackForwardCache):
* WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h:
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toBackForwardListItemState):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::WebFrameLoaderClient):
(WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const):
(WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame):
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
(WebKit::WebFrameLoaderClient::didRestoreFromBackForwardCache):
(WebKit::WebFrameLoaderClient::createPlugin):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
(WebKit::WebFrameLoaderClient::forceLayoutOnRestoreFromBackForwardCache):
* WebProcess/WebPage/VisitedLinkTableController.cpp:
* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::WebBackForwardListProxy::removeItem):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::suspendForProcessSwap):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::setCacheModel):
(WebKit::WebProcess::deleteWebsiteData):
(WebKit::WebProcess::setBackForwardCacheCapacity):
(WebKit::WebProcess::clearCachedPage):
* WebProcess/WebProcess.h:

Source/WebKitLegacy/ios:

* WebView/WebUIKitDelegate.h:

Source/WebKitLegacy/mac:

* History/BackForwardList.mm:
(BackForwardList::addItem):
(BackForwardList::setCapacity):
* History/WebBackForwardList.mm:
(-[WebBackForwardList pageCacheSize]):
* History/WebHistoryItem.mm:
* History/WebHistoryItemPrivate.h:
* Misc/WebCache.mm:
* Misc/WebCoreStatistics.mm:
(+[WebCoreStatistics cachedPageCount]):
(+[WebCoreStatistics cachedFrameCount]):
* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::forceLayoutOnRestoreFromBackForwardCache):
(WebFrameLoaderClient::didRestoreFromBackForwardCache):
* WebCoreSupport/WebVisitedLinkStore.mm:
* WebView/WebHTMLView.mm:
(-[WebHTMLView layoutToMinimumPageWidth:height:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustingViewSize:]):
(-[WebHTMLView setNeedsLayout:]):
(-[WebHTMLView setNeedsToApplyStyles:]):
* WebView/WebView.mm:
(-[WebView _close]):
(-[WebView _preferencesChanged:]):
(+[WebView _setCacheModel:]):

Source/WebKitLegacy/win:

* BackForwardList.cpp:
(BackForwardList::addItem):
(BackForwardList::setCapacity):
* WebCoreStatistics.cpp:
(WebCoreStatistics::cachedPageCount):
(WebCoreStatistics::cachedFrameCount):
* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::didRestoreFromBackForwardCache):
* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebVisitedLinkStore.cpp:
* WebFrame.cpp:
(WebFrame::accessible const):
* WebView.cpp:
(WebView::setCacheModel):
(WebView::notifyPreferencesChanged):

Tools:

* DumpRenderTree/TestOptions.cpp:
(TestOptions::TestOptions):
* DumpRenderTree/TestOptions.h:
* DumpRenderTree/TestRunner.cpp:
(overridePreferenceCallback):
* DumpRenderTree/mac/DumpRenderTree.mm:
(setWebPreferencesForTestOptions):
* DumpRenderTree/win/DumpRenderTree.cpp:
(resetWebPreferencesToConsistentValues):
(setWebPreferencesForTestOptions):
* TestWebKitAPI/Tests/WebKit/DOMWindowExtensionBasic.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/DOMWindowExtensionNoCache.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/DOMWindowExtensionNoCache_Bundle.cpp:
(TestWebKitAPI::DOMWindowExtensionNoCache::willDisconnectDOMWindowExtensionFromGlobalObject):
(TestWebKitAPI::DOMWindowExtensionNoCache::didReconnectDOMWindowExtensionToGlobalObject):
* TestWebKitAPI/Tests/WebKit/DidRemoveFrameFromHiearchyInPageCache.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/DidRemoveFrameFromHiearchyInPageCache_Bundle.cpp:
(TestWebKitAPI::DidRemoveFrameFromHiearchyInBackForwardCacheTest::DidRemoveFrameFromHiearchyInBackForwardCacheTest):
(TestWebKitAPI::DidRemoveFrameFromHiearchyInBackForwardCacheTest::didCreatePage):
* TestWebKitAPI/Tests/WebKit/LayoutMilestonesWithAllContentInFrame.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp:
(testWebKitSettings):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::overridePreference):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):
* lldb/lldb_webkit.py:
(WebCoreFrame_SummaryProvider):
(WebCoreDocument_SummaryProvider):
(WebCoreDocumentProvider.page_cache_state):

LayoutTests:

* animations/resume-after-page-cache.html:
* compositing/accelerated-layers-after-back.html:
* compositing/iframes/page-cache-layer-tree.html:
* compositing/page-cache-back-crash.html:
* compositing/show-composited-iframe-on-back-button.html:
* editing/mac/input/unconfirmed-text-navigation-with-page-cache.html:
* fast/canvas/webgl/canvas-webgl-page-cache.html:
* fast/css/fontloader-page-cache.html:
* fast/dom/DeviceMotion/no-page-cache.html:
* fast/dom/DeviceOrientation/event-after-navigation.html:
* fast/dom/DeviceOrientation/no-page-cache.html:
* fast/dom/Window/timer-resume-on-navigation-back.html:
* fast/events/onunload-back-to-page-cache.html:
* fast/events/pagehide-timeout.html:
* fast/events/pagehide-xhr-open.html:
* fast/events/pageshow-pagehide-on-back-cached-with-frames.html:
* fast/events/pageshow-pagehide-on-back-cached.html:
* fast/events/suspend-timers.html:
* fast/forms/autocomplete-off-with-default-value-does-not-clear.html:
* fast/frames/frame-crash-with-page-cache.html:
* fast/frames/frame-unload-navigate-and-setTimeout-assert-fail.html:
* fast/frames/page-hide-document-open.html:
* fast/frames/restoring-page-cache-should-not-run-scripts-via-style-update.html:
* fast/frames/restoring-page-cache-should-not-run-scripts.html:
* fast/harness/page-cache-crash-on-data-urls.html:
* fast/harness/use-page-cache.html:
* fast/history/back-from-page-with-focused-iframe.html:
* fast/history/go-back-to-iframe-with-plugin.html:
* fast/history/go-back-to-object-subframe.html:
* fast/history/history-back-while-pdf-in-pagecache.html:
* fast/history/page-cache-MessagePort-pending-message.html:
* fast/history/page-cache-after-window-open.html:
* fast/history/page-cache-back-navigation-crash.html:
* fast/history/page-cache-clearing-expected.txt:
* fast/history/page-cache-clearing.html:
* fast/history/page-cache-closed-audiocontext.html:
* fast/history/page-cache-createImageBitmap.html:
* fast/history/page-cache-createObjectURL-using-open-panel.html:
* fast/history/page-cache-createObjectURL.html:
* fast/history/page-cache-destroy-document.html:
* fast/history/page-cache-element-state-focused.html:
* fast/history/page-cache-execute-script-during-restore.html:
* fast/history/page-cache-geolocation-active-oneshot.html:
* fast/history/page-cache-geolocation-active-watcher.html:
* fast/history/page-cache-geolocation.html:
* fast/history/page-cache-iframe-js-url.html:
* fast/history/page-cache-indexed-closed-db.html:
* fast/history/page-cache-indexed-opened-db.html:
* fast/history/page-cache-media-source-closed-2.html:
* fast/history/page-cache-media-source-closed.html:
* fast/history/page-cache-media-source-opened.html:
* fast/history/page-cache-navigate-during-restore.html:
* fast/history/page-cache-notification-non-suspendable.html:
* fast/history/page-cache-notification-suspendable.html:
* fast/history/page-cache-removed-source-buffer.html:
* fast/history/page-cache-running-audiocontext.html:
* fast/history/page-cache-subframes-with-provisional-load.html:
* fast/history/page-cache-suspended-audiocontext.html:
* fast/history/page-cache-webdatabase-no-transaction-db.html:
* fast/history/page-cache-webdatabase-pending-transaction.html:
* fast/history/page-cache-with-opener.html:
* fast/history/pagehide-remove-iframe-crash.html:
* fast/history/resources/page-cache-window-with-iframe.html:
* fast/history/resources/page-cache-window-with-opener.html:
* fast/history/timed-refresh-in-cached-frame.html:
* fast/images/animated-gif-restored-from-bfcache.html:
* fast/loader/frames-with-unload-handlers-in-page-cache.html:
* fast/loader/image-in-page-cache.html:
* fast/loader/input-element-page-cache-crash.html:
* fast/loader/navigate-with-new-target-after-back-forward-navigation.html:
* fast/loader/navigate-with-post-to-new-target-after-back-forward-navigation.html:
* fast/loader/scroll-position-restored-on-back.html:
* fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html:
* fast/loader/stateobjects/popstate-fires-with-page-cache.html:
* fast/loader/unschedule-relayout-after-unload.html:
* fast/loader/window-properties-restored-from-page-cache.html:
* fast/mediastream/RTCPeerConnection-page-cache.html:
* fast/overflow/horizontal-scroll-after-back.html:
* fast/scrolling/iframe-scrollable-after-back.html:
* fast/scrolling/ios/scroll-events-back-forward-after-pageshow.html:
* fast/scrolling/ios/scroll-events-back-forward.html:
* fast/scrolling/ios/touch-scroll-back-forward.html:
* fast/scrolling/overflow-scrollable-after-back.html:
* fast/scrolling/page-cache-back-overflow-scroll-restore.html:
* fast/text-autosizing/ios/text-autosizing-after-back.html:
* fast/viewport/ios/viewport-shrink-to-fit-on-new-navigation.html:
* fast/viewport/viewport-128.html:
* fast/workers/worker-page-cache.html:
* http/tests/cache/display-image-unset-allows-cached-image-load.html:
* http/tests/eventsource/eventsource-page-cache-connected.html:
* http/tests/eventsource/eventsource-page-cache-connecting.html:
* http/tests/loading/main-resource-delegates-on-back-navigation.html:
* http/tests/loading/unfinished-load-back-to-cached-page-callbacks.html:
* http/tests/loading/unfinished-main-resource-back-to-cached-page-callbacks.html:
* http/tests/media/reload-after-dialog.html:
* http/tests/navigation/go-back-to-error-page.html:
* http/tests/navigation/https-in-page-cache.html:
* http/tests/navigation/https-no-store-subframe-in-page-cache.html:
* http/tests/navigation/image-load-in-pagehide-handler.html:
* http/tests/navigation/page-cache-domcache-pending-promise.html:
* http/tests/navigation/page-cache-domcachestorage-pending-promise.html:
* http/tests/navigation/page-cache-failed-xhr.html:
* http/tests/navigation/page-cache-fontfaceset.html:
* http/tests/navigation/page-cache-fragment-referrer.html:
* http/tests/navigation/page-cache-iframe-no-current-historyItem.html:
* http/tests/navigation/page-cache-iframe-provisional-load-async-delegates.html:
* http/tests/navigation/page-cache-iframe-provisional-load.html:
* http/tests/navigation/page-cache-pending-image-load-cache-partition.html:
* http/tests/navigation/page-cache-pending-image-load.html:
* http/tests/navigation/page-cache-pending-load.html:
* http/tests/navigation/page-cache-pending-ping-load-cross-origin.html:
* http/tests/navigation/page-cache-pending-ping-load-same-origin.html:
* http/tests/navigation/page-cache-requestAnimationFrame.html:
* http/tests/navigation/page-cache-xhr-in-pagehide.html:
* http/tests/navigation/page-cache-xhr.html:
* http/tests/navigation/resources/https-in-page-cache-3.html:
* http/tests/navigation/subframe-pagehide-handler-starts-load.html:
* http/tests/navigation/subframe-pagehide-handler-starts-load2.html:
* http/tests/security/cross-origin-window-open-insert-script.html:
* http/tests/security/cross-origin-window-open-javascript-url.html:
* http/tests/security/navigate-when-restoring-cached-page.html:
* http/tests/security/xss-DENIED-click-and-form-submission-from-inactive-domwindow.html:
* http/tests/security/xss-DENIED-script-inject-into-inactive-window.html:
* http/tests/security/xss-DENIED-script-inject-into-inactive-window2-pson.html:
* http/tests/security/xss-DENIED-script-inject-into-inactive-window2.html:
* http/tests/security/xss-DENIED-script-inject-into-inactive-window3.html:
* http/tests/websocket/tests/hybi/closed-when-entering-page-cache.html:
* http/tests/websocket/tests/hybi/stop-on-resume-in-error-handler.html:
* http/tests/workers/service/client-added-to-clients-when-restored-from-page-cache.html:
* http/tests/workers/service/client-removed-from-clients-while-in-page-cache.html:
* http/tests/workers/service/page-cache-service-worker-pending-promise.https.html:
* http/tests/workers/service/page-caching.html:
* http/wpt/beacon/support/sendBeacon-onpagehide-window.html:
* legacy-animation-engine/animations/resume-after-page-cache.html:
* loader/go-back-cached-main-resource.html:
* loader/go-back-to-different-window-size.html:
* media/crash-closing-page-with-media-as-plugin-fallback.html:
* media/media-source/media-source-page-cache.html:
* media/restore-from-page-cache.html:
* platform/ios/ios/fixed/fixed-back-forward.html:
* plugins/crash-restoring-plugin-page-from-page-cache.html:
* plugins/frameset-with-plugin-frame.html:
* plugins/netscape-plugin-page-cache-works.html:
* storage/indexeddb/IDBRequest-page-cache.html:
* storage/indexeddb/IDBTransaction-page-cache.html:
* swipe/basic-cached-back-swipe.html:
* swipe/main-frame-pinning-requirement.html:
* swipe/pushState-cached-back-swipe.html:
* swipe/pushState-programmatic-back-while-swiping-crash.html:
* swipe/pushstate-with-manual-scrollrestoration.html:
* tiled-drawing/scrolling/null-parent-back-crash.html:
* tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html:
* webrtc/datachannel/datachannel-page-cache-send.html:
* webrtc/datachannel/datachannel-page-cache.html:

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

7 weeks ago[iOS] Remove ubiquity client rule from sandbox
pvollan@apple.com [Thu, 17 Oct 2019 00:36:52 +0000 (00:36 +0000)]
[iOS] Remove ubiquity client rule from sandbox
https://bugs.webkit.org/show_bug.cgi?id=201347

Reviewed by Brent Fulgham.

This rule is most likely not needed, since we have already blocked all of its associated mach services,
and no issues have been reported.

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

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

7 weeks agoiOS: inputmode=none is not respected with a hardware keyboard attached
timothy_horton@apple.com [Thu, 17 Oct 2019 00:15:28 +0000 (00:15 +0000)]
iOS: inputmode=none is not respected with a hardware keyboard attached
https://bugs.webkit.org/show_bug.cgi?id=203061

Reviewed by Daniel Bates.

Source/WebKit:

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView shouldShowAutomaticKeyboardUI]):
We can resolve this FIXME, as the underlying bug was fixed in <rdar://problem/52706523>.
This now means that we will respect inputmode=none even when a hardware
keyboard is attached, significantly improving the experience on sites that use it
by avoiding an intermittent input bar.

LayoutTests:

* fast/forms/ios/inputmode-none-with-hardware-keyboard.html: Added.
Clone inputmode-none.html to inputmode-none-with-hardware-keyboard.html
and remove the line to faux-detach the hardware keyboard.

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

7 weeks ago[iOS] Remove send-signal from mach-lookup rule
pvollan@apple.com [Wed, 16 Oct 2019 23:01:30 +0000 (23:01 +0000)]
[iOS] Remove send-signal from mach-lookup rule
https://bugs.webkit.org/show_bug.cgi?id=201203

Reviewed by Brent Fulgham.

The send-signal can be removed, since crashes have not been reported from this rule.

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

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

7 weeks agoAdd Swift modulemap for WebKit Private APIs
dino@apple.com [Wed, 16 Oct 2019 22:49:31 +0000 (22:49 +0000)]
Add Swift modulemap for WebKit Private APIs
https://bugs.webkit.org/show_bug.cgi?id=203059

Reviewed by Tim Horton.

Provide a Swift modulemap for WebKit_Private, and
ensure WKPreferencesPrivate.h is exposed.

Renamed OSX.modulemap to macOS.modulemap while here.

* Configurations/WebKit.xcconfig:
* Modules/iOS.private.modulemap: Added.
* Modules/macOS.modulemap: Renamed from Source/WebKit/Modules/OSX.modulemap.
* Modules/macOS.private.modulemap: Added.
* Shared/API/Cocoa/WebKitPrivate.h: Include WKPreferencesPrivate.h.

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

7 weeks agoPython 3: Add support in webkitpy.common.net.bugzilla
jbedard@apple.com [Wed, 16 Oct 2019 22:47:40 +0000 (22:47 +0000)]
Python 3: Add support in webkitpy.common.net.bugzilla
https://bugs.webkit.org/show_bug.cgi?id=202468

Reviewed by Stephanie Lewis.

Make the irc library we use Python 3 compatible.

* Scripts/test-webkitpy-python3: Add webkitpy.common.net.bugzilla to the test list.
* Scripts/webkitpy/thirdparty/irc/ircbot.py: Use full import paths.
* Scripts/webkitpy/thirdparty/irc/irclib.py: Fix exceptions, printing for Python 3.
(Connection._get_socket):
(ServerConnection.connect):
(ServerConnection.process_data):
(ServerConnection.disconnect):
(ServerConnection.send_raw):
(DCCConnection.connect):
(DCCConnection.listen):
(DCCConnection.disconnect):
(DCCConnection.process_data):
(DCCConnection.privmsg):

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

7 weeks agoResource Load Statistics (experimental): Block all third-party cookies on websites...
wilander@apple.com [Wed, 16 Oct 2019 22:38:55 +0000 (22:38 +0000)]
Resource Load Statistics (experimental): Block all third-party cookies on websites without prior user interaction
https://bugs.webkit.org/show_bug.cgi?id=203017
<rdar://problem/56262708>

Reviewed by Alex Christensen.

Source/WebCore:

NetworkStorageSession::shouldBlockCookies() now checks if the first-party website has
received user interaction and if not, blocks all third-party cookies, regardless of the
status of those third-party domains (prevalent or not).

Bundled cleanup task: Remove the two month old feature flag for NSURLSession switching.

Tests: http/tests/resourceLoadStatistics/third-party-cookie-blocking-on-sites-without-user-interaction-database.html
       http/tests/resourceLoadStatistics/third-party-cookie-blocking-on-sites-without-user-interaction.html

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setIsITPSessionSwitchingEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::isITPSessionSwitchingEnabled const): Deleted.
* page/Settings.yaml:
* platform/network/NetworkStorageSession.cpp:
(WebCore::NetworkStorageSession::hasHadUserInteractionAsFirstParty const):
(WebCore::NetworkStorageSession::shouldBlockCookies const):
(WebCore::NetworkStorageSession::setDomainsWithUserInteractionAsFirstParty):
* platform/network/NetworkStorageSession.h:
(WebCore::NetworkStorageSession::setIsThirdPartyCookieBlockingOnSitesWithoutUserInteractionEnabled):

Source/WebKit:

This enhancement is off by default and controlled by an internal feature flag.

The functional change is in WebCore::NetworkStorageSession::shouldBlockCookies() which is
called from:
- NetworkDataTaskCocoa::NetworkDataTaskCocoa()
- NetworkDataTaskCocoa::willPerformHTTPRedirection

shouldBlockCookies() now checks if the first-party website has received user interaction
and if not, blocks all third-party cookies, regardless of the status of those third-party
domains (prevalent or not).

The changes to ResourceLoadStatisticsDatabaseStore and ResourceLoadStatisticsMemoryStore
are about communicating which domains have received user interaction (prevalent or not)
to the network storage session so that it can enforce the new restriction.

The C API change and piping through the WebsiteDataStore is test infrastructure.

Bundled cleanup task: Remove the two month old feature flag for NSURLSession switching.

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::CompletionHandler<void):
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::clear):
(WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
(WebKit::RegistrableDomainsToBlockCookiesFor::isolatedCopy const):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::setShouldBlockThirdPartyCookiesForTesting):
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::setResourceLoadStatisticsLogTestingEvent):
(WebKit::NetworkSession::shouldIsolateSessionsForPrevalentTopFrames const): Deleted.
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting):
(WKWebsiteDataStoreStatisticsResetToConsistentState):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::setShouldBlockThirdPartyCookiesForTesting):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting):
* UIProcess/WebsiteData/WebsiteDataStore.h:

Tools:

These changes are test infrastructure to be able to toggle the function
through testRunner.setStatisticsShouldBlockThirdPartyCookies().

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setStatisticsShouldBlockThirdPartyCookies):
(WTR::TestRunner::statisticsCallDidSetShouldBlockThirdPartyCookiesCallback):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::setStatisticsShouldBlockThirdPartyCookies):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
(WTR::TestInvocation::didSetShouldBlockThirdPartyCookies):
* WebKitTestRunner/TestInvocation.h:

LayoutTests:

* http/tests/resourceLoadStatistics/third-party-cookie-blocking-on-sites-without-user-interaction-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/third-party-cookie-blocking-on-sites-without-user-interaction-database.html: Added.
* http/tests/resourceLoadStatistics/third-party-cookie-blocking-on-sites-without-user-interaction-expected.txt: Added.
* http/tests/resourceLoadStatistics/third-party-cookie-blocking-on-sites-without-user-interaction.html: Added.

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

7 weeks agoWKWebsiteDataStoreStatisticsResetToConsistentState() should call store.setUseITPDatab...
commit-queue@webkit.org [Wed, 16 Oct 2019 22:16:29 +0000 (22:16 +0000)]
WKWebsiteDataStoreStatisticsResetToConsistentState() should call store.setUseITPDatabase(false)
https://bugs.webkit.org/show_bug.cgi?id=203020
<rdar://problem/56314484>

Patch by Kate Cheney <katherine_cheney@apple.com> on 2019-10-16
Reviewed by Chris Dumez.

Source/WebKit:

The resourceLoadStatisticsStore should be reset between tests to use
a memory store, and any test that needs to use the database store
can use the setUseITPDatabase function.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setUseITPDatabase):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetUseITPDatabase):
(WKWebsiteDataStoreStatisticsResetToConsistentState):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::setUseITPDatabase):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setUseITPDatabase):
* UIProcess/WebsiteData/WebsiteDataStore.h:

Tools:

Added a completion handler to setUseITPDatabase() to avoid race
conditions.

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

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

7 weeks ago[LFC][IFC] Add style and text content to Display::Run
zalan@apple.com [Wed, 16 Oct 2019 22:01:27 +0000 (22:01 +0000)]
[LFC][IFC] Add style and text content to Display::Run
https://bugs.webkit.org/show_bug.cgi?id=203045
<rdar://problem/56340105>

Reviewed by Antti Koivisto.

Painting Display::Runs requires style and text content. Currently there's no mapping structure to connect Display::Runs to Display::Boxes to access style and content.

* layout/displaytree/DisplayRun.h:
(WebCore::Display::Run::TextContext::content const):
(WebCore::Display::Run::style const):
(WebCore::Display::Run::Run):
(WebCore::Display::Run::TextContext::TextContext):
(WebCore::Display::Run::TextContext::expand):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::appendNonBreakableSpace):
(WebCore::Layout::Line::appendTextContent):
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::appendHardLineBreak):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::Run::expand):

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

7 weeks agoMove assert in Wasm::Plan::fail.
keith_miller@apple.com [Wed, 16 Oct 2019 21:51:38 +0000 (21:51 +0000)]
Move assert in Wasm::Plan::fail.
https://bugs.webkit.org/show_bug.cgi?id=203052

Reviewed by Mark Lam.

JSTests:

* wasm/regress/wasm-plan-fail-bad-error-message-assert.js: Added.
(Binary):
(Binary.prototype.trunc_buffer):
(Binary.prototype.emit_leb_u):
(Binary.prototype.emit_u32v):
(Binary.prototype.emit_bytes):
(Binary.prototype.emit_header):
(__f_576):
(__f_587):

Source/JavaScriptCore:

Since we changed how Wasm::Plan interacts with the streaming
parser it's possible for the streaming parser to call fail with no
error message (because the corresponding Wasm::Plan already
failed). This patch moves an erroneous assert so it no longer
trips when this happens.

* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::fail):

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

7 weeks agocheckConsistency in Air O0 should only run when validation is enabled
keith_miller@apple.com [Wed, 16 Oct 2019 21:49:16 +0000 (21:49 +0000)]
checkConsistency in Air O0 should only run when validation is enabled
https://bugs.webkit.org/show_bug.cgi?id=203050

Reviewed by Saam Barati.

I resued the validateGraph and validateGraphAtEachPhase options
because adding a new option and threading it through all our
testing infrastructure didn't seem worthwhile for this.

* b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp:
(JSC::B3::Air::GenerateAndAllocateRegisters::checkConsistency):

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

7 weeks agoAdd dumping for BorderData and StyleBackgroundData
simon.fraser@apple.com [Wed, 16 Oct 2019 21:24:58 +0000 (21:24 +0000)]
Add dumping for BorderData and StyleBackgroundData
https://bugs.webkit.org/show_bug.cgi?id=203038

Reviewed by Zalan Bujtas.

As part of adding dumping for all RenderStyle data, add dumping support for
BorderData and StyleBackgroundData.

For large classes it's beneficial to avoid dumping default values; those classes
get a dump() function that can take an argument to say whether values which are default
should be printed.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/LengthSize.h:
(WebCore::LengthSize::isZero const):
* rendering/style/BorderData.cpp: Added.
(WebCore::operator<<):
(WebCore::BorderData::dump const):
* rendering/style/BorderData.h:
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleBackgroundData.cpp:
(WebCore::StyleBackgroundData::dump const):
(WebCore::operator<<):
* rendering/style/StyleBackgroundData.h:

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

7 weeks agoSource/WebCore:
cdumez@apple.com [Wed, 16 Oct 2019 20:54:23 +0000 (20:54 +0000)]
Source/WebCore:
[WK2] Handle back/forward cache entry expiration in the UIProcess instead of the WebProcess
https://bugs.webkit.org/show_bug.cgi?id=203034
<rdar://problem/56332453>

Reviewed by Antti Koivisto.

Use Seconds type for backForwardCacheExpirationInterval setting instead of
double, for clarity.

* history/CachedPage.cpp:
(WebCore::CachedPage::CachedPage):
(WebCore::CachedPage::hasExpired const):
* page/Settings.yaml:

Source/WebKit:
[WK2] Handle back/forward cache entry expiration in the UIProcess instead of the WebProcess
https://bugs.webkit.org/show_bug.cgi?id=203034
<rdar://problem/56332453>

Reviewed by Antti Koivisto.

Handle back/forward cache entry expiration in the UIProcess instead of the WebProcess,
now that back/forward cache management is done in the UIProcess.

* UIProcess/WebBackForwardCacheEntry.cpp:
(WebKit::WebBackForwardCacheEntry::WebBackForwardCacheEntry):
(WebKit::WebBackForwardCacheEntry::takeSuspendedPage):
(WebKit::WebBackForwardCacheEntry::expirationTimerFired):
* UIProcess/WebBackForwardCacheEntry.h:
Add a Timer to WebBackForwardCacheEntry to make the entry expire after 30 minutes, which is what used
to happen on WebContent process side. One difference in behavior is that when the entry expires we
now remove it from the cache right away to free-up memory, instead of simply refusing to use it later
on.

* WebProcess/WebPage/WebPage.cpp:
Disable back forward cache expiration in the WebContent process when using modern
WebKit.

Source/WebKitLegacy/mac:
[WK2] Move back/forward cache entry expiration from the WebProcess to the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=203034
<rdar://problem/56332453>

Reviewed by Antti Koivisto.

* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

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

7 weeks ago[LFC][IFC] Fix various vertical alignment issues.
zalan@apple.com [Wed, 16 Oct 2019 20:32:55 +0000 (20:32 +0000)]
[LFC][IFC] Fix various vertical alignment issues.
https://bugs.webkit.org/show_bug.cgi?id=203041

Reviewed by Antti Koivisto.

This patch fixes both regular inline box and inline-block baseline aligment. It also addresses a few related vertical positioning issues.

* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::alignContentVertically):
(WebCore::Layout::Line::appendInlineContainerStart):
(WebCore::Layout::Line::appendInlineContainerEnd):
(WebCore::Layout::Line::appendTextContent):
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::appendHardLineBreak):
(WebCore::Layout::Line::adjustBaselineAndLineHeight):
(WebCore::Layout::Line::inlineItemContentHeight const):
* layout/inlineformatting/InlineLine.h:
* layout/inlineformatting/InlineLineBox.h:
(WebCore::Layout::LineBox::resetDescent):
(WebCore::Layout::LineBox::setLogicalHeightIfGreater):
(WebCore::Layout::LineBox::setBaselineOffsetIfGreater):
(WebCore::Layout::LineBox::setAscentIfGreater):
(WebCore::Layout::LineBox::setDescentIfGreater):
(WebCore::Layout::LineBox::resetBaseline):
(WebCore::Layout::LineBox::setBaseline): Deleted.
(WebCore::Layout::LineBox::baseline): Deleted.
(WebCore::Layout::LineBox::setBaselineOffset): Deleted.
(WebCore::Layout::LineBox::Baseline::setAscentIfGreater): Deleted.
(WebCore::Layout::LineBox::Baseline::setDescentIfGreater): Deleted.

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

7 weeks agoInvalid instruction generated for ARM_THUMB2 in llint
ticaiolima@gmail.com [Wed, 16 Oct 2019 19:50:24 +0000 (19:50 +0000)]
Invalid instruction generated for ARM_THUMB2 in llint
https://bugs.webkit.org/show_bug.cgi?id=202844

Reviewed by Saam Barati.

Do not allow instruction execution to reach OSR return label on ARMv7.
Currently we are seeing the instruction execution hitting a .word directive in
the instruction stream and segfaulting. There are two words used to represent a
global label which was generated as part of the work on OSR Exit to LLInt work
(r250806). The double word generation only occurs in ARMv7 and therefore only here
the segfault manifests itself.

* llint/LowLevelInterpreter.asm:

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

7 weeks ago[iOS] Stop terminating the prewarmed process on application suspension
cdumez@apple.com [Wed, 16 Oct 2019 19:22:38 +0000 (19:22 +0000)]
[iOS] Stop terminating the prewarmed process on application suspension
https://bugs.webkit.org/show_bug.cgi?id=203033

Reviewed by Alex Christensen.

Stop terminating the prewarmed process on application suspension. Having no prewarmed process when the
application resumes means the next cross-site load will be significantly slower. If the system needs
memory, this process can be jetsammed.

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::applicationIsAboutToSuspend):

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

7 weeks agoDrop unused WKPageSetResourceCachingDisabled() SPI
cdumez@apple.com [Wed, 16 Oct 2019 18:24:25 +0000 (18:24 +0000)]
Drop unused WKPageSetResourceCachingDisabled() SPI
https://bugs.webkit.org/show_bug.cgi?id=203035

Reviewed by Alex Christensen.

Source/WebCore:

* history/PageCache.cpp:
(WebCore::canCachePage):
(WebCore::PageCache::take):
(WebCore::PageCache::get):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerShouldUsePersistentCache const):
* inspector/agents/page/PageNetworkAgent.cpp:
(WebCore::PageNetworkAgent::setResourceCachingDisabled):
* inspector/agents/worker/WorkerNetworkAgent.cpp:
(WebCore::WorkerNetworkAgent::setResourceCachingDisabled):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::subresourceCachePolicy const):
(WebCore::FrameLoader::addExtraFieldsToRequest):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::cachePolicy const):
* page/Page.h:
(WebCore::Page::isResourceCachingDisabledByWebInspector const):
(WebCore::Page::setResourceCachingDisabledByWebInspector):
(WebCore::Page::isResourceCachingDisabled const): Deleted.
(WebCore::Page::setResourceCachingDisabled): Deleted.
(WebCore::Page::setResourceCachingDisabledOverride): Deleted.
* workers/WorkerDebuggerProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::setResourceCachingDisabledByWebInspector):
(WebCore::WorkerMessagingProxy::setResourceCachingDisabled): Deleted.
* workers/WorkerMessagingProxy.h:
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::setResourceCachingDisabledByWebInspector):
(WebCore::ServiceWorkerThreadProxy::setResourceCachingDisabled): Deleted.
* workers/service/context/ServiceWorkerThreadProxy.h:

Source/WebKit:

* UIProcess/API/C/WKPage.cpp:
(WKPageGetResourceCachingDisabled): Deleted.
(WKPageSetResourceCachingDisabled): Deleted.
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setResourceCachingDisabled): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isResourceCachingDisabled const): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setResourceCachingDisabled): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

7 weeks agoDumpRenderTree should clear WTFLogChannelState::OnWithAccumulation state set by testR...
Hironori.Fujii@sony.com [Wed, 16 Oct 2019 18:15:01 +0000 (18:15 +0000)]
DumpRenderTree should clear WTFLogChannelState::OnWithAccumulation state set by testRunner.accummulateLogsForChannel
https://bugs.webkit.org/show_bug.cgi?id=203024

Reviewed by Alex Christensen.

Source/WebCore:

* platform/LogInitialization.h:
* platform/Logging.cpp:
(WebCore::clearAllLogChannelsToAccumulate): Added.
* platform/Logging.h:
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::clearAllLogChannelsToAccumulate): Added.
* testing/js/WebCoreTestSupport.h:

Tools:

If a test case calls testRunner.accummulateLogsForChannel("IndexedDB"),
all subsequent IndexedDB tests also dump the log.
This is unnecessarily bloating DumpRenderTree log because
DumpRenderTree is run with --debug-rwt-logging switch on Buildbot.

Add a function to clear WTFLogChannelState::OnWithAccumulation
state, and call it for every test execution.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebViewToConsistentStateBeforeTesting):
* DumpRenderTree/win/DumpRenderTree.cpp:
(resetWebViewToConsistentStateBeforeTesting):
Call WebCoreTestSupport::clearAllLogChannelsToAccumulate.

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

7 weeks agoRemove an API test workaround that is no longer needed
wenson_hsieh@apple.com [Wed, 16 Oct 2019 17:37:06 +0000 (17:37 +0000)]
Remove an API test workaround that is no longer needed
https://bugs.webkit.org/show_bug.cgi?id=203037

Reviewed by Tim Horton.

This worked around <rdar://problem/51510554> by avoiding codepaths that resulted in failure to read dropped
content from NSItemProviders on iOS. <rdar://problem/51510554> is fixed in iOS 13, so we can remove this hack.

* TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[TestWKWebView initWithFrame:configuration:addToWindow:]):
(applyWorkaroundToAllowWritingAttributedStringsToItemProviders): Deleted.

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

7 weeks ago[Tools] Add a driver for cog for benchmark_runner.py
psaavedra@igalia.com [Wed, 16 Oct 2019 17:26:10 +0000 (17:26 +0000)]
[Tools] Add a driver for cog for benchmark_runner.py
https://bugs.webkit.org/show_bug.cgi?id=202995

Reviewed by Žan Doberšek.

* Scripts/webkitpy/benchmark_runner/browser_driver/linux_cog_driver.py: Added.
(CogBrowserDriver):
(CogBrowserDriver.launch_url):
(CogBrowserDriver.launch_driver):
(CogFdoBrowserDriver):
(CogFdoBrowserDriver.launch_url):

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

7 weeks agoUnreviewed, fix the internal macOS 10.13 and 10.14 builds after r251171
wenson_hsieh@apple.com [Wed, 16 Oct 2019 17:12:05 +0000 (17:12 +0000)]
Unreviewed, fix the internal macOS 10.13 and 10.14 builds after r251171

Source/WebKit:

* Platform/spi/mac/ApplicationServicesSPI.h: Guard SPI declarations that use AXClientType with HAVE(AX_CLIENT_TYPE).

Source/WTF:

* wtf/Platform.h: Add a HAVE() macro for AXClientType, which is only available on macOS 10.15+ SDKs.

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

7 weeks agoCorrect TestExpectations from r251119.
russell_e@apple.com [Wed, 16 Oct 2019 17:07:38 +0000 (17:07 +0000)]
Correct TestExpectations from r251119.
https://bugs.webkit.org/show_bug.cgi?id=202826

Unreviewed Test Gardening.

* platform/ios/TestExpectations:

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

7 weeks agoWebAudioSourceProviderAVFObjC::provideInput should set its WebAudioBufferList paramet...
youenn@apple.com [Wed, 16 Oct 2019 16:48:48 +0000 (16:48 +0000)]
WebAudioSourceProviderAVFObjC::provideInput should set its WebAudioBufferList parameters correctly
https://bugs.webkit.org/show_bug.cgi?id=202930
<rdar://problem/56006776>

Reviewed by Eric Carlson.

Source/WebCore:

There is a time where the bus channel number and audio source channel numbers may be different.
In case the bus channel number is less than the audio source channel number, initialization of
the WebAudioBufferList might not be fully done.
In that case, output silence and return early.
Reduce the number of frames to process based on the number of frames the output audio bus plans to process.

Partially covered by new API test (this a race so we cannot reproduce the crash easily).

* Modules/webaudio/MediaStreamAudioSourceNode.cpp:
(WebCore::MediaStreamAudioSourceNode::process):
Make sure to process the number of frames the output bus expect.
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
(WebCore::WebAudioSourceProviderAVFObjC::provideInput):

Tools:

Add a test that has an audio track that goes from 1 to 2 channels while being piped to a WebAudio pipeline.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/GetUserMedia.mm:
(-[GUMMessageHandler userContentController:didReceiveScriptMessage:]):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/getUserMedia-webaudio.html: Added.

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

7 weeks agoRemove duplicate MathML tests
commit-queue@webkit.org [Wed, 16 Oct 2019 14:43:41 +0000 (14:43 +0000)]
Remove duplicate MathML tests
https://bugs.webkit.org/show_bug.cgi?id=202979

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

Remove mo-form-dynamic.html, this got imported
as presentation-markup/operators/mo-form-dynamic.html.

Remove mo-form-minus-plus.html, this got imported
as presentation-markup/operators/mo-form-minus-plus.html.

Remove mo-form-fallback.html, this got imported
as presentation-markup/operators/mo-form-fallback.html.

* mathml/presentation/mo-form-dynamic-expected.html: Removed.
* mathml/presentation/mo-form-dynamic-expected.html: Removed.
* mathml/presentation/mo-form-dynamic.html: Removed.
* mathml/presentation/mo-form-fallback-expected.html: Removed.
* mathml/presentation/mo-form-fallback.html: Removed.
* mathml/presentation/mo-form-minus-plus-expected.html: Removed.
* mathml/presentation/mo-form-minus-plus.html: Removed.

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

7 weeks ago[LFC][TFC] TableFormattingContext::distributeExtraHorizontalSpace should not ignore...
zalan@apple.com [Wed, 16 Oct 2019 13:27:19 +0000 (13:27 +0000)]
[LFC][TFC] TableFormattingContext::distributeExtraHorizontalSpace should not ignore fixed width columns
https://bugs.webkit.org/show_bug.cgi?id=203010

Reviewed by Antti Koivisto.

Fixed width columns (e.g. <col width=100px>) don't participate in the extra horizontal space distribution.

* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computedTableWidth):
(WebCore::Layout::TableFormattingContext::distributeExtraHorizontalSpace):
(WebCore::Layout::TableFormattingContext::distributeAvailableWidth): Deleted.
* layout/tableformatting/TableFormattingContext.h:
* layout/tableformatting/TableGrid.cpp:
(WebCore::Layout::TableGrid::Column::hasFixedWidth const):
(WebCore::Layout::TableGrid::widthConstraints const):
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::totalHorizontalSpacing const):
(WebCore::Layout::TableGrid::columnsContext const):

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

7 weeks ago[GTK][WPE] ASSERTION FAILED: blob in SQLiteStatement.cpp(163) : int WebCore::SQLiteSt...
carlosgc@webkit.org [Wed, 16 Oct 2019 10:57:25 +0000 (10:57 +0000)]
[GTK][WPE] ASSERTION FAILED: blob in SQLiteStatement.cpp(163) : int WebCore::SQLiteStatement::bindBlob()
https://bugs.webkit.org/show_bug.cgi?id=202976

Reviewed by Adrian Perez de Castro.

This is because IconDatabases passes a nullptr blob to store emtpty icons. sqlite3_bind_blob() allows nullptr as
blob, so we shouldn't assert.

* platform/sql/SQLiteStatement.cpp:
(WebCore::SQLiteStatement::bindBlob): Update the assert to only fail when blob is nullptr and size > 0.

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

7 weeks ago[CSS Shadow Parts] Import css/css-shadow-parts/simple-inline.html WPT
antti@apple.com [Wed, 16 Oct 2019 09:47:41 +0000 (09:47 +0000)]
[CSS Shadow Parts] Import css/css-shadow-parts/simple-inline.html WPT
https://bugs.webkit.org/show_bug.cgi?id=203029

Reviewed by Adrian Perez de Castro.

* web-platform-tests/css/css-shadow-parts/simple-inline-expected.txt: Added.
* web-platform-tests/css/css-shadow-parts/simple-inline.html: Added.
* web-platform-tests/css/css-shadow-parts/w3c-import.log:

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

7 weeks agoUnreviewed build fix for Windows ports
Hironori.Fujii@sony.com [Wed, 16 Oct 2019 09:11:15 +0000 (09:11 +0000)]
Unreviewed build fix for Windows ports
https://bugs.webkit.org/show_bug.cgi?id=203016
<rdar://problem/56317774>

* page/DOMTimer.h: Added WEBCORE_EXPORT to ~DOMTimer().

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

7 weeks agoimage/apng not recognized in source tag
clopez@igalia.com [Wed, 16 Oct 2019 09:00:55 +0000 (09:00 +0000)]
image/apng not recognized in source tag
https://bugs.webkit.org/show_bug.cgi?id=202785

Reviewed by Dean Jackson.

Source/WebCore:

Add image/apng as supported mime type for images on Mac/iOS and
on all the other platforms that enable apng support.

This fixes the test imported/w3c/web-platform-tests/apng/supported-in-source-type.html

* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::supportedImageMIMETypes):

LayoutTests:

* TestExpectations: Remove test imported/w3c/web-platform-tests/apng/supported-in-source-type.html
from the list of expected failures.

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

7 weeks ago[GTK][WPE] Add user messages API
carlosgc@webkit.org [Wed, 16 Oct 2019 07:36:24 +0000 (07:36 +0000)]
[GTK][WPE] Add user messages API
https://bugs.webkit.org/show_bug.cgi?id=202847

Reviewed by Adrian Perez de Castro.

Source/WebCore/platform/gtk/po:

* POTFILES.in: Add new files containing translatable strings.

Source/WebKit:

We have never exposed an API to send/receive messages to/from Web extensions, to allow applications use their own
IPC. Now, with PSON enabled, it's a lot more difficult to implement the custom IPC on the application side,
because applications need to keep track of all the web processes launched, and the changes of web process in the
web view to send the messages to the right extension. That's already done internally by WebKit, so it would be
easier to provide a simple API so that apps don't need to worry about the web process being used. This patch adds
WebKitUserMessage, a simple message API consisting on a message name, parameters and file descriptors. Messages
can be sent from a WebKitWebContext to all the WebKitWebExtensions, or from a WebKitWebExtension to its
WebKitWebContext, or from a WebKitWebView to its WebKitWebPage (and vice versa).

* PlatformGTK.cmake:
* PlatformWPE.cmake:
* Shared/API/glib/WebKitUserMessage.cpp: Added.
(webkitUserMessageDispose):
(webkitUserMessageGetProperty):
(webkitUserMessageSetProperty):
(webkit_user_message_class_init):
(webkitUserMessageCreate):
(webkitUserMessageGetMessage):
(webkit_user_message_new):
(webkit_user_message_new_with_fd_list):
(webkit_user_message_get_name):
(webkit_user_message_get_parameters):
(webkit_user_message_get_fd_list):
(webkit_user_message_send_reply):
* Shared/API/glib/WebKitUserMessagePrivate.h: Added.
* Shared/glib/ArgumentCodersGLib.cpp: Added.
(IPC::encode):
(IPC::decode):
* Shared/glib/ArgumentCodersGLib.h: Added.
* Shared/glib/UserMessage.cpp: Added.
(WebKit::UserMessage::encode const):
(WebKit::UserMessage::decode):
* Shared/glib/UserMessage.h: Added.
(WebKit::UserMessage::UserMessage):
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/glib/WebKitWebContext.cpp:
(webkitWebContextConstructed):
(webkit_web_context_class_init):
(webkit_web_context_send_message_to_all_extensions):
* UIProcess/API/glib/WebKitWebView.cpp:
(webkit_web_view_class_init):
(webkitWebViewDidReceiveUserMessage):
(webkit_web_view_send_message_to_page):
(webkit_web_view_send_message_to_page_finish):
* UIProcess/API/glib/WebKitWebViewPrivate.h:
* UIProcess/API/gtk/WebKitUserMessage.h: Added.
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/gtk/WebKitWebView.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/gtk/webkit2.h:
* UIProcess/API/wpe/APIViewClient.h:
(API::ViewClient::didReceiveUserMessage):
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::sendMessageToWebView):
* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::View::didReceiveUserMessage):
* UIProcess/API/wpe/WPEView.h:
* UIProcess/API/wpe/WebKitUserMessage.h: Added.
* UIProcess/API/wpe/WebKitWebContext.h:
* UIProcess/API/wpe/WebKitWebView.h:
* UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
* UIProcess/API/wpe/docs/wpe-docs.sgml:
* UIProcess/API/wpe/webkit.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* UIProcess/glib/WebProcessProxyGLib.cpp:
(WebKit::WebProcessProxy::sendMessageToWebContextWithReply):
(WebKit::WebProcessProxy::sendMessageToWebContext):
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::sendMessageToWebViewWithReply):
(WebKit::WebPageProxy::sendMessageToWebView):
* UIProcess/wpe/WebPageProxyWPE.cpp:
(WebKit::WebPageProxy::sendMessageToWebViewWithReply):
(WebKit::WebPageProxy::sendMessageToWebView):
* WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.h:
(WebKit::WebKitExtensionManager::extension const):
* WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp:
(webkitWebExtensionDidReceiveUserMessage):
(webkit_web_extension_send_message_to_context):
(webkit_web_extension_send_message_to_context_finish):
* WebProcess/InjectedBundle/API/glib/WebKitWebExtensionPrivate.h:
* WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
(webkit_web_page_class_init):
(webkitWebPageDidReceiveUserMessage):
(webkit_web_page_send_message_to_view):
(webkit_web_page_send_message_to_view_finish):
* WebProcess/InjectedBundle/API/glib/WebKitWebPagePrivate.h:
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h:
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h:
* WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
* WebProcess/InjectedBundle/API/wpe/WebKitWebExtension.h:
* WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h:
* WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-1.0-sections.txt:
* WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/glib/WebPageGLib.cpp: Added.
(WebKit::WebPage::sendMessageToWebExtensionWithReply):
(WebKit::WebPage::sendMessageToWebExtension):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/glib/WebProcessGLib.cpp:
(WebKit::WebProcess::sendMessageToWebExtension):

Tools:

Add a test to check the new API.

* TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp:
(UserMessageTest::webViewUserMessageReceivedCallback):
(UserMessageTest::webContextUserMessageReceivedCallback):
(UserMessageTest::UserMessageTest):
(UserMessageTest::~UserMessageTest):
(UserMessageTest::sendMessage):
(UserMessageTest::sendMedssageToAllExtensions):
(UserMessageTest::viewUserMessageReceived):
(UserMessageTest::contextUserMessageReceived):
(UserMessageTest::waitUntilViewMessageReceived):
(UserMessageTest::waitUntilContextMessageReceived):
(readFileDescritpor):
(testWebExtensionUserMessages):
(beforeAll):
* TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp:
(documentLoadedCallback):
(pageMessageReceivedCallback):
(pageCreatedCallback):
(extensionMessageReceivedCallback):
(webkit_web_extension_initialize_with_user_data):

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