WebKit-https.git
2 years agoFix Windows build after r233268.
simon.fraser@apple.com [Wed, 27 Jun 2018 20:01:49 +0000 (20:01 +0000)]
Fix Windows build after r233268.

* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::hasContents const):
* platform/graphics/ca/win/PlatformCALayerWin.h:

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

2 years agoAdd Cross-Origin-Resource-Policy tests for workers and service workers
youenn@apple.com [Wed, 27 Jun 2018 19:59:17 +0000 (19:59 +0000)]
Add Cross-Origin-Resource-Policy tests for workers and service workers
https://bugs.webkit.org/show_bug.cgi?id=187030

Reviewed by Chris Dumez.

* web-platform-tests/fetch/cross-origin-resource-policy/fetch-in-service-worker-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/fetch-in-service-worker.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/fetch.any-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/fetch.any.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/fetch.any.js: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/cross-origin-resource-policy/fetch.html.
* web-platform-tests/fetch/cross-origin-resource-policy/fetch.any.worker-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/fetch.any.worker.html: Added.

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

2 years ago[LFC] Out-of-flow positioned element's height depends on its containing block's height.
zalan@apple.com [Wed, 27 Jun 2018 19:23:13 +0000 (19:23 +0000)]
[LFC] Out-of-flow positioned element's height depends on its containing block's height.
https://bugs.webkit.org/show_bug.cgi?id=187082

Reviewed by Antti Koivisto.

We can't really compute the final height of an out-of-flow element until after its containing block's height is computed.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
* layout/FormattingContext.h:
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::updateLayout):
(WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
* layout/LayoutContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
* layout/layouttree/LayoutContainer.h:
(WebCore::Layout::Container::outOfFlowDescendants const):
(WebCore::Layout::Container::outOfFlowDescendants): Deleted.

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

2 years ago[Wincairo] Add support for context menus to non-legacy minibrowser
commit-queue@webkit.org [Wed, 27 Jun 2018 19:19:16 +0000 (19:19 +0000)]
[Wincairo] Add support for context menus to non-legacy minibrowser
https://bugs.webkit.org/show_bug.cgi?id=186815.

Patch by Stephan Szabo <stephan.szabo@sony.com> on 2018-06-27
Reviewed by Ryosuke Niwa.

* UIProcess/WebPageProxy.h:
* UIProcess/win/PageClientImpl.cpp:
(WebKit::PageClientImpl::viewWidget):
* UIProcess/win/PageClientImpl.h:
* UIProcess/win/WebContextMenuProxyWin.cpp:
(WebKit::WebContextMenuProxyWin::show):
(WebKit::createMenu):
(WebKit::createMenuItem):
(WebKit::populate):
(WebKit::WebContextMenuProxyWin::showContextMenuWithItems):
(WebKit::WebContextMenuProxyWin::WebContextMenuProxyWin):
(WebKit::WebContextMenuProxyWin::~WebContextMenuProxyWin):
* UIProcess/win/WebContextMenuProxyWin.h:
* UIProcess/win/WebPageProxyWin.cpp:
(WebKit::WebPageProxy::viewWidget):
* UIProcess/win/WebView.cpp:
(WebKit::WebView::wndProc):
(WebKit::WebView::onMenuCommand):
* UIProcess/win/WebView.h:

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

2 years agoDisable content blockers in NetworkLoadChecker except for ping loads
youenn@apple.com [Wed, 27 Jun 2018 18:23:06 +0000 (18:23 +0000)]
Disable content blockers in NetworkLoadChecker except for ping loads
https://bugs.webkit.org/show_bug.cgi?id=187083
<rdar://problem/41440083>

Reviewed by Chris Dumez.

Source/WebCore:

Add internals API to reload a frame without content extensions.

Test: http/tests/contentextensions/reload-without-contentextensions.html

* testing/Internals.cpp:
(WebCore::Internals::reloadWithoutContentExtensions):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
* NetworkProcess/NetworkLoadChecker.h:
(WebKit::NetworkLoadChecker::enableContentExtensionsCheck):
* NetworkProcess/PingLoad.cpp:

LayoutTests:

* http/tests/contentextensions/reload-without-contentextensions-expected.txt: Added.
* http/tests/contentextensions/reload-without-contentextensions.html: Added.
* http/tests/contentextensions/reload-without-contentextensions.html.json: Added.

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

2 years agohttps://hackernoon.com/ uses lots of layer backing store
simon.fraser@apple.com [Wed, 27 Jun 2018 18:22:06 +0000 (18:22 +0000)]
https://hackernoon.com/ uses lots of layer backing store
https://bugs.webkit.org/show_bug.cgi?id=186909
rdar://problem/40257540

Reviewed by Tim Horton.

Source/bmalloc:

Drive-by typo fix.

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

Source/WebCore:

The existing "backing store detached" logic, which was used to eliminate backing store
for compositing layers outside the viewport, had a number of bugs that allowed layers
to have backing store when they should not.

Specifically, any code path that ended up in setNeedsDisplay{InRect}() in PlatformCALayer
could trigger backing store creation on layers that should have never had any.

Rather than monkeypatch all the GraphicsLayerCA call sites that call setNeedsDisplay{InRect}(),
just bail early from the PlatformCALayer* methods that trigger repaints.

Tests didn't catch this because they just dumped the state of the backingStoreAttached flag. To fix this,
create backingStoreAttachedForTesting() which also tests whether the layer has contents.

Test: compositing/backing/backing-store-attachment-outside-viewport.html

* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::dumpProperties const):
(showGraphicsLayerTree):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::backingStoreAttachedForTesting const):
* platform/graphics/GraphicsLayerClient.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::backingStoreAttachedForTesting const):
(WebCore::GraphicsLayerCA::setNeedsDisplay):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::setNeedsDisplay):
(PlatformCALayerCocoa::setNeedsDisplayInRect):
(PlatformCALayerCocoa::hasContents const):

Source/WebKit:

PlatformCALayerRemote was actually holding onto backing stores for layers with
backing store detached, which could increase memory use. When told that backing stores
are not attached, explicitly throw away the backing, and re-create it (via setNeedsDisplay)
when attached. This is now similar to what PlatformLayerCACocoa does.

* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::setNeedsDisplayInRect):
(WebKit::PlatformCALayerRemote::setNeedsDisplay):
(WebKit::PlatformCALayerRemote::hasContents const):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:

LayoutTests:

New test.

* compositing/backing/backing-store-attachment-outside-viewport-expected.txt: Added.
* compositing/backing/backing-store-attachment-outside-viewport.html: Added.

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

2 years agoFix clang static analyzer warnings: Branch condition evaluates to a garbage value
ddkilzer@apple.com [Wed, 27 Jun 2018 18:07:00 +0000 (18:07 +0000)]
Fix clang static analyzer warnings: Branch condition evaluates to a garbage value
<https://webkit.org/b/186968>

Reviewed by Zalan Bujtas.

This patch changes two stack-allocated `bool` variables into
`std::optional<bool>` since the functions that set the variable
may return early without setting it.  It also changes one
stack-allocated pointer to be initialized to `nullptr`.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSTransitionsForElement):
Update for change to CSSPropertyAnimation::getPropertyAtIndex()
argument type.

* editing/ios/EditorIOS.mm:
(WebCore::Editor::writeImageToPasteboard): Initialize
`cachedImage` stack pointer to nullptr since getImage() has an
early return that doesn't set `cachedImage`.
* editing/mac/EditorMac.mm:
(WebCore::Editor::writeImageToPasteboard): Ditto.

* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimation::getPropertyAtIndex):
* page/animation/CSSPropertyAnimation.h:
(WebCore::CSSPropertyAnimation::getPropertyAtIndex):
- Change method to take `std::optional<bool>` instead of `bool`
  as second argument since the method may return early without
  setting `isShorthand`.

* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::updateTransitions): Update for
change to CSSPropertyAnimation::getPropertyAtIndex() argument
type.

* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::placeBoxesInBlockDirection): Also
rename local `emphasisMarkIsOver` to `emphasisMarkIsAbove` to
match other call sites.
(WebCore::InlineFlowBox::addTextBoxVisualOverflow):
(WebCore::InlineFlowBox::computeOverAnnotationAdjustment const):
(WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const):
- Update for change to InlineTextBox::emphasisMarkExistsAndIsAbove()
  argument type.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
- Change method to take `std::optional<bool>` instead of `bool`
  as second argument since the method may return early without
  setting `above`.
(WebCore::InlineTextBox::paintMarkedTextForeground):
- Update for change to InlineTextBox::emphasisMarkExistsAndIsAbove()
  argument type.
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
- Change method to take `std::optional<bool>` instead of `bool`.

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

2 years agoEnable WebKit iOS 12 build
jbedard@apple.com [Wed, 27 Jun 2018 18:02:56 +0000 (18:02 +0000)]
Enable WebKit iOS 12 build
https://bugs.webkit.org/show_bug.cgi?id=187024
<rdar://problem/39759057>

Reviewed by David Kilzer.

Source/WebCore/PAL:

* pal/cf/CoreMediaSoftLink.cpp: Condition some CoreMedia functions on version.
* pal/cf/CoreMediaSoftLink.h: Ditto.
* pal/spi/cocoa/NSXPCConnectionSPI.h: Use XPCSPI.h instead of xpc.h.
* pal/spi/ios/QuickLookSPI.h: QLItem adopts QLPreviewItem.
* pal/spi/ios/SystemPreviewSPI.h: Fix compiler errors.

Source/WebKit:

* Platform/spi/ios/PDFKitSPI.h: Added PDFKit SPI.
* Platform/spi/ios/UIKitSPI.h: Add new UIKit SPI and UICompositingMode enumeration.
* UIProcess/ios/WKPDFView.mm: Use PDFKitSPI header.
* UIProcess/ios/WKSystemPreviewView.mm: Use CoreGraphicsSPI.h.
* UIProcess/ios/fullscreen/WKFullscreenStackView.mm: Use QuartzCoreSPI.h.

Source/WTF:

* wtf/spi/darwin/XPCSPI.h: Add endpoint and connection declarations.

Tools:

* Scripts/configure-xcode-for-ios-development:
(copyMissingHeadersFromSDKToSDKIfNeeded): Copy launch.h into embedded SDKs.

WebKitLibraries:

* WebKitPrivateFrameworkStubs/iOS/12: Added.

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

2 years agoCSS Animation Triggers is not an experimental feature, should be globally off by...
timothy_horton@apple.com [Wed, 27 Jun 2018 17:59:37 +0000 (17:59 +0000)]
CSS Animation Triggers is not an experimental feature, should be globally off by default

Reviewed by Dean Jackson.

* Shared/WebPreferences.yaml:

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

2 years agoPromote the Secure Context API feature from experimental-yet-on-by-default to always-on
timothy_horton@apple.com [Wed, 27 Jun 2018 17:41:09 +0000 (17:41 +0000)]
Promote the Secure Context API feature from experimental-yet-on-by-default to always-on

Reviewed by Dan Bates.

* Shared/WebPreferences.yaml:
Secure Context API is on by default, it's not experimental anymore.

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

2 years agoMake Link Preload an on-by-default feature
timothy_horton@apple.com [Wed, 27 Jun 2018 17:38:27 +0000 (17:38 +0000)]
Make Link Preload an on-by-default feature
https://bugs.webkit.org/show_bug.cgi?id=187104

Reviewed by Ryosuke Niwa.

* Shared/WebPreferences.yaml:
This should be on, not experimental. It already shipped on in the past.

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

2 years ago[WSL] Add a control-flow stack to the execution rules in WSL.ott
rmorisset@apple.com [Wed, 27 Jun 2018 17:01:33 +0000 (17:01 +0000)]
[WSL] Add a control-flow stack to the execution rules in WSL.ott
https://bugs.webkit.org/show_bug.cgi?id=186310

Rubberstamped by Filip Pizlo.

The goal of this is to enable (future) rules about uniform control flow for barriers.
It required adding two new special construct: Join(s) and JoinExpr(e) whose only role is to pop the last element of the stack.

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

2 years agoRegression(r233208): Completion handler does not get called on GTK port
cdumez@apple.com [Wed, 27 Jun 2018 16:36:42 +0000 (16:36 +0000)]
Regression(r233208): Completion handler does not get called on GTK port
https://bugs.webkit.org/show_bug.cgi?id=187099

Reviewed by Antti Koivisto.

Make sure UpdatePrevalentDomainsToPartitionOrBlockCookiesHandler's completion handler
gets called on non-COCOA ports.

* UIProcess/WebResourceLoadStatisticsStore.h:

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

