WebKit.git
2 years agoREGRESSION: API tests WebKit.ProcessDidTerminateRequestedByClient and WebKit.ProcessD...
achristensen@apple.com [Mon, 2 Oct 2017 19:49:55 +0000 (19:49 +0000)]
REGRESSION: API tests WebKit.ProcessDidTerminateRequestedByClient and WebKit.ProcessDidTerminateWithReasonCrash are timing out
https://bugs.webkit.org/show_bug.cgi?id=177764

Reviewed by Chris Dumez.

* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageNavigationClient):
I shouldn't have reverted the A API telling the listener to continue if there's no client function.

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

2 years ago[WPE][GTK] Crash in webkit_web_resource_get_data_finish()
carlosgc@webkit.org [Mon, 2 Oct 2017 19:48:37 +0000 (19:48 +0000)]
[WPE][GTK] Crash in webkit_web_resource_get_data_finish()
https://bugs.webkit.org/show_bug.cgi?id=177107

Reviewed by Michael Catanzaro.

Source/WebKit:

Handle errors in webkit_web_resource_get_data() callback.

* UIProcess/API/glib/WebKitWebResource.cpp:
(resourceDataCallback):
(webkit_web_resource_get_data):

Tools:

Add a test case to check we handle errors when webkit_web_resource_get_data() fails.

* TestWebKitAPI/Tests/WebKitGLib/TestResources.cpp:
(webViewloadChanged):
(testWebResourceGetDataError):
(beforeAll):

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

2 years agoMark imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSA-PSS.worke...
jiewen_tan@apple.com [Mon, 2 Oct 2017 19:40:45 +0000 (19:40 +0000)]
Mark imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSA-PSS.worker.html as slow
https://bugs.webkit.org/show_bug.cgi?id=177615

Unreviewed test gardening.

* TestExpectations:
* platform/mac-wk2/TestExpectations:

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

2 years agoAddressing post-review comments after r222621
zalan@apple.com [Mon, 2 Oct 2017 19:34:42 +0000 (19:34 +0000)]
Addressing post-review comments after r222621
https://bugs.webkit.org/show_bug.cgi?id=177610

Reviewed by Darin Adler.

* rendering/RenderMenuList.cpp:
(RenderMenuList::didUpdateActiveOption):

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

2 years agoRemove length argument from TextPainter::paint()
dbates@webkit.org [Mon, 2 Oct 2017 19:23:38 +0000 (19:23 +0000)]
Remove length argument from TextPainter::paint()
https://bugs.webkit.org/show_bug.cgi?id=177758

Reviewed by Alex Christensen.

Have TextPainter.paint() use the length of the specified TextRun as opposed to
taking an explicit argument for the length of the TextRun.

Following r222670 InlineTextBox creates a TextRun with respect to the truncated
line. Prior to r222670 InlineTextBox did not do this and hence it had to pass both
the TextRun and truncated length to TextPainter.paint() to have the line painted.
Code that needs to paint a substring of a TextRun can still do so by using TextPainter.paintRange().

No functionality changed. So, no new tests.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
* rendering/TextPainter.cpp:
(WebCore::TextPainter::paint):
* rendering/TextPainter.h:

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

2 years ago[Linux] Enable Gigacage in x64 Linux environment
utatane.tea@gmail.com [Mon, 2 Oct 2017 19:20:00 +0000 (19:20 +0000)]
[Linux] Enable Gigacage in x64 Linux environment
https://bugs.webkit.org/show_bug.cgi?id=177745

Reviewed by Carlos Garcia Campos.

This patch enables Gigacage in x64 Linux environment.
Gigacage enforces a caged pointer to reference to the
specific memory region. This reduces the effectiveness
of some types of attacks setting a pointer to ArrayBuffer
and modifying arbitrary memory region.

* bmalloc/Gigacage.h:

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

2 years ago[curl] Crashes in CurlRequest::setupPUT()
commit-queue@webkit.org [Mon, 2 Oct 2017 19:04:09 +0000 (19:04 +0000)]
[curl] Crashes in CurlRequest::setupPUT()
https://bugs.webkit.org/show_bug.cgi?id=177733

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-10-02
Reviewed by Alex Christensen.

Tests: http/tests/xmlhttprequest/xmlhttprequest-open-method-allowed.html

* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupPUT): Null-check the result of request.httpBody().

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

2 years ago[WPE] Fix UIProcess build with GStreamer and without VIDEO
commit-queue@webkit.org [Mon, 2 Oct 2017 19:02:27 +0000 (19:02 +0000)]
[WPE] Fix UIProcess build with GStreamer and without VIDEO
https://bugs.webkit.org/show_bug.cgi?id=177753

Patch by Olivier Blin <olivier.blin@softathome.com> on 2017-10-02
Reviewed by Michael Catanzaro.

GStreamer builds fail when WebAudio is enabled but VIDEO disabled.
This is the WPE counterpart of bug 153135.

* UIProcess/API/wpe/PageClientImpl.h:

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

2 years ago[CURL] Should handle redirects in WebCore
commit-queue@webkit.org [Mon, 2 Oct 2017 19:00:17 +0000 (19:00 +0000)]
[CURL] Should handle redirects in WebCore
https://bugs.webkit.org/show_bug.cgi?id=21242

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-10-02
Reviewed by Alex Christensen.

* platform/network/ResourceHandle.cpp:
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::enableAutoReferer): Deleted.
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupTransfer):
(WebCore::CurlRequest::didReceiveHeader):
(WebCore::CurlRequest::didReceiveData):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::continueDidReceiveResponse):
(WebCore::ResourceHandle::continueWillSendRequest):
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
(WebCore::ResourceHandleCurlDelegate::shouldRedirectAsGET):
(WebCore::ResourceHandleCurlDelegate::willSendRequest):
(WebCore::ResourceHandleCurlDelegate::continueWillSendRequest):
(WebCore::ResourceHandleCurlDelegate::continueAfterWillSendRequest):
* platform/network/curl/ResourceHandleCurlDelegate.h:
* platform/network/curl/ResourceResponse.h:
* platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::shouldRedirect):
(WebCore::ResourceResponse::isMovedPermanently const):
(WebCore::ResourceResponse::isFound const):
(WebCore::ResourceResponse::isSeeOther const):
(WebCore::ResourceResponse::isRedirection const): Deleted.

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

2 years ago[WPE] Do not require XSLT if disabled
commit-queue@webkit.org [Mon, 2 Oct 2017 18:58:07 +0000 (18:58 +0000)]
[WPE] Do not require XSLT if disabled
https://bugs.webkit.org/show_bug.cgi?id=177752

Patch by Olivier Blin <olivier.blin@softathome.com> on 2017-10-02
Reviewed by Michael Catanzaro.

* Source/cmake/OptionsWPE.cmake: libxslt is not a hard dep

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

2 years agoCrashes with guard malloc under RenderFullScreen::unwrapRenderer
antti@apple.com [Mon, 2 Oct 2017 18:29:25 +0000 (18:29 +0000)]
Crashes with guard malloc under RenderFullScreen::unwrapRenderer
https://bugs.webkit.org/show_bug.cgi?id=177760

Unreviewed.

* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::unwrapRenderer):

The assert accesses 'this' after it has been deleted. It is not very valuable so remove the assert.

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

2 years agoGraphicsContext: remove unused ENABLE(3D_TRANSFORMS) && USE(TEXTURE_MAPPER)
zandobersek@gmail.com [Mon, 2 Oct 2017 18:17:51 +0000 (18:17 +0000)]
GraphicsContext: remove unused ENABLE(3D_TRANSFORMS) && USE(TEXTURE_MAPPER)
https://bugs.webkit.org/show_bug.cgi?id=177757

Reviewed by Michael Catanzaro.

Remove three methods from the GraphicsContext class that were conditioned
with the ENABLE(3D_TRANSFORMS) and USE(TEXTURE_MAPPER) guards. These aren't
used anywhere at this point, but apparently used to be in the TextureMapper
implementation.

* platform/graphics/GraphicsContext.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::get3DTransform const): Deleted.
(WebCore::GraphicsContext::concat3DTransform): Deleted.
(WebCore::GraphicsContext::set3DTransform): Deleted.

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

2 years agoChakraCore/test/Function/apply3.js is resulting wrong result in x86_64
ticaiolima@gmail.com [Mon, 2 Oct 2017 18:15:09 +0000 (18:15 +0000)]
ChakraCore/test/Function/apply3.js is resulting wrong result in x86_64
https://bugs.webkit.org/show_bug.cgi?id=175642

Reviewed by Darin Adler.

JSTests:

* ChakraCore/test/Function/apply3.baseline-jsc:

Source/JavaScriptCore:

According JS spec, the ToLength operation[1] has a range of 0..(2^53)
- 1. In Interpreter.cpp::sizeFrameForVarargs, the call to
sizeOfVarargs() was being assigned to "unsigned length", forcing a
type cast that results in different value among architectures JSC supports.
For instance, in x86_64 "4294967295 + 1" results in 0, while in ARMv6 it
results 4294967295. This patch is changing "sizeOfVarargs" to clamp the
result from "toLength" to unsigned and then get desired behavior for
all supported platforms.

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

* interpreter/Interpreter.cpp:
(JSC::sizeOfVarargs):
* interpreter/Interpreter.h:

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

2 years ago[GLib] NetworkStateNotifier implementation missing
commit-queue@webkit.org [Mon, 2 Oct 2017 18:08:06 +0000 (18:08 +0000)]
[GLib] NetworkStateNotifier implementation missing
https://bugs.webkit.org/show_bug.cgi?id=177741

Patch by Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> on 2017-10-02
Reviewed by Carlos Garcia Campos.

No new tests. The DOM support is already being tested, but we would need a way
of simulating a network outage to test GNetworkMonitor.

* PlatformGTK.cmake: add new file.
* PlatformWPE.cmake: add new file.
* platform/network/NetworkStateNotifier.cpp: no longer need the empty implementations, all platforms covered.
* platform/network/NetworkStateNotifier.h:
* platform/network/glib/NetworkStateNotifierGLib.cpp: Added.
(WebCore::NetworkStateNotifier::updateStateWithoutNotifying): update the network state using GNetworkMonitor's availability.
(WebCore::NetworkStateNotifier::networkChangedCallback): when network-changed is emitted, trigger a state update.
(WebCore::NetworkStateNotifier::startObserving): watch GNetworkMonitor's network-changed signal.

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

2 years agoRebaseline of js/dom/global-constructors-attributes-dedicated-worker.html after r222692.
jlewis3@apple.com [Mon, 2 Oct 2017 18:04:01 +0000 (18:04 +0000)]
Rebaseline of js/dom/global-constructors-attributes-dedicated-worker.html after r222692.

Unreviewed test gardening.

* platform/mac-wk1/js/dom/global-constructors-attributes-dedicated-worker-expected.txt:

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

2 years agoFix build with MathML disabled
commit-queue@webkit.org [Mon, 2 Oct 2017 17:59:36 +0000 (17:59 +0000)]
Fix build with MathML disabled
https://bugs.webkit.org/show_bug.cgi?id=177744

Patch by Olivier Blin <olivier.blin@softathome.com> on 2017-10-02
Reviewed by Michael Catanzaro.

These are regressions from r217549 (StyleResolver) and r221379 (RenderBlockFlow), which do not guard MathML usage.

* css/StyleResolver.cpp:
(WebCore::hasEffectiveDisplayNoneForDisplayContents):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::willCreateColumns const):

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

2 years agoUnreviewed WPE gardening.
zandobersek@gmail.com [Mon, 2 Oct 2017 17:58:49 +0000 (17:58 +0000)]
Unreviewed WPE gardening.

* platform/wpe/TestExpectations: Unskip some more tests, and add
failure expectations for whatever is still failing from that subset.

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

2 years agoUse ThreadIdentifier instead of thread::this_thread::get_id
utatane.tea@gmail.com [Mon, 2 Oct 2017 17:52:52 +0000 (17:52 +0000)]
Use ThreadIdentifier instead of thread::this_thread::get_id
https://bugs.webkit.org/show_bug.cgi?id=177729

Reviewed by Sam Weinig.

We can use WTF::ThreadIdentifier instead of thread::this_thread::get_id
to make use of ThreadIdentifier consistent in WebKit. In the other places,
we use ThreadIdentifier for this debugging purpose. And this is the only
place using thread::this_thread::get_id for the exact same purpose.
Furthermore, thread::this_thread::get_id in Windows platform. So we prefer
using ThreadIdentifier than thread::this_thread::get_id.

* Modules/webdatabase/DatabaseDetails.h:
(WebCore::DatabaseDetails::DatabaseDetails):
(WebCore::DatabaseDetails::threadID const):
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::detailsForNameAndOrigin):

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

2 years agoFix build after r222715
achristensen@apple.com [Mon, 2 Oct 2017 17:35:10 +0000 (17:35 +0000)]
Fix build after r222715
https://bugs.webkit.org/show_bug.cgi?id=177697

* TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
(TEST):
Use the public API instead of the removed SPI.

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

2 years agoAdd a WebKit Build Archives page
jond@apple.com [Mon, 2 Oct 2017 17:26:38 +0000 (17:26 +0000)]
Add a WebKit Build Archives page
https://bugs.webkit.org/show_bug.cgi?id=177654

Reviewed by Alexey Proskuryakov.

* wp-content/themes/webkit/build-archives.php: Added.

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

2 years agoRebaseline of js/dom/global-constructors-attributes.html after r222692.
jlewis3@apple.com [Mon, 2 Oct 2017 17:22:48 +0000 (17:22 +0000)]
Rebaseline of js/dom/global-constructors-attributes.html after r222692.

Unreviewed test gardening.

* platform/mac-elcapitan-wk2/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-sierra/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:

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

2 years agoExpose more WKPreferences SPI to match C SPI
achristensen@apple.com [Mon, 2 Oct 2017 17:13:22 +0000 (17:13 +0000)]
Expose more WKPreferences SPI to match C SPI
https://bugs.webkit.org/show_bug.cgi?id=177697

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _javaEnabledForLocalFiles]):
(-[WKPreferences _setPlugInsEnabled:]): Deleted.
(-[WKPreferences _plugInsEnabled]): Deleted.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
_javaEnabledForLocalFiles should return the correct value.
_plugInsEnabled has public API.  This SPI is not needed.

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

2 years agoREGRESSION(r214201): WebProcess hangs during policy decisions
achristensen@apple.com [Mon, 2 Oct 2017 17:09:30 +0000 (17:09 +0000)]
REGRESSION(r214201): WebProcess hangs during policy decisions
https://bugs.webkit.org/show_bug.cgi?id=177590
<rdar://problem/33362929>

Reviewed by Andy Estes.

Source/WebKit:

This is like r222431 but for trunk instead of a branch.
It includes the same regression API test so I don't make the same mistake again.

* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageNavigationClient):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForResponseSync):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
(WebKit::WebFrameLoaderClient::applyToDocumentLoader):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/WebDocumentLoader.cpp:
(WebKit::WebDocumentLoader::setNavigationID):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::setUpPolicyListener):
(WebKit::WebFrame::invalidatePolicyListener):
(WebKit::WebFrame::didReceivePolicyDecision):
* WebProcess/WebPage/WebFrame.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didReceivePolicyDecision):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/JavaScriptDuringNavigation.mm: Added.
(-[JSNavigationDelegate webView:didFinishNavigation:]):
(-[JSNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
(-[JSNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
(-[JSNavigationDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):
(TEST):

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

2 years agoUnreviewed. Fix debug assertion after r222671.
sbarati@apple.com [Mon, 2 Oct 2017 17:09:08 +0000 (17:09 +0000)]
Unreviewed. Fix debug assertion after r222671.

JSTestCustomGetterSetter::finishCreation needs to call its base's finishCreation implementation.

* jsc.cpp:
(JSTestCustomGetterSetter::finishCreation):

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

2 years agoRemove unnecessary copy of SessionID in WebPageProxy
achristensen@apple.com [Mon, 2 Oct 2017 16:54:12 +0000 (16:54 +0000)]
Remove unnecessary copy of SessionID in WebPageProxy
https://bugs.webkit.org/show_bug.cgi?id=177702

Reviewed by Darin Adler.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::sessionID const):
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::sessionID const): Deleted.

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

2 years agoExpose more WKPreferences SPI to match C SPI
achristensen@apple.com [Mon, 2 Oct 2017 16:50:13 +0000 (16:50 +0000)]
Expose more WKPreferences SPI to match C SPI
https://bugs.webkit.org/show_bug.cgi?id=177697
<rdar://problem/24110556>

Reviewed by Darin Adler.

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setJavaEnabledForLocalFiles:]):
(-[WKPreferences _javaEnabledForLocalFiles]):
(-[WKPreferences _setCanvasUsesAcceleratedDrawing:]):
(-[WKPreferences _canvasUsesAcceleratedDrawing]):
(-[WKPreferences _setAcceleratedCompositingEnabled:]):
(-[WKPreferences _acceleratedCompositingEnabled]):
(-[WKPreferences _setDefaultTextEncodingName:]):
(-[WKPreferences _defaultTextEncodingName]):
(-[WKPreferences _setNeedsSiteSpecificQuirks:]):
(-[WKPreferences _needsSiteSpecificQuirks]):
(-[WKPreferences _setAuthorAndUserStylesEnabled:]):
(-[WKPreferences _authorAndUserStylesEnabled]):
(-[WKPreferences _setDOMTimersThrottlingEnabled:]):
(-[WKPreferences _domTimersThrottlingEnabled]):
(-[WKPreferences _setWebArchiveDebugModeEnabled:]):
(-[WKPreferences _webArchiveDebugModeEnabled]):
(-[WKPreferences _setLocalFileContentSniffingEnabled:]):
(-[WKPreferences _localFileContentSniffingEnabled]):
(-[WKPreferences _setUsesPageCache:]):
(-[WKPreferences _usesPageCache]):
(-[WKPreferences _setPageCacheSupportsPlugins:]):
(-[WKPreferences _pageCacheSupportsPlugins]):
(-[WKPreferences _setShouldPrintBackgrounds:]):
(-[WKPreferences _shouldPrintBackgrounds]):
(-[WKPreferences _setWebSecurityEnabled:]):
(-[WKPreferences _webSecurityEnabled]):
(-[WKPreferences _setUniversalAccessFromFileURLsAllowed:]):
(-[WKPreferences _universalAccessFromFileURLsAllowed]):
(-[WKPreferences _setAVFoundationEnabled:]):
(-[WKPreferences _avFoundationEnabled]):
(-[WKPreferences _setSuppressesIncrementalRendering:]):
(-[WKPreferences _suppressesIncrementalRendering]):
(-[WKPreferences _setAsynchronousPluginInitializationEnabled:]):
(-[WKPreferences _asynchronousPluginInitializationEnabled]):
(-[WKPreferences _setArtificialPluginInitializationDelayEnabled:]):
(-[WKPreferences _artificialPluginInitializationDelayEnabled]):
(-[WKPreferences _setCookieEnabled:]):
(-[WKPreferences _cookieEnabled]):
(-[WKPreferences _setPlugInSnapshottingEnabled:]):
(-[WKPreferences _plugInSnapshottingEnabled]):
(-[WKPreferences _setQTKitEnabled:]):
(-[WKPreferences _qtKitEnabled]):
(-[WKPreferences _setSubpixelCSSOMElementMetricsEnabled:]):
(-[WKPreferences _subpixelCSSOMElementMetricsEnabled]):
(-[WKPreferences _setMediaSourceEnabled:]):
(-[WKPreferences _mediaSourceEnabled]):
(-[WKPreferences _setViewGestureDebuggingEnabled:]):
(-[WKPreferences _viewGestureDebuggingEnabled]):
(-[WKPreferences _setCSSAnimationTriggersEnabled:]):
(-[WKPreferences _cssAnimationTriggersEnabled]):
(-[WKPreferences _setStandardFontFamily:]):
(-[WKPreferences _standardFontFamily]):
(-[WKPreferences _setNotificationsEnabled:]):
(-[WKPreferences _notificationsEnabled]):
(-[WKPreferences _setBackspaceKeyNavigationEnabled:]):
(-[WKPreferences _backspaceKeyNavigationEnabled]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

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

2 years agoFix memory leaks in RenderMultiColumnFlow
antti@apple.com [Mon, 2 Oct 2017 16:00:28 +0000 (16:00 +0000)]
Fix memory leaks in RenderMultiColumnFlow
https://bugs.webkit.org/show_bug.cgi?id=177735

Reviewed by Zalan Bujtas.

* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::evacuateAndDestroy):

    Switch from destroy() to removeFromParentAndDestroy() (they are currently equivalent in practice).

(WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):

    Destroy the placeholders instead of leaking them.

(WebCore::RenderMultiColumnFlow::handleSpannerRemoval):

    Destroy the placeholder instead of leaking it.

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

2 years agoLog stack-trace for run-webkit-tests when interrupted
jbedard@apple.com [Mon, 2 Oct 2017 14:59:28 +0000 (14:59 +0000)]
Log stack-trace for run-webkit-tests when interrupted
https://bugs.webkit.org/show_bug.cgi?id=176393
<rdar://problem/34262310>

Reviewed by Darin Adler.

When run-webkit-tests is stuck, it is difficult to immediately tell
why. Saving a stack-trace when run-webkit-tests is terminated
or stopped with CNTRL-C will make such issues easier to debug.

* Scripts/webkitpy/common/interupt_debugging.py: Added.
(log_stack_trace): Given a Python frame object, log a stack trace to
the provided file.
(log_stack_trace_on_term): Attach a listener to SIGTERM so that a
stack-trace can be logged when a program is terminated.
(log_stack_trace_on_cntrl_c): Attach a listener to SIGINT so that a
stack-trace can be logged when a program is CNTRL-Ced.
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(main): Set handlers to log stack trace on interruption.

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

2 years ago[GTK][WPE] Enable interactive forms validation by default
carlosgc@webkit.org [Mon, 2 Oct 2017 14:32:52 +0000 (14:32 +0000)]
[GTK][WPE] Enable interactive forms validation by default
https://bugs.webkit.org/show_bug.cgi?id=177737

Reviewed by Michael Catanzaro.

It's currently disabled for no reason.

* Shared/WebPreferencesDefinitions.h:

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

2 years agoTry to play AVC codec even if H.264 decoder only advertises byte-stream profile.
cturner@igalia.com [Mon, 2 Oct 2017 13:17:41 +0000 (13:17 +0000)]
Try to play AVC codec even if H.264 decoder only advertises byte-stream profile.
https://bugs.webkit.org/show_bug.cgi?id=177550

GStreamer's element factory filters will claim they can't play videos with AVC
codec strings, but the elements really are capable of playing them when filters
like videoconvert are inserted by playbin. Videos of this variety are in the YouTube
2018 EME conformance tests.

Also replace std::array with a stack array, this saves having to count
the number of elements (the compiler does that now) and reduces braces.

Reviewed by Carlos Alberto Lopez Perez.

* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::codecSet):

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

2 years ago[SOUP] Default kerberos authentication credentials are used in ephemeral (private...
tpopela@redhat.com [Mon, 2 Oct 2017 12:55:12 +0000 (12:55 +0000)]
[SOUP] Default kerberos authentication credentials are used in ephemeral (private) mode
https://bugs.webkit.org/show_bug.cgi?id=177738

Reviewed by Carlos Garcia Campos.

If the session is ephemeral then don't enable the Negotiate support in
our SoupSession.

* platform/network/soup/NetworkStorageSessionSoup.cpp: Pass the
session ID if it's known to the SoupNetworkSession.
(WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
(WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession const):
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession): If the session is
ephemeral (based on given session ID) then don't activate the
Negotiate support in SoupSession.
* platform/network/soup/SoupNetworkSession.h:
Change the constructor to accept the PAL::SessionID with the default
value set to PAL::SessionID::emptySessionID.

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

2 years agoREGRESSION(r222640) [GTK] Build broken with ATK 2.14
jdiggs@igalia.com [Mon, 2 Oct 2017 12:17:24 +0000 (12:17 +0000)]
REGRESSION(r222640) [GTK] Build broken with ATK 2.14
https://bugs.webkit.org/show_bug.cgi?id=177634

Reviewed by Michael Catanzaro.

Use ATK_CHECK_VERSION to prevent the build failure.

No new tests. This fixes a downstream build failure.

* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::postPlatformNotification):

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

2 years agoRemove ENABLE_CSS_REGIONS
mcatanzaro@igalia.com [Mon, 2 Oct 2017 12:05:56 +0000 (12:05 +0000)]
Remove ENABLE_CSS_REGIONS
https://bugs.webkit.org/show_bug.cgi?id=177689

Reviewed by Darin Adler.

.:

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsMac.cmake:
* Source/cmake/OptionsWPE.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/tools/vsprops/FeatureDefines.props:
* Source/cmake/tools/vsprops/FeatureDefinesCairo.props:

Source/WebKit:

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
(webkit_dom_element_get_webkit_region_overset):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
(webkit_dom_element_get_webkit_region_overset): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:

Tools:

* Scripts/webkitperl/FeatureList.pm:

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

2 years agoWebDriver: HTTP status code is not correct for some of the errors
carlosgc@webkit.org [Mon, 2 Oct 2017 09:09:07 +0000 (09:09 +0000)]
WebDriver: HTTP status code is not correct for some of the errors
https://bugs.webkit.org/show_bug.cgi?id=177354

Reviewed by Brian Burg.

I think this changed in the spec at some point. The thing is that no such alert, frame and window and stale
element reference errors should return 404 instead of 400.

https://w3c.github.io/webdriver/webdriver-spec.html#handling-errors

* CommandResult.cpp:
(WebDriver::CommandResult::httpStatusCode const):

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

2 years agoPasteboard shouldn't add "Files" as a type
rniwa@webkit.org [Mon, 2 Oct 2017 08:55:11 +0000 (08:55 +0000)]
Pasteboard shouldn't add "Files" as a type
https://bugs.webkit.org/show_bug.cgi?id=177731

Reviewed by Wenson Hsieh.

Removed the platform specific code to add "Files" when there is a file present in platform's pasteboard.
DataTransfer::types now adds "Files" automatically when Pasteboard::containsFiles returns true.

No new tests since there should be no behavioral change.

* dom/DataTransfer.cpp:
(WebCore::DataTransfer::types const):
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::typesForLegacyUnsafeBindings):
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType):
* platform/win/PasteboardWin.cpp:
(WebCore::addMimeTypesForFormat): Removed the code to add "Text" and "URL" as separate types since
this is not what the rest of ports do, and this type normalization is now taken care of by DataTransfer
since r221063.

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

2 years agoAnother attempt to fix Windows build after r222697.
rniwa@webkit.org [Mon, 2 Oct 2017 08:25:53 +0000 (08:25 +0000)]
Another attempt to fix Windows build after r222697.

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::updateAppearance):
* platform/DragImage.cpp:
(WebCore::createDragImageForRange):
* rendering/SelectionRangeData.cpp:
(WebCore::SelectionRangeData::clear):
* rendering/SelectionRangeData.h:
(WebCore::SelectionRangeData::Context::Context):

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

2 years agoWindows build fix attempt after r222697.
rniwa@webkit.org [Mon, 2 Oct 2017 07:26:04 +0000 (07:26 +0000)]
Windows build fix attempt after r222697.

* platform/DragImage.cpp:
(WebCore::createDragImageForRange):

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

2 years agoMerge readFilenames() and read(PasteboardFileReader)
rniwa@webkit.org [Mon, 2 Oct 2017 07:03:45 +0000 (07:03 +0000)]
Merge readFilenames() and read(PasteboardFileReader)
https://bugs.webkit.org/show_bug.cgi?id=177728
<rdar://problem/34761725>

Reviewed by Sam Weinig.

Generalized PasteboardFileReader to return multiple files instead of just one file, and replaced the use
of Pasteboard::readFilenames() with it. Because eliminates the need for finding the list of types to read
as files in addition to file names, this patch also removes Pasteboard::typesTreatedAsFiles().

Note that Pasteboard::readFilenames() continues to exist in macOS and iOS as it's internally used by
Pasteboard::read(PasteboardFileReader) in PasteboardCocoa.mm.

No new tests since there should be no behavioral change.

* dom/DataTransfer.cpp:
(WebCore::DataTransfer::files const): Now makes a single call to Pasteboard::read(PasteboardFileReader)
instead of reading filenames and then falling back to it. Also got rid of if-def for drag drop checks
since forDrag() and forFileDrag() are always defined since r222688.
(WebCore::PasteboardFileTypeReader): Added. Gets the list of all file types.
(WebCore::PasteboardFileTypeReader::readFilename): Added. Gets the list of all file types.
(WebCore::PasteboardFileTypeReader::readBuffer): Added. Gets the list of all file types.
(WebCore::DataTransfer::hasFileOfType): Reimplemented using PasteboardFileTypeReader.
* editing/WebCorePasteboardFileReader.cpp:
(WebCore::WebCorePasteboardFileReader::readFilename): Added.
(WebCore::WebCorePasteboardFileReader::readBuffer): Renamed from read.
* editing/WebCorePasteboardFileReader.h:
* platform/Pasteboard.h:
(WebCore::PasteboardFileReader): Removed the constructor since we no longer specify a specific type to
read off of pasteboard, and renamed the existing read function to readBuffer, and added a new variant
which takes a filename.
* platform/StaticPasteboard.h:
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::imageTypeToFakeFilename): Return "image/png" for ImageType::TIFF (to do TIFF-to-PNG conversion;
see r222656 for why this is needed) now that this function is used to convert directly from image type
converted from cocoa type instead of the one reverse-converted from MIME type.
(WebCore::mimeTypeToImageType): Deleted.
(WebCore::Pasteboard::typesTreatedAsFiles): Deleted.
(WebCore::Pasteboard::typesForLegacyUnsafeBindings): Use newly added readTypesWithSecurityCheck.
(WebCore::convertTIFFToPNG): Extracted out of read(PasteboardFileReader).
(WebCore::Pasteboard::read): Generalized to add filenames as well as image buffers as files. Because now
we're concerting Cocoa types to ImageType, we no longer have to detect when TIFF-as-PNG conversion is
happening here. We just treat ImageType::TIFF as PNG and do the conversion.
(WebCore::Pasteboard::readStringInCustomData): Use newly added readBufferForTypeWithSecurityCheck.
(WebCore::Pasteboard::readTypesWithSecurityCheck): Added.
(WebCore::Pasteboard::readBufferForTypeWithSecurityCheck): Added.
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::read): Implemented.
(WebCore::Pasteboard::typesTreatedAsFiles): Deleted.
(WebCore::Pasteboard::containsFiles): Implemented without calling readFilenames, which has been deleted.
(WebCore::Pasteboard::readFilenames): Deleted.
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::typesTreatedAsFiles): Deleted.
(WebCore::PasteboardFileCounter): Added. Used to counts the number of files in the pasteboard.
(WebCore::PasteboardFileCounter::readFilename):
(WebCore::PasteboardFileCounter::readBuffer):
(WebCore::Pasteboard::containsFiles):
(WebCore::Pasteboard::read): Moved the code to extract filenames out of readFilenames.
(WebCore::Pasteboard::readFilenames): Deleted.
* platform/wpe/PasteboardWPE.cpp:
(WebCore::Pasteboard::typesTreatedAsFiles): Deleted.
(WebCore::Pasteboard::readFilenames): Deleted.

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

2 years ago[Settings] Move remaining simple settings to Settings.in
commit-queue@webkit.org [Mon, 2 Oct 2017 06:02:52 +0000 (06:02 +0000)]
[Settings] Move remaining simple settings to Settings.in
https://bugs.webkit.org/show_bug.cgi?id=177730

Patch by Sam Weinig <sam@webkit.org> on 2017-10-01
Reviewed by Darin Adler.

- Adds new option type for Settings.in, 'getter', which allows you to specify
  a custom name for the setting's getter. For instance, the setting javaEnabled
  has a custom getter name, 'isJavaEnabled'.
- Adds support for WTF::Seconds as a type of setting. Used by only
  timeWithoutMouseMovementBeforeHidingControls at the moment.
- Moves non-generated settings from Settings.h/cpp that don't require custom
  action when set, to Settings.in

* Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py:
* Scripts/GenerateSettings/GenerateSettingsHeaderFile.py:
* Scripts/GenerateSettings/Settings.py:

    Add support for 'getter' and the Seconds type.

* WebCore.xcodeproj/project.pbxproj:
* platform/text/FontRenderingMode.h: Copied from Source/WebCore/platform/text/TextFlags.h.
* platform/text/TextFlags.h:

    Add FontRenderingMode.h. Moved out of TextFlags.h to be accessible by
    the settings generator.

* page/Settings.cpp:
(WebCore::Settings::Settings):
(WebCore::Settings::setJavaEnabled): Deleted.
(WebCore::Settings::setJavaEnabledForLocalFiles): Deleted.
(WebCore::Settings::setPreferMIMETypeForImages): Deleted.
(WebCore::Settings::setForcePendingWebGLPolicy): Deleted.
(WebCore::Settings::setNeedsAdobeFrameReloadingQuirk): Deleted.
(WebCore::Settings::setFontRenderingMode): Deleted.
(WebCore::Settings::fontRenderingMode const): Deleted.
(WebCore::Settings::setShowTiledScrollingIndicator): Deleted.
(WebCore::Settings::setFontFallbackPrefersPictographs): Deleted.
(WebCore::Settings::setWebFontsAlwaysFallBack): Deleted.
* page/Settings.h:
(WebCore::Settings::isJavaEnabled const): Deleted.
(WebCore::Settings::isJavaEnabledForLocalFiles const): Deleted.
(WebCore::Settings::preferMIMETypeForImages const): Deleted.
(WebCore::Settings::needsAcrobatFrameReloadingQuirk const): Deleted.
(WebCore::Settings::showTiledScrollingIndicator const): Deleted.
(WebCore::Settings::setTouchEventEmulationEnabled): Deleted.
(WebCore::Settings::isTouchEventEmulationEnabled const): Deleted.
(WebCore::Settings::setTimeWithoutMouseMovementBeforeHidingControls): Deleted.
(WebCore::Settings::timeWithoutMouseMovementBeforeHidingControls const): Deleted.
(WebCore::Settings::fontFallbackPrefersPictographs const): Deleted.
(WebCore::Settings::webFontsAlwaysFallBack const): Deleted.
(WebCore::Settings::setMediaKeysStorageDirectory): Deleted.
(WebCore::Settings::mediaKeysStorageDirectory const): Deleted.
(WebCore::Settings::setMediaDeviceIdentifierStorageDirectory): Deleted.
(WebCore::Settings::mediaDeviceIdentifierStorageDirectory const): Deleted.
(WebCore::Settings::applePayEnabled const): Deleted.
(WebCore::Settings::setApplePayEnabled): Deleted.
(WebCore::Settings::applePayCapabilityDisclosureAllowed const): Deleted.
(WebCore::Settings::setApplePayCapabilityDisclosureAllowed): Deleted.
(WebCore::Settings::isForcePendingWebGLPolicy const): Deleted.
* page/Settings.in:

    Moved hand-written settings to be Settings.in based.

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

2 years agoRenderView does not need to be a SelectionSubtreeRoot
zalan@apple.com [Mon, 2 Oct 2017 04:46:32 +0000 (04:46 +0000)]
RenderView does not need to be a SelectionSubtreeRoot
https://bugs.webkit.org/show_bug.cgi?id=177713

Reviewed by Darin Adler and Antti Koivisto.

1. SelectionSubtreeRoot -> SelectionRangeData
2. Move all selection logic from RenderView to SelectionRangeData
3. class RenderView : public SelectionSubtreeRoot -> SelectionRangeData m_selection;
4. Remove redundant code
5. General modernization

