WebKit-https.git
15 months ago[GTK] Unreviewed test gardening
aboya@igalia.com [Wed, 18 Jul 2018 18:45:42 +0000 (18:45 +0000)]
[GTK] Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=187771

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/wpe/TestExpectations:

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

15 months ago[ews-build] Add build step to run layout-test
aakash_jain@apple.com [Wed, 18 Jul 2018 18:40:20 +0000 (18:40 +0000)]
[ews-build] Add build step to run layout-test
https://bugs.webkit.org/show_bug.cgi?id=187674

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(RunWebKitTests): Added build step to run layout-tests. This is similar to current EWS.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.
* BuildSlaveSupport/ews-build/factories.py: Added build-step to run layout-test in iOSSimulatorFactory.

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

15 months agoWeb Inspector: REGRESSION(r232591): CodeMirrorEditor should not use a RegExp lineSepa...
mattbaker@apple.com [Wed, 18 Jul 2018 18:40:14 +0000 (18:40 +0000)]
Web Inspector: REGRESSION(r232591): CodeMirrorEditor should not use a RegExp lineSeparator option
https://bugs.webkit.org/show_bug.cgi?id=187772
<rdar://problem/42331640>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/CodeMirrorEditor.js:
(WI.CodeMirrorEditor.create):
(WI.CodeMirrorEditor):
CodeMirror should be left to auto-detect line separators. By default
it detects \n, \r\n, and \r. By specifying a regular expression we
merely cause problems when CodeMirror uses the supplied lineSeparator
when joining its array of lines together.

* UserInterface/Views/TextEditor.js:
(WI.TextEditor.set string.update):
(WI.TextEditor.prototype.set string):
This assertion was only true when we forced "\n" line endings everywhere.
It no longer holds for source text with "\r\n" (Windows-style) line endings.

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

15 months ago[Curl] Disable CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST specified by setAllo...
Basuke.Suzuki@sony.com [Wed, 18 Jul 2018 18:35:16 +0000 (18:35 +0000)]
[Curl] Disable CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST specified by setAllowsAnyHTTPSCertificate.
https://bugs.webkit.org/show_bug.cgi?id=187611

Reviewed by Fujii Hironori.

Current interface for TLS certificate validation for Curl port are as follows:

- WEBCORE_EXPORT void setHostAllowsAnyHTTPSCertificate(const String&);
- bool isAllowedHTTPSCertificateHost(const String&);
- bool canIgnoredHTTPSCertificate(const String&, const Vector<CertificateInfo::Certificate>&);

First one registers a host to be ignored for any certificate check. Once it is registered, no
further certificate validation check is executed.
Second one checks the host is registered in the list above.
Third one is weird. The method signature implies it checks the certificate for the host and detect
whether we can ignore this certificate for the host, but actually it  just check only the host and
register the certificate into the vector. Then in the next request for the host, the certificate
will be checked with the previously stored certificate.

It's hard to understand, but in short,
- We can register a host as an exception for any TLS certificate validation.
- But only certificate arrived first is ignored, not any certificates for the host
  (which is rare, but possible for mis configured web cluster).

This behavior is incomplete. To ignore any certificates of the host, these two methods are enough:

- void allowAnyHTTPSCertificatesForHost(const String&)
- bool canIgnoreAnyHTTPSCertificatesForHost(const String&)

No new tests. Covered by existing tests.

* platform/network/curl/CertificateInfo.h:
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::enableSSLForHost): Ignore TLS verification for registered host.
* platform/network/curl/CurlSSLHandle.cpp:
(WebCore::CurlSSLHandle::allowAnyHTTPSCertificatesForHost): Added.
(WebCore::CurlSSLHandle::canIgnoreAnyHTTPSCertificatesForHost const): Ditto.
(WebCore::CurlSSLHandle::setClientCertificateInfo): Separate lock.
(WebCore::CurlSSLHandle::getSSLClientCertificate const): Ditto and add const.
(WebCore::CurlSSLHandle::setHostAllowsAnyHTTPSCertificate): Deleted.
(WebCore::CurlSSLHandle::isAllowedHTTPSCertificateHost): Deleted.
(WebCore::CurlSSLHandle::canIgnoredHTTPSCertificate): Deleted.
(WebCore::CurlSSLHandle::getSSLClientCertificate): Deleted.
* platform/network/curl/CurlSSLHandle.h:
* platform/network/curl/CurlSSLVerifier.cpp:
(WebCore::CurlSSLVerifier::CurlSSLVerifier):
(WebCore::CurlSSLVerifier::collectInfo): Renamed from verify.
(WebCore::CurlSSLVerifier::verifyCallback):
(WebCore::CurlSSLVerifier::verify): Renamed to collectInfo.
* platform/network/curl/CurlSSLVerifier.h:
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate): Rename calling method.

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

15 months ago[JSC] JSON.stringify's replacer should use `isArray` instead of JSArray checks
utatane.tea@gmail.com [Wed, 18 Jul 2018 18:31:09 +0000 (18:31 +0000)]
[JSC] JSON.stringify's replacer should use `isArray` instead of JSArray checks
https://bugs.webkit.org/show_bug.cgi?id=187755

Reviewed by Mark Lam.

JSTests:

* stress/json-stringify-gap-calculation-should-be-after-replacer-check.js: Added.
(shouldThrow):
(shouldThrow.string.toString):
* test262/expectations.yaml:

Source/JavaScriptCore:

JSON.stringify used `inherits<JSArray>(vm)` to determine whether the given replacer is an array replacer.
But this is wrong. According to the spec, we should use `isArray`[1], which accepts Proxies. This difference
makes one test262 test failed.

This patch changes the code to using `isArray()`. And we reorder the evaluations of replacer check and ident space check
to align these checks to the spec's order.

[1]: https://tc39.github.io/ecma262/#sec-json.stringify

* runtime/JSONObject.cpp:
(JSC::Stringifier::Stringifier):

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

15 months ago[JSC] Root wrapper object in JSON.stringify is not necessary if replacer is not callable
utatane.tea@gmail.com [Wed, 18 Jul 2018 18:27:08 +0000 (18:27 +0000)]
[JSC] Root wrapper object in JSON.stringify is not necessary if replacer is not callable
https://bugs.webkit.org/show_bug.cgi?id=187752

Reviewed by Mark Lam.

JSON.stringify has an implicit root wrapper object since we would like to call replacer
with a wrapper object and a property name. While we always create this wrapper object,
it is unnecessary if the given replacer is not callable.

This patch removes wrapper object creation when a replacer is not callable to avoid unnecessary
allocations. This change slightly improves the performance of Kraken/json-stringify-tinderbox.

                                   baseline                  patched

json-stringify-tinderbox        39.730+-0.590      ^      38.853+-0.266         ^ definitely 1.0226x faster

* runtime/JSONObject.cpp:
(JSC::Stringifier::isCallableReplacer const):
(JSC::Stringifier::Stringifier):
(JSC::Stringifier::stringify):
(JSC::Stringifier::appendStringifiedValue):

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

15 months agoRename WordBreak::Break to WordBreak::BreakWord
mmaxfield@apple.com [Wed, 18 Jul 2018 18:10:08 +0000 (18:10 +0000)]
Rename WordBreak::Break to WordBreak::BreakWord
https://bugs.webkit.org/show_bug.cgi?id=187767

Reviewed by Simon Fraser.

These breaking properties are very confusing. There are:

1. word-break: break-all, a standard value that allows breaking after every
character.
2. word-break: break-word, a non-standard value which allows for breaking after
every character, but only if the word is too long for the available width (otherwise
it works the same as word-break: normal). This affects the min-content-size of the
text (and makes it equal to what it would be if word-break: break-all was
specified).
3. word-wrap: break-word, which is the same as word-break: break-word, but doesn't
affect the min-content-size of the text.
4. overflow-wrap: break-word, which is the same as word-wrap: break-word.

Because this is so confusing it's valuable for our internal enums to match the names
of the official CSS properties/values.

No new tests because there is no behavior change.

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator WordBreak const):
* rendering/RenderText.cpp:
(WebCore::RenderText::computePreferredLogicalWidths):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::breakWords const):
* rendering/style/RenderStyleConstants.h:

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

15 months agoAdd SPI to defer running async script until after document load
wenson_hsieh@apple.com [Wed, 18 Jul 2018 17:08:46 +0000 (17:08 +0000)]
Add SPI to defer running async script until after document load
https://bugs.webkit.org/show_bug.cgi?id=187748
<rdar://problem/42317378>

Reviewed by Ryosuke Niwa and Tim Horton.

Source/WebCore:

On watchOS, we currently observe that time-consuming async scripts can block the first paint of Reader, leaving
the user with a blank screen for tens of seconds. One way to mitigate this is to defer async script execution
until after document load (i.e. the same timing as DOMContentLoaded).

This patch introduces an SPI configuration allowing internal clients to defer execution of asynchronous script
until after document load; this, in combination with the parser yielding token introduced in r233891, allows
Safari on watchOS to avoid being blocked on slow script execution before the first paint of the Reader page on
most article-like pages. See below for more details.

Test: RunScriptAfterDocumentLoad.ExecutionOrderOfScriptsInDocument

* dom/Document.cpp:
(WebCore::Document::shouldDeferAsynchronousScriptsUntilParsingFinishes const):
(WebCore::Document::finishedParsing):

Notify ScriptRunner when the Document has finished parsing, and is about to fire DOMContentLoaded.

* dom/Document.h:
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::documentFinishedParsing):

When the document is finished parsing, kick off the script execution timer if needed to run any async script
that has been deferred.

(WebCore::ScriptRunner::notifyFinished):
(WebCore::ScriptRunner::timerFired):

Instead of always taking from the list of async scripts to execute, check our document to see whether we should
defer this until after document load. If so, ignore `m_scriptsToExecuteSoon`.

* dom/ScriptRunner.h:
* page/Settings.yaml:

Add a WebCore setting for this behavior.

Source/WebKit:

Add plumbing for a new ShouldDeferAsynchronousScriptsUntilAfterDocumentLoad configuration that determines
whether async script execution should be deferred until document load (i.e. DOMContentLoaded). This
configuration defaults to NO on all platforms. See WebCore ChangeLog for more detail.

* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _shouldDeferAsynchronousScriptsUntilAfterDocumentLoad]):
(-[WKWebViewConfiguration _setShouldDeferAsynchronousScriptsUntilAfterDocumentLoad:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:

Tools:

Add an API test to verify that when the deferred async script configuration is set, async scripts will be
executed after the DOMContentLoaded event.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/RunScriptAfterDocumentLoad.mm: Added.
(TEST):

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

15 months ago[WPE] Update WPEBackend in flatpak
cturner@igalia.com [Wed, 18 Jul 2018 16:04:33 +0000 (16:04 +0000)]
[WPE] Update WPEBackend in flatpak
https://bugs.webkit.org/show_bug.cgi?id=187753

r233763 updated WPEBackend for the jhbuild, but not the flatpak. This
caused WPE_BACKEND_CHECK_VERSION to not be defined, triggering a bug
in the version guard,

#if defined(WPE_BACKEND_CHECK_VERSION) && WPE_BACKEND_CHECK_VERSION(0, 2, 0)

This doesn't work as intended, since the C preprocessor first expands
all macro arguments in the #if expression before evaluating the
expression. When WPE_BACKEND_CHECK_VERSION is not defined, this will
lead to a syntax error and some head scratching.

A future patch should address the buggy macro check, when it is
decided whether the assume the macro is always defined and bump
the API requirements on WPEBackend, or to move the check into two
conditionals to avoid the expansion problem.

Unreviewed build fix.

* flatpak/org.webkit.WPE.yaml:

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

15 months agoFix the parsing of colors in attributed string tests, and make it possible to dump...
simon.fraser@apple.com [Wed, 18 Jul 2018 15:55:33 +0000 (15:55 +0000)]
Fix the parsing of colors in attributed string tests, and make it possible to dump the typing attributes
https://bugs.webkit.org/show_bug.cgi?id=187747

Reviewed by Ryosuke Niwa.

Tools:

Add textInputController.attributedStringForTyping(), which returns a one-character
attributed string whose attributes are the typing attributes, making it possible to
test -[WebView typingAttributes].

Sadly WebCore's convertObjcValueToValue() doesn't know how to convert NSDictionary,
so we can't return -typingAttributes directly.

* DumpRenderTree/mac/TextInputControllerMac.m:
(+[TextInputController isSelectorExcludedFromWebScript:]):
(-[TextInputController attributedStringForTyping]):

LayoutTests:

Fix the parsing of color properties in dump-attributed-string.js, and treat NSStrokeColor as
a color. Rebase all the affected tests. Give macOS Sierra its own expectations with the legacy NSCustomColorSpace.

Add attributed-string-for-typing.html which tests typingAttributes.

* editing/mac/attributed-string/anchor-element-expected.txt:
* editing/mac/attributed-string/attributed-string-for-typing-expected.txt: Added.
* editing/mac/attributed-string/attributed-string-for-typing.html: Added.
* editing/mac/attributed-string/basic-expected.txt:
* editing/mac/attributed-string/comment-cdata-section-expected.txt:
* editing/mac/attributed-string/font-size-expected.txt:
* editing/mac/attributed-string/font-style-variant-effect-expected.txt:
* editing/mac/attributed-string/font-weight-expected.txt:
* editing/mac/attributed-string/letter-spacing-expected.txt:
* editing/mac/attributed-string/resources/dump-attributed-string.js:
(dumpAttributedString):
(formatNonParagraphAttributeValue):
(parseNSColorDescription):
(window.onload):
(serializeAttributedString.log): Deleted.
(serializeAttributedString.): Deleted.
(serializeAttributedString): Deleted.
* editing/mac/attributed-string/text-decorations-expected.txt:
* editing/mac/attributed-string/vertical-align-expected.txt:
* platform/mac-sierra/editing/mac/attributed-string/anchor-element-expected.txt:
* platform/mac-sierra/editing/mac/attributed-string/attributed-string-for-typing-expected.txt: Added.
* platform/mac-sierra/editing/mac/attributed-string/basic-expected.txt:
* platform/mac-sierra/editing/mac/attributed-string/comment-cdata-section-expected.txt:
* platform/mac-sierra/editing/mac/attributed-string/font-size-expected.txt:
* platform/mac-sierra/editing/mac/attributed-string/font-style-variant-effect-expected.txt:
* platform/mac-sierra/editing/mac/attributed-string/font-weight-expected.txt:
* platform/mac-sierra/editing/mac/attributed-string/letter-spacing-expected.txt:
* platform/mac-sierra/editing/mac/attributed-string/text-decorations-expected.txt:
* platform/mac-sierra/editing/mac/attributed-string/vertical-align-expected.txt:
* platform/mac/editing/mac/attributed-string/anchor-element-expected.txt: Removed.
* platform/mac/editing/mac/attributed-string/basic-expected.txt: Removed.
* platform/mac/editing/mac/attributed-string/comment-cdata-section-expected.txt: Removed.
* platform/mac/editing/mac/attributed-string/font-size-expected.txt: Removed.
* platform/mac/editing/mac/attributed-string/font-style-variant-effect-expected.txt: Removed.
* platform/mac/editing/mac/attributed-string/font-weight-expected.txt: Removed.
* platform/mac/editing/mac/attributed-string/letter-spacing-expected.txt: Removed.
* platform/mac/editing/mac/attributed-string/text-decorations-expected.txt: Removed.
* platform/mac/editing/mac/attributed-string/vertical-align-expected.txt: Removed.

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

15 months agoSwitch CMake ports back to C++ 14
mcatanzaro@igalia.com [Wed, 18 Jul 2018 14:43:50 +0000 (14:43 +0000)]
Switch CMake ports back to C++ 14
https://bugs.webkit.org/show_bug.cgi?id=187744

Reviewed by Ryosuke Niwa.

.:

The XCode build is still not using C++ 17, it's been several months since CMake ports
switched, everything builds fine without changes if we switch back, and there have been some
unfixed problems. Let's go back to C++ 14 for now. We can switch back to C++ 17 whenever we
are ready to switch over XCode at the same time, to ensure we don't wind up with divergent
behavior for std::optional.

* Source/cmake/WebKitCompilerFlags.cmake:

Source/WTF:

Always use WTF's internal std::optional implementation, since std::optional is not part of
C++ 14.

* wtf/Optional.h:

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

15 months ago[GLIB] Add jsc_context_check_syntax() to GLib API
carlosgc@webkit.org [Wed, 18 Jul 2018 12:54:38 +0000 (12:54 +0000)]
[GLIB] Add jsc_context_check_syntax() to GLib API
https://bugs.webkit.org/show_bug.cgi?id=187694

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

A new function to be able to check for syntax errors without actually evaluating the code.

* API/glib/JSCContext.cpp:
(jsc_context_check_syntax):
* API/glib/JSCContext.h:
* API/glib/docs/jsc-glib-4.0-sections.txt:

Tools:

Add a new test case.

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

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

15 months ago[Nicosia] Add debug border, repaint counter state tracking to Nicosia::CompositionLayer
zandobersek@gmail.com [Wed, 18 Jul 2018 10:22:15 +0000 (10:22 +0000)]
[Nicosia] Add debug border, repaint counter state tracking to Nicosia::CompositionLayer
https://bugs.webkit.org/show_bug.cgi?id=187749

Reviewed by Carlos Garcia Campos.

Add the RepaintCounter and DebugBorder structs to
Nicosia::CompositionLayer::LayerState, tracking visibility as well as
repaint count or debug color and width.

Instances of RepaintCounter and DebugBorder types are kept in each
CoordinatedGraphicsLayer object, updating the relevant data as it is
changed (since the GraphicsLayer object isn't tracking these values on
its own). During layer flush these values (if changed) are then copied
over into the CompositionLayer state.

* platform/graphics/nicosia/NicosiaPlatformLayer.cpp:
Also fix the year in the license header.
* platform/graphics/nicosia/NicosiaPlatformLayer.h:
Also fix the year in the license header.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers):
(WebCore::CoordinatedGraphicsLayer::setShowDebugBorder):
(WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
(WebCore::CoordinatedGraphicsLayer::setDebugBorder):
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

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

15 months ago[CoordGraphics] Start tracking Nicosia layers in CoordinatedGraphicsState
zandobersek@gmail.com [Wed, 18 Jul 2018 10:20:21 +0000 (10:20 +0000)]
[CoordGraphics] Start tracking Nicosia layers in CoordinatedGraphicsState
https://bugs.webkit.org/show_bug.cgi?id=187751

Reviewed by Carlos Garcia Campos.

Start including the Nicosia::CompositionLayer objects in the
CoordinatedGraphicsState struct, under a separate NicosiaState struct.
References to all the layers in a given scene are kept in a HashSet,
and a separate reference to the root layer kept in a separate member
variable.

Source/WebCore:

* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::compositionLayer const):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
Add the getter method that returns internal Nicosia::CompositionLayer
object. This can't be defined in the class definition because of
WEBCORE_EXPORT used on the CoordinatedGraphicsLayer class.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:

Source/WebKit:

CompositingCoordinator now takes care of adding or removing the
Nicosia::CompositionLayer objects to the NicosiaState's HashSet, as well
as setting the root layer object when it's being initialized. Additions
and removals of Nicosia::CompositionLayer correspond to the additions
and removals of CoordinatedGraphicsLayer objects to the coordinator's
m_registeredLayers HashMap.

Upon each state commit that's done in CoordinatedGraphicsScene, the
NicosiaState object will be copied into the member variable. Nothing is
done yet with that state object, but in the near future it will be used
to finally commit all the state details into the TextureMapper layers.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::commitSceneState):
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::initializeRootCompositingLayerIfNeeded):
(WebKit::CompositingCoordinator::createGraphicsLayer):
(WebKit::CompositingCoordinator::detachLayer):
(WebKit::CompositingCoordinator::attachLayer):

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

