WebKit-https.git
15 months agoUnreviewed gardening. Update expectations for new tests added in r230953.
carlosgc@webkit.org [Wed, 25 Apr 2018 11:06:07 +0000 (11:06 +0000)]
Unreviewed gardening. Update expectations for new tests added in r230953.

* TestExpectations.json:

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

15 months ago[GTK] Implement MouseEvent.buttons
carlosgc@webkit.org [Wed, 25 Apr 2018 10:16:59 +0000 (10:16 +0000)]
[GTK] Implement MouseEvent.buttons
https://bugs.webkit.org/show_bug.cgi?id=184913

Reviewed by Žan Doberšek.

Source/WebCore:

Add helper function to get the state modifier of a GDK button.

* platform/gtk/GtkUtilities.cpp:
(WebCore::stateModifierForGdkButton):
* platform/gtk/GtkUtilities.h:

Source/WebKit:

It's currently returning always 0.

* Shared/gtk/WebEventFactory.cpp:
(WebKit::pressedMouseButtons): Helper function to get the pressed mouse buttons.
(WebKit::WebEventFactory::createWebMouseEvent): Pass presssed mouse buttons to constructor instead of 0.
* UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
(WebKit::WebAutomationSession::platformSimulateMouseInteraction): Include the mouse buttons state in automation
synthesized events and update m_currentModifiers with the mouse buttons state.
(WebKit::keyCodeForVirtualKey): Do not set the state here.
(WebKit::modifiersForKeyCode): Helper to get the modifiers for a key code.
(WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): Initialize the modifiers also when
virtualKey is std::nullopt;

Tools:

Include the mouse buttons state in WTR synthesized events.

* WebKitTestRunner/EventSenderProxy.h:
* WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
(WTR::EventSenderProxy::EventSenderProxy):
(WTR::EventSenderProxy::createMouseButtonEvent):
(WTR::EventSenderProxy::mouseDown):
(WTR::EventSenderProxy::mouseUp):
(WTR::EventSenderProxy::mouseMoveTo):

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

15 months agoAX: soft link libAccessibility.dylb
n_wang@apple.com [Wed, 25 Apr 2018 05:52:57 +0000 (05:52 +0000)]
AX: soft link libAccessibility.dylb
https://bugs.webkit.org/show_bug.cgi?id=184919

Reviewed by Dan Bernstein.

Weakly linked libAccessibility.dylib on macOS.

* Configurations/WebKit.xcconfig:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _updateAccessibilityEventsEnabled]):

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

15 months ago[GTK][WPE] Fix triggered bot name on the WPE Debug Build bot
commit-queue@webkit.org [Wed, 25 Apr 2018 05:33:48 +0000 (05:33 +0000)]
[GTK][WPE] Fix triggered bot name on the WPE Debug Build bot
https://bugs.webkit.org/show_bug.cgi?id=184954

Patch by Pablo Saavedra <psaavedra@igalia.com> on 2018-04-24
Reviewed by Michael Catanzaro.

* BuildSlaveSupport/build.webkit.org-config/config.json:

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

15 months agoRelease assert in ScriptController::canExecuteScripts via CachedSVGFont::ensureCustom...
rniwa@webkit.org [Wed, 25 Apr 2018 03:42:06 +0000 (03:42 +0000)]
Release assert in ScriptController::canExecuteScripts via CachedSVGFont::ensureCustomFontData during
Document::updateStyleIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=184950

Reviewed by Zalan Bujtas.

Convert an existing ScriptDisallowedScope::EventAllowedScope which only disables the debug assertions
by ScriptDisallowedScope::DisableAssertionsInScope which also disables the release assertion.

Because SVG font is loaded in a document isolated from the rest of the page (m_externalSVGDocument),
there is no security implication to execute scripts in this isolated document.

Unfortunately, no new tests. I could never make CachedSVGFont::ensureCustomFontData to get called inside
style resolution with m_externalSVGDocument set to nullptr after many attempts. Even EventAllowedScope
I added 13 months ago in r211965, which this patch replaces by DisableAssertionsInScope, is not utilized
by the existing layout tests since removing the assertion doesn't cause any layout test to hit an assertion.

* dom/ScriptDisallowedScope.h: Updated the comment.
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::ensureCustomFontData): Replaced the asssertion.

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

15 months ago[WinCairo] Add WKView and WKAPI
Hironori.Fujii@sony.com [Wed, 25 Apr 2018 03:36:06 +0000 (03:36 +0000)]
[WinCairo] Add WKView and WKAPI
https://bugs.webkit.org/show_bug.cgi?id=182869

Reviewed by Alex Christensen.

Resurrected source files for WebKit for Windows port which was
removed in r139003.

* PlatformWin.cmake: Renamed the output name of WebKit to WebKit2
not to conflict WebKitLegacy. Added source files and include paths.
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/win/WKAPICastWin.h: Added.
* UIProcess/API/C/win/WKView.cpp: Added.
(WKViewCreate):
(WKViewGetWindow):
(WKViewGetPage):
(WKViewSetParentWindow):
(WKViewWindowAncestryDidChange):
(WKViewSetIsInWindow):
(WKViewSetScrollOffsetOnNextResize):
* UIProcess/API/C/win/WKView.h: Added.
* UIProcess/API/win/APIWebsiteDataStoreWin.cpp: Added.
(API::WebsiteDataStore::defaultApplicationCacheDirectory):
(API::WebsiteDataStore::defaultCacheStorageDirectory):
(API::WebsiteDataStore::defaultNetworkCacheDirectory):
(API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
(API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
(API::WebsiteDataStore::defaultLocalStorageDirectory):
(API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
(API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
(API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
(API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
(API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
(API::WebsiteDataStore::defaultDataStoreConfiguration):
* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Launcher/win/ProcessLauncherWin.cpp: Added.
(WebKit::processName):
(WebKit::ProcessLauncher::launchProcess):
(WebKit::ProcessLauncher::terminateProcess):
(WebKit::ProcessLauncher::platformInvalidate):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::networkProcessFailedToLaunch):
(WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess):
* UIProcess/WebsiteData/win/WebsiteDataStoreWin.cpp: Added.
(WebKit::WebsiteDataStore::platformInitialize):
(WebKit::WebsiteDataStore::platformDestroy):
(WebKit::WebsiteDataStore::platformRemoveRecentSearches):
* UIProcess/win/PageClientImpl.cpp: Added.
(WebKit::PageClientImpl::PageClientImpl):
(WebKit::PageClientImpl::createDrawingAreaProxy):
(WebKit::PageClientImpl::setViewNeedsDisplay):
(WebKit::PageClientImpl::requestScroll):
(WebKit::PageClientImpl::viewScrollPosition):
(WebKit::PageClientImpl::viewSize):
(WebKit::PageClientImpl::isViewWindowActive):
(WebKit::PageClientImpl::isViewFocused):
(WebKit::PageClientImpl::isViewVisible):
(WebKit::PageClientImpl::isViewInWindow):
(WebKit::PageClientImpl::PageClientImpl::processDidExit):
(WebKit::PageClientImpl::didRelaunchProcess):
(WebKit::PageClientImpl::toolTipChanged):
(WebKit::PageClientImpl::setCursor):
(WebKit::PageClientImpl::setCursorHiddenUntilMouseMoves):
(WebKit::PageClientImpl::didChangeViewportProperties):
(WebKit::PageClientImpl::registerEditCommand):
(WebKit::PageClientImpl::clearAllEditCommands):
(WebKit::PageClientImpl::canUndoRedo):
(WebKit::PageClientImpl::executeUndoRedo):
(WebKit::PageClientImpl::convertToDeviceSpace):
(WebKit::PageClientImpl::convertToUserSpace):
(WebKit::PageClientImpl::screenToRootView):
(WebKit::PageClientImpl::rootViewToScreen):
(WebKit::PageClientImpl::doneWithKeyEvent):
(WebKit::PageClientImpl::createPopupMenuProxy):
(WebKit::PageClientImpl::createContextMenuProxy):
(WebKit::createColorPicker):
(WebKit::PageClientImpl::enterAcceleratedCompositingMode):
(WebKit::PageClientImpl::exitAcceleratedCompositingMode):
(WebKit::PageClientImpl::updateAcceleratedCompositingMode):
(WebKit::PageClientImpl::pageClosed):
(WebKit::PageClientImpl::preferencesDidChange):
(WebKit::PageClientImpl::didChangeContentSize):
(WebKit::PageClientImpl::handleDownloadRequest):
(WebKit::PageClientImpl::didCommitLoadForMainFrame):
(WebKit::PageClientImpl::fullScreenManagerProxyClient):
(WebKit::PageClientImpl::closeFullScreenManager):
(WebKit::PageClientImpl::isFullScreen):
(WebKit::PageClientImpl::enterFullScreen):
(WebKit::PageClientImpl::exitFullScreen):
(WebKit::PageClientImpl::beganEnterFullScreen):
(WebKit::PageClientImpl::beganExitFullScreen):
(WebKit::PageClientImpl::doneWithTouchEvent):
(WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore):
(WebKit::PageClientImpl::didFinishLoadingDataForCustomContentProvider):
(WebKit::PageClientImpl::navigationGestureDidBegin):
(WebKit::PageClientImpl::navigationGestureWillEnd):
(WebKit::PageClientImpl::navigationGestureDidEnd):
(WebKit::PageClientImpl::willRecordNavigationSnapshot):
(WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot):
(WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame):
(WebKit::PageClientImpl::didFinishLoadForMainFrame):
(WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame):
(WebKit::PageClientImpl::didChangeBackgroundColor):
(WebKit::PageClientImpl::isPlayingAudioWillChange):
(WebKit::PageClientImpl::isPlayingAudioDidChange):
(WebKit::PageClientImpl::refView):
(WebKit::PageClientImpl::derefView):
* UIProcess/win/PageClientImpl.h: Added.
* UIProcess/win/TextCheckerWin.cpp: Added.
(WebKit::checkerState):
(WebKit::TextChecker::state):
(WebKit::TextChecker::setTestingMode):
(WebKit::TextChecker::isTestingMode):
(WebKit::TextChecker::isContinuousSpellCheckingAllowed):
(WebKit::TextChecker::setContinuousSpellCheckingEnabled):
(WebKit::TextChecker::setGrammarCheckingEnabled):
(WebKit::TextChecker::continuousSpellCheckingEnabledStateChanged):
(WebKit::TextChecker::grammarCheckingEnabledStateChanged):
(WebKit::TextChecker::uniqueSpellDocumentTag):
(WebKit::TextChecker::closeSpellDocumentWithTag):
(WebKit::TextChecker::checkSpellingOfString):
(WebKit::TextChecker::checkGrammarOfString):
(WebKit::TextChecker::spellingUIIsShowing):
(WebKit::TextChecker::toggleSpellingUIIsShowing):
(WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
(WebKit::TextChecker::updateSpellingUIWithGrammarString):
(WebKit::TextChecker::getGuessesForWord):
(WebKit::TextChecker::learnWord):
(WebKit::TextChecker::ignoreWord):
(WebKit::TextChecker::requestCheckingOfString):
(WebKit::TextChecker::checkTextOfParagraph):
* UIProcess/win/WebContextMenuProxyWin.cpp: Added.
(WebKit::WebContextMenuProxyWin::show):
(WebKit::WebContextMenuProxyWin::showContextMenuWithItems):
(WebKit::WebContextMenuProxyWin::WebContextMenuProxyWin):
(WebKit::WebContextMenuProxyWin::~WebContextMenuProxyWin):
* UIProcess/win/WebContextMenuProxyWin.h: Added.
(WebKit::WebContextMenuProxyWin::create):
* UIProcess/win/WebInspectorProxyWin.cpp: Added.
(WebKit::WebInspectorProxy::platformCreateFrontendPage):
(WebKit::WebInspectorProxy::platformCreateFrontendWindow):
(WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
(WebKit::WebInspectorProxy::platformDidCloseForCrash):
(WebKit::WebInspectorProxy::platformInvalidate):
(WebKit::WebInspectorProxy::platformHide):
(WebKit::WebInspectorProxy::platformBringToFront):
(WebKit::WebInspectorProxy::platformBringInspectedPageToFront):
(WebKit::WebInspectorProxy::platformIsFront):
(WebKit::WebInspectorProxy::platformInspectedURLChanged):
(WebKit::WebInspectorProxy::inspectorPageURL):
(WebKit::WebInspectorProxy::inspectorTestPageURL):
(WebKit::WebInspectorProxy::inspectorBaseURL):
(WebKit::WebInspectorProxy::platformInspectedWindowHeight):
(WebKit::WebInspectorProxy::platformInspectedWindowWidth):
(WebKit::WebInspectorProxy::platformAttach):
(WebKit::WebInspectorProxy::platformDetach):
(WebKit::WebInspectorProxy::platformSetAttachedWindowHeight):
(WebKit::WebInspectorProxy::platformSetAttachedWindowWidth):
(WebKit::WebInspectorProxy::platformStartWindowDrag):
(WebKit::WebInspectorProxy::platformSave):
(WebKit::WebInspectorProxy::platformAppend):
(WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
* UIProcess/win/WebPageProxyWin.cpp: Added.
(WebKit::WebPageProxy::platformInitialize):
(WebKit::WebPageProxy::standardUserAgent):
(WebKit::WebPageProxy::saveRecentSearches):
(WebKit::WebPageProxy::loadRecentSearches):
(WebKit::WebPageProxy::editorStateChanged):
* UIProcess/win/WebPreferencesWin.cpp: Added.
(WebKit::WebPreferences::platformInitializeStore):
(WebKit::WebPreferences::platformUpdateStringValueForKey):
(WebKit::WebPreferences::platformUpdateBoolValueForKey):
(WebKit::WebPreferences::platformUpdateUInt32ValueForKey):
(WebKit::WebPreferences::platformUpdateDoubleValueForKey):
(WebKit::WebPreferences::platformUpdateFloatValueForKey):
(WebKit::WebPreferences::platformGetStringUserValueForKey):
(WebKit::WebPreferences::platformGetBoolUserValueForKey):
(WebKit::WebPreferences::platformGetUInt32UserValueForKey):
(WebKit::WebPreferences::platformGetDoubleUserValueForKey):
* UIProcess/win/WebProcessPoolWin.cpp: Added.
(WebKit::WebProcessPool::platformInitialize):
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
(WebKit::WebProcessPool::platformInitializeWebProcess):
(WebKit::WebProcessPool::platformInvalidateContext):
(WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory):
(WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory):
(WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
(WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
(WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
(WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
(WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
(WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory):
(WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
* UIProcess/win/WebView.cpp: Added.
(WebKit::WebView::WebViewWndProc):
(WebKit::WebView::wndProc):
(WebKit::WebView::registerWebViewWindowClass):
(WebKit::WebView::WebView):
(WebKit::WebView::~WebView):
(WebKit::WebView::initialize):
(WebKit::WebView::setParentWindow):
(WebKit::findTopLevelParentWindow):
(WebKit::WebView::windowAncestryDidChange):
(WebKit::WebView::onMouseEvent):
(WebKit::WebView::onWheelEvent):
(WebKit::WebView::onHorizontalScroll):
(WebKit::WebView::onVerticalScroll):
(WebKit::WebView::onKeyEvent):
(WebKit::drawPageBackground):
(WebKit::WebView::paint):
(WebKit::WebView::onPaintEvent):
(WebKit::WebView::onPrintClientEvent):
(WebKit::WebView::onSizeEvent):
(WebKit::WebView::onWindowPositionChangedEvent):
(WebKit::WebView::onSetFocusEvent):
(WebKit::WebView::onKillFocusEvent):
(WebKit::WebView::onTimerEvent):
(WebKit::WebView::onShowWindowEvent):
(WebKit::WebView::onSetCursor):
(WebKit::WebView::updateActiveState):
(WebKit::WebView::updateActiveStateSoon):
(WebKit::initCommonControls):
(WebKit::WebView::initializeToolTipWindow):
(WebKit::WebView::startTrackingMouseLeave):
(WebKit::WebView::stopTrackingMouseLeave):
(WebKit::WebView::shouldInitializeTrackPointHack):
(WebKit::WebView::close):
(WebKit::WebView::cursorToShow const):
(WebKit::WebView::updateNativeCursor):
(WebKit::WebView::setOverrideCursor):
(WebKit::WebView::setIsInWindow):
(WebKit::WebView::setIsVisible):
(WebKit::WebView::isWindowActive):
(WebKit::WebView::isFocused):
(WebKit::WebView::isVisible):
(WebKit::WebView::isInWindow):
(WebKit::WebView::setScrollOffsetOnNextResize):
(WebKit::WebView::setViewNeedsDisplay):
(WebKit::WebView::createColorChooserProxy):
(WebKit::WebView::didCommitLoadForMainFrame):
(WebKit::WebView::customRepresentationZoomFactor):
(WebKit::WebView::setCustomRepresentationZoomFactor):
(WebKit::WebView::findStringInCustomRepresentation):
(WebKit::WebView::countStringMatchesInCustomRepresentation):
(WebKit::WebView::nativeWindow):
(WebKit::WebView::windowReceivedMessage):
* UIProcess/win/WebView.h: Added.
(WebKit::WebView::create):
(WebKit::WebView::window const):
(WebKit::WebView::page const):
(WebKit::WebView::drawingArea):
(WebKit::WebView::setWasActivatedByMouseEvent):

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

15 months agoImplement Same-Site cookies
Hironori.Fujii@sony.com [Wed, 25 Apr 2018 03:28:25 +0000 (03:28 +0000)]
Implement Same-Site cookies
https://bugs.webkit.org/show_bug.cgi?id=159464
<rdar://problem/27196358>

Unreviewed build fix.

WinCairo WebKit2 can't compile since r230921.

* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::appendCookieHeader):
CookieJarCurlDatabase::cookieRequestHeaderFieldValue needs
SameSiteInfo.

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

15 months agofromCharCode is missing some exception checks
keith_miller@apple.com [Wed, 25 Apr 2018 03:14:21 +0000 (03:14 +0000)]
fromCharCode is missing some exception checks
https://bugs.webkit.org/show_bug.cgi?id=184952

Reviewed by Saam Barati.

JSTests:

* stress/fromCharCode-exception-check.js: Added.
(get catch):

Source/JavaScriptCore:

I also removed the pointless slow path function and moved it into the
main function.

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

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

15 months agovisitedDependentColor() should take a CSSPropertyID
simon.fraser@apple.com [Wed, 25 Apr 2018 01:51:49 +0000 (01:51 +0000)]
visitedDependentColor() should take a CSSPropertyID
https://bugs.webkit.org/show_bug.cgi?id=184949

Reviewed by Sam Weinig.

Change RenderStyle::colorIncludingFallback(), RenderStyle::visitedDependentColor()
and RenderElement::selectionColor() to take CSSPropertyID rather than int.

No behavior change.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::selectionColor const):
* rendering/RenderElement.h:
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computeCollapsedStartBorder const):
(WebCore::RenderTableCell::computeCollapsedEndBorder const):
(WebCore::RenderTableCell::computeCollapsedBeforeBorder const):
(WebCore::RenderTableCell::computeCollapsedAfterBorder const):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::colorIncludingFallback const):
(WebCore::RenderStyle::visitedDependentColor const):
* rendering/style/RenderStyle.h:

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

15 months agoAdd a new "color-filter" CSS property as an experimental feature
simon.fraser@apple.com [Wed, 25 Apr 2018 01:50:39 +0000 (01:50 +0000)]
Add a new "color-filter" CSS property as an experimental feature
https://bugs.webkit.org/show_bug.cgi?id=184940
Source/WebCore:

rdar://problem/39664904

Reviewed by Jon Lee.

Add a new CSS property called "color-filter" as an experimental feature (off by default).

This property specifies a list of filter functions (as specified in https://drafts.fxtf.org/filter-effects/#supported-filter-functions)
to CSS colors, allowing authors to modify the provided page colors, for example to improve accessibility.
Filters that move pixels (i.e. blur() and drop-shadow()) are invalid in this property.

Colors will be mapped through the filter functions just before paint time, and gradient stop colors will also be mapped.

This patch adds support for parsing color-filter.

Test: css3/color-filters/color-filter-parsing.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
* css/parser/CSSParserMode.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::isColorFilterFunction):
(WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
(WebCore::CSSPropertyParserHelpers::consumeFilter):
* css/parser/CSSPropertyParserHelpers.h:
* page/Settings.yaml:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresRepaint const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::mutableColorFilter):
(WebCore::RenderStyle::colorFilter const):
(WebCore::RenderStyle::hasColorFilter const):
(WebCore::RenderStyle::setColorFilter):
(WebCore::RenderStyle::initialColorFilter):
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
(WebCore::StyleRareInheritedData::hasColorFilters const):
* rendering/style/StyleRareInheritedData.h:

Source/WebKit:

Reviewed by Jon Lee.

Add the color-filter property as an experimental feature.

* Shared/WebPreferences.yaml:

LayoutTests:

Reviewed by Jon Lee.

* css3/color-filters/color-filter-parsing-expected.txt: Added.
* css3/color-filters/color-filter-parsing.html: Added.

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

15 months agoKeep around a pre-warmed process when doing process swap on navigation
sbarati@apple.com [Tue, 24 Apr 2018 23:19:25 +0000 (23:19 +0000)]
Keep around a pre-warmed process when doing process swap on navigation
https://bugs.webkit.org/show_bug.cgi?id=184765
<rdar://problem/39685099>

Reviewed by Ryosuke Niwa and Brady Eidson.

Source/WebKit:

This patch makes it so that WebProcessPool prewarms a process when process
swap on navigation is turned on. When we do a process swap on navigation,
we first try to grab a prewarmed process before creating a new one.

We try to be smart about when to create these processes. The initial heuristic
that this patch chooses is when we reach the DidFirstVisuallyNonEmptyLayout
layout milestone. We're going to try to improve on this heuristic in:
https://bugs.webkit.org/show_bug.cgi?id=184899

This is a 40% progression on PLT with process swap on navigation turned on.

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _prewarmedWebProcessCount]):
(-[WKProcessPool _webProcessCountIgnoringPrewarmed]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::notifyProcessPoolToPrewarm):
(WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::tryTakePrewarmedProcess):
(WebKit::WebProcessPool::warmInitialProcess):
(WebKit::WebProcessPool::disconnectProcess):
(WebKit::WebProcessPool::createWebPage):
(WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
(WebKit::WebProcessPool::processForNavigation):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::create):
(WebKit::WebProcessProxy::WebProcessProxy):
(WebKit::m_isInPrewarmedPool):
(WebKit::m_userMediaCaptureManagerProxy): Deleted.
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::isInPrewarmedPool const):
(WebKit::WebProcessProxy::setIsInPrewarmedPool):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

15 months agoshape-outside and filter styles occur twice in the result of getComputedStyle
simon.fraser@apple.com [Tue, 24 Apr 2018 23:06:26 +0000 (23:06 +0000)]
shape-outside and filter styles occur twice in the result of getComputedStyle
https://bugs.webkit.org/show_bug.cgi?id=184931

Reviewed by Antti Koivisto.

CSSPropertyShapeOutside and CSSPropertyFilter were duplicated in the list of computedProperties[]
used by getComputedStyle. Remove the duplication.
Source/WebCore:

Tested by existing tests.

* css/CSSComputedStyleDeclaration.cpp:

LayoutTests:

* fast/css/getComputedStyle/computed-style-expected.txt:
* fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* platform/ios/fast/css/getComputedStyle/computed-style-expected.txt:
* platform/ios/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* platform/mac-sierra/fast/css/getComputedStyle/computed-style-expected.txt:
* platform/mac-sierra/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* platform/mac-sierra/svg/css/getComputedStyle-basic-expected.txt:
* platform/mac/fast/css/getComputedStyle/computed-style-expected.txt:
* platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* platform/mac/svg/css/getComputedStyle-basic-expected.txt:
* svg/css/getComputedStyle-basic-expected.txt:

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

15 months agoMultiByOffset should emit one fewer branches in the case that the set of structures...
fpizlo@apple.com [Tue, 24 Apr 2018 22:29:39 +0000 (22:29 +0000)]
MultiByOffset should emit one fewer branches in the case that the set of structures is proved already
https://bugs.webkit.org/show_bug.cgi?id=184923

Reviewed by Saam Barati.

If we have a MultiGetByOffset or MultiPutByOffset over a structure set that we've already proved
(i.e. we know that the object has one of those structures), then previously we would still emit a
switch with a case per structure along with a default case. That would mean one extra redundant
branch to check that whatever structure we wound up with belongs to the set. In that case, we
were already making the default case be an Oops.

One possible solution would be to say that the default case being Oops means that B3 doesn't need
to emit the extra branch. But that would require having B3 exploit the fact that Oops is known to
be unreachable. Although B3 IR semantics (webkit.org/docs/b3/intermediate-representation.html)
seem to allow this, I don't particularly like that style of optimization. I like Oops to mean
trap.

So, this patch makes FTL lowering turn one of the cases into the default, explicitly removing the
extra branch.

This is not a speed-up. But it makes the B3 IR for MultiByOffset a lot simpler, which should make
it easier to implement B3-level optimizations for MultiByOffset. It also makes the IR easier to
read.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileMultiGetByOffset):
(JSC::FTL::DFG::LowerDFGToB3::compileMultiPutByOffset):
(JSC::FTL::DFG::LowerDFGToB3::emitSwitchForMultiByOffset):

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

15 months agoUnreviewed, rolling out r230971.
commit-queue@webkit.org [Tue, 24 Apr 2018 22:11:53 +0000 (22:11 +0000)]
Unreviewed, rolling out r230971.
https://bugs.webkit.org/show_bug.cgi?id=184939

This fix was not appropriate (Requested by n_wang on #webkit).

Reverted changeset:

"AX: soft link libAccessibility.dylb"
https://bugs.webkit.org/show_bug.cgi?id=184919
https://trac.webkit.org/changeset/230971

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

15 months ago[Curl] Extract proxy settings into a separate class to hold advanced information.
commit-queue@webkit.org [Tue, 24 Apr 2018 21:54:49 +0000 (21:54 +0000)]
[Curl] Extract proxy settings into a separate class to hold advanced information.
https://bugs.webkit.org/show_bug.cgi?id=184714

It was simplely structure to hold proxy setting. To support advanced feature of proxy
such as authentication, more inteligent object is required to store intermediate state
or errors. That's why we've introduced new class for that purpose.

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2018-04-24
Reviewed by Youenn Fablet.

No new tests because there's no new behavior.

* platform/Curl.cmake:
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::enableProxyIfExists):
(WebCore::CurlContext::ProxyInfo::url const): Deleted.
(WebCore::CurlContext::setProxyInfo): Deleted.
* platform/network/curl/CurlContext.h:
(WebCore::CurlContext::proxySettings const):
(WebCore::CurlContext::setProxySettings):
(WebCore::CurlContext::setProxyUserPass):
(WebCore::CurlContext::proxyInfo const): Deleted.
(WebCore::CurlContext::setProxyInfo): Deleted.
* platform/network/curl/CurlProxySettings.cpp: Added.
(WebCore::CurlProxySettings::CurlProxySettings):
(WebCore::CurlProxySettings::rebuildUrl):
(WebCore::CurlProxySettings::setUserPass):
(WebCore::protocolIsInSocksFamily):
(WebCore::getProxyPort):
(WebCore::createProxyUrl):
* platform/network/curl/CurlProxySettings.h: Added.
(WebCore::CurlProxySettings::CurlProxySettings):
(WebCore::CurlProxySettings::isEmpty const):
(WebCore::CurlProxySettings::mode const):
(WebCore::CurlProxySettings::url const):
(WebCore::CurlProxySettings::ignoreHosts const):
(WebCore::CurlProxySettings::user const):
(WebCore::CurlProxySettings::password const):
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::didReceiveHeader):
* platform/network/curl/CurlResponse.h:
(WebCore::CurlResponse::isolatedCopy const):
* platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::ResourceResponse):

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

15 months agoGardening: test fix after r230863.
mark.lam@apple.com [Tue, 24 Apr 2018 21:52:50 +0000 (21:52 +0000)]
Gardening: test fix after r230863.
https://bugs.webkit.org/show_bug.cgi?id=184846
<rdar://problem/39390672>

Not reviewed.

* stress/json-stringified-overflow-2.js:
(catch):
* stress/json-stringified-overflow.js:
(catch):

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

15 months agoAX: soft link libAccessibility.dylb
n_wang@apple.com [Tue, 24 Apr 2018 21:27:01 +0000 (21:27 +0000)]
AX: soft link libAccessibility.dylb
https://bugs.webkit.org/show_bug.cgi?id=184919

Reviewed by Chris Fleizach.

Source/WebKit:

Make sure we soft link the library so that it won't crash
if it's missing in the system.

* Configurations/WebKit.xcconfig:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _updateAccessibilityEventsEnabled]):

Source/WTF:

* wtf/cocoa/SoftLinking.h:

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

15 months agoThrow in case of PeerConnection created for detached documents
youenn@apple.com [Tue, 24 Apr 2018 20:22:51 +0000 (20:22 +0000)]
Throw in case of PeerConnection created for detached documents
https://bugs.webkit.org/show_bug.cgi?id=184921
<rdar://problem/39629216>

Reviewed by Eric Carlson.

Source/WebCore:

Add a check to ensure that page is not null when creating a peer connection backend.
In that case, the peer connection constructor will later on throw.
The same for setConfiguration is done.
Behavior is consistent with Chrome.

Test: webrtc/pc-detached-document.html

* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::createLibWebRTCPeerConnectionBackend):
(WebCore::LibWebRTCPeerConnectionBackend::LibWebRTCPeerConnectionBackend):
(WebCore::LibWebRTCPeerConnectionBackend::setConfiguration):
(WebCore::libWebRTCProvider): Deleted.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:

LayoutTests:

* webrtc/pc-detached-document-expected.txt: Added.
* webrtc/pc-detached-document.html: Added.

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

15 months ago[build.webkit.org] unit-tests fail when passwords.json is missing
aakash_jain@apple.com [Tue, 24 Apr 2018 20:15:02 +0000 (20:15 +0000)]
[build.webkit.org] unit-tests fail when passwords.json is missing
https://bugs.webkit.org/show_bug.cgi?id=180390

Reviewed by Carlos Alberto Lopez Perez.

* BuildSlaveSupport/build.webkit.org-config/loadConfig.py:
(loadBuilderConfig): Add support for test_mode. Load mock passwords in test_mode.
* BuildSlaveSupport/build.webkit.org-config/steps_unittest.py:
(BuildBotConfigLoader._add_dependant_modules_to_sys_modules): Call _add_webkitpy_to_sys_path as well.
(BuildBotConfigLoader._mock_open): Deleted.
(BuildBotConfigLoader.load_config): Deleted.

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

15 months agoFrom-Origin: Support for 'same' and 'same-site' response header, nested frame origin...
wilander@apple.com [Tue, 24 Apr 2018 19:51:22 +0000 (19:51 +0000)]
From-Origin: Support for 'same' and 'same-site' response header, nested frame origin check
https://bugs.webkit.org/show_bug.cgi?id=184560
<rdar://problem/38901344>

Reviewed by Youenn Fablet and Daniel Bates.

LayoutTests/imported/w3c:

This patch implements significant parts of https://github.com/whatwg/fetch/issues/687.
We consume the From-Origin response header and only load the resource if:
- The header is non-existent, empty, or invalid.
- The header specifies 'same' and the resource's origin matches the originating
  document's origin and the origins up the frame tree.
- The header specifies 'same-site' and the resource's eTLD+1 matches the originating
  document's eTLD+1 and the eTLD+1 of the documents up the frame tree.

This feature is experimental and off by default.

* web-platform-tests/service-workers/service-worker/fetch-request-redirect.https-expected.txt:
    Removed console message since they are now suppressed.

Source/WebCore:

Tests: http/tests/from-origin/document-from-origin-same-accepted.html
       http/tests/from-origin/document-from-origin-same-blocked.html
       http/tests/from-origin/document-from-origin-same-site-accepted.html
       http/tests/from-origin/document-from-origin-same-site-blocked.html
       http/tests/from-origin/document-nested-from-origin-same-accepted.html
       http/tests/from-origin/document-nested-from-origin-same-blocked.html
       http/tests/from-origin/fetch-data-iframe-from-origin-same-blocked.html
       http/tests/from-origin/fetch-from-origin-same-accepted.html
       http/tests/from-origin/fetch-from-origin-same-blocked.html
       http/tests/from-origin/fetch-from-origin-same-site-accepted.html
       http/tests/from-origin/fetch-from-origin-same-site-blocked.html
       http/tests/from-origin/fetch-iframe-from-origin-same-accepted.html
       http/tests/from-origin/fetch-iframe-from-origin-same-blocked.html
       http/tests/from-origin/image-about-blank-from-origin-same-blocked.html
       http/tests/from-origin/image-from-origin-same-accepted.html
       http/tests/from-origin/image-from-origin-same-blocked.html
       http/tests/from-origin/image-from-origin-same-site-accepted.html
       http/tests/from-origin/image-from-origin-same-site-blocked.html
       http/tests/from-origin/redirect-document-from-origin-same-blocked.html
       http/tests/from-origin/redirect-fetch-from-origin-same-blocked.html
       http/tests/from-origin/redirect-image-from-origin-same-blocked.html
       http/tests/from-origin/redirect-script-from-origin-same-blocked.html
       http/tests/from-origin/redirect-xhr-from-origin-same-blocked.html
       http/tests/from-origin/sandboxed-sub-frame-from-origin-same-blocked.html
       http/tests/from-origin/sandboxed-sub-frame-nested-cross-origin-from-origin-same-blocked.html
       http/tests/from-origin/sandboxed-sub-frame-nested-same-origin-from-origin-same-blocked.html
       http/tests/from-origin/script-from-origin-same-accepted.html
       http/tests/from-origin/script-from-origin-same-blocked.html
       http/tests/from-origin/script-from-origin-same-site-accepted.html
       http/tests/from-origin/script-from-origin-same-site-blocked.html
       http/tests/from-origin/top-frame-document-from-origin-same-accepted.php
       http/tests/from-origin/xhr-from-origin-same-accepted.html
       http/tests/from-origin/xhr-from-origin-same-blocked.html
       http/tests/from-origin/xhr-from-origin-same-site-accepted.html
       http/tests/from-origin/xhr-from-origin-same-site-blocked.html

* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didFail):
    Outputs the error's localized description in a console message except when the destination
    is FetchOptions::Destination::Serviceworker or FetchOptions::Destination::EmptyString.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setFromOriginResponseHeaderEnabled):
