WebKit-https.git
15 months agoImplement rendering support for the color-filter CSS property
simon.fraser@apple.com [Fri, 27 Apr 2018 00:10:48 +0000 (00:10 +0000)]
Implement rendering support for the color-filter CSS property
https://bugs.webkit.org/show_bug.cgi?id=185047
rdar://problem/39664967

Reviewed by Tim Horton.

Source/WebCore:

The color-filter property transforms CSS colors just before painting. To support this,
add to RenderStyle colorByApplyingColorFilter() and visitedDependentColorWithColorFilter().
At most calls sites that transform colors for rendering, replace calls to
visitedDependentColor() with visitedDependentColorWithColorFilter(). The few locations
that don't use visitedDependentColor() (e.g. for shadows) call colorByApplyingColorFilter().

Color transformation is implemented via a new virtual function on FilterOperation;
BasicColorMatrixFilterOperation overrides this to use a new ColorMatrix class to
do color math, and BasicComponentTransferFilterOperation to do the equivalent of component
transfer operations. The math in both cases matches that for SVG filters, with the exception
that color components are stored as floats through multiple filters and then mapped to
normal 0-255 color components at the end.

Tests: css3/color-filters/color-filter-backgrounds-borders.html
       css3/color-filters/color-filter-box-shadow.html
       css3/color-filters/color-filter-brightness.html
       css3/color-filters/color-filter-color-property-list-item.html
       css3/color-filters/color-filter-color-property.html
       css3/color-filters/color-filter-color-text-decorations.html
       css3/color-filters/color-filter-column-rule.html
       css3/color-filters/color-filter-contrast.html
       css3/color-filters/color-filter-current-color.html
       css3/color-filters/color-filter-filter-list.html
       css3/color-filters/color-filter-grayscale.html
       css3/color-filters/color-filter-hue-rotate.html
       css3/color-filters/color-filter-inherits.html
       css3/color-filters/color-filter-invert.html
       css3/color-filters/color-filter-opacity.html
       css3/color-filters/color-filter-outline.html
       css3/color-filters/color-filter-saturate.html
       css3/color-filters/color-filter-sepia.html
       css3/color-filters/color-filter-text-emphasis.html

* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
* page/FrameView.cpp:
(WebCore::FrameView::documentBackgroundColor const):
* platform/graphics/ColorUtilities.cpp:
(WebCore::ColorMatrix::ColorMatrix):
(WebCore::ColorMatrix::makeIdentity):
(WebCore::ColorMatrix::grayscaleMatrix):
(WebCore::ColorMatrix::saturationMatrix):
(WebCore::ColorMatrix::hueRotateMatrix):
(WebCore::ColorMatrix::sepiaMatrix):
(WebCore::ColorMatrix::transformColorComponents const):
* platform/graphics/ColorUtilities.h:
* platform/graphics/filters/FilterOperation.cpp:
(WebCore::BasicColorMatrixFilterOperation::transformColor const):
(WebCore::BasicComponentTransferFilterOperation::transformColor const):
* platform/graphics/filters/FilterOperation.h:
(WebCore::FilterOperation::transformColor const):
* platform/graphics/filters/FilterOperations.cpp:
(WebCore::FilterOperations::transformColor const):
* platform/graphics/filters/FilterOperations.h:
* rendering/BorderEdge.cpp:
(WebCore::BorderEdge::getBorderEdgeInfo):
* rendering/EllipsisBox.cpp:
(WebCore::EllipsisBox::paint):
(WebCore::EllipsisBox::paintSelection):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paintBoxDecorations):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintMarkedTextForeground):
(WebCore::InlineTextBox::paintMarkedTextDecoration):
(WebCore::InlineTextBox::paintCompositionUnderline const):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintRootBoxFillLayers):
(WebCore::RenderBox::paintBackground):
(WebCore::RenderBox::getBackgroundPaintedExtent const):
(WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect const):
(WebCore::RenderBox::backgroundHasOpaqueTopLayer const):
* rendering/RenderBoxModelObject.cpp:
(WebCore::applyBoxShadowForBackground):
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
(WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground const):
(WebCore::RenderBoxModelObject::paintBoxShadow):
* rendering/RenderDetailsMarker.cpp:
(WebCore::RenderDetailsMarker::paint):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::selectionColor const):
(WebCore::RenderElement::selectionBackgroundColor const):
(WebCore::RenderElement::paintFocusRing):
(WebCore::RenderElement::paintOutline):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::paintObject):
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::paintColumnBorder):
(WebCore::RenderFrameSet::paintRowBorder):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintReplaced):
(WebCore::RenderImage::paintAreaElementFocusRing):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::paintOutline):
* rendering/RenderLayerBacking.cpp:
(WebCore::canDirectlyCompositeBackgroundBackgroundImage):
(WebCore::RenderLayerBacking::rendererBackgroundColor const):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::paintItemForeground):
(WebCore::RenderListBox::paintItemBackground):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::paint):
* rendering/RenderMenuList.cpp:
(RenderMenuList::itemStyle const):
(RenderMenuList::getItemBackgroundColor const):
(RenderMenuList::menuStyle const):
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::paintColumnRules):
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::menuStyle const):
* rendering/RenderTable.h:
(WebCore::RenderTable::bgColor const):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computeCollapsedStartBorder const):
(WebCore::RenderTableCell::computeCollapsedEndBorder const):
(WebCore::RenderTableCell::computeCollapsedBeforeBorder const):
(WebCore::RenderTableCell::computeCollapsedAfterBorder const):
(WebCore::RenderTableCell::paintBackgroundsBehindCell):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::paintRowGroupBorder):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paintSliderTicks):
* rendering/TextDecorationPainter.cpp:
(WebCore::decorationColor):
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle):
* rendering/mathml/MathOperator.cpp:
(WebCore::MathOperator::paint):
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::paint):
* rendering/mathml/RenderMathMLMenclose.cpp:
(WebCore::RenderMathMLMenclose::paint):
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::paint):
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::RenderMathMLToken::paint):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::visitedDependentColorWithColorFilter const):
(WebCore::RenderStyle::colorByApplyingColorFilter const):
* rendering/style/RenderStyle.h:

Source/WebKitLegacy/mac:

The body background should reflect the filtered color.

* WebView/WebFrame.mm:
(-[WebFrame _bodyBackgroundColor]):
* WebView/WebView.mm:
(-[WebView updateTextTouchBar]): No logic change, just cleanup.

LayoutTests:

Tests for color-filter rendering.

* css3/color-filters/color-filter-backgrounds-borders-expected.html: Added.
* css3/color-filters/color-filter-backgrounds-borders.html: Added.
* css3/color-filters/color-filter-box-shadow-expected.html: Added.
* css3/color-filters/color-filter-box-shadow.html: Added.
* css3/color-filters/color-filter-brightness-expected.html: Added.
* css3/color-filters/color-filter-brightness.html: Added.
* css3/color-filters/color-filter-color-property-expected.html: Added.
* css3/color-filters/color-filter-color-property-list-item-expected.html: Added.
* css3/color-filters/color-filter-color-property-list-item.html: Added.
* css3/color-filters/color-filter-color-property.html: Added.
* css3/color-filters/color-filter-color-text-decorations-expected.html: Added.
* css3/color-filters/color-filter-color-text-decorations.html: Added.
* css3/color-filters/color-filter-column-rule-expected.html: Added.
* css3/color-filters/color-filter-column-rule.html: Added.
* css3/color-filters/color-filter-contrast-expected.html: Added.
* css3/color-filters/color-filter-contrast.html: Added.
* css3/color-filters/color-filter-current-color-expected.html: Added.
* css3/color-filters/color-filter-current-color.html: Added.
* css3/color-filters/color-filter-filter-list-expected.html: Added.
* css3/color-filters/color-filter-filter-list.html: Added.
* css3/color-filters/color-filter-grayscale-expected.html: Added.
* css3/color-filters/color-filter-grayscale.html: Added.
* css3/color-filters/color-filter-hue-rotate-expected.html: Added.
* css3/color-filters/color-filter-hue-rotate.html: Added.
* css3/color-filters/color-filter-inherits-expected.html: Added.
* css3/color-filters/color-filter-inherits.html: Added.
* css3/color-filters/color-filter-invert-expected.html: Added.
* css3/color-filters/color-filter-invert.html: Added.
* css3/color-filters/color-filter-opacity-expected.html: Added.
* css3/color-filters/color-filter-opacity.html: Added.
* css3/color-filters/color-filter-outline-expected.html: Added.
* css3/color-filters/color-filter-outline.html: Added.
* css3/color-filters/color-filter-saturate-expected.html: Added.
* css3/color-filters/color-filter-saturate.html: Added.
* css3/color-filters/color-filter-sepia-expected.html: Added.
* css3/color-filters/color-filter-sepia.html: Added.
* css3/color-filters/color-filter-text-emphasis-expected.html: Added.
* css3/color-filters/color-filter-text-emphasis.html: Added.

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

15 months agoUnreviewed build fix; fix WebInspectorUI copy resources step after r231063.
jer.noble@apple.com [Thu, 26 Apr 2018 23:30:21 +0000 (23:30 +0000)]
Unreviewed build fix; fix WebInspectorUI copy resources step after r231063.

* Configurations/Base.xcconfig:

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

15 months agoAdd timeout for ensurePositionInformationIsUpToDate
megan_gardner@apple.com [Thu, 26 Apr 2018 23:27:19 +0000 (23:27 +0000)]
Add timeout for ensurePositionInformationIsUpToDate
https://bugs.webkit.org/show_bug.cgi?id=184567

Reviewed by Wenson Hsieh.

We are having long hang times for WebKit, and this is one of the culprits.
If we do not get an answer for positionInformation in a reasonable amount of time, we should timeout,
so as to not hang the UI.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView ensurePositionInformationIsUpToDate:]):

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

15 months agoGardening: Speculative build fix for Windows.
mark.lam@apple.com [Thu, 26 Apr 2018 22:59:04 +0000 (22:59 +0000)]
Gardening: Speculative build fix for Windows.
https://bugs.webkit.org/show_bug.cgi?id=184976
<rdar://problem/39723901>

Not reviewed.

Source/JavaScriptCore:

* runtime/JSCPtrTag.h:

Source/WebCore:

* cssjit/CSSPtrTag.h:

Source/WTF:

* wtf/PtrTag.h:
(WTF::makePtrTagHash): Undo last speculative build fix that did not work for 64-bit.

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

15 months agoShow punycode if URL contains Latin small letter o with dot below character
bfulgham@apple.com [Thu, 26 Apr 2018 22:50:55 +0000 (22:50 +0000)]
Show punycode if URL contains Latin small letter o with dot below character
https://bugs.webkit.org/show_bug.cgi?id=185051
<rdar://problem/39459297>

Reviewed by David Kilzer.

Source/WebCore:

Revise our "lookalike character" logic to include the small Latin o
with dot below character.

Test: fast/url/host.html

* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::isLookalikeCharacter):

LayoutTests:

* fast/url/host-expected.txt:
* fast/url/host.html:

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

15 months agoGardening: Windows build fix.
mark.lam@apple.com [Thu, 26 Apr 2018 21:53:28 +0000 (21:53 +0000)]
Gardening: Windows build fix.

Not reviewed.

* runtime/Options.cpp:

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

15 months agoTry again to fix the iOS build after r231063.
aestes@apple.com [Thu, 26 Apr 2018 21:48:32 +0000 (21:48 +0000)]
Try again to fix the iOS build after r231063.

* Configurations/Base.xcconfig:

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

15 months ago[iOS] LayoutTest http/tests/quicklook/hide-referer-on-navigation.html is failing
commit-queue@webkit.org [Thu, 26 Apr 2018 21:41:39 +0000 (21:41 +0000)]
[iOS] LayoutTest http/tests/quicklook/hide-referer-on-navigation.html is failing
https://bugs.webkit.org/show_bug.cgi?id=184825
<rdar://problem/38924997>

Patch by Sihui Liu <sihui_liu@apple.com> on 2018-04-26
Reviewed by Geoffrey Garen.

Policy decisions are made asynchronously now, so we need to set the async flag of this test.

* http/tests/quicklook/hide-referer-on-navigation.html:

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

15 months agoWK_COCOA_TOUCH the WK_ACCESSIBILITY_LDFLAGS
jer.noble@apple.com [Thu, 26 Apr 2018 21:40:31 +0000 (21:40 +0000)]
WK_COCOA_TOUCH the WK_ACCESSIBILITY_LDFLAGS
https://bugs.webkit.org/show_bug.cgi?id=185007
<rdar://problem/39735943>

Reviewed by Timothy Hatcher.

* Configurations/WebKit.xcconfig:

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

15 months agoUnreviewed build fix; fix iOS TAPI build step after r231063.
jer.noble@apple.com [Thu, 26 Apr 2018 21:32:05 +0000 (21:32 +0000)]
Unreviewed build fix; fix iOS TAPI build step after r231063.

* Configurations/WebKit.xcconfig:

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

15 months agoAdd release bots for WinCairo.
ross.kirsling@sony.com [Thu, 26 Apr 2018 21:26:19 +0000 (21:26 +0000)]
Add release bots for WinCairo.
https://bugs.webkit.org/show_bug.cgi?id=185042

Reviewed by Lucas Forschler.

* BuildSlaveSupport/build.webkit.org-config/config.json:
Add a release build bot and two test bots, replacing the outdated WinCairo release bots.

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

15 months agoFix the build following r231068
dbates@webkit.org [Thu, 26 Apr 2018 20:50:16 +0000 (20:50 +0000)]
Fix the build following r231068
(https://bugs.webkit.org/show_bug.cgi?id=185002)

Substitute mainResourceRequest.resourceRequest().url() for mainResourceRequest.url() as the
latter does not exist.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::loadMainResource):

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

15 months agoDocumentLoader::loadMainResource() should WTFMove() the passed ResourceRequest
dbates@webkit.org [Thu, 26 Apr 2018 20:43:32 +0000 (20:43 +0000)]
DocumentLoader::loadMainResource() should WTFMove() the passed ResourceRequest
https://bugs.webkit.org/show_bug.cgi?id=185002

Reviewed by Youenn Fablet and Alex Christensen.