15 months agoShrink CompositeAnimation and AnimationBase
simon.fraser@apple.com [Wed, 18 Jul 2018 07:02:02 +0000 (07:02 +0000)]
Shrink CompositeAnimation and AnimationBase
https://bugs.webkit.org/show_bug.cgi?id=187683

Reviewed by Daniel Bates.

Reduce the size of CompositeAnimation and AnimationBase.

* page/animation/AnimationBase.h:
* page/animation/CompositeAnimation.h:

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

15 months ago[WPE][GTK] Update xdgmime
mcatanzaro@igalia.com [Wed, 18 Jul 2018 06:08:36 +0000 (06:08 +0000)]
[WPE][GTK] Update xdgmime
https://bugs.webkit.org/show_bug.cgi?id=187727

Reviewed by Carlos Garcia Campos.

* xdgmime/README:
* xdgmime/README.webkit:
* xdgmime/src/xdgmime.c:
(_xdg_mime_mime_type_subclass):
* xdgmime/src/xdgmimecache.c:
(_xdg_mime_cache_new_from_file):
(_xdg_mime_cache_get_mime_type_for_file):
(_xdg_mime_cache_mime_type_subclass):

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

15 months agoRevert r233630 since it broke internal wasm benchmarks
keith_miller@apple.com [Wed, 18 Jul 2018 05:14:25 +0000 (05:14 +0000)]
Revert r233630 since it broke internal wasm benchmarks
https://bugs.webkit.org/show_bug.cgi?id=187746

Unreviewed revert.

Source/JavaScriptCore:

This patch seems to have broken internal Wasm benchmarks. This
issue is likely due to an underlying bug but let's rollout while
we investigate.

* bytecode/CodeType.h:
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::codeType const):
(JSC::UnlinkedCodeBlock::didOptimize const):
(JSC::UnlinkedCodeBlock::setDidOptimize):
* bytecode/VirtualRegister.h:
(JSC::VirtualRegister::VirtualRegister):
(): Deleted.

Source/WTF:

* wtf/TriState.h:

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

15 months agoREGRESSION (iOS 12): Can't scroll to the bottom of the page in WKWebView while keyboa...
timothy_horton@apple.com [Wed, 18 Jul 2018 03:50:12 +0000 (03:50 +0000)]
REGRESSION (iOS 12): Can't scroll to the bottom of the page in WKWebView while keyboard is up on pages with viewport-fit=cover
https://bugs.webkit.org/show_bug.cgi?id=187743
<rdar://problem/41651546>

Reviewed by Simon Fraser.

UIScrollView's _systemContentInset no longer includes keyboard insets
in apps linked on iOS 12+ when contentInsetAdjustmentBehavior is None.

We use contentInsetAdjustmentBehavior to control adjustment of other
sources of insets, but expect the keyboard inset to always be applied.

For now, barring a more comprehensive way to separate insets, re-add
the keyboard inset in cases where UIKit does not.

* Platform/spi/ios/UIKitSPI.h:
Move some IPI to the SPI header.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _haveSetObscuredInsets]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
Make it possible for WKScrollView to check whether the client is overriding insets.

* UIProcess/Cocoa/VersionChecks.h:
Add a linkedOnOrAfter() version for this new UIScrollView behavior.

* UIProcess/ios/WKScrollView.mm:
(-[WKScrollView initWithFrame:]):
Force WKScrollView's scroll indicator to always respect insets. We always
want the scroll bars in a sensible place, even if the page sets
viewport-fit=cover.

(-[WKScrollView _adjustForAutomaticKeyboardInfo:animated:lastAdjustment:]):
Store the bottom inset due to the keyboard.

(-[WKScrollView _systemContentInset]):
Add the bottom inset due to the keyboard to the systemContentInset
in all cases where UIKit does not. Also avoid adding it if the client takes
full control of the insets, because the only client that does (MobileSafari)
includes insets-due-to-keyboard in their custom insets.

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

15 months agoRELEASE_ASSERT() under IPC::Connection::sendSync() from PluginProxy::supportsSnapshot...
cdumez@apple.com [Wed, 18 Jul 2018 03:43:37 +0000 (03:43 +0000)]
RELEASE_ASSERT() under IPC::Connection::sendSync() from PluginProxy::supportsSnapshotting()
https://bugs.webkit.org/show_bug.cgi?id=187740
<rdar://problem/41818955>

Reviewed by Youenn Fablet.

As per the crash trace, PluginProxy::supportsSnapshotting() can be called during layout but does synchronous
IPC. As a result, we need to prevent WebCore re-entrancy by using DoNotProcessIncomingMessagesWhenWaitingForSyncReply
sendOption.

* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::supportsSnapshotting const):

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

15 months agoEnsure timingFunctionForKeyframeAtIndex() can be used from setAnimatedPropertiesInSty...
graouts@webkit.org [Wed, 18 Jul 2018 01:05:29 +0000 (01:05 +0000)]
Ensure timingFunctionForKeyframeAtIndex() can be used from setAnimatedPropertiesInStyle().
https://bugs.webkit.org/show_bug.cgi?id=187637
<rdar://problem/42157915>

Reviewed by Dean Jackson.

Source/WebCore:

Test: webanimations/empty-keyframes-crash.html

Unlike what we assumed, it is possible to have a non-declarative animation without any parsed keyframes.
This can happen as a result of calling `Element.animate({}, …)`. In this case, we want to return a null
value in timingFunctionForKeyframeAtIndex() so we update the call site in setAnimatedPropertiesInStyle()
which is the only place where we didn't check for a null value and didn't know for sure that there would
be parsed keyframes to rely on in the case of a WebAnimation instance.

* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle):
(WebCore::KeyframeEffectReadOnly::timingFunctionForKeyframeAtIndex):

LayoutTests:

Add a new test that would crash prior to this change.

* webanimations/empty-keyframes-crash-expected.txt: Added.
* webanimations/empty-keyframes-crash.html: Added.

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

15 months agoRebaseline imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/pbkdf2.https...
ryanhaddad@apple.com [Wed, 18 Jul 2018 00:59:33 +0000 (00:59 +0000)]
Rebaseline imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/pbkdf2.https.worker.html for Sierra after r233898.

Unreviewed test gardening.

* platform/mac-sierra/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/pbkdf2.https.worker-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/pbkdf2.https.worker-expected.txt: Added.

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

15 months agoMarking test as flakey
tsavell@apple.com [Wed, 18 Jul 2018 00:39:25 +0000 (00:39 +0000)]
Marking test as flakey

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

15 months agoUnreviewed, test gardening after r233898.
jiewen_tan@apple.com [Wed, 18 Jul 2018 00:24:23 +0000 (00:24 +0000)]
Unreviewed, test gardening after r233898.

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:
* platform/wpe/TestExpectations:

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

15 months agoREGRESSION: [macOS Sierra] TestWebKitAPI.WebKit.WebsiteDataStoreCustomPaths is a...
sihui_liu@apple.com [Tue, 17 Jul 2018 23:34:36 +0000 (23:34 +0000)]
REGRESSION: [macOS Sierra] TestWebKitAPI.WebKit.WebsiteDataStoreCustomPaths is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=187066
<rdar://problem/41609065>

Reviewed by Chris Dumez.

In r232668 we started to do reload if web process crashes by default. As we killed the web
process explicitly in this test, if web page got reloaded, messages would be sent again,
and flag set in message handler could keep the test continue to evaluate the expectation
without waiting for removeDataOfTypes to finish.

* TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:
(-[WebsiteDataStoreCustomPathsMessageHandler webViewWebContentProcessDidTerminate:]):
(TEST):

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

15 months ago[WebCrypto] Crypto operations should copy their parameters before hoping to another...
jiewen_tan@apple.com [Tue, 17 Jul 2018 23:06:12 +0000 (23:06 +0000)]
[WebCrypto] Crypto operations should copy their parameters before hoping to another thread
https://bugs.webkit.org/show_bug.cgi?id=187501
<rdar://problem/41438160>

Reviewed by Youenn Fablet.

Source/WebCore:

This patch aims at making all captured variables in all crypto lambdas that need to be passed
to a worker thread thread safe, which includes:
1) changing ref counted objects to thread safe ref counted object.
2) adding isolatedCopy methods to non ref counted classes, so they can be called by CrossThreadCopy().

In addition to above changes, this patch also does the following things:
1) change the name CryptoAlgorithm::dispatchOperation => CryptoAlgorithm::dispatchOperationInWorkQueue
to make it clear that lambdas will be passed to a secondary thread.
2) make CryptoAlgorithmParameters as const parameters for all methods.
3) add null checks on BufferSource.length() and .data().

Tests: crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html
       http/wpt/crypto/aes-cbc-crash.any.html
       http/wpt/crypto/aes-cbc-crash.any.worker.html
       http/wpt/crypto/aes-ctr-crash.any.html
       http/wpt/crypto/aes-ctr-crash.any.worker.html
       http/wpt/crypto/aes-gcm-crash.any.html
       http/wpt/crypto/aes-gcm-crash.any.worker.html
       http/wpt/crypto/derive-hmac-key-crash.any.html
       http/wpt/crypto/derive-hmac-key-crash.any.worker.html
       http/wpt/crypto/ecdsa-crash.any.html
       http/wpt/crypto/ecdsa-crash.any.worker.html
       http/wpt/crypto/hkdf-crash.any.html
       http/wpt/crypto/hkdf-crash.any.worker.html
       http/wpt/crypto/pbkdf2-crash.any.html
       http/wpt/crypto/pbkdf2-crash.any.worker.html
       http/wpt/crypto/rsa-oaep-crash.any.html
       http/wpt/crypto/rsa-oaep-crash.any.worker.html
       http/wpt/crypto/rsa-pss-crash.any.html
       http/wpt/crypto/rsa-pss-crash.any.worker.html
       http/wpt/crypto/unwrap-ec-key-crash.any.html
       http/wpt/crypto/unwrap-ec-key-crash.any.worker.html
       http/wpt/crypto/unwrap-rsa-key-crash.any.html
       http/wpt/crypto/unwrap-rsa-key-crash.any.worker.html

* bindings/js/BufferSource.h:
(WebCore::BufferSource::data const):
(WebCore::BufferSource::length const):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::encrypt):
(WebCore::CryptoAlgorithm::decrypt):
(WebCore::CryptoAlgorithm::sign):
(WebCore::CryptoAlgorithm::verify):
(WebCore::CryptoAlgorithm::deriveBits):
(WebCore::CryptoAlgorithm::importKey):
(WebCore::dispatchAlgorithmOperation):
(WebCore::CryptoAlgorithm::dispatchOperationInWorkQueue):
(WebCore::CryptoAlgorithm::dispatchOperation): Deleted.
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.cpp:
(WebCore::crossThreadCopyImportParams):
(WebCore::SubtleCrypto::encrypt):
(WebCore::SubtleCrypto::decrypt):
(WebCore::SubtleCrypto::sign):
(WebCore::SubtleCrypto::verify):
(WebCore::SubtleCrypto::deriveKey):
(WebCore::SubtleCrypto::deriveBits):
(WebCore::SubtleCrypto::importKey):
(WebCore::SubtleCrypto::wrapKey):
(WebCore::SubtleCrypto::unwrapKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::encrypt):
(WebCore::CryptoAlgorithmAES_CBC::decrypt):
(WebCore::CryptoAlgorithmAES_CBC::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
(WebCore::CryptoAlgorithmAES_CFB::encrypt):
(WebCore::CryptoAlgorithmAES_CFB::decrypt):
(WebCore::CryptoAlgorithmAES_CFB::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CFB.h:
* crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
(WebCore::parametersAreValid):
(WebCore::CryptoAlgorithmAES_CTR::encrypt):
(WebCore::CryptoAlgorithmAES_CTR::decrypt):
(WebCore::CryptoAlgorithmAES_CTR::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CTR.h:
* crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
(WebCore::CryptoAlgorithmAES_GCM::encrypt):
(WebCore::CryptoAlgorithmAES_GCM::decrypt):
(WebCore::CryptoAlgorithmAES_GCM::importKey):
* crypto/algorithms/CryptoAlgorithmAES_GCM.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::importKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmECDH.cpp:
(WebCore::CryptoAlgorithmECDH::deriveBits):
(WebCore::CryptoAlgorithmECDH::importKey):
* crypto/algorithms/CryptoAlgorithmECDH.h:
* crypto/algorithms/CryptoAlgorithmECDSA.cpp:
(WebCore::CryptoAlgorithmECDSA::sign):
(WebCore::CryptoAlgorithmECDSA::verify):
(WebCore::CryptoAlgorithmECDSA::importKey):
* crypto/algorithms/CryptoAlgorithmECDSA.h:
* crypto/algorithms/CryptoAlgorithmHKDF.cpp:
(WebCore::CryptoAlgorithmHKDF::deriveBits):
(WebCore::CryptoAlgorithmHKDF::importKey):
* crypto/algorithms/CryptoAlgorithmHKDF.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::sign):
(WebCore::CryptoAlgorithmHMAC::verify):
(WebCore::CryptoAlgorithmHMAC::importKey):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
(WebCore::CryptoAlgorithmPBKDF2::deriveBits):
(WebCore::CryptoAlgorithmPBKDF2::importKey):
* crypto/algorithms/CryptoAlgorithmPBKDF2.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::sign):
(WebCore::CryptoAlgorithmRSA_PSS::verify):
(WebCore::CryptoAlgorithmRSA_PSS::importKey):
* crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
* crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
(WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
* crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
(WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
* crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::platformSign):
(WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
(WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/mac/CryptoAlgorithmHKDFMac.cpp:
(WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
* crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
(WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
* crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
* crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::platformSign):
(WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
* crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h:
* crypto/parameters/CryptoAlgorithmAesCtrParams.h:
* crypto/parameters/CryptoAlgorithmAesGcmParams.h:
* crypto/parameters/CryptoAlgorithmEcKeyParams.h:
* crypto/parameters/CryptoAlgorithmEcdsaParams.h:
* crypto/parameters/CryptoAlgorithmHkdfParams.h:
* crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
* crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
* crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
* crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
* crypto/parameters/CryptoAlgorithmRsaPssParams.h:

LayoutTests:

crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html is an exception of this series of tests as
it only aims to test the correct behavoir of suggested algorithms. This patch aslo does some test
gardening.

* TestExpectations:
* crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key-expected.txt: Added.
* crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html: Added.
* http/wpt/crypto/aes-cbc-crash.any-expected.txt: Added.
* http/wpt/crypto/aes-cbc-crash.any.html: Added.
* http/wpt/crypto/aes-cbc-crash.any.js: Added.
* http/wpt/crypto/aes-cbc-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/aes-cbc-crash.any.worker.html: Added.
* http/wpt/crypto/aes-ctr-crash.any-expected.txt: Added.
* http/wpt/crypto/aes-ctr-crash.any.html: Added.
* http/wpt/crypto/aes-ctr-crash.any.js: Added.
* http/wpt/crypto/aes-ctr-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/aes-ctr-crash.any.worker.html: Added.
* http/wpt/crypto/aes-gcm-crash.any-expected.txt: Added.
* http/wpt/crypto/aes-gcm-crash.any.html: Added.
* http/wpt/crypto/aes-gcm-crash.any.js: Added.
* http/wpt/crypto/aes-gcm-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/aes-gcm-crash.any.worker.html: Added.
* http/wpt/crypto/derive-hmac-key-crash.any-expected.txt: Added.
* http/wpt/crypto/derive-hmac-key-crash.any.html: Added.
* http/wpt/crypto/derive-hmac-key-crash.any.js: Added.
* http/wpt/crypto/derive-hmac-key-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/derive-hmac-key-crash.any.worker.html: Added.
* http/wpt/crypto/ecdsa-crash.any-expected.txt: Added.
* http/wpt/crypto/ecdsa-crash.any.html: Added.
* http/wpt/crypto/ecdsa-crash.any.js: Added.
* http/wpt/crypto/ecdsa-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/ecdsa-crash.any.worker.html: Added.
* http/wpt/crypto/hkdf-crash.any-expected.txt: Added.
* http/wpt/crypto/hkdf-crash.any.html: Added.
* http/wpt/crypto/hkdf-crash.any.js: Added.
* http/wpt/crypto/hkdf-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/hkdf-crash.any.worker.html: Added.
* http/wpt/crypto/pbkdf2-crash.any-expected.txt: Added.
* http/wpt/crypto/pbkdf2-crash.any.html: Added.
* http/wpt/crypto/pbkdf2-crash.any.js: Added.
* http/wpt/crypto/pbkdf2-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/pbkdf2-crash.any.worker.html: Added.
* http/wpt/crypto/resources/common.js: Added.
* http/wpt/crypto/rsa-oaep-crash.any-expected.txt: Added.
* http/wpt/crypto/rsa-oaep-crash.any.html: Added.
* http/wpt/crypto/rsa-oaep-crash.any.js: Added.
* http/wpt/crypto/rsa-oaep-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/rsa-oaep-crash.any.worker.html: Added.
* http/wpt/crypto/rsa-pss-crash.any-expected.txt: Added.
* http/wpt/crypto/rsa-pss-crash.any.html: Added.
* http/wpt/crypto/rsa-pss-crash.any.js: Added.
* http/wpt/crypto/rsa-pss-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/rsa-pss-crash.any.worker.html: Added.
* http/wpt/crypto/unwrap-ec-key-crash.any-expected.txt: Added.
* http/wpt/crypto/unwrap-ec-key-crash.any.html: Added.
* http/wpt/crypto/unwrap-ec-key-crash.any.js: Added.
* http/wpt/crypto/unwrap-ec-key-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/unwrap-ec-key-crash.any.worker.html: Added.
* http/wpt/crypto/unwrap-rsa-key-crash.any-expected.txt: Added.
* http/wpt/crypto/unwrap-rsa-key-crash.any.html: Added.
* http/wpt/crypto/unwrap-rsa-key-crash.any.js: Added.
* http/wpt/crypto/unwrap-rsa-key-crash.any.worker.html: Added.
* http/wpt/crypto/unwrap-rsa-key-crash.any.worker-expected.txt: Added.

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

15 months agoTurn on PSON in WebKitTestRunner
cdumez@apple.com [Tue, 17 Jul 2018 21:50:09 +0000 (21:50 +0000)]
Turn on PSON in WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=186542

Reviewed by Brady Eidson.

Source/WebKit:

Fix leaking of pre-warmed WebContent processes which became obvious when turning
on process-swap-on-navigation by default in WebKitTestRunner. The issue was that
the WebProcessPool holds a strong reference to its WebProcessProxy objects via
m_processes data members. In turn, WebProcessProxy objects hold a strong reference
to their WebProcessPool via their m_processPool data member. This reference cycle
normally gets broken by calling WebProcessProxy::shutDown() which removes the
WebProcessProxy objects from its WebProcessPool's m_processes container.
WebProcessProxy::shutDown() normally gets called when a WebProcessProxy no longer
has any WebPageProxy objects. However, in the case of unused pre-warmed
WebProcessProxy objects, those never get any page and therefore we'd never break
the reference cycle. To address the issue, pre-warmed WebProcessProxy objects
now only hold a Weak reference to their process pool, only regular WebProcessProxy
objects hold a strong reference to their pool.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::~WebProcessPool):
(WebKit::WebProcessPool::tryTakePrewarmedProcess):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::WebProcessProxy):
(WebKit::WebProcessProxy::getLaunchOptions):
(WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::processPool):
(WebKit::WebProcessProxy::WeakOrStrongPtr::WeakOrStrongPtr):
(WebKit::WebProcessProxy::WeakOrStrongPtr::setIsWeak):
(WebKit::WebProcessProxy::WeakOrStrongPtr::get const):
(WebKit::WebProcessProxy::WeakOrStrongPtr::operator-> const):
(WebKit::WebProcessProxy::WeakOrStrongPtr::operator* const):
(WebKit::WebProcessProxy::WeakOrStrongPtr::operator bool const):
(WebKit::WebProcessProxy::WeakOrStrongPtr::updateStrongReference):

Tools:

Turn on PSON by default in WebKitTestRunner.

* WebKitTestRunner/TestOptions.h:

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

15 months agoUnskip LayoutTest imported/w3c/web-platform-tests/css/css-display/display-contents...
ryanhaddad@apple.com [Tue, 17 Jul 2018 20:50:52 +0000 (20:50 +0000)]
Unskip LayoutTest imported/w3c/web-platform-tests/css/css-display/display-contents-first-letter-002.html.
https://bugs.webkit.org/show_bug.cgi?id=186901

Unreviewed test gardening.

* TestExpectations:

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

15 months agoCodeBlock::baselineVersion() should account for executables with purged codeBlocks.
mark.lam@apple.com [Tue, 17 Jul 2018 20:20:21 +0000 (20:20 +0000)]
CodeBlock::baselineVersion() should account for executables with purged codeBlocks.
https://bugs.webkit.org/show_bug.cgi?id=187736
<rdar://problem/42114371>

Reviewed by Michael Saboff.

CodeBlock::baselineVersion() currently checks for a null replacement but does not
account for the fact that that the replacement can also be null due to the
executable having being purged of its codeBlocks due to a memory event (see
ExecutableBase::clearCode()).  This patch adds code to account for this.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::baselineVersion):

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

15 months ago[Web Animations] Interpolation between lengths with an "auto" value should be discrete
commit-queue@webkit.org [Tue, 17 Jul 2018 18:54:05 +0000 (18:54 +0000)]
[Web Animations] Interpolation between lengths with an "auto" value should be discrete
https://bugs.webkit.org/show_bug.cgi?id=187721

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

LayoutTests/imported/w3c:

Mark 2 new WPT progressions.

* web-platform-tests/web-animations/animation-model/animation-types/discrete-expected.txt:

Source/WebCore:

When interpolating between two Length values, if one is "auto", we should use the from-value
from 0 and up to (but excluding) 0.5, and use the to-value from 0.5 to 1.

This change caused a regression in the legacy animation engine since it would create a CSS
transition even when the underlying and target values were non-interpolable. As such, the
underlying value would be used until the transition's mid-point and the tests at
legacy-animation-engine/imported/blink/transitions/transition-not-interpolable.html and
legacy-animation-engine/fast/animation/height-auto-transition-computed-value.html would fail
expecting the target value to be used immediately. We now ensure that no transition is actually
started if two values for a given property cannot be interpolated.

* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::updateTransitions):
* platform/Length.cpp:
(WebCore::blend):

LayoutTests:

Make two more tests opt into the new animation engine since they pass and they're not in the legacy-animation-engine directory.
A third test now has some logging due to transitions not actually running, which is expected and correct.

* fast/animation/height-auto-transition-computed-value.html:
* imported/blink/transitions/transition-not-interpolable.html:
* legacy-animation-engine/transitions/transition-to-from-auto-expected.txt:

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

15 months agoAdd an SPI hook to allow clients to yield document parsing and script execution
wenson_hsieh@apple.com [Tue, 17 Jul 2018 18:23:36 +0000 (18:23 +0000)]
Add an SPI hook to allow clients to yield document parsing and script execution
https://bugs.webkit.org/show_bug.cgi?id=187682
<rdar://problem/42207453>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Using a single web process for both the Reader page and original web page on watchOS has multiple benefits,
including: (1) allowing the user to bail out of Reader and view the original web page without having to load it
again, and (2) improving the bringup time of the Reader page, since subresources are already cached in process
and we don't eat the additional cost of a web process launch if prewarming fails.

However, this has some drawbacks as well, one of which is that main thread work being done on behalf of the
original page may contend with work being done to load and render the Reader page. This is especially bad when
the page is in the middle of executing heavy script after Safari has already detected that the Reader version of
the page is available, but before it has finished loading the Reader page. The result is that script on the
original page may block the first paint of the Reader page (on New York Times articles, this often leads to an
apparent page load time of 25-35 seconds before the user sees anything besides a blank screen).

To mitigate this, we introduce a way for injected bundle clients to yield parsing and async script execution on
a document. This capability is surfaced in the form of an opaque token which clients may request from a
WKDOMDocument. Construction of the token causes the document to begin yielding and defer execution of previously
scheduled scripts, only if there were no active tokens on the document already. Similarly, destruction of all
active tokens on the document causes it to stop yielding and resume execution of scripts if needed.

Tests:  ParserYieldTokenTests.PreventDocumentLoadByTakingParserYieldToken
        ParserYieldTokenTests.TakeMultipleParserYieldTokens
        ParserYieldTokenTests.DeferredScriptExecutesBeforeDocumentLoadWhenTakingParserYieldToken
        ParserYieldTokenTests.AsyncScriptRunsWhenFetched

* dom/Document.cpp:
(WebCore::Document::implicitOpen):

If the parser yield token was taken before the document's parser was created, tell the parser's scheduler to
start yielding immediately after creation.

(WebCore::DocumentParserYieldToken::DocumentParserYieldToken):
(WebCore::DocumentParserYieldToken::~DocumentParserYieldToken):
* dom/Document.h:

Introduce a parser yield count to Document; as long as this count is greater than 0, we consider the Document to
have active yield tokens. When constructing or destroying a ParserYieldToken, we increment and decrement the
parser yield count (respectively).

(WebCore::Document::createParserYieldToken):
(WebCore::Document::hasActiveParserYieldToken const):
* dom/DocumentParser.h:
(WebCore::DocumentParser::didBeginYieldingParser):
(WebCore::DocumentParser::didEndYieldingParser):

Hooks for Document to tell its parser that we've started or finished yielding. This updates a flag on the
parser's scheduler which is consulted when we determine whether to yield before a pumping token or executing
script.

* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::resume):
(WebCore::ScriptRunner::notifyFinished):
* dom/ScriptRunner.h:
(WebCore::ScriptRunner::didBeginYieldingParser):
(WebCore::ScriptRunner::didEndYieldingParser):

Hooks for Document to tell its ScriptRunner that we've started or finished yielding. These wrap calls to suspend
and resume.

* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::didBeginYieldingParser):
(WebCore::HTMLDocumentParser::didEndYieldingParser):