No change in functionality.

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setNeedsSelectionUpdate):
(WebCore::DragCaretController::nodeWillBeRemoved):
(WebCore::FrameSelection::respondToNodeModification):
(WebCore::FrameSelection::prepareForDestruction):
(WebCore::FrameSelection::focusedOrActiveStateChanged):
(WebCore::FrameSelection::updateAppearance):
(WebCore::FrameSelection::selectionBounds const):
* page/FrameView.cpp:
(WebCore::FrameView::paintContentsForSnapshot):
* platform/DragImage.cpp:
(WebCore::ScopedFrameSelectionState::ScopedFrameSelectionState):
(WebCore::ScopedFrameSelectionState::~ScopedFrameSelectionState):
(WebCore::createDragImageForRange):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::selectionState):
(WebCore::InlineTextBox::selectionStartEnd const):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::isSelectionRoot const):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::isSelectionBorder const):
* rendering/RenderObject.h:
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::isSelected const):
* rendering/RenderText.cpp:
(WebCore::RenderText::collectSelectionRectsForLineBoxes):
* rendering/RenderTextLineBoxes.cpp:
(WebCore::RenderTextLineBoxes::setSelectionState):
* rendering/RenderView.cpp:
(WebCore::RenderView::RenderView):
(WebCore::SelectionIterator::SelectionIterator): Deleted.
(WebCore::SelectionIterator::current const): Deleted.
(WebCore::SelectionIterator::next): Deleted.
(WebCore::SelectionIterator::checkForSpanner): Deleted.
(WebCore::rendererAfterPosition): Deleted.
(WebCore::RenderView::selectionBounds const): Deleted.
(WebCore::RenderView::subtreeSelectionBounds const): Deleted.
(WebCore::RenderView::repaintSelection const): Deleted.
(WebCore::RenderView::repaintSubtreeSelection const): Deleted.
(WebCore::RenderView::setSelection): Deleted.
(WebCore::isValidObjectForNewSelection): Deleted.
(WebCore::RenderView::clearSubtreeSelection const): Deleted.
(WebCore::RenderView::applySubtreeSelection): Deleted.
(WebCore::RenderView::getSelection const): Deleted.
(WebCore::RenderView::clearSelection): Deleted.
* rendering/RenderView.h:
* rendering/SelectionSubtreeRoot.cpp:
(WebCore::rendererAfterPosition):
(WebCore::SelectionIterator::SelectionIterator):
(WebCore::SelectionIterator::current const):
(WebCore::SelectionIterator::next):
(WebCore::SelectionIterator::checkForSpanner):
(WebCore::SelectionRangeData::SelectionRangeData):
(WebCore::SelectionRangeData::set):
(WebCore::SelectionRangeData::clear):
(WebCore::SelectionRangeData::repaint const):
(WebCore::SelectionRangeData::bounds const):
(WebCore::SelectionRangeData::collectAndClear const):
(WebCore::SelectionRangeData::apply):
(WebCore::SelectionRangeData::isValidRendererForNewSelection const):
(WebCore::SelectionSubtreeRoot::SelectionSubtreeRoot): Deleted.
* rendering/SelectionSubtreeRoot.h:
(WebCore::SelectionRangeData::Context::operator== const):
(WebCore::SelectionRangeData::get const):
(WebCore::SelectionRangeData::start const):
(WebCore::SelectionRangeData::end const):
(WebCore::SelectionRangeData::startPosition const):
(WebCore::SelectionRangeData::endPosition const):
(WebCore::SelectionSubtreeRoot::OldSelectionData::OldSelectionData): Deleted.
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::SelectionSubtreeData): Deleted.
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStart const): Deleted.
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStartPos const): Deleted.
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionEnd const): Deleted.
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionEndPos const): Deleted.
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStartEndPositions const): Deleted.
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::clearSelection): Deleted.
(WebCore::SelectionSubtreeRoot::selectionData): Deleted.
(WebCore::SelectionSubtreeRoot::selectionData const): Deleted.
(WebCore::SelectionSubtreeRoot::setSelectionData): Deleted.

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

2 years ago[Settings] Enums should not be passed by const reference
commit-queue@webkit.org [Mon, 2 Oct 2017 03:17:18 +0000 (03:17 +0000)]
[Settings] Enums should not be passed by const reference
https://bugs.webkit.org/show_bug.cgi?id=177727

Patch by Sam Weinig <sam@webkit.org> on 2017-10-01
Reviewed by Darin Adler.

* Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:
* Scripts/GenerateSettings/GenerateSettingsHeaderFile.py:
(printGetterAndSetter):

    Use the new typeIsAggregate predicate to determine whether to
    use const reference or not.

(includeForSetting): Deleted.

    Move includeForSetting to Settings.py with the rest of the Setting
    helpers.

* Scripts/GenerateSettings/Settings.py:
(mapToIDLType):
(typeIsPrimitive):
(typeIsAggregate):

    Add predicate to determine if a setting's type is an aggregate (struct or class)
    or a primitive. Remove references to size_t, which is not used.

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

2 years agoSkip failing tests from r222692 that have different output on each run.
weinig@apple.com [Mon, 2 Oct 2017 01:35:37 +0000 (01:35 +0000)]
Skip failing tests from r222692 that have different output on each run.

* TestExpectations:

    Skips imported/w3c/web-platform-tests/fetch/api/abort/general.any.html
    and imported/w3c/web-platform-tests/fetch/api/abort/general.any.worker.html

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

2 years agoAdd missing results from r222690.
weinig@apple.com [Mon, 2 Oct 2017 01:28:23 +0000 (01:28 +0000)]
Add missing results from r222690.

* web-platform-tests/XMLHttpRequest/responseType-document-in-worker-expected.txt: Added.
* web-platform-tests/XMLHttpRequest/responseXML-unavailable-in-worker-expected.txt: Added.

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

2 years agoAdd support for DOM aborting (https://dom.spec.whatwg.org/#aborting-ongoing-activities)
weinig@apple.com [Sun, 1 Oct 2017 22:32:58 +0000 (22:32 +0000)]
Add support for DOM aborting (https://dom.spec.whatwg.org/#aborting-ongoing-activities)
https://bugs.webkit.org/show_bug.cgi?id=177718

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/dom/abort/event.any-expected.txt:
* web-platform-tests/dom/abort/event.any.worker-expected.txt:
* web-platform-tests/dom/interface-objects-expected.txt:
* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/fetch/api/abort/cache.https-expected.txt:
* web-platform-tests/fetch/api/abort/general.any-expected.txt:
* web-platform-tests/fetch/api/abort/general.any.worker-expected.txt:
* web-platform-tests/payment-request/interfaces.https-expected.txt:

    Update test results.

Source/WebCore:

Adds standalone support for AbortController and AbortSignal. No integration
with other specs yet.

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:

    Add new files.

* dom/AbortController.cpp: Added.
* dom/AbortController.h: Added.
* dom/AbortController.idl: Added.
* dom/AbortSignal.cpp: Added.
* dom/AbortSignal.h: Added.
* dom/AbortSignal.idl: Added.

    Add basic support AbortController and AbortSignal.

* dom/EventTargetFactory.in:

    Add AbortSignal to the list of EventTargets.

LayoutTests:

* js/dom/global-constructors-attributes-dedicated-worker-expected.txt:

    Update test results.

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

2 years agoUse WeakPtr for first-letter memory management
antti@apple.com [Sun, 1 Oct 2017 21:24:56 +0000 (21:24 +0000)]
Use WeakPtr for first-letter memory management
https://bugs.webkit.org/show_bug.cgi?id=177716

Reviewed by Darin Adler.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::destroyLeftoverChildren):

    Remove first-letter special case.
    Use removeAndDestroyChild instead of calling destroy() directly. The latter should
    eventually stop calling takeChild and assert that the renderer is not in the tree.

* rendering/RenderTextFragment.cpp:
(WebCore::RenderTextFragment::willBeDestroyed):
(WebCore::RenderTextFragment::setText):
* rendering/RenderTextFragment.h:

    Use WeakPtr.

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

2 years agoXMLHttpRequest's responseXML should be annotated with [Exposed=Window]
commit-queue@webkit.org [Sun, 1 Oct 2017 21:12:48 +0000 (21:12 +0000)]
XMLHttpRequest's responseXML should be annotated with [Exposed=Window]
https://bugs.webkit.org/show_bug.cgi?id=177714

Patch by Sam Weinig <sam@webkit.org> on 2017-10-01
Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/XMLHttpRequest/resources/responseType-document-in-worker.js: Added.
* web-platform-tests/XMLHttpRequest/resources/responseXML-unavailable-in-worker.js: Added.
* web-platform-tests/XMLHttpRequest/resources/w3c-import.log:
* web-platform-tests/XMLHttpRequest/responseType-document-in-worker.html: Added.
* web-platform-tests/XMLHttpRequest/responseXML-unavailable-in-worker.html: Added.
* web-platform-tests/XMLHttpRequest/w3c-import.log:

    Import latest XMLHttpRequest tests that include tests for responseXML not
    being available in workers and setting a responseType of 'document' being
    a no-op in workers.

Source/WebCore:

Tests: imported/w3c/web-platform-tests/XMLHttpRequest/responseType-document-in-worker.html
       imported/w3c/web-platform-tests/XMLHttpRequest/responseXML-unavailable-in-worker.html

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::responseXML):

    Replace returning null for non-document contexts with an assertion now
    that the bindings layer ensures this doesn't get called.

(WebCore::XMLHttpRequest::setResponseType):

    Match the spec and turn attempts to set a responseType of 'document' in
    non-documents contexts as a no-op.

* xml/XMLHttpRequest.idl:

    Address FIXME and annotate responseXML with [Exposed=Window] now that it
    is supported.

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

2 years agoUnreviewed, rolling out r222564.
commit-queue@webkit.org [Sun, 1 Oct 2017 17:23:29 +0000 (17:23 +0000)]
Unreviewed, rolling out r222564.
https://bugs.webkit.org/show_bug.cgi?id=177720

"It regressed JetStream by 2% on iOS caused by a 50%
regression on the bigfib subtest" (Requested by saamyjoon on
#webkit).

Reverted changeset:

"Add Above/Below comparisons for UInt32 patterns"
https://bugs.webkit.org/show_bug.cgi?id=177281
http://trac.webkit.org/changeset/222564

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

2 years agoDon't reveal file URL when pasting an image
rniwa@webkit.org [Sun, 1 Oct 2017 06:59:00 +0000 (06:59 +0000)]
Don't reveal file URL when pasting an image
https://bugs.webkit.org/show_bug.cgi?id=177710
<rdar://problem/34757924>

Reviewed by Wenson Hsieh.

Source/WebCore:

Fixed the bug by generalizing the code we had for drag & drop to hide string types when there is a file.

We don't hide string types when customPasteboardDataEnabled() is false to preserve the backwards compatiblity
with apps that are relying on being able to read files URLs in the pasteboard.

Test: editing/pasteboard/paste-image-does-not-reveal-file-url.html

* dom/DataTransfer.cpp:
(WebCore::DataTransfer::getData const): Pretend there is no string data when there is a file in the pasteboard
custom pasteboard data is enabled.
(WebCore::DataTransfer::setData): Ditto.
(WebCore::DataTransfer::types const): Ditto.
* dom/DataTransfer.h:
(WebCore::DataTransfer::forDrag const): Added for when drag & drop support is disabled at compilation time.
(WebCore::DataTransfer::forFileDrag const): Ditto.
* platform/Pasteboard.h:
* platform/StaticPasteboard.h:
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::Pasteboard::containsFiles): Added.
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::containsFiles): Added.
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::containsFiles): Added.
* platform/wpe/PasteboardWPE.cpp:
(WebCore::Pasteboard::containsFiles): Added.
(WebCore::Pasteboard::readFilenames): Annotated this function with notImplemented().

LayoutTests:

Added a regression test for pasting an image. We enable this protection only when custom data is enabled
to preserve the backwards compatibility.

* editing/pasteboard/paste-image-does-not-reveal-file-url-expected.txt: Added.
* editing/pasteboard/paste-image-does-not-reveal-file-url.html: Added.

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

2 years agoAugment editing/pasteboard/data-transfer-get-data-non-normalized-types.html to check...
wenson_hsieh@apple.com [Sun, 1 Oct 2017 05:00:03 +0000 (05:00 +0000)]
Augment editing/pasteboard/data-transfer-get-data-non-normalized-types.html to check whitespace stripping
https://bugs.webkit.org/show_bug.cgi?id=177707

Reviewed by Ryosuke Niwa.

Augment an existing layout test to check that whitespace is stripped from types passed into DataTransfer's
getData and setData methods.

* editing/pasteboard/data-transfer-get-data-non-normalized-types-expected.txt:
* editing/pasteboard/data-transfer-get-data-non-normalized-types.html:

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

2 years ago[Settings] Replace SettingsMacros.h with a generated base class for Settings
commit-queue@webkit.org [Sun, 1 Oct 2017 01:13:34 +0000 (01:13 +0000)]
[Settings] Replace SettingsMacros.h with a generated base class for Settings
https://bugs.webkit.org/show_bug.cgi?id=177681

Patch by Sam Weinig <sam@webkit.org> on 2017-09-30
Reviewed by Darin Adler.

- Adds a SettingsGenerated class that Settings inherits from. The new class
  has the members and getters/setters for all the generated bindings.
- Some default values for settings are literals in Settings.in, but rather
  constants or functions defined externally. These have all been moved to
  SettingsDefaultValues.h to allow for the script to include them all for
  SettingsGenerated.
- Previously, a few enums were declared in Settings.h for use by Settings.
  Now that SettingsGenerated needs access, we standarize the same way that
  exists for the IDL generator; expecting the enum to be in a header of the
  same name.

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* WebCoreMacros.cmake:

    Add new files / generation steps.

* Scripts/GenerateSettings.py:
* Scripts/GenerateSettings/GenerateSettings.py:
* Scripts/GenerateSettings/GenerateSettingsHeaderFile.py: Added.
* Scripts/GenerateSettings/GenerateSettingsImplementationFile.py: Added.
* Scripts/GenerateSettings/GenerateSettingsMacrosHeader.py: Removed.
* Scripts/GenerateSettings/Settings.py:

    Replace script to generate SettingsMacros.h with scripts to generate a SettingsGenerated.{h,cpp}.

* accessibility/ForcedAccessibilityValue.h: Added.
* editing/EditableLinkBehavior.h: Added.
* editing/EditingBehavior.h:
* editing/EditingBehaviorType.h: Copied from editing/EditingBehaviorTypes.h.
* editing/EditingBehaviorTypes.h: Removed.
* editing/cocoa/DataDetection.h:
* editing/cocoa/DataDetectorTypes.h: Added.
* page/DebugOverlayRegions.h: Added.
* page/FrameFlattening.h: Added.
* page/PDFImageCachingPolicy.h: Added.
* page/TextDirectionSubmenuInclusionBehavior.h: Added.
* page/UserInterfaceDirectionPolicy.h: Added.
* platform/text/TextDirection.h: Added.
* platform/text/WritingMode.h:

    Split out enums from Settings.h

* css/MediaQueryEvaluator.cpp:

    Update for new name of ForcedAccessibilityValue.

* html/parser/HTMLParserOptions.cpp:

    Update for new name of defaultMaximumHTMLParserDOMTreeDepth.

* page/Settings.cpp:
* page/Settings.h:

    - Move defaults to SettingsDefaultValues.h (and SettingsDefaultValuesCocoa.mm for defaultTextAutosizingEnabled).
    - Move enums to their own files.
    - Inherit from SettingsGenerated.h

* page/Settings.in:

    - Use new 'include' option for javaScriptRuntimeFlags setting to include <runtime/RuntimeFlags.h>,
      as it doesn't fit the normal idiomatic model.
    - Replace call to defaultMinimumZoomFontSize() with direct constant access.

* page/SettingsDefaultValues.h: Added.
* page/cocoa/SettingsDefaultValuesCocoa.mm: Added.

    Move default values from Settings to this new file.

* page/cocoa/SettingsCocoa.mm:

    Move defaultTextAutosizingEnabled() out of here and into SettingsDefaultValuesCocoa.mm.

* style/StyleTreeResolver.cpp:

    - Update for new scoping of defaultMaximumRenderTreeDepth.
    - Move defaultMaximumRenderTreeDepth from Settings here. This is the only use.

* testing/InternalSettings.cpp:
(WebCore::InternalSettings::forcedColorsAreInvertedAccessibilityValue const):
(WebCore::InternalSettings::setForcedColorsAreInvertedAccessibilityValue):
(WebCore::InternalSettings::forcedDisplayIsMonochromeAccessibilityValue const):
(WebCore::InternalSettings::setForcedDisplayIsMonochromeAccessibilityValue):
(WebCore::InternalSettings::forcedPrefersReducedMotionAccessibilityValue const):
(WebCore::InternalSettings::setForcedPrefersReducedMotionAccessibilityValue):
(WebCore::settingsToInternalSettingsValue): Deleted.
(WebCore::internalSettingsToSettingsValue): Deleted.
* testing/InternalSettings.h:

    Replace duplicate definition of ForcedAccessibilityValue with a using declaration
    and simplify code now that it doesn't need to map between the two enums.

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

2 years agoAdd a layout test test that exercises setData and getData for non-normalized types
wenson_hsieh@apple.com [Sat, 30 Sep 2017 23:33:09 +0000 (23:33 +0000)]
Add a layout test test that exercises setData and getData for non-normalized types
https://bugs.webkit.org/show_bug.cgi?id=177707

Reviewed by Darin Adler.

We have test coverage for getData and setData with non-normalized types on some of our bots where custom
pasteboard data is enabled by default, but this is not the case in EWS. This patch adds a copy and paste test
that exercises this codepath across all Cocoa platforms.

* editing/pasteboard/data-transfer-get-data-non-normalized-types-expected.txt: Added.
* editing/pasteboard/data-transfer-get-data-non-normalized-types.html: Added.
* platform/ios-simulator-wk1/TestExpectations:

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

2 years agoHave IPC::Connection::Client objects consistently invalidate the connection when...
darin@apple.com [Sat, 30 Sep 2017 22:50:16 +0000 (22:50 +0000)]
Have IPC::Connection::Client objects consistently invalidate the connection when destroyed
https://bugs.webkit.org/show_bug.cgi?id=177708

Reviewed by Anders Carlsson.

I ran into an intermittent crash when running regression tests. It looked like a connection
client was being called after it was destroyed. I did an audit of the all the connection
clients to make sure they all invalidate their connection before they are destroyed.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess): Invalidate the
connection since this object opened the connection. There is no obvious
guarantee that the connection will already be invalid when this is destroyed.
* StorageProcess/StorageToWebProcessConnection.cpp:
(WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection): Ditto.
* UIProcess/Plugins/PluginProcessProxy.cpp:
(WebKit::PluginProcessProxy::~PluginProcessProxy): Ditto.
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::~NetworkProcessConnection): Ditto.
* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::~WebToStorageProcessConnection): Ditto.

* StorageProcess/StorageToWebProcessConnection.h: Derive privately rather than publicly
from IPC::Connection::Client because we can, and this means we don't have to study quite
as much code to understand how this is used as a connection client.
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: Ditto.
* WebProcess/Storage/WebToStorageProcessConnection.h: Ditto.
* WebProcess/WebPage/WebInspector.h: Ditto.
* WebProcess/WebPage/WebInspectorUI.h: Ditto.

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer): Added a comment about a
reference cycle cycle leading to a leak that I believe exists here.

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

2 years ago[iOS WK2] API test EditorStateTests.ContentViewHasTextInContentEditableElement is...
wenson_hsieh@apple.com [Sat, 30 Sep 2017 21:25:50 +0000 (21:25 +0000)]
[iOS WK2] API test EditorStateTests.ContentViewHasTextInContentEditableElement is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=177698

Reviewed by Ryosuke Niwa.

The WebKit2 API test EditorStateTests.ContentViewHasTextInContentEditableElement is currently hitting
intermittent failures on test runners. After inserting just an image in the editable element, we would expect
that -hasText should return NO because the text content is an empty string, but we find that -hasText is YES.
This is because we're bailing on an early return in computeEditableRootHasContentAndPlainText because the
EditorState's PostLayoutData contains non-zero characters near the selection, which is incorrect.

However, upon closer inspection, this is due to a latent bug in the charactersAroundPosition helper function.
This function attempts to compute characters before and after the current selection by initializing a Vector
of size 3 with the relevant character data, and then sets oneAfter, oneBefore and twoBefore to the UChar32
values in the vector. However, in the case where there are less than three characters, we end up assigning
the uninitialized values in the vector to one or more of oneAfter, oneBefore and twoBefore, which causes the
helper added in r222654 to bail early when it should not.