2 years ago[LFC] Move formatting context root layout logic to a dedicated function.
zalan@apple.com [Wed, 27 Jun 2018 16:18:00 +0000 (16:18 +0000)]
[LFC] Move formatting context root layout logic to a dedicated function.
https://bugs.webkit.org/show_bug.cgi?id=187097

Reviewed by Antti Koivisto.

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

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

2 years ago[LFC] Compute static position for out-of-flow elements only when required.
zalan@apple.com [Wed, 27 Jun 2018 16:13:48 +0000 (16:13 +0000)]
[LFC] Compute static position for out-of-flow elements only when required.
https://bugs.webkit.org/show_bug.cgi?id=187096

Reviewed by Antti Koivisto.

Computing static position for out-of-flow elements could be somewhat expensive, so let's not do it unless we actually need it.

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
(WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
(WebCore::Layout::BlockFormattingContext::Geometry::staticPositionForOutOfFlowPositioned): Deleted.

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

2 years ago[GTK][WPE] Update expectations for WebDriver tests.
Ms2ger@igalia.com [Wed, 27 Jun 2018 16:13:43 +0000 (16:13 +0000)]
[GTK][WPE] Update expectations for WebDriver tests.
https://bugs.webkit.org/show_bug.cgi?id=187098

Unreviewed gardening.

* TestExpectations.json:

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

2 years agoAX: [iOS] Remove the ability to set keyboard focus when VoiceOver takes focus
n_wang@apple.com [Wed, 27 Jun 2018 16:10:21 +0000 (16:10 +0000)]
AX: [iOS] Remove the ability to set keyboard focus when VoiceOver takes focus
https://bugs.webkit.org/show_bug.cgi?id=187076

Reviewed by Chris Fleizach.

Source/WebCore:

We shouldn't set keyboard focus when assistive technology takes focus since
this is causing website incompatibility issues by causing focus to be lost.

Test: accessibility/ios-simulator/accessibility-focus-do-not-set-focus.html

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]):

LayoutTests:

* accessibility/ios-simulator/accessibility-focus-do-not-set-focus-expected.txt: Added.
* accessibility/ios-simulator/accessibility-focus-do-not-set-focus.html: Added.
* accessibility/ios-simulator/dom-focus-fires-on-correct-element-expected.txt: Removed.
* accessibility/ios-simulator/dom-focus-fires-on-correct-element.html: Removed.

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

2 years ago[WSL] Fix minor formatting issues in the grammar section
rmorisset@apple.com [Wed, 27 Jun 2018 15:14:45 +0000 (15:14 +0000)]
[WSL] Fix minor formatting issues in the grammar section
https://bugs.webkit.org/show_bug.cgi?id=186310

Rubberstamped by Filip Pizlo.

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

2 years agoMIME type subclass check should guard against small strings
mcatanzaro@igalia.com [Wed, 27 Jun 2018 15:07:10 +0000 (15:07 +0000)]
MIME type subclass check should guard against small strings
https://bugs.webkit.org/show_bug.cgi?id=186977

Reviewed by Carlos Garcia Campos.

Sadly, this code is duplicated between two different files because it is not good.

* xdgmime/README.webkit:
* xdgmime/src/xdgmime.c:
(ends_with):
(xdg_mime_is_super_type):
* xdgmime/src/xdgmimecache.c:
(ends_with):
(is_super_type):

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

2 years ago[WSL] Put the full grammar in the Sphinx document
rmorisset@apple.com [Wed, 27 Jun 2018 15:04:07 +0000 (15:04 +0000)]
[WSL] Put the full grammar in the Sphinx document
https://bugs.webkit.org/show_bug.cgi?id=186310

Rubberstamped by Filip Pizlo.

Put the grammar's production rules in the Sphinx document, along with a few comments and the rules for desugaring.
Also includes a bit of clean-up of the antlr rules.

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

2 years agoDFG's compileReallocatePropertyStorage() and compileAllocatePropertyStorage() slow...
mark.lam@apple.com [Wed, 27 Jun 2018 11:19:46 +0000 (11:19 +0000)]
DFG's compileReallocatePropertyStorage() and compileAllocatePropertyStorage() slow paths should also clear unused properties.
https://bugs.webkit.org/show_bug.cgi?id=187091
<rdar://problem/41395624>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/regress-187091.js: Added.

Source/JavaScriptCore:

Previously, when compileReallocatePropertyStorage() and compileAllocatePropertyStorage()
take their slow paths, the slow path would jump back to the fast path right after
the emitted code which clears the unused property values.  As a result, the
unused properties are not initialized.  We've fixed this by adding the slow path
generators before we emit the code to clear the unused properties.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
(JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):

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

2 years ago[JSC] ArrayPatternNode::emitDirectBinding does not return assignment target value...
utatane.tea@gmail.com [Wed, 27 Jun 2018 10:05:50 +0000 (10:05 +0000)]
[JSC] ArrayPatternNode::emitDirectBinding does not return assignment target value if dst is nullptr
https://bugs.webkit.org/show_bug.cgi?id=185943

Reviewed by Mark Lam.

JSTests:

* stress/direct-binding-return-result.js: Added.
(shouldBe):
(test):

Source/JavaScriptCore:

ArrayPatternNode::emitDirectBinding should return a register with an assignment target instead of filling
the result with undefined if `dst` is nullptr. While `dst == ignoredResult()` means we do not require
the result, `dst == nullptr` just means "dst is required, but a register for dst is not allocated.".
This patch fixes emitDirectBinding to return an appropriate value with an allocated register for dst.

ArrayPatternNode::emitDirectBinding() should be removed later since it does not follow array spreading protocol,
but it should be done in a separate patch since it would be performance sensitive.

* bytecompiler/NodesCodegen.cpp:
(JSC::ArrayPatternNode::emitDirectBinding):

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

2 years agoMove clearChildNeedsStyleRecalc into resetStyleForNonRenderedDescendants.
emilio@crisal.io [Wed, 27 Jun 2018 09:34:25 +0000 (09:34 +0000)]
Move clearChildNeedsStyleRecalc into resetStyleForNonRenderedDescendants.
https://bugs.webkit.org/show_bug.cgi?id=186881

Reviewed by Antti Koivisto.

Every caller does this already.

No new tests, no change in behavior.

* style/StyleTreeResolver.cpp:
(WebCore::Style::resetStyleForNonRenderedDescendants):
(WebCore::Style::TreeResolver::resolveComposedTree):

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

2 years agoWhen trying to print a very long email on iOS, the print preview is blank
timothy_horton@apple.com [Wed, 27 Jun 2018 08:27:40 +0000 (08:27 +0000)]
When trying to print a very long email on iOS, the print preview is blank
https://bugs.webkit.org/show_bug.cgi?id=187077
<rdar://problem/41107013>

Reviewed by Timothy Hatcher.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):
ChildProcessProxy::sendSync has a (surprising) default timeout of 1 second,
(as opposed to Connection::sendSync's default timeout of ∞ seconds).
The printing path already waits ∞ seconds for the final PDF, but currently
uses the default 1 second timeout for page count computation. If page
count computation takes more than 1 second, the preview will be blank.
Since the print preview is generated asynchronously, we really want
to wait until it's done, and not give up after 1 second.

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

2 years ago[GTK][WPE] Remove gflags from libwebrtc build
utatane.tea@gmail.com [Wed, 27 Jun 2018 08:19:05 +0000 (08:19 +0000)]
[GTK][WPE] Remove gflags from libwebrtc build
https://bugs.webkit.org/show_bug.cgi?id=187078

Reviewed by Alejandro G. Castro.

gflags is used only in libyuv unit tests. So the Apple ports do not build & link it.
GTK and WPE can do the same thing: not building gflags. By doing so, we can achieve
the following results.

1. Remove static initializers defined for gflags.
2. Reduce binary size.

* CMakeLists.txt:

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

2 years ago[GStreamer] Coverity scan issues
tpopela@redhat.com [Wed, 27 Jun 2018 08:16:59 +0000 (08:16 +0000)]
[GStreamer] Coverity scan issues
https://bugs.webkit.org/show_bug.cgi?id=187087

Reviewed by Xabier Rodriguez-Calvar.

Fix uninitialized members.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:

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

2 years ago[GCrypt] Move definitions of GCryptUtilities helpers into a separate source file
zandobersek@gmail.com [Wed, 27 Jun 2018 08:13:10 +0000 (08:13 +0000)]
[GCrypt] Move definitions of GCryptUtilities helpers into a separate source file
https://bugs.webkit.org/show_bug.cgi?id=187033

Reviewed by Michael Catanzaro.

Move the GCryptUtilities helpers that operate on libgcrypt values and
constants into a separate source file. This limits a bit the amount of
inlining the compiler might feel compelled to do, and the resulting
shared library is 8kB smaller in size.

* crypto/gcrypt/GCryptUtilities.cpp: Copied from Source/WebCore/crypto/gcrypt/GCryptUtilities.h.
(WebCore::hmacAlgorithm):
(WebCore::digestAlgorithm):
(WebCore::hashCryptoDigestAlgorithm):
(WebCore::mpiLength):
(WebCore::mpiData):
(WebCore::mpiZeroPrefixedData):
(WebCore::mpiSignedData):
* crypto/gcrypt/GCryptUtilities.h:
(WebCore::hmacAlgorithm): Deleted.
(WebCore::digestAlgorithm): Deleted.
(WebCore::hashCryptoDigestAlgorithm): Deleted.
(WebCore::mpiLength): Deleted.
(WebCore::mpiData): Deleted.
(WebCore::mpiZeroPrefixedData): Deleted.
(WebCore::mpiSignedData): Deleted.
* platform/SourcesGCrypt.txt:

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

2 years ago[iPad apps on macOS] Unable to interact with video elements that have started playing
wenson_hsieh@apple.com [Wed, 27 Jun 2018 05:06:51 +0000 (05:06 +0000)]
[iPad apps on macOS] Unable to interact with video elements that have started playing
https://bugs.webkit.org/show_bug.cgi?id=187073
<rdar://problem/40591107>

Reviewed by Tim Horton.

Source/WebCore/PAL:

Define an SPI method on CALayer. See WebKit ChangeLog for more detail.

* pal/spi/cocoa/QuartzCoreSPI.h:

Source/WebKit:

On iOS, we currently force remote hosting contexts to be non-interactive by passing in `kCAContextIgnoresHitTest`
when creating the CAContext. However, this flag is not respected by CoreAnimation when running iOS apps on macOS.
This means all HID events dispatched over a video that has been played (which causes WebKit to insert a
CALayerHost-backed WKRemoteView in the view hierarchy) will be routed to the context ID of the video's CAContext
rather than the context ID of the key window containing the WKWebView.

This subsequently causes all gesture recognizers (hover, touch, tap, long press) to fail recognition when
running iOS apps on macOS. To address this, we set a flag on WKRemoteView's CALayerHost to prevent hit-testing
to the remote layer. This allows us to avoid routing HID events to the wrong context, and instead target the
main UIWindow.

Manually verified that click, touch, and mouseenter/mouseleave events are dispatched when interacting over a
video element.

* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(-[WKRemoteView initWithFrame:contextID:]):

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

2 years ago[JSC] Pass VM& to functions more
utatane.tea@gmail.com [Wed, 27 Jun 2018 05:01:29 +0000 (05:01 +0000)]
[JSC] Pass VM& to functions more
https://bugs.webkit.org/show_bug.cgi?id=186241

Reviewed by Mark Lam.

Source/JavaScriptCore:

This patch threads VM& to functions requiring VM& more.

* API/JSObjectRef.cpp:
(JSObjectIsConstructor):
* bytecode/AdaptiveInferredPropertyValueWatchpointBase.cpp:
(JSC::AdaptiveInferredPropertyValueWatchpointBase::install):
(JSC::AdaptiveInferredPropertyValueWatchpointBase::fire):
(JSC::AdaptiveInferredPropertyValueWatchpointBase::StructureWatchpoint::fireInternal):
(JSC::AdaptiveInferredPropertyValueWatchpointBase::PropertyWatchpoint::fireInternal):
* bytecode/AdaptiveInferredPropertyValueWatchpointBase.h:
* bytecode/CodeBlockJettisoningWatchpoint.cpp:
(JSC::CodeBlockJettisoningWatchpoint::fireInternal):
* bytecode/CodeBlockJettisoningWatchpoint.h:
* bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp:
(JSC::LLIntPrototypeLoadAdaptiveStructureWatchpoint::install):
(JSC::LLIntPrototypeLoadAdaptiveStructureWatchpoint::fireInternal):
* bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.h:
* bytecode/StructureStubClearingWatchpoint.cpp:
(JSC::StructureStubClearingWatchpoint::fireInternal):
* bytecode/StructureStubClearingWatchpoint.h:
* bytecode/Watchpoint.cpp:
(JSC::Watchpoint::fire):
(JSC::WatchpointSet::fireAllWatchpoints):
* bytecode/Watchpoint.h:
* dfg/DFGAdaptiveInferredPropertyValueWatchpoint.cpp:
(JSC::DFG::AdaptiveInferredPropertyValueWatchpoint::handleFire):
* dfg/DFGAdaptiveInferredPropertyValueWatchpoint.h:
* dfg/DFGAdaptiveStructureWatchpoint.cpp:
(JSC::DFG::AdaptiveStructureWatchpoint::install):
(JSC::DFG::AdaptiveStructureWatchpoint::fireInternal):
* dfg/DFGAdaptiveStructureWatchpoint.h:
* dfg/DFGDesiredWatchpoints.cpp:
(JSC::DFG::AdaptiveStructureWatchpointAdaptor::add):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::setupGetByIdPrototypeCache):
* runtime/ArrayPrototype.cpp:
(JSC::ArrayPrototype::tryInitializeSpeciesWatchpoint):
(JSC::ArrayPrototypeAdaptiveInferredPropertyWatchpoint::handleFire):
* runtime/ECMAScriptSpecInternalFunctions.cpp:
(JSC::esSpecIsConstructor):
* runtime/FunctionRareData.cpp:
(JSC::FunctionRareData::AllocationProfileClearingWatchpoint::fireInternal):
* runtime/FunctionRareData.h:
* runtime/InferredStructureWatchpoint.cpp:
(JSC::InferredStructureWatchpoint::fireInternal):
* runtime/InferredStructureWatchpoint.h:
* runtime/InternalFunction.cpp:
(JSC::InternalFunction::createSubclassStructureSlow):
* runtime/InternalFunction.h:
(JSC::InternalFunction::createSubclassStructure):
* runtime/JSCJSValue.h:
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::isConstructor const):
* runtime/JSCell.h:
* runtime/JSCellInlines.h:
(JSC::JSCell::isConstructor):
(JSC::JSCell::methodTable const):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/ObjectPropertyChangeAdaptiveWatchpoint.h:
(JSC::ObjectPropertyChangeAdaptiveWatchpoint::ObjectPropertyChangeAdaptiveWatchpoint):
* runtime/ProxyObject.cpp:
(JSC::ProxyObject::finishCreation):
* runtime/ReflectObject.cpp:
(JSC::reflectObjectConstruct):
* runtime/StructureRareData.cpp:
(JSC::StructureRareData::setObjectToStringValue):
(JSC::ObjectToStringAdaptiveStructureWatchpoint::install):
(JSC::ObjectToStringAdaptiveStructureWatchpoint::fireInternal):
(JSC::ObjectToStringAdaptiveInferredPropertyValueWatchpoint::handleFire):