Plumb to didBegin/didEnd calls to the HTMLParserScheduler.

* html/parser/HTMLDocumentParser.h:
* html/parser/HTMLParserScheduler.cpp:
(WebCore::HTMLParserScheduler::shouldYieldBeforeExecutingScript):
* html/parser/HTMLParserScheduler.h:
(WebCore::HTMLParserScheduler::shouldYieldBeforeToken):

Consult a flag when determining whether to yield. This flag is set to true only while the document has an active
parser yield token.

(WebCore::HTMLParserScheduler::isScheduledForResume const):

Consider the parser scheduler to be scheduled for resume if there are active tokens. Without this change, we
incorrectly consider the document to be finished loading when we have yield tokens, since it appears that the
parser is no longer scheduled to pump its tokenizer.

(WebCore::HTMLParserScheduler::didBeginYieldingParser):
(WebCore::HTMLParserScheduler::didEndYieldingParser):

When the Document begins yielding due to the documet having active tokens or ends yielding after the document
loses all of its yield tokens, update a flag on the parser scheduler. After we finish yielding, additionally
reschedule the parser if needed to ensure that we continue parsing the document; without this additional change
to resume, we'll never get the document load or load events after relinquishing the yield token.

Source/WebKit:

Add hooks to WKDOMDocument to create and return an internal WKDOMDocumentParserYieldToken object, whose lifetime
is tied to a document parser yield token. See WebCore ChangeLog for more detail.

* WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
* WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
(-[WKDOMDocumentParserYieldToken initWithDocument:]):
(-[WKDOMDocument parserYieldToken]):

Tools:

Add a few tests to exercise the new document yield token SPI, verifying that clients can use the SPI to defer
document load, and that doing so doesn't cause deferred `script` to execute in the wrong order (i.e. before
synchronous script, or after "DOMContentLoaded").

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/ParserYieldTokenPlugIn.mm: Added.
(-[ParserYieldTokenPlugIn takeDocumentParserTokenAfterCommittingLoad]):
(-[ParserYieldTokenPlugIn releaseDocumentParserToken]):
(-[ParserYieldTokenPlugIn webProcessPlugInBrowserContextController:didCommitLoadForFrame:]):
(-[ParserYieldTokenPlugIn webProcessPlugIn:didCreateBrowserContextController:]):
(-[ParserYieldTokenPlugIn webProcessPlugInBrowserContextController:didFinishDocumentLoadForFrame:]):
(-[ParserYieldTokenPlugIn webProcessPlugInBrowserContextController:didFinishLoadForFrame:]):

Add an injected bundle object that knows how to take and release multiple document parser yield tokens.

* TestWebKitAPI/Tests/WebKitCocoa/ParserYieldTokenTests.h: Added.
* TestWebKitAPI/Tests/WebKitCocoa/ParserYieldTokenTests.mm: Added.
(+[ParserYieldTokenTestWebView webView]):
(-[ParserYieldTokenTestWebView bundle]):
(-[ParserYieldTokenTestWebView schemeHandler]):
(-[ParserYieldTokenTestWebView didFinishDocumentLoad]):
(-[ParserYieldTokenTestWebView didFinishLoad]):
(waitForDelay):
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/TestURLSchemeHandler.h: Added.
* TestWebKitAPI/Tests/WebKitCocoa/TestURLSchemeHandler.mm: Added.
(-[TestURLSchemeHandler webView:startURLSchemeTask:]):
(-[TestURLSchemeHandler webView:stopURLSchemeTask:]):
(-[TestURLSchemeHandler setStartURLSchemeTaskHandler:]):
(-[TestURLSchemeHandler startURLSchemeTaskHandler]):
(-[TestURLSchemeHandler setStopURLSchemeTaskHandler:]):
(-[TestURLSchemeHandler stopURLSchemeTaskHandler]):

Add a new test helper class to handle custom schemes via a block-based API.

* TestWebKitAPI/Tests/WebKitCocoa/text-with-async-script.html: Added.

New test HTML page that contains a deferred script element, a synchronous script element, another deferred
script element, and then some text, images, and links.

* TestWebKitAPI/Tests/WebKitCocoa/text-with-deferred-script.html: Added.

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

15 months agoAdding myself to Contributors.json
tsavell@apple.com [Tue, 17 Jul 2018 18:21:55 +0000 (18:21 +0000)]
Adding myself to Contributors.json

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

15 months ago[macOS] TestWebKitAPI.PictureInPicture.WKUIDelegate is timing out
commit-queue@webkit.org [Tue, 17 Jul 2018 18:04:46 +0000 (18:04 +0000)]
[macOS] TestWebKitAPI.PictureInPicture.WKUIDelegate is timing out
https://bugs.webkit.org/show_bug.cgi?id=187730

Patch by Aditya Keerthi <akeerthi@apple.com> on 2018-07-17
Reviewed by Jer Noble.

This regression was introduced by r233865. PIP can now only be initiated from a
window that is on screen.

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

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

15 months agoAdd completion handlers to TestRunner functions setStatisticsLastSeen(), setStatistic...
wilander@apple.com [Tue, 17 Jul 2018 17:45:41 +0000 (17:45 +0000)]
Add completion handlers to TestRunner functions setStatisticsLastSeen(), setStatisticsPrevalentResource(), setStatisticsVeryPrevalentResource(), setStatisticsHasHadUserInteraction(), and setStatisticsHasHadNonRecentUserInteraction()
https://bugs.webkit.org/show_bug.cgi?id=187710
<rdar://problem/42252757>

Reviewed by Chris Dumez.

Source/WebKit:

These changes are to back the completion handler functionality of
TestRunner functions:
- setStatisticsLastSeen(),
- setStatisticsPrevalentResource(),
- setStatisticsVeryPrevalentResource(),
- setStatisticsHasHadUserInteraction(), and
- setStatisticsHasHadNonRecentUserInteraction().

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetStatisticsLastSeen):
(WKWebsiteDataStoreSetStatisticsPrevalentResource):
(WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
(WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
(WKWebsiteDataStoreSetStatisticsHasHadNonRecentUserInteraction):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::setLastSeen):
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
* UIProcess/WebResourceLoadStatisticsStore.h:

Tools:

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setStatisticsLastSeen):
(WTR::TestRunner::statisticsCallDidSetLastSeenCallback):
(WTR::TestRunner::setStatisticsPrevalentResource):
(WTR::TestRunner::statisticsCallDidSetPrevalentResourceCallback):
(WTR::TestRunner::setStatisticsVeryPrevalentResource):
(WTR::TestRunner::statisticsCallDidSetVeryPrevalentResourceCallback):
(WTR::TestRunner::setStatisticsHasHadUserInteraction):
(WTR::TestRunner::setStatisticsHasHadNonRecentUserInteraction):
(WTR::TestRunner::statisticsCallDidSetHasHadUserInteractionCallback):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::setStatisticsLastSeen):
(WTR::TestController::setStatisticsPrevalentResource):
(WTR::TestController::setStatisticsVeryPrevalentResource):
(WTR::TestController::setStatisticsHasHadUserInteraction):
(WTR::TestController::setStatisticsHasHadNonRecentUserInteraction):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didSetLastSeen):
(WTR::TestInvocation::didSetPrevalentResource):
(WTR::TestInvocation::didSetVeryPrevalentResource):
(WTR::TestInvocation::didSetHasHadUserInteraction):
(WTR::TestInvocation::didSetHasHadNonRecentUserInteraction):
* WebKitTestRunner/TestInvocation.h:

LayoutTests:

These changes are to update all test cases that make use of
TestRunner functions:
- setStatisticsLastSeen(),
- setStatisticsPrevalentResource(),
- setStatisticsVeryPrevalentResource(),
- setStatisticsHasHadUserInteraction(), and
- setStatisticsHasHadNonRecentUserInteraction().

* http/tests/resourceLoadStatistics/add-blocking-to-redirect.html:
* http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html:
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html:
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html:
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html:
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-to-prevalent.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-to-prevalent.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to.html:
* http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics.html:
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html:
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store.html:
* http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect.html:
* http/tests/resourceLoadStatistics/grandfathering.html:
* http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html:
* http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html:
* http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html:
* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html:
* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout-expected.txt:
* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html:
* http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction.html:
* http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown.html:
* http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown.html:
* http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html:
* http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction.html:
* http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction.html:
* http/tests/resourceLoadStatistics/prune-statistics.html:
* http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html:
* http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html:
* http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects.html:
* http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests.html:
* http/tests/resourceLoadStatistics/telemetry-generation.html:
* http/tests/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction.html:
* http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html:

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

15 months agoRebaseline displaylists/extent-includes-* tests for mac-wk1 after r233869.
ryanhaddad@apple.com [Tue, 17 Jul 2018 16:59:05 +0000 (16:59 +0000)]
Rebaseline displaylists/extent-includes-* tests for mac-wk1 after r233869.
https://bugs.webkit.org/show_bug.cgi?id=187574

Unreviewed test gardening.

* platform/mac-wk1/displaylists/extent-includes-shadow-expected.txt:
* platform/mac-wk1/displaylists/extent-includes-transforms-expected.txt:

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

15 months ago[clip-path] Implement support for margin-box as reference box and box shape
krit@webkit.org [Tue, 17 Jul 2018 16:52:04 +0000 (16:52 +0000)]
[clip-path] Implement support for margin-box as reference box and box shape
https://bugs.webkit.org/show_bug.cgi?id=127984

Reviewed by Simon Fraser.

Compute the margin-box rectangle as needed for clip-path based on the actual
computed values for the margin-top, *-left, *-bottom, *-right properties.

Source/WebCore:

Test: css3/masking/clip-path-margin-box.html

* rendering/RenderBox.h:
(WebCore::RenderBox::marginBoxRect const):
* rendering/RenderBoxModelObject.h:
* rendering/RenderLayer.cpp:
(WebCore::computeReferenceBox):

LayoutTests:

* css3/masking/clip-path-circle-margin-box-expected.html: Added.
* css3/masking/clip-path-margin-box-expected.html: Added.
* css3/masking/clip-path-margin-box.html: Added.
* platform/mac/css3/masking/clip-path-circle-margin-box-expected.png: Removed.
* platform/mac/css3/masking/clip-path-circle-margin-box-expected.txt: Removed.

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

15 months agoDelete content of a single cell table should not delete the whole table
jfernandez@igalia.com [Tue, 17 Jul 2018 08:48:49 +0000 (08:48 +0000)]
Delete content of a single cell table should not delete the whole table
https://bugs.webkit.org/show_bug.cgi?id=173117

Reviewed by Ryosuke Niwa.

Source/WebCore:

We should not extend selection looking for special elements if the
delete operation has been triggered by a caret based selection.

This change is based on a recent [1] resolution of the Editing TF,
which acknowledges that behavior of single-cell tables must be the
same that multi-cell tables and even if the last character is
deleted, we should not delete the whole table structure.

A different case would be when the user actively selects the whole
content of a table; in this case, as we do in multi-cell tables,
the structure of single-cell tables should be deleted together
with the content.

[1] https://github.com/w3c/editing/issues/163

Tests: editing/deleting/backspace-delete-last-char-in-table.html
       editing/deleting/forward-delete-last-char-in-table.html
       editing/deleting/select-and-delete-last-char-in-table.html

* editing/TypingCommand.cpp:
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):

LayoutTests:

Tests to verify that single-cell tables are not deleted when their
last character is deleted, unless it was previously selected by
the user.

Changes two expected files to adapt them to the new logic.

* LayoutTests/editing/deleting/deleting-relative-positioned-special-element-expected.txt: The paragraph is not deleted, even if it's empty. The paragraphs above are not merged, which was the goal of the test.
* editing/deleting/delete-last-char-in-table-expected.txt: The table is not removed, even if it's empty. The formatted elements are deleted, which was the goal of the test.
* editing/deleting/backspace-delete-last-char-in-table-expected.txt: Added.
* editing/deleting/backspace-delete-last-char-in-table.html: Added.
* editing/deleting/forward-delete-last-char-in-table-expected.txt: Added.
* editing/deleting/forward-delete-last-char-in-table.html: Added.
* editing/deleting/select-and-delete-last-char-in-table-expected.txt: Added.
* editing/deleting/select-and-delete-last-char-in-table.html: Added.

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

15 months agoCustomConfigurationTestGroupForm should dispatch different arguments based on whether...
dewei_zhu@apple.com [Tue, 17 Jul 2018 05:07:34 +0000 (05:07 +0000)]
CustomConfigurationTestGroupForm should dispatch different arguments based on whether analysis task is created.
https://bugs.webkit.org/show_bug.cgi?id=187675

Reviewed by Ryosuke Niwa.

This change will fix the bug that no notification will be sent for any test groups except the
first one in any custom perf-try A/B task.

* public/v3/components/custom-configuration-test-group-form.js:
(CustomConfigurationTestGroupForm.prototype.startTesting): Conditionally includes taskName based on
whether or not analysis task is created.

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

15 months agoCorrectly adjust scroll offsets when a page is zoomed
megan_gardner@apple.com [Tue, 17 Jul 2018 04:44:23 +0000 (04:44 +0000)]
Correctly adjust scroll offsets when a page is zoomed
https://bugs.webkit.org/show_bug.cgi?id=187673
<rdar://problem/41712829>

Reviewed by Wenson Hsieh.

Will add test later.

Make sure that distance is scaled by the pageScaleFactor, to
make sure that we scroll correctly when we are zoomed in.

* page/ios/EventHandlerIOS.mm:
(WebCore::autoscrollAdjustmentFactorForScreenBoundaries):

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