In r224852 we extracted logic from DocumentLoader::startLoadingMainResource() into a new
function DocumentLoader::loadMainResource() that could be shared by both DocumentLoader::startLoadingMainResource()
and the service worker code. As part of this extraction, DocumentLoader::loadMainResource()
takes a ResourceRequest by rvalue reference, but it never actually takes ownership of this
ResourceRequest and subsequently makes a copy of it when instantiating a CachedResourceRequest.
Instead we should WTFMove() the passed request into the CachedResourceRequest.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::loadMainResource):

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

15 months ago-[WKHTTPCookieStore deleteCookie:completionHandler:] doesn't delete cookies
commit-queue@webkit.org [Thu, 26 Apr 2018 20:39:47 +0000 (20:39 +0000)]
-[WKHTTPCookieStore deleteCookie:completionHandler:] doesn't delete cookies
https://bugs.webkit.org/show_bug.cgi?id=184938
<rdar://problem/34737395>

Patch by Sihui Liu <sihui_liu@apple.com> on 2018-04-26
Reviewed by Geoffrey Garen.

Source/WebCore:

When a Cookie object was converted to NSHTTPCookie object, the HTTPOnly property information
was lost so the delete function cannot find the proper cookie to delete.
This patch implements a workaround that compares Cookie object instead of NSHTTPCookie
object. We might want to add the ability to set HTTPOnly header during conversion if there
is an easy way to do it later.

New API test: WebKit.WKHTTPCookieStoreHttpOnly

* platform/network/cocoa/CookieCocoa.mm:
(WebCore::Cookie::operator== const):
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::deleteCookie):

Tools:

Add API test coverage.

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

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

15 months agoUnreviewed, rolling out r231052.
commit-queue@webkit.org [Thu, 26 Apr 2018 20:36:48 +0000 (20:36 +0000)]
Unreviewed, rolling out r231052.
https://bugs.webkit.org/show_bug.cgi?id=185044

Broke test http/tests/security/credentials-main-resource.html
(Requested by dydz on #webkit).

Reverted changeset:

"DocumentLoader::loadMainResource() should WTFMove() the
passed ResourceRequest"
https://bugs.webkit.org/show_bug.cgi?id=185002
https://trac.webkit.org/changeset/231052

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

15 months agoMark http/tests/workers/worker-importScripts-banned-mimetype.html as flaky.
ryanhaddad@apple.com [Thu, 26 Apr 2018 20:19:39 +0000 (20:19 +0000)]
Mark http/tests/workers/worker-importScripts-banned-mimetype.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=184800

Unreviewed test gardening.

* TestExpectations:

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

15 months agoWinCairo test bots should run JSC tests with options for Windows command prompt.
ross.kirsling@sony.com [Thu, 26 Apr 2018 19:19:57 +0000 (19:19 +0000)]
WinCairo test bots should run JSC tests with options for Windows command prompt.
https://bugs.webkit.org/show_bug.cgi?id=185019

Reviewed by Per Arne Vollan.

* BuildSlaveSupport/build.webkit.org-config/steps.py:
(RunJavaScriptCoreTests.start):

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

15 months agoWK_COCOA_TOUCH all the things.
jer.noble@apple.com [Thu, 26 Apr 2018 19:15:20 +0000 (19:15 +0000)]
WK_COCOA_TOUCH all the things.
https://bugs.webkit.org/show_bug.cgi?id=185006
Source/JavaScriptCore:

<rdar://problem/39736025>

Reviewed by Tim Horton.

* Configurations/Base.xcconfig:

Source/WebCore:

Reviewed by Tim Horton.

* Configurations/WebCore.xcconfig:

Source/WebCore/PAL:

Reviewed by Tim Horton.

* Configurations/PAL.xcconfig:

Source/WebInspectorUI:

Reviewed by Tim Horton.

* Configurations/WebInspectorUIFramework.xcconfig:

Source/WebKit:

Reviewed by Tim Horton.

* Configurations/BaseTarget.xcconfig:
* Configurations/WebKit.xcconfig:

Source/WebKitLegacy/mac:

Reviewed by Tim Horton.

* Configurations/WebKitLegacy.xcconfig:

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

15 months agoASSERTION FAILED: ASSERT(!containsImage || MIMETypeRegistry::isSupportedImageResource...
dbates@webkit.org [Thu, 26 Apr 2018 18:46:42 +0000 (18:46 +0000)]
ASSERTION FAILED: ASSERT(!containsImage || MIMETypeRegistry::isSupportedImageResourceMIMEType([resource MIMEType])) in -[NSPasteboard(WebExtras) _web_writePromisedRTFDFromArchive:containsImage:]
https://bugs.webkit.org/show_bug.cgi?id=184161
<rdar://problem/39051645>

Reviewed by Dan Bernstein.

.:

* ManualTests/DragInlinePDFImageDocument.html: Added.
* ManualTests/resources/simple.pdf: Added.

Source/WebKitLegacy/mac:

Fixes an assertion failure when quitting an app that uses a Legacy WebKit web view after dragging-and-
dropping a PDF embedded using an HTML image element into the same web view.

When performing a drag-and-drop of a PDF document image (WebCore::PDFDocumentImage) we create a WebArchive
from the main frame's WebHTMLView and promise AppKit that we will provide a Rich Text Format (RTF) document
from this archive if needed. For some reason, on app termination AppKit requests that the WebHTMLView
fulfill its RTF document promise for the WebArchive created at the start of the drag operation. To do this,
we need to extract the image resource from the Web Archive. Currently we query MIMETypeRegistry::isSupportedImageResourceMIMEType()
to see if the contained image is one that we can handle. However MIMETypeRegistry::isSupportedImageResourceMIMEType()
only returns true if WebKit supports creating an image document for the specified MIME type. Disregarding
the iOS motivated setting Settings::useImageDocumentForSubframePDF, PDFs and PostScripts do not create an
image document when navigated to directly. Since we can support dragging PDF document images we need to
query if MIMETypeRegistry::isPDFOrPostScriptMIMEType() in addition to querying MIMETypeRegistry::isSupportedImageResourceMIMEType().
We need to do both such queries before falling back to using the main resource of the Web Archive as
the image. Otherwise, we will cause an assertion failure if the main resource of the Web Archive is
not an image document.

* Misc/WebNSPasteboardExtras.mm:
(-[NSPasteboard _web_writePromisedRTFDFromArchive:containsImage:]):

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

15 months agoRemove WebCore::-qualifier in NetworkLoadChecker.cpp
dbates@webkit.org [Thu, 26 Apr 2018 18:42:01 +0000 (18:42 +0000)]
Remove WebCore::-qualifier in NetworkLoadChecker.cpp
https://bugs.webkit.org/show_bug.cgi?id=185037

Reviewed by Youenn Fablet.

It is unncesssary to qualify WebCore types in NetworkLoadChecker.cpp as it has a
"using namespace WebCore" directive.

* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::NetworkLoadChecker):
(WebKit::NetworkLoadChecker::checkRedirection):
(WebKit::NetworkLoadChecker::validateResponse):
(WebKit::NetworkLoadChecker::continueCheckingRequest): Removed extra space character and unnecessary
parentheses from the right-hand side of the assignment to m_storedCredentialsPolicy.
(WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):

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

15 months agoRename NetworkLoadChecker::returnError() to NetworkLoadChecker::accessControlErrorFor...
dbates@webkit.org [Thu, 26 Apr 2018 18:29:25 +0000 (18:29 +0000)]
Rename NetworkLoadChecker::returnError() to NetworkLoadChecker::accessControlErrorForValidationHandler()
https://bugs.webkit.org/show_bug.cgi?id=185035

Reviewed by Youenn Fablet.

Substitute NetworkLoadChecker::accessControlErrorForValidationHandler() for NetworkLoadChecker::returnError()
to better describe that it is a convenience function that returns a wrapped ResourceError object,
that represents an access control error, suitable to be passed directly to a validation handler.

* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::checkRedirection): Update as needed for renaming.
(WebKit::NetworkLoadChecker::accessControlErrorForValidationHandler): Use auto -> syntax to avoid the need to
class-qualify the return type. Also renamed parameter from error to message as it represents the message/description
for the access control error.
(WebKit::NetworkLoadChecker::checkRequest): Update as needed for renaming. Also substitute "message" for "error"
to match the argument of accessControlErrorForValidationHandler() with the same name.
(WebKit::NetworkLoadChecker::continueCheckingRequest): Update as needed for renaming.
(WebKit::NetworkLoadChecker::returnError): Deleted; renamed to accessControlErrorForValidationHandler().
* NetworkProcess/NetworkLoadChecker.h:

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

15 months agoMake WAKScrollView delegate a weak property
ddkilzer@apple.com [Thu, 26 Apr 2018 18:22:03 +0000 (18:22 +0000)]
Make WAKScrollView delegate a weak property
<https://webkit.org/b/184799>
<rdar://problem/39469669>

Reviewed by Simon Fraser.

* platform/ios/wak/WAKScrollView.h:
- Remove `delegate` instance variable declaration.
- Declare `delegate` property as weak.
(-[WAKScrollView setDelegate:]): Delete declaration.
(-[WAKScrollView delegate]): Ditto.
* platform/ios/wak/WAKScrollView.mm:
- Synthesize getter/setter methods for `delegate` property.
(-[WAKScrollView setDelegate:]): Delete implementation.
(-[WAKScrollView delegate]): Ditto.

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

15 months agoRemove access to keychain from the WebContent process
jiewen_tan@apple.com [Thu, 26 Apr 2018 18:20:50 +0000 (18:20 +0000)]
Remove access to keychain from the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=184428
<rdar://problem/13150903>

Part 3.

Tighten WebContent Process' sandbox profile to all Security.framework services.

Reviewed by Brent Fulgham.

* WebProcess/com.apple.WebProcess.sb.in:

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

15 months agoLayoutTests/imported/w3c:
youenn@apple.com [Thu, 26 Apr 2018 18:17:55 +0000 (18:17 +0000)]
LayoutTests/imported/w3c:
preflight checker should add a console message when preflight load is blocked
https://bugs.webkit.org/show_bug.cgi?id=185021

Reviewed by Chris Dumez.

* web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-expected.txt:
* web-platform-tests/cors/late-upload-events-expected.txt:

Source/WebCore:
CORS preflight checker should add a console message when preflight load is blocked
https://bugs.webkit.org/show_bug.cgi?id=185021

Reviewed by Chris Dumez.

No change of behavior, adding a JS console message when preflight load is blocked.
This mirrors what is being done in preflighting done from NetworkProcess.
Covered by existing tests.

* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::notifyFinished):
(WebCore::CrossOriginPreflightChecker::doPreflight):

LayoutTests:
CORS preflight checker should add a console message when preflight load is blocked
https://bugs.webkit.org/show_bug.cgi?id=185021

Reviewed by Chris Dumez.

* TestExpectations: Skipping console JS logging for some WPT tests to keep them consistent between WK1 and WK2.
* http/tests/xmlhttprequest/redirect-cross-origin-post-expected.txt:
* http/tests/xmlhttprequest/simple-cross-origin-denied-events-post-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-cors-basic-setrequestheader-expected.txt: Removed.
* platform/mac-wk1/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred-expected.txt: Removed.
* platform/mac-wk1/imported/w3c/web-platform-tests/cors/request-headers-expected.txt: Removed.
* platform/win/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-cors-basic-setrequestheader-expected.txt: Removed.
* platform/win/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred-expected.txt: Removed.
* platform/win/imported/w3c/web-platform-tests/cors/request-headers-expected.txt: Removed.

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

15 months agoLayoutTests/imported/w3c:
youenn@apple.com [Thu, 26 Apr 2018 18:16:55 +0000 (18:16 +0000)]
LayoutTests/imported/w3c:
Mak cross origin redirection error messages consistent between SubresourceLoader and NetworkLoadChecker
https://bugs.webkit.org/show_bug.cgi?id=185023

Reviewed by Chris Dumez.

Fix message cross origin check failed in case of redirection

* web-platform-tests/service-workers/service-worker/fetch-request-fallback.https-expected.txt:

Source/WebKit:
Make cross origin redirection error messages consistent between SubresourceLoader and NetworkLoadChecker
https://bugs.webkit.org/show_bug.cgi?id=185023

Reviewed by Chris Dumez.

Align NetworkLoadChecker with what SubresourceLoader is doing so that we can keep WK1 and WK2 error messages as consistent as possible.

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

LayoutTests:
Make cross origin redirection error messages consistent between SubresourceLoader and NetworkLoadChecker
https://bugs.webkit.org/show_bug.cgi?id=185023

Reviewed by Chris Dumez.

* http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-redirect-expected.txt:
* http/tests/security/shape-image-cors-redirect-error-message-logging-1-expected.txt:
* http/tests/security/shape-image-cors-redirect-error-message-logging-2-expected.txt:
* platform/mac-wk1/http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-redirect-expected.txt: Removed.
* platform/mac-wk1/http/tests/security/shape-image-cors-redirect-error-message-logging-1-expected.txt: Removed.
* platform/mac-wk1/http/tests/security/shape-image-cors-redirect-error-message-logging-2-expected.txt: Removed.
* platform/win/http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-redirect-expected.txt: Removed.
* platform/win/http/tests/security/shape-image-cors-redirect-error-message-logging-1-expected.txt: Removed.
* platform/win/http/tests/security/shape-image-cors-redirect-error-message-logging-2-expected.txt: Removed.

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

15 months agoActivate selection when interacting with editable content
megan_gardner@apple.com [Thu, 26 Apr 2018 18:05:20 +0000 (18:05 +0000)]
Activate selection when interacting with editable content
https://bugs.webkit.org/show_bug.cgi?id=185017

Reviewed by Tim Horton.

Source/WebKit:

Fixes a regression from r231016 where selection now does not work when interacting with
editable content. When we go into editable content, we should turn on the assistant.
This fulfills the requirement of user interaction as well, so any javascript selections
after this point should be valid.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _startAssistingKeyboard]):
(-[WKContentView _stopAssistingKeyboard]):

LayoutTests:

Fixed double-tap-on-editable-and-noneditable test, as it was not actually written correctly.
Should actually double tap on correct content and check for the correct output now.
Added two more tests to make sure that selections really are happening in editable content.

* fast/events/touch/ios/double-tap-on-editable-and-noneditable.html:
* fast/events/touch/ios/double-tap-on-editable-content-for-selection-expected.txt: Added.
* fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-right-to-change-selected-text-expected.txt: Added.
* fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-right-to-change-selected-text.html: Added.
* fast/events/touch/ios/double-tap-on-editable-content-for-selection.html: Added.

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