To fix this, we initialize the values in `characters` to 0 (which is the initial value for the 3 corresponding
members in the PostLayoutData struct). We also turn `characters` into a UChar32 array on the stack, to avoid the
heap allocations using a Vector<UChar32>.

No new tests; fixes a flaky API test.

* editing/VisibleUnits.cpp:
(WebCore::charactersAroundPosition):

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

2 years agoAdd makeWeakPtr for easier WeakPtr construction
antti@apple.com [Sat, 30 Sep 2017 13:44:04 +0000 (13:44 +0000)]
Add makeWeakPtr for easier WeakPtr construction
https://bugs.webkit.org/show_bug.cgi?id=177706

Reviewed by Sam Weinig.

Source/WebCore:

Use it in render tree.

* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::loadPlugin):
* page/FrameView.cpp:
(WebCore::FrameView::updateEmbeddedObject):
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
* rendering/RenderObject.h:
(WebCore::RenderObject::weakFactory const):
(WebCore::RenderObject::createWeakPtr): Deleted.
* rendering/RenderView.cpp:
(WebCore::RenderView::RepaintRegionAccumulator::RepaintRegionAccumulator):
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::setWidgetGeometry):
(WebCore::RenderWidget::setWidget):
(WebCore::RenderWidget::updateWidgetPosition):

Source/WTF:

Standalone makeWeakPtr() returns a WeakPtr of the same type as the argument.

For this to work the argument type needs to expose a (possibly base type) WeakPtrFactory
as a public weakPtrFactory() member function.

* wtf/WeakPtr.h:
(WTF::WeakPtr::operator-> const):
(WTF::WeakPtr::operator* const): Also add operator*.
(WTF::makeWeakPtr):

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

2 years agoUnreviewed. Upgrade webkitgtk-test-fonts to version 0.0.7.
carlosgc@webkit.org [Sat, 30 Sep 2017 13:00:30 +0000 (13:00 +0000)]
Unreviewed. Upgrade webkitgtk-test-fonts to version 0.0.7.

Tools:

This version upgrades liberation fonts to version 2, that has a wider glyph coverage.

* gtk/jhbuild.modules:

LayoutTests:

Rebaseline tests affected by the new fonts.

* platform/gtk/css3/unicode-bidi-isolate-basic-expected.png:
* platform/gtk/css3/unicode-bidi-isolate-basic-expected.txt:
* platform/gtk/editing/selection/caret-rtl-2-expected.png:
* platform/gtk/editing/selection/caret-rtl-2-expected.txt:
* platform/gtk/editing/selection/caret-rtl-2-left-expected.png:
* platform/gtk/editing/selection/caret-rtl-2-left-expected.txt:
* platform/gtk/editing/selection/caret-rtl-expected.png:
* platform/gtk/editing/selection/caret-rtl-expected.txt:
* platform/gtk/editing/selection/caret-rtl-right-expected.png:
* platform/gtk/editing/selection/caret-rtl-right-expected.txt:
* platform/gtk/editing/selection/extend-by-word-002-expected.png:
* platform/gtk/editing/selection/extend-by-word-002-expected.txt:
* platform/gtk/editing/selection/extend-selection-bidi-expected.png:
* platform/gtk/editing/selection/extend-selection-bidi-expected.txt:
* platform/gtk/editing/selection/move-past-trailing-space-expected.png:
* platform/gtk/editing/selection/move-past-trailing-space-expected.txt:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-br-expected.png:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-br-expected.txt:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-p-expected.png:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-p-expected.txt:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-forward-br-expected.png:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-forward-br-expected.txt:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-forward-p-expected.png:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-forward-p-expected.txt:
* platform/gtk/fast/borders/rtl-border-04-expected.png:
* platform/gtk/fast/borders/rtl-border-04-expected.txt:
* platform/gtk/fast/borders/rtl-border-05-expected.png:
* platform/gtk/fast/borders/rtl-border-05-expected.txt:
* platform/gtk/fast/css/rtl-ordering-expected.png:
* platform/gtk/fast/css/rtl-ordering-expected.txt:
* platform/gtk/fast/css/text-overflow-ellipsis-bidi-expected.png:
* platform/gtk/fast/css/text-overflow-ellipsis-bidi-expected.txt:
* platform/gtk/fast/css/text-overflow-ellipsis-expected.png:
* platform/gtk/fast/css/text-overflow-ellipsis-expected.txt:
* platform/gtk/fast/css/text-overflow-ellipsis-strict-expected.png:
* platform/gtk/fast/css/text-overflow-ellipsis-strict-expected.txt:
* platform/gtk/fast/css/word-space-extra-expected.png:
* platform/gtk/fast/css/word-space-extra-expected.txt:
* platform/gtk/fast/dom/34176-expected.png:
* platform/gtk/fast/dom/34176-expected.txt:
* platform/gtk/fast/dom/52776-expected.png:
* platform/gtk/fast/dom/52776-expected.txt:
* platform/gtk/fast/forms/listbox-bidi-align-expected.png:
* platform/gtk/fast/forms/listbox-bidi-align-expected.txt:
* platform/gtk/fast/forms/search-rtl-expected.png:
* platform/gtk/fast/forms/search-rtl-expected.txt:
* platform/gtk/fast/forms/select-visual-hebrew-expected.png:
* platform/gtk/fast/forms/select-visual-hebrew-expected.txt:
* platform/gtk/fast/forms/visual-hebrew-text-field-expected.png:
* platform/gtk/fast/forms/visual-hebrew-text-field-expected.txt:
* platform/gtk/fast/inline/inline-box-background-expected.png:
* platform/gtk/fast/inline/inline-box-background-expected.txt:
* platform/gtk/fast/inline/inline-box-background-long-image-expected.png:
* platform/gtk/fast/inline/inline-box-background-long-image-expected.txt:
* platform/gtk/fast/inline/inline-box-background-repeat-x-expected.png:
* platform/gtk/fast/inline/inline-box-background-repeat-x-expected.txt:
* platform/gtk/fast/inline/inline-box-background-repeat-y-expected.png:
* platform/gtk/fast/inline/inline-box-background-repeat-y-expected.txt:
* platform/gtk/fast/text/atsui-negative-spacing-features-expected.png:
* platform/gtk/fast/text/atsui-negative-spacing-features-expected.txt:
* platform/gtk/fast/text/atsui-spacing-features-expected.png:
* platform/gtk/fast/text/atsui-spacing-features-expected.txt:
* platform/gtk/fast/text/basic/006-expected.png:
* platform/gtk/fast/text/basic/006-expected.txt:
* platform/gtk/fast/text/bidi-embedding-pop-and-push-same-expected.png:
* platform/gtk/fast/text/bidi-embedding-pop-and-push-same-expected.txt:
* platform/gtk/fast/text/capitalize-boundaries-expected.png:
* platform/gtk/fast/text/capitalize-boundaries-expected.txt:
* platform/gtk/fast/text/cg-fallback-bolding-expected.png:
* platform/gtk/fast/text/cg-fallback-bolding-expected.txt:
* platform/gtk/fast/text/drawBidiText-expected.png:
* platform/gtk/fast/text/drawBidiText-expected.txt:
* platform/gtk/fast/text/hyphenate-avoid-orphaned-word-expected.txt:
* platform/gtk/fast/text/hyphenate-character-expected.png:
* platform/gtk/fast/text/hyphenate-character-expected.txt:
* platform/gtk/fast/text/hyphenate-first-word-expected.png:
* platform/gtk/fast/text/hyphenate-first-word-expected.txt:
* platform/gtk/fast/text/hyphenate-limit-before-after-expected.png:
* platform/gtk/fast/text/hyphenate-limit-before-after-expected.txt:
* platform/gtk/fast/text/hyphenate-limit-lines-expected.png:
* platform/gtk/fast/text/hyphenate-limit-lines-expected.txt:
* platform/gtk/fast/text/hyphens-expected.png:
* platform/gtk/fast/text/hyphens-expected.txt:
* platform/gtk/fast/text/in-rendered-text-rtl-expected.png:
* platform/gtk/fast/text/in-rendered-text-rtl-expected.txt:
* platform/gtk/fast/text/international/bidi-AN-after-L-expected.png:
* platform/gtk/fast/text/international/bidi-AN-after-L-expected.txt:
* platform/gtk/fast/text/international/bidi-L2-run-reordering-expected.png:
* platform/gtk/fast/text/international/bidi-L2-run-reordering-expected.txt:
* platform/gtk/fast/text/international/bidi-LDB-2-CSS-expected.png:
* platform/gtk/fast/text/international/bidi-LDB-2-CSS-expected.txt:
* platform/gtk/fast/text/international/bidi-LDB-2-HTML-expected.png:
* platform/gtk/fast/text/international/bidi-LDB-2-HTML-expected.txt:
* platform/gtk/fast/text/international/bidi-LDB-2-formatting-characters-expected.png:
* platform/gtk/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt:
* platform/gtk/fast/text/international/bidi-explicit-embedding-expected.png:
* platform/gtk/fast/text/international/bidi-explicit-embedding-expected.txt:
* platform/gtk/fast/text/international/bidi-ignored-for-first-child-inline-expected.png:
* platform/gtk/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt:
* platform/gtk/fast/text/international/bidi-innertext-expected.png:
* platform/gtk/fast/text/international/bidi-innertext-expected.txt:
* platform/gtk/fast/text/international/bidi-linebreak-001-expected.png:
* platform/gtk/fast/text/international/bidi-linebreak-001-expected.txt:
* platform/gtk/fast/text/international/bidi-linebreak-002-expected.png:
* platform/gtk/fast/text/international/bidi-linebreak-002-expected.txt:
* platform/gtk/fast/text/international/bidi-linebreak-003-expected.png:
* platform/gtk/fast/text/international/bidi-linebreak-003-expected.txt:
* platform/gtk/fast/text/international/bidi-mirror-he-ar-expected.png:
* platform/gtk/fast/text/international/bidi-mirror-he-ar-expected.txt:
* platform/gtk/fast/text/international/bidi-neutral-run-expected.png:
* platform/gtk/fast/text/international/bidi-neutral-run-expected.txt:
* platform/gtk/fast/text/international/bidi-override-expected.png:
* platform/gtk/fast/text/international/bidi-override-expected.txt:
* platform/gtk/fast/text/international/hebrew-vowels-expected.png:
* platform/gtk/fast/text/international/hebrew-vowels-expected.txt:
* platform/gtk/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png:
* platform/gtk/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt:
* platform/gtk/fast/text/international/rtl-caret-expected.png:
* platform/gtk/fast/text/international/rtl-caret-expected.txt:
* platform/gtk/fast/text/international/rtl-white-space-pre-wrap-expected.png:
* platform/gtk/fast/text/international/rtl-white-space-pre-wrap-expected.txt:
* platform/gtk/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png:
* platform/gtk/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt:
* platform/gtk/fast/text/line-breaks-expected.png:
* platform/gtk/fast/text/line-breaks-expected.txt:
* platform/gtk/fast/text/midword-break-after-breakable-char-expected.png:
* platform/gtk/fast/text/midword-break-after-breakable-char-expected.txt:
* platform/gtk/fast/text/trailing-white-space-2-expected.png:
* platform/gtk/fast/text/trailing-white-space-2-expected.txt:
* platform/gtk/fast/text/trailing-white-space-expected.png:
* platform/gtk/fast/text/trailing-white-space-expected.txt:
* platform/gtk/fast/text/vertical-rl-rtl-linebreak-expected.png:
* platform/gtk/fast/text/vertical-rl-rtl-linebreak-expected.txt:
* platform/gtk/fast/text/whitespace/026-expected.png:
* platform/gtk/fast/text/whitespace/026-expected.txt:
* platform/gtk/svg/W3C-I18N/text-anchor-dirLTR-anchorEnd-expected.png:
* platform/gtk/svg/W3C-I18N/text-anchor-dirLTR-anchorEnd-expected.txt:
* platform/gtk/svg/W3C-I18N/text-anchor-dirLTR-anchorMiddle-expected.png:
* platform/gtk/svg/W3C-I18N/text-anchor-dirLTR-anchorMiddle-expected.txt:
* platform/gtk/svg/W3C-I18N/text-anchor-dirLTR-anchorStart-expected.png:
* platform/gtk/svg/W3C-I18N/text-anchor-dirLTR-anchorStart-expected.txt:
* platform/gtk/svg/W3C-I18N/text-anchor-dirNone-anchorEnd-expected.png:
* platform/gtk/svg/W3C-I18N/text-anchor-dirNone-anchorEnd-expected.txt:
* platform/gtk/svg/W3C-I18N/text-anchor-dirNone-anchorMiddle-expected.png:
* platform/gtk/svg/W3C-I18N/text-anchor-dirNone-anchorMiddle-expected.txt:
* platform/gtk/svg/W3C-I18N/text-anchor-dirNone-anchorStart-expected.png:
* platform/gtk/svg/W3C-I18N/text-anchor-dirNone-anchorStart-expected.txt:
* platform/gtk/svg/W3C-I18N/text-anchor-dirRTL-anchorEnd-expected.png:
* platform/gtk/svg/W3C-I18N/text-anchor-dirRTL-anchorEnd-expected.txt:
* platform/gtk/svg/W3C-I18N/text-anchor-dirRTL-anchorMiddle-expected.png:
* platform/gtk/svg/W3C-I18N/text-anchor-dirRTL-anchorMiddle-expected.txt:
* platform/gtk/svg/W3C-I18N/text-anchor-dirRTL-anchorStart-expected.png:
* platform/gtk/svg/W3C-I18N/text-anchor-dirRTL-anchorStart-expected.txt:
* platform/gtk/svg/W3C-I18N/text-anchor-inherited-dirLTR-anchorEnd-expected.png:
* platform/gtk/svg/W3C-I18N/text-anchor-inherited-dirLTR-anchorEnd-expected.txt:
* platform/gtk/svg/W3C-I18N/text-anchor-inherited-dirLTR-anchorMiddle-expected.png:
* platform/gtk/svg/W3C-I18N/text-anchor-inherited-dirLTR-anchorMiddle-expected.txt:
* platform/gtk/svg/W3C-I18N/text-anchor-inherited-dirLTR-anchorStart-expected.png:
* platform/gtk/svg/W3C-I18N/text-anchor-inherited-dirLTR-anchorStart-expected.txt:
* platform/gtk/svg/W3C-I18N/text-anchor-inherited-dirRTL-anchorEnd-expected.png:
* platform/gtk/svg/W3C-I18N/text-anchor-inherited-dirRTL-anchorEnd-expected.txt:
* platform/gtk/svg/W3C-I18N/text-anchor-inherited-dirRTL-anchorMiddle-expected.png:
* platform/gtk/svg/W3C-I18N/text-anchor-inherited-dirRTL-anchorMiddle-expected.txt:
* platform/gtk/svg/W3C-I18N/text-anchor-inherited-dirRTL-anchorStart-expected.png:
* platform/gtk/svg/W3C-I18N/text-anchor-inherited-dirRTL-anchorStart-expected.txt:
* platform/gtk/svg/W3C-I18N/text-anchor-no-markup-expected.png:
* platform/gtk/svg/W3C-I18N/text-anchor-no-markup-expected.txt:
* platform/gtk/svg/W3C-SVG-1.1-SE/text-intro-02-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/text-intro-02-b-expected.txt:
* platform/gtk/svg/W3C-SVG-1.1-SE/text-intro-09-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/text-intro-09-b-expected.txt:
* platform/gtk/svg/W3C-SVG-1.1/text-tselect-02-f-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/text-tselect-02-f-expected.txt:
* platform/gtk/svg/custom/glyph-selection-bidi-mirror-expected.png:
* platform/gtk/svg/custom/glyph-selection-bidi-mirror-expected.txt:
* platform/gtk/svg/text/bidi-embedded-direction-expected.png:
* platform/gtk/svg/text/bidi-embedded-direction-expected.txt:
* platform/gtk/svg/text/bidi-reorder-value-lists-expected.png:
* platform/gtk/svg/text/bidi-reorder-value-lists-expected.txt: Added.
* platform/gtk/svg/text/bidi-text-anchor-direction-expected.png:
* platform/gtk/svg/text/bidi-text-anchor-direction-expected.txt:
* platform/gtk/svg/text/text-tselect-02-f-expected.png:
* platform/gtk/svg/text/text-tselect-02-f-expected.txt:
* platform/gtk/tables/mozilla/marvin/backgr_layers-opacity-expected.png:
* platform/gtk/tables/mozilla/marvin/backgr_layers-opacity-expected.txt:
* platform/gtk/tables/mozilla/marvin/backgr_position-table-expected.png:
* platform/gtk/tables/mozilla/marvin/backgr_position-table-expected.txt:
* platform/gtk/tables/mozilla/marvin/backgr_simple-table-cell-expected.png:
* platform/gtk/tables/mozilla/marvin/backgr_simple-table-cell-expected.txt:
* platform/gtk/tables/mozilla/marvin/backgr_simple-table-column-expected.png:
* platform/gtk/tables/mozilla/marvin/backgr_simple-table-column-expected.txt:
* platform/gtk/tables/mozilla/marvin/backgr_simple-table-column-group-expected.png:
* platform/gtk/tables/mozilla/marvin/backgr_simple-table-column-group-expected.txt:
* platform/gtk/tables/mozilla/marvin/backgr_simple-table-expected.png:
* platform/gtk/tables/mozilla/marvin/backgr_simple-table-expected.txt:
* platform/gtk/tables/mozilla/marvin/backgr_simple-table-row-expected.png:
* platform/gtk/tables/mozilla/marvin/backgr_simple-table-row-expected.txt:
* platform/gtk/tables/mozilla/marvin/backgr_simple-table-row-group-expected.png:
* platform/gtk/tables/mozilla/marvin/backgr_simple-table-row-group-expected.txt:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_border-table-cell-expected.png:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_border-table-cell-expected.txt:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_border-table-column-expected.png:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_border-table-column-expected.txt:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_border-table-column-group-expected.png:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_border-table-column-group-expected.txt:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_border-table-expected.png:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_border-table-expected.txt:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_border-table-quirks-expected.png:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_border-table-quirks-expected.txt:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_border-table-row-expected.png:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_border-table-row-expected.txt:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_border-table-row-group-expected.png:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_border-table-row-group-expected.txt:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.png:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.txt:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_layers-hide-expected.png:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_layers-hide-expected.txt:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_layers-show-expected.png:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_layers-show-expected.txt:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_position-table-cell-expected.png:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_position-table-cell-expected.txt:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_position-table-column-expected.png:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_position-table-column-expected.txt:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_position-table-column-group-expected.png:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_position-table-column-group-expected.txt:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_position-table-row-expected.png:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_position-table-row-expected.txt:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_position-table-row-group-expected.png:
* platform/gtk/tables/mozilla_expected_failures/marvin/backgr_position-table-row-group-expected.txt:

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