15 months ago Roll out r233873 and r233875 since they caused 8 new layout test crashes.
simon.fraser@apple.com [Tue, 17 Jul 2018 04:22:22 +0000 (04:22 +0000)]
    Roll out r233873 and r233875 since they caused 8 new layout test crashes.

        * TestExpectations:
        * crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key-expected.txt: Removed.
        * crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html: Removed.
        * http/wpt/crypto/aes-cbc-crash.any-expected.txt: Removed.
        * http/wpt/crypto/aes-cbc-crash.any.html: Removed.
        * http/wpt/crypto/aes-cbc-crash.any.js: Removed.
        * http/wpt/crypto/aes-cbc-crash.any.worker-expected.txt: Removed.
        * http/wpt/crypto/aes-cbc-crash.any.worker.html: Removed.
        * http/wpt/crypto/aes-ctr-crash.any-expected.txt: Removed.
        * http/wpt/crypto/aes-ctr-crash.any.html: Removed.
        * http/wpt/crypto/aes-ctr-crash.any.js: Removed.
        * http/wpt/crypto/aes-ctr-crash.any.worker-expected.txt: Removed.
        * http/wpt/crypto/aes-ctr-crash.any.worker.html: Removed.
        * http/wpt/crypto/aes-gcm-crash.any-expected.txt: Removed.
        * http/wpt/crypto/aes-gcm-crash.any.html: Removed.
        * http/wpt/crypto/aes-gcm-crash.any.js: Removed.
        * http/wpt/crypto/aes-gcm-crash.any.worker-expected.txt: Removed.
        * http/wpt/crypto/aes-gcm-crash.any.worker.html: Removed.
        * http/wpt/crypto/derive-hmac-key-crash.any-expected.txt: Removed.
        * http/wpt/crypto/derive-hmac-key-crash.any.html: Removed.
        * http/wpt/crypto/derive-hmac-key-crash.any.js: Removed.
        * http/wpt/crypto/derive-hmac-key-crash.any.worker-expected.txt: Removed.
        * http/wpt/crypto/derive-hmac-key-crash.any.worker.html: Removed.
        * http/wpt/crypto/ecdsa-crash.any-expected.txt: Removed.
        * http/wpt/crypto/ecdsa-crash.any.html: Removed.
        * http/wpt/crypto/ecdsa-crash.any.js: Removed.
        * http/wpt/crypto/ecdsa-crash.any.worker-expected.txt: Removed.
        * http/wpt/crypto/ecdsa-crash.any.worker.html: Removed.
        * http/wpt/crypto/hkdf-crash.any-expected.txt: Removed.
        * http/wpt/crypto/hkdf-crash.any.html: Removed.
        * http/wpt/crypto/hkdf-crash.any.js: Removed.
        * http/wpt/crypto/hkdf-crash.any.worker-expected.txt: Removed.
        * http/wpt/crypto/hkdf-crash.any.worker.html: Removed.
        * http/wpt/crypto/pbkdf2-crash.any-expected.txt: Removed.
        * http/wpt/crypto/pbkdf2-crash.any.html: Removed.
        * http/wpt/crypto/pbkdf2-crash.any.js: Removed.
        * http/wpt/crypto/pbkdf2-crash.any.worker-expected.txt: Removed.
        * http/wpt/crypto/pbkdf2-crash.any.worker.html: Removed.
        * http/wpt/crypto/resources/common.js: Removed.
        * http/wpt/crypto/rsa-oaep-crash.any-expected.txt: Removed.
        * http/wpt/crypto/rsa-oaep-crash.any.html: Removed.
        * http/wpt/crypto/rsa-oaep-crash.any.js: Removed.
        * http/wpt/crypto/rsa-oaep-crash.any.worker-expected.txt: Removed.
        * http/wpt/crypto/rsa-oaep-crash.any.worker.html: Removed.
        * http/wpt/crypto/rsa-pss-crash.any-expected.txt: Removed.
        * http/wpt/crypto/rsa-pss-crash.any.html: Removed.
        * http/wpt/crypto/rsa-pss-crash.any.js: Removed.
        * http/wpt/crypto/rsa-pss-crash.any.worker-expected.txt: Removed.
        * http/wpt/crypto/rsa-pss-crash.any.worker.html: Removed.
        * http/wpt/crypto/unwrap-ec-key-crash.any-expected.txt: Removed.
        * http/wpt/crypto/unwrap-ec-key-crash.any.html: Removed.
        * http/wpt/crypto/unwrap-ec-key-crash.any.js: Removed.
        * http/wpt/crypto/unwrap-ec-key-crash.any.worker-expected.txt: Removed.
        * http/wpt/crypto/unwrap-ec-key-crash.any.worker.html: Removed.
        * http/wpt/crypto/unwrap-rsa-key-crash.any-expected.txt: Removed.
        * http/wpt/crypto/unwrap-rsa-key-crash.any.html: Removed.
        * http/wpt/crypto/unwrap-rsa-key-crash.any.js: Removed.
        * http/wpt/crypto/unwrap-rsa-key-crash.any.worker-expected.txt: Removed.
        * http/wpt/crypto/unwrap-rsa-key-crash.any.worker.html: Removed.

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

15 months agoUpdate ReadMe.md line 68
rniwa@webkit.org [Tue, 17 Jul 2018 03:38:25 +0000 (03:38 +0000)]
Update ReadMe.md line 68
https://bugs.webkit.org/show_bug.cgi?id=187533

Reviewed by Wenson Hsieh.

* ReadMe.md:

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

15 months ago[ WK2 ] Layout Test editing/selection/update-selection-by-style-change.html is flaky
rniwa@webkit.org [Tue, 17 Jul 2018 03:33:14 +0000 (03:33 +0000)]
[ WK2 ] Layout Test editing/selection/update-selection-by-style-change.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=187649

Reviewed by Wenson Hsieh.

Force update the selection before ending the test.

* editing/selection/update-selection-by-style-change.html:

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

15 months agoRelease assert in ~TimerBase is getting hit in WK1 apps which uses JSC API directly
rniwa@webkit.org [Tue, 17 Jul 2018 02:50:11 +0000 (02:50 +0000)]
Release assert in ~TimerBase is getting hit in WK1 apps which uses JSC API directly
https://bugs.webkit.org/show_bug.cgi?id=187713
<rdar://problem/41759548>

Reviewed by Simon Fraser.

Turn this into a debug assertion in WebKit1 on iOS since JSC API doesn't grab the web thread lock,
which means that Timer can get destroyed without the web thread lock in the main thread.

* platform/Timer.cpp:
(WebCore::TimerBase::~TimerBase):
(WebCore::TimerBase::setNextFireTime):

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

15 months agoFix API Test failures introduced by r233865
commit-queue@webkit.org [Tue, 17 Jul 2018 02:17:38 +0000 (02:17 +0000)]
Fix API Test failures introduced by r233865
https://bugs.webkit.org/show_bug.cgi?id=187720

Unreviewed APITest fix after r233865.

Fullscreen can now only be initiated from a window that is on screen.

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-07-16

* TestWebKitAPI/Tests/WebKitCocoa/FullscreenDelegate.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/FullscreenTopContentInset.mm:
(TestWebKitAPI::TEST):

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

15 months agoAdd color filter for transforming colors in Dark Mode
simon.fraser@apple.com [Tue, 17 Jul 2018 02:03:33 +0000 (02:03 +0000)]
Add color filter for transforming colors in Dark Mode
https://bugs.webkit.org/show_bug.cgi?id=187717
Source/WebCore:

rdar://problem/41146650

Reviewed by Dean Jackson.

Add a new filter function for use in -apple-color-filter for transforming colors
when in Dark Mode. The filter is called apple-invert-lightness(), and takes no parameters.
It's based on a lightness invert in HSL space, with some adjustments to improve the contrast
of some colors on dark backgrounds, so does a much better job that using invert() with hue-rotate().

Test: css3/color-filters/color-filter-apple-invert-lightness.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForFilter):
* css/CSSValueKeywords.in:
* css/StyleResolver.cpp:
(WebCore::filterOperationForType):
(WebCore::StyleResolver::createFilterOperations):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeFilterImage):
(WebCore::CSSPropertyParserHelpers::isPixelFilterFunction):
(WebCore::CSSPropertyParserHelpers::isColorFilterFunction):
(WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
(WebCore::CSSPropertyParserHelpers::consumeFilter):
(WebCore::CSSPropertyParserHelpers::isValidPrimitiveFilterFunction): Deleted.
* css/parser/CSSPropertyParserHelpers.h:
* page/FrameView.cpp:
(WebCore::FrameView::paintContents):
* platform/graphics/Color.cpp:
* platform/graphics/ColorUtilities.cpp:
(WebCore::sRGBToLinearComponents):
(WebCore::linearToSRGBComponents):
(WebCore::sRGBToLinearColorComponentForLuminance):
(WebCore::luminance):
(WebCore::sRGBToHSL):
(WebCore::calcHue):
(WebCore::HSLToSRGB):
(WebCore::ColorMatrix::ColorMatrix):
* platform/graphics/ColorUtilities.h:
* platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
(PlatformCAFilters::filterValueForOperation):
(PlatformCAFilters::colorMatrixValueForFilter):
* platform/graphics/filters/FEColorMatrix.cpp:
* platform/graphics/filters/FilterOperation.cpp:
(WebCore::InvertLightnessFilterOperation::operator== const):
(WebCore::InvertLightnessFilterOperation::blend):
(WebCore::InvertLightnessFilterOperation::transformColor const):
(WebCore::operator<<):
* platform/graphics/filters/FilterOperation.h:
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::build):

Source/WebKit:

Reviewed by Dean Jackson.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<FilterOperation>::encode):
(IPC::decodeFilterOperation):

LayoutTests:

rdar://problem/41146650

Reviewed by Dean Jackson.

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

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

15 months agoBlack flash in content area when returning to Mail
timothy_horton@apple.com [Tue, 17 Jul 2018 01:10:01 +0000 (01:10 +0000)]
Black flash in content area when returning to Mail
https://bugs.webkit.org/show_bug.cgi?id=187719
<rdar://problem/42165340>

Reviewed by Wenson Hsieh.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
This still reproduces sometimes even after r233723, because:

If a pending commit arrives after ApplicationDidEnterBackground (when we
ask the web content process to freeze the layer tree), and after
ApplicationDidFinishSnapshottingAfterEnteringBackground (when we hide
WKContentView), but before the process sleeps, it will cause WKContentView
to be unhidden (potentially including layers with empty surfaces as contents).
Nothing will re-hide WKContentView. Instead, we should wait for the next
*pending* commit, which will necessarily not come until after the application
returns to the foreground because of the strict IPC ordering between
the message that freezes the layer tree and the "next commit" mechanism.

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

15 months agoUnreviewed, build fix for r233873.
jiewen_tan@apple.com [Tue, 17 Jul 2018 01:03:20 +0000 (01:03 +0000)]
Unreviewed, build fix for r233873.

* crypto/SubtleCrypto.cpp:
(WebCore::crossThreadCopyImportParams):

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

15 months ago[WebCrypto] Crypto operations should copy their parameters before hoping to another...
jiewen_tan@apple.com [Tue, 17 Jul 2018 00:31:49 +0000 (00:31 +0000)]
[WebCrypto] Crypto operations should copy their parameters before hoping to another thread
https://bugs.webkit.org/show_bug.cgi?id=187501
<rdar://problem/41438160>

Reviewed by Youenn Fablet.

Source/WebCore:

This patch aims at making all captured variables in all crypto lambdas that need to be passed
to a worker thread thread safe, which includes:
1) changing ref counted objects to thread safe ref counted object.
2) adding isolatedCopy methods to non ref counted classes, so they can be called by CrossThreadCopy().

In addition to above changes, this patch also does the following things:
1) change the name CryptoAlgorithm::dispatchOperation => CryptoAlgorithm::dispatchOperationInWorkQueue
to make it clear that lambdas will be passed to a secondary thread.
2) make CryptoAlgorithmParameters as const parameters for all methods.

Tests: crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html
       http/wpt/crypto/aes-cbc-crash.any.html
       http/wpt/crypto/aes-cbc-crash.any.worker.html
       http/wpt/crypto/aes-ctr-crash.any.html
       http/wpt/crypto/aes-ctr-crash.any.worker.html
       http/wpt/crypto/aes-gcm-crash.any.html
       http/wpt/crypto/aes-gcm-crash.any.worker.html
       http/wpt/crypto/derive-hmac-key-crash.any.html
       http/wpt/crypto/derive-hmac-key-crash.any.worker.html
       http/wpt/crypto/ecdsa-crash.any.html
       http/wpt/crypto/ecdsa-crash.any.worker.html
       http/wpt/crypto/hkdf-crash.any.html
       http/wpt/crypto/hkdf-crash.any.worker.html
       http/wpt/crypto/pbkdf2-crash.any.html
       http/wpt/crypto/pbkdf2-crash.any.worker.html
       http/wpt/crypto/rsa-oaep-crash.any.html
       http/wpt/crypto/rsa-oaep-crash.any.worker.html
       http/wpt/crypto/rsa-pss-crash.any.html
       http/wpt/crypto/rsa-pss-crash.any.worker.html
       http/wpt/crypto/unwrap-ec-key-crash.any.html
       http/wpt/crypto/unwrap-ec-key-crash.any.worker.html
       http/wpt/crypto/unwrap-rsa-key-crash.any.html
       http/wpt/crypto/unwrap-rsa-key-crash.any.worker.html

* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::encrypt):
(WebCore::CryptoAlgorithm::decrypt):
(WebCore::CryptoAlgorithm::sign):
(WebCore::CryptoAlgorithm::verify):
(WebCore::CryptoAlgorithm::deriveBits):
(WebCore::CryptoAlgorithm::importKey):
(WebCore::dispatchAlgorithmOperation):
(WebCore::CryptoAlgorithm::dispatchOperationInWorkQueue):
(WebCore::CryptoAlgorithm::dispatchOperation): Deleted.
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.cpp:
(WebCore::crossThreadCopyImportParams):
(WebCore::SubtleCrypto::encrypt):
(WebCore::SubtleCrypto::decrypt):
(WebCore::SubtleCrypto::sign):
(WebCore::SubtleCrypto::verify):
(WebCore::SubtleCrypto::deriveKey):
(WebCore::SubtleCrypto::deriveBits):
(WebCore::SubtleCrypto::importKey):
(WebCore::SubtleCrypto::wrapKey):
(WebCore::SubtleCrypto::unwrapKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::encrypt):
(WebCore::CryptoAlgorithmAES_CBC::decrypt):
(WebCore::CryptoAlgorithmAES_CBC::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
(WebCore::CryptoAlgorithmAES_CFB::encrypt):
(WebCore::CryptoAlgorithmAES_CFB::decrypt):
(WebCore::CryptoAlgorithmAES_CFB::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CFB.h:
* crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
(WebCore::parametersAreValid):
(WebCore::CryptoAlgorithmAES_CTR::encrypt):
(WebCore::CryptoAlgorithmAES_CTR::decrypt):
(WebCore::CryptoAlgorithmAES_CTR::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CTR.h:
* crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
(WebCore::CryptoAlgorithmAES_GCM::encrypt):
(WebCore::CryptoAlgorithmAES_GCM::decrypt):
(WebCore::CryptoAlgorithmAES_GCM::importKey):
* crypto/algorithms/CryptoAlgorithmAES_GCM.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::importKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmECDH.cpp:
(WebCore::CryptoAlgorithmECDH::deriveBits):
(WebCore::CryptoAlgorithmECDH::importKey):
* crypto/algorithms/CryptoAlgorithmECDH.h:
* crypto/algorithms/CryptoAlgorithmECDSA.cpp:
(WebCore::CryptoAlgorithmECDSA::sign):
(WebCore::CryptoAlgorithmECDSA::verify):
(WebCore::CryptoAlgorithmECDSA::importKey):
* crypto/algorithms/CryptoAlgorithmECDSA.h:
* crypto/algorithms/CryptoAlgorithmHKDF.cpp:
(WebCore::CryptoAlgorithmHKDF::deriveBits):
(WebCore::CryptoAlgorithmHKDF::importKey):
* crypto/algorithms/CryptoAlgorithmHKDF.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::sign):
(WebCore::CryptoAlgorithmHMAC::verify):
(WebCore::CryptoAlgorithmHMAC::importKey):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
(WebCore::CryptoAlgorithmPBKDF2::deriveBits):
(WebCore::CryptoAlgorithmPBKDF2::importKey):
* crypto/algorithms/CryptoAlgorithmPBKDF2.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::sign):
(WebCore::CryptoAlgorithmRSA_PSS::verify):
(WebCore::CryptoAlgorithmRSA_PSS::importKey):
* crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
* crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
(WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
* crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
(WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
* crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::platformSign):
(WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
(WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/mac/CryptoAlgorithmHKDFMac.cpp:
(WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
* crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
(WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
* crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
* crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::platformSign):
(WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
* crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h:
* crypto/parameters/CryptoAlgorithmAesCtrParams.h:
* crypto/parameters/CryptoAlgorithmAesGcmParams.h:
* crypto/parameters/CryptoAlgorithmEcKeyParams.h:
* crypto/parameters/CryptoAlgorithmEcdsaParams.h:
* crypto/parameters/CryptoAlgorithmHkdfParams.h:
* crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
* crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
* crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
* crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
* crypto/parameters/CryptoAlgorithmRsaPssParams.h:

LayoutTests:

crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html is an exception of this series of tests as
it only aims to test the correct behavoir of suggested algorithms. This patch aslo does some test
gardening.

* TestExpectations:
* crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key-expected.txt: Added.
* crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html: Added.
* http/wpt/crypto/aes-cbc-crash.any-expected.txt: Added.
* http/wpt/crypto/aes-cbc-crash.any.html: Added.
* http/wpt/crypto/aes-cbc-crash.any.js: Added.
* http/wpt/crypto/aes-cbc-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/aes-cbc-crash.any.worker.html: Added.
* http/wpt/crypto/aes-ctr-crash.any-expected.txt: Added.
* http/wpt/crypto/aes-ctr-crash.any.html: Added.
* http/wpt/crypto/aes-ctr-crash.any.js: Added.
* http/wpt/crypto/aes-ctr-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/aes-ctr-crash.any.worker.html: Added.
* http/wpt/crypto/aes-gcm-crash.any-expected.txt: Added.
* http/wpt/crypto/aes-gcm-crash.any.html: Added.
* http/wpt/crypto/aes-gcm-crash.any.js: Added.
* http/wpt/crypto/aes-gcm-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/aes-gcm-crash.any.worker.html: Added.
* http/wpt/crypto/derive-hmac-key-crash.any-expected.txt: Added.
* http/wpt/crypto/derive-hmac-key-crash.any.html: Added.
* http/wpt/crypto/derive-hmac-key-crash.any.js: Added.
* http/wpt/crypto/derive-hmac-key-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/derive-hmac-key-crash.any.worker.html: Added.
* http/wpt/crypto/ecdsa-crash.any-expected.txt: Added.
* http/wpt/crypto/ecdsa-crash.any.html: Added.
* http/wpt/crypto/ecdsa-crash.any.js: Added.
* http/wpt/crypto/ecdsa-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/ecdsa-crash.any.worker.html: Added.
* http/wpt/crypto/hkdf-crash.any-expected.txt: Added.
* http/wpt/crypto/hkdf-crash.any.html: Added.
* http/wpt/crypto/hkdf-crash.any.js: Added.
* http/wpt/crypto/hkdf-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/hkdf-crash.any.worker.html: Added.
* http/wpt/crypto/pbkdf2-crash.any-expected.txt: Added.
* http/wpt/crypto/pbkdf2-crash.any.html: Added.
* http/wpt/crypto/pbkdf2-crash.any.js: Added.
* http/wpt/crypto/pbkdf2-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/pbkdf2-crash.any.worker.html: Added.
* http/wpt/crypto/resources/common.js: Added.
* http/wpt/crypto/rsa-oaep-crash.any-expected.txt: Added.
* http/wpt/crypto/rsa-oaep-crash.any.html: Added.
* http/wpt/crypto/rsa-oaep-crash.any.js: Added.
* http/wpt/crypto/rsa-oaep-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/rsa-oaep-crash.any.worker.html: Added.
* http/wpt/crypto/rsa-pss-crash.any-expected.txt: Added.
* http/wpt/crypto/rsa-pss-crash.any.html: Added.
* http/wpt/crypto/rsa-pss-crash.any.js: Added.
* http/wpt/crypto/rsa-pss-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/rsa-pss-crash.any.worker.html: Added.
* http/wpt/crypto/unwrap-ec-key-crash.any-expected.txt: Added.
* http/wpt/crypto/unwrap-ec-key-crash.any.html: Added.
* http/wpt/crypto/unwrap-ec-key-crash.any.js: Added.
* http/wpt/crypto/unwrap-ec-key-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/unwrap-ec-key-crash.any.worker.html: Added.
* http/wpt/crypto/unwrap-rsa-key-crash.any-expected.txt: Added.
* http/wpt/crypto/unwrap-rsa-key-crash.any.html: Added.
* http/wpt/crypto/unwrap-rsa-key-crash.any.js: Added.
* http/wpt/crypto/unwrap-rsa-key-crash.any.worker.html: Added.
* http/wpt/crypto/unwrap-rsa-key-crash.any.worker-expected.txt: Added.

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

15 months agoSource/WebCore:
commit-queue@webkit.org [Tue, 17 Jul 2018 00:17:45 +0000 (00:17 +0000)]
Source/WebCore:
[iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the flush immediate transaction
https://bugs.webkit.org/show_bug.cgi?id=187375

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-07-16
Reviewed by Simon Fraser.

An immediate-paint transaction should force all the images which are pending
decoding to be repainted.

To do that, FrameView::paintControlTints() will be re-factored to a new
generic function such that it takes PaintInvalidationReasons. The new function
which is named 'traverseForPaintInvalidation' will traverse the render tree
for a specific PaintInvalidationReasons.

invalidateImagesWithAsyncDecodes() will stop the asynchronous decoding for
the underlying image and repaint all the clients which are waiting for the
decoding to finish.

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::didRemoveClient):
(WebCore::CachedImage::isClientWaitingForAsyncDecoding const):
(WebCore::CachedImage::addClientWaitingForAsyncDecoding):
(WebCore::CachedImage::removeAllClientsWaitingForAsyncDecoding):
(WebCore::CachedImage::allClientsRemoved):
(WebCore::CachedImage::clear):
(WebCore::CachedImage::createImage):
(WebCore::CachedImage::imageFrameAvailable):
(WebCore::CachedImage::addPendingImageDrawingClient): Deleted.
* loader/cache/CachedImage.h:
* page/FrameView.cpp:
(WebCore::FrameView::paintScrollCorner):
(WebCore::FrameView::updateControlTints):
(WebCore::FrameView::traverseForPaintInvalidation):
(WebCore::FrameView::adjustPageHeightDeprecated):
(WebCore::FrameView::paintControlTints): Deleted.
* page/FrameView.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::paint):
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::paint):
* platform/graphics/BitmapImage.h:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::GraphicsContext):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::performingPaintInvalidation const):
(WebCore::GraphicsContext::invalidatingControlTints const):
(WebCore::GraphicsContext::invalidatingImagesWithAsyncDecodes const):
(WebCore::GraphicsContext::updatingControlTints const): Deleted.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintReplaced):
(WebCore::RenderImage::paintAreaElementFocusRing):
(WebCore::RenderImage::paintIntoRect):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintScrollCorner):
(WebCore::RenderLayer::paintResizer):
(WebCore::RenderLayer::paintLayer):
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::paint):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):
* testing/Internals.cpp:
(WebCore::Internals::invalidateControlTints):
(WebCore::Internals::paintControlTints): Deleted.
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:
[iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the immediate-paint transaction
https://bugs.webkit.org/show_bug.cgi?id=187375

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-07-16
Reviewed by Simon Fraser.

For immediate-paint transaction, we should force all the images which are
pending decoding to be repainted before building this transaction.

* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::updateControlTints):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::paint):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):