Source/WebCore:

* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::define):

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

2 years agoUnreviewed, rolling out r233232.
commit-queue@webkit.org [Wed, 27 Jun 2018 04:45:06 +0000 (04:45 +0000)]
Unreviewed, rolling out r233232.
https://bugs.webkit.org/show_bug.cgi?id=187081

"This is breaking launching some plugins" (Requested by youenn
on #webkit).

Reverted changeset:

"Remove quarantine for Webex plugin"
https://bugs.webkit.org/show_bug.cgi?id=187050
https://trac.webkit.org/changeset/233232

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

2 years agoRearrange some WebPreferences; move two experimental prefs into the experimental...
timothy_horton@apple.com [Wed, 27 Jun 2018 04:36:49 +0000 (04:36 +0000)]
Rearrange some WebPreferences; move two experimental prefs into the experimental section

* Shared/WebPreferences.yaml:

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

2 years agoeval() is wrong about the LiteralParser never throwing any exceptions.
mark.lam@apple.com [Wed, 27 Jun 2018 03:10:18 +0000 (03:10 +0000)]
eval() is wrong about the LiteralParser never throwing any exceptions.
https://bugs.webkit.org/show_bug.cgi?id=187074
<rdar://problem/41461099>

Reviewed by Saam Barati.

JSTests:

* stress/regress-187074.js: Added.

Source/JavaScriptCore:

Added the missing exception check, and removed an erroneous assertion.

* interpreter/Interpreter.cpp:
(JSC::eval):

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

2 years agoCSSGradientValue's color stops vector wastes 12KB on theverge.com
simon.fraser@apple.com [Wed, 27 Jun 2018 03:03:50 +0000 (03:03 +0000)]
CSSGradientValue's color stops vector wastes 12KB on theverge.com
https://bugs.webkit.org/show_bug.cgi?id=186988

Reviewed by Sam Weinig.

Shrink the color stops vector when we're done parsing the stops.

* css/CSSGradientValue.h:
(WebCore::CSSGradientValue::doneAddingStops):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient):
(WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
(WebCore::CSSPropertyParserHelpers::consumeAngularGradientColorStops):

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

2 years agoDeal better with the network process crashing on startup
cdumez@apple.com [Wed, 27 Jun 2018 02:10:58 +0000 (02:10 +0000)]
Deal better with the network process crashing on startup
https://bugs.webkit.org/show_bug.cgi?id=187065
<rdar://problem/41451622>

Reviewed by Geoffrey Garen.

Source/WebKit:

When a network process crashes on startup, we would not attempt to relaunch it. If there were web
processes waiting for a connection to this network process, we would send them an invalid connection
identifier which would cause them to forcefully crash.

Instead, we now apply the same policy whether a network process crashes on startup or later:
- We attempt to relaunch the network process
- If there were pending connections from WebContent processes, we ask the new Network process instead.

As a result, WebContent processes no longer crash in this case. Instead, they wait for a valid
connection to the network process.

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _makeNextNetworkProcessLaunchFailForTesting]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getLaunchOptions):
(WebKit::NetworkProcessProxy::didFinishLaunching):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::networkProcessCrashed):
* UIProcess/WebProcessPool.h:

Tools:

Add layout test coverage.

* TestWebKitAPI/Tests/WebKit/NetworkProcessCrashWithPendingConnection.mm:
(-[MonitorWebContentCrashNavigationDelegate _webView:webContentProcessDidTerminateWithReason:]):
(-[MonitorWebContentCrashNavigationDelegate webView:didFinishNavigation:]):
(TestWebKitAPI::TEST):

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

2 years agoRemove static initializers more
utatane.tea@gmail.com [Wed, 27 Jun 2018 01:58:06 +0000 (01:58 +0000)]
Remove static initializers more
https://bugs.webkit.org/show_bug.cgi?id=186969

Reviewed by Michael Catanzaro.

Source/WebCore:

This patch removes static initializers more. They typically exists in GTK port.

No behavior change.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/ResourceUsageData.cpp: Removed.
* page/ResourceUsageData.h:
Remove ResourceUsageData constructors since default constructors are enough.

(WebCore::MemoryCategoryInfo::MemoryCategoryInfo):
* platform/gtk/PasteboardHelper.cpp:
(WebCore::markupPrefix):
(WebCore::removeMarkupPrefix):
(WebCore::PasteboardHelper::fillSelectionData):
Use NeverDestroyed<> and static functions.

* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
(WebCore::defaultVolumeCapability):
(WebCore::GStreamerAudioCaptureSource::capabilities const):
CapabilityValueOrRange's constructor is not constexpr.

* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::initialAcceptLanguages):
(WebCore::proxySettings):
(WebCore::SoupNetworkSession::SoupNetworkSession):
(WebCore::SoupNetworkSession::setupProxy):
(WebCore::SoupNetworkSession::setProxySettings):
(WebCore::SoupNetworkSession::setInitialAcceptLanguages):
Use NeverDestroyed<> and static functions.

Tools:

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::assignedUrlsCache):
(WTR::dumpResourceURL):
(WTR::InjectedBundlePage::resetAfterTest):
(WTR::InjectedBundlePage::didInitiateLoadForResource):
* WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:
(WTR::AccessibilityNotificationHandler::setNotificationFunctionCallback):
(WTR::AccessibilityNotificationHandler::removeAccessibilityNotificationHandler):
(WTR::AccessibilityNotificationHandler::connectAccessibilityCallbacks):
(WTR::AccessibilityNotificationHandler::disconnectAccessibilityCallbacks):
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::stringAttributeValue):
Use NeverDestroyed<> and static functions.

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

2 years agoImport wpt CORP tests
youenn@apple.com [Wed, 27 Jun 2018 01:29:12 +0000 (01:29 +0000)]
Import wpt CORP tests
https://bugs.webkit.org/show_bug.cgi?id=187027

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/common/get-host-info.sub.js:
* web-platform-tests/fetch/cross-origin-resource-policy/fetch-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/fetch-in-iframe-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/fetch-in-iframe.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/fetch.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/iframe-loads-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/iframe-loads.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/image-loads-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/image-loads.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/resources/green.png: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/resources/hello.py: Added.
(main):
* web-platform-tests/fetch/cross-origin-resource-policy/resources/iframe.py: Added.
(main):
* web-platform-tests/fetch/cross-origin-resource-policy/resources/iframeFetch.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/resources/image.py: Added.
(main):
* web-platform-tests/fetch/cross-origin-resource-policy/resources/redirect.py: Added.
(main):
* web-platform-tests/fetch/cross-origin-resource-policy/resources/script.py: Added.
(main):
* web-platform-tests/fetch/cross-origin-resource-policy/resources/w3c-import.log: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/scheme-restriction.any-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/scheme-restriction.any.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/scheme-restriction.any.js: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/scheme-restriction.any.worker-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/scheme-restriction.any.worker.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/scheme-restriction.https.window.js: Added.
(promise_test.t.return.new.Promise):
(promise_test.t.finally):
* web-platform-tests/fetch/cross-origin-resource-policy/script-loads-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/script-loads.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/syntax.any-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/syntax.any.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/syntax.any.js: Added.
(string_appeared_here.forEach.incorrectHeaderValue.promise_test.t.return.fetch.crossOriginURL.encodeURIComponent):
* web-platform-tests/fetch/cross-origin-resource-policy/syntax.any.worker-expected.txt: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/syntax.any.worker.html: Added.
* web-platform-tests/fetch/cross-origin-resource-policy/w3c-import.log: Added.

LayoutTests:

Skipping tests for WK1.

* platform/ios-wk1/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

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

2 years agoREGRESSION (r231479): Unable to buy Odeon cinema tickets in STP (bogus 'X-Frame-Optio...
dbates@webkit.org [Wed, 27 Jun 2018 01:23:09 +0000 (01:23 +0000)]
REGRESSION (r231479): Unable to buy Odeon cinema tickets in STP (bogus 'X-Frame-Options' to 'SAMEORIGIN')
https://bugs.webkit.org/show_bug.cgi?id=186090
<rdar://problem/40692595>

Reviewed by Andy Estes.

Source/WebCore:

Fix up Content Security Policy logic for checking the frame ancestors now that we
exclude the frame that initiated the load request.

Test: http/tests/security/XFrameOptions/cross-origin-iframe-post-form-to-parent-same-origin-x-frame-options-page-allow.html

* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowFrameAncestors const):
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::checkFrameAncestors):

Source/WebKit:

Fixes an issue where a page P delivered with "X-Frame-Options: SAMEORIGIN" loaded in a sub-
frame would be blocked if we were redirected to it in response to the cross-origin POST
request regardless of whether P is same-origin with its parent document.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions): Compare the origin
of the top frame's document as opposed to the source origin. The latter represents the
origin of the document that initiated the navigation, which can be cross-origin, and
should not be considered when applying "X-Frame-Options: SAMEORIGIN". This check exists
as a performance optimization to avoid traversing over all frame ancestors only to find
out that the innermost frame (the one that made this request) is cross-origin with the
top-most frame.
* NetworkProcess/NetworkResourceLoader.h:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Exclude the origin of the
frame that is making the load request from the list of ancestor origins. This makes the
X-Frame-Options algorithm in WebKit2 match the logic we do in FrameLoader::shouldInterruptLoadForXFrameOptions().

LayoutTests:

Add a test to ensure that we allow a same-origin page with "X-Frame-Options: SAMEORIGIN" to
load as a result of a redirected cross-origin POST request.

* http/tests/security/XFrameOptions/cross-origin-iframe-post-form-to-parent-same-origin-x-frame-options-page-allow-expected.txt: Added.
* http/tests/security/XFrameOptions/cross-origin-iframe-post-form-to-parent-same-origin-x-frame-options-page-allow.html: Added.
* http/tests/security/XFrameOptions/resources/post-form-to-x-frame-options-parent-same-origin-allow.html: Added.
* http/tests/security/XFrameOptions/resources/x-frame-options-parent-same-origin-allow.cgi:

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