2 years agoShare more pasteboard code between iOS and macOS and remove dependency on Settings
rniwa@webkit.org [Sat, 30 Sep 2017 10:31:05 +0000 (10:31 +0000)]
Share more pasteboard code between iOS and macOS and remove dependency on Settings
https://bugs.webkit.org/show_bug.cgi?id=177700

Reviewed by Wenson Hsieh.

Moved more code from PasteboardIOS.mm and PasteboardMac.mm into PasteboardCocoa.mm to share code.

This patch also removes the layering violation inadvertently introduced in r222595 whereby which
Pasteboard code depends on Settings. To do this, this patch splits readStringForBindings is into
readString and readStringInCustomData and typesForBindings into typesSafeForBindings and
typesForLegacyUnsafeBindings, and moves the logic to decide whether a given type or string is read
off of the native pasteboard entry or our custom data entry is moved to DataTransfer.

No new tests since there should be no behavioral change.

* dom/DataTransfer.cpp:
(WebCore::DataTransfer::getData const): Moved the code to decide whether string is
read off of custom data or native pasteboard from readStringForBindings.
(WebCore::DataTransfer::types const): Ditto from typesForBindings.
* platform/Pasteboard.cpp:
(WebCore::Pasteboard::isSafeTypeForDOMToReadAndWrite): Moved into Pasteboard.
* platform/Pasteboard.h:
* platform/StaticPasteboard.cpp:
(WebCore::StaticPasteboard::readString): Renamed from readStringForBindings.
(WebCore::StaticPasteboard::readStringInCustomData): Added.
(WebCore::StaticPasteboard::writeString):
* platform/StaticPasteboard.h:
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::Pasteboard::typesSafeForBindings): Extracted out of typesForBindings in PasteboardIOS.mm
and PasteboardMac.mm.
(WebCore::Pasteboard::typesForLegacyUnsafeBindings): Ditto.
(WebCore::Pasteboard::readString): Ditto.
(WebCore::Pasteboard::readStringInCustomData): Ditto.
(WebCore::Pasteboard::writeCustomData): Moved here from PasteboardIOS.mm and PasteboardCocoa.mm.
(WebCore::Pasteboard::changeCount const): Ditto.
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::typesSafeForBindings): Added.
(WebCore::Pasteboard::typesForLegacyUnsafeBindings): Renamed from readStringForBindings.
(WebCore::Pasteboard::readString):
(WebCore::Pasteboard::readStringInCustomData): Added.
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::writeCustomData): Moved to PasteboardCocoa.mm.
(WebCore::Pasteboard::changeCount const): Ditto.
(WebCore::Pasteboard::readPlatformValueAsString): Moved into Pasteboard.
(WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType): Ditto.
(WebCore::Pasteboard::readStringForBindings): Moved to PasteboardCocoa.mm.
(WebCore::Pasteboard::typesForBindings): Ditto.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::changeCount const): Moved to PasteboardCocoa.mm.
(WebCore::Pasteboard::writeCustomData): Ditto.
(WebCore::Pasteboard::readPlatformValueAsString): Moved into Pasteboard.
(WebCore::Pasteboard::readStringForBindings): Moved to PasteboardCocoa.mm.
(WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType): Moved into Pasteboard.
(WebCore::Pasteboard::typesForBindings): Moved to PasteboardCocoa.mm.
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::typesSafeForBindings): Added.
(WebCore::Pasteboard::typesForLegacyUnsafeBindings): Renamed from readStringForBindings.
(WebCore::Pasteboard::readString): Renamed from readStringForBindings.
(WebCore::Pasteboard::readStringInCustomData): Added.
* platform/wpe/PasteboardWPE.cpp:
(WebCore::Pasteboard::typesSafeForBindings): Added.
(WebCore::PasteboardtypesForLegacyUnsafeBindings): Renamed from readStringForBindings.
(WebCore::Pasteboard::readString): Renamed from readStringForBindings.
(WebCore::Pasteboard::readStringInCustomData): Added.

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

2 years agoUse smart pointers for creating, adding and removing renderers
antti@apple.com [Sat, 30 Sep 2017 06:45:59 +0000 (06:45 +0000)]
Use smart pointers for creating, adding and removing renderers
https://bugs.webkit.org/show_bug.cgi?id=177603

Reviewed by Zalan Bujtas.

With this patch RenderObject ownership is consistently managed using RenderPtrs. It also
clarifies that in-tree renderers are always owned by the parent renderer.

- renderers are constructed with createRenderer<> which returns RenderPtr
- addChild and related functions take RenderPtrs
- removeChild is replaced with takeChild that returns a RenderPtr
- only addChildInternal/takeChildInternal deal with raw ownder renderer pointers.

There are still a few exception left, noted below, to be fixed later.

* dom/Document.cpp:
(WebCore::Document::webkitWillEnterFullScreenForElement):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addChildToContinuation):
(WebCore::RenderBlock::addChild):
(WebCore::RenderBlock::addChildIgnoringContinuation):
(WebCore::RenderBlock::makeChildrenNonInline):
(WebCore::RenderBlock::dropAnonymousBoxChild):
(WebCore::RenderBlock::takeChild):
(WebCore::RenderBlock::createAnonymousBlockWithStyleAndDisplay):
(WebCore::RenderBlock::removeChild): Deleted.
* rendering/RenderBlock.h:
(WebCore::RenderBlock::createAnonymousWithParentRendererAndDisplay):
(WebCore::RenderBlock::createAnonymousBoxWithSameTypeAs const):
(WebCore::RenderBlock::createAnonymousBlock const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::addChild):
(WebCore::RenderBlockFlow::takeChild):
(WebCore::RenderBlockFlow::removeChild): Deleted.
* rendering/RenderBlockFlow.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::splitAnonymousBoxesAroundChild):
* rendering/RenderBox.h:
(WebCore::RenderBox::createAnonymousBoxWithSameTypeAs const):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::moveChildTo):
* rendering/RenderButton.cpp:
(WebCore::RenderButton::addChild):
(WebCore::RenderButton::takeChild):
(WebCore::RenderButton::setText):
(WebCore::RenderButton::removeChild): Deleted.
* rendering/RenderButton.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::addChild):
(WebCore::RenderElement::takeChild):
(WebCore::RenderElement::removeAndDestroyChild):
(WebCore::RenderElement::destroyLeftoverChildren):

    Keep the existing behavior and leak the firstLetter renderer. The comment claims they get destroyed by RenderTextFragment.
    To be cleaned up later.

(WebCore::RenderElement::insertChildInternal):
(WebCore::RenderElement::takeChildInternal):
(WebCore::RenderElement::handleDynamicFloatPositionChange):
(WebCore::RenderElement::removeChild): Deleted.
(WebCore::RenderElement::removeChildInternal): Deleted.
* rendering/RenderElement.h:
(WebCore::RenderElement::addChildIgnoringContinuation):
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::willBeDestroyed):
(WebCore::RenderFullScreen::wrapNewRenderer):
(WebCore::RenderFullScreen::wrapExistingRenderer):

    Split wrapRenderer() into two functions, wrapNewRenderer() and wrapExistingRenderer().
    The first one deals with adding new renderers to the tree while the latter mutates
    existing render tree in-place.

(WebCore::RenderFullScreen::unwrapRenderer):
(WebCore::RenderFullScreen::createPlaceholder):
(WebCore::RenderFullScreen::wrapRenderer): Deleted.
* rendering/RenderFullScreen.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::addChild):
(WebCore::RenderGrid::takeChild):
(WebCore::RenderGrid::removeChild): Deleted.
* rendering/RenderGrid.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::addChild):
(WebCore::RenderInline::addChildIgnoringContinuation):
(WebCore::RenderInline::splitInlines):
(WebCore::RenderInline::splitFlow):
(WebCore::RenderInline::addChildToContinuation):
(WebCore::RenderInline::childBecameNonInline):
* rendering/RenderInline.h:
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::createInnerBlock):
(RenderMenuList::addChild):
(RenderMenuList::takeChild):
(RenderMenuList::setText):
(RenderMenuList::removeChild): Deleted.
* rendering/RenderMenuList.h:
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
(WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
(WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):

    Keep the existing behavior and leak the placeholder renderer.
    To be cleaned up later.

(WebCore::RenderMultiColumnFlow::handleSpannerRemoval):

    Keep the existing behavior and leak the placeholder renderer.
    To be cleaned up later.

* rendering/RenderMultiColumnSpannerPlaceholder.cpp:
(WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
* rendering/RenderMultiColumnSpannerPlaceholder.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::removeFromParentAndDestroy):
(WebCore::RenderObject::willBeDestroyed):
(WebCore::RenderObject::destroy):
(WebCore::RenderObject::removeFromParent): Deleted.
* rendering/RenderObject.h:
* rendering/RenderQuote.cpp:
(WebCore::RenderQuote::updateTextRenderer):
* rendering/RenderRuby.cpp:
(WebCore::createAnonymousRubyInlineBlock):
(WebCore::RenderRubyAsInline::addChild):
(WebCore::RenderRubyAsInline::takeChild):
(WebCore::RenderRubyAsBlock::addChild):
(WebCore::RenderRubyAsBlock::takeChild):
(WebCore::RenderRubyAsInline::removeChild): Deleted.
(WebCore::RenderRubyAsBlock::removeChild): Deleted.
* rendering/RenderRuby.h:
* rendering/RenderRubyBase.cpp:
(WebCore::RenderRubyBase::moveInlineChildren):
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::rubyBaseSafe):
(WebCore::RenderRubyRun::addChild):
(WebCore::RenderRubyRun::takeChild):
(WebCore::RenderRubyRun::createRubyBase const):
(WebCore::RenderRubyRun::staticCreateRubyRun):
(WebCore::RenderRubyRun::removeChild): Deleted.
* rendering/RenderRubyRun.h:
* rendering/RenderTable.cpp:
(WebCore::RenderTable::addChild):
(WebCore::RenderTable::createTableWithStyle):
(WebCore::RenderTable::createAnonymousWithParentRenderer):
* rendering/RenderTable.h:
(WebCore::RenderTable::createAnonymousBoxWithSameTypeAs const):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::createTableCellWithStyle):
(WebCore::RenderTableCell::createAnonymousWithParentRenderer):
* rendering/RenderTableCell.h:
(WebCore::RenderTableCell::createAnonymousBoxWithSameTypeAs const):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::addChild):
(WebCore::RenderTableRow::createTableRowWithStyle):
(WebCore::RenderTableRow::createAnonymousWithParentRenderer):
* rendering/RenderTableRow.h:
(WebCore::RenderTableRow::createAnonymousBoxWithSameTypeAs const):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::addChild):
(WebCore::RenderTableSection::createTableSectionWithStyle):
(WebCore::RenderTableSection::createAnonymousWithParentRenderer):
* rendering/RenderTableSection.h:
(WebCore::RenderTableSection::createAnonymousBoxWithSameTypeAs const):
* rendering/mathml/RenderMathMLFenced.cpp:
(WebCore::RenderMathMLFenced::makeFences):
(WebCore::RenderMathMLFenced::addChild):
* rendering/mathml/RenderMathMLFenced.h:
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::addChild):
(WebCore::RenderSVGContainer::takeChild):
(WebCore::RenderSVGContainer::removeChild): Deleted.
* rendering/svg/RenderSVGContainer.h:
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::addChild):
(WebCore::RenderSVGInline::takeChild):
(WebCore::RenderSVGInline::removeChild): Deleted.
* rendering/svg/RenderSVGInline.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::addChild):
(WebCore::RenderSVGRoot::takeChild):
(WebCore::RenderSVGRoot::removeChild): Deleted.
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::addChild):
(WebCore::RenderSVGText::takeChild):
(WebCore::RenderSVGText::removeChild): Deleted.
* rendering/svg/RenderSVGText.h:
* style/RenderTreePosition.h:
(WebCore::RenderTreePosition::insert):
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::createRenderer):
(WebCore::createTextRenderer):
* style/RenderTreeUpdaterFirstLetter.cpp:
(WebCore::updateFirstLetterStyle):
(WebCore::createFirstLetterRenderer):
* style/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::createContentRenderers):
* style/RenderTreeUpdaterListItem.cpp:
(WebCore::RenderTreeUpdater::ListItem::updateMarker):
* style/RenderTreeUpdaterMultiColumn.cpp:
(WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):

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

2 years agoWeb Inspector: Styles Redesign: support undo/redo of manual edits
nvasilyev@apple.com [Sat, 30 Sep 2017 05:07:01 +0000 (05:07 +0000)]
Web Inspector: Styles Redesign: support undo/redo of manual edits
https://bugs.webkit.org/show_bug.cgi?id=177314

Reviewed by Joseph Pecoraro.

Make sure Command-Z and Command-Shift-Z undo changes in the styles sidebar
when not focused on a contentEditable field.

* UserInterface/Views/EditingSupport.js:
(WI.isEventTargetAnEditableField):
Make sure WI._undoKeyboardShortcut doesn't call WI.undo() when editing inside of a contentEditable element.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor):
Call style setter to setup event listeners during instantiation.

(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.set style):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype._propertiesChanged):
Update style declaration section when it isn't focused.
This is the same logic as in the old styles sidebar (CSSStyleDeclarationTextEditor style setter).

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

2 years agoRemove redundant RenderObject::selectionRoot and dependencies
zalan@apple.com [Sat, 30 Sep 2017 04:31:29 +0000 (04:31 +0000)]
Remove redundant RenderObject::selectionRoot and dependencies
https://bugs.webkit.org/show_bug.cgi?id=177696

Reviewed by Ryosuke Niwa.

There's only one selection root (RenderView).

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::selectionState):
(WebCore::InlineTextBox::selectionStartEnd const):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::selectionRoot const): Deleted.
(WebCore::RenderObject::selectionStartEnd const): Deleted.
* rendering/RenderObject.h:
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::isSelected const):
* rendering/RenderText.cpp:
(WebCore::RenderText::collectSelectionRectsForLineBoxes):
* rendering/RenderTextLineBoxes.cpp:
(WebCore::RenderTextLineBoxes::setSelectionState):
* rendering/RenderView.h:
* rendering/SelectionSubtreeRoot.h:

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

2 years agoFollow-up to https://trac.webkit.org/r222239 to fix crashes.
ap@apple.com [Sat, 30 Sep 2017 02:11:20 +0000 (02:11 +0000)]
Follow-up to https://trac.webkit.org/r222239 to fix crashes.
rdar://problem/34705779

Addressing review comments that I somehow landed without.

* WebView/WebHTMLView.mm: Undo adding #if guards around -_web_uniqueWebDataURL

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

2 years ago[DFG] Support ArrayPush with multiple args
utatane.tea@gmail.com [Sat, 30 Sep 2017 01:16:52 +0000 (01:16 +0000)]
[DFG] Support ArrayPush with multiple args
https://bugs.webkit.org/show_bug.cgi?id=175823

Reviewed by Saam Barati.

JSTests:

* microbenchmarks/array-push-0.js: Added.
(arrayPush0):
* microbenchmarks/array-push-1.js: Added.
(arrayPush1):
* microbenchmarks/array-push-2.js: Added.
(arrayPush2):
* microbenchmarks/array-push-3.js: Added.
(arrayPush3):
* stress/array-push-multiple-contiguous.js: Added.
(shouldBe):
(test):
* stress/array-push-multiple-double-nan.js: Added.
(shouldBe):
(test):
* stress/array-push-multiple-double.js: Added.
(shouldBe):
(test):
* stress/array-push-multiple-int32.js: Added.
(shouldBe):
(test):
* stress/array-push-multiple-many-contiguous.js: Added.
(shouldBe):
(test):
* stress/array-push-multiple-many-double.js: Added.
(shouldBe):
(test):
* stress/array-push-multiple-many-int32.js: Added.
(shouldBe):
(test):
* stress/array-push-multiple-many-storage.js: Added.
(shouldBe):
(test):
* stress/array-push-multiple-storage.js: Added.
(shouldBe):
(test):
* stress/array-push-with-force-exit.js: Added.
(target.createBuiltin):

Source/JavaScriptCore:

Reviewed by Saam Barati.

This patch implements ArrayPush(with multiple arguments) in DFG and FTL. Previously, they are not handled
by ArrayPush. Then they go to generic direct call to Array#push and it does in slow path. This patch
extends ArrayPush to push multiple arguments in a bulk push manner.

The problem of ArrayPush is that we need to perform ArrayPush atomically: If OSR exit occurs in the middle
of ArrayPush, we incorrectly push pushed elements twice. Once we start pushing values, we should not exit.
But we do not want to iterate elements twice, once for type checks and once for actually pushing it. It
could move elements between registers and memory back and forth.

This patch achieves the above goal by separating type checks from ArrayPush. When starting ArrayPush, type
checks for elements are already done by separately emitted Check nodes.

We also add JSArray::pushInline for DFG operations just calling JSArray::push. And we also use it in
arrayProtoFuncPush's fast path.

This patch significantly improves performance of `push(multiple args)`.

                                    baseline                  patched
    Microbenchmarks:
        array-push-0            461.8455+-28.9995    ^    151.3438+-6.5653        ^ definitely 3.0516x faster
        array-push-1            133.8845+-7.0349     ?    136.1775+-5.8327        ? might be 1.0171x slower
        array-push-2            675.6555+-13.4645    ^    145.8747+-6.4621        ^ definitely 4.6318x faster
        array-push-3            849.5284+-15.2540    ^    253.4421+-9.1249        ^ definitely 3.3520x faster

                                    baseline                  patched
    SixSpeed:
        spread-literal.es5       90.3482+-6.6514     ^     24.8123+-2.3304        ^ definitely 3.6413x faster

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArrayPush):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGStoreBarrierInsertionPhase.cpp:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileArrayPush):
* jit/JITOperations.h:
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncPush):
* runtime/JSArray.cpp:
(JSC::JSArray::push):
* runtime/JSArray.h:
* runtime/JSArrayInlines.h:
(JSC::JSArray::pushInline):

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

2 years agoREGRESSION: ASSERTION FAILED: m_provisionalURL.isEmpty() in WebKit::FrameLoadState...
commit-queue@webkit.org [Sat, 30 Sep 2017 00:54:22 +0000 (00:54 +0000)]
REGRESSION: ASSERTION FAILED: m_provisionalURL.isEmpty() in WebKit::FrameLoadState::didStartProvisionalLoad
https://bugs.webkit.org/show_bug.cgi?id=177491

Patch by Alex Christensen <achristensen@webkit.org> on 2017-09-29
Reviewed by Andy Estes.

* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::setUpWillSubmitFormListener):
(WebKit::WebFrame::continueWillSubmitForm):
(WebKit::WebFrame::invalidatePolicyListener):
Speculative fix for a flaky assertion.
Restore the clearing of the policy listeners we used to have when form submission was treated as a policy.

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