LayoutTests:
[iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the immediate-paint transaction
https://bugs.webkit.org/show_bug.cgi?id=187375

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-07-16
Reviewed by Simon Fraser.

The Internals API paintControlTints() is now renamed to invalidateControlTints()
to be consistent with the new enum values and with the new name of the
C++ function.

* fast/css/webkit-mask-crash-fieldset-legend.html:
* fast/css/webkit-mask-crash-figure.html:
* fast/css/webkit-mask-crash-table.html:
* fast/css/webkit-mask-crash-td-2.html:
* fast/css/webkit-mask-crash-td.html:

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

15 months ago[ MacOS WK1 Debug ] Layout Test svg/custom/linking-uri-01-b.svg is flakey
commit-queue@webkit.org [Mon, 16 Jul 2018 23:53:49 +0000 (23:53 +0000)]
[ MacOS WK1 Debug ] Layout Test svg/custom/linking-uri-01-b.svg is flakey
https://bugs.webkit.org/show_bug.cgi?id=187711

Unreviewed test gardening.

Patch by Truitt Savell <tsavell@apple.com> on 2018-07-16

* platform/mac-wk1/TestExpectations:

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

15 months agoUnreviewed attempt to fix the build.
ryanhaddad@apple.com [Mon, 16 Jul 2018 23:46:31 +0000 (23:46 +0000)]
Unreviewed attempt to fix the build.

* rendering/RenderThemeMac.mm:

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

15 months agoAllow removal of white backgrounds
dino@apple.com [Mon, 16 Jul 2018 23:34:42 +0000 (23:34 +0000)]
Allow removal of white backgrounds
https://bugs.webkit.org/show_bug.cgi?id=187574
<rdar://problem/41146792>

Reviewed by Simon Fraser.

Source/WebCore:

Add a drawing mode that turns white backgrounds into transparent
regions, such that a hosting app can see through to its window.

Test: css3/color-filters/punch-out-white-backgrounds.html

* page/Settings.yaml: New Setting.

* rendering/InlineFlowBox.cpp: Draw with a destination out blend mode
if the background is white and we are punching out backgrounds, which means
that it will erase the destination.
(WebCore::InlineFlowBox::paintBoxDecorations):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintBackground): Ditto.
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paintBackgroundsBehindCell): Ditto.

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended): Save and restore
the composition mode if necessary.

Source/WebKit:

Add a new WebPreference for punching out white backgrounds.

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetPunchOutWhiteBackgroundsInDarkMode):
(WKPreferencesGetPunchOutWhiteBackgroundsInDarkMode):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _punchOutWhiteBackgroundsInDarkMode]):
(-[WKWebViewConfiguration _setPunchOutWhiteBackgroundsInDarkMode:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:

Source/WebKitLegacy/mac:

Add a new WebPreference for punching out white backgrounds.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences punchOutWhiteBackgroundsInDarkMode]):
(-[WebPreferences setPunchOutWhiteBackgroundsInDarkMode:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Tools:

Add a new menu item for punching out white backgrounds in MiniBrowser.
In WebKitTestRunner, expose the new setting and hook that up to
drawing a background in the WebView.

* MiniBrowser/mac/AppDelegate.m:
(defaultConfiguration): Add _punchOutWhiteBackgroundsInDarkMode.

* MiniBrowser/mac/SettingsController.h: Ditto.
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController togglePunchOutWhiteBackgroundsInDarkMode:]):
(-[SettingsController punchOutWhiteBackgroundsInDarkMode]):

* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController didChangeSettings]): Set the new preference.

* WebKitTestRunner/PlatformWebView.h: Expose a drawsBackground property.
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp: Null implementation.
(WTR::PlatformWebView::drawsBackground const):
(WTR::PlatformWebView::setDrawsBackground):
* WebKitTestRunner/wpe/PlatformWebViewWPE.cpp: Ditto.
(WTR::PlatformWebView::drawsBackground const):
(WTR::PlatformWebView::setDrawsBackground):
* WebKitTestRunner/ios/PlatformWebViewIOS.mm: Call into the WKWebView and
set its SPI.
(WTR::PlatformWebView::drawsBackground const):
(WTR::PlatformWebView::setDrawsBackground):
* WebKitTestRunner/mac/PlatformWebViewMac.mm: Ditto.
(WTR::PlatformWebView::drawsBackground const):
(WTR::PlatformWebView::setDrawsBackground):

* WebKitTestRunner/TestController.cpp: Reset and copy the new preference.
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):

* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::platformCreateWebView): If the option for punching
out the background was set, tell the WebView to not draw its background.

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

15 months agoUnreviewed, rolling out r233867.
david_fenton@apple.com [Mon, 16 Jul 2018 23:11:49 +0000 (23:11 +0000)]
Unreviewed, rolling out r233867.

caused build failures on High Sierra, Sierra and iOS

Reverted changeset:

"[WebCrypto] Crypto operations should copy their parameters
before hoping to another thread"
https://bugs.webkit.org/show_bug.cgi?id=187501
https://trac.webkit.org/changeset/233867

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

15 months ago[WebCrypto] Crypto operations should copy their parameters before hoping to another...
jiewen_tan@apple.com [Mon, 16 Jul 2018 21:58:21 +0000 (21:58 +0000)]
[WebCrypto] Crypto operations should copy their parameters before hoping to another thread
https://bugs.webkit.org/show_bug.cgi?id=187501
<rdar://problem/41438160>

Reviewed by Youenn Fablet.

Source/WebCore:

This patch aims at making all captured variables in all crypto lambdas that need to be passed
to a worker thread thread safe, which includes:
1) changing ref counted objects to thread safe ref counted object.
2) adding isolatedCopy methods to non ref counted classes, so they can be called by CrossThreadCopy().

In addition to above changes, this patch also does the following things:
1) change the name CryptoAlgorithm::dispatchOperation => CryptoAlgorithm::dispatchOperationInWorkQueue
to make it clear that lambdas will be passed to a secondary thread.
2) make CryptoAlgorithmParameters as const parameters for all methods.

Tests: crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html
       http/wpt/crypto/aes-cbc-crash.any.html
       http/wpt/crypto/aes-cbc-crash.any.worker.html
       http/wpt/crypto/aes-ctr-crash.any.html
       http/wpt/crypto/aes-ctr-crash.any.worker.html
       http/wpt/crypto/aes-gcm-crash.any.html
       http/wpt/crypto/aes-gcm-crash.any.worker.html
       http/wpt/crypto/derive-hmac-key-crash.any.html
       http/wpt/crypto/derive-hmac-key-crash.any.worker.html
       http/wpt/crypto/ecdsa-crash.any.html
       http/wpt/crypto/ecdsa-crash.any.worker.html
       http/wpt/crypto/hkdf-crash.any.html
       http/wpt/crypto/hkdf-crash.any.worker.html
       http/wpt/crypto/pbkdf2-crash.any.html
       http/wpt/crypto/pbkdf2-crash.any.worker.html
       http/wpt/crypto/rsa-oaep-crash.any.html
       http/wpt/crypto/rsa-oaep-crash.any.worker.html
       http/wpt/crypto/rsa-pss-crash.any.html
       http/wpt/crypto/rsa-pss-crash.any.worker.html
       http/wpt/crypto/unwrap-ec-key-crash.any.html
       http/wpt/crypto/unwrap-ec-key-crash.any.worker.html
       http/wpt/crypto/unwrap-rsa-key-crash.any.html
       http/wpt/crypto/unwrap-rsa-key-crash.any.worker.html

* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::encrypt):
(WebCore::CryptoAlgorithm::decrypt):
(WebCore::CryptoAlgorithm::sign):
(WebCore::CryptoAlgorithm::verify):
(WebCore::CryptoAlgorithm::deriveBits):
(WebCore::CryptoAlgorithm::importKey):
(WebCore::dispatchAlgorithmOperation):
(WebCore::CryptoAlgorithm::dispatchOperationInWorkQueue):
(WebCore::CryptoAlgorithm::dispatchOperation): Deleted.
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.cpp:
(WebCore::crossThreadCopyImportParams):
(WebCore::SubtleCrypto::encrypt):
(WebCore::SubtleCrypto::decrypt):
(WebCore::SubtleCrypto::sign):
(WebCore::SubtleCrypto::verify):
(WebCore::SubtleCrypto::deriveKey):
(WebCore::SubtleCrypto::deriveBits):
(WebCore::SubtleCrypto::importKey):
(WebCore::SubtleCrypto::wrapKey):
(WebCore::SubtleCrypto::unwrapKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::encrypt):
(WebCore::CryptoAlgorithmAES_CBC::decrypt):
(WebCore::CryptoAlgorithmAES_CBC::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
(WebCore::CryptoAlgorithmAES_CFB::encrypt):
(WebCore::CryptoAlgorithmAES_CFB::decrypt):
(WebCore::CryptoAlgorithmAES_CFB::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CFB.h:
* crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
(WebCore::parametersAreValid):
(WebCore::CryptoAlgorithmAES_CTR::encrypt):
(WebCore::CryptoAlgorithmAES_CTR::decrypt):
(WebCore::CryptoAlgorithmAES_CTR::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CTR.h:
* crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
(WebCore::CryptoAlgorithmAES_GCM::encrypt):
(WebCore::CryptoAlgorithmAES_GCM::decrypt):
(WebCore::CryptoAlgorithmAES_GCM::importKey):
* crypto/algorithms/CryptoAlgorithmAES_GCM.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::importKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmECDH.cpp:
(WebCore::CryptoAlgorithmECDH::deriveBits):
(WebCore::CryptoAlgorithmECDH::importKey):
* crypto/algorithms/CryptoAlgorithmECDH.h:
* crypto/algorithms/CryptoAlgorithmECDSA.cpp:
(WebCore::CryptoAlgorithmECDSA::sign):
(WebCore::CryptoAlgorithmECDSA::verify):
(WebCore::CryptoAlgorithmECDSA::importKey):
* crypto/algorithms/CryptoAlgorithmECDSA.h:
* crypto/algorithms/CryptoAlgorithmHKDF.cpp:
(WebCore::CryptoAlgorithmHKDF::deriveBits):
(WebCore::CryptoAlgorithmHKDF::importKey):
* crypto/algorithms/CryptoAlgorithmHKDF.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::sign):
(WebCore::CryptoAlgorithmHMAC::verify):
(WebCore::CryptoAlgorithmHMAC::importKey):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
(WebCore::CryptoAlgorithmPBKDF2::deriveBits):
(WebCore::CryptoAlgorithmPBKDF2::importKey):
* crypto/algorithms/CryptoAlgorithmPBKDF2.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::sign):
(WebCore::CryptoAlgorithmRSA_PSS::verify):
(WebCore::CryptoAlgorithmRSA_PSS::importKey):
* crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
* crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
(WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
* crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
(WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
* crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
* crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::platformSign):
(WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
(WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/mac/CryptoAlgorithmHKDFMac.cpp:
(WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
* crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
(WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
* crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
* crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::platformSign):
(WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
* crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h:
* crypto/parameters/CryptoAlgorithmAesCtrParams.h:
* crypto/parameters/CryptoAlgorithmAesGcmParams.h:
* crypto/parameters/CryptoAlgorithmEcKeyParams.h:
* crypto/parameters/CryptoAlgorithmEcdsaParams.h:
* crypto/parameters/CryptoAlgorithmHkdfParams.h:
* crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
* crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
* crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
* crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
* crypto/parameters/CryptoAlgorithmRsaPssParams.h:

LayoutTests:

crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html is an exception of this series of tests as
it only aims to test the correct behavoir of suggested algorithms. This patch aslo does some test
gardening.

* TestExpectations:
* crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key-expected.txt: Added.
* crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html: Added.
* http/wpt/crypto/aes-cbc-crash.any-expected.txt: Added.
* http/wpt/crypto/aes-cbc-crash.any.html: Added.
* http/wpt/crypto/aes-cbc-crash.any.js: Added.
* http/wpt/crypto/aes-cbc-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/aes-cbc-crash.any.worker.html: Added.
* http/wpt/crypto/aes-ctr-crash.any-expected.txt: Added.
* http/wpt/crypto/aes-ctr-crash.any.html: Added.
* http/wpt/crypto/aes-ctr-crash.any.js: Added.
* http/wpt/crypto/aes-ctr-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/aes-ctr-crash.any.worker.html: Added.
* http/wpt/crypto/aes-gcm-crash.any-expected.txt: Added.
* http/wpt/crypto/aes-gcm-crash.any.html: Added.
* http/wpt/crypto/aes-gcm-crash.any.js: Added.
* http/wpt/crypto/aes-gcm-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/aes-gcm-crash.any.worker.html: Added.
* http/wpt/crypto/derive-hmac-key-crash.any-expected.txt: Added.
* http/wpt/crypto/derive-hmac-key-crash.any.html: Added.
* http/wpt/crypto/derive-hmac-key-crash.any.js: Added.
* http/wpt/crypto/derive-hmac-key-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/derive-hmac-key-crash.any.worker.html: Added.
* http/wpt/crypto/ecdsa-crash.any-expected.txt: Added.
* http/wpt/crypto/ecdsa-crash.any.html: Added.
* http/wpt/crypto/ecdsa-crash.any.js: Added.
* http/wpt/crypto/ecdsa-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/ecdsa-crash.any.worker.html: Added.
* http/wpt/crypto/hkdf-crash.any-expected.txt: Added.
* http/wpt/crypto/hkdf-crash.any.html: Added.
* http/wpt/crypto/hkdf-crash.any.js: Added.
* http/wpt/crypto/hkdf-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/hkdf-crash.any.worker.html: Added.
* http/wpt/crypto/pbkdf2-crash.any-expected.txt: Added.
* http/wpt/crypto/pbkdf2-crash.any.html: Added.
* http/wpt/crypto/pbkdf2-crash.any.js: Added.
* http/wpt/crypto/pbkdf2-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/pbkdf2-crash.any.worker.html: Added.
* http/wpt/crypto/resources/common.js: Added.
* http/wpt/crypto/rsa-oaep-crash.any-expected.txt: Added.
* http/wpt/crypto/rsa-oaep-crash.any.html: Added.
* http/wpt/crypto/rsa-oaep-crash.any.js: Added.
* http/wpt/crypto/rsa-oaep-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/rsa-oaep-crash.any.worker.html: Added.
* http/wpt/crypto/rsa-pss-crash.any-expected.txt: Added.
* http/wpt/crypto/rsa-pss-crash.any.html: Added.
* http/wpt/crypto/rsa-pss-crash.any.js: Added.
* http/wpt/crypto/rsa-pss-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/rsa-pss-crash.any.worker.html: Added.
* http/wpt/crypto/unwrap-ec-key-crash.any-expected.txt: Added.
* http/wpt/crypto/unwrap-ec-key-crash.any.html: Added.
* http/wpt/crypto/unwrap-ec-key-crash.any.js: Added.
* http/wpt/crypto/unwrap-ec-key-crash.any.worker-expected.txt: Added.
* http/wpt/crypto/unwrap-ec-key-crash.any.worker.html: Added.
* http/wpt/crypto/unwrap-rsa-key-crash.any-expected.txt: Added.
* http/wpt/crypto/unwrap-rsa-key-crash.any.html: Added.
* http/wpt/crypto/unwrap-rsa-key-crash.any.js: Added.
* http/wpt/crypto/unwrap-rsa-key-crash.any.worker.html: Added.
* http/wpt/crypto/unwrap-rsa-key-crash.any.worker-expected.txt: Added.

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

15 months ago[Datalist][macOS] Add suggestions UI for TextFieldInputTypes
commit-queue@webkit.org [Mon, 16 Jul 2018 21:15:57 +0000 (21:15 +0000)]
[Datalist][macOS] Add suggestions UI for TextFieldInputTypes
https://bugs.webkit.org/show_bug.cgi?id=186531

Patch by Aditya Keerthi <akeerthi@apple.com> on 2018-07-16
Reviewed by Tim Horton.

Source/WebCore:

Tests: fast/forms/datalist/datalist-show-hide.html
       fast/forms/datalist/datalist-textinput-keydown.html

* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::handleKeydownEvent):
(WebCore::TextFieldInputType::handleKeydownEventForSpinButton): The suggestions view takes precedence when handling arrow key events.

Source/WebKit:

Created WebDataListSuggestionsDropdownMac as a wrapper around the suggestions
view. The suggestions for TextFieldInputTypes are displayed using an NSTableView
in it's own child window. This is done so that suggestions can be presented
outside of the page if the parent window's size is too small. The maximum number
of suggestions that are visible at one time is 6, with additional suggestions made
available by scrolling.

Suggestions in the view can be selected via click or by using arrow keys. If the
input element associated with the suggestions is blurred, or the page is moved in
any way, the suggestions view is hidden.

Added IPC messages to the UIProcess to enable the display of the suggestions view.
This required a new ArgumentCoder for DataListSuggestionInformation.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<DataListSuggestionInformation>::encode):
(IPC::ArgumentCoder<DataListSuggestionInformation>::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/PageClient.h:
* UIProcess/WebDataListSuggestionsDropdown.cpp: Copied from Source/WebKit/WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h.
(WebKit::WebDataListSuggestionsDropdown::WebDataListSuggestionsDropdown):
(WebKit::WebDataListSuggestionsDropdown::~WebDataListSuggestionsDropdown):
(WebKit::WebDataListSuggestionsDropdown::close):
* UIProcess/WebDataListSuggestionsDropdown.h: Copied from Source/WebKit/WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h.
(WebKit::WebDataListSuggestionsDropdown::Client::~Client):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::viewWillStartLiveResize):
(WebKit::WebPageProxy::viewDidLeaveWindow):
(WebKit::WebPageProxy::handleWheelEvent):
(WebKit::WebPageProxy::setPageZoomFactor):
(WebKit::WebPageProxy::setPageAndTextZoomFactors):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
(WebKit::WebPageProxy::pageDidScroll):
(WebKit::WebPageProxy::showDataListSuggestions):
(WebKit::WebPageProxy::handleKeydownInDataList):
(WebKit::WebPageProxy::endDataListSuggestions):
(WebKit::WebPageProxy::didCloseSuggestions):
(WebKit::WebPageProxy::didSelectOption):
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::closeOverlayedViews):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::createDataListSuggestionsDropdown):
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::createDataListSuggestionsDropdown):
* UIProcess/mac/WebDataListSuggestionsDropdownMac.h: Copied from Source/WebKit/WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h.
* UIProcess/mac/WebDataListSuggestionsDropdownMac.mm: Added.
(WebKit::WebDataListSuggestionsDropdownMac::create):
(WebKit::WebDataListSuggestionsDropdownMac::~WebDataListSuggestionsDropdownMac):
(WebKit::WebDataListSuggestionsDropdownMac::WebDataListSuggestionsDropdownMac):
(WebKit::WebDataListSuggestionsDropdownMac::show):
(WebKit::WebDataListSuggestionsDropdownMac::didSelectOption):
(WebKit::WebDataListSuggestionsDropdownMac::selectOption):
(WebKit::WebDataListSuggestionsDropdownMac::handleKeydownWithIdentifier):
(WebKit::WebDataListSuggestionsDropdownMac::close):
(-[WKDataListSuggestionCell initWithFrame:]):
(-[WKDataListSuggestionCell setText:]):
(-[WKDataListSuggestionCell setActive:]):
(-[WKDataListSuggestionCell drawRect:]):
(-[WKDataListSuggestionCell mouseEntered:]):
(-[WKDataListSuggestionCell mouseExited:]):
(-[WKDataListSuggestionCell acceptsFirstResponder]):
(-[WKDataListSuggestionTable initWithElementRect:]):
(-[WKDataListSuggestionTable setVisibleRect:]):
(-[WKDataListSuggestionTable currentActiveRow]):
(-[WKDataListSuggestionTable setActiveRow:]):
(-[WKDataListSuggestionTable reload]):
(-[WKDataListSuggestionTable acceptsFirstResponder]):
(-[WKDataListSuggestionTable enclosingScrollView]):
(-[WKDataListSuggestionTable removeFromSuperviewWithoutNeedingDisplay]):
(-[WKDataListSuggestionsView initWithInformation:inView:]):
(-[WKDataListSuggestionsView currentSelectedString]):
(-[WKDataListSuggestionsView updateWithInformation:]):
(-[WKDataListSuggestionsView moveSelectionByDirection:]):
(-[WKDataListSuggestionsView invalidate]):
(-[WKDataListSuggestionsView dropdownRectForElementRect:]):
(-[WKDataListSuggestionsView showSuggestionsDropdown:]):
(-[WKDataListSuggestionsView selectedRow:]):
(-[WKDataListSuggestionsView numberOfRowsInTableView:]):
(-[WKDataListSuggestionsView tableView:heightOfRow:]):
(-[WKDataListSuggestionsView tableView:viewForTableColumn:row:]):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebDataListSuggestionPicker.cpp:
(WebKit::WebDataListSuggestionPicker::handleKeydownWithIdentifier):
(WebKit::WebDataListSuggestionPicker::didSelectOption):
(WebKit::WebDataListSuggestionPicker::didCloseSuggestions):
(WebKit::WebDataListSuggestionPicker::close):
(WebKit::WebDataListSuggestionPicker::displayWithActivationType):
* WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h:

Tools:

Added isShowingDatalistSuggestions testing hook in order to enable testing of the
visibility of the suggestions view.

* DumpRenderTree/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::isShowingDataListSuggestions const):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::isShowingDataListSuggestions const):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::isShowingDataListSuggestions const):