15 months agoWinCairo WKL Debug Test bot is not using DRT.
ross.kirsling@sony.com [Thu, 26 Apr 2018 17:54:42 +0000 (17:54 +0000)]
WinCairo WKL Debug Test bot is not using DRT.
https://bugs.webkit.org/show_bug.cgi?id=185009

Reviewed by Per Arne Vollan.

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

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

15 months agoDocumentLoader::loadMainResource() should WTFMove() the passed ResourceRequest
dbates@webkit.org [Thu, 26 Apr 2018 17:46:32 +0000 (17:46 +0000)]
DocumentLoader::loadMainResource() should WTFMove() the passed ResourceRequest
https://bugs.webkit.org/show_bug.cgi?id=185002

Reviewed by Youenn Fablet and Alex Christensen.

In r224852 we extracted logic from DocumentLoader::startLoadingMainResource() into a new
function DocumentLoader::loadMainResource() that could be shared by both DocumentLoader::startLoadingMainResource()
and the service worker code. As part of this extraction, DocumentLoader::loadMainResource()
takes a ResourceRequest by rvalue reference, but it never actually takes ownership of this
ResourceRequest and subsequently makes a copy of it when instantiating a CachedResourceRequest.
Instead we should WTFMove() the passed request into the CachedResourceRequest.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::loadMainResource):

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

15 months agoDisable content filtering in minimal simulator mode
pvollan@apple.com [Thu, 26 Apr 2018 17:29:16 +0000 (17:29 +0000)]
Disable content filtering in minimal simulator mode
https://bugs.webkit.org/show_bug.cgi?id=185027
<rdar://problem/39736091>

Reviewed by Jer Noble.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

15 months agoAdd port 548 (afpovertcp) to port blacklist
bfulgham@apple.com [Thu, 26 Apr 2018 17:12:46 +0000 (17:12 +0000)]
Add port 548 (afpovertcp) to port blacklist
https://bugs.webkit.org/show_bug.cgi?id=185000
<rdar://problem/39540481>

Reviewed by David Kilzer.

Source/WebCore:

Tested by security/block-test.html.

* platform/URL.cpp:
(WebCore::portAllowed):Also block port 548.

LayoutTests:

Update test and expectations for new port.

* platform/gtk/security/block-test-expected.txt:
* platform/mac/security/block-test-expected.txt:
* platform/wpe/security/block-test-expected.txt:
* security/block-test-expected.txt:
* security/block-test.html:

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

15 months ago[WPE] Gardening of tests for the WPE Debug bot.
clopez@igalia.com [Thu, 26 Apr 2018 16:48:45 +0000 (16:48 +0000)]
[WPE] Gardening of tests for the WPE Debug bot.

Mark tests timing out.
An attempt to make the new WPE debug bot not abort early.

* platform/gtk/TestExpectations: workers/bomb.html for debug was skipped in the root expectations file,
  but we were overriding it to simply "slow" here because we missed the tag for release.
  Let's put both expectations together to make this clearer.
* platform/wpe/TestExpectations: Ditto.

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

15 months agoAdd a setting for keeping around all processes and always reusing them per-origin.
beidson@apple.com [Thu, 26 Apr 2018 16:39:21 +0000 (16:39 +0000)]
Add a setting for keeping around all processes and always reusing them per-origin.
<rdar://problem/39695798> and https://bugs.webkit.org/show_bug.cgi?id=185020

Reviewed by Andy Estes.

Source/WebKit:

* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:

* UIProcess/API/C/WKContextConfigurationRef.cpp:
(WKContextConfigurationAlwaysKeepAndReuseSwappedProcesses):
(WKContextConfigurationSetAlwaysKeepAndReuseSwappedProcesses):
* UIProcess/API/C/WKContextConfigurationRef.h:

* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration setAlwaysKeepAndReuseSwappedProcesses:]):
(-[_WKProcessPoolConfiguration alwaysKeepAndReuseSwappedProcesses]):

* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::webProcessDidClose):
(WebKit::SuspendedPageProxy::destroyWebPageInWebProcess):
* UIProcess/SuspendedPageProxy.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::suspendedPageClosed):
(WebKit::WebPageProxy::suspendedPageProcessClosed): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::suspendedPage const):

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::shouldTerminate):
(WebKit::WebProcessPool::disconnectProcess):
(WebKit::WebProcessPool::addProcessToOriginCacheSet):
(WebKit::WebProcessPool::removeProcessFromOriginCacheSet):
(WebKit::WebProcessPool::processForNavigation): If a swap will occur, cache the old process.
(WebKit::WebProcessPool::processForNavigationInternal): Consider re-using a previously cached process.
* UIProcess/WebProcessPool.h:

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

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

15 months ago[INTL] Implement Intl.PluralRules
commit-queue@webkit.org [Thu, 26 Apr 2018 16:37:26 +0000 (16:37 +0000)]
[INTL] Implement Intl.PluralRules
https://bugs.webkit.org/show_bug.cgi?id=184312

Patch by Andy VanWagoner <thetalecrafter@gmail.com> on 2018-04-26
Reviewed by JF Bastien.

.:

Added Intl.PluralRules feature flag.

* Source/cmake/WebKitFeatures.cmake:

Source/JavaScriptCore:

Use UNumberFormat to enforce formatting, and then UPluralRules to find
the correct plural rule for the given number. Relies on ICU v59+ for
resolvedOptions().pluralCategories and trailing 0 detection.
Behind the useIntlPluralRules option and INTL_PLURAL_RULES flag.

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* builtins/BuiltinNames.h:
* runtime/BigIntObject.cpp:
(JSC::BigIntObject::create): Moved to ensure complete JSGlobalObject definition.
* runtime/BigIntObject.h:
* runtime/CommonIdentifiers.h:
* runtime/IntlObject.cpp:
(JSC::IntlObject::finishCreation):
* runtime/IntlObject.h:
* runtime/IntlPluralRules.cpp: Added.
(JSC::IntlPluralRules::UPluralRulesDeleter::operator() const):
(JSC::IntlPluralRules::UNumberFormatDeleter::operator() const):
(JSC::UEnumerationDeleter::operator() const):
(JSC::IntlPluralRules::create):
(JSC::IntlPluralRules::createStructure):
(JSC::IntlPluralRules::IntlPluralRules):
(JSC::IntlPluralRules::finishCreation):
(JSC::IntlPluralRules::destroy):
(JSC::IntlPluralRules::visitChildren):
(JSC::IntlPRInternal::localeData):
(JSC::IntlPluralRules::initializePluralRules):
(JSC::IntlPluralRules::resolvedOptions):
(JSC::IntlPluralRules::select):
* runtime/IntlPluralRules.h: Added.
* runtime/IntlPluralRulesConstructor.cpp: Added.
(JSC::IntlPluralRulesConstructor::create):
(JSC::IntlPluralRulesConstructor::createStructure):
(JSC::IntlPluralRulesConstructor::IntlPluralRulesConstructor):
(JSC::IntlPluralRulesConstructor::finishCreation):
(JSC::constructIntlPluralRules):
(JSC::callIntlPluralRules):
(JSC::IntlPluralRulesConstructorFuncSupportedLocalesOf):
(JSC::IntlPluralRulesConstructor::visitChildren):
* runtime/IntlPluralRulesConstructor.h: Added.
* runtime/IntlPluralRulesPrototype.cpp: Added.
(JSC::IntlPluralRulesPrototype::create):
(JSC::IntlPluralRulesPrototype::createStructure):
(JSC::IntlPluralRulesPrototype::IntlPluralRulesPrototype):
(JSC::IntlPluralRulesPrototype::finishCreation):
(JSC::IntlPluralRulesPrototypeFuncSelect):
(JSC::IntlPluralRulesPrototypeFuncResolvedOptions):
* runtime/IntlPluralRulesPrototype.h: Added.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::intlPluralRulesAvailableLocales):
* runtime/JSGlobalObject.h:
* runtime/Options.h:
* runtime/RegExpPrototype.cpp: Added inlines header.
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

Source/WebCore:

Added Intl.PluralRules feature flag.

Test: js/intl-pluralrules.html

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

Added Intl.PluralRules feature flag.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

Added Intl.PluralRules feature flag.

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

Added Intl.PluralRules feature flag.

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

Added Intl.PluralRules feature flag.

* wtf/FeatureDefines.h:

Tools:

Added Intl.PluralRules feature flag.

* Scripts/webkitperl/FeatureList.pm:
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

LayoutTests:

* js/intl-pluralrules-expected.txt: Added.
* js/intl-pluralrules.html: Added.
* js/script-tests/intl-pluralrules.js: Added.
* platform/win/TestExpectations: Disabled Intl.PluralRules tests on win.

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

15 months ago[Cocoa] Adopt CCRSAGetCRTComponents and stop using CCBigNum
darin@apple.com [Thu, 26 Apr 2018 16:14:37 +0000 (16:14 +0000)]
[Cocoa] Adopt CCRSAGetCRTComponents and stop using CCBigNum
https://bugs.webkit.org/show_bug.cgi?id=184637

Reviewed by Alexey Proskuryakov.

* crypto/CommonCryptoUtilities.cpp: Compile out WebCore::CCBigNum class if
HAVE(CCRSAGetCRTComponents) is true.

* crypto/CommonCryptoUtilities.h: Define HAVE(CCRSAGetCRTComponents) on new
enough versions of iOS and macOS that have it and add declarations of the
function for the non-Apple-internal-SDK case. Also don't define the
WebCore::CCBigNum class if HAVE(CCRSAGetCRTComponents) is true.

* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::getPrivateKeyComponents): Use CCRSAGetCRTComponents if present.

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

15 months agoAdd lazy initialization of caption display mode for videos.
pvollan@apple.com [Thu, 26 Apr 2018 15:04:16 +0000 (15:04 +0000)]
Add lazy initialization of caption display mode for videos.
https://bugs.webkit.org/show_bug.cgi?id=184993

The call to MACaptionAppearanceGetDisplayType in CaptionUserPreferencesMediaAF::captionDisplayMode()
is showing up in samples when called from HTMLMediaElement::finishInitialization().

Reviewed by Eric Carlson.

No new tests, covered by existing tests.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::finishInitialization):
(WebCore::HTMLMediaElement::setSelectedTextTrack):
(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
(WebCore::HTMLMediaElement::captionPreferencesChanged):
(WebCore::HTMLMediaElement::captionDisplayMode):
* html/HTMLMediaElement.h:

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

15 months ago[MIPS] Fix branch offsets in branchNeg32
commit-queue@webkit.org [Thu, 26 Apr 2018 12:04:22 +0000 (12:04 +0000)]
[MIPS] Fix branch offsets in branchNeg32
https://bugs.webkit.org/show_bug.cgi?id=185025

Patch by Dominik Infuehr <dinfuehr@igalia.com> on 2018-04-26
Reviewed by Yusuke Suzuki.

Two nops were removed in branch(Not)Equal in #183130 but the offset wasn't adjusted.

* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::branchNeg32):

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

15 months ago[GTK][WPE] Initial ASYNC_SCROLLING support
zandobersek@gmail.com [Thu, 26 Apr 2018 07:54:19 +0000 (07:54 +0000)]
[GTK][WPE] Initial ASYNC_SCROLLING support
https://bugs.webkit.org/show_bug.cgi?id=184961

Reviewed by Carlos Garcia Campos.

.:

* Source/cmake/OptionsGTK.cmake: Enable ASYNC_SCROLLING as a private option.
* Source/cmake/OptionsWPE.cmake: Ditto.

Source/WebCore:

Add CoordinatedGraphics-specific code that will be required for async
scrolling support. The ScrollingCoordinatorCoordinatedGraphics and
ScrollingTreeCoordinatedGraphics classes are mostly complete already,
but the new ScrollingTreeNode-inheriting classes will need further
work that will have to be done in parallel with other improvements
planned for the CoordinatedGraphics subsystem.

While the build-time flag is enabled, the feature is still not enabled
at runtime due to being marked as unsupported by the DrawingArea
implementation in the WebKit layer. It would also not work yet if it
were enabled due to the before-mentioned pending changes.

Various build fixes that address non-Cocoa usage of ASYNC_SCROLLING
code are included.

* Sources.txt: Add AsyncScrollingCoordinator.cpp to build.
* SourcesCocoa.txt:
* SourcesGTK.txt: Add new files to build.
* SourcesWPE.txt: Ditto.
* page/scrolling/AsyncScrollingCoordinator.cpp:
Guard setStateScrollingNodeSnapOffsetsAsFloat() with CSS_SCROLL_SNAP.
* page/scrolling/ScrollingTree.h:
* page/scrolling/ThreadedScrollingTree.cpp:
* page/scrolling/ThreadedScrollingTree.h:
currentSnapPointIndicesDidChange() method is only invoked in
Cocoa-specific code, and its implementation calls Cocoa-specific method
on the AsyncScrollingCoordinator class.
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
(WebCore::ScrollingCoordinator::create):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::~ScrollingCoordinatorCoordinatedGraphics):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::pageDestroyed):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::commitTreeStateIfNeeded):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::handleWheelEvent):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::scheduleTreeStateCommit):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::commitTreeState):
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h: Added.
* page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp: Added.
(WebCore::ScrollingTreeCoordinatedGraphics::create):
(WebCore::ScrollingTreeCoordinatedGraphics::ScrollingTreeCoordinatedGraphics):
(WebCore::ScrollingTreeCoordinatedGraphics::createScrollingTreeNode):
* page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h: Added.
* page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp: Added.
(WebCore::ScrollingTreeFixedNode::create):
(WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode):
(WebCore::ScrollingTreeFixedNode::~ScrollingTreeFixedNode):
(WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
* page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h: Added.
* page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp: Added.
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::create):
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::ScrollingTreeFrameScrollingNodeCoordinatedGraphics):
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::handleWheelEvent):
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::scrollPosition const):
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPositionWithoutContentEdgeConstraints):
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollLayerPosition):
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::updateLayersAfterViewportChange):
* page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h: Added.
* page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp: Added.
(WebCore::ScrollingTreeStickyNode::create):
(WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode):
(WebCore::ScrollingTreeStickyNode::~ScrollingTreeStickyNode):
(WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
* page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h: Added.
* platform/PlatformWheelEvent.h: Enable PlatformWheelEventPhase code
for WPE. Guard latching-specific methods under ASYNC_SCROLLING.
* platform/TextureMapper.cmake: Two build targets have been moved to
SourcesGTK.txt and SourcesWPE.txt.

Source/WebKit:

Guard RemoteScrollingCoordinator and RemoteScrollingCoordinatorProxy
usage in WebChromeClient and WebPageProxy, respectively, with
PLATFORM(COCOA) in addition to the ASYNC_SCROLLING guards.

Despite enabling the code at build-time, the feature (as intended) is
not yet used because of the DrawingArea rejection in the WebPage
constructor.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::initializeWebPage):
(WebKit::WebPageProxy::handleWheelEvent):
(WebKit::WebPageProxy::updateTouchEventTracking):
* UIProcess/WebPageProxy.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createScrollingCoordinator const):

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