2 years agoJSImmutableButterfly can't be allocated from a subspace with HeapCell::Kind::Auxiliary
sbarati@apple.com [Wed, 27 Jun 2018 01:08:25 +0000 (01:08 +0000)]
JSImmutableButterfly can't be allocated from a subspace with HeapCell::Kind::Auxiliary
https://bugs.webkit.org/show_bug.cgi?id=186878
<rdar://problem/40568659>

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

This patch fixes a bug in our JSImmutableButterfly implementation uncovered by
our stress GC bots. Before this patch, JSImmutableButterfly was allocated
with HeapCell::Kind::Auxiliary. This is wrong. Things that are JSCells can't
be allocated from HeapCell::Kind::Auxiliary. This patch adds a new HeapCell::Kind
called JSCellWithInteriorPointers. It behaves like JSCell in all ways, except
conservative scan knows to treat it like a butterfly in when we we may be
pointing into the middle of it.

The way we were crashing on the stress GC bots is that our conservative marking
won't do cell visiting for things that are Auxiliary. This meant that if the
stack were the only thing pointing to a JSImmutableButterfly when a GC took place,
that JSImmutableButterfly would not be visited. This is now fixed.

* bytecompiler/NodesCodegen.cpp:
(JSC::ArrayNode::emitBytecode):
* debugger/Debugger.cpp:
* heap/ConservativeRoots.cpp:
(JSC::ConservativeRoots::genericAddPointer):
* heap/Heap.cpp:
(JSC::GatherHeapSnapshotData::operator() const):
(JSC::RemoveDeadHeapSnapshotNodes::operator() const):
(JSC::Heap::globalObjectCount):
(JSC::Heap::objectTypeCounts):
(JSC::Heap::deleteAllCodeBlocks):
* heap/HeapCell.cpp:
(WTF::printInternal):
* heap/HeapCell.h:
(JSC::isJSCellKind):
(JSC::hasInteriorPointers):
* heap/HeapUtil.h:
(JSC::HeapUtil::findGCObjectPointersForMarking):
(JSC::HeapUtil::isPointerGCObjectJSCell):
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::Handle::didAddToDirectory):
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::appendJSCellOrAuxiliary):
* runtime/JSGlobalObject.cpp:
* runtime/JSImmutableButterfly.h:
(JSC::JSImmutableButterfly::subspaceFor):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
* tools/CellProfile.h:
(JSC::CellProfile::CellProfile):
(JSC::CellProfile::isJSCell const):
* tools/HeapVerifier.cpp:
(JSC::HeapVerifier::validateCell):

LayoutTests:

Make these test not susceptible to conservative scan leaks by ensuring at least
one object gets collected when we allocate many of them. Before, these were just
testing that a fixed number of objects were collected.

* editing/selection/navigation-clears-editor-state-expected.txt:
* editing/selection/navigation-clears-editor-state.html:
* fast/dom/reference-cycle-leaks.html:
* fast/misc/resources/test-observegc.js:
* fast/misc/test-observegc-expected.txt:
* platform/mac-wk2/plugins/refcount-leaks-expected.txt:
* plugins/refcount-leaks-expected.txt:
* plugins/refcount-leaks.html:

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

2 years ago[ews-build] Add support for compiling WebKit
aakash_jain@apple.com [Wed, 27 Jun 2018 01:07:27 +0000 (01:07 +0000)]
[ews-build] Add support for compiling WebKit
https://bugs.webkit.org/show_bug.cgi?id=187019

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(CompileWebKit): Added, class to compile WebKit.
(CleanBuild): Added, class to clean up the build.
(KillOldProcesses): Added, class to kill old processes.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.
* BuildSlaveSupport/ews-build/config.json: Renamed ios-11-simulator to ios-simulator-11, to match with build.webkit.org code.
Added configuration, architecture which is required for compiling. Renamed Release to release as the tools expect lower-case release.
* BuildSlaveSupport/ews-build/factories.py: Added BuildFactory.
* BuildSlaveSupport/ews-build/loadConfig.py: Renamed configuraton value to lower-case as tools expect lower-case values.
* BuildSlaveSupport/ews-build/loadConfig_unittest.py: Ditto.

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

2 years agoSkip some unnecessary work in Interpreter::getStackTrace().
mark.lam@apple.com [Wed, 27 Jun 2018 00:43:25 +0000 (00:43 +0000)]
Skip some unnecessary work in Interpreter::getStackTrace().
https://bugs.webkit.org/show_bug.cgi?id=187070

Reviewed by Michael Saboff.

* interpreter/Interpreter.cpp:
(JSC::Interpreter::getStackTrace):

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

2 years ago[iOS] Rebaseline two webanimations tests after r233164
commit-queue@webkit.org [Wed, 27 Jun 2018 00:41:30 +0000 (00:41 +0000)]
[iOS] Rebaseline two webanimations tests after r233164
https://bugs.webkit.org/show_bug.cgi?id=187071

Unreviewed gardening

Patch by Truitt Savell <tsavell@apple.com> on 2018-06-26

* platform/ios/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:
* platform/ios/webanimations/opacity-animation-yields-compositing-span-expected.txt: Added.

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

2 years agoRemove quarantine for Webex plugin
youenn@apple.com [Wed, 27 Jun 2018 00:31:43 +0000 (00:31 +0000)]
Remove quarantine for Webex plugin
https://bugs.webkit.org/show_bug.cgi?id=187050
rdar://problem/41478189

Reviewed by Brent Fulgham.

Update the Plugin Info.plist to not do quarantine of downloaded files by default.
Update PluginProcess implementation to reenable quarantine for all plug-ins except cisco webex plug-in.

* PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
* PluginProcess/PluginProcess.h:
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::shouldOverrideQuarantine):
* Shared/ChildProcess.h:
(WebKit::ChildProcess::shouldOverrideQuarantine):
* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::initializeSandbox):

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

2 years agoEnsure element fullscreen animation is always visible.
commit-queue@webkit.org [Wed, 27 Jun 2018 00:25:47 +0000 (00:25 +0000)]
Ensure element fullscreen animation is always visible.
https://bugs.webkit.org/show_bug.cgi?id=187068
rdar://problem/36187369

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-06-26
Reviewed by Eric Carlson.

The fullscreen animation is important for communicating to users that they are no longer in inline mode.
If fullscreen animation's inline rect is not visible, animate from a point in the middle of the screen.

* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(WebKit::safeInlineRect):
(-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):

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

2 years agoAdd a sandbox profile for com.google.o1dbrowserplugin plugin
youenn@apple.com [Wed, 27 Jun 2018 00:22:01 +0000 (00:22 +0000)]
Add a sandbox profile for com.google.o1dbrowserplugin plugin
https://bugs.webkit.org/show_bug.cgi?id=187067

Reviewed by Brent Fulgham.

* Resources/PlugInSandboxProfiles/com.google.o1dbrowserplugin.sb: Added.
* WebKit.xcodeproj/project.pbxproj:

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

2 years ago[ews-build] Add support for WebKitPerl-Tests-EWS
aakash_jain@apple.com [Wed, 27 Jun 2018 00:16:48 +0000 (00:16 +0000)]
[ews-build] Add support for WebKitPerl-Tests-EWS
https://bugs.webkit.org/show_bug.cgi?id=187023

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/config.json: Added WebKitPerl-tests-EWS.
* BuildSlaveSupport/ews-build/factories.py: Added WebKitPerlFactory.
* BuildSlaveSupport/ews-build/steps.py: Added build step RunWebKitPerlTests.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-test.

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

2 years ago[build.webkit.org] Rename badly named variable kls to schedulerType
aakash_jain@apple.com [Wed, 27 Jun 2018 00:10:23 +0000 (00:10 +0000)]
[build.webkit.org] Rename badly named variable kls to schedulerType
https://bugs.webkit.org/show_bug.cgi?id=186926

Reviewed by Lucas Forschler.

* BuildSlaveSupport/build.webkit.org-config/loadConfig.py:
(loadBuilderConfig): Renamed kls to schedulerType.

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

2 years agoPromote two more experimental features to traditional features
timothy_horton@apple.com [Tue, 26 Jun 2018 23:22:52 +0000 (23:22 +0000)]
Promote two more experimental features to traditional features
https://bugs.webkit.org/show_bug.cgi?id=187063

Reviewed by Dean Jackson.

* Shared/WebPreferences.yaml:
Promote some shipped/default-on features to non-experimental.

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

2 years agoRollout macOS sandbox change in r232276
bfulgham@apple.com [Tue, 26 Jun 2018 22:28:19 +0000 (22:28 +0000)]
Rollout macOS sandbox change in r232276
https://bugs.webkit.org/show_bug.cgi?id=186904
<rdar://problem/41350969>

Patch by Jiewen Tan <jiewen_tan@apple.com> on 2018-06-26
Reviewed by Brent Fulgham.

* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:

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

2 years agoTap highlight displayed when tapping a field that is already focussed
commit-queue@webkit.org [Tue, 26 Jun 2018 22:20:59 +0000 (22:20 +0000)]
Tap highlight displayed when tapping a field that is already focussed
https://bugs.webkit.org/show_bug.cgi?id=187004
<rdar://problem/41428008>
Patch by Aditya Keerthi <akeerthi@apple.com> on 2018-06-26
Reviewed by Tim Horton.

In the case where fast-clicking is enabled, _singleTapCommited: could be invoked
before the tap highlight request, causing _potentialTapInProgress to be set to NO.
This results in the early return for preventing multiple tap highlights on an
assisted node to be skipped. Since a tap highlight should never be shown for an
input field that is already focussed, _potentialTapInProgress can be removed from
the early return condition.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):

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

2 years agoREGRESSION (r232314): Flaky Test: imported/w3c/web-platform-tests/streams/piping...
ryanhaddad@apple.com [Tue, 26 Jun 2018 22:18:12 +0000 (22:18 +0000)]
REGRESSION (r232314): Flaky Test: imported/w3c/web-platform-tests/streams/piping/error-propagation-forward.html
https://bugs.webkit.org/show_bug.cgi?id=186161

Unreviewed gardening.

Patch by Truitt Savell <tsavell@apple.com> on 2018-06-26

* TestExpectations:

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

2 years agoSimplify NetworkStorageSession::getAllStorageAccessEntries()
cdumez@apple.com [Tue, 26 Jun 2018 21:42:33 +0000 (21:42 +0000)]
Simplify NetworkStorageSession::getAllStorageAccessEntries()
https://bugs.webkit.org/show_bug.cgi?id=187016

Reviewed by Youenn Fablet.

Iterate over the HashMaps' values instead of iterating over their keys and then looking them
up in the HashMap.

* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::getAllStorageAccessEntries const):

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

2 years agoEWS should pass --status-host-uses-http when invoking webkit-patch, if needed
dbates@webkit.org [Tue, 26 Jun 2018 21:13:33 +0000 (21:13 +0000)]
EWS should pass --status-host-uses-http when invoking webkit-patch, if needed
https://bugs.webkit.org/show_bug.cgi?id=187061

Reviewed by Per Arne Vollan.

When EWS invokes webkit-patch to perform an operation (e.g. apply an attachment)
it should pass the command line option --status-host-uses-http, if EWS was
started with this command line option, so that we query the status server over
HTTP in child "webkit-patch" processes as we do in the main EWS process.

* Scripts/webkitpy/common/net/statusserver_mock.py:
(MockStatusServer.__init__):
* Scripts/webkitpy/tool/commands/queues.py:
(AbstractQueue.run_webkit_patch):

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

2 years agowebkit-patch: Make attachment commands work with status-server hosted attachments
dbates@webkit.org [Tue, 26 Jun 2018 20:54:50 +0000 (20:54 +0000)]
webkit-patch: Make attachment commands work with status-server hosted attachments
https://bugs.webkit.org/show_bug.cgi?id=187056

Reviewed by Per Arne Vollan.

Allow the EWS bots to apply, build, test, check-style, and (in the future) land
attachments hosted on the status server. We only download an attachment from the
status server if we do not have sufficient permission to download it from Bugzilla
(e.g. security-sensitive patches).

A valid status server API key is required to run these commands by hand. Otherwise,
the status server will not provide attachment data.