LayoutTests:

Added tests to verify that the suggestions are correctly shown and hidden, and that
suggestions can be selected and inserted into an input field.

* fast/forms/datalist/datalist-show-hide-expected.txt: Added.
* fast/forms/datalist/datalist-show-hide.html: Added.
* fast/forms/datalist/datalist-textinput-keydown-expected.txt: Added.
* fast/forms/datalist/datalist-textinput-keydown.html: Added.
* platform/ios/TestExpectations:
* resources/ui-helper.js:
(window.UIHelper.isShowingDataListSuggestions):

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

15 months agoFullscreen requires active document.
commit-queue@webkit.org [Mon, 16 Jul 2018 20:39:37 +0000 (20:39 +0000)]
Fullscreen requires active document.
https://bugs.webkit.org/show_bug.cgi?id=186226
rdar://problem/36187413

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-07-16
Reviewed by Jer Noble.

Source/WebCore:

Test: media/no-fullscreen-when-hidden.html

This change guarantees the document to be visible for both element fullscreen and video fullscreen.

User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
because JavaScript can spin wait before initiating fullscreen. During that spin the page or window might
be hidden.

Document::hidden() can't be relied upon because it won't update while JavaScript spins.

This change adds a sync call to the UI process to get the current UI visibility state.

* dom/Document.cpp:
(WebCore::Document::requestFullScreenForElement):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::enterFullscreen):
* page/ChromeClient.h:

Source/WebKit:

This change guarantees the document to be visible for both element fullscreen and video fullscreen.

User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
because JavaScript can spin wait before initiating fullscreen. During that spin the page or window might
be hidden.

Document::hidden() can't be relied upon because it won't update while JavaScript spins.

This change adds a sync call to the UI process to get the current UI visibility state.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::getIsViewVisible):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::isViewVisible):
* WebProcess/WebCoreSupport/WebChromeClient.h:

LayoutTests:

This change guarantees the document to be visible for both element fullscreen and video fullscreen.

User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
because JavaScript can spin wait before initiating fullscreen. During that spin the page or window might
be hidden.

Document::hidden() can't be relied upon because it won't update while JavaScript spins.

This change adds a sync call to the UI process to get the current UI visibility state.

* media/no-fullscreen-when-hidden.html: Added.
* media/video-test.js:
(eventName.string_appeared_here.thunk):
(runWithKeyDown):
* platform/ios-wk1/TestExpectations:
* platform/mac-wk1/TestExpectations:

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

15 months agoREGRESSION (r233502): Camera in <input type=file> becomes unresponsive after attempti...
timothy_horton@apple.com [Mon, 16 Jul 2018 20:32:07 +0000 (20:32 +0000)]
REGRESSION (r233502): Camera in <input type=file> becomes unresponsive after attempting to dismiss it
https://bugs.webkit.org/show_bug.cgi?id=187706
<rdar://problem/42137088>

Reviewed by Wenson Hsieh.

* UIProcess/ios/forms/WKFileUploadPanel.mm:
Remove an unused member.

(-[WKFileUploadPanel _dismissDisplayAnimated:]):
Allow us to dismiss the camera view controller in addition to the menu.

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

15 months agoReduce size of NetworkLoadMetrics and therefore ResourceResponse
commit-queue@webkit.org [Mon, 16 Jul 2018 20:23:52 +0000 (20:23 +0000)]
Reduce size of NetworkLoadMetrics and therefore ResourceResponse
https://bugs.webkit.org/show_bug.cgi?id=187671

Patch by Alex Christensen <achristensen@webkit.org> on 2018-07-16
Reviewed by Darin Adler.

Source/WebCore:

* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::toProtocol):
(WebCore::InspectorNetworkAgent::buildObjectForMetrics):
* platform/network/NetworkLoadMetrics.h:
(WebCore::NetworkLoadMetrics::isolatedCopy const):
(WebCore::NetworkLoadMetrics::reset):
(WebCore::NetworkLoadMetrics::clearNonTimingData):

Source/WebKit:

* Shared/WebCoreArgumentCoders.h:

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

15 months ago[JSC] UnlinkedCodeBlock::shrinkToFit miss m_constantIdentifierSets
utatane.tea@gmail.com [Mon, 16 Jul 2018 20:10:06 +0000 (20:10 +0000)]
[JSC] UnlinkedCodeBlock::shrinkToFit miss m_constantIdentifierSets
https://bugs.webkit.org/show_bug.cgi?id=187709

Reviewed by Mark Lam.

UnlinkedCodeBlock::shrinkToFit accidentally misses m_constantIdentifierSets shrinking.

* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::shrinkToFit):

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

15 months agoWeb Inspector: Fix execution highlighting after r233820
mattbaker@apple.com [Mon, 16 Jul 2018 20:06:52 +0000 (20:06 +0000)]
Web Inspector: Fix execution highlighting after r233820
https://bugs.webkit.org/show_bug.cgi?id=187703
<rdar://problem/42246167>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
* UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype.currentPositionToOriginalPosition):
(WI.TextEditor.prototype._updateExecutionRangeHighlight):

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

15 months ago[JSC] Make SourceParseMode small
utatane.tea@gmail.com [Mon, 16 Jul 2018 19:49:11 +0000 (19:49 +0000)]
[JSC] Make SourceParseMode small
https://bugs.webkit.org/show_bug.cgi?id=187705

Reviewed by Mark Lam.

Each SourceParseMode is distinct. So we do not need to make it a set-style (power of 2 style).
Originally, this is done to make SourceParseModeSet faster because it is critical in our parser.
But we can keep SourceParseModeSet fast by `1U << mode | set`. And we can make SourceParseMode
within 5 bits. This reduces the size of UnlinkedCodeBlock from 288 to 280.

* parser/ParserModes.h:
(JSC::SourceParseModeSet::SourceParseModeSet):
(JSC::SourceParseModeSet::contains):
(JSC::SourceParseModeSet::mergeSourceParseModes):

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

15 months agoAX: Audit Tab should have an Audit Manager
commit-queue@webkit.org [Mon, 16 Jul 2018 18:57:39 +0000 (18:57 +0000)]
AX: Audit Tab should have an Audit Manager
https://bugs.webkit.org/show_bug.cgi?id=184071
<rdar://problem/38946364>

Patch by Aaron Chu <aaron_chu@apple.com> on 2018-07-16
Reviewed by Brian Burg.

Source/WebInspectorUI:

This implements the AuditManager for the audit feature. This patch revolves
around building out an AuditManager that facilitates an audit. The AuditManager
is responsible for managing and storing AuditReports and AuditTestSuites. It is
also tasked to decide how to run a test -- whether as a test case or as a test
suite. This patch also includes 4 models with which the AuditManager works to
perform an audit and to generate a report. These models include AuditTestCase,
which as a collection is stored inside an AuditTestSuite; and AuditResult,
which, as a collection is stored inside an AuditReport.

* UserInterface/Controllers/AuditManager.js: Added.
(WI.AuditManager):
(WI.AuditManager.prototype.get testSuites):
(WI.AuditManager.prototype.get reports):
(WI.AuditManager.prototype.async.runAuditTestByRepresentedObject):
(WI.AuditManager.prototype.reportForId):
(WI.AuditManager.prototype.removeAllReports):
(WI.AuditManager.prototype.async._runTestCase):
* UserInterface/Main.html:
* UserInterface/Models/AuditReport.js: Added.
(WI.AuditReport):
(WI.AuditReport.prototype.get representedTestCases):
(WI.AuditReport.prototype.get representedTestSuite):
(WI.AuditReport.prototype.get resultsData):
(WI.AuditReport.prototype.get isWritable):
(WI.AuditReport.prototype.get failedCount):
(WI.AuditReport.prototype.addResult):
(WI.AuditReport.prototype.close):
* UserInterface/Models/AuditResult.js: Added.
(WI.AuditResult):
(WI.AuditResult.prototype.get testResult):
(WI.AuditResult.prototype.get name):
(WI.AuditResult.prototype.get logLevel):
(WI.AuditResult.prototype.get failed):
* UserInterface/Models/AuditTestCase.js: Added.
(WI.AuditTestCase.prototype.get id):
(WI.AuditTestCase.prototype.get name):
(WI.AuditTestCase.prototype.get suite):
(WI.AuditTestCase.prototype.get test):
(WI.AuditTestCase.prototype.get setup):
(WI.AuditTestCase.prototype.get tearDown):
(WI.AuditTestCase.prototype.get errorDetails):
(WI.AuditTestCase):
* UserInterface/Models/AuditTestSuite.js: Added.
(WI.AuditTestSuite):
(WI.AuditTestSuite.testCaseDescriptors):
(WI.AuditTestSuite.prototype.get id):
(WI.AuditTestSuite.prototype.get name):
(WI.AuditTestSuite.prototype.get testCases):
(WI.AuditTestSuite.prototype._buildTestCasesFromDescriptors):
* UserInterface/Test.html:

LayoutTests:

Test cases for AuditManager, AuditTestCase, AuditTestSuite, AuditResult and AuditReport.

* inspector/audit/audit-manager-expected.txt: Added.
* inspector/audit/audit-manager.html: Added.
* inspector/audit/audit-report-expected.txt: Added.
* inspector/audit/audit-report.html: Added.
* inspector/audit/audit-test-case-expected.txt: Added.
* inspector/audit/audit-test-case.html: Added.
* inspector/audit/audit-test-suite-expected.txt: Added.
* inspector/audit/audit-test-suite.html: Added.
* inspector/audit/resources/audit-test-fixtures.js: Added.
(TestPage.registerInitializer.window.testSuiteFixture1):
(TestPage.registerInitializer.window.testSuiteFixture1.testCaseDescriptors):
(TestPage.registerInitializer.window.testSuiteFixture2):
(TestPage.registerInitializer.window.testSuiteFixture2.testCaseDescriptors):
(TestPage.registerInitializer):

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

15 months agoMake sure LibWebRTCMediaEndpoint is always destroyed on the main thread
cdumez@apple.com [Mon, 16 Jul 2018 18:55:08 +0000 (18:55 +0000)]
Make sure LibWebRTCMediaEndpoint is always destroyed on the main thread
https://bugs.webkit.org/show_bug.cgi?id=187702

Reviewed by Youenn Fablet.

Make sure LibWebRTCMediaEndpoint is always constructed and destructed on the main thread since
it has a Timer data member and it would not be safe otherwise. LibWebRTCMediaEndpoint is
ThreadSafeRefCounted and frequently passed to other threads.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:

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

15 months agoAdd --target-path option to dump-class-layout
utatane.tea@gmail.com [Mon, 16 Jul 2018 18:52:22 +0000 (18:52 +0000)]
Add --target-path option to dump-class-layout
https://bugs.webkit.org/show_bug.cgi?id=187687

Reviewed by Simon Fraser.

We add an escape hatch to dump-class-layout for specifying target path directly.
This `--target-path` allows us to use dump-class-layout in the other ports
like JSCOnly.

We can dump class layout if we build the target with clang by using the following command.

Tools/Scripts/dump-class-layout \
    --architecture=x86_64 \
    --target-path=path/to/libJavaScriptCore.so \
    JavaScriptCore \
    ScopeNode

* Scripts/dump-class-layout:
(main):

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

15 months ago[JSC] Generator and AsyncGeneratorMethod's prototype is incorrect
utatane.tea@gmail.com [Mon, 16 Jul 2018 18:49:22 +0000 (18:49 +0000)]
[JSC] Generator and AsyncGeneratorMethod's prototype is incorrect
https://bugs.webkit.org/show_bug.cgi?id=187585

Reviewed by Darin Adler.

JSTests:

* stress/default-proto-for-async-generator.js: Added.
(shouldBe):
(async.asyncGenerator):
* stress/default-proto-for-generator.js: Added.
(shouldBe):
(generator):
* stress/prototype-for-async-generator.js: Added.
(shouldBe):
(async.asyncGenerator):
(A.prototype.async.asyncGenerator):
(A):
* test262/expectations.yaml:

Source/JavaScriptCore:

This patch fixes Generator and AsyncGenerator's prototype issues.

1. Generator's default prototype is incorrect when `generator.prototype = null` is performed.
We fix this by changing JSFunction::prototypeForConstruction.

2. AsyncGeneratorMethod is not handled. We change the name isAsyncGeneratorFunctionParseMode
to isAsyncGeneratorWrapperParseMode since it is aligned to Generator's code. And use it well
to fix `prototype` issues for AsyncGeneratorMethod.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitPutAsyncGeneratorFields):
(JSC::BytecodeGenerator::emitNewFunction):
* bytecompiler/NodesCodegen.cpp:
(JSC::FunctionNode::emitBytecode):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createFunctionMetadata):
* parser/Parser.cpp:
(JSC::getAsynFunctionBodyParseMode):
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::parseAsyncGeneratorFunctionSourceElements):
* parser/ParserModes.h:
(JSC::isAsyncGeneratorParseMode):
(JSC::isAsyncGeneratorWrapperParseMode):
(JSC::isAsyncGeneratorFunctionParseMode): Deleted.
* runtime/FunctionExecutable.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::prototypeForConstruction):
(JSC::JSFunction::getOwnPropertySlot):

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

15 months agojsc shell's noFTL utility test function should be more robust.
mark.lam@apple.com [Mon, 16 Jul 2018 18:42:07 +0000 (18:42 +0000)]
jsc shell's noFTL utility test function should be more robust.
https://bugs.webkit.org/show_bug.cgi?id=187704
<rdar://problem/42231988>

Reviewed by Michael Saboff and Keith Miller.

* jsc.cpp:
(functionNoFTL):
- only setNeverFTLOptimize() if the function is actually a JS function.

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

15 months agoIndexedDB: closeAndDeleteDatabasesForOrigins should remove all databases for those...
sihui_liu@apple.com [Mon, 16 Jul 2018 18:35:50 +0000 (18:35 +0000)]
IndexedDB: closeAndDeleteDatabasesForOrigins should remove all databases for those origins
https://bugs.webkit.org/show_bug.cgi?id=187631
<rdar://problem/42164227>

Reviewed by Brady Eidson.

Source/WebCore:

When asked to delete database for an origin, we deleted the databases whose mainFrameOrigin
is that origin. Given that the origin may create IndexedDB from subframes, we should delete
databases whose openingOrigin is that origin too.

Covered by modified API test: WebKit.WebsiteDataStoreCustomPaths.

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):

Source/WebKit:

We need to return all origins, both openingOrigin and mainFrameOrigin, of IndexedDB so users
could be better aware of which origins are using databases and decide what they want to
remove.

* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::indexedDatabaseOrigins):
* StorageProcess/StorageProcess.h:

Tools:

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

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

15 months agoVersioning.
kocsen_chung@apple.com [Mon, 16 Jul 2018 18:28:54 +0000 (18:28 +0000)]
Versioning.

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