15 months ago[WPE] Build and link against latest WPEBackend and WPEBackend-fdo
mcatanzaro@igalia.com [Thu, 26 Apr 2018 06:40:04 +0000 (06:40 +0000)]
[WPE] Build and link against latest WPEBackend and WPEBackend-fdo
https://bugs.webkit.org/show_bug.cgi?id=184643

Reviewed by Žan Doberšek.

.:

Update find modules to include the API versions.

* Source/cmake/FindWPEBackend-fdo.cmake:
* Source/cmake/FindWPEBackend.cmake:

Source/WebCore:

Adapt to single-header WPE includes.

* platform/graphics/egl/GLContextEGLWPE.cpp:
* platform/graphics/wpe/PlatformDisplayWPE.cpp:
* platform/wpe/PlatformPasteboardWPE.cpp:

Source/WebKit:

Adapt to single-header WPE includes.

Null-initialize padding to silence -Wmissing-field-initializers. (Yuck.)

* Shared/NativeWebTouchEvent.h:
* Shared/wpe/WebEventFactory.cpp:
* UIProcess/API/glib/WebKitPrivate.cpp:
* UIProcess/API/wpe/CompositingManagerProxy.cpp:
* UIProcess/API/wpe/ScrollGestureController.h:
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::m_backend):
* UIProcess/API/wpe/WebKitWebViewBackend.h:
* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
* WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
(WebKit::AcceleratedSurfaceWPE::initialize):

Tools:

Add missing INCLUDE_DIRS in many places.

Adapt to single-header WPE includes.

Null-initialize padding to silence -Wmissing-field-initializers. (Yuck.)

* TestWebKitAPI/PlatformWPE.cmake:
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp:
(testWebViewWebBackend):
* TestWebKitAPI/glib/PlatformWPE.cmake:
* WebKitTestRunner/EventSenderProxy.h:
* WebKitTestRunner/PlatformWPE.cmake:
* WebKitTestRunner/wpe/EventSenderProxyWPE.cpp:
* wpe/HeadlessViewBackend/CMakeLists.txt:
* wpe/HeadlessViewBackend/HeadlessViewBackend.cpp:
* wpe/HeadlessViewBackend/HeadlessViewBackend.h:
* wpe/jhbuild.modules:

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

15 months agodlopen the bundle's executable before calling -[NSBundle load] since that will also...
sbarati@apple.com [Thu, 26 Apr 2018 03:33:58 +0000 (03:33 +0000)]
dlopen the bundle's executable before calling -[NSBundle load] since that will also do a bunch of other things we don't need
https://bugs.webkit.org/show_bug.cgi?id=184904

Reviewed by Geoffrey Garen.

Loading an NSBundle does a lot of work to find the principal class inside
the bundle. This means it walks all the objective C class names loaded
by the bundle. Doing this is *really* expensive.

Some users of the injected bundle define a WKBundleInitialize function.
In such a case, we don't need the principal class, so we can skip loading
the NSBundle. Now, before we load the bundle, we dlopen and dlsym looking
for the WKBundleInitialize function. If we find it, we skip loading
the bundle. If we don't find the WKBundleInitialize function, we fall
back to loading the bundle and finding the principal class.

This speeds up initializeWebProcess by ~70ms on my MBP.

* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
(WebKit::InjectedBundle::initialize):

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

15 months agoUse NetworkLoadChecker for all subresource loads except fetch/XHR
youenn@apple.com [Thu, 26 Apr 2018 03:21:55 +0000 (03:21 +0000)]
Use NetworkLoadChecker for all subresource loads except fetch/XHR
https://bugs.webkit.org/show_bug.cgi?id=184870
<rdar://problem/39370034>

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/basic/mode-same-origin.any-expected.txt:
* web-platform-tests/fetch/api/basic/mode-same-origin.any.worker-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-to-dataurl-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-to-dataurl-worker-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-request-redirect.https-expected.txt:

Source/WebCore:

No change of behavior.
Update CachedResourceLoader error messages to match NetworkProcess error messages.

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::printAccessDeniedMessage const):

Source/WebKit:

Relax rules to check for non HTTP(s) redirections to throw only when WebProcess says to load it after redirection.
This allows WebProcess to load redirected non HTTP(s) URLs, such as data URLs.
We keep these checks when WebProcess asks to continue the load and for all PingLoads.

Update error messages to be more consistent with WK1.

* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::checkRedirection):
(WebKit::NetworkLoadChecker::continueCheckingRequest):
(WebKit::NetworkLoadChecker::validateResourceResponse):
(WebKit::NetworkLoadChecker::continueCheckingRequest):
* NetworkProcess/NetworkLoadChecker.h:
(WebKit::NetworkLoadChecker::validateResponse):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::shouldUseNetworkLoadChecker):
(WebKit::NetworkResourceLoader::continueWillSendRequest):

LayoutTests:

* TestExpectations:
* http/tests/security/contentSecurityPolicy/1.1/child-src/worker-redirect-blocked-expected.txt:
* http/tests/security/cross-origin-xsl-BLOCKED-expected.txt:
* http/tests/security/cross-origin-xsl-redirect-BLOCKED-expected.txt:
* http/tests/security/isolatedWorld/bypass-main-world-csp-worker-redirect-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-redirect-expected.txt:
* http/tests/security/shape-image-cors-redirect-error-message-logging-1-expected.txt:
* http/tests/security/shape-image-cors-redirect-error-message-logging-2-expected.txt:
* http/tests/security/worker-cross-origin-expected.txt:
* http/tests/security/xss-DENIED-xml-external-entity-expected.txt:
* http/tests/security/xss-DENIED-xsl-document-expected.txt:
* http/tests/security/xss-DENIED-xsl-external-entity-expected.txt:
* http/tests/workers/worker-redirect-expected.txt:
* http/tests/xmlhttprequest/access-control-and-redirects-expected.txt:
* http/tests/xmlhttprequest/redirect-cross-origin-post-sync-expected.txt:
* http/tests/xmlhttprequest/redirect-cross-origin-sync-expected.txt:
* http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt:
* platform/mac-wk1/http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-redirect-expected.txt: Added.
* platform/mac-wk1/http/tests/security/shape-image-cors-redirect-error-message-logging-1-expected.txt: Added.
* platform/mac-wk1/http/tests/security/shape-image-cors-redirect-error-message-logging-2-expected.txt: Added.
* platform/mac-wk1/http/tests/workers/worker-redirect-expected.txt: Added.
* platform/mac-wk1/http/tests/security/contentSecurityPolicy/1.1/child-src/worker-redirect-blocked-expected.txt: Added.
* platform/mac-wk1/http/tests/security/isolatedWorld/bypass-main-world-csp-worker-redirect-expected.txt: Added.
* platform/mac-wk1/http/tests/security/worker-cross-origin-expected.txt: Added.
* platform/mac-wk2/TestExpectations:
* platform/win/http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-redirect-expected.txt: Added.
* platform/win/http/tests/security/shape-image-cors-redirect-error-message-logging-1-expected.txt: Added.
* platform/win/http/tests/security/shape-image-cors-redirect-error-message-logging-2-expected.txt: Added.
* platform/win/http/tests/workers/worker-redirect-expected.txt: Added.
* platform/win/http/tests/security/contentSecurityPolicy/1.1/child-src/worker-redirect-blocked-expected.txt: Added.
* platform/win/http/tests/security/isolatedWorld/bypass-main-world-csp-worker-redirect-expected.txt: Added.
* platform/win/http/tests/security/worker-cross-origin-expected.txt: Added.

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

15 months agoREGRESSION (r230998): Bot watcher's dashboard doesn't display number of API test...
jbedard@apple.com [Thu, 26 Apr 2018 02:10:59 +0000 (02:10 +0000)]
REGRESSION (r230998): Bot watcher's dashboard doesn't display number of API test failures
https://bugs.webkit.org/show_bug.cgi?id=184982

Rubber-stamped by Aakash Jain.

Correctly count the number of API test failures.

* BuildSlaveSupport/build.webkit.org-config/steps.py:
(RunUnitTests.countFailures): Count the number of test failures for the new run-api-tests.
* BuildSlaveSupport/build.webkit.org-config/steps_unittest.py:
* Scripts/webkitpy/api_tests/manager.py:
(Manager.run): Disabled tests are not run.

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

15 months ago[LFC] Add support for is<> and downcast<>
zalan@apple.com [Thu, 26 Apr 2018 02:04:48 +0000 (02:04 +0000)]
[LFC] Add support for is<> and downcast<>
https://bugs.webkit.org/show_bug.cgi?id=185016

Reviewed by Antti Koivisto.

* layout/layouttree/LayoutBlockContainer.cpp:
(WebCore::Layout::BlockContainer::BlockContainer):
* layout/layouttree/LayoutBlockContainer.h:
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::Box):
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::isContainer const):
(WebCore::Layout::Box::isBlockContainer const):
(WebCore::Layout::Box::isInlineBox const):
(WebCore::Layout::Box::isInlineContainer const):
* layout/layouttree/LayoutContainer.cpp:
(WebCore::Layout::Container::Container):
* layout/layouttree/LayoutContainer.h:
* layout/layouttree/LayoutInlineBox.cpp:
(WebCore::Layout::InlineBox::InlineBox):
* layout/layouttree/LayoutInlineBox.h:
* layout/layouttree/LayoutInlineContainer.cpp:
(WebCore::Layout::InlineContainer::InlineContainer):
* layout/layouttree/LayoutInlineContainer.h:

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

15 months agowindow.postMessage() / focus() / blur() throw a TypeError when called on a RemoteDOMW...
cdumez@apple.com [Thu, 26 Apr 2018 00:55:49 +0000 (00:55 +0000)]
window.postMessage() / focus() / blur() throw a TypeError when called on a RemoteDOMWindow
https://bugs.webkit.org/show_bug.cgi?id=184981

Reviewed by Sam Weinig.

Source/WebCore:

window.postMessage() / focus() / blur() was throwing a TypeError when called on a RemoteDOMWindow,
complaining that |this| is not a Window. This was caused by a copy & paste mistake in
JSDOMWindowCustom where we were calling the JSDOMWindow methods instead of the JSRemoteDOMWindow
ones.

No new tests, updated existing tests.

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
* page/RemoteDOMWindow.cpp:
(WebCore::RemoteDOMWindow::postMessage):
* page/RemoteDOMWindow.h:
* page/RemoteDOMWindow.idl:

LayoutTests:

Add layout test coverage.

* http/tests/navigation/process-swap-window-open-expected.txt:
* http/tests/navigation/process-swap-window-open.html:

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

15 months agoUnreviewed test gardening
jiewen_tan@apple.com [Thu, 26 Apr 2018 00:42:20 +0000 (00:42 +0000)]
Unreviewed test gardening

Mark http/tests/misc/submit-post-keygen.html as 'Skip' in Win because of lacking corresponding
implementations.

* platform/win/TestExpectations:

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

15 months agoGardening: Speculative build fix for Windows 32-bit to compensate for MSVC's lack...
mark.lam@apple.com [Thu, 26 Apr 2018 00:13:35 +0000 (00:13 +0000)]
Gardening: Speculative build fix for Windows 32-bit to compensate for MSVC's lack of smarts.
https://bugs.webkit.org/show_bug.cgi?id=184976
<rdar://problem/39723901>

Not reviewed.

According to https://stackoverflow.com/questions/37658794/integer-constant-overflow-warning-in-constexpr,
disabling the warning around the definition of the function will not disable it
for all clients of the function.

* wtf/PtrTag.h:
(WTF::makePtrTagHash):

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

15 months agoIn FTLLowerDFGToB3.cpp::compileCreateRest, always use a contiguous array as the index...
rmorisset@apple.com [Wed, 25 Apr 2018 23:32:58 +0000 (23:32 +0000)]
In FTLLowerDFGToB3.cpp::compileCreateRest, always use a contiguous array as the indexing type when under isWatchingHavingABadTimeWatchpoint
https://bugs.webkit.org/show_bug.cgi?id=184773
<rdar://problem/37773612>

Reviewed by Filip Pizlo.

JSTests:

This bug requires a race between the thread doing FTL compilation and the main thread, but it triggers in 100% of cases (before the fix) on my machine
so I decided to add it to the stress tests nonetheless.

* stress/create-rest-while-having-a-bad-time.js: Added.
(f):
(g):
(h):

Source/JavaScriptCore:

We were calling restParameterStructure(), which returns arrayStructureForIndexingTypeDuringAllocation(ArrayWithContiguous).
arrayStructureForIndexingTypeDuringAllocation uses m_arrayStructureForIndexingShapeDuringAllocation, which is set to SlowPutArrayStorage when we are 'having a bad time'.
This is problematic, because the structure is then passed to allocateUninitializedContiguousJSArray, which ASSERTs that the indexing type is contiguous (or int32).
We solve the problem by using originalArrayStructureForIndexingType which always returns a structure with the right indexing type (contiguous), even if we are having a bad time.
This is safe, as we are under isWatchingHavingABadTimeWatchpoint, so if we have a bad time, the code we generate will never be installed.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCreateRest):

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

15 months agobrightness() filter should default to 1, and not allow negative values
simon.fraser@apple.com [Wed, 25 Apr 2018 23:24:47 +0000 (23:24 +0000)]
brightness() filter should default to 1, and not allow negative values
https://bugs.webkit.org/show_bug.cgi?id=184937

Reviewed by Dean Jackson.
Source/WebCore:

Remove the special-casing for brightness() in consumeFilterFunction(), so it now
follows the same logic as the other color-related filters in not allowing negative
values.

Removed the special-casing for brightness() in createFilterOperations() so its default
value is now 1.