2 years agohttp/tests/preconnect/link-rel-preconnect-https.html is flaky
cdumez@apple.com [Sat, 30 Sep 2017 00:35:24 +0000 (00:35 +0000)]
http/tests/preconnect/link-rel-preconnect-https.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=177673

Reviewed by Alex Christensen.

Source/WebCore:

No new tests, unskipped test that is now passing consistently.

* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLink):
* loader/LoaderStrategy.h:

Source/WebKit:

Update PreconnectTask to query the client when a certificate needs to be
validated. This allows WebKitTestRunner to ignore invalid certificates
and this causes http/tests/preconnect/link-rel-preconnect-https.html
to pass consistently.

To avoid duplicating code, PreconnectTask now uses NetworkLoad internally
instead of using a NetworkDataTask directly.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::preconnectTo):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::generateCanAuthenticateIdentifier):
(WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace):
(WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
(WebKit::NetworkProcess::preconnectTo):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/PreconnectTask.cpp:
(WebKit::PreconnectTask::PreconnectTask):
(WebKit::PreconnectTask::~PreconnectTask):
(WebKit::PreconnectTask::willSendRedirectedRequest):
(WebKit::PreconnectTask::didReceiveResponse):
(WebKit::PreconnectTask::didReceiveBuffer):
(WebKit::PreconnectTask::didFinishLoading):
(WebKit::PreconnectTask::didFailLoading):
(WebKit::PreconnectTask::didSendData):
(WebKit::PreconnectTask::canAuthenticateAgainstProtectionSpaceAsync):
(WebKit::PreconnectTask::continueCanAuthenticateAgainstProtectionSpace):
(WebKit::PreconnectTask::frameID const):
(WebKit::PreconnectTask::pageID const):
* NetworkProcess/PreconnectTask.h:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::preconnectTo):
* WebProcess/Network/WebLoaderStrategy.h:

Source/WebKitLegacy:

* WebCoreSupport/WebResourceLoadScheduler.cpp:
(WebResourceLoadScheduler::preconnectTo):
* WebCoreSupport/WebResourceLoadScheduler.h:

LayoutTests:

* http/tests/preconnect/link-rel-preconnect-https-expected.txt:
Rebaseline test now that it is passing.

* platform/wk2/TestExpectations:
Uskip test as it should no longer be flaky.

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

2 years agoExpose WebPreferences::webGLEnabled through WKPreferences
achristensen@apple.com [Sat, 30 Sep 2017 00:29:19 +0000 (00:29 +0000)]
Expose WebPreferences::webGLEnabled through WKPreferences
https://bugs.webkit.org/show_bug.cgi?id=177692
<rdar://problem/24110556>

Reviewed by Andy Estes.

Source/WebKit:

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setWebGLEnabled:]):
(-[WKPreferences _webGLEnabled]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/Preferences.mm:
(-[AlertSaver alert]):
(-[AlertSaver webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):
(TEST):

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

2 years agoCustom GetterSetterAccessCase does not use the correct slotBase when making call
sbarati@apple.com [Fri, 29 Sep 2017 23:48:10 +0000 (23:48 +0000)]
Custom GetterSetterAccessCase does not use the correct slotBase when making call
https://bugs.webkit.org/show_bug.cgi?id=177639

Reviewed by Geoffrey Garen.

JSTests:

* stress/custom-get-set-inline-caching-one-level-up-proto-chain.js: Added.
(assert):
(Class):
(items.forEach):
(set get for):

Source/JavaScriptCore:

The bug occurred when you had a custom set value. Custom set/get
values are passed the property holder, not the base of the access.
If we had an object chain like this:
o = {__proto__: thingWithCustomSetValue}

We would end up not providing thingWithCustomSetValue as the argument
to the PutValueFunc. The reason is, we would use generateConditionsForPrototypePropertyHitCustom
for custom sets. This would return to us an empty ConditionSet, because
the property holder was only one level up the prototype chain. The reason
is, it didn't generate a condition for the slot holder, because the
protocol for custom set/get is that if an object responds to a custom
setter/getter, it will continue to respond to that getter/setter for
the lifetime of that object. Therefore, it's not strictly necessary to
generate an OPC for the slot base for custom accesses. However, AccessCase
uses !m_conditionSet.isEmtpy() to indicate that the IC is doing a prototype
access. With the above object "o", we were doing a prototype access, but we
had an empty condition set. This lead us to passing the base instead of
the property holder to the custom set value function, which is incorrect.

With custom getters, we never called to into the generateConditionsForPrototypePropertyHitCustom
API. Gets would always call into generateConditionsForPrototypePropertyHit, which
will generate an OPC on the slot base, even if it isn't strictly necessary for custom accessors.
This patch simply removes generateConditionsForPrototypePropertyHitCustom
and aligns the set case with the get case. It makes us properly detect
when we're doing a prototype access with the above object "o". If we find
that generateConditionsForPrototypePropertyHitCustom was a worthwhile
optimization to have, we can re-introduce it. We'll just need to pipe through
a new notion of when we're doing prototype accesses that doesn't rely solely
on !m_conditionSet.isEmpty().

* bytecode/ObjectPropertyConditionSet.cpp:
(JSC::generateConditionsForPrototypePropertyHitCustom): Deleted.
* bytecode/ObjectPropertyConditionSet.h:
* jit/Repatch.cpp:
(JSC::tryCachePutByID):
* jsc.cpp:
(JSTestCustomGetterSetter::JSTestCustomGetterSetter):
(JSTestCustomGetterSetter::create):
(JSTestCustomGetterSetter::createStructure):
(customGetAccessor):
(customGetValue):
(customSetAccessor):
(customSetValue):
(JSTestCustomGetterSetter::finishCreation):
(GlobalObject::finishCreation):
(functionLoadGetterFromGetterSetter):
(functionCreateCustomTestGetterSetter):
* runtime/PropertySlot.h:
(JSC::PropertySlot::setCustomGetterSetter):

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

2 years agoExtract logic to compute text to render into common function
dbates@webkit.org [Fri, 29 Sep 2017 23:42:03 +0000 (23:42 +0000)]
Extract logic to compute text to render into common function
https://bugs.webkit.org/show_bug.cgi?id=177607

Reviewed by Zalan Bujtas.

Currently we duplicate the logic to compute the text to render
throughout InlineTextBox. Instead we should move this common
code into a member function. This will allow us to audit the
the code paths that render text and ensure such code paths
account for hyphenation and combined text, if applicable.

Note that a TextRun does not own the text. The caller owns it.

No functionality changed. So, no new tests.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::localSelectionRect const): Modified to
use text() and createTextRun() to compute the text to render
and the text run for it.
(WebCore::InlineTextBox::paint): Ditto.
(WebCore::InlineTextBox::paintSelection): Ditto. Additionally query
lineStyle() for the style of the line instead of requiring it to be
passed as an argument.
(WebCore::InlineTextBox::paintTextSubrangeBackground): Modified
to use text() and createTextRun() to compute the text to render
and the text run for it.
(WebCore::InlineTextBox::paintDocumentMarker): Ditto.
(WebCore::InlineTextBox::offsetForPosition const): Ditto.
(WebCore::InlineTextBox::positionForOffset const): Ditto.
(WebCore::InlineTextBox::createTextRun const): Added; formerly named constructTextRun.
(WebCore::InlineTextBox::text const): Added.
(WebCore::InlineTextBox::substringToRender const): Deleted.
(WebCore::InlineTextBox::hyphenatedStringForTextRun const): Deleted.
(WebCore::InlineTextBox::constructTextRun const): Deleted.
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::substringToRender): Deleted.
(WebCore::InlineTextBox::hyphenatedStringForTextRun): Deleted.
(WebCore::InlineTextBox::constructTextRun): Deleted; renamed to createTextRun.

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

2 years agoRemove SelectionSubtreeRoot::RenderSubtreesMap
zalan@apple.com [Fri, 29 Sep 2017 22:50:56 +0000 (22:50 +0000)]
Remove SelectionSubtreeRoot::RenderSubtreesMap
https://bugs.webkit.org/show_bug.cgi?id=177685

Reviewed by Andy Estes.

This is in preparation of removing redundant SelectionSubtreeRoot.
(Now that we removed regions, RenderView is the only selection root)

No change in functionality.

* rendering/RenderView.cpp:
(WebCore::RenderView::selectionBounds const):
(WebCore::RenderView::subtreeSelectionBounds const):
(WebCore::RenderView::repaintSelection const):
(WebCore::RenderView::repaintSubtreeSelection const):
(WebCore::RenderView::setSelection):
(WebCore::isValidObjectForNewSelection):
(WebCore::RenderView::clearSubtreeSelection const):
(WebCore::RenderView::applySubtreeSelection):
(WebCore::RenderView::updateSelectionForSubtrees): Deleted.
* rendering/RenderView.h:
* rendering/SelectionSubtreeRoot.h:

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

2 years agoUnreviewed, rolling out r222652.
jlewis3@apple.com [Fri, 29 Sep 2017 22:25:15 +0000 (22:25 +0000)]
Unreviewed, rolling out r222652.

This broke an internal build.

Reverted changeset:

"Build libwebrtc unit tests executables"
https://bugs.webkit.org/show_bug.cgi?id=177211
http://trac.webkit.org/changeset/222652

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

2 years ago[WK2][NETWORK_SESSION] Move some authentication-related code to avoid duplication
cdumez@apple.com [Fri, 29 Sep 2017 22:08:33 +0000 (22:08 +0000)]
[WK2][NETWORK_SESSION] Move some authentication-related code to avoid duplication
https://bugs.webkit.org/show_bug.cgi?id=177667

Reviewed by Alex Christensen.

Move some authentication-related code to avoid duplication.
This is a preparation code supporting Download authentication
as Download uses a NSURLSessionDownloadTask and not a
NetworkDataTask.

* NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTask::setSuggestedFilename):
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::didReceiveChallenge):
(WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::allowsSpecificHTTPSCertificateForHost):
* NetworkProcess/NetworkSession.h:
* NetworkProcess/PreconnectTask.cpp:
(WebKit::PreconnectTask::didReceiveChallenge):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::didReceiveChallenge):
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
(WebKit::certificatesMatch):
(WebKit::NetworkSessionCocoa::allowsSpecificHTTPSCertificateForHost):

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

2 years agoFix WKWebViewConfigurationPrivate after r222663
achristensen@apple.com [Fri, 29 Sep 2017 21:35:59 +0000 (21:35 +0000)]
Fix WKWebViewConfigurationPrivate after r222663
https://bugs.webkit.org/show_bug.cgi?id=177644

Source/WebKit:

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:

Tools:

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

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

2 years ago[Curl] Extract a features to manage HTTP communication from ResourceHandle
commit-queue@webkit.org [Fri, 29 Sep 2017 21:19:32 +0000 (21:19 +0000)]
[Curl] Extract a features to manage HTTP communication from ResourceHandle
https://bugs.webkit.org/show_bug.cgi?id=175148

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-09-29
Reviewed by Alex Christensen.