(WebCore::RuntimeEnabledFeatures::fromOriginResponseHeaderEnabled const):
    Added From-Origin support as an experimental feature.
* platform/network/HTTPHeaderNames.in:
    Added From-Origin.
* platform/network/HTTPParsers.cpp:
(WebCore::parseFromOriginHeader):
    Parses the From-Origin header, currently supporting 'Same' and 'Same-Site.'
* platform/network/HTTPParsers.h:

Source/WebKit:

This patch implements significant parts of https://github.com/whatwg/fetch/issues/687.
We consume the From-Origin response header and only load the resource if:
- The header is non-existent, empty, or invalid.
- The header specifies 'same' and the resource's origin matches the originating
  document's origin and the origins up the frame tree.
- The header specifies 'same-site' and the resource's eTLD+1 matches the originating
  document's eTLD+1 and the eTLD+1 of the documents up the frame tree.

This feature is experimental and off by default.

* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
    Support for the two new load parameters:
    - shouldEnableFromOriginResponseHeader
    - frameAncestorOrigins
* NetworkProcess/NetworkResourceLoadParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::areFrameAncestorsSameSite):
(WebKit::areFrameAncestorsSameOrigin):
(WebKit::shouldCancelCrossOriginLoad):
    The three functions above implement the new blocking logic.
(WebKit::fromOriginResourceError):
    Convenience function that returns an error with the From-Origin error message.
(WebKit::NetworkResourceLoader::didReceiveResponse):
    Now checks for a From-Origin response header.
(WebKit::NetworkResourceLoader::didFailLoading):
    Now checks for a From-Origin response header.
(WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
    Now checks for a From-Origin response header.
(WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
    Now checks for a From-Origin response header.
(WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
    Now checks for a From-Origin response header.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<Vector<RefPtr<SecurityOrigin>>>::encode):
(IPC::ArgumentCoder<Vector<RefPtr<SecurityOrigin>>>::decode):
    Now encodes and decodes vectors of RefPtr<WebCore::SecurityOrigin>.
* Shared/WebCoreArgumentCoders.h:
* Shared/WebPreferences.yaml:
    Added From-Origin support as an experimental feature.
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetFromOriginResponseHeaderEnabled):
(WKPreferencesGetFromOriginResponseHeaderEnabled):
* UIProcess/API/C/WKPreferencesRef.h:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
    Sets the two new load parameters:
    - shouldEnableFromOriginResponseHeader
    - frameAncestorOrigins

Tools:

This patch implements significant parts of https://github.com/whatwg/fetch/issues/687.
We consume the From-Origin response header and only load the resource if:
- The header is non-existent, empty, or invalid.
- The header specifies 'same' and the resource's origin matches the originating
  document's origin and the origins up the frame tree.
- The header specifies 'same-site' and the resource's eTLD+1 matches the originating
  document's eTLD+1 and the eTLD+1 of the documents up the frame tree.

This feature is experimental and off by default.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/HTTPParsers.cpp: Added.
(TestWebKitAPI::TEST):
    Tests for From-Origin header parsing.

LayoutTests:

This patch implements significant parts of https://github.com/whatwg/fetch/issues/687.
We consume the From-Origin response header and only load the resource if:
- The header is non-existent, empty, or invalid.
- The header specifies 'same' and the resource's origin matches the originating
  document's origin and the origins up the frame tree.
- The header specifies 'same-site' and the resource's eTLD+1 matches the originating
  document's eTLD+1 and the eTLD+1 of the documents up the frame tree.

This feature is experimental and off by default.

* TestExpectations:
    The http/tests/from-origin/ directory marked as [ Skip ].
    Suppressed console output for imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-redirect.https.html.
* http/tests/from-origin: Added.
* http/tests/from-origin/document-from-origin-same-accepted-expected.txt: Added.
* http/tests/from-origin/document-from-origin-same-accepted.html: Added.
* http/tests/from-origin/document-from-origin-same-blocked-expected.txt: Added.
* http/tests/from-origin/document-from-origin-same-blocked.html: Added.
* http/tests/from-origin/document-from-origin-same-site-accepted-expected.txt: Added.
* http/tests/from-origin/document-from-origin-same-site-accepted.html: Added.
* http/tests/from-origin/document-from-origin-same-site-blocked-expected.txt: Added.
* http/tests/from-origin/document-from-origin-same-site-blocked.html: Added.
* http/tests/from-origin/document-nested-from-origin-same-accepted-expected.txt: Added.
* http/tests/from-origin/document-nested-from-origin-same-accepted.html: Added.
* http/tests/from-origin/document-nested-from-origin-same-blocked-expected.txt: Added.
* http/tests/from-origin/document-nested-from-origin-same-blocked.html: Added.
* http/tests/from-origin/fetch-data-iframe-from-origin-same-blocked-expected.txt: Added.
* http/tests/from-origin/fetch-data-iframe-from-origin-same-blocked.html: Added.
* http/tests/from-origin/fetch-from-origin-same-accepted-expected.txt: Added.
* http/tests/from-origin/fetch-from-origin-same-accepted.html: Added.
* http/tests/from-origin/fetch-from-origin-same-blocked-expected.txt: Added.
* http/tests/from-origin/fetch-from-origin-same-blocked.html: Added.
* http/tests/from-origin/fetch-from-origin-same-site-accepted-expected.txt: Added.
* http/tests/from-origin/fetch-from-origin-same-site-accepted.html: Added.
* http/tests/from-origin/fetch-from-origin-same-site-blocked-expected.txt: Added.
* http/tests/from-origin/fetch-from-origin-same-site-blocked.html: Added.
* http/tests/from-origin/fetch-iframe-from-origin-same-accepted-expected.txt: Added.
* http/tests/from-origin/fetch-iframe-from-origin-same-accepted.html: Added.
* http/tests/from-origin/fetch-iframe-from-origin-same-blocked-expected.txt: Added.
* http/tests/from-origin/fetch-iframe-from-origin-same-blocked.html: Added.
* http/tests/from-origin/image-about-blank-from-origin-same-blocked-expected.txt: Added.
* http/tests/from-origin/image-about-blank-from-origin-same-blocked.html: Added.
* http/tests/from-origin/image-from-origin-same-accepted-expected.txt: Added.
* http/tests/from-origin/image-from-origin-same-accepted.html: Added.
* http/tests/from-origin/image-from-origin-same-blocked-expected.txt: Added.
* http/tests/from-origin/image-from-origin-same-blocked.html: Added.
* http/tests/from-origin/image-from-origin-same-site-accepted-expected.txt: Added.
* http/tests/from-origin/image-from-origin-same-site-accepted.html: Added.
* http/tests/from-origin/image-from-origin-same-site-blocked-expected.txt: Added.
* http/tests/from-origin/image-from-origin-same-site-blocked.html: Added.
* http/tests/from-origin/redirect-document-from-origin-same-blocked-expected.txt: Added.
* http/tests/from-origin/redirect-document-from-origin-same-blocked.html: Added.
* http/tests/from-origin/redirect-fetch-from-origin-same-blocked-expected.txt: Added.
* http/tests/from-origin/redirect-fetch-from-origin-same-blocked.html: Added.
* http/tests/from-origin/redirect-image-from-origin-same-blocked-expected.txt: Added.
* http/tests/from-origin/redirect-image-from-origin-same-blocked.html: Added.
* http/tests/from-origin/redirect-script-from-origin-same-blocked-expected.txt: Added.
* http/tests/from-origin/redirect-script-from-origin-same-blocked.html: Added.
* http/tests/from-origin/redirect-xhr-from-origin-same-blocked-expected.txt: Added.
* http/tests/from-origin/redirect-xhr-from-origin-same-blocked.html: Added.
* http/tests/from-origin/resources: Added.
* http/tests/from-origin/resources/fetch.php: Added.
* http/tests/from-origin/resources/iframe.php: Added.
* http/tests/from-origin/resources/iframeIPAddressFetch.html: Added.
* http/tests/from-origin/resources/iframeLocalhostFetch.html: Added.
* http/tests/from-origin/resources/image.php: Added.
* http/tests/from-origin/resources/nestedIPAddressIframe.html: Added.
* http/tests/from-origin/resources/nestedLocalhostIframe.html: Added.
* http/tests/from-origin/resources/redirect.php: Added.
* http/tests/from-origin/resources/script.php: Added.
* http/tests/from-origin/resources/xhr.php: Added.
* http/tests/from-origin/sandboxed-sub-frame-from-origin-same-blocked-expected.txt: Added.
* http/tests/from-origin/sandboxed-sub-frame-from-origin-same-blocked.html: Added.
* http/tests/from-origin/sandboxed-sub-frame-nested-cross-origin-from-origin-same-blocked-expected.txt: Added.
* http/tests/from-origin/sandboxed-sub-frame-nested-cross-origin-from-origin-same-blocked.html: Added.
* http/tests/from-origin/sandboxed-sub-frame-nested-same-origin-from-origin-same-blocked-expected.txt: Added.
* http/tests/from-origin/sandboxed-sub-frame-nested-same-origin-from-origin-same-blocked.html: Added.
* http/tests/from-origin/script-from-origin-same-accepted-expected.txt: Added.
* http/tests/from-origin/script-from-origin-same-accepted.html: Added.
* http/tests/from-origin/script-from-origin-same-blocked-expected.txt: Added.
* http/tests/from-origin/script-from-origin-same-blocked.html: Added.
* http/tests/from-origin/script-from-origin-same-site-accepted-expected.txt: Added.
* http/tests/from-origin/script-from-origin-same-site-accepted.html: Added.
* http/tests/from-origin/script-from-origin-same-site-blocked-expected.txt: Added.
* http/tests/from-origin/script-from-origin-same-site-blocked.html: Added.
* http/tests/from-origin/top-frame-document-from-origin-same-accepted-expected.txt: Added.
* http/tests/from-origin/top-frame-document-from-origin-same-accepted.php: Added.
* http/tests/from-origin/xhr-from-origin-same-accepted-expected.txt: Added.
* http/tests/from-origin/xhr-from-origin-same-accepted.html: Added.
* http/tests/from-origin/xhr-from-origin-same-blocked-expected.txt: Added.
* http/tests/from-origin/xhr-from-origin-same-blocked.html: Added.
* http/tests/from-origin/xhr-from-origin-same-site-accepted-expected.txt: Added.
* http/tests/from-origin/xhr-from-origin-same-site-accepted.html: Added.
* http/tests/from-origin/xhr-from-origin-same-site-blocked-expected.txt: Added.
* http/tests/from-origin/xhr-from-origin-same-site-blocked.html: Added.
* platform/mac-wk2/TestExpectations:
    Suppressed console output for imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-redirect.https.html.
* platform/wk2/TestExpectations:
    The http/tests/from-origin/ directory marked as [ Pass ].

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

15 months agoLand test262 test results associated with Test262 runner
commit-queue@webkit.org [Tue, 24 Apr 2018 19:48:58 +0000 (19:48 +0000)]
Land test262 test results associated with Test262 runner
https://bugs.webkit.org/show_bug.cgi?id=184667

Patch by Leo Balter <leonardo.balter@gmail.com> on 2018-04-24
Reviewed by Michael Saboff.

* .gitignore: Ignore test262 results file.

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

15 months agoRename LayoutCtx.h/cpp to LayoutContext.h/cpp
antti@apple.com [Tue, 24 Apr 2018 19:48:53 +0000 (19:48 +0000)]
Rename LayoutCtx.h/cpp to LayoutContext.h/cpp
https://bugs.webkit.org/show_bug.cgi?id=184922

Reviewed by Zalan Bujtas.

To achieve this the existing LayoutContext class is renamed to FrameViewLayoutContext.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/LayoutContext.cpp: Copied from Source/WebCore/layout/LayoutCtx.cpp.
* layout/LayoutContext.h: Copied from Source/WebCore/layout/LayoutCtx.h.
* layout/LayoutCtx.cpp: Removed.
* layout/LayoutCtx.h: Removed.
* page/FrameView.cpp:
(WebCore::FrameView::shouldDeferScrollUpdateAfterContentSizeChange):
(WebCore::FrameView::updateLayoutViewport):
(WebCore::FrameView::updateLayerPositionsAfterScrolling):
(WebCore::FrameView::updateCompositingLayersAfterScrolling):
(WebCore::FrameView::availableContentSizeChanged):
* page/FrameView.h:
* page/FrameViewLayoutContext.cpp: Copied from Source/WebCore/page/LayoutContext.cpp.
(WebCore::LayoutScope::LayoutScope):
(WebCore::FrameViewLayoutContext::FrameViewLayoutContext):
(WebCore::FrameViewLayoutContext::~FrameViewLayoutContext):
(WebCore::FrameViewLayoutContext::layout):
(WebCore::FrameViewLayoutContext::runOrScheduleAsynchronousTasks):
(WebCore::FrameViewLayoutContext::runAsynchronousTasks):
(WebCore::FrameViewLayoutContext::flushAsynchronousTasks):
(WebCore::FrameViewLayoutContext::reset):
(WebCore::FrameViewLayoutContext::needsLayout const):
(WebCore::FrameViewLayoutContext::setNeedsLayout):
(WebCore::FrameViewLayoutContext::enableSetNeedsLayout):
(WebCore::FrameViewLayoutContext::disableSetNeedsLayout):
(WebCore::FrameViewLayoutContext::scheduleLayout):
(WebCore::FrameViewLayoutContext::unscheduleLayout):
(WebCore::FrameViewLayoutContext::scheduleSubtreeLayout):
(WebCore::FrameViewLayoutContext::layoutTimerFired):
(WebCore::FrameViewLayoutContext::convertSubtreeLayoutToFullLayout):
(WebCore::FrameViewLayoutContext::setSubtreeLayoutRoot):
(WebCore::FrameViewLayoutContext::canPerformLayout const):
(WebCore::FrameViewLayoutContext::applyTextSizingIfNeeded):
(WebCore::FrameViewLayoutContext::updateStyleForLayout):
(WebCore::FrameViewLayoutContext::handleLayoutWithFrameFlatteningIfNeeded):
(WebCore::FrameViewLayoutContext::startLayoutAtMainFrameViewIfNeeded):
(WebCore::FrameViewLayoutContext::layoutDelta const):
(WebCore::FrameViewLayoutContext::addLayoutDelta):
(WebCore::FrameViewLayoutContext::layoutDeltaMatches):
(WebCore::FrameViewLayoutContext::layoutState const):
(WebCore::FrameViewLayoutContext::pushLayoutState):
(WebCore::FrameViewLayoutContext::pushLayoutStateForPaginationIfNeeded):
(WebCore::FrameViewLayoutContext::popLayoutState):
(WebCore::FrameViewLayoutContext::checkLayoutState):
(WebCore::FrameViewLayoutContext::frame const):
(WebCore::FrameViewLayoutContext::view const):
(WebCore::FrameViewLayoutContext::renderView const):
(WebCore::FrameViewLayoutContext::document const):
(WebCore::LayoutContext::LayoutContext): Deleted.
(WebCore::LayoutContext::~LayoutContext): Deleted.
(WebCore::LayoutContext::layout): Deleted.
(WebCore::LayoutContext::runOrScheduleAsynchronousTasks): Deleted.
(WebCore::LayoutContext::runAsynchronousTasks): Deleted.
(WebCore::LayoutContext::flushAsynchronousTasks): Deleted.
(WebCore::LayoutContext::reset): Deleted.
(WebCore::LayoutContext::needsLayout const): Deleted.
(WebCore::LayoutContext::setNeedsLayout): Deleted.
(WebCore::LayoutContext::enableSetNeedsLayout): Deleted.
(WebCore::LayoutContext::disableSetNeedsLayout): Deleted.
(WebCore::LayoutContext::scheduleLayout): Deleted.
(WebCore::LayoutContext::unscheduleLayout): Deleted.
(WebCore::LayoutContext::scheduleSubtreeLayout): Deleted.
(WebCore::LayoutContext::layoutTimerFired): Deleted.
(WebCore::LayoutContext::convertSubtreeLayoutToFullLayout): Deleted.
(WebCore::LayoutContext::setSubtreeLayoutRoot): Deleted.
(WebCore::LayoutContext::canPerformLayout const): Deleted.
(WebCore::LayoutContext::applyTextSizingIfNeeded): Deleted.
(WebCore::LayoutContext::updateStyleForLayout): Deleted.
(WebCore::LayoutContext::handleLayoutWithFrameFlatteningIfNeeded): Deleted.
(WebCore::LayoutContext::startLayoutAtMainFrameViewIfNeeded): Deleted.
(WebCore::LayoutContext::layoutDelta const): Deleted.
(WebCore::LayoutContext::addLayoutDelta): Deleted.
(WebCore::LayoutContext::layoutDeltaMatches): Deleted.
(WebCore::LayoutContext::layoutState const): Deleted.
(WebCore::LayoutContext::pushLayoutState): Deleted.
(WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded): Deleted.
(WebCore::LayoutContext::popLayoutState): Deleted.
(WebCore::LayoutContext::checkLayoutState): Deleted.
(WebCore::LayoutContext::frame const): Deleted.
(WebCore::LayoutContext::view const): Deleted.
(WebCore::LayoutContext::renderView const): Deleted.
(WebCore::LayoutContext::document const): Deleted.
* page/FrameViewLayoutContext.h: Copied from Source/WebCore/page/LayoutContext.h.
(WebCore::LayoutContext::startDisallowingLayout): Deleted.
(WebCore::LayoutContext::endDisallowingLayout): Deleted.
(WebCore::LayoutContext::layoutPhase const): Deleted.
(WebCore::LayoutContext::isLayoutNested const): Deleted.
(WebCore::LayoutContext::isLayoutPending const): Deleted.
(WebCore::LayoutContext::isInLayout const): Deleted.
(WebCore::LayoutContext::isInRenderTreeLayout const): Deleted.
(WebCore::LayoutContext::inPaintableState const): Deleted.
(WebCore::LayoutContext::layoutCount const): Deleted.
(WebCore::LayoutContext::subtreeLayoutRoot const): Deleted.
(WebCore::LayoutContext::clearSubtreeLayoutRoot): Deleted.
(WebCore::LayoutContext::resetFirstLayoutFlag): Deleted.
(WebCore::LayoutContext::didFirstLayout const): Deleted.
(WebCore::LayoutContext::setNeedsFullRepaint): Deleted.
(WebCore::LayoutContext::needsFullRepaint const): Deleted.
(WebCore::LayoutContext::isPaintOffsetCacheEnabled const): Deleted.
(WebCore::LayoutContext::layoutDisallowed const): Deleted.
(WebCore::LayoutContext::isLayoutSchedulingEnabled const): Deleted.
(WebCore::LayoutContext::inAsynchronousTasks const): Deleted.
(WebCore::LayoutContext::disablePaintOffsetCache): Deleted.
(WebCore::LayoutContext::enablePaintOffsetCache): Deleted.
* page/LayoutContext.cpp: Removed.
* page/LayoutContext.h: Removed.
* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
(WebCore::LayoutState::computePaginationInformation):
(WebCore::LayoutState::establishLineGrid):
(WebCore::LayoutStateDisabler::LayoutStateDisabler):
* rendering/LayoutState.h:

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

15 months agoNeed to acquire the VM lock before calling toNumber on a JSValue.
mark.lam@apple.com [Tue, 24 Apr 2018 19:19:47 +0000 (19:19 +0000)]
Need to acquire the VM lock before calling toNumber on a JSValue.
https://bugs.webkit.org/show_bug.cgi?id=184924
<rdar://problem/39690679>

Reviewed by Saam Barati.

* bridge/objc/objc_utility.mm:
(JSC::Bindings::convertValueToObjcValue):

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

15 months agoDFG CSE should know how to decay a MultiGetByOffset
fpizlo@apple.com [Tue, 24 Apr 2018 18:54:47 +0000 (18:54 +0000)]
DFG CSE should know how to decay a MultiGetByOffset
https://bugs.webkit.org/show_bug.cgi?id=159859

Reviewed by Keith Miller.

This teaches Node::remove() how to decay a MultiGetByOffset to a CheckStructure, so that
clobberize() can report a def() for MultiGetByOffset.

This is a slight improvement to codegen in splay because splay is a heavy user of
MultiGetByOffset. It uses it redundantly in one of its hot functions (the function called
"splay_"). I don't see a net speed-up in the benchmark. However, this is just a first step to
removing MultiXByOffset-related redundancies, which by my estimates account for 16% of
splay's time.

* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGNode.cpp:
(JSC::DFG::Node::remove):
(JSC::DFG::Node::removeWithoutChecks):
(JSC::DFG::Node::replaceWith):
(JSC::DFG::Node::replaceWithWithoutChecks):
* dfg/DFGNode.h:
(JSC::DFG::Node::convertToMultiGetByOffset):
(JSC::DFG::Node::replaceWith): Deleted.
* dfg/DFGNodeType.h:
* dfg/DFGObjectAllocationSinkingPhase.cpp:

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

15 months agoREGRESSION(r221839): Fix requests with FormData containing empty files
commit-queue@webkit.org [Tue, 24 Apr 2018 18:15:48 +0000 (18:15 +0000)]
REGRESSION(r221839): Fix requests with FormData containing empty files
https://bugs.webkit.org/show_bug.cgi?id=184490
<rdar://problem/39385169>

Patch by Tadeu Zagallo <tzagallo@apple.com> on 2018-04-24
Reviewed by Geoffrey Garen.

Source/WebCore:

We should not append the blob to the FormData when it is a file but has no path. It broke
the submission since the request was failing to read the file in FormDataStreamCFNet.h:156

Test: http/tests/local/formdata/send-form-data-with-empty-file.html

* platform/network/FormData.cpp:
(WebCore::FormData::appendMultiPartFileValue):

LayoutTests:

Verify that the final boundary is present in the request body when submitting FormData containing an empty file.

* http/tests/local/formdata/send-form-data-with-empty-file-expected.txt: Added.
* http/tests/local/formdata/send-form-data-with-empty-file.html: Added.

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

15 months agoFix project file after r230931.
zalan@apple.com [Tue, 24 Apr 2018 17:50:50 +0000 (17:50 +0000)]
Fix project file after r230931.

* WebCore.xcodeproj/project.pbxproj:

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

15 months agoUpdate API docs with information on which run loop the VM will use
keith_miller@apple.com [Tue, 24 Apr 2018 17:32:44 +0000 (17:32 +0000)]
Update API docs with information on which run loop the VM will use
https://bugs.webkit.org/show_bug.cgi?id=184900
<rdar://problem/39166054>

Reviewed by Mark Lam.

* API/JSContextRef.h:
* API/JSVirtualMachine.h:

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

15 months agoTool scripts should not use PrivilegedAPI from 'public/v3/privileged-api.js'.
dewei_zhu@apple.com [Tue, 24 Apr 2018 17:17:42 +0000 (17:17 +0000)]
Tool scripts should not use PrivilegedAPI from 'public/v3/privileged-api.js'.
https://bugs.webkit.org/show_bug.cgi?id=184766

Reviewed by Ryosuke Niwa.

For tools, we should not use PrivilegedAPI for tools as current PrivilegedAPI
is used by UI and it is unnecessary to generate CSRF token for tools.
Will post a followup patch that creates a PrivilegedAPI used by tools.
Make a change on TestServer.inject and MockRemoteAPI.inject to allow specifying
BrowserPrivilegedAPI or NodePrivilegedAPI in the test. Currently defaults to
BrowserPrivilegedAPI as this is the test behavior before this change.

* server-tests/resources/common-operations.js: Allow passing type of privileged api
information to TestServer.inject.
* server-tests/resources/test-server.js: Conditionally inject PrivilegedAPI based on
type of privileged api.
(TestServer.prototype.inject):
(TestServer):
* server-tests/tools-buildbot-triggerable-tests.js: Updated 'prepareServerTest' invocation.
* server-tests/tools-os-build-fetcher-tests.js: Updated 'prepareServerTest' invocation.
* server-tests/tools-sync-buildbot-integration-tests.js: Temporarily injecting
BrowserPrivilegedAPI for mocking UploadedFile. The actual script does not rely on
BrowserPrivilegedAPI at all.
(async.createTestGroupWihPatch):
(beforeEach):
* tools/js/privileged-api.js: Added NodePrivilegedAPI
(NodePrivilegedAPI.prototype.sendRequest):
(NodePrivilegedAPI.configure): Configure the slave name and password.
(NodePrivilegedAPI):
* tools/js/v3-models.js: Removed the import of PrivilegedAPI.
* unit-tests/privileged-api-tests.js:. Added unit tests for NodePrivilegedAPI.
* unit-tests/resources/mock-remote-api.js: Conditionally inject PrivilegedAPI based on
the type of privileged api.
(MockRemoteAPI.inject):

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

15 months agoDon't add system framework paths to FRAMEWORK_SEARCH_PATHS
jer.noble@apple.com [Tue, 24 Apr 2018 16:17:09 +0000 (16:17 +0000)]
Don't add system framework paths to FRAMEWORK_SEARCH_PATHS
https://bugs.webkit.org/show_bug.cgi?id=184786

Reviewed by Tim Horton.

Source/WebCore:

* Configurations/WebCore.xcconfig:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:

Source/WebCore/PAL:

* Configurations/PAL.xcconfig:

Source/WebKit:

* Configurations/BaseTarget.xcconfig:
* DerivedSources.make:

Source/WebKitLegacy/mac:

* Configurations/WebKitLegacy.xcconfig:
* MigrateHeaders.make:

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

15 months agoUnreviewed, rolling out r230938.
ryanhaddad@apple.com [Tue, 24 Apr 2018 15:58:49 +0000 (15:58 +0000)]
Unreviewed, rolling out r230938.

Introduced two ProcessSwap API test failures.

Reverted changeset:

"Keep around a pre-warmed process when doing process swap on
navigation"
https://bugs.webkit.org/show_bug.cgi?id=184765
https://trac.webkit.org/changeset/230938

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

15 months ago$vm.totalGCTime() should be a thing
fpizlo@apple.com [Tue, 24 Apr 2018 15:53:15 +0000 (15:53 +0000)]
$vm.totalGCTime() should be a thing
https://bugs.webkit.org/show_bug.cgi?id=184916

Reviewed by Sam Weinig.

When debugging regressions in tests that are GC heavy, it's nice to be able to query the total
time spent in GC to determine if the regression is because the GC got slower.

This adds $vm.totalGCTime(), which tells you the total time spent in GC, in seconds.

* heap/Heap.cpp:
(JSC::Heap::runEndPhase):
* heap/Heap.h:
(JSC::Heap::totalGCTime const):
* tools/JSDollarVM.cpp:
(JSC::functionTotalGCTime):
(JSC::JSDollarVM::finishCreation):

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

15 months ago[CoordGraphics] Remove dead fixed layer code
zandobersek@gmail.com [Tue, 24 Apr 2018 15:27:46 +0000 (15:27 +0000)]
[CoordGraphics] Remove dead fixed layer code
https://bugs.webkit.org/show_bug.cgi?id=184912

Reviewed by Michael Catanzaro.

Source/WebCore:

Remove CoordinatedGraphicsLayer::setFixedToViewport() and the
corresponding attribute on the CoordinatedGraphicsLayerState struct.
The method is not called anywhere since r230952.

CoordinatedGraphicsState struct also loses the scrollPosition attribute
that also isn't used anymore.

Changes to GraphicsLayerTextureMapper class mirror those made to
CoordinatedGraphicsLayer, removing support for the fixed-to-viewport
attribute. This too was not called from anywhere.

All that enables us removing fixed-to-viewport handling in the
TextureMapperLayer class. Along with related changes in the
CoordinatedGraphicsScene class, we're able to remove a bunch of methods
and member variables that are not used or needed anymore.

* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
(WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
(WebCore::GraphicsLayerTextureMapper::setFixedToViewport): Deleted.
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::computeTransformsRecursive):
(WebCore::TextureMapperLayer::setFixedToViewport): Deleted.
(WebCore::TextureMapperLayer::isAncestorFixedToViewport const): Deleted.
(WebCore::TextureMapperLayer::setScrollPositionDeltaIfNeeded): Deleted.
* platform/graphics/texmap/TextureMapperLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::syncLayerState):
(WebCore::CoordinatedGraphicsLayer::setFixedToViewport): Deleted.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
(WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):