Modified existing tests.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::createFilterOperations):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::allowsValuesGreaterThanOne):
(WebCore::CSSPropertyParserHelpers::consumeFilterFunction):

LayoutTests:

Added negative value tests to filter-property-parsing.html and backdropfilter-property-parsing.html,
and made these tests more similar.

Fixed expected computed value for brightness() to be brightness(1) in the tests.

The effect-brightness* test results failed because elements with invalid brightness values now
no longer create a RenderLayer.

* css3/color-filters/color-filter-parsing-expected.txt:
* css3/color-filters/color-filter-parsing.html:
* css3/filters/backdrop/backdropfilter-property-computed-style-expected.txt:
* css3/filters/backdrop/backdropfilter-property-computed-style.html:
* css3/filters/backdrop/backdropfilter-property-parsing-expected.txt:
* css3/filters/backdrop/backdropfilter-property-parsing.html:
* css3/filters/effect-brightness-expected.txt:
* css3/filters/filter-property-computed-style-expected.txt:
* css3/filters/filter-property-computed-style.html:
* css3/filters/filter-property-parsing-expected.txt:
* css3/filters/filter-property-parsing.html:
* css3/filters/unprefixed-expected.txt:
* css3/filters/unprefixed.html:
* fast/filter-image/parse-filter-image-expected.txt:
* fast/filter-image/parse-filter-image.html:
* platform/mac/css3/filters/effect-brightness-clamping-expected.txt:

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

15 months agoMissing closing parenthesis when determining INSTALL_PATH build setting in WebCore...
wenson_hsieh@apple.com [Wed, 25 Apr 2018 23:23:00 +0000 (23:23 +0000)]
Missing closing parenthesis when determining INSTALL_PATH build setting in WebCore.xcconfig
https://bugs.webkit.org/show_bug.cgi?id=184999

Reviewed by Tim Horton.

Tweaks a line in WebCore.xcconfig that computes INSTALL_PATH, so that it doesn't use WK_NOT or WK_EMPTY.

* Configurations/WebCore.xcconfig:

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

15 months agoPSON: Don't create a new process when navigating to a blob URL, data URL, and about...
rniwa@webkit.org [Wed, 25 Apr 2018 23:17:31 +0000 (23:17 +0000)]
PSON: Don't create a new process when navigating to a blob URL, data URL, and about:blank
https://bugs.webkit.org/show_bug.cgi?id=184962

Reviewed by Youenn Fablet.
<rdar://problem/39715044>

Build fix. Revert the change in r231019 to remove the empty URL and about:blank check here.
These checks are for the source / originating URL, not the target URL.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigation):

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

15 months ago[WPE][Debug] Test gardening of EME related tests.
clopez@igalia.com [Wed, 25 Apr 2018 23:13:13 +0000 (23:13 +0000)]
[WPE][Debug] Test gardening of EME related tests.

Report and mark the tests crashing on the Debug build.

* platform/wpe/TestExpectations:

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

15 months ago[LFC] Implement LayoutContexet::layout() and its dependencies.
zalan@apple.com [Wed, 25 Apr 2018 22:54:01 +0000 (22:54 +0000)]
[LFC] Implement LayoutContexet::layout() and its dependencies.
https://bugs.webkit.org/show_bug.cgi?id=184951

Reviewed by Antti Koivisto.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::FormattingContext):
(WebCore::Layout::FormattingContext::~FormattingContext):
(WebCore::Layout::FormattingContext::computeStaticPosition):
(WebCore::Layout::FormattingContext::computeInFlowPositionedPosition):
(WebCore::Layout::FormattingContext::computeOutOfFlowPosition):
(WebCore::Layout::FormattingContext::computeWidth):
(WebCore::Layout::FormattingContext::computeHeight):
(WebCore::Layout::FormattingContext::marginTop):
(WebCore::Layout::FormattingContext::marginLeft):
(WebCore::Layout::FormattingContext::marginBottom):
(WebCore::Layout::FormattingContext::marginRight):
* layout/FormattingContext.h:
* layout/FormattingState.cpp:
(WebCore::Layout::FormattingState::FormattingState):
* layout/FormattingState.h:
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::LayoutContext):
(WebCore::Layout::LayoutContext::updateLayout):
(WebCore::Layout::LayoutContext::formattingState):
(WebCore::Layout::LayoutContext::formattingContext):
* layout/LayoutContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
(WebCore::Layout::BlockFormattingContext::layout):
(WebCore::Layout::BlockFormattingContext::formattingState const):
(WebCore::Layout::BlockFormattingContext::computeStaticPosition):
(WebCore::Layout::BlockFormattingContext::computeWidth):
(WebCore::Layout::BlockFormattingContext::computeHeight):
(WebCore::Layout::BlockFormattingContext::marginTop):
(WebCore::Layout::BlockFormattingContext::marginBottom):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingState.cpp:
(WebCore::Layout::BlockFormattingState::BlockFormattingState):
* layout/blockformatting/BlockFormattingState.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
(WebCore::Layout::InlineFormattingContext::layout):
(WebCore::Layout::InlineFormattingContext::formattingState const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::InlineFormattingState):
* layout/inlineformatting/InlineFormattingState.h:

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

15 months agoPush the definition of PtrTag down to the WTF layer.
mark.lam@apple.com [Wed, 25 Apr 2018 22:31:13 +0000 (22:31 +0000)]
Push the definition of PtrTag down to the WTF layer.
https://bugs.webkit.org/show_bug.cgi?id=184976
<rdar://problem/39723901>

Reviewed by Saam Barati.

Source/JavaScriptCore:

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/ARM64Assembler.h:
* assembler/AbstractMacroAssembler.h:
* assembler/MacroAssemblerCodeRef.cpp:
* assembler/MacroAssemblerCodeRef.h:
* b3/B3MathExtras.cpp:
* bytecode/LLIntCallLinkInfo.h:
* disassembler/Disassembler.h:
* ftl/FTLJITCode.cpp:
* interpreter/InterpreterInlines.h:
* jit/ExecutableAllocator.h:
* jit/JITOperations.cpp:
* jit/ThunkGenerator.h:
* jit/ThunkGenerators.h:
* llint/LLIntOffsetsExtractor.cpp:
* llint/LLIntPCRanges.h:
* runtime/JSCPtrTag.h: Added.
* runtime/NativeFunction.h:
* runtime/PtrTag.h: Removed.
* runtime/VMTraps.cpp:

Source/WebCore:

No new tests needed.  This is covered by existing tests.

* cssjit/CSSPtrTag.h:
* cssjit/SelectorCompiler.h:
(WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
(WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
(WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
(WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):

Source/WTF:

This is in preparation for doing pointer profiling at the WTF layer as well.
Also deleted an unused ptrTag() function.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/PtrTag.h: Copied from Source/JavaScriptCore/runtime/PtrTag.h.
(WTF::makePtrTagHash):
(JSC::ptrTagName): Deleted.
(JSC::tagForPtr): Deleted.
(JSC::ptrTag): Deleted.
(JSC::tagCodePtr): Deleted.
(JSC::untagCodePtr): Deleted.
(JSC::retagCodePtr): Deleted.
(JSC::removeCodePtrTag): Deleted.
(JSC::tagCFunctionPtr): Deleted.
(JSC::untagCFunctionPtr): Deleted.
(JSC::assertIsCFunctionPtr): Deleted.
(JSC::assertIsNullOrCFunctionPtr): Deleted.
(JSC::assertIsNotTagged): Deleted.
(JSC::assertIsTagged): Deleted.
(JSC::assertIsNullOrTagged): Deleted.
(JSC::assertIsTaggedWith): Deleted.
(JSC::assertIsNullOrTaggedWith): Deleted.

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

15 months agoWebLoaderStrategy::networkMetricsFromResourceLoadIdentifier should use DoNotProcessIn...
youenn@apple.com [Wed, 25 Apr 2018 22:27:49 +0000 (22:27 +0000)]
WebLoaderStrategy::networkMetricsFromResourceLoadIdentifier should use DoNotProcessIncomingMessagesWhenWaitingForSyncReply
https://bugs.webkit.org/show_bug.cgi?id=184978
<rdar://problem/39667094>

Reviewed by Simon Fraser.

Use DoNotProcessIncomingMessagesWhenWaitingForSyncReply to keep a consistent state after the sync IPC call.

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::responseFromResourceLoadIdentifier):
(WebKit::WebLoaderStrategy::networkMetricsFromResourceLoadIdentifier):

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

15 months ago[iOS] remove media element parameter from MediaElementSession methods
eric.carlson@apple.com [Wed, 25 Apr 2018 22:25:13 +0000 (22:25 +0000)]
[iOS] remove media element parameter from MediaElementSession methods
https://bugs.webkit.org/show_bug.cgi?id=184992
<rdar://problem/39731624>

Reviewed by Jon Lee.

No new tests, no behavior change.

* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::allowsInlineMediaPlayback const):
(WebCore::MediaControlsHost::userGestureRequired const):
* accessibility/AccessibilityMediaObject.cpp:
(WebCore::AccessibilityMediaObject::isPlayingInline const):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement):
(WebCore::HTMLMediaElement::parseAttribute):
(WebCore::HTMLMediaElement::prepareForLoad):
(WebCore::HTMLMediaElement::selectMediaResource):
(WebCore::HTMLMediaElement::loadResource):
(WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const):
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::play):
(WebCore::HTMLMediaElement::pause):
(WebCore::HTMLMediaElement::pauseInternal):
(WebCore::HTMLMediaElement::setVolume):
(WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack):
(WebCore::HTMLMediaElement::sourceWasAdded):
(WebCore::HTMLMediaElement::mediaEngineWasUpdated):
(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
(WebCore::HTMLMediaElement::updatePlayState):
(WebCore::HTMLMediaElement::clearMediaPlayer):
(WebCore::HTMLMediaElement::resume):
(WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker):
(WebCore::HTMLMediaElement::addEventListener):
(WebCore::HTMLMediaElement::removeEventListener):
(WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
(WebCore::HTMLMediaElement::exitFullscreen):
(WebCore::HTMLMediaElement::configureMediaControls):
(WebCore::HTMLMediaElement::createMediaPlayer):
(WebCore::HTMLMediaElement::mediaPlayerIsFullscreenPermitted const):
(WebCore::HTMLMediaElement::updateMediaState):
(WebCore::HTMLMediaElement::mediaState const):
(WebCore::HTMLMediaElement::allowsMediaDocumentInlinePlaybackChanged):
(WebCore::HTMLMediaElement::updateShouldPlay):
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::parseAttribute):
(WebCore::HTMLVideoElement::supportsFullscreen const):
(WebCore::HTMLVideoElement::webkitEnterFullscreen):
(WebCore::HTMLVideoElement::webkitWirelessVideoPlaybackDisabled const):
(WebCore::HTMLVideoElement::webkitSupportsPresentationMode const):
(WebCore::HTMLVideoElement::setFullscreenMode):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted const):
(WebCore::MediaElementSession::dataLoadingPermitted const):
(WebCore::MediaElementSession::fullscreenPermitted const):
(WebCore::MediaElementSession::pageAllowsDataLoading const):
(WebCore::MediaElementSession::pageAllowsPlaybackAfterResuming const):
(WebCore::MediaElementSession::canShowControlsManager const):
(WebCore::MediaElementSession::showPlaybackTargetPicker):
(WebCore::MediaElementSession::hasWirelessPlaybackTargets const):
(WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const):
(WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
(WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
(WebCore::MediaElementSession::mediaStateDidChange):
(WebCore::MediaElementSession::effectivePreloadForElement const):
(WebCore::MediaElementSession::requiresFullscreenForVideoPlayback const):
(WebCore::MediaElementSession::allowsAutomaticMediaDataLoading const):
(WebCore::MediaElementSession::mediaEngineUpdated):
(WebCore::MediaElementSession::allowsPictureInPicture const):
* html/MediaElementSession.h:
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::wirelessVideoPlaybackDisabled const):

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

15 months agoRemove access to keychain from the WebContent process
jiewen_tan@apple.com [Wed, 25 Apr 2018 22:10:01 +0000 (22:10 +0000)]
Remove access to keychain from the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=184428
<rdar://problem/13150903>

Reviewed by Brent Fulgham.

Source/WebCore:

Part 2.

This patch move the operation of HTMLKeygenElement from WebContent Process to UI Process.
Function signedPublicKeyAndChallengeString is therefore marked as WEBCORE_EXPORT. Also, a
localized string is marked WEBCORE_EXPORT as well to support the API test.

Covered by existing tests and api tests.

* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::signedPublicKeyAndChallengeString):
* dom/Document.h:
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::appendFormData):
* page/ChromeClient.h:
* platform/LocalizedStrings.h:
* platform/SSLKeyGenerator.h:

Source/WebKit:

This patch does the followings:
1. Added necessary support to move HTMLKeygenElement's operation from WebContent Process to UI Process.
2. Craft new SPI copySignedPublicKeyAndChallengeString to supply HTMLKeygenElement with dummy data such
that WebKitTestRunner tests will not modify the underlying key store (e.g., the macOS Keychain).

* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::signedPublicKeyAndChallengeString):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageNavigationClient):
* UIProcess/API/C/WKPageNavigationClient.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::signedPublicKeyAndChallengeString):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::signedPublicKeyAndChallengeString const):
* WebProcess/WebCoreSupport/WebChromeClient.h:

Source/WebKitLegacy/mac:

This patch does the followings:
1. Added necessary support to move HTMLKeygenElement's operation from WebCore space to Client space.
2. Craft new SPI signedPublicKeyAndChallengeStringForWebView to supply HTMLKeygenElement with dummy data
such that DumpRenderTree tests will not modify the underlying key store (e.g., the macOS Keychain).

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::signedPublicKeyAndChallengeString const):
* WebView/WebUIDelegatePrivate.h:

Tools:

This patch does the followings:
1. Added an API test for this patch.
2. Instrument DumpRenderTree and WebKitTestRunner to take advantages of new SPIs.

* DumpRenderTree/mac/UIDelegate.mm:
(-[UIDelegate signedPublicKeyAndChallengeStringForWebView:]):
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/SSLKeyGenerator.mm: Added.
(TestWebKitAPI::SSLKeyGeneratorTest::SetUp):
(TestWebKitAPI::SSLKeyGeneratorTest::TearDown):
(TestWebKitAPI::TEST_F):
* WebKitTestRunner/TestController.cpp:
(WTR::copySignedPublicKeyAndChallengeString):
(WTR::TestController::createOtherPage):
(WTR::TestController::createWebViewWithOptions):