* Scripts/webkitpy/common/net/statusserver_mock.py:
(MockStatusServer.fetch_attachment): Log a message for testing purposes.
* Scripts/webkitpy/tool/commands/download.py:
(ProcessAttachmentsMixin._fetch_list_of_patches_to_process): Fetch the attachment
from the status server if we do not have permission to fetch it from Bugzilla.
* Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
(EarlyWarningSystemTest._default_expected_logs): Update expected result when
using a custom work item and when fetching an attachment from the status server.
(_test_ews): Modified to take use_security_sensitive_patch (defaults to False) as
to whether to use a security-sensitive patch when testing.
(test_ewses_with_security_sensitive_patch): Added.

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

2 years agoRearrange some WebPreferences; move two non-experimental prefs out of the experimenta...
timothy_horton@apple.com [Tue, 26 Jun 2018 20:38:07 +0000 (20:38 +0000)]
Rearrange some WebPreferences; move two non-experimental prefs out of the experimental section

* Shared/WebPreferences.yaml:

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

2 years agoASSERTION FAILED: length > butterfly->vectorLength() in JSObject::ensureLengthSlow().
mark.lam@apple.com [Tue, 26 Jun 2018 20:37:30 +0000 (20:37 +0000)]
ASSERTION FAILED: length > butterfly->vectorLength() in JSObject::ensureLengthSlow().
https://bugs.webkit.org/show_bug.cgi?id=187060
<rdar://problem/41452767>

Reviewed by Keith Miller.

JSTests:

* stress/regress-187060.js: Added.

Source/JavaScriptCore:

JSObject::ensureLengthSlow() may be called only because it needs to do a copy on
write conversion.  Hence, we can return early after the conversion if the vector
length is already sufficient to cover the requested length.

* runtime/JSObject.cpp:
(JSC::JSObject::ensureLengthSlow):

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

2 years agoUnreviewed followup. Fix the watchos build after r233192.
sbarati@apple.com [Tue, 26 Jun 2018 19:39:17 +0000 (19:39 +0000)]
Unreviewed followup. Fix the watchos build after r233192.

This patch also correct the changelog entry below to have the correct
bug and title info.

* bmalloc/ProcessCheck.mm:

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

2 years agoPromote some experimental features to traditional features
timothy_horton@apple.com [Tue, 26 Jun 2018 19:27:45 +0000 (19:27 +0000)]
Promote some experimental features to traditional features
https://bugs.webkit.org/show_bug.cgi?id=187047

Reviewed by Simon Fraser.

* Shared/WebPreferences.yaml:
Reindent.
Promote some shipped/default-on features to non-experimental.

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

2 years ago[Mac] AirPlay picker uses incorrect theme in Dark mode
eric.carlson@apple.com [Tue, 26 Jun 2018 19:14:36 +0000 (19:14 +0000)]
[Mac] AirPlay picker uses incorrect theme in Dark mode
https://bugs.webkit.org/show_bug.cgi?id=187054
<rdar://problem/41291093>

Reviewed by Timothy Hatcher.

Source/WebCore:

* Modules/mediasession/WebMediaSessionManager.cpp:
(WebCore::WebMediaSessionManager::showPlaybackTargetPicker): Add useDefaultAppearance parameter.
* Modules/mediasession/WebMediaSessionManager.h:

* platform/graphics/MediaPlaybackTargetPicker.cpp:
(WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker): Ditto.
* platform/graphics/MediaPlaybackTargetPicker.h:

* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
(WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Choose theme based on
useDefaultAppearance parameter.

* platform/mock/MediaPlaybackTargetPickerMock.cpp:
(WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker): Log parameter.
* platform/mock/MediaPlaybackTargetPickerMock.h:

Source/WebKit:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showPlaybackTargetPicker): Pass m_defaultAppearance.

Source/WebKitLegacy/mac:

* WebView/WebMediaPlaybackTargetPicker.mm:
(WebMediaPlaybackTargetPicker::showPlaybackTargetPicker): Pass page->defaultAppearance().

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

2 years agoUnreviewed, rolling out r233184.
commit-queue@webkit.org [Tue, 26 Jun 2018 19:14:07 +0000 (19:14 +0000)]
Unreviewed, rolling out r233184.
https://bugs.webkit.org/show_bug.cgi?id=187059

"It regressed JetStream between 5-8%" (Requested by saamyjoon
on #webkit).

Reverted changeset:

"JSImmutableButterfly can't be allocated from a subspace with
HeapCell::Kind::Auxiliary"
https://bugs.webkit.org/show_bug.cgi?id=186878
https://trac.webkit.org/changeset/233184

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

2 years ago[GTK] Unreviewed test gardening
cturner@igalia.com [Tue, 26 Jun 2018 19:13:05 +0000 (19:13 +0000)]
[GTK] Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=187048

Unreviewed gardening.

* platform/gtk/TestExpectations:

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

2 years agocontributors.json fails to parse after r233209
dbates@webkit.org [Tue, 26 Jun 2018 18:45:15 +0000 (18:45 +0000)]
contributors.json fails to parse after r233209

Removing trailing ',' that caused this file to be malformed. Also ran
"validate-committer-lists -c" to canonicalize the style of this file.

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

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

2 years agoVersioning.
kocsen_chung@apple.com [Tue, 26 Jun 2018 18:40:02 +0000 (18:40 +0000)]
Versioning.

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

2 years agoAdd Aditya to contributors.json as a contributor
timothy_horton@apple.com [Tue, 26 Jun 2018 18:28:35 +0000 (18:28 +0000)]
Add Aditya to contributors.json as a contributor

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

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

2 years agoResource Load Statistics: Make WebResourceLoadStatisticsStore::updateCookiePartitioni...
cdumez@apple.com [Tue, 26 Jun 2018 18:26:30 +0000 (18:26 +0000)]
Resource Load Statistics: Make WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains() wait for the network process before calling its callback
https://bugs.webkit.org/show_bug.cgi?id=186903
<rdar://problem/41350182>

Reviewed by Brady Eidson.

Follow-up fix after r233180 to address an API test crash. We need to keep the
NetworkProcessProxy alive during the async updatePrevalentDomainsToPartitionOrBlockCookies
request to make sure it completes.

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::updatePrevalentDomainsToPartitionOrBlockCookies):

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

2 years agoProvide a way for Injected Bundles to indicate classes approved for NSSecureCoding
bfulgham@apple.com [Tue, 26 Jun 2018 18:16:57 +0000 (18:16 +0000)]
Provide a way for Injected Bundles to indicate classes approved for NSSecureCoding
https://bugs.webkit.org/show_bug.cgi?id=186788
<rdar://problem/41094167>

Reviewed by Chris Dumez.

Source/WebKit:

InjectedBundles support a mechanism to serialize data between the UIProcess and the
WebContent process hosting the bundle. In some cases, we want to be able to serialize
a custom data object that is not part of WebKit's native data types.

After switching to strict NSSecureCoding, WebKit clients attempting to serialize these
custom objects trigger a failure.

This patch makes it possible for the InjectedBundle author to specify one (or more) data
classes that are allowed to be serialized between the two processes.

* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleExtendClassesForParameterCoder): Added.
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
(createWKArray): Added.
(-[WKWebProcessPlugInController extendClassesForParameterCoder:]): Added.
* WebProcess/InjectedBundle/InjectedBundle.h:
* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
(WebKit::InjectedBundle::extendClassesForParameterCoder): Added.
(WebKit::InjectedBundle::classesForCoder): New helper function.
(WebKit::InjectedBundle::setBundleParameter): Modified to use the new set of valid
classes for NSSecureCoding.

Tools:

Add a new test case to exercise the class check during NSSecureCoding.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/mac/CustomBundleObject.h: Added.
* TestWebKitAPI/Tests/WebKit/mac/CustomBundleObject.mm: Added.
(-[CustomBundleObject initWithValue:]):
(+[CustomBundleObject supportsSecureCoding]):
(-[CustomBundleObject copyWithZone:]):
(-[CustomBundleObject initWithCoder:]):
(-[CustomBundleObject encodeWithCoder:]):
* TestWebKitAPI/Tests/WebKit/mac/CustomBundleParameter.mm: Added.
(TestWebKitAPI::didReceiveMessageFromInjectedBundle):
(TestWebKitAPI::didFinishLoadForFrame):
* TestWebKitAPI/Tests/WebKit/mac/CustomBundleParameter_Bundle.mm: Added.
(TestWebKitAPI::CustomBundleParameterTest::CustomBundleParameterTest):
(TestWebKitAPI::CustomBundleParameterTest::didCreatePage):

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

2 years agoREGRESSION(r233065): Build broken with clang-3.8 and libstdc++-5
clopez@igalia.com [Tue, 26 Jun 2018 18:00:57 +0000 (18:00 +0000)]
REGRESSION(r233065): Build broken with clang-3.8 and libstdc++-5
https://bugs.webkit.org/show_bug.cgi?id=187051

Reviewed by Mark Lam.

Revert r233065 changes over UnlinkedCodeBlock.h to allow
clang-3.8 to be able to compile this back (with libstdc++5)

* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::decompressArrayAllocationProfile):

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

2 years agoLayout Test http/tests/resourceLoadStatistics/prevalent-resource-without-user-interac...
ryanhaddad@apple.com [Tue, 26 Jun 2018 17:50:24 +0000 (17:50 +0000)]
Layout Test http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=187053

Unreviewed test gardening.

Patch by Truitt Savell <tsavell@apple.com> on 2018-06-26

* platform/wk2/TestExpectations:

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

2 years agoFix testapi build when DFG_JIT is disabled
ryanhaddad@apple.com [Tue, 26 Jun 2018 17:38:11 +0000 (17:38 +0000)]
Fix testapi build when DFG_JIT is disabled
https://bugs.webkit.org/show_bug.cgi?id=187038

Patch by Tadeu Zagallo <tzagallo@apple.com> on 2018-06-26
Reviewed by Mark Lam.

r233158 added a new API and tests for configuring the number of JIT threads, but
the API is only available when DFG_JIT is enabled and so should the tests.

* API/tests/testapi.mm:
(runJITThreadLimitTests):

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

2 years agoEnable mock capture devices on the iOS simulator
eric.carlson@apple.com [Tue, 26 Jun 2018 17:06:26 +0000 (17:06 +0000)]
Enable mock capture devices on the iOS simulator
https://bugs.webkit.org/show_bug.cgi?id=186846
<rdar://problem/41289134>

Reviewed by Youenn Fablet.

Source/WebKit:

* Shared/WebPreferences.yaml: Use DEFAULT_MOCK_CAPTURE_DEVICES_ENABLED.
* Shared/WebPreferencesDefaultValues.h: Define DEFAULT_MOCK_CAPTURE_DEVICES_ENABLED, set to
true in the iOS simulator only.

LayoutTests:

* platform/ios/TestExpectations: Unskip fast/mediastream/getUserMedia-default.html.

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

2 years ago[GStreamer] Do not forget to set stream on track switching
commit-queue@webkit.org [Tue, 26 Jun 2018 16:58:58 +0000 (16:58 +0000)]
[GStreamer] Do not forget to set stream on track switching
https://bugs.webkit.org/show_bug.cgi?id=187049

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-06-26
Reviewed by Philippe Normand.

This was an overlooked issue introduced in Bug #186678

This is already tested, but we currently run only tests against playbin2

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::enableTrack):

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

2 years ago[LFC] Fixed positioning is a subcategory of absolute positioning.
zalan@apple.com [Tue, 26 Jun 2018 16:45:52 +0000 (16:45 +0000)]
[LFC] Fixed positioning is a subcategory of absolute positioning.
https://bugs.webkit.org/show_bug.cgi?id=187043

Reviewed by Antti Koivisto.

https://www.w3.org/TR/CSS22/visuren.html#absolute-positioning
References in this specification to an absolutely positioned element (or its box) imply that the element's 'position'
property has the value 'absolute' or 'fixed'.

* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isAbsolutelyPositioned const):
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::isOutOfFlowPositioned const):

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

2 years agoUnreviewed, rolling out r233143.
commit-queue@webkit.org [Tue, 26 Jun 2018 15:27:27 +0000 (15:27 +0000)]
Unreviewed, rolling out r233143.
https://bugs.webkit.org/show_bug.cgi?id=187046