* platform/Curl.cmake:
* platform/network/curl/CurlRequest.cpp: Added.
(WebCore::CurlRequest::CurlRequest):
(WebCore::CurlRequest::setUserPass):
(WebCore::CurlRequest::start):
(WebCore::CurlRequest::startWithJobManager):
(WebCore::CurlRequest::cancel):
(WebCore::CurlRequest::suspend):
(WebCore::CurlRequest::resume):
(WebCore::CurlRequest::callDelegate):
(WebCore::CurlRequest::setupTransfer):
(WebCore::CurlRequest::willSetupSslCtx):
(WebCore::CurlRequest::willSendData):
(WebCore::CurlRequest::didReceiveHeader):
(WebCore::CurlRequest::didReceiveData):
(WebCore::CurlRequest::didCompleteTransfer):
(WebCore::CurlRequest::didCancelTransfer):
(WebCore::CurlRequest::resolveBlobReferences):
(WebCore::CurlRequest::setupPUT):
(WebCore::CurlRequest::setupPOST):
(WebCore::CurlRequest::setupFormData):
(WebCore::CurlRequest::invokeDidReceiveResponseForFile):
(WebCore::CurlRequest::invokeDidReceiveResponse):
(WebCore::CurlRequest::setPaused):
(WebCore::CurlRequest::willSetupSslCtxCallback):
(WebCore::CurlRequest::willSendDataCallback):
(WebCore::CurlRequest::didReceiveHeaderCallback):
(WebCore::CurlRequest::didReceiveDataCallback):
* platform/network/curl/CurlRequest.h: Added.
(WebCore::CurlRequest::~CurlRequest):
(WebCore::CurlRequest::setDelegate):
(WebCore::CurlRequest::isSyncRequest):
(WebCore::CurlRequest::getNetworkLoadMetrics):
* platform/network/curl/CurlRequestDelegate.h: Added.
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::cancel):
(WebCore::ResourceHandle::platformSetDefersLoading):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
(WebCore::ResourceHandle::receivedCancellation):
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::ResourceHandleCurlDelegate):
(WebCore::ResourceHandleCurlDelegate::~ResourceHandleCurlDelegate):
(WebCore::ResourceHandleCurlDelegate::start):
(WebCore::ResourceHandleCurlDelegate::cancel):
(WebCore::ResourceHandleCurlDelegate::setDefersLoading):
(WebCore::ResourceHandleCurlDelegate::setAuthentication):
(WebCore::ResourceHandleCurlDelegate::dispatchSynchronousJob):
(WebCore::ResourceHandleCurlDelegate::createCurlRequest):
(WebCore::ResourceHandleCurlDelegate::cancelledOrClientless):
(WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
(WebCore::ResourceHandleCurlDelegate::curlDidReceiveBuffer):
(WebCore::ResourceHandleCurlDelegate::curlDidComplete):
(WebCore::ResourceHandleCurlDelegate::curlDidFailWithError):
(WebCore::ResourceHandleCurlDelegate::response):
(WebCore::ResourceHandleCurlDelegate::getCredential):
(WebCore::ResourceHandleCurlDelegate::retain): Deleted.
(WebCore::ResourceHandleCurlDelegate::release): Deleted.
(WebCore::ResourceHandleCurlDelegate::setupTransfer): Deleted.
(WebCore::ResourceHandleCurlDelegate::didCompleteTransfer): Deleted.
(WebCore::ResourceHandleCurlDelegate::didCancelTransfer): Deleted.
(WebCore::ResourceHandleCurlDelegate::setupAuthentication): Deleted.
(WebCore::ResourceHandleCurlDelegate::didReceiveAllHeaders): Deleted.
(WebCore::ResourceHandleCurlDelegate::didReceiveContentData): Deleted.
(WebCore::ResourceHandleCurlDelegate::handleLocalReceiveResponse): Deleted.
(WebCore::ResourceHandleCurlDelegate::prepareSendData): Deleted.
(WebCore::ResourceHandleCurlDelegate::didFinish): Deleted.
(WebCore::ResourceHandleCurlDelegate::didFail): Deleted.
(WebCore::ResourceHandleCurlDelegate::setupPOST): Deleted.
(WebCore::ResourceHandleCurlDelegate::setupPUT): Deleted.
(WebCore::ResourceHandleCurlDelegate::getFormElementsCount): Deleted.
(WebCore::ResourceHandleCurlDelegate::setupFormData): Deleted.
(WebCore::ResourceHandleCurlDelegate::applyAuthentication): Deleted.
(WebCore::ResourceHandleCurlDelegate::getNetworkLoadMetrics): Deleted.
(WebCore::ResourceHandleCurlDelegate::willSetupSslCtx): Deleted.
(WebCore::ResourceHandleCurlDelegate::didReceiveHeader): Deleted.
(WebCore::ResourceHandleCurlDelegate::didReceiveData): Deleted.
(WebCore::ResourceHandleCurlDelegate::willSendData): Deleted.
(WebCore::ResourceHandleCurlDelegate::willSetupSslCtxCallback): Deleted.
(WebCore::ResourceHandleCurlDelegate::didReceiveHeaderCallback): Deleted.
(WebCore::ResourceHandleCurlDelegate::didReceiveDataCallback): Deleted.
(WebCore::ResourceHandleCurlDelegate::willSendDataCallback): Deleted.
* platform/network/curl/ResourceHandleCurlDelegate.h:

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

2 years agoSplit some logic out of VisitedLinkStore and make it reusable
cdumez@apple.com [Fri, 29 Sep 2017 21:14:09 +0000 (21:14 +0000)]
Split some logic out of VisitedLinkStore and make it reusable
https://bugs.webkit.org/show_bug.cgi?id=177575

Reviewed by Alex Christensen.

Source/WebCore:

Rename LinkHash to SharedStringHash to make it more reusable.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/StyleResolver.cpp:
* dom/VisitedLinkState.cpp:
(WebCore::linkHashForElement):
(WebCore::VisitedLinkState::invalidateStyleForLink):
(WebCore::VisitedLinkState::determineLinkStateSlowCase):
* dom/VisitedLinkState.h:
* html/HTMLAnchorElement.h:
(WebCore::HTMLAnchorElement::visitedLinkHash const):
* loader/EmptyClients.cpp:
* loader/HistoryController.cpp:
(WebCore::addVisitedLink):
* page/Page.cpp:
(WebCore::Page::invalidateStylesForLink):
* page/Page.h:
* page/VisitedLinkStore.cpp:
(WebCore::VisitedLinkStore::invalidateStylesForLink):
* page/VisitedLinkStore.h:
* platform/SharedStringHash.cpp: Renamed from Source/WebCore/platform/LinkHash.cpp.
(WebCore::needsTrailingSlash):
(WebCore::computeSharedStringHashInline):
(WebCore::computeSharedStringHash):
* platform/SharedStringHash.h: Renamed from Source/WebCore/platform/LinkHash.h.
(WebCore::SharedStringHashHash::hash):
(WebCore::SharedStringHashHash::equal):
(WebCore::SharedStringHashHash::avoidDeletedValue):

Source/WebKit:

Split some logic out of VisitedLinkStore and make it reusable for other purposes than
visited links and from other processes than the UIProcess.

The plan is to reuse the new SharedStringHashStore for Service Worker registration
on StorageProcess side and querying on WebContent process side.

* CMakeLists.txt:
* Shared/SharedStringHashStore.cpp: Added.
(WebKit::nextPowerOf2):
(WebKit::tableSizeForKeyCount):
(WebKit::SharedStringHashStore::SharedStringHashStore):
(WebKit::SharedStringHashStore::createSharedMemoryHandle):
(WebKit::SharedStringHashStore::add):
(WebKit::SharedStringHashStore::clear):
(WebKit::SharedStringHashStore::resizeTable):
(WebKit::SharedStringHashStore::pendingSharedStringHashesTimerFired):
* Shared/SharedStringHashStore.h: Copied from Source/WebKit/WebProcess/WebPage/VisitedLinkTableController.h.
(WebKit::SharedStringHashStore::Client::~Client):
(WebKit::SharedStringHashStore::isEmpty const):
* Shared/SharedStringHashTable.cpp: Renamed from Source/WebKit/Shared/VisitedLinkTable.cpp.
(WebKit::SharedStringHashTable::SharedStringHashTable):
(WebKit::SharedStringHashTable::~SharedStringHashTable):
(WebKit::SharedStringHashTable::setSharedMemory):
(WebKit::SharedStringHashTable::add):
(WebKit::SharedStringHashTable::contains const):
(WebKit::SharedStringHashTable::clear):
* Shared/SharedStringHashTable.h: Renamed from Source/WebKit/Shared/VisitedLinkTable.h.
* UIProcess/API/C/WKContext.cpp:
(WKContextAddVisitedLink):
* UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
(-[_WKVisitedLinkStore addVisitedLinkWithURL:]):
* UIProcess/VisitedLinkStore.cpp:
(WebKit::VisitedLinkStore::VisitedLinkStore):
(WebKit::VisitedLinkStore::addProcess):
(WebKit::VisitedLinkStore::addVisitedLinkHash):
(WebKit::VisitedLinkStore::removeAll):
(WebKit::VisitedLinkStore::addVisitedLinkHashFromPage):
(WebKit::VisitedLinkStore::sendStoreHandleToProcess):
(WebKit::VisitedLinkStore::didInvalidateSharedMemory):
(WebKit::VisitedLinkStore::didAddSharedStringHashes):
* UIProcess/VisitedLinkStore.h:
* UIProcess/WebProcessPool.cpp:
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/VisitedLinkTableController.cpp:
(WebKit::VisitedLinkTableController::isLinkVisited):
(WebKit::VisitedLinkTableController::addVisitedLink):
(WebKit::VisitedLinkTableController::visitedLinkStateChanged):
* WebProcess/WebPage/VisitedLinkTableController.h:
* WebProcess/WebPage/VisitedLinkTableController.messages.in:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebVisitedLinkStore.h:
* WebCoreSupport/WebVisitedLinkStore.mm:
(WebVisitedLinkStore::addVisitedLink):
(WebVisitedLinkStore::removeVisitedLink):
(WebVisitedLinkStore::isLinkVisited):
(WebVisitedLinkStore::addVisitedLinkHash):

Source/WebKitLegacy/win:

* WebCoreSupport/WebVisitedLinkStore.cpp:
(WebVisitedLinkStore::addVisitedLink):
(WebVisitedLinkStore::isLinkVisited):
(WebVisitedLinkStore::addVisitedLinkHash):
* WebCoreSupport/WebVisitedLinkStore.h:

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

2 years agoAdd WKWebViewConfiguration SPI equivalent to WKPageConfigurationSetBackgroundCPULimit
achristensen@apple.com [Fri, 29 Sep 2017 20:50:13 +0000 (20:50 +0000)]
Add WKWebViewConfiguration SPI equivalent to WKPageConfigurationSetBackgroundCPULimit
https://bugs.webkit.org/show_bug.cgi?id=177644
<rdar://problem/34338698>

Reviewed by Geoffrey Garen.

WKPageConfigurationSetBackgroundCPULimit is a setter of a std::optional<double> with no accessor.
It's never set to 0 in practice, so I guess the ObjC equivalent is a double that is zero or nonzero.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration _setCPULimit:]):
(-[WKWebViewConfiguration _cpuLimit]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:

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

2 years agoWeb Inspector: Open Resource Dialog icons are blurry (24x24 instead of 32x32)
commit-queue@webkit.org [Fri, 29 Sep 2017 19:54:49 +0000 (19:54 +0000)]
Web Inspector: Open Resource Dialog icons are blurry (24x24 instead of 32x32)
https://bugs.webkit.org/show_bug.cgi?id=177631
<rdar://problem/34729636>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-09-29
Reviewed by Matt Baker.

* UserInterface/Views/OpenResourceDialog.css:
(.open-resource-dialog > .tree-outline.large .item):
(.open-resource-dialog > .tree-outline.large .item .icon):
(.open-resource-dialog .tree-outline.large .item .titles):
Make the rows large enough to fit the full 32x32 icon instead of a blurry 24x24.

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

2 years agoWeb Inspector: Uncaught exception with populate find keyboard shortcut
commit-queue@webkit.org [Fri, 29 Sep 2017 19:47:28 +0000 (19:47 +0000)]
Web Inspector: Uncaught exception with populate find keyboard shortcut
https://bugs.webkit.org/show_bug.cgi?id=177672

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-09-29
Reviewed by Matt Baker.

* UserInterface/Base/Main.js:
The focusedContentView can be null so bail if that is the case.

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

2 years ago[WinCairo] Fix build after rev 222610
don.olmstead@sony.com [Fri, 29 Sep 2017 19:32:49 +0000 (19:32 +0000)]
[WinCairo] Fix build after rev 222610
https://bugs.webkit.org/show_bug.cgi?id=177674

Reviewed by Per Arne Vollan.

No new tests. No change in behavior.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:

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

2 years ago[iOS] Remove unused pre-iOS 11 codepaths for writing to the pasteboard
wenson_hsieh@apple.com [Fri, 29 Sep 2017 18:53:23 +0000 (18:53 +0000)]
[iOS] Remove unused pre-iOS 11 codepaths for writing to the pasteboard
https://bugs.webkit.org/show_bug.cgi?id=177669

Reviewed by Tim Horton.

Now that PlatformPasteboardIOS codepaths for writing data on drag and copy have been unified to both use
NSItemProviders, we can remove the legacy codepath that called -setItems on UIPasteboard, since nothing uses it
any more. No change in behavior.

* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write):
(WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
(WebCore::PlatformPasteboard::allowReadingURLAtIndex const):
(WebCore::PlatformPasteboard::readURL):
(WebCore::richTextRepresentationsForPasteboardWebContent): Deleted.

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

2 years agoUnreviewed, rolling out r222563, r222565, and r222581.
commit-queue@webkit.org [Fri, 29 Sep 2017 18:49:37 +0000 (18:49 +0000)]
Unreviewed, rolling out r222563, r222565, and r222581.
https://bugs.webkit.org/show_bug.cgi?id=177675

"It causes a crash when playing youtube videos" (Requested by
saamyjoon on #webkit).

Reverted changesets:

"[DFG] Support ArrayPush with multiple args"
https://bugs.webkit.org/show_bug.cgi?id=175823
http://trac.webkit.org/changeset/222563

"Unreviewed, build fix after r222563"
https://bugs.webkit.org/show_bug.cgi?id=175823
http://trac.webkit.org/changeset/222565

"Unreviewed, fix x86 breaking due to exhausted registers"
https://bugs.webkit.org/show_bug.cgi?id=175823
http://trac.webkit.org/changeset/222581

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

2 years agoUnreviewed, temporarily mark http/tests/preconnect/link-rel-preconnect-https.html...
cdumez@apple.com [Fri, 29 Sep 2017 18:48:30 +0000 (18:48 +0000)]
Unreviewed, temporarily mark http/tests/preconnect/link-rel-preconnect-https.html as flaky.

* platform/wk2/TestExpectations:

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

2 years agoImage pasting is not working on tineye.com / gmail.com / GitHub.com due to lack of...
rniwa@webkit.org [Fri, 29 Sep 2017 18:46:51 +0000 (18:46 +0000)]
Image pasting is not working on tineye.com / gmail.com / GitHub.com due to lack of support for DataTransfer.items
https://bugs.webkit.org/show_bug.cgi?id=170449
<rdar://problem/31432525>

Reviewed by Wenson Hsieh.

Source/WebCore:

The bug was caused by image types in NSPasteboard or UIPasteboard not being treated as file items in dataTransfer.
Because there is no Web API to get binary data out of dataTransfer unlike text data, we need to treat any image
data as files even if they're entirely in the memory.

This patch introduces the notion of pasteboard types to be treated as files and expose them on dataTransfer.files
as well as dataTransfer.items of type "file". Because in-memory images are stored as TIFF in macOS and websites
don't typically support image/tiff, we convert all such in-memory TIFF images into PNG images ourselves for
a better web compatibility. This is done inside read(PasteboardFileReader&) in PasteboardCocoa.mm.

Note that PasteboardFileReader cannot directly have RefPtr<File> as a member variable as code in WebCore/platform
including Pasteboard code is not supposed to depend on WebCore types. WebCorePasteboardFileReader, a subclass of
PasteboardFileReader was introduced to resolve this reverse dependency.

In addition, this patch removes the restriction on dataTransfer.items that it only includes files of the supported
MIME types. This was unwarranted since 1. we don't have any restriction on what an user can drag & drop into a web
page via input element so there is no security benefit in this, and 2. the user should be able to copy & paste
whatever file he/she desires regardless of the MIME type on websites like Google Drive.

Tests: PasteImage

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* WebCore/PlatformMac.cmake:
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::types const): Now excludes image/gif, image/png, image/jpeg, and image/tiff.
(WebCore::DataTransfer::files const): Add fake files we create for in-memory images but only when there are no real
files in the pasteboard since it's expensive to copy image data across UI/Web processes to create a blob URL.
* dom/DataTransferItemList.cpp:
(WebCore::DataTransferItemList::ensureItems const): Just expose every file type. If the user had decided to paste
a file, it's okay for the page to access that file regardless of whether it's a zip file, JPEG image, etc...
* editing/WebCorePasteboardFileReader.cpp:
(WebCorePasteboardFileReader::~WebCorePasteboardFileReader):
(WebCorePasteboardFileReader::read):
* editing/WebCorePasteboardFileReader.h:
(WebCorePasteboardFileReader):
* platform/Pasteboard.cpp:
(WebCore::PasteboardImage::PasteboardImage): Moved from platform specific translation units.
(WebCore::PasteboardImage::~PasteboardImage): Ditto.
* platform/Pasteboard.h:
(PasteboardFileReader): Added.
(* platform/StaticPasteboard.h:
(StaticPasteboard::typesForBindings): Added.
(StaticPasteboard::typesTreatedAsFiles): Added. Returns an empty list we don't support the web content writing image
files into pasteboard at the moment.
* platform/cocoa/PasteboardCocoa.mm: Added.
(WebCore::PasteboardWebContent::PasteboardWebContent): Moved from PasteboardMac.mm and PasteboardIOS.mm.
(WebCore::PasteboardWebContent::~PasteboardWebContent):
(WebCore::cocoaTypeToImageType): Added.
(WebCore::imageTypeToMIMEType): Added. Pretends to have image/png when the Cocoa type is image/tiff since most of
websites don't support image/tiff.
(WebCore::imageTypeToFakeFilename): Added.
(WebCore::mimeTypeToImageType): Added.
(WebCore::Pasteboard::shouldTreatCocoaTypeAsFile): Added. Pasteboard::typesForBindings excludes the type for which
this function returns true.
(WebCore::Pasteboard::typesTreatedAsFiles): Returns the list of all in-memory image types in the pasteboard.
(WebCore::Pasteboard::read): Added. On macOS, we convert TIFF to PNG for web compatibility. We don't do this rather
memory intensive coercion on iOS where most of apps like Photos put PNG file into the pasteboard in the first place.
* platform/gtk/PasteboardGtk.cpp:
(WebCore::PasteboardImage::PasteboardImage): Deleted.
(WebCore::PasteboardImage::~PasteboardImage): Deleted.
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::typesForBindings): Renamed from types.
(WebCore::Pasteboard::typesTreatedAsFiles):
* platform/ios/PasteboardIOS.mm:
(WebCore::addHTMLClipboardTypesForCocoaType):
(WebCore::Pasteboard::typesForBindings):
(WebCore::PasteboardWebContent::PasteboardWebContent): Deleted.
(WebCore::PasteboardWebContent::~PasteboardWebContent): Deleted.
(WebCore::PasteboardImage::PasteboardImage): Deleted.
(WebCore::PasteboardImage::~PasteboardImage): Deleted.
(WebCore::Pasteboard::types): Deleted.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::safeTypeForDOMToReadAndWriteForPlatformType): Add "Files" to dataTransfer.types when there is an in-memory
image type in the pasteboard.
* platform/mac/PasteboardMac.mm:
(WebCore::PasteboardWebContent::PasteboardWebContent): Deleted.
(WebCore::PasteboardWebContent::~PasteboardWebContent): Deleted.
(WebCore::PasteboardImage::PasteboardImage): Deleted.
(WebCore::PasteboardImage::~PasteboardImage): Deleted.
(WebCore::addHTMLClipboardTypesForCocoaType): Moved the check for the legacy NeXT plain text check here. Also add
"Files" to dataTransfer.types when there is an in-memory image type in the pasteboard.
(WebCore::Pasteboard::typesForBindings): Renamed from types.
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::safeTypeForDOMToReadAndWriteForPlatformType): Ditto to add "Files".
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::typesForBindings): Renamed from types.
(WebCore::Pasteboard::typesTreatedAsFiles):
(WebCore::Pasteboard::read):
* platform/wpe/PasteboardWPE.cpp:
(WebCore::Pasteboard::typesForBindings): Renamed from types.
(WebCore::Pasteboard::typesTreatedAsFiles):
(WebCore::Pasteboard::read):

Source/WebKit:

Add sandbox extensions for files in the pasteboard to make copying & pasting image files work.
This is what we do for drag & drop but we should consider adding a mechanism to rekoke the extension in the future.

* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::getPasteboardPathnamesForType): Add sandbox extensions to the pasted files.
* UIProcess/WebPasteboardProxy.h:
* UIProcess/WebPasteboardProxy.messages.in:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::getPathnamesForType): Consume the sandbox tokens sent by the UI process permanently
since WebCore will now create File objects for these pasted files.

Tools:

Added an API test to paste an image from pasteboard. The test is shared between iOS and macOS.

The tests to paste image files are only enabled on macOS since putting files into pasteboard isn't a thing on iOS.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/PasteImage.mm: Added.
(writeImageDataToPasteboard):
(writeBundleFileToPasteboard):
* TestWebKitAPI/Tests/WebKitCocoa/paste-image.html: Added.
* TestWebKitAPI/Tests/WebKitCocoa/sunset-in-cupertino-100px.tiff: Added.
* TestWebKitAPI/Tests/WebKitCocoa/sunset-in-cupertino-200px.png: Added.
* TestWebKitAPI/Tests/WebKitCocoa/sunset-in-cupertino-400px.gif: Added.
* TestWebKitAPI/Tests/WebKitCocoa/sunset-in-cupertino-600px.jpg: Added.
* TestWebKitAPI/Tests/ios/DataInteractionTests.mm: Rebaselined the test now that types contain "Files".

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

2 years agoRe-enable more pasteboard tests on iOS after r222595
rniwa@webkit.org [Fri, 29 Sep 2017 18:37:28 +0000 (18:37 +0000)]
Re-enable more pasteboard tests on iOS after r222595
https://bugs.webkit.org/show_bug.cgi?id=177637

Reviewed by Wenson Hsieh.

* platform/ios/TestExpectations:

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

2 years ago[iOS WK2] Implement -[WKContentView hasText] for compatibility with the UITextInput...
wenson_hsieh@apple.com [Fri, 29 Sep 2017 18:33:32 +0000 (18:33 +0000)]
[iOS WK2] Implement -[WKContentView hasText] for compatibility with the UITextInput protocol
https://bugs.webkit.org/show_bug.cgi?id=177662
<rdar://problem/33410373>

Reviewed by Tim Horton.

Source/WebCore:

Adds a new TextIterator helper function to determine whether a Range has any plain text.

Tests: EditorStateTests.ContentViewHasTextInContentEditableElement
       EditorStateTests.ContentViewHasTextInTextarea

* editing/TextIterator.cpp:
(WebCore::hasAnyPlainText):

Add a new helper to determine whether a Range contains any plain text. While inspired by and very similar to the
plainText() helper function, this variant does not create a new string buffer when invoked, and is therefore
more efficient for the purposes of determining whether there is any plain text at all.

* editing/TextIterator.h:

Source/WebKit:

Implements -[WKContentView hasText] by propagating a flag through post-layout editor state.

* Shared/EditorState.cpp:
(WebKit::EditorState::PostLayoutData::encode const):
(WebKit::EditorState::PostLayoutData::decode):
* Shared/EditorState.h:

Add a new flag to EditorState indicating whether or not the current editable root containing the selection has
any plain text. Add IPC support for this new flag.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView hasText]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::computeEditableRootHasContentAndPlainText):

Add a new helper to compute whether or not the editable root has any content, and any plain text. This
is used as the last cached value for -hasText on WKContentView that we will deliver to UIKit. Some important
things to note here:
- If post layout data already indicates that we have selected some plain text, or that there is a plain text
  character near the selection, just set the flags to true and bail, since the editable root necessarily has
  content that is plain text.
- If hasContent is false, don't even bother computing hasPlainText, because it must also be false.
- Otherwise, use hasAnyPlainText to compute the value of hasPlainText, which is a faster variant of plainText.
These optimizations help us avoid doing extra work at all when running Speedometer, apart from checking the
values of a few PostLayoutData flags. This also fixes the value of hasContent, which was previously always false
if we had a range selection rather than a caret selection even when the editable root has content, because the
logic to compute the value of hasContent only existed in the branch where we have a caret selection.

(WebKit::WebPage::platformEditorState const):

Tools:

Add EditorState API tests to check that the value of -[WKContentView hasText] is correct when editing both plain
and rich text areas.

* TestWebKitAPI/EditingTestHarness.h:
* TestWebKitAPI/EditingTestHarness.mm:
(-[EditingTestHarness insertParagraph]):
(-[EditingTestHarness insertText:]):
(-[EditingTestHarness insertHTML:]):
(-[EditingTestHarness selectAll]):
(-[EditingTestHarness deleteBackwards]):
* TestWebKitAPI/Tests/WebKitCocoa/EditorStateTests.mm:

Add versions of EditingTestHarness helpers that don't require us to expect any editor state after executing the
edit command.

(TestWebKitAPI::checkContentViewHasTextWithFailureDescription):
(TestWebKitAPI::TEST):
* TestWebKitAPI/cocoa/TestWKWebView.h:
* TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[TestWKWebView textInputContentView]):

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

2 years agoAdd WeakPtr support to RenderObject.
zalan@apple.com [Fri, 29 Sep 2017 17:50:59 +0000 (17:50 +0000)]
Add WeakPtr support to RenderObject.
https://bugs.webkit.org/show_bug.cgi?id=177429
<rdar://problem/34625212>

Reviewed by Dean Jackson.

This is in preparation to start using weak pointers extensively in rendering.

No change in functionality.

* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::loadPlugin):
* page/FrameView.cpp:
(WebCore::FrameView::updateEmbeddedObject):
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
* rendering/RenderMultiColumnSpannerPlaceholder.h:
* rendering/RenderObject.cpp:
* rendering/RenderObject.h:
(WebCore::RenderObject::createWeakPtr):
* rendering/RenderView.cpp:
(WebCore::RenderView::RepaintRegionAccumulator::RepaintRegionAccumulator):
(WebCore::RenderView::RepaintRegionAccumulator::~RepaintRegionAccumulator):
* rendering/RenderView.h:
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::setWidgetGeometry):
(WebCore::RenderWidget::setWidget):
(WebCore::RenderWidget::updateWidgetPosition):
* rendering/RenderWidget.h:
(WebCore::RenderWidget::createWeakPtr): Deleted.

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