LayoutTests:

Alter the layout test to match dummy data supplied by the test runners.
Modify expectations as well.

* http/tests/misc/resources/check-keygen-post.php:
* platform/gtk/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:

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

15 months ago[Extra zoom mode] The search field on www.bing.com is missing label text
wenson_hsieh@apple.com [Wed, 25 Apr 2018 21:23:27 +0000 (21:23 +0000)]
[Extra zoom mode] The search field on bing.com is missing label text
https://bugs.webkit.org/show_bug.cgi?id=184975
<rdar://problem/39723081>

Reviewed by Tim Horton.

Source/WebKit:

Adds support for displaying the "aria-label" attribute as the input view's label text in extra zoom mode. Also
adds support for grabbing the input label's text for testing.

Test: fast/forms/extrazoom/form-control-label-text.html

* Shared/AssistedNodeInformation.cpp:
(WebKit::AssistedNodeInformation::encode const):
(WebKit::AssistedNodeInformation::decode):
* Shared/AssistedNodeInformation.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView formInputLabel]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView formInputLabel]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getAssistedNodeInformation):

Tools:

Adds UIScriptController.formInputLabel, which asynchronously requests the input label text for the currently
focused element in extra zoom mode.

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

LayoutTests:

Adds a layout test to check that the label text of the focused form control in the input view can be sourced
from (1) the "placeholder" attribute, (2) the "title" attribute, (3) the "aria-label" attribute, or (4) an
associated label element.

* fast/forms/extrazoom/form-control-label-text-expected.txt: Added.
* fast/forms/extrazoom/form-control-label-text.html: Added.
* resources/ui-helper.js:
(window.UIHelper.formInputLabel):
(window.UIHelper):

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

15 months ago[WPE] Should load injected bundle from builddir in developer builds
mcatanzaro@igalia.com [Wed, 25 Apr 2018 21:16:49 +0000 (21:16 +0000)]
[WPE] Should load injected bundle from builddir in developer builds
https://bugs.webkit.org/show_bug.cgi?id=184983

Reviewed by Carlos Alberto Lopez Perez.

Set WEBKIT_INJECTED_BUNDLE_PATH when running WPE MiniBrowser.

* Scripts/run-minibrowser:

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

15 months ago[WPE] libgstggtk.so broken in jhbuild environment
mcatanzaro@igalia.com [Wed, 25 Apr 2018 21:13:33 +0000 (21:13 +0000)]
[WPE] libgstggtk.so broken in jhbuild environment
https://bugs.webkit.org/show_bug.cgi?id=184984

Reviewed by Carlos Alberto Lopez Perez.

Don't pass --enable-glx=no when building libepoxy, to ensure it's compatible with
gst-plugins-good.

* wpe/jhbuild.modules:

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

15 months agoPSON: Don't create a new process when navigating to a blob URL, data URL, and about...
rniwa@webkit.org [Wed, 25 Apr 2018 20:48:03 +0000 (20:48 +0000)]
PSON: Don't create a new process when navigating to a blob URL, data URL, and about:blank
https://bugs.webkit.org/show_bug.cgi?id=184962

Reviewed by Youenn Fablet.

Source/WebCore:

Added NavigationAction::treatAsSameOriginNavigation, which signifies WebKit code to avoid creating
a new WebContent process when navigating to a blob URL, data URL, and about:blank.

Tests: ProcessSwap.SameOriginBlobNavigation
       ProcessSwap.CrossOriginBlobNavigation
       ProcessSwap.NavigateToAboutBlank
       ProcessSwap.NavigateToDataURL

* loader/NavigationAction.cpp:
(WebCore::treatAsSameOriginNavigation):
* loader/NavigationAction.h:
(WebCore::NavigationAction::treatAsSameOriginNavigation const):

Source/WebKit:

Don't create a new WebContent process when navigating to a blob object URL since doing so
can result in a race condition in which the blog URL is removed from the blob registry of
the network process by the time the navigation gets commited. This causes a failure in
fast/dom/HTMLAnchorElement/anchor-download-unset.html and oher layout tests.

In the future, the network process should verify that a given WebContent process has access
to a given blob URL. For now, we rely on WebContent process to tell us whether it can
navigate to a given blob URL or not.

* Shared/NavigationActionData.cpp:
(WebKit::NavigationActionData::encode const): Encode newly added treatAsSameOriginNavigation.
(WebKit::NavigationActionData::decode): Ditto for decoding.
* Shared/NavigationActionData.h:
(WebKit::NavigationActionData::treatAsSameOriginNavigation): Added.
* UIProcess/API/APINavigation.h:
(API::Navigation::setTreatAsSameOriginNavigation): Added.
(API::Navigation::treatAsSameOriginNavigation const): Added.
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction): Use the current process when
treatAsSameOriginNavigation is set to true; i.e. when navigating to a blob URL the current
document has access.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigation):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

Tools:

Added four test cases for navigating to a blob URL, data URL, and about:blank with process-swap-on-navigation turned on.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
(ProcessSwap.SameOriginBlobNavigation): Added.
(ProcessSwap.CrossOriginBlobNavigation): Added.
(ProcessSwap.NavigateToAboutBlank): Added.
(ProcessSwap.NavigateToDataURL): Added.

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

15 months agogetUnlinkedGlobalFunctionExecutable should only save things to the code cache if...
keith_miller@apple.com [Wed, 25 Apr 2018 20:43:42 +0000 (20:43 +0000)]
getUnlinkedGlobalFunctionExecutable should only save things to the code cache if the option is set
https://bugs.webkit.org/show_bug.cgi?id=184998

Reviewed by Saam Barati.

* runtime/CodeCache.cpp:
(JSC::CodeCache::getUnlinkedGlobalFunctionExecutable):

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

15 months ago[LFC] Implement Layout::BlockContainer functions.
zalan@apple.com [Wed, 25 Apr 2018 20:35:39 +0000 (20:35 +0000)]
[LFC] Implement Layout::BlockContainer functions.
https://bugs.webkit.org/show_bug.cgi?id=184994

Reviewed by Antti Koivisto.

* layout/layouttree/LayoutBlockContainer.cpp:
(WebCore::Layout::BlockContainer::BlockContainer):
(WebCore::Layout::BlockContainer::establishesInlineFormattingContext const):

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

15 months agoDon't activate Selection Assistant unless it is actually needed.
megan_gardner@apple.com [Wed, 25 Apr 2018 20:34:40 +0000 (20:34 +0000)]
Don't activate Selection Assistant unless it is actually needed.
https://bugs.webkit.org/show_bug.cgi?id=184944
<rdar://problem/39469671>

Reviewed by Tim Horton.

Source/WebKit:

Don't activate the selection unless we need to. Activating on init is overeager and allowing Javascript to
activate selections without user input.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView useSelectionAssistantWithGranularity:]):

LayoutTests:

Turning on previously flakey tests that are fixed with this change.

* platform/ios-wk2/TestExpectations:

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

15 months agoAdd missing scope release to functionProtoFuncToString
keith_miller@apple.com [Wed, 25 Apr 2018 20:31:25 +0000 (20:31 +0000)]
Add missing scope release to functionProtoFuncToString
https://bugs.webkit.org/show_bug.cgi?id=184995

Reviewed by Saam Barati.

JSTests:

* stress/function-toString-arrow.js: Added.
(async):

Source/JavaScriptCore:

* runtime/FunctionPrototype.cpp:
(JSC::functionProtoFuncToString):

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

15 months agoFix entitlements and sandbox configurations in WebKit after r230778
wenson_hsieh@apple.com [Wed, 25 Apr 2018 20:13:23 +0000 (20:13 +0000)]
Fix entitlements and sandbox configurations in WebKit after r230778
https://bugs.webkit.org/show_bug.cgi?id=184960
<rdar://problem/39662827>

Reviewed by Tim Horton.

Build fixes for watchOS and tvOS after r230778.

* Configurations/BaseXPCService.xcconfig:
* Configurations/NetworkService.xcconfig:
* Configurations/WebContentService.xcconfig:

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

15 months ago[LFC] Implement Layout::Container functions.
zalan@apple.com [Wed, 25 Apr 2018 20:09:37 +0000 (20:09 +0000)]
[LFC] Implement Layout::Container functions.
https://bugs.webkit.org/show_bug.cgi?id=184988

Reviewed by Antti Koivisto.

* layout/layouttree/LayoutContainer.cpp:
(WebCore::Layout::Container::Container):
(WebCore::Layout::Container::firstInFlowChild const):
(WebCore::Layout::Container::firstInFlowOrFloatingChild const):
(WebCore::Layout::Container::lastInFlowChild const):
(WebCore::Layout::Container::lastInFlowOrFloatingChild const):
(WebCore::Layout::Container::setFirstChild):
(WebCore::Layout::Container::setLastChild):
(WebCore::Layout::Container::setOutOfFlowDescendants):
* layout/layouttree/LayoutContainer.h:
(WebCore::Layout::Container::firstChild const):
(WebCore::Layout::Container::lastChild const):
(WebCore::Layout::Container::hasChild const):
(WebCore::Layout::Container::hasInFlowChild const):
(WebCore::Layout::Container::hasInFlowOrFloatingChild const):
(WebCore::Layout::Container::outOfFlowDescendants):

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

15 months ago[CMake] Some options should be marked as advanced
mcatanzaro@igalia.com [Wed, 25 Apr 2018 19:58:53 +0000 (19:58 +0000)]
[CMake] Some options should be marked as advanced
https://bugs.webkit.org/show_bug.cgi?id=184972

Reviewed by Konstantin Tokarev.

* Source/cmake/FindLibGcrypt.cmake:
* Source/cmake/FindWebP.cmake:

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

15 months agoREGRESSION(r230748) [GTK][ARM] no matching function for call to 'JSC::CCallHelpers...
utatane.tea@gmail.com [Wed, 25 Apr 2018 19:55:11 +0000 (19:55 +0000)]
REGRESSION(r230748) [GTK][ARM] no matching function for call to 'JSC::CCallHelpers::swap(JSC::ARMRegisters::FPRegisterID&, JSC::ARMRegisters::FPRegisterID&)'
https://bugs.webkit.org/show_bug.cgi?id=184730

Reviewed by Mark Lam.

Add swap(FPRegisterID, FPRegisterID) implementation using ARMRegisters::SD0 (temporary register in MacroAssemblerARM).
And we now use dataTempRegister, addressTempRegister, and fpTempRegister instead of using S0, S1, and SD0.

We also change swap(RegisterID, RegisterID) implementation to use moves and temporaries simply. This is aligned to
ARMv7 implementation.

* assembler/ARMAssembler.h:
* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::add32):
(JSC::MacroAssemblerARM::and32):
(JSC::MacroAssemblerARM::lshift32):
(JSC::MacroAssemblerARM::mul32):
(JSC::MacroAssemblerARM::or32):
(JSC::MacroAssemblerARM::rshift32):
(JSC::MacroAssemblerARM::urshift32):
(JSC::MacroAssemblerARM::sub32):
(JSC::MacroAssemblerARM::xor32):
(JSC::MacroAssemblerARM::load8):
(JSC::MacroAssemblerARM::abortWithReason):
(JSC::MacroAssemblerARM::load32WithAddressOffsetPatch):
(JSC::MacroAssemblerARM::store32WithAddressOffsetPatch):
(JSC::MacroAssemblerARM::store8):
(JSC::MacroAssemblerARM::store32):
(JSC::MacroAssemblerARM::push):
(JSC::MacroAssemblerARM::swap):
(JSC::MacroAssemblerARM::branch8):
(JSC::MacroAssemblerARM::branchPtr):
(JSC::MacroAssemblerARM::branch32):
(JSC::MacroAssemblerARM::branch32WithUnalignedHalfWords):
(JSC::MacroAssemblerARM::branchTest8):
(JSC::MacroAssemblerARM::branchTest32):
(JSC::MacroAssemblerARM::jump):
(JSC::MacroAssemblerARM::branchAdd32):
(JSC::MacroAssemblerARM::mull32):
(JSC::MacroAssemblerARM::branchMul32):
(JSC::MacroAssemblerARM::patchableBranch32):
(JSC::MacroAssemblerARM::nearCall):
(JSC::MacroAssemblerARM::compare32):
(JSC::MacroAssemblerARM::compare8):
(JSC::MacroAssemblerARM::test32):
(JSC::MacroAssemblerARM::test8):
(JSC::MacroAssemblerARM::add64):
(JSC::MacroAssemblerARM::load32):
(JSC::MacroAssemblerARM::call):
(JSC::MacroAssemblerARM::branchPtrWithPatch):
(JSC::MacroAssemblerARM::branch32WithPatch):
(JSC::MacroAssemblerARM::storePtrWithPatch):
(JSC::MacroAssemblerARM::loadDouble):
(JSC::MacroAssemblerARM::storeDouble):
(JSC::MacroAssemblerARM::addDouble):
(JSC::MacroAssemblerARM::divDouble):
(JSC::MacroAssemblerARM::subDouble):
(JSC::MacroAssemblerARM::mulDouble):
(JSC::MacroAssemblerARM::convertInt32ToDouble):
(JSC::MacroAssemblerARM::branchDouble):
(JSC::MacroAssemblerARM::branchTruncateDoubleToInt32):
(JSC::MacroAssemblerARM::truncateDoubleToInt32):
(JSC::MacroAssemblerARM::truncateDoubleToUint32):
(JSC::MacroAssemblerARM::branchConvertDoubleToInt32):
(JSC::MacroAssemblerARM::branchDoubleNonZero):
(JSC::MacroAssemblerARM::branchDoubleZeroOrNaN):
(JSC::MacroAssemblerARM::call32):
(JSC::MacroAssemblerARM::internalCompare32):

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

15 months agoUnreviewed build fix after r231008.
bfulgham@apple.com [Wed, 25 Apr 2018 19:48:03 +0000 (19:48 +0000)]
Unreviewed build fix after r231008.

* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::create): Forgot to remove an unneeded constructor argument.

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

15 months ago[WinCairo] Fix js/regexp-unicode.html crash.
ross.kirsling@sony.com [Wed, 25 Apr 2018 19:35:00 +0000 (19:35 +0000)]
[WinCairo] Fix js/regexp-unicode.html crash.
https://bugs.webkit.org/show_bug.cgi?id=184891

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