15 months agoShrink some font-related classes and enums
simon.fraser@apple.com [Mon, 16 Jul 2018 17:59:29 +0000 (17:59 +0000)]
Shrink some font-related classes and enums
https://bugs.webkit.org/show_bug.cgi?id=187686

Reviewed by Myles Maxfield.

Use enum class for enums in TextFlags.h and make them one byte big.

Re-order members of Font to shrink it from 360 to 328 bytes.

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator FontSmoothingMode const):
(WebCore::CSSPrimitiveValue::operator FontSmallCaps const):
(WebCore::CSSPrimitiveValue::operator TextRenderingMode const):
* platform/graphics/Font.cpp:
(WebCore::Font::Font):
(WebCore::Font::verticalRightOrientationFont const):
* platform/graphics/Font.h:
* platform/graphics/FontCascade.cpp:
(WebCore::offsetToMiddleOfGlyph):
* platform/graphics/FontCascade.h:
(WebCore::FontCascade::advancedTextRenderingMode const):
* platform/graphics/FontCascadeFonts.cpp:
(WebCore::FontCascadeFonts::glyphDataForSystemFallback):
(WebCore::FontCascadeFonts::glyphDataForVariant):
(WebCore::glyphPageFromFontRanges):
* platform/graphics/FontDescription.cpp:
(WebCore::FontCascadeDescription::FontCascadeDescription):
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::setTextRenderingMode):
(WebCore::FontDescription::setOrientation):
(WebCore::FontDescription::setWidthVariant):
(WebCore::FontCascadeDescription::setFontSmoothing):
(WebCore::FontCascadeDescription::initialSmallCaps):
(WebCore::FontCascadeDescription::initialFontSmoothing):
(WebCore::FontCascadeDescription::initialTextRenderingMode):
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::isForTextCombine const):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::showLetterpressedGlyphsWithAdvances):
(WebCore::showGlyphsWithAdvances):
(WebCore::FontCascade::drawGlyphs):
(WebCore::FontCascade::fontForCombiningCharacterSequence const):
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformInit):
(WebCore::Font::platformBoundsForGlyph const):
(WebCore::Font::platformWidthForGlyph const):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::hash const):
(WebCore::mapFontWidthVariantToCTFeatureSelector):
(WebCore::FontPlatformData::ctFont const):
(WebCore::FontPlatformData::description const):
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::buildScaledFont):
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::platformInit):
(WebCore::Font::platformWidthForGlyph const):
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::fontFeatures):
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
* platform/graphics/mac/SimpleFontDataCoreText.cpp:
(WebCore::Font::getCFStringAttributes const):
* platform/graphics/win/FontCGWin.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/win/FontCascadeDirect2D.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
(WebCore::GlyphPage::fill):
* platform/graphics/win/SimpleFontDataDirect2D.cpp:
(WebCore::Font::platformInit):
(WebCore::Font::platformBoundsForGlyph const):
(WebCore::Font::platformWidthForGlyph const):
* platform/text/TextFlags.h:
* rendering/RenderCombineText.cpp:
(WebCore::RenderCombineText::combineTextIfNeeded):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
* rendering/TextPainter.cpp:
(WebCore::TextPainter::paintTextWithShadows):
* rendering/TextPainter.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::fontAndGlyphOrientation):
* rendering/svg/RenderSVGInlineText.cpp:
(WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):

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

15 months ago[ iOS ] Layout Test fast/forms/submit-change-fragment.html is a flaky Timeout
commit-queue@webkit.org [Mon, 16 Jul 2018 17:51:28 +0000 (17:51 +0000)]
[ iOS ] Layout Test fast/forms/submit-change-fragment.html is a flaky Timeout
https://bugs.webkit.org/show_bug.cgi?id=187699

Unreviewed test gardening.

Patch by Truitt Savell <tsavell@apple.com> on 2018-07-16

* platform/ios-simulator-wk2/TestExpectations:

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

15 months ago[ EWS ] http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-audio...
ryanhaddad@apple.com [Mon, 16 Jul 2018 16:54:31 +0000 (16:54 +0000)]
[ EWS ] http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-audio.html is Crashing on Win-EWS
https://bugs.webkit.org/show_bug.cgi?id=187700

Unreviewed test gardening.

Patch by Truitt Savell <tsavell@apple.com> on 2018-07-16

* platform/win/TestExpectations:

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

15 months agoWeb Inspector: Dark Mode: Console filter field buttons should be darker
nvasilyev@apple.com [Mon, 16 Jul 2018 16:37:34 +0000 (16:37 +0000)]
Web Inspector: Dark Mode: Console filter field buttons should be darker
https://bugs.webkit.org/show_bug.cgi?id=187626
<rdar://problem/42142744>

Reviewed by Brian Burg.

* UserInterface/Views/FindBanner.css:
(@media (prefers-dark-interface)):
(.find-banner > button.segmented):
(.find-banner > button.segmented > .glyph):

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

15 months agoWeb Inspector: Dark Mode: selected item background color is too light
nvasilyev@apple.com [Mon, 16 Jul 2018 16:29:00 +0000 (16:29 +0000)]
Web Inspector: Dark Mode: selected item background color is too light
https://bugs.webkit.org/show_bug.cgi?id=187691
<rdar://problem/42225308>

Reviewed by Brian Burg.

* UserInterface/Views/DarkMode.css:
(@media (prefers-dark-interface)):
(:root):
(.tree-outline.dom li.elements-drag-over .selection-area):
(.tree-outline.dom:focus li.selected .selection-area):

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

15 months ago[WebVR] Add support for connect/disconnect and mount/unmount device events
svillar@igalia.com [Mon, 16 Jul 2018 14:24:22 +0000 (14:24 +0000)]
[WebVR] Add support for connect/disconnect and mount/unmount device events
https://bugs.webkit.org/show_bug.cgi?id=187343

Reviewed by Žan Doberšek.

WebVR specs define a series of events as part of the Window Interface Extension. We're
adding support for the connect/disconnect and mount/unmount events both at the module level
and the platform level using OpenVR.

In order to do that we need to keep lists of VRPlatformDisplays at platform level and
VRDisplays at bindings level. We then update those lists accordingly to detect potential
additions/removals, and emit the corresponding signals. A new client interface
VRPlatformDisplayClient was also defined so that VRPlatformDisplay implementations could
notify their clients (typically a VRDisplay).

Last but not least, NavigatorWebVR was updated so it supplements Navigator instead of
supplementing Page.

* Modules/webvr/NavigatorWebVR.cpp: Supplement Navigator not Page.
(WebCore::NavigatorWebVR::getVRDisplays): Keep a list of VRDisplays and update them
conveniently, also emitting the required events under certain conditions (like device
disconnection).
(WebCore::NavigatorWebVR::supplementName): New method.
(WebCore::NavigatorWebVR::from): Ditto.
* Modules/webvr/NavigatorWebVR.h: Supplement Navigator not Page.
* Modules/webvr/VRDisplay.cpp:
(WebCore::VRDisplay::create): Moved suspendIfNeeded() to constructor.
(WebCore::VRDisplay::VRDisplay): Set itself as VRPlatformDisplay client.
(WebCore::VRDisplay::~VRDisplay): Unset as  VRPlatformDisplay client.
(WebCore::VRDisplay::VRPlatformDisplayConnected): Dispatch event on DOM window.
(WebCore::VRDisplay::VRPlatformDisplayDisconnected): Ditto.
(WebCore::VRDisplay::VRPlatformDisplayMounted): Ditto.
(WebCore::VRDisplay::VRPlatformDisplayUnmounted): Ditto.
* Modules/webvr/VRDisplay.h: Extend from VRPlatformDisplayClient.
(WebCore::VRDisplay::document):
* Modules/webvr/VRDisplayEvent.cpp: Updated Copyright.
* Modules/webvr/VRDisplayEvent.h: Ditto.
* Sources.txt: Added the two new files.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* platform/vr/VRManager.cpp:
(WebCore::VRManager::getVRDisplays): Keep a list of VRPlatformDisplays and update them conveniently,
also emitting the required events under certain conditions (like device disconnection).
* platform/vr/VRManager.h:
* platform/vr/VRPlatformDisplay.cpp: New file with common implementations for VRPlatformDisplays.
(WebCore::VRPlatformDisplay::setClient):
(WebCore::VRPlatformDisplay::notifyVRPlatformDisplayEvent):
* platform/vr/VRPlatformDisplay.h: Added a generic method to notify about different
events. Added the client pointer.
* platform/vr/VRPlatformDisplayClient.h: New file. VRPlatformDisplay implementations will
call the client methods in the event of some circumstances happening.
(WebCore::VRPlatformDisplayClient::VRPlatformDisplayConnected):
(WebCore::VRPlatformDisplayClient::VRPlatformDisplayDisconnected):
(WebCore::VRPlatformDisplayClient::VRPlatformDisplayMounted):
(WebCore::VRPlatformDisplayClient::VRPlatformDisplayUnmounted):
* platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
(WebCore::VRPlatformDisplayOpenVR::updateDisplayInfo): Poll the device for new events to
detect connection/disconnections or device activations/deactivations (HMD
mounted/unmounted).
* platform/vr/openvr/VRPlatformDisplayOpenVR.h:

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

15 months ago[Nicosia] Add Nicosia::PlatformLayer, Nicosia::CompositionLayer classes
zandobersek@gmail.com [Mon, 16 Jul 2018 12:24:08 +0000 (12:24 +0000)]
[Nicosia] Add Nicosia::PlatformLayer, Nicosia::CompositionLayer classes
https://bugs.webkit.org/show_bug.cgi?id=187693

Reviewed by Carlos Garcia Campos.

Add the Nicosia::PlatformLayer class. This will be the base platform
layer class from which different derivatives will be created, addressing
different use cases. The generic PlatformLayer type alias will point to
this class in the future.

First class deriving from Nicosia::PlatformLayer is
Nicosia::CompositionLayer, purpose of which will be to mirror the state
that's stored in the platform-specific GraphicsLayer derivative. It will
also allow making thread-safe updates to that state.

CoordinatedGraphicsLayer implementation now spawns a CompositionLayer
object and tracks state changes in a separate
CompositionLayer::LayerState::Delta object. During flushing, the changed
state is applied to the layer's pending state before the delta is nulled
out. The updated state isn't used anywhere yet, but future changes will
implement committing this state into the rendering pipeline.

There's bits of state not yet being managed by CompositionLayer, e.g.
debug visuals, filters and animations. These will be addressed later.

The m_solidColor member variable is added to CoordinatedGraphicsLayer in
order to properly store the solid color value. Normally this would be
contained by the parent GraphicsLayer class, but no such member variable
exists there.

* platform/TextureMapper.cmake:
* platform/graphics/nicosia/NicosiaPlatformLayer.cpp: Added.
(Nicosia::PlatformLayer::PlatformLayer):
(Nicosia::CompositionLayer::CompositionLayer):
* platform/graphics/nicosia/NicosiaPlatformLayer.h: Added.
(Nicosia::PlatformLayer::isCompositionLayer const):
(Nicosia::PlatformLayer::id const):
(Nicosia::CompositionLayer::create):
(Nicosia::CompositionLayer::LayerState::Flags::Flags):
(Nicosia::CompositionLayer::updateState):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::setPosition):
(WebCore::CoordinatedGraphicsLayer::setAnchorPoint):
(WebCore::CoordinatedGraphicsLayer::setSize):
(WebCore::CoordinatedGraphicsLayer::setTransform):
(WebCore::CoordinatedGraphicsLayer::setChildrenTransform):
(WebCore::CoordinatedGraphicsLayer::setPreserves3D):
(WebCore::CoordinatedGraphicsLayer::setMasksToBounds):
(WebCore::CoordinatedGraphicsLayer::setDrawsContent):
(WebCore::CoordinatedGraphicsLayer::setContentsVisible):
(WebCore::CoordinatedGraphicsLayer::setContentsOpaque):
(WebCore::CoordinatedGraphicsLayer::setBackfaceVisibility):
(WebCore::CoordinatedGraphicsLayer::setOpacity):
(WebCore::CoordinatedGraphicsLayer::setContentsRect):
(WebCore::CoordinatedGraphicsLayer::setContentsTileSize):
(WebCore::CoordinatedGraphicsLayer::setContentsTilePhase):
(WebCore::CoordinatedGraphicsLayer::setContentsToSolidColor):
(WebCore::CoordinatedGraphicsLayer::setMaskLayer):
(WebCore::CoordinatedGraphicsLayer::setReplicatedByLayer):
(WebCore::CoordinatedGraphicsLayer::syncChildren):
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

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

15 months ago[GLIB] Add API to evaluate code using a given object to store global symbols
carlosgc@webkit.org [Mon, 16 Jul 2018 11:58:11 +0000 (11:58 +0000)]
[GLIB] Add API to evaluate code using a given object to store global symbols
https://bugs.webkit.org/show_bug.cgi?id=187639

Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

Add jsc_context_evaluate_in_object(). It returns a new object as an out parameter. Global symbols in the
evaluated script are added as properties to the new object instead of to the context global object. This is
similar to JS::Evaluate in spider monkey when a scopeChain parameter is passed, but JSC doesn't support using a
scope for assignments, so we have to create a new context and get its global object. This patch also updates
jsc_context_evaluate_with_source_uri() to receive the starting line number for consistency with the new
jsc_context_evaluate_in_object().

* API/glib/JSCContext.cpp:
(jsc_context_evaluate): Pass 0 as line number to jsc_context_evaluate_with_source_uri().
(evaluateScriptInContext): Helper function to evaluate a script in a JSGlobalContextRef.
(jsc_context_evaluate_with_source_uri): Use evaluateScriptInContext().
(jsc_context_evaluate_in_object): Create a new context and set the main context global object as extension
scope of it. Evaluate the script in the new context and get its global object to be returned as parameter.
* API/glib/JSCContext.h:
* API/glib/docs/jsc-glib-4.0-sections.txt:

Tools:

Add a new test case.

* TestWebKitAPI/Tests/JavaScriptCore/glib/TestJSC.cpp:
(testJSCEvaluateInObject):
(testJSCExceptions):
(main):

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

15 months ago[webkitpy] run-web-platform-tests should allow specifying custom WPT metadata directories
zandobersek@gmail.com [Mon, 16 Jul 2018 06:43:45 +0000 (06:43 +0000)]
[webkitpy] run-web-platform-tests should allow specifying custom WPT metadata directories
https://bugs.webkit.org/show_bug.cgi?id=187353

Reviewed by Youenn Fablet.

When using run-web-platform-tests, allow specifying custom WPT metadata
directory. This will avoid generating such metadata-filled directory
from the port-specific JSON expectations file, and instead will search
for the metadata files and the include manifest inside the specified
directory. The MANIFEST.json file will also be generated under there.

Rationale for this change is prototyping using custom metadata
directories and avoiding generating all this content from a JSON file.
Using this by default in the future would avoid sporradic changes in how
WPT handles metadata .ini files and releases us from the obligation of
adjusting the generator for every such change. This would also allow
managing this metadata content in a separate repository, avoiding
polluting the main webkit.org repository with thousands of .ini files.

If this turns out to be the preferable way of managing the metadata
content, the JSON files under WebPlatformTests/ and the related code in
wpt_runner.py would be removed.

* Scripts/webkitpy/w3c/wpt_runner.py:
(parse_args):
(WPTRunner._wpt_run_paths):
(WPTRunner.run):
* Scripts/webkitpy/w3c/wpt_runner_unittest.py:
(WPTRunnerTest.test_run_with_specified_options):

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

15 months ago[SOUP] http/tests/misc/bubble-drag-events.html crashes
carlosgc@webkit.org [Mon, 16 Jul 2018 05:22:36 +0000 (05:22 +0000)]
[SOUP] http/tests/misc/bubble-drag-events.html crashes
https://bugs.webkit.org/show_bug.cgi?id=182352

Reviewed by Youenn Fablet.

PingLoad is not refcounted and deletes itself when the load finishes. The problem is that the network data
task can also finish the load, causing the PingLoad to be deleted early. We tried to fix it in r233032 in the
network data task soup implementation, but it caused regressions.

* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::didReceiveChallenge): Create a weak ref for the ping load before calling the operation completion
handler and return early after the completion handler if it was deleted.
(WebKit::PingLoad::didReceiveResponseNetworkSession): Ditto.
* NetworkProcess/PingLoad.h:
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::continueAuthenticate): Revert r233032.

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

15 months ago[iOS apps on macOS] Playing embedded Twitter videos in the News app crashes the web...
wenson_hsieh@apple.com [Mon, 16 Jul 2018 05:19:42 +0000 (05:19 +0000)]
[iOS apps on macOS] Playing embedded Twitter videos in the News app crashes the web process
https://bugs.webkit.org/show_bug.cgi?id=187690
<rdar://problem/41869703>

Reviewed by Tim Horton.

Work around unexpected behavior when soft-linking AVFoundation. After using `dlopen_preflight` to check for the
existence of a library prior to loading the library using `dlopen`, `dlsym` subsequently returns null for some
symbols that would otherwise be available. This causes us to RELEASE_ASSERT later down the road when we try to
load AVAudioSessionModeDefault in AudioSessionIOS.mm.

To fix this for now, simply check for the library directly instead of using the more lightweight preflight
check. See clone: <rdar://problem/42224780> for more detail.

* platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
(WebCore::AVFoundationMIMETypeCache::isAvailable const):

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

15 months agoShrink StyleFillData, StyleStrokeData and StyleMiscData
simon.fraser@apple.com [Sun, 15 Jul 2018 04:26:36 +0000 (04:26 +0000)]
Shrink StyleFillData, StyleStrokeData and StyleMiscData
https://bugs.webkit.org/show_bug.cgi?id=187681

Reviewed by Anders Carlsson.

Shrink these data structures by making more enum classes one byte in size, and
re-ordering. StyleFillData goes from 56 to 48, StyleStrokeData from 80 to 72,
StyleMiscData from 40 to 32 bytes.

* rendering/style/SVGRenderStyleDefs.cpp:
(WebCore::StyleFillData::StyleFillData):
(WebCore::StyleFillData::operator== const):
(WebCore::StyleStrokeData::StyleStrokeData):
(WebCore::StyleStrokeData::operator== const):
(WebCore::StyleStopData::operator== const):
(WebCore::StyleMiscData::StyleMiscData):
* rendering/style/SVGRenderStyleDefs.h:

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

15 months agoShrink CachedResource and subclasses
simon.fraser@apple.com [Sun, 15 Jul 2018 02:13:40 +0000 (02:13 +0000)]
Shrink CachedResource and subclasses
https://bugs.webkit.org/show_bug.cgi?id=187546

Reviewed by Daniel Bates.

Shrink CachedResource down from 1384 to 1336 bytes, CachedImage from 1480 to
1424 bytes, and CachedFont a little.

This saves about 23KB on cnn.com.

* loader/ResourceLoaderOptions.h:
* loader/cache/CachedFont.h:
* loader/cache/CachedImage.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
* loader/cache/CachedResource.h:
* platform/network/CacheValidation.h:
(WebCore::RedirectChainCacheStatus::RedirectChainCacheStatus):
* platform/network/NetworkLoadMetrics.h:
* platform/network/ParsedContentRange.h:
* platform/network/ResourceRequestBase.h:
* platform/network/ResourceResponseBase.h:

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

15 months agoShrink some style-related classes and enums
simon.fraser@apple.com [Sun, 15 Jul 2018 00:29:28 +0000 (00:29 +0000)]
Shrink some style-related classes and enums
https://bugs.webkit.org/show_bug.cgi?id=187680

Reviewed by Antti Koivisto.

Make all the enum classes in RenderStyleConstants be one byte big (all have less
than 256 values).

Shrink DocumentRuleSet from 384 to 368 bytes by re-ordering, which also helps shrink
StyleResolver from 1024 to 952 bytes.

Shrink BorderValue by re-ordering (now that the layout of Color has changed) which
shrinks BorderData from 168 to 136 bytes.