2 years agoBuild libwebrtc unit tests executables
commit-queue@webkit.org [Fri, 29 Sep 2017 17:05:37 +0000 (17:05 +0000)]
Build libwebrtc unit tests executables
https://bugs.webkit.org/show_bug.cgi?id=177211

Patch by Youenn Fablet <youenn@apple.com> on 2017-09-29
Reviewed by Alex Christensen.

.:

* WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme:

Source/ThirdParty/libwebrtc:

Adding support for a new target called unittests that will be several executables.
Each executable run unit tests dedicated to a part of libwebrtc.

Adding one target/executable per unit test suite.
Adding one composite target to build all unit test targets.
Adding a target to build a static libwebrtctest library.
The static libwebrtctest library is then linked to each unit test executable which is also linked to libwebrtc dylib.

Some unit tests require a default codec (VP8) that is disabled in libwebrtc.
This ends up making some tests crashing.
An additional work should follow to execute only the meaningful subset of tests.

* Configurations/libwebrtc-base.xcconfig: Added.
* Configurations/libwebrtc-test-static.xcconfig: Added.
* Configurations/rtc_pc_unittests.xcconfig: Added.
* Source/third_party/gflags/gen/posix/include/private/config.h:
* Source/webrtc/modules/audio_coding/neteq/tools/neteq_test.cc: Replacing FATAL by RTC_FATAL.
* Source/webrtc/sdk/objc/Framework/Classes/Common/helpers.mm: Removing UIKit dependency.
* Source/webrtc/test/gmock.h: Using googletest version instead of checking in testing folder.
* Source/webrtc/test/gtest.h: Ditto.
* Source/webrtc/test/rtp_file_reader.cc: Replacing FATAL by RTC_FATAL.
* libwebrtc.xcodeproj/project.pbxproj:

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

2 years agoUnreviewed, rolling out r222625.
commit-queue@webkit.org [Fri, 29 Sep 2017 16:47:42 +0000 (16:47 +0000)]
Unreviewed, rolling out r222625.
https://bugs.webkit.org/show_bug.cgi?id=177664

causes crashes on iOS (Requested by pizlo-mbp on #webkit).

Reverted changeset:

"Enable gigacage on iOS"
https://bugs.webkit.org/show_bug.cgi?id=177586
http://trac.webkit.org/changeset/222625

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

2 years agoUpdate my status.
cturner@igalia.com [Fri, 29 Sep 2017 12:33:46 +0000 (12:33 +0000)]
Update my status.

Unreviewed.

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

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

2 years ago[GStreamer] Refactor media player to use MediaTime consistently
eocanha@igalia.com [Fri, 29 Sep 2017 10:22:12 +0000 (10:22 +0000)]
[GStreamer] Refactor media player to use MediaTime consistently
https://bugs.webkit.org/show_bug.cgi?id=174817

Reviewed by Xabier Rodriguez-Calvar.

Make consistent use of the MediaTime class in the GStreamer media
player implementations.

This patch is authored by Charlie Turner <cturner@igalia.com> plus
some minor modifications by Enrique: migration of m_cachedPosition,
usage of m_seekTime as MediaTime in the MSE player and more logging
using toString().

Covered by existing tests.

* platform/graphics/gstreamer/GStreamerUtilities.cpp:
(WebCore::toGstUnsigned64Time): Scales MediaTime to the precision used
by GStreamer and returns a value compatible with GstClockTime.
(WebCore::toGstClockTime): Deleted.
* platform/graphics/gstreamer/GStreamerUtilities.h:
(WebCore::toGstClockTime): Inlined, now it takes MediaTime and converts
to GstClockTime.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
Several changes to use MediaTime instead of float and to log MediaTime
values converting them toString().
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::load):
(WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
(WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const):
(WebCore::MediaPlayerPrivateGStreamer::currentMediaTime const):
(WebCore::MediaPlayerPrivateGStreamer::seek): Uses MediaTime.
(WebCore::MediaPlayerPrivateGStreamer::doSeek):
(WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
(WebCore::MediaPlayerPrivateGStreamer::buffered const):
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
(WebCore::MediaPlayerPrivateGStreamer::maxMediaTimeSeekable const):
(WebCore::MediaPlayerPrivateGStreamer::maxTimeLoaded const):
(WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const):
(WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
(WebCore::MediaPlayerPrivateGStreamer::updateStates):
(WebCore::MediaPlayerPrivateGStreamer::didEnd):
(WebCore::MediaPlayerPrivateGStreamer::durationChanged):
(WebCore::MediaPlayerPrivateGStreamer::maxTimeSeekable const): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Changed
seek(), playBackposition(), m_cachedPosition, m_durationAtEOS,
m_seekTime and m_timeOfOverlappingSeek to be of MediaTime type.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
Prefer the methods based on MediaTime over those based on fload/double.
(WebCore::MediaPlayerPrivateGStreamerBase::maxTimeLoaded const):
* platform/graphics/gstreamer/mse/GStreamerMediaSample.cpp:
(WebCore::GStreamerMediaSample::offsetTimestampsBy): toGstClockTime()
now can handle MediaTime.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
Several changes to use MediaTime instead of float and to log MediaTime
values converting them toString().
(WebCore::MediaPlayerPrivateGStreamerMSE::seek):
(WebCore::MediaPlayerPrivateGStreamerMSE::notifySeekNeedsDataForTime):
(WebCore::MediaPlayerPrivateGStreamerMSE::doSeek):
(WebCore::MediaPlayerPrivateGStreamerMSE::maybeFinishSeek):
(WebCore::MediaPlayerPrivateGStreamerMSE::isTimeBuffered const):
(WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
(WebCore::MediaPlayerPrivateGStreamerMSE::currentMediaTime const):
(WebCore::MediaPlayerPrivateGStreamerMSE::maxTimeSeekable const):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
seek() now takes a MediaTime argument.
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::enqueueSample): Use MediaTime values in
MediaSample.
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
(webKitMediaSrcQueryWithParent): Use MediaTime values in
durationMediaTime().

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

2 years agoUpdate syncing script to be able to build binary for commit set with owned commits.
dewei_zhu@apple.com [Fri, 29 Sep 2017 07:34:41 +0000 (07:34 +0000)]
Update syncing script to be able to build binary for commit set with owned commits.
https://bugs.webkit.org/show_bug.cgi?id=177225

Reviewed by Ryosuke Niwa.

Added support for syncing script to be able to schedule builds to build binary for owned commits.
Introduces 'ifRepositorySet' and 'ownedRevisions' in 'buildProperties'.
'ifRepositorySet' will conditionaly set a build property if at least one of the repositories it specified requires build.
'ownedRevisions' specifies owned commits revision informations.

* public/v3/models/commit-set.js:
(CommitSet): Added '_ownerRepositoryToOwnedRepositoriesMap'.
(CommitSet.prototype.updateSingleton): Reset '_ownerRepositoryToOwnedRepositoriesMap'.
(CommitSet.prototype._updateFromObject): Only update '_repositoryToCommitOwnerMap' and '_ownerRepositoryToOwnedRepositoriesMap' when 'commitOwner' exists.
(CommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories.
(CommitSet.prototype.ownedRepositoriesForOwnerRepository): Returns owned repositories given a owner repository.
(CustomCommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories.
* public/v3/models/triggerable.js:
(prototype.accepts): It should only check against top-level repositories. Removed a deprecated 'FIXME'.
* server-tests/tools-sync-buildbot-integration-tests.js: Added unit test for building owned commits binary.
(createTriggerable): Added conditional 'ifRepositorySet' and 'ownedRevisions' in the repository groups.
* tools/js/buildbot-syncer.js:
(BuildbotSyncer.prototype._propertiesForBuildRequest):
    Added logic to conditionaly create build property for 'ifRepositorySet'.
    Added logic to create 'ownedRevisions' based on the owner repositories it specified.
(BuildbotSyncer._parseRepositoryGroup): Build property template should be able to handle 'ifRepositorySet' and 'ownedRevisions'.
* unit-tests/buildbot-syncer-tests.js: Added unit tests for 'ifRepositorySet' and 'ownedRevisions'.
* unit-tests/commit-set-tests.js: Added unit tests for 'topLevelRepositoriesSortedByNamePreferringOnesWithURL'.
* unit-tests/resources/mock-v3-models.js: Added a repository group contains 'ios', 'webkit' and 'ownerRepository'.

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

2 years agoRe-write Settings generation in python for some reason
commit-queue@webkit.org [Fri, 29 Sep 2017 05:37:57 +0000 (05:37 +0000)]
Re-write Settings generation in python for some reason
https://bugs.webkit.org/show_bug.cgi?id=177621

Patch by Sam Weinig <sam@webkit.org> on 2017-09-28
Reviewed by Tim Horton.

Re-writes and splits up generation of InternalSettingsGenerated.{h|cpp|idl}
and SettingsMacros.h in python in preparation for larger changes.

* DerivedSources.make:
* Scripts/GenerateSettings: Added.
* Scripts/GenerateSettings.py: Added.
* Scripts/GenerateSettings/GenerateInternalSettingsHeaderFile.py: Added.
* Scripts/GenerateSettings/GenerateInternalSettingsIDLFile.py: Added.
* Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py: Added.
* Scripts/GenerateSettings/GenerateSettings.py: Added.
* Scripts/GenerateSettings/GenerateSettingsMacrosHeader.py: Added.
* Scripts/GenerateSettings/Settings.py: Added.
* Scripts/GenerateSettings/__init__.py: Added.
* WebCore.xcodeproj/project.pbxproj:
* page/make_settings.pl: Removed.

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

2 years agoFix the macOS CMake build
timothy_horton@apple.com [Fri, 29 Sep 2017 03:07:21 +0000 (03:07 +0000)]
Fix the macOS CMake build

* CMakeLists.txt:

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

2 years agoMerge the latest version of Speedometer 2.0 to browserbench.org against at r222534.
rniwa@webkit.org [Fri, 29 Sep 2017 02:42:46 +0000 (02:42 +0000)]
Merge the latest version of Speedometer 2.0 to browserbench.org against at r222534.

Rubber-stamped by Saam Barati (a while ago).

* Speedometer2.0: Replaced with PerformanceTests/Speedometer.

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

2 years ago[GTK] Test gardening
clopez@igalia.com [Fri, 29 Sep 2017 02:35:27 +0000 (02:35 +0000)]
[GTK] Test gardening
https://bugs.webkit.org/show_bug.cgi?id=177635

Unreviewed test gardening.

* platform/gtk/TestExpectations:

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

2 years agoClean up Long Press Selection Tests
megan_gardner@apple.com [Fri, 29 Sep 2017 02:22:22 +0000 (02:22 +0000)]
Clean up Long Press Selection Tests
https://bugs.webkit.org/show_bug.cgi?id=177636

Reviewed by Tim Horton.

Clean up tests to use better methods of finding selection locations so that
tests are more robust and less likely to be affected by unrelated changes.

* fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text.html:
* fast/events/touch/ios/long-press-then-drag-left-to-change-selected-text.html:
* fast/events/touch/ios/long-press-then-drag-right-to-change-selected-text.html:
* fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text.html:
* fast/events/touch/ios/long-press-to-select-and-tap-to-clear-expected.txt:
* fast/events/touch/ios/long-press-to-select-and-tap-to-clear.html:
* fast/events/touch/ios/long-press-to-select-text-expected.txt:
* fast/events/touch/ios/long-press-to-select-text.html:
* fast/events/touch/ios/resources/basic-gestures.js:
(longPressAtPoint):
(tapAtPoint):
(touchAndDragFromPointToPoint):
(pressAtPoint): Deleted.
(dragFromPointToPoint): Deleted.

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

2 years agoSimplify PLATFORM ifdefs within Editor around writing selections
don.olmstead@sony.com [Fri, 29 Sep 2017 00:15:30 +0000 (00:15 +0000)]
Simplify PLATFORM ifdefs within Editor around writing selections
https://bugs.webkit.org/show_bug.cgi?id=177624

Reviewed by Alex Christensen.

No new tests. No change in behavior.

* editing/Editor.cpp:
(WebCore::Editor::performCutOrCopy):
(WebCore::Editor::copyImage):
* editing/Editor.h:

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

2 years agoUnreviewed, rolling out r222639.
commit-queue@webkit.org [Fri, 29 Sep 2017 00:15:19 +0000 (00:15 +0000)]
Unreviewed, rolling out r222639.
https://bugs.webkit.org/show_bug.cgi?id=177630

Breaks AppleWin build (Requested by dolmstead on #webkit).

Reverted changeset:

"[WinCairo][MiniBrowser] Add ca-bundle to display secure
pages."
https://bugs.webkit.org/show_bug.cgi?id=168486
http://trac.webkit.org/changeset/222639

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

2 years agoAX: [ATK] object:state-changed notifications missing for multiple ARIA attributes
jdiggs@igalia.com [Fri, 29 Sep 2017 00:13:13 +0000 (00:13 +0000)]
AX: [ATK] object:state-changed notifications missing for multiple ARIA attributes
https://bugs.webkit.org/show_bug.cgi?id=177542

Source/WebCore:

Add new notification types to AXObjectCache in order to support the notifications
needed, post the notifications to all platforms, emit the signals for ATK.

Reviewed by Chris Fleizach.

Tests: accessibility/gtk/aria-disabled-changed-notification.html
       accessibility/gtk/aria-expanded-changed-notification.html
       accessibility/gtk/aria-pressed-changed-notification.html
       accessibility/gtk/aria-readonly-changed-notification.html
       accessibility/gtk/aria-required-changed-notification.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::handleAttributeChanged):
* accessibility/AXObjectCache.h:
* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::postPlatformNotification):

Tools:

Add platform support for the notifications. Also add support for getting the
boolean argument indicating whether the state has been set or unset.

Reviewed by Chris Fleizach.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:

LayoutTests:

Reviewed by Chris Fleizach.

* accessibility/gtk/aria-disabled-changed-notification-expected.txt: Added.
* accessibility/gtk/aria-disabled-changed-notification.html: Added.
* accessibility/gtk/aria-expanded-changed-notification-expected.txt: Added.
* accessibility/gtk/aria-expanded-changed-notification.html: Added.
* accessibility/gtk/aria-pressed-changed-notification-expected.txt: Added.
* accessibility/gtk/aria-pressed-changed-notification.html: Added.
* accessibility/gtk/aria-readonly-changed-notification-expected.txt: Added.
* accessibility/gtk/aria-readonly-changed-notification.html: Added.
* accessibility/gtk/aria-required-changed-notification-expected.txt: Added.
* accessibility/gtk/aria-required-changed-notification.html: Added.

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

2 years ago[WinCairo][MiniBrowser] Add ca-bundle to display secure pages.
commit-queue@webkit.org [Thu, 28 Sep 2017 23:52:57 +0000 (23:52 +0000)]
[WinCairo][MiniBrowser] Add ca-bundle to display secure pages.
Copy cacert.pem file into bundle directory.
https://bugs.webkit.org/show_bug.cgi?id=168486

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-09-28
Reviewed by Brent Fulgham.

* MiniBrowser/win/CMakeLists.txt:

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

2 years agotest262: Unexpected passes after r222617 and r222618.
mark.lam@apple.com [Thu, 28 Sep 2017 23:32:53 +0000 (23:32 +0000)]
test262: Unexpected passes after r222617 and r222618.
https://bugs.webkit.org/show_bug.cgi?id=177622
<rdar://problem/34725960>

Reviewed by Saam Barati.

JSTests:

Update test262.yaml for tests that are now passing.

* test262.yaml:

Source/JavaScriptCore:

Now that these tests are marked as "normal", we will run them and discover a few
missing exception checks.  This patch also adds those missing exception checks.

* runtime/DatePrototype.cpp:
(JSC::fillStructuresUsingDateArgs):

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

2 years agoRemove TextRun::setCharactersLength() and TextRun::charactersLength()
dbates@webkit.org [Thu, 28 Sep 2017 23:08:27 +0000 (23:08 +0000)]
Remove TextRun::setCharactersLength() and TextRun::charactersLength()
https://bugs.webkit.org/show_bug.cgi?id=177620

Reviewed by Zalan Bujtas.

The purpose of TextRun::setCharactersLength() and TextRun::charactersLength() predate the
use of WidthIterator to safely iterate over characters in a TextRun that may contain
surrogate halves due to how it was created (without thought of surrogate pairs). Historically
TextRun::charactersLength() complemented TextRun::length() and represented the length of the
text to render ignoring and respecting truncation, respectively. We not longer need either
of these member functions with the advent of WidthIterator.

No functionality changed. So, no new tests.

* platform/graphics/ComplexTextController.cpp:
(WebCore::TextLayout::constructTextRun):
* platform/graphics/TextRun.cpp: Remove one unsigned field from ExpectedTextRunSize as we
reduced the size of TextRun with the removal of TextRun::m_charactersLength.
* platform/graphics/TextRun.h:
(WebCore::TextRun::TextRun):
(WebCore::TextRun::charactersLength const): Deleted.
(WebCore::TextRun::setCharactersLength): Deleted.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::constructTextRun const):
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::constructTextRun): Deleted overload that took const RenderStyle& style
and StringView.
* rendering/RenderText.cpp:
(WebCore::RenderText::widthFromCache const):
(WebCore::maxWordFragmentWidth):
(WebCore::RenderText::computePreferredLogicalWidths):
(WebCore::RenderText::width const):
* rendering/line/BreakingContext.h:
(WebCore::textWidth):
(WebCore::tryHyphenating):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::constructTextRun const):
* rendering/svg/SVGTextMetrics.cpp:
(WebCore::SVGTextMetrics::constructTextRun):
* rendering/svg/SVGTextMetricsBuilder.cpp:
(WebCore::SVGTextMetricsBuilder::currentCharacterStartsSurrogatePair const): Use TextRun::length().
(WebCore::SVGTextMetricsBuilder::advance): Ditto.

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

2 years agoWebInspector: Uncaught Exception: TypeError: this._delegate.completionControllerCSSFu...
webkit@devinrousso.com [Thu, 28 Sep 2017 23:04:05 +0000 (23:04 +0000)]
WebInspector: Uncaught Exception: TypeError: this._delegate.completionControllerCSSFunctionValuesNeeded is not a function.
https://bugs.webkit.org/show_bug.cgi?id=177619

Reviewed by Joseph Pecoraro.

* UserInterface/Controllers/CodeMirrorCompletionController.js:
(WI.CodeMirrorCompletionController.prototype._generateCSSCompletions):
Remove accidental `typeof` keyword.

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