On Win64, register RDI is "considered nonvolatile and must be saved and restored by a function that uses [it]".
RDI is being used as a scratch register for JIT_UNICODE_EXPRESSIONS, not just YARR_JIT_ALL_PARENS_EXPRESSIONS.

* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::generateEnter):
(JSC::Yarr::YarrGenerator::generateReturn):
Unconditionally save and restore RDI on 64-bit Windows.

LayoutTests:

* platform/wincairo/TestExpectations:

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

15 months agoDon't Block First Party Cookies on Redirects
bfulgham@apple.com [Wed, 25 Apr 2018 19:16:00 +0000 (19:16 +0000)]
Don't Block First Party Cookies on Redirects
https://bugs.webkit.org/show_bug.cgi?id=184948
<rdar://problem/39534099>

Reviewed by Youenn Fablet.

Source/WebCore:

The Navigation scheduler looses the 'requester' value when performing a ScheduledRedirect.

Test: http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect.html

* loader/NavigationScheduler.cpp:

Source/WebKit:

Top-level navigations should not be subject to cookie blocking behavior. When performing redirects for main frame
navigation we are blocking cookies, leading to site breakage.

We need to keep track of which NetworkDataTasks are due to a main frame navigation. When a redirect is performed
on the main frame, we should treat the new origin as the 'first party for cookies' and avoid blocking cookies for
that URL.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::preconnectTo): Use the correct parameter type. We actually serialize
NetworkResourceLoadParameters over IPC, so we should get access to all the members of this child class.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::create): Pass new 'loadIsForNavigation' flag to create methods.
(WebKit::NetworkDataTask::NetworkDataTask): Capture 'loadIsForNavigation' in constructor.
* NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTask::isTopLevelNavigation const): Added.
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob): Accept new constructor argument.
* NetworkProcess/NetworkDataTaskBlob.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::willPerformHTTPRedirection): Retain requester value from old request during redirect.
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(NetworkResourceLoadParameters::decode): Update to pass new flag.
(NetworkResourceLoadParameters::encode): Ditto.
* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/capture/NetworkDataTaskReplay.cpp:
(WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay): Accept new constructor argument.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Accept new constructor argument.
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl): Accept new constructor argument.
* NetworkProcess/curl/NetworkDataTaskCurl.h:
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): Accept new constructor argument.
* NetworkProcess/soup/NetworkDataTaskSoup.h:

LayoutTests:

* http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect-expected.txt: Added.
* http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect.html: Added.

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

15 months agoUnreviewed test gardening, rebaseline tests for iOS.
ryanhaddad@apple.com [Wed, 25 Apr 2018 18:57:11 +0000 (18:57 +0000)]
Unreviewed test gardening, rebaseline tests for iOS.

* platform/ios/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* platform/ios/media/modern-media-controls/compact-media-controls/compact-media-controls-constructor-expected.txt: Added.
* platform/ios/media/modern-media-controls/compact-media-controls/compact-media-controls-layout-expected.txt: Added.

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

15 months agoCachedRawResource is not handling incremental data computation correctly
youenn@apple.com [Wed, 25 Apr 2018 18:54:48 +0000 (18:54 +0000)]
CachedRawResource is not handling incremental data computation correctly
https://bugs.webkit.org/show_bug.cgi?id=184936

Reviewed by Chris Dumez.

Source/WebCore:

Covered by updated test.

The previous logic was handling the case of only one additional segment being added to the SharedBuffer.
In service worker case, a SharedBuffer may contain more than one segment.
This is fixed by iterating until all new data is sent to clients.

* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::updateBuffer):

LayoutTests:

* http/tests/workers/service/resources/service-worker-fetch-worker.js:
(stringToBuffer):
(event.event.request.url.endsWith):
* http/tests/workers/service/resources/service-worker-fetch.js:
(async.test):
* http/tests/workers/service/service-worker-fetch.https-expected.txt:

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

15 months agoEnsure DNT is set for redirections handled in NetworkProcess
youenn@apple.com [Wed, 25 Apr 2018 18:51:46 +0000 (18:51 +0000)]
Ensure DNT is set for redirections handled in NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=184890

Reviewed by Ryosuke Niwa.

Source/WebKit:

Compute whether DNT header should be set on requests based on:
- request has a DNT header
- session is ephemeral (aka private browsing mode)
In both cases, we ensure a DNT header is added for any request triggered by a redirection.

Covered by http/wpt/fetch/dnt-header-after-redirection.html.

* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::check):
(WebKit::NetworkLoadChecker::prepareRedirectedRequest):
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::willSendRedirectedRequest):
(WebKit::NetworkResourceLoader::continueWillSendRequest):
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::willPerformHTTPRedirection):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):

LayoutTests:

* http/wpt/fetch/dnt-header-after-redirection-expected.txt: Added.
* http/wpt/fetch/dnt-header-after-redirection.html: Added.
* http/wpt/fetch/resources/dnt-status.py: Added.
* http/wpt/fetch/resources/redirect.py: Added.
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

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

15 months ago[WPE] Remove deprecated functions and properties from the API
mcatanzaro@igalia.com [Wed, 25 Apr 2018 18:41:13 +0000 (18:41 +0000)]
[WPE] Remove deprecated functions and properties from the API
https://bugs.webkit.org/show_bug.cgi?id=179295

Reviewed by Žan Doberšek.

Source/WebKit:

* UIProcess/API/glib/WebKitCookieManager.cpp:
* UIProcess/API/glib/WebKitFormSubmissionRequest.cpp:
* UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp:
(webkitNavigationPolicyDecisionGetProperty):
(webkit_navigation_policy_decision_class_init):
* UIProcess/API/glib/WebKitSettings.cpp:
(webKitSettingsSetProperty):
(webKitSettingsGetProperty):
(webkit_settings_class_init):
* UIProcess/API/glib/WebKitWebContext.cpp:
(webkitWebContextGetProperty):
(webkitWebContextSetProperty):
(webkit_web_context_class_init):
* UIProcess/API/glib/WebKitWebView.cpp:
(webkit_web_view_class_init):
(webkitWebViewHandleAuthenticationChallenge):
(webkitWebViewWebProcessTerminated):
* UIProcess/API/wpe/WebKitCookieManager.h:
* UIProcess/API/wpe/WebKitFormSubmissionRequest.h:
* UIProcess/API/wpe/WebKitNavigationPolicyDecision.h:
* UIProcess/API/wpe/WebKitSettings.h:
* UIProcess/API/wpe/WebKitWebContext.h:

Tools:

* TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp:
(testWebViewAuthenticationStorage): Disable this test for now. It will require some effort
to rewrite LoadTrackingTest to not require the web view at construction time.
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp:
(testWebKitSettings): Don't test private browsing setting, which is gone.
* TestWebKitAPI/glib/CMakeLists.txt: Disable TestCookieManager for now.

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

15 months ago[Mac] Number of drop items is always 0 when performing a DHTML drag
aestes@apple.com [Wed, 25 Apr 2018 18:35:43 +0000 (18:35 +0000)]
[Mac] Number of drop items is always 0 when performing a DHTML drag
https://bugs.webkit.org/show_bug.cgi?id=184943

Reviewed by Ryosuke Niwa.

Source/WebCore:

New API test: DragAndDropPasteboardTests.NumberOfValidItemsForDrop

DragController tracks the number of items to be accepted by a file input element, taking
into account whether the control is disabled or accepts multiple files. When this number
changes, WebKit informs the NSDraggingInfo-conforming object passed to -draggingUpdated by
calling -setNumberOfValidItemsForDrop:. This number is presented to the user in a badge
rendered next to the dragging item thumbnails.

When performing a DHTML drag, we don't know how many items the page will accept, so prior
to this patch we would render a "0" in the badge. This is misleading, because the page is
more likely to accept all the items (or at least one of them) rather than none of them.

Let's do the straightforward thing and set numberOfValidItemsForDrop to equal the number of
files in the drag operation when performing a DHTML file drag.

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

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/DragAndDropPasteboardTests.mm:
(-[DragInfo numberOfValidItemsForDrop]):
(-[DragInfo setNumberOfValidItemsForDrop:]):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/mac/full-page-dropzone.html: Added.

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

15 months ago[iOS] Set route sharing policy when setting audio session category
eric.carlson@apple.com [Wed, 25 Apr 2018 18:27:25 +0000 (18:27 +0000)]
[iOS] Set route sharing policy when setting audio session category
https://bugs.webkit.org/show_bug.cgi?id=184979
<rdar://problem/39709577>

Reviewed by Jer Noble.

* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::setCategory):

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

15 months ago[Curl] Fix wrong schema checking on r230973
commit-queue@webkit.org [Wed, 25 Apr 2018 18:05:50 +0000 (18:05 +0000)]
[Curl] Fix wrong schema checking on r230973
https://bugs.webkit.org/show_bug.cgi?id=184977

Did write a wrong condition when making a string.

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2018-04-25
Reviewed by Alex Christensen.

No new tests because test interface is not ready.

* platform/network/curl/CurlProxySettings.cpp:
(WebCore::createProxyUrl):

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

15 months agoMake DocumentThreadableLoader error logging more consistent
youenn@apple.com [Wed, 25 Apr 2018 17:57:56 +0000 (17:57 +0000)]
Make DocumentThreadableLoader error logging more consistent
https://bugs.webkit.org/show_bug.cgi?id=184853

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/XMLHttpRequest/access-control-basic-cors-safelisted-request-headers-expected.txt:
* web-platform-tests/XMLHttpRequest/access-control-basic-denied-expected.txt:
* web-platform-tests/XMLHttpRequest/access-control-basic-get-fail-non-simple-expected.txt:
* web-platform-tests/XMLHttpRequest/access-control-basic-non-cors-safelisted-content-type-expected.txt:
* web-platform-tests/XMLHttpRequest/access-control-basic-post-with-non-cors-safelisted-content-type-expected.txt:
* web-platform-tests/XMLHttpRequest/access-control-basic-preflight-denied-expected.txt:
* web-platform-tests/XMLHttpRequest/access-control-preflight-request-invalid-status-301-expected.txt:
* web-platform-tests/XMLHttpRequest/access-control-preflight-request-invalid-status-400-expected.txt:
* web-platform-tests/XMLHttpRequest/access-control-preflight-request-invalid-status-501-expected.txt:
* web-platform-tests/XMLHttpRequest/access-control-sandboxed-iframe-denied-expected.txt:
* web-platform-tests/XMLHttpRequest/access-control-sandboxed-iframe-denied-without-wildcard-expected.txt:
* web-platform-tests/XMLHttpRequest/send-non-same-origin-expected.txt:
* web-platform-tests/XMLHttpRequest/send-non-same-origin.sub-expected.txt:
* web-platform-tests/fetch/api/basic/mode-same-origin.any-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-about.any-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-about.any.worker-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-blob-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-others-expected.txt:
* web-platform-tests/fetch/api/cors/cors-basic.any-expected.txt:
* web-platform-tests/fetch/api/cors/cors-multiple-origins-expected.txt:
* web-platform-tests/fetch/api/cors/cors-origin.any.worker-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-redirect.any.worker-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-star.any-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-star.any.worker-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-status.any.worker-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight.any.worker-expected.txt:
* web-platform-tests/fetch/api/cors/cors-redirect-preflight.any.worker-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-schemes-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-to-dataurl-expected.txt:
* web-platform-tests/fetch/api/request/request-keepalive-quota-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event-redirect.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-request-fallback.https-expected.txt:

Source/WebCore:

Covered by rebased tests.
Make EventSource, XHR and Fetch log error messages consistently.
This patch also prepares consistent error logging between WK1 and WK2 as WK2 NetworkProcess
will issue more and more errors in places different from WK1.
This is the reason for SubresourceLoader changes in this patch and DTL/didFail/preflightFailure changes.

Update ImageLoader error message to be more general than CORS.

* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::doPreflight): Add some more logging for consistency between WK1 and WK2.
(WebCore::CrossOriginPreflightChecker::validatePreflightResponse): Ditto.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::didFail):
(WebCore::DocumentThreadableLoader::preflightFailure):
(WebCore::DocumentThreadableLoader::logErrorAndFail):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::notifyFinished):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didFail):
* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoader::logError):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):
* loader/cache/CachedResourceRequestInitiators.cpp:
(WebCore::CachedResourceRequestInitiators::CachedResourceRequestInitiators):
* loader/cache/CachedResourceRequestInitiators.h:
* page/EventSource.cpp:
(WebCore::EventSource::connect):
(WebCore::EventSource::didFail):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::didFail):

LayoutTests:

Removing JS console log output for some tests.
Updating tests according modified error logging.