Source/WebKit:

Drop the unused fixed layer handling  code in CoordinatedGraphicsScene.
The m_fixedLayers container can be removed, along with the
adjustPositionForFixedLayers() method that operated on that container.

This was the only method that operated with the m_scrollPosition member
variable and the contentsPosition argument that's passed to the
CoordinatedGraphicsScene::paintToCurrentGLContext() method. Both of
these are removed, along with the scrollPosition attribute on the
CoordinatedGraphicsState struct.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
(WebKit::CoordinatedGraphicsScene::setLayerState):
(WebKit::CoordinatedGraphicsScene::deleteLayer):
(WebKit::CoordinatedGraphicsScene::commitSceneState):
(WebKit::CoordinatedGraphicsScene::purgeGLResources):
(WebKit::CoordinatedGraphicsScene::adjustPositionForFixedLayers): Deleted.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::renderLayerTree):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::flushPendingLayerChanges):

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

15 months agoREGRESSION(r230950): Faulty commit sequencing in CoordinatedGraphicsScene
zandobersek@gmail.com [Tue, 24 Apr 2018 15:26:42 +0000 (15:26 +0000)]
REGRESSION(r230950): Faulty commit sequencing in CoordinatedGraphicsScene
https://bugs.webkit.org/show_bug.cgi?id=184917

Reviewed by Michael Catanzaro.

After r230950, current animation state for a given layer is also taken
into account when determining whether or not the layer requires a
backing store. For that to work properly, all the animation state has
to be updated before the backing store work. This patch changes the
order of helper method invocations in
CoordinatedGraphicsScene::setLayerState() to address that.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::setLayerState):

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

15 months agoUnreviewed. Update W3C WebDriver imported tests.
carlosgc@webkit.org [Tue, 24 Apr 2018 11:01:49 +0000 (11:01 +0000)]
Unreviewed. Update W3C WebDriver imported tests.

Tools:

* Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py:
(WebDriverW3CExecutor.__init__):

WebDriverTests:

* imported/w3c/importer.json:
* imported/w3c/tools/webdriver/webdriver/client.py:
* imported/w3c/tools/webdriver/webdriver/transport.py:
* imported/w3c/tools/wptrunner/README.rst:
* imported/w3c/tools/wptrunner/requirements_chrome.txt:
* imported/w3c/tools/wptrunner/requirements_edge.txt:
* imported/w3c/tools/wptrunner/requirements_firefox.txt:
* imported/w3c/tools/wptrunner/requirements_ie.txt:
* imported/w3c/tools/wptrunner/requirements_opera.txt:
* imported/w3c/tools/wptrunner/requirements_safari.txt: Added.
* imported/w3c/tools/wptrunner/requirements_sauce.txt:
* imported/w3c/tools/wptrunner/requirements_webkit.txt: Added.
* imported/w3c/tools/wptrunner/tox.ini:
* imported/w3c/tools/wptrunner/wptrunner/browsers/__init__.py:
* imported/w3c/tools/wptrunner/wptrunner/browsers/chrome.py:
* imported/w3c/tools/wptrunner/wptrunner/browsers/chrome_android.py:
* imported/w3c/tools/wptrunner/wptrunner/browsers/edge.py:
* imported/w3c/tools/wptrunner/wptrunner/browsers/firefox.py:
* imported/w3c/tools/wptrunner/wptrunner/browsers/ie.py:
* imported/w3c/tools/wptrunner/wptrunner/browsers/opera.py:
* imported/w3c/tools/wptrunner/wptrunner/browsers/safari.py: Added.
* imported/w3c/tools/wptrunner/wptrunner/browsers/sauce.py:
* imported/w3c/tools/wptrunner/wptrunner/browsers/sauce_setup/edge-prerun.bat:
* imported/w3c/tools/wptrunner/wptrunner/browsers/sauce_setup/safari-prerun.sh:
* imported/w3c/tools/wptrunner/wptrunner/browsers/servo.py:
* imported/w3c/tools/wptrunner/wptrunner/browsers/servodriver.py:
* imported/w3c/tools/wptrunner/wptrunner/browsers/webkit.py: Added.
* imported/w3c/tools/wptrunner/wptrunner/environment.py:
* imported/w3c/tools/wptrunner/wptrunner/executors/base.py:
* imported/w3c/tools/wptrunner/wptrunner/executors/executormarionette.py:
* imported/w3c/tools/wptrunner/wptrunner/executors/executorselenium.py:
* imported/w3c/tools/wptrunner/wptrunner/executors/executorservo.py:
* imported/w3c/tools/wptrunner/wptrunner/executors/executorservodriver.py:
* imported/w3c/tools/wptrunner/wptrunner/executors/executorwebkit.py: Added.
* imported/w3c/tools/wptrunner/wptrunner/executors/protocol.py: Added.
* imported/w3c/tools/wptrunner/wptrunner/executors/pytestrunner/runner.py:
* imported/w3c/tools/wptrunner/wptrunner/executors/testharness_marionette.js:
* imported/w3c/tools/wptrunner/wptrunner/executors/testharness_marionette_resume.js: Added.
* imported/w3c/tools/wptrunner/wptrunner/executors/testharness_webdriver_resume.js:
* imported/w3c/tools/wptrunner/wptrunner/testdriver-extra.js:
* imported/w3c/tools/wptrunner/wptrunner/testloader.py:
* imported/w3c/tools/wptrunner/wptrunner/testrunner.py:
* imported/w3c/tools/wptrunner/wptrunner/tests/base.py: Added.
* imported/w3c/tools/wptrunner/wptrunner/tests/test_products.py: Added.
* imported/w3c/tools/wptrunner/wptrunner/update/metadata.py:
* imported/w3c/tools/wptrunner/wptrunner/update/update.py:
* imported/w3c/tools/wptrunner/wptrunner/webdriver_server.py:
* imported/w3c/tools/wptrunner/wptrunner/wptcommandline.py:
* imported/w3c/tools/wptrunner/wptrunner/wptrunner.py:
* imported/w3c/tools/wptrunner/wptrunner/wpttest.py:
* imported/w3c/webdriver/tests/actions/modifier_click.py:
* imported/w3c/webdriver/tests/actions/mouse_dblclick.py:
* imported/w3c/webdriver/tests/actions/mouse_pause_dblclick.py: Added.
* imported/w3c/webdriver/tests/actions/special_keys.py:
* imported/w3c/webdriver/tests/contexts/maximize_window.py:
* imported/w3c/webdriver/tests/cookies/add_cookie.py:
* imported/w3c/webdriver/tests/element_retrieval/find_element.py:
* imported/w3c/webdriver/tests/element_retrieval/find_element_from_element.py:
* imported/w3c/webdriver/tests/element_retrieval/find_elements.py:
* imported/w3c/webdriver/tests/element_retrieval/find_elements_from_element.py:
* imported/w3c/webdriver/tests/element_send_keys/form_controls.py:
* imported/w3c/webdriver/tests/execute_async_script/collections.py: Added.
* imported/w3c/webdriver/tests/execute_async_script/user_prompts.py:
* imported/w3c/webdriver/tests/execute_script/collections.py: Added.
* imported/w3c/webdriver/tests/execute_script/user_prompts.py:
* imported/w3c/webdriver/tests/fullscreen_window.py:
* imported/w3c/webdriver/tests/interaction/element_clear.py:
* imported/w3c/webdriver/tests/minimize_window.py:
* imported/w3c/webdriver/tests/set_window_rect.py:
* imported/w3c/webdriver/tests/support/fixtures.py:

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

15 months ago[CoordGraphics] Remove unused fixed layout functionality
zandobersek@gmail.com [Tue, 24 Apr 2018 09:24:55 +0000 (09:24 +0000)]
[CoordGraphics] Remove unused fixed layout functionality
https://bugs.webkit.org/show_bug.cgi?id=184908

Reviewed by Carlos Garcia Campos.

Ports using the CoordinatedGraphics subsystem don't expose fixed layout
support. As such, we're able to remove a lot of unused code and
unnecessary USE(COORDINATED_GRAPHICS) special cases in generic sections
in both WebCore and WebKit.

Source/WebCore:

With fixed layout not available for use to users of the GTK+ and WPE
ports, we can remove the ScrollingCoordinatorCoordinatedGraphics
implementation, making room for an implementation that inherits from
AsyncScrollingCoordinator in the future. For that purpose the
ScrollingCoordinator::create() function is moved into the
ScrollingCoordinatorCoordinatedGraphics.cpp file already.

This also enables removing delegatedScrollRequested() method from
HostWindow and the inheriting ChromeClient interface.

* loader/EmptyClients.h:
* page/Chrome.cpp:
(WebCore::Chrome::delegatedScrollRequested): Deleted.
* page/Chrome.h:
* page/ChromeClient.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::create):
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
(WebCore::ScrollingCoordinator::create):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics): Deleted.
(WebCore::ScrollingCoordinatorCoordinatedGraphics::attachToStateTree): Deleted.
(WebCore::ScrollingCoordinatorCoordinatedGraphics::detachFromStateTree): Deleted.
(WebCore::ScrollingCoordinatorCoordinatedGraphics::clearStateTree): Deleted.
(WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeLayer): Deleted.
(WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeViewportConstraints): Deleted.
(WebCore::ScrollingCoordinatorCoordinatedGraphics::requestScrollPositionUpdate): Deleted.
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h: Removed.
* platform/HostWindow.h:

Source/WebKit:

Remove USE(COORDINATED_GRAPHICS) special-casing from the
WebPage::setUseFixedLayout() method. This is not possible to enable for
the GTK+ and WPE ports that use the CoordinatedGraphics subsytem via
API. Removing all this unlocks removing considerable amounts of dead
code and complexities in CoordinatedGraphics.

WebChromeClient::delegatedScrollRequested() method is removed, along
with the WebPage::pageDidRequestScroll() method that was only called
from there.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::delegatedScrollRequested): Deleted.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setUseFixedLayout):
(WebKit::WebPage::pageDidRequestScroll): Deleted.
* WebProcess/WebPage/WebPage.h:

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

15 months agoAttempt to fix the Apple Internal build following r230922
dbates@webkit.org [Tue, 24 Apr 2018 08:31:19 +0000 (08:31 +0000)]
Attempt to fix the Apple Internal build following r230922
(https://bugs.webkit.org/show_bug.cgi?id=184737)

Cast the return value of std::map::size() to a size_t before logging it with format specifier
"%zu". std::map::size() returns a size_type. According to <http://en.cppreference.com/w/cpp/container/map>
size_type is "usually a size_t", but it may not be. An Apple Internal debug builder reports
that size_type = unsigned int != unsigned long = size_t.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::provideMediaData):

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

15 months ago[CoordGraphics] Avoid painting backing stores for zero-opacity layers
zandobersek@gmail.com [Tue, 24 Apr 2018 08:15:41 +0000 (08:15 +0000)]
[CoordGraphics] Avoid painting backing stores for zero-opacity layers
https://bugs.webkit.org/show_bug.cgi?id=184143

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Skip generating backing stores for layers that have zero opacity and do
not animate the opacity value. In the current CoordinatedGraphics system
this can end up saving loads of memory on Web content that deploys a
large number of such elements.

* platform/graphics/texmap/TextureMapperLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::shouldHaveBackingStore const):

Source/WebKit:

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::layerShouldHaveBackingStore):
Mirror CoordinatedGraphicsLayer's backing store requirements.

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

15 months ago[WPE] Remove libgbm dependency
zandobersek@gmail.com [Tue, 24 Apr 2018 08:06:56 +0000 (08:06 +0000)]
[WPE] Remove libgbm dependency
https://bugs.webkit.org/show_bug.cgi?id=184906

Reviewed by Carlos Garcia Campos.

.:

Remove the libgbm CMake search module. It's not necessary anymore
after r230562.

* Source/cmake/FindLibGBM.cmake: Removed.

Tools:

Stop searching for libgbm, using its compiler flags for the
HeadlessViewBackend compilation and linking against the .so object.
This is not necessary anymore after r230562 switched to a different
backend implementation for testing.

* wpe/HeadlessViewBackend/CMakeLists.txt:
* wpe/install-dependencies:

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

15 months agoAttempt to fix the Apple Internal build following r230944
dbates@webkit.org [Tue, 24 Apr 2018 08:02:10 +0000 (08:02 +0000)]
Attempt to fix the Apple Internal build following r230944
(https://bugs.webkit.org/show_bug.cgi?id=159464)

* platform/network/mac/CookieJarMac.mm:

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

15 months agoAnother attempt to fix the Mac and iOS build following r230944
dbates@webkit.org [Tue, 24 Apr 2018 07:51:30 +0000 (07:51 +0000)]
Another attempt to fix the Mac and iOS build following r230944
(https://bugs.webkit.org/show_bug.cgi?id=159464)

* platform/network/mac/CookieJarMac.mm:
(WebCore::policyProperties):

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

15 months agoAttempt to fix the Mac and iOS build following r230944
dbates@webkit.org [Tue, 24 Apr 2018 07:47:14 +0000 (07:47 +0000)]
Attempt to fix the Mac and iOS build following r230944
(https://bugs.webkit.org/show_bug.cgi?id=159464)

* platform/network/mac/CookieJarMac.mm:
(WebCore::policyProperties):

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

15 months agoFix up order of ChangeLog entries following r230944.
dbates@webkit.org [Tue, 24 Apr 2018 07:44:06 +0000 (07:44 +0000)]
Fix up order of ChangeLog entries following r230944.

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

15 months agoSource/WebCore:
dbates@webkit.org [Tue, 24 Apr 2018 07:36:59 +0000 (07:36 +0000)]
Source/WebCore:
Make WebLoaderStrategy send to NetworkResourceLoader necessary parameters to handle full loads in NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=184763

Patch by Youenn Fablet <youenn@apple.com> on 2018-04-23
Reviewed by Chris Dumez.

No change of behavior yet since we do not use these parameters in NetworkProcess yet.

Add PreflightPolicy and CSP response headers as ResourceLoaderOptions.
This allows passing them from DocumentThreadableLoader to WebLoaderStrategy.

Allow getting the original headers from a SubresourceLoader.
This allows passing them from DocumentThreadableLoader down to WebLoaderStrategy.

* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::startLoadingBlobURL):
(WebCore::FetchLoader::start):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
(WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
* loader/ResourceLoaderOptions.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::originalHeaders const):
* loader/SubresourceLoader.h:
* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions):
(WebCore::ThreadableLoaderOptions::isolatedCopy const):
* loader/ThreadableLoader.h:
* page/EventSource.cpp:
(WebCore::EventSource::connect):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):

Source/WebCore/PAL:
Implement Same-Site cookies
https://bugs.webkit.org/show_bug.cgi?id=159464
<rdar://problem/27196358>

Reviewed by Brent Fulgham.

Forward declare some SPI.

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:
Make WebLoaderStrategy send to NetworkResourceLoader necessary parameters to handle full loads in NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=184763

Patch by Youenn Fablet <youenn@apple.com> on 2018-04-23
Reviewed by Chris Dumez.

Set all required NetworkResourceLoadParameters for asynchronous loads.
This includes preflight policy, CSP response headers, SecurityOrigin and content blockers identifier.

Update NetworkLoadChecker to handle preflight policy.
This is not needed right now since sync XHR and ping loads are using the default ConsiderPreflight policy.
But this will be needed for XHR/fetch/EventSource loads.

* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::NetworkLoadChecker):
(WebKit::NetworkLoadChecker::checkRedirection):
(WebKit::NetworkLoadChecker::validateResponse):
(WebKit::NetworkLoadChecker::checkCORSRequest):
* NetworkProcess/NetworkLoadChecker.h:
(WebKit::NetworkLoadChecker::create):
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/NetworkResourceLoadParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::PingLoad):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):

Source/WebKitLegacy/mac:
Implement Same-Site cookies
https://bugs.webkit.org/show_bug.cgi?id=159464
<rdar://problem/27196358>

Reviewed by Brent Fulgham.

Pass the Same-Site info through the strategy.

* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::cookiesForDOM):
(WebPlatformStrategies::setCookiesFromDOM):
(WebPlatformStrategies::cookieRequestHeaderFieldValue):
(WebPlatformStrategies::getRawCookies):

Source/WebKitLegacy/win:
Implement Same-Site cookies
https://bugs.webkit.org/show_bug.cgi?id=159464
<rdar://problem/27196358>

Reviewed by Brent Fulgham.

Pass the Same-Site info through the strategy.

* WebCoreSupport/WebPlatformStrategies.cpp:
(WebPlatformStrategies::cookiesForDOM):
(WebPlatformStrategies::setCookiesFromDOM):
(WebPlatformStrategies::cookieRequestHeaderFieldValue):
(WebPlatformStrategies::getRawCookies):
* WebCoreSupport/WebPlatformStrategies.h:

LayoutTests:
Implement Same-Site cookies
https://bugs.webkit.org/show_bug.cgi?id=159464
<rdar://problem/27196358>

Reviewed by Brent Fulgham.