Convert a couple of other enums to enum class so that they can have explicit size.

* css/DocumentRuleSets.h:
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::documentElementUserAgentStyle const):
* css/StyleMedia.cpp:
(WebCore::StyleMedia::matchMedium const):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::StyleResolver):
(WebCore::StyleResolver::State::State):
(WebCore::StyleResolver::styleForElement):
(WebCore::StyleResolver::cascadedPropertiesForRollback):
(WebCore::StyleResolver::applyProperty):
(WebCore::cascadeLevelForIndex):
* css/StyleResolver.h:
* rendering/style/BorderValue.h:
* rendering/style/RenderStyle.cpp:
* rendering/style/RenderStyleConstants.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::styleForElement):
* svg/SVGElementRareData.h:
(WebCore::SVGElementRareData::overrideComputedStyle):

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

15 months agoEnsure WebKit stack is ad-hoc signed
ap@apple.com [Sat, 14 Jul 2018 23:44:42 +0000 (23:44 +0000)]
Ensure WebKit stack is ad-hoc signed
https://bugs.webkit.org/show_bug.cgi?id=187667

Patch by Kocsen Chung <kocsen_chung@apple.com> on 2018-07-14
Reviewed by Alexey Proskuryakov.

* Configurations/Base.xcconfig:

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

15 months agoReplace TR2_OPTIONAL_ASSERTED_EXPRESSION macro in <wtf/Optional.h>
ddkilzer@apple.com [Sat, 14 Jul 2018 16:59:54 +0000 (16:59 +0000)]
Replace TR2_OPTIONAL_ASSERTED_EXPRESSION macro in <wtf/Optional.h>
<https://webkit.org/b/187672>

Reviewed by Frédéric Wang.

* wtf/Optional.h:
(std::optional::operator -> const):
(std::optional::operator * const):
(std::optional<T::operator-> const):
(std::optional<T::operator* const):
- Replace TR2_OPTIONAL_ASSERTED_EXPRESSION macro with
  ASSERT_UNDER_CONSTEXPR_CONTEXT macro and return statement.

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

15 months ago[css-masking] Fully support -webkit-clip-path on SVG elements
krit@webkit.org [Sat, 14 Jul 2018 09:19:46 +0000 (09:19 +0000)]
[css-masking] Fully support -webkit-clip-path on SVG elements
https://bugs.webkit.org/show_bug.cgi?id=185829

Reviewed by Simon Fraser.

Source/WebCore:

-webkit-clip-path contributes to SVG elements with boxes, shapes and now with
element references to <clipPath> elements as well. Make sure that all types
contribute to hit-testing of the SVG element as well as they should.

Tests: svg/clip-path/webkit-clip-path-after-expected.svg
       svg/clip-path/webkit-clip-path-after.svg
       svg/clip-path/webkit-clip-path-before-expected.svg
       svg/clip-path/webkit-clip-path-before.svg
       svg/dynamic-updates/SVGClipPath-prefixed-influences-hitTesting.html
       svg/dynamic-updates/SVGClipPath-prefixed-path-influences-hitTesting.html
       svg/dynamic-updates/SVGClipPathElement-prefixed-css-transform-influences-hitTesting.html
       svg/dynamic-updates/SVGClipPathElement-prefixed-transform-influences-hitTesting.html

* rendering/svg/SVGRenderSupport.cpp: Share code as much as possible.
(WebCore::clipPathReferenceBox):
(WebCore::isPointInCSSClippingArea): Take -webkit-clip-path into account.
(WebCore::SVGRenderSupport::clipContextToCSSClippingArea):
(WebCore::SVGRenderSupport::pointInClippingArea):
* rendering/svg/SVGRenderSupport.h:
* rendering/svg/SVGRenderingContext.cpp: Clip to -webkit-clip-path boxes, shapes and references.
(WebCore::SVGRenderingContext::prepareToRenderSVGContent):
* rendering/svg/SVGResources.cpp: Add -webkit-clip-path references to cached resources. Mimic SVG clip-path.
(WebCore::SVGResources::buildCachedResources):

LayoutTests:

Test -webkit-clip-path element references on SVG elements. Make sure, -webkit-clip-path
contributes to hit testing for element references and basic shapes.

* svg/clip-path/webkit-clip-path-after-expected.svg: Added.
* svg/clip-path/webkit-clip-path-after.svg: Added.
* svg/clip-path/webkit-clip-path-before-expected.svg: Added.
* svg/clip-path/webkit-clip-path-before.svg: Added.
* svg/dynamic-updates/SVGClipPath-prefixed-influences-hitTesting-expected.txt: Added.
* svg/dynamic-updates/SVGClipPath-prefixed-influences-hitTesting.html: Added.
* svg/dynamic-updates/SVGClipPath-prefixed-path-influences-hitTesting-expected.txt: Added.
* svg/dynamic-updates/SVGClipPath-prefixed-path-influences-hitTesting.html: Added.
* svg/dynamic-updates/SVGClipPathElement-prefixed-css-transform-influences-hitTesting-expected.txt: Added.
* svg/dynamic-updates/SVGClipPathElement-prefixed-css-transform-influences-hitTesting.html: Added.
* svg/dynamic-updates/SVGClipPathElement-prefixed-transform-influences-hitTesting-expected.txt: Added.
* svg/dynamic-updates/SVGClipPathElement-prefixed-transform-influences-hitTesting.html: Added.

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

15 months ago[WinCairo] run-api-tests is timing out for almost all test cases
ross.kirsling@sony.com [Sat, 14 Jul 2018 06:48:09 +0000 (06:48 +0000)]
[WinCairo] run-api-tests is timing out for almost all test cases
https://bugs.webkit.org/show_bug.cgi?id=187547

Reviewed by Fujii Hironori.

* Scripts/webkitpy/port/server_process.py:
(ServerProcess._wait_for_data_and_update_buffers_using_win32_apis):
Still attempt to read from stdout/stderr even if the process has exited, as long as it's before the deadline.

* Scripts/webkitpy/port/server_process_unittest.py:
(TestServerProcess.test_read_after_process_exits):
Add test case.

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

15 months agoAvoid fetching visitedDependentColor() so many times in editing code
simon.fraser@apple.com [Sat, 14 Jul 2018 02:15:49 +0000 (02:15 +0000)]
Avoid fetching visitedDependentColor() so many times in editing code
https://bugs.webkit.org/show_bug.cgi?id=187676

Reviewed by Zalan Bujtas.

editingAttributedStringFromRange called style.visitedDependentColor() twice for each property,
and fontAttributesForSelectionStart() called it two or three times. Use a local Color variable
to avoid so many calls. Also replace a call to alpha() with isVisible() which makes the usage more clear.

No behavior change.

* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::fontAttributesForSelectionStart const):
* editing/cocoa/HTMLConverter.mm:
(WebCore::editingAttributedStringFromRange):

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

15 months agoAdd TestExpectations and baselines for iOS 12
ryanhaddad@apple.com [Sat, 14 Jul 2018 01:53:50 +0000 (01:53 +0000)]
Add TestExpectations and baselines for iOS 12
https://bugs.webkit.org/show_bug.cgi?id=187628

Reviewed by Alexey Proskuryakov.

Tools:

* Scripts/webkitpy/port/ios.py:
(IOSPort): Bump current version to 12.

LayoutTests:

* platform/ios-12/TestExpectations: Added.

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

15 months agoAdd TestExpectations and baselines for Mojave.
ryanhaddad@apple.com [Sat, 14 Jul 2018 01:16:36 +0000 (01:16 +0000)]
Add TestExpectations and baselines for Mojave.
https://bugs.webkit.org/show_bug.cgi?id=187620

Reviewed by Alexey Proskuryakov.

Tools:

* Scripts/webkitpy/port/mac.py:
(MacPort): Bump current version to 10.14.

LayoutTests:

* platform/mac/TestExpectations:

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

15 months agoFlesh out WebSocket cookie tests to cover cookie policy for third-party resources
wilander@apple.com [Sat, 14 Jul 2018 01:07:38 +0000 (01:07 +0000)]
Flesh out WebSocket cookie tests to cover cookie policy for third-party resources
https://bugs.webkit.org/show_bug.cgi?id=187541
<rdar://problem/42048729>

Reviewed by Alex Christensen.

* http/tests/cookies/resources/cookie-utilities.js:
    Added a function for setting a cookie in a WebSocket handshake.
* http/tests/websocket/tests/hybi/cookie_wsh.py:
(web_socket_do_extra_handshake):
    Now sets the root path for new cookies so that they can be seen by
    for example cookies/resources/echo-cookies.php.
* http/tests/websocket/tests/hybi/websocket-allowed-setting-cookie-as-third-party-expected.txt: Added.
* http/tests/websocket/tests/hybi/websocket-allowed-setting-cookie-as-third-party.html: Added.
* http/tests/websocket/tests/hybi/websocket-blocked-from-setting-cookie-as-third-party-expected.txt: Added.
* http/tests/websocket/tests/hybi/websocket-blocked-from-setting-cookie-as-third-party.html: Added.
* http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior-expected.txt:
* http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior.html:
    Now tests under the condition where localhost as third-party is
    allowed to set a new cookie as third party. It also makes sure to use
    cookies with the path set to the root so that all cookies are visible.

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

15 months agoSupport connecting a MediaStreamAudioDestinationNode to RTCPeerConnection
youenn@apple.com [Sat, 14 Jul 2018 00:04:30 +0000 (00:04 +0000)]
Support connecting a MediaStreamAudioDestinationNode to RTCPeerConnection
https://bugs.webkit.org/show_bug.cgi?id=187627
<rdar://problem/35334400>

Reviewed by Jer Noble.

Source/WebCore:

When MediaStreamAudioSource is called to read new audio samples,
convert these samples to a WebAudioBufferList and call RealtimeMediaSource::audioSamplesAvailable.
This makes its observers to get the audio data.

Test: webrtc/peer-connection-createMediaStreamDestination.html

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::create): Minor refactoring.
* Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
(WebCore::createMediaStream):
(WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
(WebCore::MediaStreamAudioDestinationNode::process):
* Modules/webaudio/MediaStreamAudioDestinationNode.h:
* Modules/webaudio/MediaStreamAudioSource.cpp:
(WebCore::MediaStreamAudioSource::MediaStreamAudioSource):
(WebCore::MediaStreamAudioSource::consumeAudio):
* Modules/webaudio/MediaStreamAudioSource.h:
* Modules/webaudio/MediaStreamAudioSourceCocoa.cpp: Added.
(WebCore::streamDescription):
(WebCore::MediaStreamAudioSource::consumeAudio):
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/AudioDestinationConsumer.h: Removed.
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::create):
* platform/mediastream/MediaStreamPrivate.h:

LayoutTests:

* webrtc/peer-connection-createMediaStreamDestination-expected.txt: Added.
* webrtc/peer-connection-createMediaStreamDestination.html: Added.

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

15 months agoAdd _drawsBackground to WKWebViewConfiguration.
timothy@apple.com [Sat, 14 Jul 2018 00:03:49 +0000 (00:03 +0000)]
Add _drawsBackground to WKWebViewConfiguration.
https://bugs.webkit.org/show_bug.cgi?id=187665
rdar://problem/42182268

Reviewed by Tim Horton.

Source/WebKit:

* UIProcess/API/APIPageConfiguration.cpp:
(API::PageConfiguration::copy const): Copy m_drawsBackground, and some missing values.
* UIProcess/API/APIPageConfiguration.h:
(API::PageConfiguration::drawsBackground const): Added.
(API::PageConfiguration::setDrawsBackground): Added.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]): Transfer _drawsBackground to page config.
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]): Set _drawsBackground to YES.
(-[WKWebViewConfiguration encodeWithCoder:]): Encode _drawsBackground.
(-[WKWebViewConfiguration initWithCoder:]): Decode _drawsBackground.
(-[WKWebViewConfiguration copyWithZone:]): Copy _drawsBackground.
(-[WKWebViewConfiguration _drawsBackground]): Added.
(-[WKWebViewConfiguration _setDrawsBackground:]): Added.
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/WebPageProxy.cpp: Set m_drawsBackground based on configuration.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/Configuration.mm:
(TestWebKitAPI.WebKit.ConfigurationDrawsBackground): Added.

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

15 months ago[WinCairo] Enable WebGL when Accelerated Compositing is disabled
chris.reid@sony.com [Fri, 13 Jul 2018 23:20:53 +0000 (23:20 +0000)]
[WinCairo] Enable WebGL when Accelerated Compositing is disabled
https://bugs.webkit.org/show_bug.cgi?id=187664

Reviewed by Fujii Hironori.

AC was disabled for WinCairo in r233725 but it can still run WebGL without AC.

* html/HTMLCanvasElement.cpp:

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

15 months agoWeb Inspector: REGRESSION (r195723): Improve support for resources with '\r' and...
mattbaker@apple.com [Fri, 13 Jul 2018 23:11:08 +0000 (23:11 +0000)]
Web Inspector: REGRESSION (r195723): Improve support for resources with '\r' and '\r\n' line endings
https://bugs.webkit.org/show_bug.cgi?id=186453
<rdar://problem/39689180>

Reviewed by Joseph Pecoraro.

Now that the frontend no longer uses offsets from the original source
file to calculate positions within CodeMirror, it is possible to support
resources with '\r' and '\r\n' line endings in the editor.

* UserInterface/Views/CodeMirrorEditor.js:
(WI.CodeMirrorEditor.create):
(WI.CodeMirrorEditor):

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

15 months agoCrash under ApplicationCacheGroup::didFailLoadingEntry()
cdumez@apple.com [Fri, 13 Jul 2018 22:54:16 +0000 (22:54 +0000)]
Crash under ApplicationCacheGroup::didFailLoadingEntry()
https://bugs.webkit.org/show_bug.cgi?id=187661
<rdar://problem/42179755>

Reviewed by Youenn Fablet.

If ApplicationCacheResourceLoader::create() fails synchronously with
ApplicationCacheResourceLoader::Error::CannotCreateResource error, then
m_entryLoader will be null when didFailLoadingEntry() is called. However,
didFailLoadingEntry() fails to null check m_entryLoader before using it.

* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didFailLoadingEntry):
(WebCore::ApplicationCacheGroup::startLoadingEntry):
* loader/appcache/ApplicationCacheGroup.h:

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

15 months agoWebKit sometimes holds WiFi/BT assertions while the Networking process is suspended
timothy_horton@apple.com [Fri, 13 Jul 2018 22:35:48 +0000 (22:35 +0000)]
WebKit sometimes holds WiFi/BT assertions while the Networking process is suspended
https://bugs.webkit.org/show_bug.cgi?id=187662
<rdar://problem/41999448>

Reviewed by Chris Dumez.

Inform WiFiAssertions when the Networking process is first going into the background,
so it has a chance of dropping its assertions even in cases where the system
suspends the process before we receive prepareToSuspend.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::processDidTransitionToForeground):
(WebKit::NetworkProcess::processDidTransitionToBackground):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/curl/NetworkProcessCurl.cpp:
(WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
(WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
(WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::sendProcessDidTransitionToForeground):
(WebKit::NetworkProcessProxy::sendProcessDidTransitionToBackground):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::updateProcessAssertions):
Plumb the foreground/background transition to NetworkProcess.

* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformPrepareToSuspend):
(WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
(WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
Make use of SuspensionReason to explain to WiFiAssertions the
difference between prepareToSuspend and didTransitionToBackground,
so that it can adjust the timing of dropping the assertion.

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

15 months agoAdd release assertion to check thread in TimerBase::setNextFireTime
achristensen@apple.com [Fri, 13 Jul 2018 22:33:35 +0000 (22:33 +0000)]
Add release assertion to check thread in TimerBase::setNextFireTime
https://bugs.webkit.org/show_bug.cgi?id=187666

Reviewed by Ryosuke Niwa.

This should give us insight into what is causing <rdar://problem/33352721>

* platform/Timer.cpp:
(WebCore::TimerBase::setNextFireTime):

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

15 months agoWeb Inspector: Basic blocks highlighting should use line/column locations instead...
mattbaker@apple.com [Fri, 13 Jul 2018 22:27:30 +0000 (22:27 +0000)]
Web Inspector: Basic blocks highlighting should use line/column locations instead of offsets
https://bugs.webkit.org/show_bug.cgi?id=187613
<rdar://problem/42131808>

Reviewed by Joseph Pecoraro.

* UserInterface/Controllers/BasicBlockAnnotator.js:
Basic blocks sent from the backend include offsets into the original
file, rather than line/column locations. In order to translate to positions
within CodeMirror, we need to calculate the original line and column
for each block.

(WI.BasicBlockAnnotator.prototype.insertAnnotations):
(WI.BasicBlockAnnotator.prototype._calculateBasicBlockPositions.offsetToPosition):
(WI.BasicBlockAnnotator.prototype._calculateBasicBlockPositions):
(WI.BasicBlockAnnotator.prototype._annotateBasicBlockExecutionRanges.):
(WI.BasicBlockAnnotator.prototype._annotateBasicBlockExecutionRanges):
(WI.BasicBlockAnnotator.prototype._highlightTextForBasicBlock):

* UserInterface/Models/SourceCodePosition.js:
(WI.SourceCodePosition.prototype.offsetColumn):

* UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype.getTextInRange):
(WI.TextEditor.prototype.addStyleToTextRange):
Better encapsulation for CodeMirror positions.

* UserInterface/Workers/Formatter/FormatterUtilities.js:
(get if):
Update String.prototype.lineEndings to support additional line separators.

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

15 months ago[ MacOS WK1 ] Layout Tests in media/media-fragments/ are flaky
commit-queue@webkit.org [Fri, 13 Jul 2018 22:26:10 +0000 (22:26 +0000)]
[ MacOS WK1 ] Layout Tests in media/media-fragments/ are flaky
https://bugs.webkit.org/show_bug.cgi?id=187557

Unreviewed test gardening.

Patch by Truitt Savell <tsavell@apple.com> on 2018-07-13

* platform/mac-wk1/TestExpectations:

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

15 months agoREGRESSION (r231676): watchOS WebKit usually doesn't load in the background
timothy_horton@apple.com [Fri, 13 Jul 2018 22:22:42 +0000 (22:22 +0000)]
REGRESSION (r231676): watchOS WebKit usually doesn't load in the background
https://bugs.webkit.org/show_bug.cgi?id=187663
<rdar://problem/42181185>

Reviewed by Chris Dumez.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::applicationDidEnterBackground):
"Screen lock" is very aggressive on watchOS; we want to do our usual
30 seconds of loading in the background when you drop your wrist,
so disable this power optimization on that platform.

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

15 months agoWeb Inspector: Execution highlighting in the frontend should be line/column-based
mattbaker@apple.com [Fri, 13 Jul 2018 21:53:14 +0000 (21:53 +0000)]
Web Inspector: Execution highlighting in the frontend should be line/column-based
https://bugs.webkit.org/show_bug.cgi?id=187532
<rdar://problem/42035580>

Reviewed by Joseph Pecoraro.

Source code offsets from Esprima should not be used to calculate ranges
in CodeMirror for expression highlighting.

This also fixes a long standing bug when adjusting for the starting
position of an inline script. Previously the start offset from the script
TextRange was used for this purpose, but the value is often incorrect (see
https://bugs.webkit.org/show_bug.cgi?id=187532#c5). By using the starting
line/column instead, we avoid the problem.

* UserInterface/Models/ScriptSyntaxTree.js:
(WI.ScriptSyntaxTree.prototype.containersOfPosition):
(WI.ScriptSyntaxTree.prototype.containersOfOffset): Deleted.

* UserInterface/Models/SourceCodePosition.js:
(WI.SourceCodePosition.prototype.offsetColumn):

* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange.toInlineScriptPosition):
(WI.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange.fromInlineScriptPosition):
(WI.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
(WI.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange.convertRangeOffsetsToSourceCodeOffsets): Deleted.

* UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype._updateExecutionRangeHighlight):

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