* TestExpectations:
* http/tests/security/bypassing-cors-checks-for-extension-urls-expected.txt:
* http/tests/security/contentSecurityPolicy/connect-src-eventsource-redirect-to-blocked-expected.txt:
* http/tests/security/contentSecurityPolicy/connect-src-xmlhttprequest-redirect-to-blocked-expected.txt:
* http/tests/security/cross-origin-cached-images-expected.txt:
* http/tests/security/cross-origin-cached-images-parallel-expected.txt:
* http/tests/security/img-with-failed-cors-check-fails-to-load-expected.txt:
* http/tests/security/load-image-after-redirection-2-expected.txt:
* http/tests/security/load-image-after-redirection-expected.txt:
* http/tests/security/mixedContent/insecure-xhr-in-main-frame-expected.txt:
* http/tests/security/video-poster-cross-origin-crash-expected.txt:
* http/tests/security/video-poster-cross-origin-crash2-expected.txt:
* http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt:
* http/tests/xmlhttprequest/access-control-and-redirects-expected.txt:
* http/tests/xmlhttprequest/access-control-basic-denied-expected.txt:
* http/tests/xmlhttprequest/access-control-basic-denied-preflight-cache-expected.txt:
* http/tests/xmlhttprequest/access-control-basic-get-fail-non-simple-expected.txt:
* http/tests/xmlhttprequest/access-control-basic-non-simple-deny-cached-expected.txt:
* http/tests/xmlhttprequest/access-control-basic-post-fail-non-simple-content-type-expected.txt:
* http/tests/xmlhttprequest/access-control-preflight-async-header-denied-expected.txt:
* http/tests/xmlhttprequest/access-control-preflight-async-method-denied-expected.txt:
* http/tests/xmlhttprequest/access-control-preflight-async-not-supported-expected.txt:
* http/tests/xmlhttprequest/access-control-preflight-not-successful-expected.txt:
* http/tests/xmlhttprequest/access-control-preflight-sync-header-denied-expected.txt:
* http/tests/xmlhttprequest/access-control-preflight-sync-method-denied-expected.txt:
* http/tests/xmlhttprequest/access-control-preflight-sync-not-supported-expected.txt:
* http/tests/xmlhttprequest/access-control-sandboxed-iframe-denied-expected.txt:
* http/tests/xmlhttprequest/access-control-sandboxed-iframe-denied-without-wildcard-expected.txt:
* http/tests/xmlhttprequest/cors-non-standard-safelisted-headers-should-trigger-preflight-expected.txt:
* http/tests/xmlhttprequest/cross-origin-no-authorization-expected.txt:
* http/tests/xmlhttprequest/cross-site-denied-response-sync-2-expected.txt:
* http/tests/xmlhttprequest/cross-site-denied-response-sync-expected.txt:
* http/tests/xmlhttprequest/origin-exact-matching-expected.txt:
* http/tests/xmlhttprequest/origin-whitelisting-https-expected.txt:
* http/tests/xmlhttprequest/origin-whitelisting-ip-addresses-with-subdomains-expected.txt:
* http/tests/xmlhttprequest/origin-whitelisting-removal-expected.txt:
* http/tests/xmlhttprequest/post-blob-content-type-sync-expected.txt:
* http/tests/xmlhttprequest/redirect-cross-origin-post-expected.txt:
* http/tests/xmlhttprequest/redirect-cross-origin-post-sync-expected.txt:
* http/tests/xmlhttprequest/redirect-cross-origin-sync-expected.txt:
* http/tests/xmlhttprequest/redirect-cross-origin-tripmine-expected.txt:
* http/tests/xmlhttprequest/simple-cross-origin-denied-events-post-expected.txt:
* http/tests/xmlhttprequest/simple-cross-origin-denied-events-post-sync-expected.txt:
* http/tests/xmlhttprequest/simple-cross-origin-denied-events-sync-expected.txt:
* http/tests/xmlhttprequest/simple-cross-origin-progress-events-expected.txt:
* http/tests/xmlhttprequest/upload-request-error-event-order-expected.txt:
* http/tests/xmlhttprequest/workers/access-control-basic-get-fail-non-simple-expected.txt:
* http/tests/xmlhttprequest/xmlhttprequest-sync-no-progress-events-expected.txt:
* http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt:
* platform/mac-wk1/http/tests/xmlhttprequest/access-control-and-redirects-expected.txt:
* platform/mac-wk1/http/tests/xmlhttprequest/access-control-preflight-not-successful-expected.txt:
* platform/mac-wk1/http/tests/xmlhttprequest/cross-origin-no-authorization-expected.txt:
* platform/mac-wk1/http/tests/xmlhttprequest/redirect-cross-origin-tripmine-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/XMLHttpRequest/access-control-and-redirects-expected.txt:
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-main-frame-expected.txt:
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-iframe-expected.txt:
* platform/win/http/tests/xmlhttprequest/access-control-and-redirects-expected.txt:
* platform/win/http/tests/xmlhttprequest/access-control-preflight-not-successful-expected.txt:
* platform/win/http/tests/xmlhttprequest/cross-origin-no-authorization-expected.txt:
* platform/win/http/tests/xmlhttprequest/redirect-cross-origin-tripmine-expected.txt:

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

15 months ago[LFC] Implement Layout::Box functions.
zalan@apple.com [Wed, 25 Apr 2018 17:49:05 +0000 (17:49 +0000)]
[LFC] Implement Layout::Box functions.
https://bugs.webkit.org/show_bug.cgi?id=184974

Reviewed by Antti Koivisto.

* layout/layouttree/LayoutBlockContainer.h:
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::Box):
(WebCore::Layout::Box::~Box):
(WebCore::Layout::Box::establishesFormattingContext const):
(WebCore::Layout::Box::establishesBlockFormattingContext const):
(WebCore::Layout::Box::isRelativelyPositioned const):
(WebCore::Layout::Box::isStickyPositioned const):
(WebCore::Layout::Box::isAbsolutelyPositioned const):
(WebCore::Layout::Box::isFixedPositioned const):
(WebCore::Layout::Box::isFloatingPositioned const):
(WebCore::Layout::Box::containingBlock const):
(WebCore::Layout::Box::isDescendantOf const):
(WebCore::Layout::Box::isAnonymous const):
(WebCore::Layout::Box::isInlineBlockBox const):
(WebCore::Layout::Box::isBlockLevelBox const):
(WebCore::Layout::Box::isInlineLevelBox const):
(WebCore::Layout::Box::isBlockContainerBox const):
(WebCore::Layout::Box::isInitialContainingBlock const):
(WebCore::Layout::Box::nextInFlowSibling const):
(WebCore::Layout::Box::nextInFlowOrFloatingSibling const):
(WebCore::Layout::Box::previousInFlowSibling const):
(WebCore::Layout::Box::previousInFlowOrFloatingSibling const):
(WebCore::Layout::Box::setParent):
(WebCore::Layout::Box::setNextSibling):
(WebCore::Layout::Box::setPreviousSibling):
(WebCore::Layout::Box::isOverflowVisible const):
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::establishesInlineFormattingContext const):
(WebCore::Layout::Box::isInFlow const):
(WebCore::Layout::Box::isPositioned const):
(WebCore::Layout::Box::isInFlowPositioned const):
(WebCore::Layout::Box::isOutOfFlowPositioned const):
(WebCore::Layout::Box::isFloatingOrOutOfFlowPositioned const):
(WebCore::Layout::Box::parent const):
(WebCore::Layout::Box::nextSibling const):
(WebCore::Layout::Box::previousSibling const):
(WebCore::Layout::Box::weakPtrFactory const):
* layout/layouttree/LayoutContainer.h:
* layout/layouttree/LayoutInlineBox.h:
* layout/layouttree/LayoutInlineContainer.h:

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

15 months agoAPI test harness should be Python
jbedard@apple.com [Wed, 25 Apr 2018 16:35:34 +0000 (16:35 +0000)]
API test harness should be Python
https://bugs.webkit.org/show_bug.cgi?id=181043
<rdar://problem/36164410>

Reviewed by David Kilzer.

Run API tests from a Python script rather than Perl. The Python API tests have
the same structure as the layout tests.

* Scripts/run-api-tests: Changed from Perl to Python.
* Scripts/webkitpy/api_tests: Added.
* Scripts/webkitpy/api_tests/__init__.py: Added.
* Scripts/webkitpy/api_tests/manager.py: Added.
(Manager):
(Manager.__init__):
(Manager._test_list_from_output): Construct a list of tests from the output of
TestWTF and TestWebKitAPI.
(Manager._find_test_subset): Given a list of all possible tests and command line
arguments, return a list of tests which match the provided arguments.
(Manager._collect_tests): Run TestWTF and TestWebKitAPI with --gtest_list_tests
to determine which tests will be run.
(Manager._print_test_result): Formatted print of a test with it's output.
(Manager._print_tests_result_with_status): Print all tests and output for tests
which ran with a specified exit status.
(Manager.run): Collect all tests, run them and then print results from the run.
* Scripts/webkitpy/api_tests/run_api_tests.py: Added.
(main): Parse arguments, construct a port, early exit for illegal ports and
then run tests.
(run): Setup logging and printing before using the Manager to run tests.
(parse_args): Use argparse to define all options used by run-api-tests.
* Scripts/webkitpy/api_tests/runner.py: Added.
(Runner):
(Runner.__init__):
(Runner._shard_tests): Split tests so that each suite runs together.
(Runner.command_for_port): Run a command on the device specified by the given
port object. Once <https://bugs.webkit.org/show_bug.cgi?id=175204> is completed,
this function would be entirely replaced by the server_process factory owned
by the port object.
(Runner.run): Run all shards in the message_pool.
(Runner.handle): Handle reports from child processes.
(Runner.result_map_by_status): Return a mapping of tests to output for tests
which exit with a specific status.
(_Worker):
(_Worker.__init__):
(_Worker._filter_noisy_output): Filter out objc warnings since these polite the log.
(_Worker._run_single_test): Runs a single test in a single child process.
(_Worker._run_shard_with_binary): Attempts to run a group of tests in the same
child process. If this technique fails, the remaining tests are run singly.
(_Worker.handle): Run the specified shard.
* Scripts/webkitpy/port/base.py:
(Port):
(Port.check_api_test_build): Check if TestWTF and TestWebKitAPI are built.
(Port.environment_for_api_tests): Return the environment needed to run
the TestWebKitAPI binary.
(Port. path_to_api_test_binaries): Return a list of the path to all binaries
used when running API tests.
(Port._build_api_tests): Build TestWTF and TestWebKitAPI if required.
* Scripts/webkitpy/port/mac.py:
(MacPort.environment_for_api_tests): Enable GuardMalloc for API tests.
* Scripts/webkitpy/port/server_process.py:
(ServerProcess.pop_all_buffered_stdout):

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

15 months agoUnreviewed, silence -Wreturn-type warning
mcatanzaro@igalia.com [Wed, 25 Apr 2018 16:26:16 +0000 (16:26 +0000)]
Unreviewed, silence -Wreturn-type warning
https://bugs.webkit.org/show_bug.cgi?id=184560

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::shouldCancelCrossOriginLoad):

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

15 months ago[GTK] Miscellaneous build cleanups
mcatanzaro@igalia.com [Wed, 25 Apr 2018 16:23:05 +0000 (16:23 +0000)]
[GTK] Miscellaneous build cleanups
https://bugs.webkit.org/show_bug.cgi?id=184399

Reviewed by Žan Doberšek.

.:

* Source/cmake/OptionsGTK.cmake:

Source/JavaScriptCore:

* PlatformGTK.cmake:

Source/WebKit:

* PlatformGTK.cmake:

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

15 months ago[Win] Crash under WebCore::SimpleLineLayout::generateLineBoxTree
pvollan@apple.com [Wed, 25 Apr 2018 15:46:53 +0000 (15:46 +0000)]
[Win] Crash under WebCore::SimpleLineLayout::generateLineBoxTree
https://bugs.webkit.org/show_bug.cgi?id=184953

This is possibly a MSVC compiler bug, since a simple rearrangement of the code fixes the crash.
The crash is only happening in release builds, which also is an indication of this being a
compiler issue.

Reviewed by Zalan Bujtas.

No new tests, covered by existing tests.

* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::generateLineBoxTree):

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

15 months agoMake a better flag for system preview, and disable it where necessary
dino@apple.com [Wed, 25 Apr 2018 15:16:51 +0000 (15:16 +0000)]
Make a better flag for system preview, and disable it where necessary
https://bugs.webkit.org/show_bug.cgi?id=184968
<rdar://problem/39686506>

Reviewed by Eric Carlson.

Source/WebCore:

Use USE(SYSTEM_PREVIEW).

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::isSystemPreviewLink const):
* html/HTMLAnchorElement.h:
* html/HTMLImageElement.cpp:
* html/HTMLImageElement.h:
* html/HTMLPictureElement.cpp:
* html/HTMLPictureElement.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect):
* rendering/RenderTheme.cpp:
* rendering/RenderTheme.h:
* testing/Internals.cpp:
(WebCore::Internals::systemPreviewRelType):
(WebCore::Internals::isSystemPreviewLink const):
(WebCore::Internals::isSystemPreviewImage const):

Source/WebKit:

Use USE(SYSTEM_PREVIEW).

* UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
* UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
(-[WKWebViewContentProviderRegistry init]):
* UIProcess/ios/WKSystemPreviewView.mm:

Source/WTF:

Add a new USE(SYSTEM_PREVIEW).

* wtf/Platform.h:

LayoutTests:

These tests have platform-specific results for the moment.

* TestExpectations:
* system-preview/badge-expected.html: Removed.
* system-preview/detection-expected.txt: Removed.

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

15 months agoIncorrect number of WebDriver test failures shown in the bots
commit-queue@webkit.org [Wed, 25 Apr 2018 14:19:02 +0000 (14:19 +0000)]
Incorrect number of WebDriver test failures shown in the bots
https://bugs.webkit.org/show_bug.cgi?id=184959

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

The regular expression we are using to get the number of failures from the log is matching a particular test
error output. Improve the regular expression to avoid matching other strings in the log. Ensure that only
matches at the beginning of lines and add spaces after Unexpected and before the (<failures>).

* BuildSlaveSupport/build.webkit.org-config/steps.py:
(RunWebDriverTests.commandComplete):

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

15 months agoFix project file after r230931.
zalan@apple.com [Wed, 25 Apr 2018 13:18:26 +0000 (13:18 +0000)]
Fix project file after r230931.

* WebCore.xcodeproj/project.pbxproj:

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

15 months ago[GTK] fast/repaint/fixed-scale.html failing since r230479 "[TexMap] TextureMapperLaye...
magomez@igalia.com [Wed, 25 Apr 2018 13:08:51 +0000 (13:08 +0000)]
[GTK] fast/repaint/fixed-scale.html failing since r230479 "[TexMap] TextureMapperLayer unnecessarily duplicates state in GraphicsLayerTransform"
https://bugs.webkit.org/show_bug.cgi?id=184780

Reviewed by Žan Doberšek.

Source/WebCore:

Initialize the anchorPoint to (0.5, 0.5, 0) in TextureMapperLayer::State.

Covered by existent tests.

* platform/graphics/texmap/TextureMapperLayer.h:

LayoutTests:

* platform/gtk/TestExpectations:

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

15 months agoimported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-* LayoutTests...
Ms2ger@igalia.com [Wed, 25 Apr 2018 12:10:44 +0000 (12:10 +0000)]
imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-* LayoutTests are flaky failures
https://bugs.webkit.org/show_bug.cgi?id=182833

Reviewed by Carlos Alberto Lopez Perez.

LayoutTests/imported/w3c:

* web-platform-tests/2dcontext/imagebitmap/common.sub.js: ensure event handlers aren't garbage collected
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-origin.sub-expected.txt: update expectations

LayoutTests:

* TestExpectations: enable tests
* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-origin.sub-expected.txt: update expectations
* platform/ios/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-origin.sub-expected.txt: update expectations
* platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-origin.sub-expected.txt: update expectations

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

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