Add tests. These tests are skipped on all ports for now, including Mac and iOS. We will
look to subsequently enable the tests for Mac and iOS once we have CFNetwork support for
Same-Site cookies.

The following tests and utilities were taken in whole or in part from Blink:
    http/tests/cookies/resources/echo-json.php
    http/tests/cookies/resources/post-cookies-onmessage.php
    http/tests/cookies/resources/post-cookies-to-opener.php
    http/tests/cookies/resources/testharness-helpers.js
    http/tests/cookies/same-site/popup-cross-site-post.html
    http/tests/cookies/same-site/popup-cross-site.html
    http/tests/cookies/same-site/popup-same-site-post.html
    http/tests/cookies/same-site/popup-same-site.html

The following files were derived from tests taken from Blink:
    http/tests/cookies/same-site/popup-same-site-via-cross-site-redirect.html
    http/tests/cookies/same-site/popup-same-site-via-same-site-redirect.html

* TestExpectations: Skip on all ports for now.
* http/tests/cookies/resources/cookie-utilities.js: Added.
(createCookie):
(setBaseDocumentWhenFetchingDOMCookies):
(setDOMCookie):
* http/tests/cookies/resources/cookie-utility.php:
* http/tests/cookies/resources/echo-json.php: Added.
* http/tests/cookies/resources/post-cookies-onmessage.php: Added.
* http/tests/cookies/resources/post-cookies-to-opener.php: Added.
* http/tests/cookies/resources/testharness-helpers.js: Added.
(clearKnownCookies):
* http/tests/cookies/same-site/fetch-after-navigating-iframe-in-cross-origin-page-expected.txt: Added.
* http/tests/cookies/same-site/fetch-after-navigating-iframe-in-cross-origin-page.html: Added.
* http/tests/cookies/same-site/fetch-after-top-level-navigation-from-cross-origin-page-expected.txt: Added.
* http/tests/cookies/same-site/fetch-after-top-level-navigation-from-cross-origin-page.html: Added.
* http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page-expected.txt: Added.
* http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html: Added.
* http/tests/cookies/same-site/fetch-cookies-set-in-about-blank-iframe-expected.txt: Added.
* http/tests/cookies/same-site/fetch-cookies-set-in-about-blank-iframe.html: Added.
* http/tests/cookies/same-site/fetch-in-about-blank-page-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-about-blank-page.html: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-iframe-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-iframe.html: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-page-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-page.html: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-service-worker-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-service-worker.html: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-worker-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-worker.html: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-page-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-page.html: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-service-worker-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-service-worker.html: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-srcdoc-iframe-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-srcdoc-iframe.html: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-worker-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-worker.html: Added.
* http/tests/cookies/same-site/popup-cross-site-expected.txt: Added.
* http/tests/cookies/same-site/popup-cross-site-post-expected.txt: Added.
* http/tests/cookies/same-site/popup-cross-site-post.html: Added.
* http/tests/cookies/same-site/popup-cross-site.html: Added.
* http/tests/cookies/same-site/popup-same-site-expected.txt: Added.
* http/tests/cookies/same-site/popup-same-site-post-expected.txt: Added.
* http/tests/cookies/same-site/popup-same-site-post.html: Added.
* http/tests/cookies/same-site/popup-same-site-via-cross-site-redirect-expected.txt: Added.
* http/tests/cookies/same-site/popup-same-site-via-cross-site-redirect.html: Added.
* http/tests/cookies/same-site/popup-same-site-via-same-site-redirect-expected.txt: Added.
* http/tests/cookies/same-site/popup-same-site-via-same-site-redirect.html: Added.
* http/tests/cookies/same-site/popup-same-site.html: Added.
* http/tests/cookies/same-site/resources/click-hyperlink.php: Added.
* http/tests/cookies/same-site/resources/echo-iframe-src.php: Added.
* http/tests/cookies/same-site/resources/fetch-after-navigating-iframe-in-cross-origin-page.php: Added.
* http/tests/cookies/same-site/resources/fetch-after-top-level-navigation-from-cross-origin-page.php: Added.
* http/tests/cookies/same-site/resources/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.php: Added.
* http/tests/cookies/same-site/resources/fetch-in-cross-origin-iframe.html: Added.
* http/tests/cookies/same-site/resources/fetch-in-cross-origin-service-worker.html: Added.
* http/tests/cookies/same-site/resources/fetch-in-cross-origin-worker.js: Added.
(async.checkResult):
* http/tests/cookies/same-site/resources/fetch-in-same-origin-service-worker.php: Added.
* http/tests/cookies/same-site/resources/fetch-in-same-origin-worker.js: Added.
(async.checkResult):
* http/tests/cookies/same-site/resources/passthrough-service-worker.js: Added.
* platform/mac-wk1/TestExpectations: Skip the Service Worker tests as they are not supported in LegacyWebKit.

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

15 months ago[GLIB] Make it possible to use a different timeout for slow test cases in GLib tests
carlosgc@webkit.org [Tue, 24 Apr 2018 06:33:31 +0000 (06:33 +0000)]
[GLIB] Make it possible to use a different timeout for slow test cases in GLib tests
https://bugs.webkit.org/show_bug.cgi?id=184816

Reviewed by Michael Catanzaro.

Pass a function from api test runner to glib test runner to check if a test is slow and use the given slow
timeout.

* TestWebKitAPI/glib/TestExpectations.json:
* glib/api_test_runner.py:
(TestRunner._run_test_glib.is_slow_test):
(TestRunner._run_test_glib):
* glib/glib_test_runner.py:
(GLibTestRunner.__init__):
(GLibTestRunner._stop_timeout):
(GLibTestRunner._subtest_start):
(GLibTestRunner._subtest_end):

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

15 months agoMake WebLoaderStrategy send to NetworkResourceLoader necessary parameters to handle...
youenn@apple.com [Tue, 24 Apr 2018 03:22:53 +0000 (03:22 +0000)]
Make WebLoaderStrategy send to NetworkResourceLoader necessary parameters to handle full loads in NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=184763

Reviewed by Chris Dumez.

Source/WebCore:

No change of behavior yet since we do not use these parameters in NetworkProcess yet.

Add PreflightPolicy and CSP response headers as ResourceLoaderOptions.
This allows passing them from DocumentThreadableLoader to WebLoaderStrategy.

Allow getting the original headers from a SubresourceLoader.
This allows passing them from DocumentThreadableLoader down to WebLoaderStrategy.

* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::startLoadingBlobURL):
(WebCore::FetchLoader::start):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
(WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
* loader/ResourceLoaderOptions.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::originalHeaders const):
* loader/SubresourceLoader.h:
* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions):
(WebCore::ThreadableLoaderOptions::isolatedCopy const):
* loader/ThreadableLoader.h:
* page/EventSource.cpp:
(WebCore::EventSource::connect):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):

Source/WebKit:

Set all required NetworkResourceLoadParameters for asynchronous loads.
This includes preflight policy, CSP response headers, SecurityOrigin and content blockers identifier.

Update NetworkLoadChecker to handle preflight policy.
This is not needed right now since sync XHR and ping loads are using the default ConsiderPreflight policy.
But this will be needed for XHR/fetch/EventSource loads.

* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::NetworkLoadChecker):
(WebKit::NetworkLoadChecker::checkRedirection):
(WebKit::NetworkLoadChecker::validateResponse):
(WebKit::NetworkLoadChecker::checkCORSRequest):
* NetworkProcess/NetworkLoadChecker.h:
(WebKit::NetworkLoadChecker::create):
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/NetworkResourceLoadParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::PingLoad):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):

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

15 months ago[Extra zoom mode] REGRESSION(230860) Unable to change time input values using UI
wenson_hsieh@apple.com [Tue, 24 Apr 2018 02:45:32 +0000 (02:45 +0000)]
[Extra zoom mode] REGRESSION(230860) Unable to change time input values using UI
https://bugs.webkit.org/show_bug.cgi?id=184901
<rdar://problem/39664797>

Reviewed by Tim Horton.

Source/WebKit:

Fixes the bug by falling back to setting the value of the focused input element in the case where the selection
is not editable. Also adds plumbing to make time pickers testable in extra zoom mode.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView setTimePickerValueToHour:minute:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setTimePickerValueToHour:minute:]):

Add plumbing to make it possible for WebKitTestRunner to simulate picking a time from the given hours and
minutes. This is currently only implemented for extra zoom mode, but may be implemented for UIKit's time picker
as well in the future by adjusting -[WKContentView setTimePickerValueToHour:minute:].

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setTextAsync):

Tools:

Introduce a new UIScriptController method to set the value of a currently focused input of type time, by
interacting with the UI. See WebKit ChangeLogs for more detail.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::setTimePickerValue):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::setTimePickerValue):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::setTimePickerValue):

LayoutTests:

Adds a basic test to verify that tapping on an input of type `time` and choosing a time actually changes the
value of the input. Also adds a new UIHelper function to set the value of the currently focused input of type
time to the given hours and minutes.

* fast/forms/extrazoom/time-picker-value-change-expected.txt: Added.
* fast/forms/extrazoom/time-picker-value-change.html: Added.
* resources/ui-helper.js:
(window.UIHelper.setTimePickerValue):
(window.UIHelper):

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

15 months agoRevision information returned by querying measurement set api with analysis task...
dewei_zhu@apple.com [Tue, 24 Apr 2018 02:34:11 +0000 (02:34 +0000)]
Revision information returned by querying measurement set api with analysis task id should contain commit order.
https://bugs.webkit.org/show_bug.cgi?id=184902

Reviewed by Ryosuke Niwa

This is a bug fix for r230719 which does not cover the case while querying `measurement-set.php?analysisTask=$task_id`

* public/api/measurement-set.php: AnalysisResultsFetcher.fetch_commits results should contains commit order.
* server-tests/api-measurement-set-tests.js: Added unit test for this change.

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

15 months agoUnreviewed, fix a few tests that became flaky after r230919.
cdumez@apple.com [Tue, 24 Apr 2018 02:30:20 +0000 (02:30 +0000)]
Unreviewed, fix a few tests that became flaky after r230919.

* fast/events/beforeunload-alert-handled-keydown.html:
* fast/events/beforeunload-alert-no-user-interaction.html:
* fast/events/beforeunload-alert-user-interaction.html:

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

15 months agoKeep around a pre-warmed process when doing process swap on navigation
sbarati@apple.com [Tue, 24 Apr 2018 02:03:27 +0000 (02:03 +0000)]
Keep around a pre-warmed process when doing process swap on navigation
https://bugs.webkit.org/show_bug.cgi?id=184765

Reviewed by Ryosuke Niwa.

This patch makes it so that WebProcessPool prewarms a process when process
swap on navigation is turned on. When we do a process swap on navigation,
we first try to grab a prewarmed process before creating a new one.

We try to be smart about when to create these processes. The initial heuristic
that this patch chooses is when we reach the DidFirstVisuallyNonEmptyLayout
layout milestone. We're going to try to improve on this heuristic in:
https://bugs.webkit.org/show_bug.cgi?id=184899

This is a 40% progression on PLT with process swap on navigation turned on.

* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::notifyProcessPoolToPrewarm):
(WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::tryTakePrewarmedProcess):
(WebKit::WebProcessPool::warmInitialProcess):
(WebKit::WebProcessPool::disconnectProcess):
(WebKit::WebProcessPool::createWebPage):
(WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
(WebKit::WebProcessPool::processForNavigation):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::create):
(WebKit::WebProcessProxy::WebProcessProxy):
(WebKit::m_isInPrewarmedPool):
(WebKit::m_userMediaCaptureManagerProxy): Deleted.
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::isInPrewarmedPool const):
(WebKit::WebProcessProxy::setIsInPrewarmedPool):

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

15 months ago[GTK] check target looks broken
mcatanzaro@igalia.com [Tue, 24 Apr 2018 01:07:57 +0000 (01:07 +0000)]
[GTK] check target looks broken
https://bugs.webkit.org/show_bug.cgi?id=184407

Reviewed by Carlos Garcia Campos.

It's pretty clear that nobody has been using check for a long time.

We got rid of check-for-webkitdom-api-breaks a long time ago, when we stopped autogenerating
the DOM API, but it's still used in the check target. Fix this.

Also, the check target for some reason runs itself from the Source subdirectory of the
builddir, but the test script expects to be run from the toplevel build directory. Fix this
too.

Add VERBATIM for good measure.

* Source/PlatformGTK.cmake:

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

15 months ago[WPE][GTK] Remove WlUniquePtr<wl_display> footgun
mcatanzaro@igalia.com [Tue, 24 Apr 2018 01:07:06 +0000 (01:07 +0000)]
[WPE][GTK] Remove WlUniquePtr<wl_display> footgun
https://bugs.webkit.org/show_bug.cgi?id=184405

Reviewed by Carlos Garcia Campos.

Source/WebCore:

WlUniquePtr<wl_display> is a pretty big footgun because there are two different destruction
functions -- wl_display_disconnect() and wl_display_destroy() -- and which one you need to
use depends on how the wl_display() was created, and WebKit uses both in different places.
So WlUniquePtr<wl_display> is pretty unsafe. See bug #176490 for an example of fun caused
by using it incorrectly.

Let's use std::unique_ptr with custom deleter functors instead.

* platform/graphics/wayland/WlUniquePtr.h:

Source/WebKit:

Switch to std::unique_ptr.

* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::WaylandCompositor::WaylandCompositor):
* UIProcess/gtk/WaylandCompositor.h:
(WebKit::WaylandCompositor::DisplayDeleter::operator()):

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

15 months agoUnreviewed, rolling out r230921, r230923, r230924, r230932,
ryanhaddad@apple.com [Tue, 24 Apr 2018 00:37:42 +0000 (00:37 +0000)]
Unreviewed, rolling out r230921, r230923, r230924, r230932,
and r230934.
https://bugs.webkit.org/show_bug.cgi?id=184903

Builds still broken (Requested by ryanhaddad on #webkit).

Reverted changesets:

"Implement Same-Site cookies"
https://bugs.webkit.org/show_bug.cgi?id=159464
https://trac.webkit.org/changeset/230921

"Attempt to fix the build after r230921"
https://bugs.webkit.org/show_bug.cgi?id=159464
https://trac.webkit.org/changeset/230923

"Attempt to fix the Mac and iOS build after r230921"
https://bugs.webkit.org/show_bug.cgi?id=159464
https://trac.webkit.org/changeset/230924

"Another attempt to fix the Windows build following r230921"
https://bugs.webkit.org/show_bug.cgi?id=159464
https://trac.webkit.org/changeset/230932

"Attempt to fix the Apple Internal build following r230921"
https://bugs.webkit.org/show_bug.cgi?id=159464
https://trac.webkit.org/changeset/230934

Patch by Commit Queue <commit-queue@webkit.org> on 2018-04-23

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

15 months agoAttempt to fix the Apple Internal build following r230921
dbates@webkit.org [Tue, 24 Apr 2018 00:26:31 +0000 (00:26 +0000)]
Attempt to fix the Apple Internal build following r230921
(https://bugs.webkit.org/show_bug.cgi?id=159464)

Forward declare some SPI. Add availability guard.

* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:

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

15 months agoREGRESSION (r220112): reCAPTCHA images render off screen on Twitch.tv app Log In...
antti@apple.com [Tue, 24 Apr 2018 00:13:16 +0000 (00:13 +0000)]
REGRESSION (r220112): reCAPTCHA images render off screen on Twitch.tv app Log In or Sign Up
https://bugs.webkit.org/show_bug.cgi?id=182859
<rdar://problem/37595065>

Source/WebCore:

Reviewed by Zalan Bujtas.

Roll out this change from the trunk as the issue it fixed no longer occurs.

* css/MediaQueryEvaluator.cpp:
(WebCore::orientationEvaluate):
(WebCore::aspectRatioEvaluate):
(WebCore::heightEvaluate):
(WebCore::widthEvaluate):
* page/FrameView.cpp:
(WebCore::FrameView::layoutSizeForMediaQuery const): Deleted.
* page/FrameView.h:
* page/LayoutContext.cpp:
(WebCore::LayoutContext::handleLayoutWithFrameFlatteningIfNeeded):

LayoutTests:

Reviewed by Zalan Bujtas

* fast/frames/flattening/media-query-growing-content-expected.txt: Removed.
* fast/frames/flattening/media-query-growing-content.html: Removed.
* fast/frames/flattening/resources/media-query-min-height-with-flattening.html: Removed.

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

15 months agoAnother attempt to fix the Windows build following r230921
dbates@webkit.org [Mon, 23 Apr 2018 23:56:27 +0000 (23:56 +0000)]
Another attempt to fix the Windows build following r230921
(https://bugs.webkit.org/show_bug.cgi?id=159464)

Pass dictionary key name using a string instead of a constant and pass CFURL* to
siteForCookies().

* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdateResourceRequest):

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

15 months ago[LayoutFormattingContext] Initial commit.
zalan@apple.com [Mon, 23 Apr 2018 23:08:47 +0000 (23:08 +0000)]
[LayoutFormattingContext] Initial commit.
https://bugs.webkit.org/show_bug.cgi?id=184896

Reviewed by Antti Koivisto.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

This is the initial commit of the new layout component -class definitions only (and mostly public functions).
See the header files (and Tools/LayoutReloaded project) for more information.

// Top level layout.
rootContainer = TreeBuilder::createLayoutTree(document);
rootDisplayBox = new Display::Box();
rootDisplayBox->setSize(viewportSize);
layoutContext = new LayoutContext(rootContainer, rootDisplayBox);
layoutContext->layout(rootContainer);

Driven by build time flag (currently off). Not testable yet.

* Configurations/FeatureDefines.xcconfig:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/BlockFormatting/BlockFormattingContext.cpp: Added.
* layout/BlockFormatting/BlockFormattingContext.h: Added.
* layout/BlockFormatting/BlockFormattingState.cpp: Added.
* layout/BlockFormatting/BlockFormattingState.h: Added.
* layout/BlockFormatting/BlockMarginCollapse.cpp: Added.
* layout/BlockFormatting/BlockMarginCollapse.h: Added.
* layout/DisplayTree/DisplayBox.cpp: Added.
* layout/DisplayTree/DisplayBox.h: Added.
* layout/FloatingContext.cpp: Added.
* layout/FloatingContext.h: Added.
* layout/FloatingState.cpp: Added.
* layout/FloatingState.h: Added.
* layout/FormattingContext.cpp: Added.
* layout/FormattingContext.h: Added.
* layout/FormattingState.cpp: Added.
* layout/FormattingState.h: Added.
* layout/InlineFormatting/InlineFormattingContext.cpp: Added.
* layout/InlineFormatting/InlineFormattingContext.h: Added.
* layout/InlineFormatting/InlineFormattingState.cpp: Added.
* layout/InlineFormatting/InlineFormattingState.h: Added.
* layout/LayoutCtx.cpp: Added.
* layout/LayoutCtx.h: Added.
* layout/LayoutTree/LayoutBlockContainer.cpp: Added.
* layout/LayoutTree/LayoutBlockContainer.h: Added.
* layout/LayoutTree/LayoutBox.cpp: Added.
* layout/LayoutTree/LayoutBox.h: Added.
* layout/LayoutTree/LayoutContainer.cpp: Added.
* layout/LayoutTree/LayoutContainer.h: Added.
* layout/LayoutTree/LayoutCtx.h: Added.
* layout/LayoutTree/LayoutInlineBox.cpp: Added.
* layout/LayoutTree/LayoutInlineBox.h: Added.
* layout/LayoutTree/LayoutInlineContainer.cpp: Added.
* layout/LayoutTree/LayoutInlineContainer.h: Added.

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

15 months agoDeactivate the WindowServer connection for the WebContent process.
pvollan@apple.com [Mon, 23 Apr 2018 22:41:35 +0000 (22:41 +0000)]
Deactivate the WindowServer connection for the WebContent process.
https://bugs.webkit.org/show_bug.cgi?id=184451
<rdar://problem/38313938>

Reviewed by Brent Fulgham.

Defining ENABLE_WEBPROCESS_WINDOWSERVER_BLOCKING as 1 will deactivate the WindowServer connection
for the WebContent process by enabling the call to 'CGSSetDenyWindowServerConnections(true)' on
process startup. After calling this function, every attempt to establish a connection to the
WindowServer from the WebContent process will fail, except for CA render server connections.

* wtf/FeatureDefines.h:

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

15 months agoUnreviewed, revert accidental change to verbose flag.
fpizlo@apple.com [Mon, 23 Apr 2018 22:26:50 +0000 (22:26 +0000)]
Unreviewed, revert accidental change to verbose flag.

* dfg/DFGByteCodeParser.cpp:

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

15 months agoRoll out r226655 because it broke OSR entry when the pre-header is inadequately profiled.
fpizlo@apple.com [Mon, 23 Apr 2018 22:25:29 +0000 (22:25 +0000)]
Roll out r226655 because it broke OSR entry when the pre-header is inadequately profiled.

Rubber stamped by Saam Barati.

This is a >2x speed-up in SunSpider/bitops-bitwise-and. We don't really care about SunSpider
anymore, but r226655 didn't result in any benchmark wins and just regressed this test by a lot.
Seems sensible to just roll it out.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::addToGraph):
(JSC::DFG::ByteCodeParser::parse):

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

15 months agoVersioning.
jmarcell@apple.com [Mon, 23 Apr 2018 21:59:46 +0000 (21:59 +0000)]
Versioning.

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

15 months ago[WKTR] Move navigation policy decision from the injected bundle to the UIProcess
cdumez@apple.com [Mon, 23 Apr 2018 21:43:12 +0000 (21:43 +0000)]
[WKTR] Move navigation policy decision from the injected bundle to the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=184801

Reviewed by Geoffrey Garen.

Move navigation policy decision from the injected bundle to the UIProcess in WebKitTestRunner.
This is a more common configuration and therefore should be the default testing configuration.

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::decidePolicyForNavigationAction):
Always respond with 'PassThrough' in the InjectedBundle so the UIProcess
is now asked for the policy decision.

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