broke media/video-ended-event-negative-playback.html
(Requested by philn on #webkit).

Reverted changeset:

"[GStreamer] Remove useless workaround"
https://bugs.webkit.org/show_bug.cgi?id=186921
https://trac.webkit.org/changeset/233143

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

2 years agoLayout Test imported/mozilla/css-animations/test_animation-pausing.html is failing.
pvollan@apple.com [Tue, 26 Jun 2018 14:23:45 +0000 (14:23 +0000)]
Layout Test imported/mozilla/css-animations/test_animation-pausing.html is failing.
https://bugs.webkit.org/show_bug.cgi?id=187041

Unreviewed test gardening.

* platform/win/TestExpectations:

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

2 years ago[LFC] Computed height for in-flow non-replaced should not include padding and border.
zalan@apple.com [Tue, 26 Jun 2018 13:36:23 +0000 (13:36 +0000)]
[LFC] Computed height for in-flow non-replaced should not include padding and border.
https://bugs.webkit.org/show_bug.cgi?id=187031

Reviewed by Antti Koivisto.

In certain cases the height of a non-replaced in-flow box is computed using the bottom position of its last in-flow child.
The in-flow child's bottom position is in the coordinate system of the containing block's border box (border box's top left is 0, 0) ->
it includes both the (top) border and the padding of the containing block.

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

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

2 years agoImport WPT tests for webmessaging
fred.wang@free.fr [Tue, 26 Jun 2018 13:01:35 +0000 (13:01 +0000)]
Import WPT tests for webmessaging
https://bugs.webkit.org/show_bug.cgi?id=187001

Patch by Frederic Wang <fwang@igalia.com> on 2018-06-26
Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

* resources/import-expectations.json:
* resources/resource-files.json:
* web-platform-tests/webmessaging/Channel_postMessage_Blob-expected.txt: Added.
* web-platform-tests/webmessaging/Channel_postMessage_Blob.htm: Added.
* web-platform-tests/webmessaging/Channel_postMessage_DataCloneErr-expected.txt: Added.
* web-platform-tests/webmessaging/Channel_postMessage_DataCloneErr.htm: Added.
* web-platform-tests/webmessaging/Channel_postMessage_clone_port-expected.txt: Added.
* web-platform-tests/webmessaging/Channel_postMessage_clone_port.htm: Added.
* web-platform-tests/webmessaging/Channel_postMessage_clone_port_error-expected.txt: Added.
* web-platform-tests/webmessaging/Channel_postMessage_clone_port_error.htm: Added.
* web-platform-tests/webmessaging/Channel_postMessage_event_properties-expected.txt: Added.
* web-platform-tests/webmessaging/Channel_postMessage_event_properties.htm: Added.
* web-platform-tests/webmessaging/Channel_postMessage_ports_readonly_array-expected.txt: Added.
* web-platform-tests/webmessaging/Channel_postMessage_ports_readonly_array.htm: Added.
* web-platform-tests/webmessaging/Channel_postMessage_target_source-expected.txt: Added.
* web-platform-tests/webmessaging/Channel_postMessage_target_source.htm: Added.
* web-platform-tests/webmessaging/META.yml: Added.
* web-platform-tests/webmessaging/MessageEvent-expected.txt: Added.
* web-platform-tests/webmessaging/MessageEvent-trusted-expected.txt: Added.
* web-platform-tests/webmessaging/MessageEvent-trusted-worker.js: Added.
* web-platform-tests/webmessaging/MessageEvent-trusted.html: Added.
* web-platform-tests/webmessaging/MessageEvent.html: Added.
* web-platform-tests/webmessaging/MessageEvent_onmessage_postMessage_infinite_loop.html: Added.
* web-platform-tests/webmessaging/MessageEvent_properties.htm: Added.
* web-platform-tests/webmessaging/MessagePort_initial_disabled-expected.txt: Added.
* web-platform-tests/webmessaging/MessagePort_initial_disabled.htm: Added.
* web-platform-tests/webmessaging/MessagePort_onmessage_start-expected.txt: Added.
* web-platform-tests/webmessaging/MessagePort_onmessage_start.htm: Added.
* web-platform-tests/webmessaging/README.md: Added.
* web-platform-tests/webmessaging/Transferred_objects_unusable.sub.htm: Added.
* web-platform-tests/webmessaging/broadcastchannel/basics-expected.txt: Added.
* web-platform-tests/webmessaging/broadcastchannel/basics.html: Added.
* web-platform-tests/webmessaging/broadcastchannel/blobs-expected.txt: Added.
* web-platform-tests/webmessaging/broadcastchannel/blobs.html: Added.
* web-platform-tests/webmessaging/broadcastchannel/interface-expected.txt: Added.
* web-platform-tests/webmessaging/broadcastchannel/interface.html: Added.
* web-platform-tests/webmessaging/broadcastchannel/origin.window.js: Added.
* web-platform-tests/webmessaging/broadcastchannel/resources/origin.html: Added.
* web-platform-tests/webmessaging/broadcastchannel/resources/sandboxed.html: Added.
* web-platform-tests/webmessaging/broadcastchannel/resources/w3c-import.log: Added.
* web-platform-tests/webmessaging/broadcastchannel/resources/worker.js: Added.
(handler):
* web-platform-tests/webmessaging/broadcastchannel/sandbox-expected.txt: Added.
* web-platform-tests/webmessaging/broadcastchannel/sandbox.html: Added.
* web-platform-tests/webmessaging/broadcastchannel/w3c-import.log: Added.
* web-platform-tests/webmessaging/broadcastchannel/workers.html: Added.
* web-platform-tests/webmessaging/event.data.sub.htm: Added.
* web-platform-tests/webmessaging/event.origin.sub.htm: Added.
* web-platform-tests/webmessaging/event.ports.sub.htm: Added.
* web-platform-tests/webmessaging/event.source.htm: Added.
* web-platform-tests/webmessaging/event.source.xorigin.sub.htm: Added.
* web-platform-tests/webmessaging/message-channels/001-expected.txt: Added.
* web-platform-tests/webmessaging/message-channels/001.html: Added.
* web-platform-tests/webmessaging/message-channels/002-expected.txt: Added.
* web-platform-tests/webmessaging/message-channels/002.html: Added.
* web-platform-tests/webmessaging/message-channels/003-expected.txt: Added.
* web-platform-tests/webmessaging/message-channels/003.html: Added.
* web-platform-tests/webmessaging/message-channels/004-1.html: Added.
* web-platform-tests/webmessaging/message-channels/004-2.html: Added.
* web-platform-tests/webmessaging/message-channels/004-expected.txt: Added.
* web-platform-tests/webmessaging/message-channels/004.html: Added.
* web-platform-tests/webmessaging/message-channels/close-expected.txt: Added.
* web-platform-tests/webmessaging/message-channels/close.html: Added.
* web-platform-tests/webmessaging/message-channels/w3c-import.log: Added.
* web-platform-tests/webmessaging/message-channels/worker-expected.txt: Added.
* web-platform-tests/webmessaging/message-channels/worker.html: Added.
* web-platform-tests/webmessaging/messageerror-expected.txt: Added.
* web-platform-tests/webmessaging/messageerror.html: Added.
* web-platform-tests/webmessaging/postMessage_ArrayBuffer.sub.htm: Added.
* web-platform-tests/webmessaging/postMessage_Date.sub.htm: Added.
* web-platform-tests/webmessaging/postMessage_Document-expected.txt: Added.
* web-platform-tests/webmessaging/postMessage_Document.htm: Added.
* web-platform-tests/webmessaging/postMessage_Function-expected.txt: Added.
* web-platform-tests/webmessaging/postMessage_Function.htm: Added.
* web-platform-tests/webmessaging/postMessage_MessagePorts_sorigin.htm: Added.
* web-platform-tests/webmessaging/postMessage_MessagePorts_xorigin.sub.htm: Added.
* web-platform-tests/webmessaging/postMessage_arrays.sub.htm: Added.
* web-platform-tests/webmessaging/postMessage_asterisk_xorigin.sub.htm: Added.
* web-platform-tests/webmessaging/postMessage_dup_transfer_objects-expected.txt: Added.
* web-platform-tests/webmessaging/postMessage_dup_transfer_objects.htm: Added.
* web-platform-tests/webmessaging/postMessage_invalid_targetOrigin-expected.txt: Added.
* web-platform-tests/webmessaging/postMessage_invalid_targetOrigin.htm: Added.
* web-platform-tests/webmessaging/postMessage_objects.sub.htm: Added.
* web-platform-tests/webmessaging/postMessage_origin_mismatch.sub.htm: Added.
* web-platform-tests/webmessaging/postMessage_origin_mismatch_xorigin.sub.htm: Added.
* web-platform-tests/webmessaging/postMessage_solidus_sorigin.htm: Added.
* web-platform-tests/webmessaging/postMessage_solidus_xorigin.sub.htm: Added.
* web-platform-tests/webmessaging/w3c-import.log: Added.
* web-platform-tests/webmessaging/with-ports/001-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/001.html: Added.
* web-platform-tests/webmessaging/with-ports/002-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/002.html: Added.
* web-platform-tests/webmessaging/with-ports/003-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/003.html: Added.
* web-platform-tests/webmessaging/with-ports/004-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/004.html: Added.
* web-platform-tests/webmessaging/with-ports/005-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/005.html: Added.
* web-platform-tests/webmessaging/with-ports/006-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/006.html: Added.
* web-platform-tests/webmessaging/with-ports/007-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/007.html: Added.
* web-platform-tests/webmessaging/with-ports/010-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/010.html: Added.
* web-platform-tests/webmessaging/with-ports/011-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/011.html: Added.
* web-platform-tests/webmessaging/with-ports/012-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/012.html: Added.
* web-platform-tests/webmessaging/with-ports/013-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/013.html: Added.
* web-platform-tests/webmessaging/with-ports/014-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/014.html: Added.
* web-platform-tests/webmessaging/with-ports/015-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/015.html: Added.
* web-platform-tests/webmessaging/with-ports/016-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/016.html: Added.
* web-platform-tests/webmessaging/with-ports/017-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/017.html: Added.
* web-platform-tests/webmessaging/with-ports/018-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/018.html: Added.
* web-platform-tests/webmessaging/with-ports/019-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/019.html: Added.
* web-platform-tests/webmessaging/with-ports/020.html: Added.
* web-platform-tests/webmessaging/with-ports/021.html: Added.
* web-platform-tests/webmessaging/with-ports/023-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/023.html: Added.
* web-platform-tests/webmessaging/with-ports/024-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/024.html: Added.
* web-platform-tests/webmessaging/with-ports/025-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/025.html: Added.
* web-platform-tests/webmessaging/with-ports/026-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/026.html: Added.
* web-platform-tests/webmessaging/with-ports/027-expected.txt: Added.
* web-platform-tests/webmessaging/with-ports/027.html: Added.
* web-platform-tests/webmessaging/with-ports/w3c-import.log: Added.
* web-platform-tests/webmessaging/without-ports/001-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/001.html: Added.
* web-platform-tests/webmessaging/without-ports/002-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/002.html: Added.
* web-platform-tests/webmessaging/without-ports/003-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/003.html: Added.
* web-platform-tests/webmessaging/without-ports/004-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/004.html: Added.
* web-platform-tests/webmessaging/without-ports/005-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/005.html: Added.
* web-platform-tests/webmessaging/without-ports/006-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/006.html: Added.
* web-platform-tests/webmessaging/without-ports/007-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/007.html: Added.
* web-platform-tests/webmessaging/without-ports/008-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/008.html: Added.
* web-platform-tests/webmessaging/without-ports/009-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/009.html: Added.
* web-platform-tests/webmessaging/without-ports/010-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/010.html: Added.
* web-platform-tests/webmessaging/without-ports/011-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/011.html: Added.
* web-platform-tests/webmessaging/without-ports/012-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/012.html: Added.
* web-platform-tests/webmessaging/without-ports/013-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/013.html: Added.
* web-platform-tests/webmessaging/without-ports/014-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/014.html: Added.
* web-platform-tests/webmessaging/without-ports/015-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/015.html: Added.
* web-platform-tests/webmessaging/without-ports/016-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/016.html: Added.
* web-platform-tests/webmessaging/without-ports/017-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/017.html: Added.
* web-platform-tests/webmessaging/without-ports/018-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/018.html: Added.
* web-platform-tests/webmessaging/without-ports/019-1.html: Added.
* web-platform-tests/webmessaging/without-ports/019-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/019.html: Added.
* web-platform-tests/webmessaging/without-ports/020-1.html: Added.
* web-platform-tests/webmessaging/without-ports/020.html: Added.
* web-platform-tests/webmessaging/without-ports/021.html: Added.
* web-platform-tests/webmessaging/without-ports/023-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/023.html: Added.
* web-platform-tests/webmessaging/without-ports/024-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/024.html: Added.
* web-platform-tests/webmessaging/without-ports/025-1.js: Added.
(test):
* web-platform-tests/webmessaging/without-ports/025-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/025.html: Added.
* web-platform-tests/webmessaging/without-ports/026-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/026.html: Added.
* web-platform-tests/webmessaging/without-ports/027-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/027.html: Added.
* web-platform-tests/webmessaging/without-ports/028-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/028.html: Added.
* web-platform-tests/webmessaging/without-ports/029-expected.txt: Added.
* web-platform-tests/webmessaging/without-ports/029.html: Added.
* web-platform-tests/webmessaging/without-ports/w3c-import.log: Added.

LayoutTests:

Skip some webmessaging tests timing out.

* TestExpectations:

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

2 years agoCrash in WebAnimation::runPendingPlayTask
zandobersek@gmail.com [Tue, 26 Jun 2018 12:30:19 +0000 (12:30 +0000)]
Crash in WebAnimation::runPendingPlayTask
https://bugs.webkit.org/show_bug.cgi?id=186189

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Avoid crashes on nullopt std::optional dereference in the
runPendingPlayTask() and runPendingPauseTask() methods of the
WebAnimation class by defaulting to a Seconds(0) value.

In both cases the std::optional value is the current time retrieved from
the associated DocumentTimeline object. But there's no guarantee that
the timeline is active and the resulting time value is resolved (i.e.
not nullopt). Dereferencing the nullopt Seconds value doesn't cause a
problem on configurations still building as C++14 and the fallback
std::optional implementation provided by WTF -- no signal is raised, and
a 0 value is returned. Configurations building as C++17 on the other
hand use the stdlib-provided std::optional that does raise a signal on
invalid access, leading to crashes.

The default-to-Seconds(0) solution avoids crashes on configurations
that build with C++17 support enabled, and thus match configurations
that are still using WTF's std::optional. This still doesn't address the
underlying problem of retrieving current time from an inactive document
timeline and using it as ready time for the pending play/pause task
execution.

runPendingPlayTask() change addresses crashes in the following tests:
- fast/animation/css-animation-resuming-when-visible.html
- fast/animation/css-animation-resuming-when-visible-with-style-change.html
- imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/animate-no-browsing-context.html
- imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/getAnimations.html

runPendingPauseTask() change addresses crashes in the following tests:
- animations/multiple-animations-timing-function.html

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::runPendingPlayTask):
(WebCore::WebAnimation::runPendingPauseTask):

LayoutTests:

* platform/wpe/TestExpectations: Remove crashing expectations for fixed tests.

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

2 years ago[Win] 'deref': is not a member of 'WebKit::WebResourceLoadStatisticsStore::updateCook...
Hironori.Fujii@sony.com [Tue, 26 Jun 2018 09:50:49 +0000 (09:50 +0000)]
[Win] 'deref': is not a member of 'WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains::<lambda_9d761a6dc12d95db7fa2d6f3f5aa26fa>'
https://bugs.webkit.org/show_bug.cgi?id=187035

Unreviewed build fix.

MSVC can't compile the code using `this` in a generalized lambda
capture in another lambda.

In this case, there is no need to copy `protectedThis` for the
inner lambda. Move `protectedThis` of the outer lambda to the
inner as well as `completionHandler`.

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
Moved `protectedThis` from the outer lambda to the inner.
(WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
Ditto.

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

2 years ago[Web Animations] Show the feature as "Supported in Preview"
commit-queue@webkit.org [Tue, 26 Jun 2018 09:44:26 +0000 (09:44 +0000)]
[Web Animations] Show the feature as "Supported in Preview"
https://bugs.webkit.org/show_bug.cgi?id=187037

Patch by Antoine Quint <graouts@apple.com> on 2018-06-26
Reviewed by Dean Jackson.

Web Animations are enabled by default in STP.

* features.json:

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

2 years ago[GTK] Many webpages can crash the browser in WebCore::CoordinatedGraphicsLayer::trans...
magomez@igalia.com [Tue, 26 Jun 2018 09:12:22 +0000 (09:12 +0000)]
[GTK] Many webpages can crash the browser in WebCore::CoordinatedGraphicsLayer::transformedVisibleRect
https://bugs.webkit.org/show_bug.cgi?id=179304

Reviewed by Michael Catanzaro.

Source/WebCore:

When adding new CoordinatedGraphicsLayers to the tree, check that they have the appropriate
CompositingCoordinator. If that's not the case, set the appropriate one to the layer and its
children and set the state of those layers so they are rendered properly.

* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::addChild):
(WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
(WebCore::CoordinatedGraphicsLayer::addChildAbove):
(WebCore::CoordinatedGraphicsLayer::addChildBelow):
(WebCore::CoordinatedGraphicsLayer::replaceChild):
(WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

Source/WebKit:

Add a way to attach to the CompositingCoordinator layers that were not created by it.

* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::attachLayer):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:

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

2 years agoWasm: Any function argument of type Void should be a validation error
sbarati@apple.com [Tue, 26 Jun 2018 07:38:06 +0000 (07:38 +0000)]
Wasm: Any function argument of type Void should be a validation error
https://bugs.webkit.org/show_bug.cgi?id=186794
<rdar://problem/41140257>

Reviewed by Keith Miller.

We have evidence showing that processes with small heaps using the
JS API are more space efficient when using system malloc. Our main
hypothesis as to why this is, is that when dealing with small heaps,
one malloc can be more efficient at optimizing memory usage than
two mallocs.

* bmalloc/BPlatform.h:
* bmalloc/Environment.cpp:
(bmalloc::isNanoMallocEnabled):
(bmalloc::Environment::computeIsDebugHeapEnabled):
* bmalloc/ProcessCheck.h:
(bmalloc::shouldProcessUnconditionallyUseBmalloc):
* bmalloc/ProcessCheck.mm:
(bmalloc::shouldProcessUnconditionallyUseBmalloc):

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

2 years agoImport WPT fetch destination tests
youenn@apple.com [Tue, 26 Jun 2018 05:47:24 +0000 (05:47 +0000)]
Import WPT fetch destination tests
https://bugs.webkit.org/show_bug.cgi?id=186984

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/request/destination/fetch-destination-iframe.https-expected.txt: Added.
* web-platform-tests/fetch/api/request/destination/fetch-destination-iframe.https.html: Added.
* web-platform-tests/fetch/api/request/destination/fetch-destination-no-load-event.https.html: Added.
* web-platform-tests/fetch/api/request/destination/fetch-destination-worker.https-expected.txt: Added.
* web-platform-tests/fetch/api/request/destination/fetch-destination-worker.https.html: Added.
* web-platform-tests/fetch/api/request/destination/fetch-destination.https.html: Added.
* web-platform-tests/fetch/api/request/destination/resources/dummy: Added.
* web-platform-tests/fetch/api/request/destination/resources/dummy.es: Added.
* web-platform-tests/fetch/api/request/destination/resources/dummy.es.headers: Added.
* web-platform-tests/fetch/api/request/destination/resources/dummy.html: Added.
* web-platform-tests/fetch/api/request/destination/resources/dummy.png: Added.
* web-platform-tests/fetch/api/request/destination/resources/dummy.ttf: Added.
* web-platform-tests/fetch/api/request/destination/resources/dummy_audio.mp3: Added.
* web-platform-tests/fetch/api/request/destination/resources/dummy_audio.oga: Added.
* web-platform-tests/fetch/api/request/destination/resources/dummy_video.mp4: Added.
* web-platform-tests/fetch/api/request/destination/resources/dummy_video.ogv: Added.
* web-platform-tests/fetch/api/request/destination/resources/empty.https.html: Added.
* web-platform-tests/fetch/api/request/destination/resources/fetch-destination-worker-iframe.js: Added.
(event.request.url.includes.):
(event.request.url.includes):
* web-platform-tests/fetch/api/request/destination/resources/fetch-destination-worker-no-load-event.js: Added.
(event.request.url.includes):
* web-platform-tests/fetch/api/request/destination/resources/fetch-destination-worker.js: Added.
(event.request.url.includes):
* web-platform-tests/fetch/api/request/destination/resources/importer.js: Added.
* web-platform-tests/fetch/api/request/destination/resources/w3c-import.log: Added.
* web-platform-tests/fetch/api/request/destination/w3c-import.log: Added.

LayoutTests:

Skipping tests for WK1 since they use service worker.

* TestExpectations: Skipping timing out tests.
* platform/ios-wk1/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

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

2 years agoLog a message when fetching attachment data from the status server
dbates@webkit.org [Tue, 26 Jun 2018 04:58:42 +0000 (04:58 +0000)]
Log a message when fetching attachment data from the status server
https://bugs.webkit.org/show_bug.cgi?id=187032

Reviewed by Zalan Bujtas.

Currently we silently fetch from the status server an attachment when fetching
the attachment from Bugzilla fails due to an access denied error. Instead we
should emit a message when fetching data from the status server to indicate
that webkit-patch/EWS is still processing the command/trying to obtain the
patch.

* Scripts/webkitpy/common/net/statusserver.py:
(StatusServer._fetch_attachment_page):

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

2 years agoAdjust WEBCORE_EXPORT annotations for LTO
krollin@apple.com [Tue, 26 Jun 2018 02:05:35 +0000 (02:05 +0000)]
Adjust WEBCORE_EXPORT annotations for LTO
https://bugs.webkit.org/show_bug.cgi?id=186944
<rdar://problem/41384880>

Reviewed by David Kilzer.

Adjust a number of places that result in WebKit's
'check-for-weak-vtables-and-externals' script reporting weak external
symbols:

    ERROR: WebCore has a weak external symbol in it (/Volumes/Data/dev/webkit/OpenSource/WebKitBuild/Release/WebCore.framework/Versions/A/WebCore)
    ERROR: A weak external symbol is generated when a symbol is defined in multiple compilation units and is also marked as being exported from the library.
    ERROR: A common cause of weak external symbols is when an inline function is listed in the linker export file.
    ...

These cases are caused by inline methods being marked with WTF_EXPORT
(or related macro) or with an inline function being in a class marked
as such, and when enabling LTO builds.

For the most part, address these by removing the WEBCORE_EXPORT
annotation from inline methods. In some cases, move the implementation
out-of-line because it's the class that has the WEBCORE_EXPORT on it
and removing the annotation from the class would be too disruptive.
Finally, in other cases, move the implementation out-of-line because
check-for-weak-vtables-and-externals still complains when keeping the
implementation inline and removing the annotation; this seems to
typically (but not always) happen with destructors.

No new tests. There is no changed functionality. Only the annotation
and treatment of inline methods are altered.

* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::pause):
* page/CacheStorageProvider.h:
(): Deleted.
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::reportSynchronousScrollingReasonsChanged):
(WebCore::ScrollingTree::reportExposedUnfilledArea):
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::hasActiveNowPlayingSession const):
(WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingTitle const):
(WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingDuration const):
(WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingElapsedTime const):
(WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingInfoUniqueIdentifier const):
(WebCore::PlatformMediaSessionManager::registeredAsNowPlayingApplication const):
* platform/audio/mac/CARingBuffer.cpp:
(WebCore::CARingBuffer::~CARingBuffer):
* platform/audio/mac/CARingBuffer.h:
(WebCore::CARingBuffer::~CARingBuffer): Deleted.
* platform/cocoa/VideoFullscreenModelVideoElement.h:
* platform/gamepad/GamepadProvider.h:
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::displayListAsText const):
(WebCore::GraphicsLayer::setIsTrackingDisplayListReplay):
(WebCore::GraphicsLayer::isTrackingDisplayListReplay const):
(WebCore::GraphicsLayer::replayDisplayListAsText const):
* platform/mac/PlaybackSessionInterfaceMac.h:
* platform/mediastream/RealtimeMediaSourceCenter.h:
(WebCore::RealtimeMediaSourceCenter::setAudioFactory):
(WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::setActive):
(WebCore::LibWebRTCProvider::createDecoderFactory):
(WebCore::LibWebRTCProvider::createEncoderFactory):
(WebCore::LibWebRTCProvider::disableEnumeratingAllNetworkInterfaces):
(WebCore::LibWebRTCProvider::enableEnumeratingAllNetworkInterfaces):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::willCacheResponseAsync):
* testing/MockGamepadProvider.h:
* workers/service/server/SWServer.h:
(WebCore::SWServer::Connection::~Connection):

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