15 months ago[GTK][WPE] Add Debug bots (build and tests) for WPE
commit-queue@webkit.org [Mon, 23 Apr 2018 21:41:42 +0000 (21:41 +0000)]
[GTK][WPE] Add Debug bots (build and tests) for WPE
https://bugs.webkit.org/show_bug.cgi?id=184887

Patch by Pablo Saavedra <psaavedra@igalia.com> on 2018-04-23
Reviewed by Carlos Alberto Lopez Perez.

Deployed 2 new bots for WPE Debug: wpe-linux-bot-3 and
wpe-linux-bot-4

Both bots have already the credentials ready to authenticated against
build.webkit.org. They provides the bots for the "debug" configuration over
the "WPE" platform and building for the "x86_64" architecture:
WPE Linux 64-bit Debug (Build) and WPE Linux 64-bit Debug (Tests) 

* BuildSlaveSupport/build.webkit.org-config/config.json:
* BuildSlaveSupport/build.webkit.org-config/steps_unittest.py:

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

15 months agoAttempt to fix the Mac and iOS build after r230921
dbates@webkit.org [Mon, 23 Apr 2018 21:17:04 +0000 (21:17 +0000)]
Attempt to fix the Mac and iOS build after r230921
(https://bugs.webkit.org/show_bug.cgi?id=159464)

Pass strings for the dictionary key names instead of using an extern constant as the
latter may not be available on all systems.

* platform/network/mac/CookieJarMac.mm:
(WebCore::setHTTPCookiesForURL):

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

15 months agoAttempt to fix the build after r230921
dbates@webkit.org [Mon, 23 Apr 2018 21:10:41 +0000 (21:10 +0000)]
Attempt to fix the build after r230921
(https://bugs.webkit.org/show_bug.cgi?id=159464)

Pass Same-Site info through.

* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/curl/CookieJarCurl.cpp:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/curl/CookieJarCurlDatabase.cpp:
(WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const):
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::cookieRequestHeaderFieldValue):

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

15 months agoUnreviewed, speculative macOS build fix attempt.
ryanhaddad@apple.com [Mon, 23 Apr 2018 21:07:36 +0000 (21:07 +0000)]
Unreviewed, speculative macOS build fix attempt.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::provideMediaData):

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

15 months agoImplement Same-Site cookies
dbates@webkit.org [Mon, 23 Apr 2018 20:58:35 +0000 (20:58 +0000)]
Implement Same-Site cookies
https://bugs.webkit.org/show_bug.cgi?id=159464
<rdar://problem/27196358>

Reviewed by Brent Fulgham.

Source/WebCore:

Implements support for Same-Site cookies as per <https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00>.
The implementation is materially consistent with the spec. though implements the computation
for a document's "site for cookies" indirectly as part of loading its frame. This is done to
avoid traversing the frame tree on each subresource request initiated by the document or one
of its workers. We take advantage of the fact that Web Workers and Service Workers use their
host document's loader to load resources on their behalf to use the correct "site for cookies"
for requests (e.g. fetch()) initiating by them without the need to duplicate and store the
host document's "site for cookies" in the worker's script execution context.

The implementation differs from the spec. in the handling of about: URLs and the empty URL
and makes the implementation in WebKit match the behavior of Chrome and Firefox as well as
consistent with origin inheritance as described in <https://html.spec.whatwg.org/multipage/browsers.html#origin>
(16 April 2018). Specifically, requests to about:blank, about:srcdoc and the empty URL ("")
are treated as same-site because these URLs inherit their origin from their owner.

Tests: http/tests/cookies/same-site/fetch-after-navigating-iframe-in-cross-origin-page.html
       http/tests/cookies/same-site/fetch-after-top-level-navigation-from-cross-origin-page.html
       http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html
       http/tests/cookies/same-site/fetch-cookies-set-in-about-blank-iframe.html
       http/tests/cookies/same-site/fetch-in-about-blank-page.html
       http/tests/cookies/same-site/fetch-in-cross-origin-iframe.html
       http/tests/cookies/same-site/fetch-in-cross-origin-page.html
       http/tests/cookies/same-site/fetch-in-cross-origin-service-worker.html
       http/tests/cookies/same-site/fetch-in-cross-origin-worker.html
       http/tests/cookies/same-site/fetch-in-same-origin-page.html
       http/tests/cookies/same-site/fetch-in-same-origin-service-worker.html
       http/tests/cookies/same-site/fetch-in-same-origin-srcdoc-iframe.html
       http/tests/cookies/same-site/fetch-in-same-origin-worker.html
       http/tests/cookies/same-site/popup-cross-site-post.html
       http/tests/cookies/same-site/popup-cross-site.html
       http/tests/cookies/same-site/popup-same-site-post.html
       http/tests/cookies/same-site/popup-same-site-via-cross-site-redirect.html
       http/tests/cookies/same-site/popup-same-site-via-same-site-redirect.html
       http/tests/cookies/same-site/popup-same-site.html

* Sources.txt: Add source file SameSiteInfo.cpp.
* WebCore.xcodeproj/project.pbxproj: Add source files SameSiteInfo.{cpp, h}.
* dom/Document.cpp:
(WebCore::Document::initSecurityContext): Modified to call SecurityPolicy::shouldInheritSecurityOriginFromOwner().
(WebCore::Document::shouldInheritContentSecurityPolicyFromOwner const): Ditto.
(WebCore::shouldInheritSecurityOriginFromOwner): Deleted; moved to SecurityPolicy.
* dom/Document.h:
(WebCore::Document::firstPartyForSameSiteCookies const): Added.
(WebCore::Document::setFirstPartyForSameSiteCookies): Added.
* loader/CookieJar.cpp:
(WebCore::sameSiteInfo): Returns the same-site info for the request used to load the specified document.
(WebCore::cookies): Pass the same-site info down to the platform.
(WebCore::cookieRequestHeaderFieldProxy): Ditto.
(WebCore::setCookies): Ditto.
(WebCore::cookieRequestHeaderFieldValue): Ditto.
(WebCore::getRawCookies): Ditto.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest): Add same-site info to the request.
(WebCore::DocumentLoader::startLoadingMainResource): Update a FIXME comment to explain that
we can simplify ResourceRequestBase if we can remove the call to addExtraFieldsToMainResourceRequest()
here. Specifically, we would not need to differentiate between a request with an unspecified
same-site state (default state of a new request) from a request whose same-site state has
been explicitly set if we can assume that the same-site state of a request is set exactly
once. In absence of this guarantee we need an "unspecified" state to avoid overriding existing
same-site information computed with a null initiating document (the case of a new address bar
initiated load) from a load initiated by the document associated with this loader.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::setFirstPartyForCookies): Modified to also update the first party for
same-site cookies ("site for cookies").
(WebCore::FrameLoader::load): Add same-site info to the request.
(WebCore::FrameLoader::reload): Ditto.
(WebCore::FrameLoader::setOriginalURLForDownloadRequest): Ditto.
(WebCore::FrameLoader::addExtraFieldsToRequest): If the request does not already have
same-site info then compute it and add it to the request. Mark main frame main resource
requests as a "top-site".
(WebCore::FrameLoader::addSameSiteInfoToRequestIfNeeded): Implements the "'Same-site' and 'cross-site'
Requests" algorithm from <https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-2.1>.
(WebCore::createWindow): Add same-site info to the request.
* loader/FrameLoader.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::init): Ditto.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow): Ditto.
* page/SecurityPolicy.cpp:
(WebCore::SecurityPolicy::shouldInheritSecurityOriginFromOwner): Moved from Document.cpp.
* page/SecurityPolicy.h:
* platform/CookiesStrategy.h:
* platform/network/CacheValidation.cpp:
(WebCore::headerValueForVary): Pass the same-site info down to the platform.
* platform/network/CookieRequestHeaderFieldProxy.h:
(WebCore::CookieRequestHeaderFieldProxy::encode const): Encode same-site bits.
(WebCore::CookieRequestHeaderFieldProxy::decode): Decode same-site bits.
* platform/network/PlatformCookieJar.h:
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setAsIsolatedCopy): Added.
(WebCore::ResourceRequestBase::isSameSite const): Added.
(WebCore::ResourceRequestBase::setIsSameSite): Added.
(WebCore::ResourceRequestBase::isTopSite const): Added.
(WebCore::ResourceRequestBase::setIsTopSite): Added.
(WebCore::equalIgnoringHeaderFields):
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::isSameSiteUnspecified const): Added. See comment for DocumentLoader::startLoadingMainResource()
for more details.
(WebCore::registrableDomainsAreEqual): Added.
(WebCore::ResourceRequestBase::encodeBase const): Encode same-site bits.
(WebCore::ResourceRequestBase::decodeBase): Decode same-site bits.
* platform/network/SameSiteInfo.cpp: Added.
(WebCore::SameSiteInfo::create):
* platform/network/SameSiteInfo.h: Added.
(WebCore::SameSiteInfo::encode const):
(WebCore::SameSiteInfo::decode):
* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::setCookiesFromDOM): Pass Same-Site info down.
(WebCore::cookiesForDOM): Ditto.
(WebCore::cookieRequestHeaderFieldValue): Ditto.
(WebCore::getRawCookies): Ditto.
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::siteForCookies): Added.
(WebCore::ResourceRequest::doUpdatePlatformRequest): Update platform request with same-site info.
(WebCore::ResourceRequest::doUpdateResourceRequest): Ditto.
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdateResourceRequest): Ditto.
(WebCore::siteForCookies): Added.
(WebCore::ResourceRequest::doUpdatePlatformRequest): Update platform request with same-site info.
* platform/network/curl/CookieJarCurl.cpp:
(WebCore::cookiesForDOM): Pass Same-Site info down.
(WebCore::setCookiesFromDOM): Ditto.
(WebCore::cookieRequestHeaderFieldValue): Ditto.
(WebCore::getRawCookies): Ditto.
* platform/network/curl/CookieJarCurl.h:
* platform/network/curl/CookieJarCurlDatabase.cpp:
(WebCore::CookieJarCurlDatabase::setCookiesFromDOM const): Ditto.
(WebCore::CookieJarCurlDatabase::cookiesForDOM const): Ditto.
(WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const): Ditto.
(WebCore::CookieJarCurlDatabase::getRawCookies const): Ditto.
* platform/network/curl/CookieJarCurlDatabase.h:
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::createCurlRequest): Ditto.
* platform/network/mac/CookieJarMac.mm:
(WebCore::cookiesForURL): Added; shared function to return the cookies based on the specified criterion.
(WebCore::setHTTPCookiesForURL): Moved from the bottom of the file to top to be closer to the other
CFNetwork helper functions. Modified to support fetching same-site cookies.
(WebCore::httpCookiesForURL): Moved to be under setHTTPCookiesForURL(). Modified to call cookiesForURL().
Note the SPI used in cookiesForURL() apply the same criterion for whether to fetch secure cookies as we
were computing here. That is, the CFNetwork SPI only returns secure cookies if the specified URL's scheme
case-insensitively matches "https".
(WebCore::cookiesInPartitionForURL): Wrote in terms of cookiesForURL().
(WebCore::cookiesForSession): Pass the Same-Site info.
(WebCore::cookiesForDOM): Ditto.
(WebCore::cookieRequestHeaderFieldValue): Ditto.
(WebCore::setCookiesFromDOM): Ditto.
(WebCore::getRawCookies): Ditto.
(WebCore::deleteCookie): Pass std::nullopt for the Same-Site info so that we do not consider the SameSite
attribute when fetching cookies to delete.
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::setCookiesFromDOM): Pass the Same-Site info.
(WebCore::cookiesForDOM): Ditto.
(WebCore::cookieRequestHeaderFieldValue): Ditto.
(WebCore::getRawCookies): Ditto.
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::createPageForServiceWorker): Set the first party for same site cookies ("site for cookies") to
the script URL.
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::createDocumentFromSource): Copy the first party for same-site cookies to the
new document.

Source/WebCore/PAL:

Forward declare some SPI.

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

Pass the Same-Site info through the WebKit abstractions.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
(WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
(WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
(WebKit::NetworkConnectionToWebProcess::getRawCookies):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::logCookieInformation const):
(WebKit::logBlockedCookieInformation):
(logCookieInformationInternal):
(NetworkResourceLoader::logCookieInformation):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::constructRevalidationRequest):
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
(WebKit::NetworkCache::SubresourceInfo::encode const):
(WebKit::NetworkCache::SubresourceInfo::decode):
(WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
(WebKit::NetworkCache::SubresourceInfo::isSameSite const):
(WebKit::NetworkCache::SubresourceInfo::isTopSite const): Returns false; subresources do not represent
a top-level navigation.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::isThirdPartyRequest):
(WebKit::updateTaskWithFirstPartyForSameSiteCookies):
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::download):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::cookiesForDOM):
(WebKit::WebPlatformStrategies::setCookiesFromDOM):
(WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
(WebKit::WebPlatformStrategies::getRawCookies):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:

Source/WebKitLegacy/mac:

Pass the Same-Site info through the strategy.

* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::cookiesForDOM):
(WebPlatformStrategies::setCookiesFromDOM):
(WebPlatformStrategies::cookieRequestHeaderFieldValue):
(WebPlatformStrategies::getRawCookies):

Source/WebKitLegacy/win:

Pass the Same-Site info through the strategy.

* WebCoreSupport/WebPlatformStrategies.cpp:
(WebPlatformStrategies::cookiesForDOM):
(WebPlatformStrategies::setCookiesFromDOM):
(WebPlatformStrategies::cookieRequestHeaderFieldValue):
(WebPlatformStrategies::getRawCookies):
* WebCoreSupport/WebPlatformStrategies.h:

LayoutTests:

Add tests. These tests are skipped on all ports for now, including Mac and iOS. We will
look to subsequently enable the tests for Mac and iOS once we have CFNetwork support for
Same-Site cookies.

The following tests and utilities were taken in whole or in part from Blink:
    http/tests/cookies/resources/echo-json.php
    http/tests/cookies/resources/post-cookies-onmessage.php
    http/tests/cookies/resources/post-cookies-to-opener.php
    http/tests/cookies/resources/testharness-helpers.js
    http/tests/cookies/same-site/popup-cross-site-post.html
    http/tests/cookies/same-site/popup-cross-site.html
    http/tests/cookies/same-site/popup-same-site-post.html
    http/tests/cookies/same-site/popup-same-site.html

The following files were derived from tests taken from Blink:
    http/tests/cookies/same-site/popup-same-site-via-cross-site-redirect.html
    http/tests/cookies/same-site/popup-same-site-via-same-site-redirect.html

* TestExpectations: Skip on all ports for now.
* http/tests/cookies/resources/cookie-utilities.js: Added.
(createCookie):
(setBaseDocumentWhenFetchingDOMCookies):
(setDOMCookie):
* http/tests/cookies/resources/cookie-utility.php:
* http/tests/cookies/resources/echo-json.php: Added.
* http/tests/cookies/resources/post-cookies-onmessage.php: Added.
* http/tests/cookies/resources/post-cookies-to-opener.php: Added.
* http/tests/cookies/resources/testharness-helpers.js: Added.
(clearKnownCookies):
* http/tests/cookies/same-site/fetch-after-navigating-iframe-in-cross-origin-page-expected.txt: Added.
* http/tests/cookies/same-site/fetch-after-navigating-iframe-in-cross-origin-page.html: Added.
* http/tests/cookies/same-site/fetch-after-top-level-navigation-from-cross-origin-page-expected.txt: Added.
* http/tests/cookies/same-site/fetch-after-top-level-navigation-from-cross-origin-page.html: Added.
* http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page-expected.txt: Added.
* http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html: Added.
* http/tests/cookies/same-site/fetch-cookies-set-in-about-blank-iframe-expected.txt: Added.
* http/tests/cookies/same-site/fetch-cookies-set-in-about-blank-iframe.html: Added.
* http/tests/cookies/same-site/fetch-in-about-blank-page-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-about-blank-page.html: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-iframe-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-iframe.html: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-page-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-page.html: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-service-worker-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-service-worker.html: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-worker-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-cross-origin-worker.html: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-page-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-page.html: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-service-worker-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-service-worker.html: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-srcdoc-iframe-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-srcdoc-iframe.html: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-worker-expected.txt: Added.
* http/tests/cookies/same-site/fetch-in-same-origin-worker.html: Added.
* http/tests/cookies/same-site/popup-cross-site-expected.txt: Added.
* http/tests/cookies/same-site/popup-cross-site-post-expected.txt: Added.
* http/tests/cookies/same-site/popup-cross-site-post.html: Added.
* http/tests/cookies/same-site/popup-cross-site.html: Added.
* http/tests/cookies/same-site/popup-same-site-expected.txt: Added.
* http/tests/cookies/same-site/popup-same-site-post-expected.txt: Added.
* http/tests/cookies/same-site/popup-same-site-post.html: Added.
* http/tests/cookies/same-site/popup-same-site-via-cross-site-redirect-expected.txt: Added.
* http/tests/cookies/same-site/popup-same-site-via-cross-site-redirect.html: Added.
* http/tests/cookies/same-site/popup-same-site-via-same-site-redirect-expected.txt: Added.
* http/tests/cookies/same-site/popup-same-site-via-same-site-redirect.html: Added.
* http/tests/cookies/same-site/popup-same-site.html: Added.
* http/tests/cookies/same-site/resources/click-hyperlink.php: Added.
* http/tests/cookies/same-site/resources/echo-iframe-src.php: Added.
* http/tests/cookies/same-site/resources/fetch-after-navigating-iframe-in-cross-origin-page.php: Added.
* http/tests/cookies/same-site/resources/fetch-after-top-level-navigation-from-cross-origin-page.php: Added.
* http/tests/cookies/same-site/resources/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.php: Added.
* http/tests/cookies/same-site/resources/fetch-in-cross-origin-iframe.html: Added.
* http/tests/cookies/same-site/resources/fetch-in-cross-origin-service-worker.html: Added.
* http/tests/cookies/same-site/resources/fetch-in-cross-origin-worker.js: Added.
(async.checkResult):
* http/tests/cookies/same-site/resources/fetch-in-same-origin-service-worker.php: Added.
* http/tests/cookies/same-site/resources/fetch-in-same-origin-worker.js: Added.
(async.checkResult):
* http/tests/cookies/same-site/resources/passthrough-service-worker.js: Added.
* platform/mac-wk1/TestExpectations: Skip the Service Worker tests as they are not supported in LegacyWebKit.

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