2 years ago[LFC] Adjust static position for out-of-flow positioned boxes.
zalan@apple.com [Tue, 26 Jun 2018 01:22:10 +0000 (01:22 +0000)]
[LFC] Adjust static position for out-of-flow positioned boxes.
https://bugs.webkit.org/show_bug.cgi?id=187000

Reviewed by Antti Koivisto.

The static position of an out-of-flow positioned box is the the position where box would go
if it was in-flow positioned. This position needs to the resolved in the containing block's coordinate system.

* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::staticPositionForOutOfFlowPositioned):
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):

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

2 years agoWeb Inspector: Dark Mode: Box Model section should have dark background
nvasilyev@apple.com [Tue, 26 Jun 2018 00:43:32 +0000 (00:43 +0000)]
Web Inspector: Dark Mode: Box Model section should have dark background
https://bugs.webkit.org/show_bug.cgi?id=186976

Reviewed by Brian Burg.

Replace all instances of black text on white background with the default text and background colors.

* UserInterface/Views/BoxModelDetailsSectionRow.css:
(@media (prefers-dark-interface)):
(.details-section .row.box-model):
(.details-section .row.box-model .label):
(.details-section .row.box-model :matches(.position, .margin, .border, .padding, .content)):
(.details-section .row.box-model:not(.hovered) :matches(.margin, .border, .padding, .content),):
(.details-section .row.box-model .margin):
(.details-section .row.box-model .border):

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