15 months agoHTML String load cannot be prevented by responding 'Cancel' asynchronously in decideP...
cdumez@apple.com [Mon, 23 Apr 2018 20:49:57 +0000 (20:49 +0000)]
HTML String load cannot be prevented by responding 'Cancel' asynchronously in decidePolicyForNavigationAction
https://bugs.webkit.org/show_bug.cgi?id=184848
<rdar://problem/39145306>

Reviewed by Brady Eidson.

Source/WebCore:

When calling loadHTMLString on a WebView, we end up doing a load for 'about:blank'
with substitute data. In such case, we want to do a regular asynchronous policy
delegate check, there is no reason we need it to be synchronous. Update our check
to make sure we only do a synchronous policy check for initial 'about:blank' loads
that do not have substitute data.

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

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/DecidePolicyForNavigationAction.mm:
(-[DecidePolicyForNavigationActionController webView:decidePolicyForNavigationAction:decisionHandler:]):
(TEST):

LayoutTests:

Update layout tests that wrongly expected 'about:blank' to load synchronously even
when it is not the initial empty document of an iframe. I have checked that our
behavior is now consistent with Chrome.

* fast/events/beforeunload-alert-user-interaction2.html:
* http/tests/security/cross-origin-reified-window-location-setting-expected.txt:
* http/tests/security/cross-origin-reified-window-location-setting.html:
* webarchive/loading/javascript-url-iframe-crash-expected.txt:

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

15 months agoWebProcessProxy frequently re-takes a process assertion for the network process even...
cdumez@apple.com [Mon, 23 Apr 2018 20:29:36 +0000 (20:29 +0000)]
WebProcessProxy frequently re-takes a process assertion for the network process even though is already has one
https://bugs.webkit.org/show_bug.cgi?id=184889
<rdar://problem/38151530>

Reviewed by Brady Eidson.

In ProcessThrottler::updateAssertionNow(), if the new process assertion state is the same
as the existing one, then return early. Otherwise, we would end up calling WebProcessProxy::didSetAssertionState()
for the same assertion state, which would cause duplicate logging but also some unnecessary work.

* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::updateAssertionNow):

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

15 months ago[Extra zoom mode] 100vw is roughly half of the viewport width in extra zoom mode
wenson_hsieh@apple.com [Mon, 23 Apr 2018 19:40:26 +0000 (19:40 +0000)]
[Extra zoom mode] 100vw is roughly half of the viewport width in extra zoom mode
https://bugs.webkit.org/show_bug.cgi?id=184871
<rdar://problem/39477595>

Reviewed by Andy Estes.

Source/WebCore:

Currently, when computing CSS viewport units, we use ViewportConfiguration::initialScaleIgnoringContentSize().
This method computes an initial scale from the layout width and height without relying on any information
derived from the current content size. This is done to ensure that the content size and viewport dimensions for
CSS viewport units should not be simultaneously dependent on each other.

Since shrink-to-fit heuristics depend on content size, we currently assume that shrink-to-fit is disabled when
computing initialScaleIgnoringContentSize, by always passing in `false` for `shouldIgnoreScalingConstraints`.
However, in extra zoom mode, the opposite is true: since we force both `m_canIgnoreScalingConstraints` and
`m_forceHorizontalShrinkToFit` to be `true` in this mode, we will always try to shrink-to-fit regardless of
content size.

Because of this shrink-to-fit disparity between `initialScale` and `initialScaleIgnoringContentSize`, viewport
units in extra zoom mode are currently computed assuming an initial scale set by the page, whereas the real
viewport is scaled to fit, which causes any lengths computed in terms of vw and vh to be incorrect. To fix this,
we introduce a version of shouldIgnoreScalingConstraints() that returns `true` iff scaling constraints are
always ignored, regardless of content size. We then use this in initialScaleIgnoringContentSize, instead of
always passing in `false` for `shouldIgnoreScalingConstraints`.

Test: fast/css/extrazoom/viewport-units-shrink-to-fit.html

* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::shouldIgnoreScalingConstraintsRegardlessOfContentSize const):
(WebCore::ViewportConfiguration::initialScaleIgnoringContentSize const):
* page/ViewportConfiguration.h:

LayoutTests:

Add a new layout test to verify that shrink-to-fit works as intended in extra zoom mode:
1.  The large element should cause the entire viewport to shrink down to fit.
2.  Removing the large element should adjust the viewport, such that the smaller element now fits the entire
    viewport.
3.  The smaller element (at 100vw and 100vh) should be the same size as the window.

* TestExpectations:
* fast/css/extrazoom/viewport-units-shrink-to-fit-expected.txt: Added.
* fast/css/extrazoom/viewport-units-shrink-to-fit.html: Added.

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

15 months agoInclude stdio.h before using stderr
commit-queue@webkit.org [Mon, 23 Apr 2018 15:23:35 +0000 (15:23 +0000)]
Include stdio.h before using stderr
https://bugs.webkit.org/show_bug.cgi?id=184872

Patch by Ting-Wei Lan <lantw44@gmail.com> on 2018-04-23
Reviewed by Yusuke Suzuki.

* bmalloc/PerProcess.cpp:
* bmalloc/Scavenger.cpp:

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

15 months ago[Simple line layout] Generate inline boxtree using simple line layout runs.
zalan@apple.com [Mon, 23 Apr 2018 14:47:00 +0000 (14:47 +0000)]
[Simple line layout] Generate inline boxtree using simple line layout runs.
https://bugs.webkit.org/show_bug.cgi?id=184833

Reviewed by Antti Koivisto.

RenderBlockFlow::ensureLineBoxes triggers line layout on the block content to replace
the simple line layout runs with an inline boxtree. The runs generated by the fast path
should always match the inline tree boxes.
In this patch instead of triggering layout, we just convert the simple line runs to
inline boxes.
Currently, it works with only one, non-paginated text renderer, but we should be
able to extend it to all the simple line layout content.

Covered by existing tests.

* rendering/InlineBox.h:
(WebCore::InlineBox::setHasHyphen):
(WebCore::InlineBox::setCanHaveLeadingExpansion):
(WebCore::InlineBox::setCanHaveTrailingExpansion):
(WebCore::InlineBox::setForceTrailingExpansion):
(WebCore::InlineBox::setForceLeadingExpansion):
(WebCore::InlineBox::hasHyphen const):
(WebCore::InlineBox::canHaveLeadingExpansion const):
(WebCore::InlineBox::canHaveTrailingExpansion const):
(WebCore::InlineBox::forceTrailingExpansion const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::ensureLineBoxes):
* rendering/RenderBlockFlow.h:
* rendering/SimpleLineLayoutFlowContents.h:
(WebCore::SimpleLineLayout::FlowContents::segmentForRun const):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::canUseForLineBoxTree):
(WebCore::SimpleLineLayout::initializeInlineBox):
(WebCore::SimpleLineLayout::generateLineBoxTree):
* rendering/SimpleLineLayoutFunctions.h:
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::rangeForLine const):
* rendering/SimpleLineLayoutResolver.h:

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

15 months ago[CoordGraphics] Remove unused trajectory cruft in CoordinatedLayerTreeHost, Coordinat...
zandobersek@gmail.com [Mon, 23 Apr 2018 14:16:00 +0000 (14:16 +0000)]
[CoordGraphics] Remove unused trajectory cruft in CoordinatedLayerTreeHost, CoordinatedGraphicsLayer
https://bugs.webkit.org/show_bug.cgi?id=184881

Reviewed by Michael Catanzaro.

Source/WebCore:

Remove the redundant findFirstDescendantWithContentsRecursively() and
setVisibleContentRectTrajectoryVector() methods on the
CoordinatedGraphicsLayer class.

* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::findFirstDescendantWithContentsRecursively): Deleted.
(WebCore::CoordinatedGraphicsLayer::setVisibleContentRectTrajectoryVector): Deleted.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

Source/WebKit:

The CompositingCoordinator::setVisibleContentsRect() method is always
called with a (0,0) FloatPoint value as the trajectory vector parameter,
which is already the default value in TiledBackingStore where this ends
up. Removing this call chain also enables removing some unnecessary and
odd code in the CoordinatedGraphicsLayer class.

This doesn't yet touch the trajectory logic in the TiledBackingStore
class since it's not yet a given this won't be used in the future. But
if that will be necessary, hope is to not use it this way.

* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::setVisibleContentsRect):
(WebKit::CompositingCoordinator::mainContentsLayer): Deleted.
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::setVisibleContentsRect):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewport):

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

15 months ago[CoordGraphics] TiledBackingStore unnecessarily tracks alpha support value
zandobersek@gmail.com [Mon, 23 Apr 2018 14:12:24 +0000 (14:12 +0000)]
[CoordGraphics] TiledBackingStore unnecessarily tracks alpha support value
https://bugs.webkit.org/show_bug.cgi?id=184880

Reviewed by Michael Catanzaro.

Drop the m_supportsAlpha member from the TiledBackingStore class. The
member value was unused. TiledBackingStore::setSupportsAlpha() method
is removed.

TiledBackingStore::setSupportsAlpha() invalidated the backing store,
so CoordinatedGraphicsLayer::setContentsOpaque() now enforces the same
behavior by manually updating the m_needsDisplay struct. This means
that during the following layer flush the backing store is repainted
in its entirety.

* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setContentsOpaque):
(WebCore::CoordinatedGraphicsLayer::createBackingStore):
* platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
(WebCore::TiledBackingStore::TiledBackingStore):
(WebCore::TiledBackingStore::setSupportsAlpha): Deleted.
* platform/graphics/texmap/coordinated/TiledBackingStore.h:

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

15 months ago[GTK][WPE] TestSSL fails due to additional TLS errors returned
mcatanzaro@igalia.com [Mon, 23 Apr 2018 13:45:20 +0000 (13:45 +0000)]
[GTK][WPE] TestSSL fails due to additional TLS errors returned
https://bugs.webkit.org/show_bug.cgi?id=184860

Reviewed by Carlos Garcia Campos.

Add script and config file for regenerating the test certificate.
Regenerate it. TestSSL no longer fails on my machine.

I do see a ton of network process crashes and JavaScript errors, none of
which prevent the test from passing, but this commit only claims to fix
the certificate validation portion of the test.

* TestWebKitAPI/Tests/WebKitGLib/resources/generate-test-cert.sh: Added.
* TestWebKitAPI/Tests/WebKitGLib/resources/test-cert.conf: Added.
* TestWebKitAPI/Tests/WebKitGLib/resources/test-cert.pem:

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

15 months ago[GStreamer] Start implementing Audio/VideoTrackPrivateGSTreamer::kind method
commit-queue@webkit.org [Mon, 23 Apr 2018 13:39:53 +0000 (13:39 +0000)]
[GStreamer] Start implementing Audio/VideoTrackPrivateGSTreamer::kind method
https://bugs.webkit.org/show_bug.cgi?id=184650

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

In the playbin3 case we can assume that if the GstStream is selected by default,
it is the Main track of that kind.

No new tests are added as:
    * It relies on playbin3 case which support might be compiled out
    * we already have a few test that are currently disabled in the mediastream
      testsuite. This patch is part of the work to enable them.

* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
(WebCore::AudioTrackPrivateGStreamer::kind const):
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
(WebCore::VideoTrackPrivateGStreamer::kind const):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:

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

15 months ago[MSE] Add allSamplesInTrackEnqueued event
aboya@igalia.com [Mon, 23 Apr 2018 11:19:01 +0000 (11:19 +0000)]
[MSE] Add allSamplesInTrackEnqueued event
https://bugs.webkit.org/show_bug.cgi?id=184737

MediaSource has a .endOfStream() method to signal when there are no more frames
after the ones currently buffered.

This bit of data is important for some multimedia frameworks. For instance, in
GStreamer a stream of frames being decoded should be terminated by a
'end-of-stream' (EOS) event that has a similar meaning. Some GStreamer elements
will expect this event in order to work properly under some circumstances.

Unfortunately currently WebKit provides no mechanism for this: an event of
sorts should be emitted after no more frames are going to be enqueued to signal
the end of the stream. The closest mechanism WebKit has for this is
`markEndOfStream()`, but it's not exactly the same: markEndOfStream() informs
that -- as far as network buffering is concerned -- we are done; but at that
point there may still be (and often are) many frames waiting in the
decodeQueue, so it would be wrong to signal the decoder that there are no more
frames.

This patch introduces a new optional method in SourceBufferPrivate,
`allSamplesInTrackEnqueued(const AtomicString& trackID)` that is called
whenever the MediaSource is in "ended" state (the user has called
`MediaSource.endOfStream()`) and the decodeQueue is empty. Media framework
implementations can use this method to send a EOS event to a decoder that needs
it.

Reviewed by Xabier Rodriguez-Calvar.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::streamEndedWithError):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::provideMediaData):
(WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):
(WebCore::SourceBuffer::trySignalAllSamplesEnqueued):
* Modules/mediasource/SourceBuffer.h:
* platform/graphics/SourceBufferPrivate.h:
(WebCore::SourceBufferPrivate::allSamplesInTrackEnqueued):
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::allSamplesInTrackEnqueued):
* platform/graphics/gstreamer/mse/PlaybackPipeline.h:
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::allSamplesInTrackEnqueued):
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:

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

15 months ago[Win][WK2] REGRESSION(r230834) 'getpid': identifier not found
Hironori.Fujii@sony.com [Mon, 23 Apr 2018 10:13:00 +0000 (10:13 +0000)]
[Win][WK2] REGRESSION(r230834) 'getpid': identifier not found
https://bugs.webkit.org/show_bug.cgi?id=184877

Reviewed by Yusuke Suzuki.

* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::WebBackForwardListProxy::addItem): Use WTF::getCurrentProcessID() instead of getpid().
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::goToBackForwardItem): Ditto.

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

15 months agoAvoid uninitialized memory read.
zandobersek@gmail.com [Mon, 23 Apr 2018 07:44:50 +0000 (07:44 +0000)]
Avoid uninitialized memory read.
https://bugs.webkit.org/show_bug.cgi?id=184505
<rdar://problem/39348325>

Patch by Ms2ger <Ms2ger@igalia.com> on 2018-04-23
Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-bounds-expected.txt: Added.
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-bounds.html: Added.

Source/WebCore:

Test: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-bounds.html

* html/ImageBitmap.cpp:
(WebCore::croppedSourceRectangleWithFormatting):

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

15 months ago[TexMap] Drop RefCounted inheritance off of TextureMapperBackingStore
zandobersek@gmail.com [Mon, 23 Apr 2018 07:32:30 +0000 (07:32 +0000)]
[TexMap] Drop RefCounted inheritance off of TextureMapperBackingStore
https://bugs.webkit.org/show_bug.cgi?id=184810

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Turn TextureMapperBackingStore into a simple interface that doesn't
inherit from RefCounted<>. Instead, push that inheritance off to the
classes that implement the TextureMapperBackingStore interface. This
narrows down the purpose of TextureMapperBackingStore towards a simple
interface that TextureMapper algorithms can work with.

TextureMapperLayer has its m_backingStore member variable turn into
a simple pointer instead of a RefPtr<>. Setter method and call sites of
that method are updated to reflect that.

TextureMapperTiledBackingStore now inherits from RefCounted<> directly,
instead of through TextureMapperBackingStore.

* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
(WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* platform/graphics/texmap/TextureMapperBackingStore.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::setBackingStore):
* platform/graphics/texmap/TextureMapperLayer.h:
* platform/graphics/texmap/TextureMapperTiledBackingStore.h:

Source/WebKit:

CoordinatedBackingStore should inherit directly from RefCounted<> now
that TextureMapperBackingStore doesn't anymore.

* Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::createBackingStoreIfNeeded):

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

15 months ago[AsyncScrolling] Add generic ScrollingThread implementation
zandobersek@gmail.com [Mon, 23 Apr 2018 06:48:37 +0000 (06:48 +0000)]
[AsyncScrolling] Add generic ScrollingThread implementation
https://bugs.webkit.org/show_bug.cgi?id=184809

Reviewed by Yusuke Suzuki.

Add a generic ScrollingThread implementation that internally uses
RunLoop facilities to run the scrolling thread and dispatch
callbacks on that thread.

ScrollingThread::initializeRunLoop() retrieves address of the
thread-specific RunLoop and signals the Condition object.
ScrollingThread::wakeUpRunLoop() uses RunLoop::dispatch() to schedule
callback dispatches on the scrolling thread.

ScrollingThread::createThreadIfNeeded() mimics Cocoa implementation and
waits for the RunLoop address to be retrieved before continuing.

* SourcesGTK.txt: Add to build.
* SourcesWPE.txt: Ditto.
* page/scrolling/ScrollingThread.cpp:
(WebCore::ScrollingThread::createThreadIfNeeded):
* page/scrolling/ScrollingThread.h:
* page/scrolling/generic/ScrollingThreadGeneric.cpp: Added.
(WebCore::ScrollingThread::initializeRunLoop):
(WebCore::ScrollingThread::wakeUpRunLoop):

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

15 months ago[CoordinatedGraphics] Unused contentsSize, coveredRect attributes in CoordinatedGraph...
zandobersek@gmail.com [Mon, 23 Apr 2018 06:47:02 +0000 (06:47 +0000)]
[CoordinatedGraphics] Unused contentsSize, coveredRect attributes in CoordinatedGraphicsState
https://bugs.webkit.org/show_bug.cgi?id=184811

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Remove the unused contentsSize and coveredRect attributes on the
CoordinatedGraphicsState struct. CoordinatedGraphicsLayer::coverRect()
method is now unused and can also be removed.

* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:

Source/WebKit:

* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::flushPendingLayerChanges): Stop setting
the removed contentsSize and coveredRect attributes. These were only
ever set to the appropriate values, but were then never used anywhere.

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

15 months agoWeb Inspector: WebInspectorProxy releases WKWebInspectorProxyObjCAdapter without...
mattbaker@apple.com [Sun, 22 Apr 2018 23:03:44 +0000 (23:03 +0000)]
Web Inspector: WebInspectorProxy releases WKWebInspectorProxyObjCAdapter without removing corresponding observer
https://bugs.webkit.org/show_bug.cgi?id=184865
<rdar://problem/37764960>

Reviewed by Brian Burg.

Replace the early return removed in https://bugs.webkit.org/show_bug.cgi?id=177661,
so that WKWebInspectorProxyObjCAdapter and the view controller can be reused
when reopening the Inspector while the WebView is still alive.

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformCreateFrontendPage):

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

15 months agoAdd -[WKInputDelegate _webView:decidePolicyForFocusedElement:] so clients can request...
commit-queue@webkit.org [Sun, 22 Apr 2018 21:39:30 +0000 (21:39 +0000)]
Add -[WKInputDelegate _webView:decidePolicyForFocusedElement:] so clients can request default focusing behavior
https://bugs.webkit.org/show_bug.cgi?id=184844

Patch by Paul Knight <pknight@apple.com> on 2018-04-22
Reviewed by Dan Bernstein.

If a client doesn't implement -[_WKInputDelegate _webView:focusShouldStartInputSession:] the default
focus behavior only brings up the keyboard if it's already onscreen, the interaction is user driven,
and other factors that even depend on what feature flags are enabled.

If a client implements _webView:focusShouldStartInputSession:, they don't have a good way to specifiy
they'd like to fall back to the default behavior. This makes it difficult for a client to use the
default in most cases, but sometimes allow programmatic focus from the page, for example.

Add a new delegate method -_webView:decidePolicyForFocusedElement: that returns a new enum type
_WKFocusStartsInputSessionPolicy. Clients can return _WKFocusStartsInputSessionPolicyAuto to request
the default behavior, or _WKFocusStartsInputSessionPolicyAllow / Disallow to directly control whether
the keyboard appears to assist the focused node.

* UIProcess/API/Cocoa/_WKInputDelegate.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):

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

15 months agoAdd a layout test for r230785
wenson_hsieh@apple.com [Sun, 22 Apr 2018 21:23:16 +0000 (21:23 +0000)]
Add a layout test for r230785
https://bugs.webkit.org/show_bug.cgi?id=184757

Reviewed by Beth Dakin.

Adds a new layout test to verify that true screen dimensions in extra zoom mode
are observable from the page, via window.screen.

* TestExpectations:
* fast/dom/Window/extrazoom/window-get-real-screen-dimensions.html: Added.

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

15 months ago[JSC] Remove ModuleLoaderPrototype
utatane.tea@gmail.com [Sun, 22 Apr 2018 13:44:58 +0000 (13:44 +0000)]
[JSC] Remove ModuleLoaderPrototype
https://bugs.webkit.org/show_bug.cgi?id=184784

Reviewed by Mark Lam.

When we introduce ModuleLoaderPrototype, ModuleLoader may be created by users and exposed to users.
However, the loader spec is abandoned. So we do not need to have ModuleLoaderPrototype and JSModuleLoader.
This patch merges ModuleLoaderPrototype's functionality into JSModuleLoader.

* CMakeLists.txt:
* DerivedSources.make:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* builtins/ModuleLoader.js: Renamed from Source/JavaScriptCore/builtins/ModuleLoaderPrototype.js.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::proxyRevokeStructure const):
(JSC::JSGlobalObject::moduleLoaderStructure const): Deleted.
* runtime/JSModuleLoader.cpp:
(JSC::moduleLoaderParseModule):
(JSC::moduleLoaderRequestedModules):
(JSC::moduleLoaderModuleDeclarationInstantiation):
(JSC::moduleLoaderResolve):
(JSC::moduleLoaderResolveSync):
(JSC::moduleLoaderFetch):
(JSC::moduleLoaderGetModuleNamespaceObject):
(JSC::moduleLoaderEvaluate):
* runtime/JSModuleLoader.h:
* runtime/ModuleLoaderPrototype.cpp: Removed.
* runtime/ModuleLoaderPrototype.h: Removed.

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

16 months agoCleanup CookieRequestHeaderFieldProxy
dbates@webkit.org [Sun, 22 Apr 2018 01:21:17 +0000 (01:21 +0000)]
Cleanup CookieRequestHeaderFieldProxy
https://bugs.webkit.org/show_bug.cgi?id=184868

Remove extraneous whitespace that I inadvertently added.

* platform/network/CookieRequestHeaderFieldProxy.h:
(WebCore::CookieRequestHeaderFieldProxy::decode):

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

16 months agoCleanup CookieRequestHeaderFieldProxy
dbates@webkit.org [Sun, 22 Apr 2018 01:16:25 +0000 (01:16 +0000)]
Cleanup CookieRequestHeaderFieldProxy
https://bugs.webkit.org/show_bug.cgi?id=184868

Reviewed by Youenn Fablet.

Simplify the struct CookieRequestHeaderFieldProxy and make it consistent with other structs.
Among other changes, remove constructors for CookieRequestHeaderFieldProxy as they are
unnecessary as all supported compilers support non-static data member initializers (NSDMI)
for aggregates, remove prefix "m_" from the name of fields as this is struct exists for
convenience and offers no encapsulation and simplify decoding logic of this struct.

No functionality changed. So, no new tests.

* loader/CookieJar.cpp:
(WebCore::cookieRequestHeaderFieldProxy):
* platform/network/CookieRequestHeaderFieldProxy.h:
(WebCore::CookieRequestHeaderFieldProxy::encode const):
(WebCore::CookieRequestHeaderFieldProxy::decode):
(WebCore::CookieRequestHeaderFieldProxy::CookieRequestHeaderFieldProxy): Deleted.
* platform/network/SocketStreamHandleImpl.cpp:
(WebCore::cookieDataForHandshake):
* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/curl/CookieJarCurl.cpp:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/curl/CookieJarCurlDatabase.cpp:
(WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const):
* platform/network/mac/CookieJarMac.mm:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::cookieRequestHeaderFieldValue):

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

16 months agoUnreviewed, follow-up patch after r230474
utatane.tea@gmail.com [Sat, 21 Apr 2018 21:58:51 +0000 (21:58 +0000)]
Unreviewed, follow-up patch after r230474
https://bugs.webkit.org/show_bug.cgi?id=166684

Add "JavaScriptCore" to Darwin name. And use short name "BMScavenger"
for Linux since adding "JavaScriptCore" makes the name too long for Linux.

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

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

16 months agoDisable backward and forward navigation swipes while in fullscreen.
commit-queue@webkit.org [Sat, 21 Apr 2018 21:52:51 +0000 (21:52 +0000)]
Disable backward and forward navigation swipes while in fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=184656
rdar://problem/36057535

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-04-21
Reviewed by Tim Horton.

Disable navigation swipes while in fullscreen.

* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::canSwipeInDirection const):

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

16 months ago[Modern Media Controls] Show a loading indicator after pressing the play button in...
graouts@webkit.org [Sat, 21 Apr 2018 21:49:04 +0000 (21:49 +0000)]
[Modern Media Controls] Show a loading indicator after pressing the play button in compact mode
https://bugs.webkit.org/show_bug.cgi?id=184863
<rdar://problem/38939468>

Reviewed by Dean Jackson.

Source/WebCore:

We now display a loading indicator after pressing the play button when in compact mode. We also update the
behavior to use assets provided through WebKitAdditions (see webkit.org/b/184862) for the play button and
the invalid icon. Additionally, we always show a 20% opaque black overlay in the background while any piece
of user interface is up.

* Modules/modern-media-controls/controls/compact-activity-indicator.css: Added.
(button.compact-activity-indicator > picture): The loading indicator asset is a sprite made of 23 frames, so
we specify the mask size (since all buttons are rendered via a mask) to be 23 * 100% the rendered size. The
display of the loading indicator is performed with a first intro animation which runs once through the first
8 frames and then a continuously looping animation going through the remaining frames. We use a frames()
timing function to achieve the frame-by-frame effect while using only from/to keyframe animations. When we
fade out, we use a simply opacity fade, which is combined with the spinning animation. We use CSS variables
to encode both animations so they can be used combined or one at a time without redefining the whole animation
property.
(button.compact-activity-indicator.spins > picture): Use the "spins" animation variable when spinning.
(button.compact-activity-indicator.spins.fades-out > picture): Combine the "spins" and "fades-out" animation
variables when fading out.
(@keyframes compact-activity-indicator-intro): Animation going through the first 8 frames of the loading indicator.
(@keyframes compact-activity-indicator-loop): Animation going through the remaining frames of the loading indicator.
(@keyframes compact-activity-indicator-fades-out): Animation fading opacity from 1 to 0.
* Modules/modern-media-controls/controls/compact-activity-indicator.js: Added.
(CompactActivityIndicator):
(CompactActivityIndicator.prototype.show): Add the "spins" CSS class to show the control spinning with the intro animation.
(CompactActivityIndicator.prototype.hide): Add the "fades-out" CSS class to hide the control, removing both this class and
the "spins" class when the fade-out animation completes.
* Modules/modern-media-controls/controls/compact-media-controls.css: Added.
(.media-controls.compact:before): Add a 20% black overlay over the video frame to provide contrast for controls.
(.media-controls.compact button): Ensure buttons are sized to use the entire video frame so that their hit region
comprises the whole video frame.
(.media-controls.compact button > picture): Override default blending styles for a simple solid white mask.
(.media-controls.compact button:active > picture): Turn off the scale down effect when pressing a button.
* Modules/modern-media-controls/controls/compact-media-controls.js: Expose a "state" property for the compact media controls,
which can be exlusively one of three: "paused", "pending" and "invalid".
(CompactMediaControls.):
(CompactMediaControls.prototype.get state):
(CompactMediaControls.prototype.set state):
(CompactMediaControls.prototype.layout): In the "paused" state, show the play button. In the "pending" state show
the loading indicator. In the "invalid" state show the invalid button.
(CompactMediaControls.prototype.get placard): Deleted.
(CompactMediaControls.prototype.set placard): Deleted.
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/compact-media-controls-support.js: Added.
(CompactMediaControlsSupport.prototype.get mediaEvents):
(CompactMediaControlsSupport.prototype.handleEvent): Make the controls enter the "paused" state when receiving a "pause"
event. Make the controls enter the "invalid" state when receiving an "error" event.
(CompactMediaControlsSupport.prototype.enable):
(CompactMediaControlsSupport.prototype.disable):
(CompactMediaControlsSupport.prototype.buttonWasPressed): Play the media when pressing the play button and make the controls
enter the "pending" state. When pressing the loading indicator, pause the media and make the controls enter the "paused" state.
(CompactMediaControlsSupport.prototype._buttons):
(CompactMediaControlsSupport):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._supportingObjectClasses): Only use CompactMediaControlsSupport as a media controller supporting object
in the compact mode.
* Modules/modern-media-controls/media/placard-support.js:
(PlacardSupport.prototype.get mediaEvents): This media controller support object no longer needs to deal with compact mode.
* Modules/modern-media-controls/media/playback-support.js:
(PlaybackSupport.prototype.syncControl): This media controller support object no longer needs to deal with compact mode.
(PlaybackSupport):

LayoutTests:

* media/modern-media-controls/compact-media-controls/compact-media-controls-constructor-expected.txt:
* media/modern-media-controls/compact-media-controls/compact-media-controls-constructor.html:
* media/modern-media-controls/compact-media-controls/compact-media-controls-layout-expected.txt:
* media/modern-media-controls/compact-media-controls/compact-media-controls-layout.html:

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

16 months ago[Modern Media Controls] Obtain compact mode icons through WebKitAdditions
graouts@webkit.org [Sat, 21 Apr 2018 21:47:55 +0000 (21:47 +0000)]
[Modern Media Controls] Obtain compact mode icons through WebKitAdditions
https://bugs.webkit.org/show_bug.cgi?id=184862
<rdar://problem/39621645>

Reviewed by Jon Lee.

* Modules/modern-media-controls/controls/button.js:
(Button.prototype._updateImageMetrics): Handle PDF assets where the image source's intrinsic size needs
to be adjusted for the device pixel density.
(Button):
* Modules/modern-media-controls/controls/icon-service.js: Expect three additional icons provided through
WebKitAdditions, including two in the PDF format, so we add support for this format.
* WebCore.xcodeproj/project.pbxproj: Copy additional assets from the WebKitAdditions build directory should
any be present.

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

16 months agoActivate NetworkLoadChecker for media loads
youenn@apple.com [Sat, 21 Apr 2018 20:46:44 +0000 (20:46 +0000)]
Activate NetworkLoadChecker for media loads
https://bugs.webkit.org/show_bug.cgi?id=184841

Reviewed by Eric Carlson.

Source/WebKit:

Instantiate a NetworkLoadChecker for NetworkResourceLoader for audio/video loads.

Move CORS checks for response after handling of 304 checks.
For 304 checks, we need to do the CORS checks on the validated cached response, not the 304 received response.

Updated ResourceError argument coder to explicitly pass the error type
as some errors created by NetworkLoadChecker would otherwise be received as General errors by WebProcess.
Updated platform data encoding of ResourceError accordingly.

All changes are covered by regular media loading layout tests.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::shouldUseNetworkLoadChecker):
(WebKit::NetworkResourceLoader::didReceiveResponse):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ResourceError>::encode):
(IPC::ArgumentCoder<ResourceError>::decode):
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<ResourceError>::encodePlatformData):
(IPC::ArgumentCoder<ResourceError>::decodePlatformData):
We need to set the type after decoding the NSError as ResourceError tries to guess the type from NSError data.
* Shared/soup/WebCoreArgumentCodersSoup.cpp:
(IPC::ArgumentCoder<ResourceError>::encodePlatformData):
(IPC::ArgumentCoder<ResourceError>::decodePlatformData):

LayoutTests:

* TestExpectations: Added DumpJSConsoleLogInStdErr to remove console message differences between WK1/WK2.

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

16 months agoExpose whether you've build with the Apple Internal SDK
dino@apple.com [Sat, 21 Apr 2018 20:28:40 +0000 (20:28 +0000)]
Expose whether you've build with the Apple Internal SDK
https://bugs.webkit.org/show_bug.cgi?id=184864

Reviewed by Wenson Hsieh.

Internals API to let a test know if it is running with the
Apple internal SDK.

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

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

16 months agoREGRESSION(r214076): Web Inspector: Timelines load and DOMContentLoaded markers aren...
nvasilyev@apple.com [Sat, 21 Apr 2018 17:45:23 +0000 (17:45 +0000)]
REGRESSION(r214076): Web Inspector: Timelines load and DOMContentLoaded markers aren't visible
https://bugs.webkit.org/show_bug.cgi?id=184858

Reviewed by Brian Burg.

r214076 changed the color of all markers to light gray.

* UserInterface/Views/TimelineRuler.css:
(.timeline-ruler > .markers > .marker):
(body[dir=ltr] .timeline-ruler > .markers > .marker):
(body[dir=rtl] .timeline-ruler > .markers > .marker):
(.timeline-ruler > .markers > .marker.current-time):
(.timeline-ruler > .markers > .marker.load-event):
(.timeline-ruler > .markers > .marker.dom-content-event):
(.timeline-ruler > .markers > .marker.timestamp):
(body[dir=ltr] .timeline-ruler > .markers > .marker.current-time): Deleted.
(body[dir=rtl] .timeline-ruler > .markers > .marker.current-time): Deleted.

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

16 months agoAX: AOM does not work with DOM Level 1 events
n_wang@apple.com [Sat, 21 Apr 2018 06:56:29 +0000 (06:56 +0000)]
AX: AOM does not work with DOM Level 1 events
https://bugs.webkit.org/show_bug.cgi?id=184847

Reviewed by Chris Fleizach.

Source/WebCore:

Added the accessibility events to the HTML attribute names.

Test cases are added to the existing layout tests.

* html/HTMLAttributeNames.in:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::createEventHandlerNameMap):

LayoutTests:

* accessibility/ios-simulator/AOM-dismiss-event-expected.txt:
* accessibility/ios-simulator/AOM-dismiss-event.html:
* accessibility/mac/AOM-event-accessiblesetvalue-expected.txt:
* accessibility/mac/AOM-event-accessiblesetvalue.html:
* accessibility/mac/AOM-events-all-expected.txt:
* accessibility/mac/AOM-events-all.html:
* accessibility/mac/AOM-events-expected.txt:
* accessibility/mac/AOM-events.html:

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

16 months ago[GLIB] ERROR: Thread was unable to be detached when running /jsc/vm test in debug
carlosgc@webkit.org [Sat, 21 Apr 2018 06:42:26 +0000 (06:42 +0000)]
[GLIB] ERROR: Thread was unable to be detached when running /jsc/vm test in debug
https://bugs.webkit.org/show_bug.cgi?id=184815

Reviewed by Michael Catanzaro.

This is because in the test we are calling both join and detach. We should only call join.

* TestWebKitAPI/Tests/JavaScriptCore/glib/TestJSC.cpp:
(testsJSCVirtualMachine):

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

16 months ago[GLIB] Test /jsc/prototypes crashes in debug
carlosgc@webkit.org [Sat, 21 Apr 2018 06:40:52 +0000 (06:40 +0000)]
[GLIB] Test /jsc/prototypes crashes in debug
https://bugs.webkit.org/show_bug.cgi?id=184814

Reviewed by Michael Catanzaro.

We should also call the constructor/destructor of Bar struct to ensure Foo is constructed.

* TestWebKitAPI/Tests/JavaScriptCore/glib/TestJSC.cpp:
(barCreate):
(barFree):

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

16 months ago[GLIB] All API tests fail in debug builds
carlosgc@webkit.org [Sat, 21 Apr 2018 06:38:21 +0000 (06:38 +0000)]
[GLIB] All API tests fail in debug builds
https://bugs.webkit.org/show_bug.cgi?id=184813

Reviewed by Mark Lam.

This is because of a conflict of ExceptionHandler class used in tests and ExceptionHandler struct defined in
JSCContext.cpp. This patch renames the ExceptionHandler struct as JSCContextExceptionHandler.

* API/glib/JSCContext.cpp:
(JSCContextExceptionHandler::JSCContextExceptionHandler):
(JSCContextExceptionHandler::~JSCContextExceptionHandler):
(jscContextConstructed):
(ExceptionHandler::ExceptionHandler): Deleted.
(ExceptionHandler::~ExceptionHandler): Deleted.

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

16 months agoREGRESSION(r228088): [SOUP] Check TLS errors for WebSockets on GTlsConnection::accept...
carlosgc@webkit.org [Sat, 21 Apr 2018 06:36:12 +0000 (06:36 +0000)]
REGRESSION(r228088): [SOUP] Check TLS errors for WebSockets on GTlsConnection::accept-certificate
https://bugs.webkit.org/show_bug.cgi?id=184804

Source/WebCore:

Reviewed by Michael Catanzaro.

* platform/network/soup/SocketStreamHandleImpl.h: Add a public url getter.
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::acceptCertificateCallback): Call SoupNetworkSession::checkTLSErrors() to decide whether to accept the
certificate or not.
(WebCore::connectProgressCallback): Receive the SocketStreamHandle and pass it to acceptCertificateCallback callback.
(WebCore::socketClientEventCallback): Ditto.
(WebCore::SocketStreamHandleImpl::create): Always connect to network events.
(WebCore::wssConnectionAcceptCertificateCallback): Deleted.
(WebCore::wssSocketClientEventCallback): Deleted.

Tools:

Patch by Michael Catanzaro <mcatanzaro@igalia.com> on 2018-04-20
Reviewed by Carlos Garcia Campos.

* TestWebKitAPI/Tests/WebKitGLib/TestSSL.cpp:
(WebSocketTest::WebSocketTest):
(WebSocketTest::~WebSocketTest):
(WebSocketTest::serverWebSocketCallback):
(WebSocketTest::webSocketTestResultCallback):
(WebSocketTest::connectToServerAndWaitForEvents):
(testWebSocketTLSErrors):
(beforeAll):

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

16 months ago[SOUP] Do TLS error checking on GTlsConnection::accept-certificate
carlosgc@webkit.org [Sat, 21 Apr 2018 06:22:15 +0000 (06:22 +0000)]
[SOUP] Do TLS error checking on GTlsConnection::accept-certificate
https://bugs.webkit.org/show_bug.cgi?id=184480

Reviewed by Michael Catanzaro.

Source/WebCore:

* platform/network/soup/ResourceError.h: Change tlsError to recieve a failing URL instead of a SoupRequest,
since the request was only used to get the failing URL.
* platform/network/soup/ResourceErrorSoup.cpp:
(WebCore::ResourceError::tlsError): Use the given failing URL.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession): Use ssl-strict when creating the SoupSession to handle the
certificates ourselves by connecting to GTlsConnection::accept-certificate.
(WebCore::SoupNetworkSession::checkTLSErrors): Updated to receive a URL, certificate and errors instead of
receiving a SoupRequest and SoupMessage and extract the url, certirficate and errors from them. Also return the
optional error directly instead of using a completion handler since the function is always synchronous.
* platform/network/soup/SoupNetworkSession.h:

Source/WebKit:

Connect to GTlsConnection::accept-certificate signal instead of SoupMessage::notify::tls-errors to perform the
TLS errors check.

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::createRequest): Do not connect to SoupMessage::notify::tls-errors.
(WebKit::NetworkDataTaskSoup::tlsConnectionAcceptCertificateCallback): Call tlsConnectionAcceptCertificate() is
the task is still ongoing.
(WebKit::NetworkDataTaskSoup::tlsConnectionAcceptCertificate): Check TLS errors here.
(WebKit::NetworkDataTaskSoup::networkEventCallback): Pass the stream to networkEvent.
(WebKit::NetworkDataTaskSoup::networkEvent): Connect to GTlsConnection::accept-certificate.
* NetworkProcess/soup/NetworkDataTaskSoup.h:

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