2 years agoUnreviewed, rolling out r233120.
david_fenton@apple.com [Tue, 26 Jun 2018 00:40:41 +0000 (00:40 +0000)]
Unreviewed, rolling out r233120.

caused regression in ios API tests

Reverted changeset:

"[Cocoa] reduce unnecessary use of .mm source files in WTF,
spruce up some implementation details"
https://bugs.webkit.org/show_bug.cgi?id=186924
https://trac.webkit.org/changeset/233120

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

2 years agoLayoutTest imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSASSA...
david_fenton@apple.com [Tue, 26 Jun 2018 00:38:49 +0000 (00:38 +0000)]
LayoutTest imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSASSA-PKCS1-v1_5.https.any.worker.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=187025

Unreviewed test gardening, update Test Expectations to [Pass Failure Slow]

* TestExpectations:

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

2 years agoJSImmutableButterfly can't be allocated from a subspace with HeapCell::Kind::Auxiliary
sbarati@apple.com [Mon, 25 Jun 2018 23:56:35 +0000 (23:56 +0000)]
JSImmutableButterfly can't be allocated from a subspace with HeapCell::Kind::Auxiliary
https://bugs.webkit.org/show_bug.cgi?id=186878
<rdar://problem/40568659>

Reviewed by Mark Lam.

Source/JavaScriptCore:

This patch fixes a bug in our JSImmutableButterfly implementation uncovered by
our stress GC bots. Before this patch, JSImmutableButterfly was allocated
with HeapCell::Kind::Auxiliary. This is wrong. Things that are JSCells must be
allocated from HeapCell::Kind::JSCell. The way this broke on the stress GC
bots is that our conservative marking won't do cell marking for things that
are Auxiliary. This means that if the stack is the only thing pointing to a
JSImmutableButterfly when a GC took place, that JSImmutableButterfly would
not be visited. This patch fixes this bug. This patch also extends our conservative
marking to understand that there may be interior pointers to things that are HeapCell::Kind::JSCell.

* bytecompiler/NodesCodegen.cpp:
(JSC::ArrayNode::emitBytecode):
* heap/HeapUtil.h:
(JSC::HeapUtil::findGCObjectPointersForMarking):
* runtime/JSImmutableButterfly.h:
(JSC::JSImmutableButterfly::subspaceFor):

LayoutTests:

Make these test not susceptible to conservative scan leaks by ensuring at least
one object gets collected when we allocate many of them. Before, these were just
testing that a fixed number of objects were collected.

* editing/selection/navigation-clears-editor-state-expected.txt:
* editing/selection/navigation-clears-editor-state.html:
* fast/dom/reference-cycle-leaks.html:
* fast/misc/resources/test-observegc.js:
* fast/misc/test-observegc-expected.txt:
* platform/mac-wk2/plugins/refcount-leaks-expected.txt:
* plugins/refcount-leaks-expected.txt:
* plugins/refcount-leaks.html:

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

2 years agoRemove RELEASE_ASSERT added in r230875.
beidson@apple.com [Mon, 25 Jun 2018 23:56:01 +0000 (23:56 +0000)]
Remove RELEASE_ASSERT added in r230875.
<rdar://problem/40860061> and https://bugs.webkit.org/show_bug.cgi?id=187022

Reviewed by Brent Fulgham.

There's actually more than one way for a network session to be destroyed, and that can happen
asynchronously and unpredictably.

And the request to start up a WebSocket and do its handshake is also asynchronous and unpredictable

It's an expected race.

If the NetworkStorageSession cannot be found then the WebSocket handshake should just fail.

* platform/network/SocketStreamHandleImpl.cpp:
(WebCore::cookieDataForHandshake): If the NetworkStorageSession cannot be found, return std::nullopt.
(WebCore::SocketStreamHandleImpl::platformSendHandshake): If the cookieData is null, fail the handshake.

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

2 years ago[iPad apps on macOS] Web process crashes when attempting to play embedded YouTube...
wenson_hsieh@apple.com [Mon, 25 Jun 2018 23:54:25 +0000 (23:54 +0000)]
[iPad apps on macOS] Web process crashes when attempting to play embedded YouTube video in News
https://bugs.webkit.org/show_bug.cgi?id=187011
<rdar://problem/40906808>

Reviewed by Tim Horton.

Disable remote media commands when running iOS WebKit on macOS. The iOS flavor of RemoteCommandListener
currently throws an exception when attempting to soft-link the MediaPlayer framework, which prevents video from
being played altogether. For a followup tracking touch bar integration in iOS WebKit on macOS, see:
<rdar://problem/39164732>.

Manually tested by playing a YouTube video in News.

* platform/RemoteCommandListener.cpp:
* platform/ios/RemoteCommandListenerIOS.h:
* platform/ios/RemoteCommandListenerIOS.mm:

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

2 years agoWKThumbnailView fallback background is blindingly bright in Dark Mode
timothy_horton@apple.com [Mon, 25 Jun 2018 23:40:52 +0000 (23:40 +0000)]
WKThumbnailView fallback background is blindingly bright in Dark Mode
https://bugs.webkit.org/show_bug.cgi?id=187017
<rdar://problem/41036209>

Reviewed by Simon Fraser.

* UIProcess/API/Cocoa/_WKThumbnailView.mm:
(-[_WKThumbnailView initWithFrame:]):
(-[_WKThumbnailView wantsUpdateLayer]):
(-[_WKThumbnailView updateLayer]):
Use a semantic color for the WKThumbnailView background color
instead of flat white.

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

2 years agoResource Load Statistics: Make WebResourceLoadStatisticsStore::updateCookiePartitioni...
wilander@apple.com [Mon, 25 Jun 2018 23:37:39 +0000 (23:37 +0000)]
Resource Load Statistics: Make WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains() wait for the network process before calling its callback
https://bugs.webkit.org/show_bug.cgi?id=186903
<rdar://problem/41350182>

Reviewed by Chris Dumez.

Source/WebKit:

This patch stores the callback sent to
WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains(),
sets up a context ID, and sends that ID to the network process when
asking it to update cookie partitioning and blocking. The network
process then tells the UI process when it's done, at which point the
callback is called.

This change is meant to address layout test flakiness.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::updatePrevalentDomainsToPartitionOrBlockCookies):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::updatePrevalentDomainsToPartitionOrBlockCookies):
(WebKit::NetworkProcessProxy::didUpdatePartitionOrBlockCookies):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
(WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::updatePrevalentDomainsToPartitionOrBlockCookies):
(WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
* UIProcess/WebsiteData/WebsiteDataStore.h:

LayoutTests:

* http/tests/storageAccess/grant-storage-access-under-opener-expected.txt:
* http/tests/storageAccess/grant-storage-access-under-opener.html:
    Moved the code block to the page's body instead of its head.
    Added an initial console log statement. The reason for these
    changes is that we're seeing flaky timeouts with no output.

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

2 years agoAllow access to APTDevice in iOS WebContent process
bfulgham@apple.com [Mon, 25 Jun 2018 23:07:43 +0000 (23:07 +0000)]
Allow access to APTDevice in iOS WebContent process
https://bugs.webkit.org/show_bug.cgi?id=187021
<rdar://problem/41339769>

Reviewed by Youenn Fablet.

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

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

2 years agoUnreviewed, rolling out r233087.
krollin@apple.com [Mon, 25 Jun 2018 22:34:49 +0000 (22:34 +0000)]
Unreviewed, rolling out r233087.

Causes 5% Mac PLT regression.

Reverted changeset:

"Recalc styles every time defaultAppearance changes."
https://bugs.webkit.org/show_bug.cgi?id=186866
https://trac.webkit.org/changeset/233087

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

2 years agoAdd a sandbox profile to Hangout plug-in
youenn@apple.com [Mon, 25 Jun 2018 22:29:55 +0000 (22:29 +0000)]
Add a sandbox profile to Hangout plug-in
https://bugs.webkit.org/show_bug.cgi?id=187005
<rdar://problem/41428391>

Reviewed by Brent Fulgham.

Add a sandbox profile so that this plug-in can be run when UIProcess is sandboxed.

* Resources/PlugInSandboxProfiles/com.google.googletalkbrowserplugin.sb: Added.
* WebKit.xcodeproj/project.pbxproj:

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

2 years agoREGRESSION(r229722): WebKitLegacy clients can crash when loading alternate page
bfulgham@apple.com [Mon, 25 Jun 2018 21:29:50 +0000 (21:29 +0000)]
REGRESSION(r229722): WebKitLegacy clients can crash when loading alternate page
https://bugs.webkit.org/show_bug.cgi?id=187008

Reviewed by Chris Dumez.

The new call to 'clearProvisionalLoadForPolicyCheck' added in r229722 broke loading
behavior in WebKitLegacy.

1. We can now enter 'cancelPolicyCheckIfNeeded' without a Frame loader, in what appears
   to be a recursive call during the load cancellation (the 'm_waitingForContentPolicy'
   and 'm_waitingForNavigationPolicy' have already been nulled). It seems like we should
   return early here, or perhaps just move the RELEASE_ASSERT inside the case where we
   have an active policy check happening.

2. We also enter FrameLoader::checkContentPolicy without an active document loader. We
   should recognize this case and handle it, rather than trying to dereference a nullptr
   document loader.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::cancelPolicyCheckIfNeeded): Move the RELEASE_ASSERT inside the
conditional where the frameLoader is actually used.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkContentPolicy): Recognize that the activeDocumentLoader may
be nullptr at this point, and take appropriate action (rather than crashing).

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

2 years ago[ews-build] Add support for Bindings-tests-EWS
aakash_jain@apple.com [Mon, 25 Jun 2018 21:28:25 +0000 (21:28 +0000)]
[ews-build] Add support for Bindings-tests-EWS
https://bugs.webkit.org/show_bug.cgi?id=187014

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/factories.py:
(BindingsFactory): Added RunBindingsTests build step to BindingsFactory.
* BuildSlaveSupport/ews-build/steps.py:
(RunBindingsTests): Added build-step for running Bindings tests.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.

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

2 years agoperformance-api/performance-observer-no-document-leak.html is flaky
cdumez@apple.com [Mon, 25 Jun 2018 21:27:11 +0000 (21:27 +0000)]
performance-api/performance-observer-no-document-leak.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=186938
<rdar://problem/41379336>

Unreviewed, skip test again as it is apparently still flaky.

* TestExpectations:

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

2 years agoMatchedPropertiesCacheItem wastes 388KB of vector capacity on nytimes.com
simon.fraser@apple.com [Mon, 25 Jun 2018 21:15:21 +0000 (21:15 +0000)]
MatchedPropertiesCacheItem wastes 388KB of vector capacity on nytimes.com
https://bugs.webkit.org/show_bug.cgi?id=186990

Reviewed by Antti Koivisto.

MatchedPropertiesCacheItem.matchedProperties was appended to, so it allocated capacity
in 16-size chunks. Instead, assign to it so it only allocates as much capacity as is needed.
Copy-constructing is more wasteful, since it copies the 64-chunk size from the right-hand side.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::addToMatchedPropertiesCache):
* css/StyleResolver.h:
(WebCore::StyleResolver::MatchedPropertiesCacheItem::MatchedPropertiesCacheItem):

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

2 years agoNetworkLoadChecker should not check CORS for 304 responses triggered by WebProcess...
youenn@apple.com [Mon, 25 Jun 2018 21:14:07 +0000 (21:14 +0000)]
NetworkLoadChecker should not check CORS for 304 responses triggered by WebProcess revalidation
https://bugs.webkit.org/show_bug.cgi?id=186939
<rdar://problem/40941725>

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/cors/resources/cache-304.py: Added.
* web-platform-tests/cors/script-304-expected.txt: Added.
* web-platform-tests/cors/script-304.html: Added.

Source/WebKit:

* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::validateResponse):

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