WebKit-https.git
3 years agoMediaKeySession: use existing 'message' event name
zandobersek@gmail.com [Tue, 17 Jan 2017 10:11:09 +0000 (10:11 +0000)]
MediaKeySession: use existing 'message' event name
https://bugs.webkit.org/show_bug.cgi?id=167095

Reviewed by Sam Weinig.

When dispatching the 'message' event in MediaKeySession::enqueueMessage(),
use the messageEvent member that's provided by the EventNames object. This
removes the need for a custom static AtomicString object.

* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::enqueueMessage):
(WebCore::messageEventName): Deleted.

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

3 years agoRemove the REQUEST_ANIMATION_FRAME flag
commit-queue@webkit.org [Tue, 17 Jan 2017 06:20:56 +0000 (06:20 +0000)]
Remove the REQUEST_ANIMATION_FRAME flag
https://bugs.webkit.org/show_bug.cgi?id=156980
<rdar://problem/25906849>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-16
Reviewed by Simon Fraser.

.:

* Source/cmake/OptionsEfl.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/tools/vsprops/FeatureDefines.props:
* Source/cmake/tools/vsprops/FeatureDefinesCairo.props:

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:
* dom/Document.cpp:
* dom/Document.h:
* dom/RequestAnimationFrameCallback.idl:
* dom/ScriptedAnimationController.cpp:
* dom/ScriptedAnimationController.h:
* loader/EmptyClients.h:
* page/Chrome.cpp:
* page/Chrome.h:
* page/ChromeClient.h:
* page/DOMWindow.cpp:
* page/DOMWindow.h:
* page/DOMWindow.idl:
* page/FrameView.cpp:
* page/FrameView.h:
* page/animation/AnimationController.cpp:
* page/animation/AnimationController.h:
* page/animation/AnimationControllerPrivate.h:
* platform/HostWindow.h:
* platform/ScrollAnimationSmooth.h:
* testing/Internals.cpp:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::syncDisplayState):
(WebKit::CompositingCoordinator::nextAnimationServiceTime):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::scheduleAnimation):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
* WebProcess/WebPage/LayerTreeHost.h:

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

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

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

3 years ago[QuickLook] QLPreviewConverter should be owned by its delegate
aestes@apple.com [Tue, 17 Jan 2017 03:53:57 +0000 (03:53 +0000)]
[QuickLook] QLPreviewConverter should be owned by its delegate
https://bugs.webkit.org/show_bug.cgi?id=167104

Reviewed by Andreas Kling.

Instead of having QuickLookHandle own both the QLPreviewConverter and its delegate, have it
just own the delegate and have the delegate own the QLPreviewConverter.

No change in behavior. Covered by existing tests.

* loader/ios/QuickLook.h:
(WebCore::QuickLookHandle::converter): Moved out-of-line.
* loader/ios/QuickLook.mm: Renamed WebPreviewConverterDelegate to WebPreviewConverter, and
gave it ownership of the QLPreviewConverter, QuickLookHandleClient, and preview response.
(-[WebPreviewConverter initWithResourceLoader:resourceResponse:quickLookHandle:]):
Added a ResourceResponse parameter.
(-[WebPreviewConverter setClient:]): Moved from QuickLookHandle::setClient().
(-[WebPreviewConverter appendDataArray:]): Moved from QuickLookHandle::didReceiveDataArray().
(-[WebPreviewConverter finishedAppending]): Moved from QuickLookHandle::didFinishLoading().
(-[WebPreviewConverter failed]): Moved from QuickLookHandle::didFail().
(-[WebPreviewConverter platformConverter]): Added to return the QLPreviewConverter.
(-[WebPreviewConverter _sendDidReceiveResponseIfNecessary]): Used _previewResponse directly.
(WebCore::QuickLookHandle::~QuickLookHandle): Removed unneeded logging.
(WebCore::QuickLookHandle::didReceiveData): Called -[WebPreviewConverter appendDataArray:].
(WebCore::QuickLookHandle::didReceiveBuffer): Ditto.
(WebCore::QuickLookHandle::didFinishLoading): Called -[WebPreviewConverter finishedAppending].
(WebCore::QuickLookHandle::didFail): Called -[WebPreviewConverter failed].
(WebCore::QuickLookHandle::setClient): Called -[WebPreviewConverter setClient:].
(WebCore::QuickLookHandle::previewFileName): Retrieved the QLPreviewConverter via
-[WebPreviewConverter platformConverter].
(WebCore::QuickLookHandle::previewUTI): Ditto.
(WebCore::QuickLookHandle::previewRequestURL): Ditto.
(WebCore::QuickLookHandle::converter): Ditto.
(WebCore::QuickLookHandle::didReceiveDataArray): Deleted.
(WebCore::QuickLookHandle::previewResponse): Deleted.

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

3 years agoCrashTracer: com.apple.WebKit.WebContent at JavaScriptCore: WTF::StringImpl::contains...
antti@apple.com [Tue, 17 Jan 2017 03:47:43 +0000 (03:47 +0000)]
CrashTracer: com.apple.WebKit.WebContent at JavaScriptCore: WTF::StringImpl::containsOnlyWhitespace
https://bugs.webkit.org/show_bug.cgi?id=167106
<rdar://problem/24457632>

Reviewed by Tim Horton.

Speculative fix.

* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::detectContentInRange):

    Test before casting to Text.

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

3 years ago[GTK][MSE] Update list of media-source tests that fail.
clopez@igalia.com [Tue, 17 Jan 2017 03:42:20 +0000 (03:42 +0000)]
[GTK][MSE] Update list of media-source tests that fail.

Unskip imported/w3c/web-platform-tests/media-source tests for WebKitGTK+
Report the list of those tests that fail.
Rebase imported/w3c/web-platform-tests/media-source/mediasource-removesourcebuffer.html.

Unreviewed gardening.

* platform/gtk/TestExpectations:
* platform/gtk/imported/w3c/web-platform-tests/media-source/mediasource-removesourcebuffer-expected.txt: Added. Rebased.

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

3 years agoWeb Inspector: add "Persist Logs on Navigation" to settings screen
commit-queue@webkit.org [Tue, 17 Jan 2017 00:04:15 +0000 (00:04 +0000)]
Web Inspector: add "Persist Logs on Navigation" to settings screen
https://bugs.webkit.org/show_bug.cgi?id=166992

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2017-01-16
Reviewed by Brian Burg.

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Base/Setting.js:
* UserInterface/Controllers/LogManager.js:
(WebInspector.LogManager):
(WebInspector.LogManager.prototype._delayedMessagesCleared):
* UserInterface/Views/LogContentView.js:
(WebInspector.LogContentView.prototype._sessionStarted):
(WebInspector.LogContentView.prototype._handleContextMenuEvent):
(WebInspector.LogContentView.prototype._toggleClearLogOnNavigateSetting):
Move setting and UI toggle for "Keep Log on Navigation" to the global settings dictionary
and content view.

* UserInterface/Views/SettingsTabContentView.js:
(WebInspector.SettingsTabContentView.prototype.initialLayout):
(WebInspector.SettingsTabContentView):
Add checkbox for new setting and spacer between text settings and log settings.

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

3 years ago[css-grid] Implementing baseline positioning for grid containers
jfernandez@igalia.com [Mon, 16 Jan 2017 23:15:26 +0000 (23:15 +0000)]
[css-grid] Implementing baseline positioning for grid containers
https://bugs.webkit.org/show_bug.cgi?id=165063

Reviewed by Darin Adler and Sergio Villar Senin.

Source/WebCore:

Implementation of the 'first-line' baseline for Grid containers,
according to the CSS Grid Layout spec.
https://drafts.csswg.org/css-grid/#grid-baselines

The self-baseline and content-baseline alignment logic is still
not implemented, hence some cases will be implemented in
future patches.

Tests: fast/css-grid-layout/grid-baseline-margins.html
       fast/css-grid-layout/grid-baseline-must-respect-grid-order.html
       fast/css-grid-layout/grid-baseline.html

* rendering/RenderGrid.cpp:
(WebCore::synthesizedBaselineFromBorderBox):
(WebCore::RenderGrid::isInlineBaselineAlignedChild):
(WebCore::RenderGrid::baselinePosition):
(WebCore::RenderGrid::firstLineBaseline):
(WebCore::RenderGrid::inlineBlockBaseline):
* rendering/RenderGrid.h:

LayoutTests:

Tests to verify the baseline positioning of grid and inline-grid blocks.
Note that two of these new tests are expected to fail because of a Flexbox
bug, since we use Flexbox as reference test.

* TestExpectations:
* fast/css-grid-layout/grid-baseline-expected.html: Added.
* fast/css-grid-layout/grid-baseline-margins-expected.html: Added.
* fast/css-grid-layout/grid-baseline-margins.html: Added.
* fast/css-grid-layout/grid-baseline-must-respect-grid-order-expected.txt: Added.
* fast/css-grid-layout/grid-baseline-must-respect-grid-order.html: Added.
* fast/css-grid-layout/grid-baseline.html: Added.
* fast/css-grid-layout/resources/grid-alignment.css:
(.alignSelfBaseline):
(.selfBaseline):

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

3 years agoFix a ChangeLog typo.
aestes@apple.com [Mon, 16 Jan 2017 23:04:47 +0000 (23:04 +0000)]
Fix a ChangeLog typo.

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

3 years agoAdd the ability to use numbers in makeString()
weinig@apple.com [Mon, 16 Jan 2017 22:23:55 +0000 (22:23 +0000)]
Add the ability to use numbers in makeString()
https://bugs.webkit.org/show_bug.cgi?id=167087

Reviewed by Darin Adler.

Source/WTF:

Allow numbers to be easily used in makeString() and tryMakeString().

For instance, you can now write:
    int amount = 7;
    auto foo = makeString("There are ", amount, " apples in the cart");

* WTF.xcodeproj/project.pbxproj:
Add new file.

* wtf/text/IntegerToStringConversion.h:
(WTF::writeNumberToBufferImpl):
(WTF::writeNumberToBufferSigned):
(WTF::writeNumberToBufferUnsigned):
(WTF::lengthOfNumberAsStringImpl):
(WTF::lengthOfNumberAsStringSigned):
(WTF::lengthOfNumberAsStringUnsigned):
Add variants of integer writing code that compute the length of the string
that would be produced and writes the string to an existing buffer.

(WTF::IntegerToStringConversionTrait<AtomicString>::flush): Deleted.
(WTF::IntegerToStringConversionTrait<String>::flush): Deleted.
(WTF::IntegerToStringConversionTrait<StringBuilder>::flush): Deleted.
Move these traits to their respective classes.

* wtf/text/AtomicString.h:
(WTF::IntegerToStringConversionTrait<AtomicString>::flush):
* wtf/text/StringBuilder.h:
(WTF::IntegerToStringConversionTrait<StringBuilder>::flush):
* wtf/text/WTFString.h:
(WTF::IntegerToStringConversionTrait<String>::flush):
Traits moved here from IntegerToStringConversion.h

* wtf/text/StringConcatenateNumbers.h: Added.
(WTF::StringTypeAdapter<int>::StringTypeAdapter<int>):
(WTF::StringTypeAdapter<int>::length):
(WTF::StringTypeAdapter<int>::is8Bit):
(WTF::StringTypeAdapter<int>::writeTo):
(WTF::StringTypeAdapter<int>::toString):
(WTF::StringTypeAdapter<unsigned>::StringTypeAdapter<unsigned>):
(WTF::StringTypeAdapter<unsigned>::length):
(WTF::StringTypeAdapter<unsigned>::is8Bit):
(WTF::StringTypeAdapter<unsigned>::writeTo):
(WTF::StringTypeAdapter<unsigned>::toString):
(WTF::StringTypeAdapter<float>::StringTypeAdapter<float>):
(WTF::StringTypeAdapter<float>::length):
(WTF::StringTypeAdapter<float>::is8Bit):
(WTF::StringTypeAdapter<float>::writeTo):
(WTF::StringTypeAdapter<float>::toString):
(WTF::StringTypeAdapter<double>::StringTypeAdapter<double>):
(WTF::StringTypeAdapter<double>::length):
(WTF::StringTypeAdapter<double>::is8Bit):
(WTF::StringTypeAdapter<double>::writeTo):
(WTF::StringTypeAdapter<double>::toString):
Add basic adaptors for int, unsigned, float, and double.

(WTF::FormattedNumber::fixedPrecision):
(WTF::FormattedNumber::fixedWidth):
(WTF::FormattedNumber::length):
(WTF::FormattedNumber::buffer):
(WTF::FormattedNumber::stringView):
(WTF::StringTypeAdapter<FormattedNumber>::StringTypeAdapter<FormattedNumber>):
(WTF::StringTypeAdapter<FormattedNumber>::length):
(WTF::StringTypeAdapter<FormattedNumber>::is8Bit):
(WTF::StringTypeAdapter<FormattedNumber>::writeTo):
(WTF::StringTypeAdapter<FormattedNumber>::toString):
Add a special class, FormattedNumber, and an adaptor for it, allowing for
fixedPrecision and fixedWidth representation of doubles.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/StringConcatenate.cpp: Added.
Add tests for StringConcatenate, focusing on new numeric additions.

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

3 years ago[QuickLook] Do some cleanup in QuickLookHandle
aestes@apple.com [Mon, 16 Jan 2017 22:14:27 +0000 (22:14 +0000)]
[QuickLook] Do some cleanup in QuickLookHandle
https://bugs.webkit.org/show_bug.cgi?id=166864

Reviewed by Darin Adler.

Source/WebCore:

* loader/ios/QuickLook.h: Stopped including QuickLookHandleClient.h and forward-declared
instead; changed setClient() to take a Ref<QuickLookHandleClient>&&; renamed nsResponse() to
previewResponse(); changed QuickLookHandle() to take a ResourceLoader& and const
ResourceResponse&; gave m_delegate a stronger type; removed unused m_quicklookFileHandle;
initialized m_finishedLoadingDataIntoConverter to false.
(WebCore::QuickLookHandle::firstRequestURL): Stopped exporting.
(WebCore::QuickLookHandle::setClient): Moved definition out-of-line.
* loader/ios/QuickLook.mm: Renamed WebResourceLoaderQuickLookDelegate to
WebPreviewConverterDelegate and stopped conforming to NSURLConnectionDelegate and
WebCoreResourceLoaderDelegate; removed @property quickLookHandle and initialized
_quickLookHandle in the initializer instead.
(-[WebPreviewConverter initWithResourceLoader:quickLookHandle:]): Changed to take references
to resourceLoader and quickLookHandle.
(-[WebPreviewConverter _sendDidReceiveResponseIfNecessary]): Stoped checking for a nil
_quickLookHandle, since it is never nil.
(-[WebResourceLoaderQuickLookDelegate connection:didReceiveDataArray:]): Deleted.
QLPreviewConverter never calls this method.
(-[WebPreviewConverter connection:didReceiveData:lengthReceived:]): Stopped checking for a
nil _resourceLoader, since it is never nil.
(-[WebPreviewConverter connectionDidFinishLoading:]): Ditto.
(-[WebPreviewConverter connection:didFailWithError:]): Ditto.
(WebCore::emptyClient): Changed to return a reference.
(WebCore::QuickLookHandle::QuickLookHandle): Moved creation of the delegate,
firstRequestURL, and response to here from QuickLookHandle::create(). Called
ResourceLoader::didCreateQuickLookHandle() here instead of in QuickLookHandle::create().
(WebCore::QuickLookHandle::create): Used std::make_unique to create the QuickLookHandle.
(WebCore::QuickLookHandle::didFinishLoading): Set m_finishedLoadingDataIntoConverter to true
instead of YES.
(WebCore::QuickLookHandle::setClient): Moved the client rvalue reference into m_client.
(WebCore::QuickLookHandle::~QuickLookHandle): Stopped clearing m_converter and calling
-detachHandle.
(WebCore::QuickLookHandle::previewRequestURL): Used dot syntax.
(WebCore::QuickLookHandle::previewResponse): Renamed from nsResponse().

Source/WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::didCreateQuickLookHandle): Changed to pass a
Ref<QuickLookHandleClient>&& to QuickLookHandle::setClient().

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

3 years agoWeb Inspector: add UI Zoom level to Settings screen
commit-queue@webkit.org [Mon, 16 Jan 2017 21:11:53 +0000 (21:11 +0000)]
Web Inspector: add UI Zoom level to Settings screen
https://bugs.webkit.org/show_bug.cgi?id=166991

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2017-01-16
Reviewed by Brian Burg.

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Base/Main.js:
(WebInspector.loaded):
(WebInspector._dockedResizerMouseDown):
(WebInspector._increaseZoom):
(WebInspector._decreaseZoom):
(WebInspector._resetZoom):
(WebInspector.getZoomFactor): Renamed from _zoomFactor.
(WebInspector.setZoomFactor): Renamed from _setZoomFactor.
* UserInterface/Base/Setting.js:
(WebInspector.settings):
Moved zoomFactor setting to global dictionary.

* UserInterface/Views/SettingsTabContentView.css:
(.content-view.settings > .setting-container > .setting-value-controller input[type="number"]):
* UserInterface/Views/SettingsTabContentView.js:
(WebInspector.SettingsTabContentView.prototype.initialLayout):
Add UI input for changing zoomFactor.

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

3 years agoRemove CSSPropertyNames.in from the project. It's not used any more,
simon.fraser@apple.com [Mon, 16 Jan 2017 17:45:15 +0000 (17:45 +0000)]
Remove CSSPropertyNames.in from the project. It's not used any more,
now that we generate files from CSSProperties.json.

* WebCore.xcodeproj/project.pbxproj:

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

3 years ago[SOUP] Accept-language could be set twice in a row for the default context
carlosgc@webkit.org [Mon, 16 Jan 2017 11:49:39 +0000 (11:49 +0000)]
[SOUP] Accept-language could be set twice in a row for the default context
https://bugs.webkit.org/show_bug.cgi?id=167089

Reviewed by Žan Doberšek.

Source/WebCore:

If NetworkStorageSession doesn't have a SoupNetworkSession yet, we are creating it only to set the
languages. Since we already set the global value, the languages will be set when the SoupNetworkSession is
created later. This is not a big deal for the language property, but it will be for proxies after bug #128674.
Since NetworkStorageSession::soupNetworkSession() it's actually getting or creating the SoupNetworkSession, this
patch renames it as NetworkStorageSession::getOrCreateSoupNetworkSession() and now
NetworkStorageSession::soupNetworkSession() returns a pointer without creating the SoupNetworkSession, so it can
be nullptr. This can now be used to only use the default SoupNetworkSession when it has already been created.

* platform/network/NetworkStorageSession.h:
(WebCore::NetworkStorageSession::soupNetworkSession): Use NetworkStorageSession::getOrCreateSoupNetworkSession().
* platform/network/soup/DNSSoup.cpp:
(WebCore::DNSResolveQueue::updateIsUsingProxy): Ditto.
(WebCore::DNSResolveQueue::platformResolve): Ditto.
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession): This is the old soupNetworkSession(), now renamed.
(WebCore::NetworkStorageSession::soupNetworkSession): Return a pointer with the current value of m_session that
now can be nullptr.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::sessionFromContext): Use NetworkStorageSession::getOrCreateSoupNetworkSession().

Source/WebKit2:

* NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
(WebKit::CustomProtocolManager::registerScheme): Use NetworkStorageSession::getOrCreateSoupNetworkSession().
* NetworkProcess/efl/NetworkProcessMainEfl.cpp:
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::userPreferredLanguagesChanged): Only set the languages if NetworkStorageSession has a
SoupNetworkSession.
* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSessionSoup::soupSession): Use NetworkStorageSession::getOrCreateSoupNetworkSession().
* WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
(WebKit::WebCookieManager::setCookiePersistentStorage): Ditto.
* WebProcess/efl/WebProcessMainEfl.cpp:

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

3 years ago[SOUP] Fix handling of accept language property
carlosgc@webkit.org [Mon, 16 Jan 2017 11:24:23 +0000 (11:24 +0000)]
[SOUP] Fix handling of accept language property
https://bugs.webkit.org/show_bug.cgi?id=166969

Reviewed by Michael Catanzaro.

Source/WebCore:

Add SoupNetworkSession::setInitialAcceptLanguages() static method and update setAcceptLanguages to receive the
string already built from the languages vector. Now the SoupNetworkSession saves that value globally that
is always used when creating new sessions.

* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::switchToNewTestingSession): Remove workaround.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession): If initial accept languages were set, apply them to the newly created context.
(WebCore::SoupNetworkSession::setInitialAcceptLanguages): Just save the given value globally.
(WebCore::SoupNetworkSession::setAcceptLanguages): It receives now the string, so just set it to the session.
* platform/network/soup/SoupNetworkSession.h:

Source/WebKit2:

* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::buildAcceptLanguages): Moved from WebCore.
(WebKit::NetworkProcess::userPreferredLanguagesChanged): Build the accept language string from the vector and
pass set it to SoupNetworkSession to be used for new sessions, and also to all other existing sessions.

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

3 years agoAdd the build fix for browsers that don't yet support custom elements SPI.
rniwa@webkit.org [Mon, 16 Jan 2017 00:14:40 +0000 (00:14 +0000)]
Add the build fix for browsers that don't yet support custom elements SPI.
It was supposedly to be a part of the previous commit.

* public/v3/components/base.js:
(ComponentBase.defineElement):

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

3 years agoAdopt custom elements API in perf dashboard
rniwa@webkit.org [Mon, 16 Jan 2017 00:12:22 +0000 (00:12 +0000)]
Adopt custom elements API in perf dashboard
https://bugs.webkit.org/show_bug.cgi?id=167045

Reviewed by Darin Adler.

Adopt custom elements API in ComponentBase, and create the shadow tree lazily in content() and render()
instead of eagerly creating it inside the constructor.

For now, create a separate element class for each component in ComponentBase.defineElement instead of
making ComponentBase inherit from HTMLElement to preserve the semantics we have as well as to test
the boundaries of what custom elements API allows for framework authors.

In order to ensure one-to-one correspondence between elements and their components, we use a static map,
ComponentBase._currentlyConstructedByInterface, to remember which element or component is being created
and use that in custom element's constructor to update element.component() and this._element.

Also dropped the support for not having attachShadow as we've shipped this feature in Safari 10.

Finally, added tests to be ran inside a browser to test the front end code in browser-tests.

* browser-tests/component-base-tests.js: Added. Basic tests for ComponentBase.
* browser-tests/index.html: Added.

* public/v3/components/base.js:
(ComponentBase): Don't create the shadow tree. Use the currently constructed element as this._element if
there is one (the custom element's constructor is getting called). Otherwise create a new element but
store this component in the map to avoid creating a new component in the custom element's constructor.
(ComponentBase.prototype.content): Lazily create the shadow tree now.
(ComponentBase.prototype.render): Ditto.
(ComponentBase.prototype._ensureShadowTree): Renamed from _constructShadowTree. Dropped the support for
not having shadow DOM API. This is now required. Also use importNode instead of cloneNode in cloning
the template content since the latter would not get upgraded.
(ComponentBase.prototype._recursivelyReplaceUnknownElementsByComponents): Modernized the code. Don't
re-create a component if its element had already been upgraded by its custom element constructor.
(ComponentBase.defineElement): Add this component to the static maps. _componentByName is used by
_recursivelyReplaceUnknownElementsByComponents to instantiate new components in the browsers that don't
support custom elements API and _componentByClass is used by ComponentBase's constructor to lookup the
element name. The latter should go away once all components fully adopt ComponentBase.defineElement.
(ComponentBase.defineElement.elementClass): A class to define a custom element for the component.
We need to reconfigure the property since class's name is not writable but configurable.

* public/v3/components/button-base.js:
(ButtonBase.htmlTemplate): Added. Extracted the common code from CloseButton and WarningIcon.
(ButtonBase.buttonContent): Added. An abstract method overridden by CloseButton and WarningIcon.
(ButtonBase.sizeFactor): Added. Overridden by WarningIcon.
(ButtonBase.cssTemplate): Updated to use :host.
* public/v3/components/close-button.js:
(CloseButton.buttonContent): Renamed from htmlTemplate.
* public/v3/components/spinner-icon.js:
(SpinnerIcon.cssTemplate): Removed webkit prefixed properties, and updated it to animate stroke instead
of opacity to reduce the power usage.
(SpinnerIcon.htmlTemplate): Factored stroke, stroke-width, and stroke-linecap into cssTemplate.
* public/v3/components/warning-icon.js:
(WarningIcon.cssTemplate): Deleted.
(WarningIcon.sizeFactor): Added.
(WarningIcon.buttonContent): Renamed from htmlTemplate.
* public/v3/pages/summary-page.js:
(SummaryPage._constructRatioGraph): Fixed a bug that we were not never calling spinner.updateRendering().
(SummaryPage.prototype._renderCell):

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

3 years agoUnreviewed, remove stale comment.
mcatanzaro@igalia.com [Sun, 15 Jan 2017 22:42:53 +0000 (22:42 +0000)]
Unreviewed, remove stale comment.

This test was fixed by r163173.

* TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp:

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

3 years ago[SOUP] SoupNetworkSession constructor should be explicit
mcatanzaro@igalia.com [Sun, 15 Jan 2017 21:01:26 +0000 (21:01 +0000)]
[SOUP] SoupNetworkSession constructor should be explicit
https://bugs.webkit.org/show_bug.cgi?id=167069

Reviewed by Darin Adler.

* platform/network/soup/SoupNetworkSession.h:

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

3 years ago[WebIDL] Remove custom bindings for HTMLInputElement, HTMLFrameElement, HTMLMediaElem...
commit-queue@webkit.org [Sun, 15 Jan 2017 20:05:20 +0000 (20:05 +0000)]
[WebIDL] Remove custom bindings for HTMLInputElement, HTMLFrameElement, HTMLMediaElement and HTMLOptionsCollection
https://bugs.webkit.org/show_bug.cgi?id=167039

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

Source/WebCore:

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSHTMLFrameElementCustom.cpp: Removed.
* bindings/js/JSHTMLInputElementCustom.cpp: Removed.
* bindings/js/JSHTMLMediaElementCustom.cpp: Removed.
Remove files.

* html/HTMLOptionsCollection.idl:
* bindings/js/JSHTMLOptionsCollectionCustom.cpp:
(WebCore::JSHTMLOptionsCollection::setLength): Deleted.
Remove custom setLength. The bindings generator can handle this now.

* html/HTMLFrameElement.idl:
Resort to match spec. Replace custom annotation for location with SetterCallWith=ScriptState.

* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::setLocation):
* html/HTMLFrameElementBase.h:
Add implementation of setLocation.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::selectionStartForBindings):
(WebCore::HTMLInputElement::setSelectionStartForBindings):
(WebCore::HTMLInputElement::selectionEndForBindings):
(WebCore::HTMLInputElement::setSelectionEndForBindings):
(WebCore::HTMLInputElement::selectionDirectionForBindings):
(WebCore::HTMLInputElement::setSelectionDirectionForBindings):
(WebCore::HTMLInputElement::setSelectionRangeForBindings):
* html/HTMLInputElement.h:
* html/HTMLInputElement.idl:
Add variants of the selection properties that throw using the 'forBindings' suffix to differentiate.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setControllerForBindings):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::controllerForBindings):
* html/HTMLMediaElement.idl:
Add a variant of the controller property that unsets the media group, using the 'forBindings' suffix to differentiate.

* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::setLength):
Match other implementations by ignoring attempts to set large lengths (> 10000) rather than clamping.

LayoutTests:

* fast/dom/HTMLSelectElement/select-selectedIndex-expected.txt:
* fast/dom/HTMLSelectElement/select-selectedIndex-multiple-expected.txt:
* fast/dom/HTMLSelectElement/select-selectedIndex-multiple.html:
* fast/dom/HTMLSelectElement/select-selectedIndex.html:
Update tests / results now that negative lengths don't throw, but do log due to be converted
to a large number.

* fast/forms/select-max-length-expected.txt:
Update result now that a large length is not clamped, but rather, ignored.

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

3 years agoDe-duplicate more (nearly) identical code in Editor(Mac|IOS).mm
timothy_horton@apple.com [Sun, 15 Jan 2017 19:39:39 +0000 (19:39 +0000)]
De-duplicate more (nearly) identical code in Editor(Mac|IOS).mm
https://bugs.webkit.org/show_bug.cgi?id=167063

Reviewed by Dan Bernstein.

Source/WebCore:

No new tests, just refactoring.

* editing/Editor.h:
Adjust to fontAttributesForSelectionStart returning a RetainPtr.

* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle):
Make use of more Obj-C literals (for NSNumber).

(WebCore::Editor::fontAttributesForSelectionStart):
Merge this from EditorMac and EditorIOS. There are a number of attributes
that are currently only extracted on Mac, and it's not clear why (and
probably should be shared).

(WebCore::Editor::stringSelectionForPasteboard):
(WebCore::Editor::stringSelectionForPasteboardWithImageAltText):
Merge these functions from EditorMac and EditorIOS. The iOS implementation
was missing a reasonable bug fix from r161925.

(WebCore::Editor::createFragmentAndAddResources):
Merge this from EditorMac and EditorIOS. The Mac implementation was missing
a reasonable bug fix from r203482.

* editing/ios/EditorIOS.mm:
(WebCore::Editor::fontAttributesForSelectionStart): Deleted.
(WebCore::Editor::stringSelectionForPasteboardWithImageAltText): Deleted.
(WebCore::Editor::createFragmentAndAddResources): Deleted.
* editing/mac/EditorMac.mm:
(WebCore::Editor::fontAttributesForSelectionStart): Deleted.
(WebCore::Editor::stringSelectionForPasteboard): Deleted.
(WebCore::Editor::stringSelectionForPasteboardWithImageAltText): Deleted.
(WebCore::Editor::createFragmentAndAddResources): Deleted.

Source/WebKit/mac:

* WebView/WebHTMLView.mm:
(-[WebHTMLView _selectionStartFontAttributesAsRTF]):
(-[WebHTMLView _updateFontPanel]):
* WebView/WebView.mm:
(-[WebView typingAttributes]):
Adjust to fontAttributesForSelectionStart returning a RetainPtr.

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

3 years ago[Cocoa] Unify FontPlatformData's hashing and equality operators
mmaxfield@apple.com [Sun, 15 Jan 2017 17:47:00 +0000 (17:47 +0000)]
[Cocoa] Unify FontPlatformData's hashing and equality operators
https://bugs.webkit.org/show_bug.cgi?id=167061

Reviewed by Darin Adler.

On iOS, we were using CFEqual() and CFHash(), while on macOS
we were using pointer hashing and pointer equality. Instead,
we should be consistent about these operators.

Right now, FontPlatformData holds two internal CTFontRefs, and
switching to these higher-level CFEqual() and CFHash()
functions is required for eliminating one of these two
internal font objects.

No new tests because there is no behavior change.

* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::hash): Deleted.
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::hash):
(WebCore::FontPlatformData::platformIsEqual):
(WebCore::cascadeToLastResortAttributesDictionary):
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::hash):
* platform/graphics/win/FontPlatformDataCGWin.cpp:
(WebCore::FontPlatformData::hash):
* platform/graphics/win/FontPlatformDataCairoWin.cpp:
(WebCore::FontPlatformData::hash):
* platform/graphics/win/FontPlatformDataDirect2D.cpp:
(WebCore::FontPlatformData::hash):

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

3 years agoFrameView shouldn't keep dangling pointers into dead render trees.
akling@apple.com [Sun, 15 Jan 2017 10:48:04 +0000 (10:48 +0000)]
FrameView shouldn't keep dangling pointers into dead render trees.
<https://webkit.org/b/167011>

Reviewed by Antti Koivisto.

Added some pretty paranoid assertions to FrameView that verify all of its raw pointers
into the render tree are gone after the render tree has been destroyed.
They immediately caught two bugs, also fixed in this patch.

* page/FrameView.h:
* page/FrameView.cpp:
(WebCore::FrameView::willDestroyRenderTree):
(WebCore::FrameView::didDestroyRenderTree): Added these two callbacks for before/after
Document tears down its render tree. The former clears the layout root, and detaches
custom scrollbars. The latter contains a bunch of sanity assertions that pointers into
the now-destroyed render tree are gone.

* dom/Document.cpp:
(WebCore::Document::destroyRenderTree): Notify FrameView before/after teardown.

* page/animation/AnimationController.h:
* page/animation/AnimationController.cpp:
(WebCore::AnimationController::hasAnimations): Added a helper to check if there are
any composite animations around, as these contain raw pointers to renderers.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::willBeRemovedFromTree):
(WebCore::RenderElement::willBeDestroyed): Moved slow repaint object unregistration
from willBeRemovedFromTree() to willBeDestroyed(). The willBeRemovedFromTree() callback
is skipped as an optimization during full tree teardown, but willBeDestroyed() always
gets called. This fixes a bug where we'd fail to remove dangling pointers.

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

3 years ago[Cocoa] Unify font fallback between macOS and iOS for when the font-family list is...
mmaxfield@apple.com [Sun, 15 Jan 2017 08:23:31 +0000 (08:23 +0000)]
[Cocoa] Unify font fallback between macOS and iOS for when the font-family list is exhausted
https://bugs.webkit.org/show_bug.cgi?id=167056

Reviewed by Darin Adler.

When performing font fallback, each item in the font-family list is examined.
If no appropriate fonts are found, WebKit asks the system for an appropriate
font. As of a few years ago, both macOS and iOS used platform calls to
produce a font; however, each platform used a different platform call. This
patch migrates both platforms to use a shared function which uses only
one of the platform calls (which means the other platform call is never used).

There are still some behavior differences between macOS and iOS (which are now
hidden behind a PLATFORM() guard), but I'd like to minimize and eliminate these
in the future. Using a shared function is a step toward this goal.

No new tests because there is no behavior change.

* platform/graphics/FontCache.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::lookupFallbackFont):
(WebCore::FontCache::systemFallbackForCharacters):
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::getSystemFontFallbackForCharacters): Deleted.
(WebCore::platformLookupFallbackFont): Deleted.
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::platformLookupFallbackFont): Deleted.

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

3 years agoAnnotate large string tests with largeHeap
utatane.tea@gmail.com [Sun, 15 Jan 2017 07:22:19 +0000 (07:22 +0000)]
Annotate large string tests with largeHeap
https://bugs.webkit.org/show_bug.cgi?id=167054

Reviewed by Filip Pizlo.

JSTests:

* microbenchmarks/dense-set.js:
* microbenchmarks/lots-of-fields.js:
* stress/joined-strings-should-not-exceed-max-string-length.js:
* stress/make-large-string-jit-strcat.js:
* stress/make-large-string-jit.js:
* stress/make-large-string-strcat.js:
* stress/make-large-string.js:
* stress/string-joining-long-strings-should-not-crash.js:
* stress/string-prototype-replace-should-throw-out-of-memory-error-when-using-too-much-memory.js:

Tools:

* Scripts/run-javascriptcore-tests:
* Scripts/run-jsc-stress-tests:

LayoutTests:

* js/script-tests/stringimpl-to-jsstring-on-large-strings-1.js:
* js/script-tests/stringimpl-to-jsstring-on-large-strings-2.js:
* js/script-tests/stringimpl-to-jsstring-on-large-strings-3.js:

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

3 years agoReport CPU usage of tabs after they become non-visible using diagnostic logging
cdumez@apple.com [Sun, 15 Jan 2017 06:59:46 +0000 (06:59 +0000)]
Report CPU usage of tabs after they become non-visible using diagnostic logging
https://bugs.webkit.org/show_bug.cgi?id=167019
<rdar://problem/30019773>

Reviewed by Darin Adler.

Report CPU usage of tabs after they become non-visible using diagnostic logging.
We start measure CPU usage 5 seconds after a tab goes to the background, for 5
minutes and report how much CPU the tab used during those 5 minutes. We will
not log if the tab gets closed or moved to the foreground during those 5
minutes.

* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::postPageBackgroundingKey):
* page/DiagnosticLoggingKeys.h:
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::didStartProvisionalLoad):
(WebCore::Page::didFinishLoad):
(WebCore::foregroundCPUUsageToDiagnosticLogginKey):
(WebCore::Page::measurePostLoadCPUUsage):
(WebCore::backgroundCPUUsageToDiagnosticLogginKey):
(WebCore::Page::measurePostBackgroundingCPUUsage):
(WebCore::Page::setIsVisibleInternal):
* page/Page.h:
* page/Settings.cpp:
(WebCore::Settings::isPostBackgroundingCPUUsageMeasurementEnabled):
* page/Settings.h:

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

3 years agoDe-duplicate some (nearly) identical code in Editor(Mac|IOS).mm
timothy_horton@apple.com [Sun, 15 Jan 2017 06:45:58 +0000 (06:45 +0000)]
De-duplicate some (nearly) identical code in Editor(Mac|IOS).mm
https://bugs.webkit.org/show_bug.cgi?id=167062

Reviewed by Dan Bernstein.

No new tests, just refactoring.

* editing/Editor.cpp:
(WebCore::Editor::fontForSelection):
(WebCore::Editor::styleForSelectionStart):
(WebCore::Editor::adjustedSelectionRange):
* editing/Editor.h:
Move these three functions to Editor and unguard them, because they're
not Cocoa specific.

* platform/spi/cocoa/NSAttributedStringSPI.h:
Move some iOS-only NSAttributedString IPI (so no Internal SDK switch)
to NSAttributedStringSPI.h.

* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::writeSelectionToPasteboard):
(WebCore::Editor::selectionInWebArchiveFormat):
(WebCore::Editor::replaceSelectionWithAttributedString):
(WebCore::Editor::createFragmentForImageResourceAndAddResource):
(WebCore::Editor::dataInRTFDFormat):
(WebCore::Editor::dataInRTFFormat):
Move these six functions here.
selectionInWebArchiveFormat and replaceSelectionWithAttributedString are
entirely identical; writeSelectionToPasteboard and createFragment...
both have slightly suspicious-looking differences that I left intact
and wrote comments about (especially createFragment..., the other one
is somewhat explicable). The two dataInRTF(D)Format functions used to
be static functions, but for now are required from both EditorCocoa
and Editor(Mac|IOS), so we'll make them static member functions.

* editing/ios/EditorIOS.mm:
(WebCore::Editor::fontForSelection): Deleted.
(WebCore::Editor::selectionInWebArchiveFormat): Deleted.
(WebCore::dataInRTFDFormat): Deleted.
(WebCore::dataInRTFFormat): Deleted.
(WebCore::Editor::writeSelectionToPasteboard): Deleted.
(WebCore::Editor::createFragmentForImageResourceAndAddResource): Deleted.
(WebCore::Editor::replaceSelectionWithAttributedString): Deleted.
* editing/mac/EditorMac.mm:
(WebCore::Editor::fontForSelection): Deleted.
(WebCore::Editor::selectionInWebArchiveFormat): Deleted.
(WebCore::dataInRTFDFormat): Deleted.
(WebCore::dataInRTFFormat): Deleted.
(WebCore::Editor::writeSelectionToPasteboard): Deleted.
(WebCore::Editor::createFragmentForImageResourceAndAddResource): Deleted.
(WebCore::Editor::replaceSelectionWithAttributedString): Deleted.

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

3 years agoWeb Inspector: Cmd-, should open Settings tab
commit-queue@webkit.org [Sun, 15 Jan 2017 06:27:41 +0000 (06:27 +0000)]
Web Inspector: Cmd-, should open Settings tab
https://bugs.webkit.org/show_bug.cgi?id=167028

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2017-01-14
Reviewed by Timothy Hatcher.

* UserInterface/Base/Main.js:
(WebInspector.contentLoaded):
(WebInspector._showSettingsTab): Added.

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

3 years agoRemove stale references to ENABLE_ES6_GENERATORS and ENABLE_PROMISES
commit-queue@webkit.org [Sun, 15 Jan 2017 05:06:37 +0000 (05:06 +0000)]
Remove stale references to ENABLE_ES6_GENERATORS and ENABLE_PROMISES
https://bugs.webkit.org/show_bug.cgi?id=167043

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-14
Reviewed by Darin Adler.

.:

* Source/cmake/tools/vsprops/FeatureDefines.props:
* Source/cmake/tools/vsprops/FeatureDefinesCairo.props:

Tools:

* Scripts/webkitperl/FeatureList.pm:

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

3 years agoSmall code cleanup after r210760
zalan@apple.com [Sat, 14 Jan 2017 19:59:26 +0000 (19:59 +0000)]
Small code cleanup after r210760
https://bugs.webkit.org/show_bug.cgi?id=167047

Reviewed by Sam Weinig.

No change in functionality.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPosition):

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

3 years agoWebAssembly: Suppress warnings & errors in GCC
utatane.tea@gmail.com [Sat, 14 Jan 2017 19:35:23 +0000 (19:35 +0000)]
WebAssembly: Suppress warnings & errors in GCC
https://bugs.webkit.org/show_bug.cgi?id=167049

Reviewed by Sam Weinig.

Source/JavaScriptCore:

* wasm/WasmFunctionParser.h:
Add missing { } after the switch. Ideally, it is not necessary.
But in GCC, it is required. Since this function is fairly large,
I think the code generated by this does not cause performance
regression.

* wasm/WasmPageCount.h:
UINT_MAX is defined in limits.h.

* wasm/generateWasmValidateInlinesHeader.py:
On the other hand, we use this suppress pragma here to solve the
same problem in wasm/WasmFunctionParser.h. Since the load function
is fairly small, the additional `return { };` may generate some
suboptimal code. See bug 150794 for more detail.

Source/WTF:

* wtf/LEBDecoder.h:
(WTF::LEBDecoder::decodeInt):
If T = int, it performs `-1 << shift`. It causes
warning in GCC. Instead, we first cast it to the
UnsignedT, perform operation and re-cast to the
T.

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

3 years agoRenderers should have a simple way to access Settings.
zalan@apple.com [Sat, 14 Jan 2017 18:45:20 +0000 (18:45 +0000)]
Renderers should have a simple way to access Settings.
https://bugs.webkit.org/show_bug.cgi?id=167048

Now that RenderObjects can never outlive the Page, we can just access the Settings
through Page instead of Document::settings/Frame::settings.

Reviewed by Andreas Kling.

No change in functionality.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintCaret):
(WebCore::RenderBlock::shouldPaintSelectionGaps):
* rendering/RenderBlockFlow.cpp:
(WebCore::needsAppleMailPaginationQuirk):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::startAlignedOffsetForLine):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::layoutOverflowRectForPropagation):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
(WebCore::RenderElement::willBeRemovedFromTree):
(WebCore::RenderElement::shouldRespectImageOrientation):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::flattenFrameSet):
* rendering/RenderIFrame.cpp:
(WebCore::RenderIFrame::flattenFrame):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::addChildIgnoringContinuation):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::acceleratedCompositingForOverflowScrollEnabled):
(WebCore::RenderLayer::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
(WebCore::RenderLayer::hasAcceleratedTouchScrolling):
(WebCore::RenderLayer::getRectToExpose):
(WebCore::RenderLayer::overhangAmount):
(WebCore::RenderLayer::setHasHorizontalScrollbar):
(WebCore::RenderLayer::setHasVerticalScrollbar):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking):
(WebCore::RenderLayerBacking::shouldAggressivelyRetainTiles):
(WebCore::RenderLayerBacking::shouldTemporarilyRetainTileCohorts):
(WebCore::RenderLayerBacking::useGiantTiles):
(WebCore::RenderLayerBacking::startAnimation):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::addToOverlapMap):
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):
(WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer):
(WebCore::RenderLayerCompositor::requiresContentShadowLayer):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
* rendering/RenderObject.h:
(WebCore::RenderObject::settings):
* rendering/RenderText.cpp:
(WebCore::SecureTextTimer::restart):
* rendering/RenderView.cpp:
(WebCore::RenderView::clientLogicalWidthForFixedPosition):
(WebCore::RenderView::clientLogicalHeightForFixedPosition):
(WebCore::RenderView::paintBoxDecorations):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForWithReason):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::applyResource):

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

3 years agoAlign the innerText setter with the HTML spec and Gecko
cdumez@apple.com [Sat, 14 Jan 2017 17:35:56 +0000 (17:35 +0000)]
Align the innerText setter with the HTML spec and Gecko
https://bugs.webkit.org/show_bug.cgi?id=160971

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline several W3C tests now that more checks are passing.

* web-platform-tests/domparsing/createContextualFragment-expected.txt:
* web-platform-tests/innerText/setter-expected.txt:

Source/WebCore:

Align the innerText setter and createContextualFragment() with the
HTML specification and Gecko. In particular, they no longer throw
when the context element is a void element. This behavior was there
to match an old IE behavior but Edge dropped this behavior.

Test: fast/dom/br-set-outerText.html

* dom/Element.cpp:
* dom/Element.h:
* editing/markup.cpp:
(WebCore::createContextualFragment):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::setInnerText):
(WebCore::HTMLElement::setOuterText):

LayoutTests:

Add test coverage for outerText, which is non-standard.

* fast/dom/br-set-outerText-expected.txt: Added.
* fast/dom/br-set-outerText.html: Added.

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

3 years agoReserve capacity for StringBuilder in unescape
utatane.tea@gmail.com [Sat, 14 Jan 2017 16:19:33 +0000 (16:19 +0000)]
Reserve capacity for StringBuilder in unescape
https://bugs.webkit.org/show_bug.cgi?id=167008

Reviewed by Sam Weinig.

JSTests:

* stress/unescape.js: Added.
(shouldBe):

Source/JavaScriptCore:

`unescape` function is frequently called in Kraken sha256-iterative.
This patch just reserves the capacity for the StringBuilder.

Currently, we select the length of the string for the reserved capacity.
It improves the performance 2.73%.

    Benchmark report for Kraken on sakura-trick.

    VMs tested:
    "baseline" at /home/yusukesuzuki/dev/WebKit/WebKitBuild/untot/Release/bin/jsc
    "patched" at /home/yusukesuzuki/dev/WebKit/WebKitBuild/un/Release/bin/jsc

    Collected 100 samples per benchmark/VM, with 100 VM invocations per benchmark. Emitted a call to gc() between
    sample measurements. Used 1 benchmark iteration per VM invocation for warm-up. Used the jsc-specific preciseTime()
    function to get microsecond-level timing. Reporting benchmark execution times with 95% confidence intervals in
    milliseconds.

                                               baseline                  patched

    stanford-crypto-sha256-iterative        51.609+-0.672             50.237+-0.860           might be 1.0273x faster

    <arithmetic>                            51.609+-0.672             50.237+-0.860           might be 1.0273x faster

* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncUnescape):

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

3 years agoRemove unused WKView initializer parameter
timothy_horton@apple.com [Sat, 14 Jan 2017 09:01:11 +0000 (09:01 +0000)]
Remove unused WKView initializer parameter
https://bugs.webkit.org/show_bug.cgi?id=167046

Reviewed by Dan Bernstein.

* UIProcess/API/mac/WKView.mm:
(-[WKView initWithFrame:processPool:configuration:]):
(-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
(-[WKView initWithFrame:configurationRef:]):
(-[WKView initWithFrame:processPool:configuration:webView:]): Deleted.
* UIProcess/API/mac/WKViewInternal.h:
Ever since WKWebView stopped having WKView inside it, this parameter
has never been used. Now, it only leads to confusion.

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

3 years agoWeb Inspector: Settings tab is restored when reopening inspector
commit-queue@webkit.org [Sat, 14 Jan 2017 07:09:50 +0000 (07:09 +0000)]
Web Inspector: Settings tab is restored when reopening inspector
https://bugs.webkit.org/show_bug.cgi?id=167025

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2017-01-13
Reviewed by Matt Baker.

* UserInterface/Base/Main.js:
(WebInspector._tabBrowserSelectedTabContentViewDidChange):
Only save the selectedTabIndex if the current tab should be saved and reloaded upon opening
the WebInspector window.

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

3 years agoRemove ENABLE(DETAILS_ELEMENT) guards
commit-queue@webkit.org [Sat, 14 Jan 2017 05:59:03 +0000 (05:59 +0000)]
Remove ENABLE(DETAILS_ELEMENT) guards
https://bugs.webkit.org/show_bug.cgi?id=167042

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-13
Reviewed by Alex Christensen.

.:

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

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::setIsExpanded):
* html/HTMLDetailsElement.cpp:
* html/HTMLDetailsElement.idl:
* html/HTMLSummaryElement.cpp:
* html/HTMLTagNames.in:
* html/shadow/DetailsMarkerControl.cpp:
* rendering/RenderDetailsMarker.cpp:
* rendering/RenderDetailsMarker.h:
* rendering/RenderObject.h:
(WebCore::RenderObject::isDetailsMarker):
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

3 years agoFix WinCairo build after r210753.
achristensen@apple.com [Sat, 14 Jan 2017 05:52:49 +0000 (05:52 +0000)]
Fix WinCairo build after r210753.
https://bugs.webkit.org/show_bug.cgi?id=166730

* platform/WebGLStateTracker.h:
WTF::Function apparently needs to explicitly be differentiated from JSC::Attribute Function in PropertySlot.h.

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

3 years agoCrash when visiting a webpage that uses Gamepads in a new WebProcess after a previous...
beidson@apple.com [Sat, 14 Jan 2017 04:04:59 +0000 (04:04 +0000)]
Crash when visiting a webpage that uses Gamepads in a new WebProcess after a previous page has used gamepads..
https://bugs.webkit.org/show_bug.cgi?id=167033

Reviewed by Alex Christensen.

* UIProcess/Gamepad/UIGamepadProvider.cpp:
(WebKit::UIGamepadProvider::processPoolStartedUsingGamepads): Don't schedule a state update here.
(WebKit::UIGamepadProvider::processPoolStoppedUsingGamepads): Ditto.
* UIProcess/Gamepad/UIGamepadProvider.h:

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::startedUsingGamepads): Populate the WebProcess with initial gamepads.

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

3 years agoPotential nullptr dereference in RenderLayer::updateLayerPosition()
bfulgham@apple.com [Sat, 14 Jan 2017 03:42:32 +0000 (03:42 +0000)]
Potential nullptr dereference in RenderLayer::updateLayerPosition()
https://bugs.webkit.org/show_bug.cgi?id=167036
<rdar://problem/30023019>

Reviewed by Dean Jackson.

A value was being used without nullptr checking, even though it had been checked for null a
few lines prior.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPosition): Add missing nullptr check.

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

3 years agoWeb Inspector: Resources disappear from the network tab when iframe gets removed...
nvasilyev@apple.com [Sat, 14 Jan 2017 03:40:52 +0000 (03:40 +0000)]
Web Inspector: Resources disappear from the network tab when iframe gets removed from DOM
https://bugs.webkit.org/show_bug.cgi?id=166776
<rdar://problem/29909640>

Reviewed by Matt Baker.

* UserInterface/Views/NetworkSidebarPanel.js:
(WebInspector.NetworkSidebarPanel):
Don't remove resource tree elements from Network tab when iframe gets detached from the DOM.

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

3 years agoRemove PassRefPtr from more of "platform"
darin@apple.com [Sat, 14 Jan 2017 03:35:54 +0000 (03:35 +0000)]
Remove PassRefPtr from more of "platform"
https://bugs.webkit.org/show_bug.cgi?id=166809

Reviewed by Sam Weinig.

Source/JavaScriptCore:

* inspector/JSInjectedScriptHost.h:
(Inspector::JSInjectedScriptHost::impl): Simplified code since we don't need a
const_cast here any more.
* runtime/PrivateName.h:
(JSC::PrivateName::uid): Ditto.

Source/WebCore:

* CMakeLists.txt: Removed DeviceMotionClientMock.cpp.

* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h:
Added now-needed include.

* Modules/speech/SpeechSynthesisUtterance.cpp:
(WebCore::SpeechSynthesisUtterance::SpeechSynthesisUtterance):
Pass a reference instead of a pointer.

* Modules/speech/SpeechSynthesisUtterance.h: Tweaks, msade a few things
more private and final.

* bindings/js/JSDOMConvert.h:
(WebCore::Detail::getPtrOrRef): Removed no-longer-needed const_cast.
* bindings/js/JSDOMWrapper.h:
(WebCore::JSDOMWrapper::wrapped): Ditto.
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::~ScriptModuleLoader): Ditto.

* css/BasicShapeFunctions.cpp:
(WebCore::convertToLengthSize): Updated for LengthSize struct.
(WebCore::convertToCenterCoordinate): Ditto.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::createPositionListForLayer): Take a reference.
(WebCore::getBorderRadiusCornerValues): Updated for LengthSize struct.
(WebCore::getBorderRadiusCornerValue): Ditto.
(WebCore::getBorderRadiusShorthandValue): Ditto.
(WebCore::fillSizeToCSSValue): Ditto.
(WebCore::ComputedStyleExtractor::propertyValue): Updated many properties
since the layer properties now return references rather than pointers.

* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::CachedGeneratedImage::image): Removed
no-longer-needed const_cast.
* css/CSSKeyframesRule.cpp:
(WebCore::CSSKeyframesRule::item): Ditto.

* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::init): Updated for LengthSize struct.

* css/CSSStyleRule.h: Removed no-longer-needed const_cast.

* css/CSSToStyleMap.cpp:
(WebCore::convertToLengthSize): Updated for LengthSize struct.

* css/FontFace.cpp:
(WebCore::FontFace::family): Removed no-longer-needed const_cast.
(WebCore::FontFace::style): Ditto.
(WebCore::FontFace::weight): Ditto.
(WebCore::FontFace::unicodeRange): Ditto.
(WebCore::FontFace::variant): Ditto.
(WebCore::FontFace::featureSettings): Ditto.

* css/LengthFunctions.cpp:
(WebCore::sizeForLengthSize): Added.
(WebCore::floatSizeForLengthSize): Updated for LengthSize struct.
* css/LengthFunctions.h: Added sizeForLengthSize.

* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::paintOrder): Cut down on creation of unused objects.
We now create only what we actually use.

* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertRadius): Updated for
LengthSize struct.
(WebCore::StyleBuilderConverter::convertShapeValue): Pass references
when creating ShapeValue.

* css/StyleBuilderCustom.h:
(WebCore::forwardInheritedValue): Added. This set of overloaded
functions allows us to use move semantics for some types, but copy
them when inheriting. Doing it with special cases here allows us to
resolve this without adding overloads someone might be tempted to
call outside the style builder, and without adding special cases to
the JSON file for each property.
(WebCore::StyleBuilderCustom::applyValueWebkitDashboardRegion):
Add WTFMove as needed to work with rvalue references.
(WebCore::StyleBuilderCustom::applyValueSize): Ditto.
(WebCore::StyleBuilderCustom::applyInheritTextIndent): Ditto.
(WebCore::StyleBuilderCustom::applyValueTextIndent): Ditto.
(WebCore::StyleBuilderCustom::applyInheritLineHeight): Ditto.
(WebCore::StyleBuilderCustom::applyValueLineHeight): Ditto.
(WebCore::StyleBuilderCustom::applyInheritClip): Ditto.
(WebCore::StyleBuilderCustom::applyValueClip): Ditto.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::State::cacheBorderAndBackground): Use
references instead of pointers.
(WebCore::StyleResolver::applyMatchedProperties): Ditto.
(WebCore::StyleResolver::applyProperty): Update for changes to the
custom property data in RenderStyle.

* css/makeprop.pl: Use auto quite a bit more in the generated code.
Updated special cases for layers to expect references. Added a WTFMove
so we can get move semantics for converted values that come out in
an optional. Added call to forwardInheritedValue (see above).

* dom/Document.cpp:
(WebCore::Document::pageSizeAndMarginsInPixels): Use auto and update
since LengthSize is a struct.

* dom/EventPath.cpp:
(WebCore::EventPath::computePathUnclosedToTarget): Use auto.

* dom/LiveNodeList.h:
(WebCore::LiveNodeList::ownerNode): Removed no-longer-needed const_cast.

* dom/MessageEvent.cpp:
(WebCore::MessageEvent::source): Removed unneeded static_cast.

* dom/Node.cpp:
(WebCore::nodeSetPreTransformedFromNodeOrStringVector): Tweaked formatting.

* dom/Range.h:
(WebCore::Range::ownerDocument): Removed no-longer-needed const_cast.
* dom/RegisteredEventListener.h:
(WebCore::RegisteredEventListener::callback): Ditto.
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::~ScriptRunner): Ditto.
* html/HTMLCollection.h:
(WebCore::HTMLCollection::ownerNode): Ditto.
* html/parser/HTMLStackItem.h:
(WebCore::HTMLStackItem::node): Ditto.

* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::setJavaScriptPaused): Cut down on the number
of different functions here. Also use reference rather than pointer.
* inspector/PageScriptDebugServer.h: Updated for above change.

* loader/HistoryController.cpp:
(WebCore::HistoryController::recursiveSetProvisionalItem): Removed
no-longer-needed const_cast.
(WebCore::HistoryController::recursiveGoToItem): Ditto.

* page/Frame.cpp:
(WebCore::Frame::ownerRenderer): Use auto. Let the is<> function do null
checking for us.
(WebCore::Frame::frameForWidget): Take a reference rather than a pointer.
* page/Frame.h: Updated for the above.

* page/FrameView.cpp:
(WebCore::FrameView::invalidateRect): Use Chrome directly instead of using
HostWindow. HostWindow is an abstraction for the platform layer, and there
is no good reason to use it here.
(WebCore::FrameView::scheduleAnimation): Ditto.
(WebCore::FrameView::graphicsLayerForPlatformWidget): Updated to use reference
when calling RenderWidget::find.
(WebCore::FrameView::scrollContentsFastPath): Use Chrome instead of HostWindow.
(WebCore::FrameView::hostWindow): Use early return.
(WebCore::FrameView::updateScrollCorner): Removed unneeded call through to base
class function, which was empty.
(WebCore::FrameView::hasCustomScrollbars): Updated since the children set now
contains Ref rather than RefPtr.
(WebCore::FrameView::parentFrameView): Use early return.
(WebCore::FrameView::updateWidgetPositions): Use reference instead of pointer.
* page/FrameView.h: Use final instead of override. Remove now-unneeded const_cast.

* page/Page.cpp:
(WebCore::Page::pluginViews): Updated since the children set now contains
Ref rather than RefPtr.

* page/PrintContext.cpp:
(WebCore::PrintContext::pageProperty): Updated for LengthSize struct.

* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::fireAnimationEventsIfNeeded): Updated for changes to
the types in animation function members.
(WebCore::AnimationBase::timeToNextService): Ditto.
(WebCore::AnimationBase::progress): Ditto.
(WebCore::AnimationBase::getElapsedTime): Ditto.

* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc): Updated for LengthSize struct.
(WebCore::LengthPropertyWrapper::LengthPropertyWrapper): Updated since we now
use rvalue references and move semantics when setting length properties.

* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame): Tweaked to
use auto, pass references.

* platform/KeyedCoding.h: Return RefPtr instead of PassRefPtr.

* platform/LengthBox.h: Added a constructor that moves the lengths in, rather
than always copying them.

* platform/LengthSize.cpp:
(WebCore::operator<<): Updated since LengthSize is a struct.
* platform/LengthSize.h: Turned LengthSize into a struct and removed all the
getter and setter code.

* platform/PlatformSpeechSynthesis.h: Removed. Unused.

* platform/PlatformSpeechSynthesisUtterance.cpp:
(WebCore::PlatformSpeechSynthesisUtterance::create): Return Ref rather than PassRefPtr.
(WebCore::PlatformSpeechSynthesisUtterance::PlatformSpeechSynthesisUtterance): Take
a reference. Initialize data members in class definition.
* platform/PlatformSpeechSynthesisUtterance.h: Updated for the above.

* platform/PlatformSpeechSynthesisVoice.cpp:
(WebCore::PlatformSpeechSynthesisVoice::create): Return Ref rather than PassRefPtr.
* platform/PlatformSpeechSynthesisVoice.h: Updated for the above.

* platform/ScrollView.cpp:
(WebCore::ScrollView::addChild): Take a reference rather than a PassRefPtr.
(WebCore::ScrollView::setHasScrollbarInternal): Updated for change to addChild
(WebCore::ScrollView::scrollContentsFastPath): Deleted. This was never called,
so made it pure virtual.
(WebCore::ScrollView::frameRectsChanged): Use a modern for loop.
(WebCore::ScrollView::clipRectChanged): Ditto.
(WebCore::ScrollView::updateScrollCorner): Deleted. This was empty so made it pure
virtual and changed FrameView to not call it.
(WebCore::ScrollView::setParentVisible): Use a modern for loop.
(WebCore::ScrollView::show): Ditto.
(WebCore::ScrollView::hide): Ditto.
* platform/ScrollView.h: Changed the children set to contain Ref instead of RefPtr.
Changed functions that were never overridden to either be final or non-virtual,
Changed functions that were never called to be pure virtual.

* platform/Theme.h:
(WebCore::Theme::minimumControlSize): Updated for LengthSize struct.

* platform/animation/Animation.h: Changed timingFunction and trigger to return
raw pointers instead of PassRefPtr. Changed setTimingFunction and setTrigger to
take RefPtr&& and Ref&& instead of PassRefPtr. CHanged initialTimingfunction and
initialTrigger to return Ref.

* platform/animation/AnimationList.cpp: Removed redundant check in FILL_UNSET_PROPERTY.
(WebCore::AnimationList::AnimationList): Use modern for loop, reserveInitialCapacity,
and uncheckedAppend.
* platform/animation/AnimationList.h: Changed append to take Ref&& instead of PassRefPtr.
changed vecto to contain Ref instead of RefPtr. Added move constructor and assignment
operator.

* platform/animation/AnimationTrigger.h:
(WebCore::AutoAnimationTrigger::clone): Return Ref instead of PassRefPtr.
(WebCore::AutoAnimationTrigger::create): Ditto.
(WebCore::AutoAnimationTrigger::clone): Ditto.
(WebCore::ScrollAnimationTrigger::create): Ditto.
(WebCore::ScrollAnimationTrigger::clone): Ditto.

* platform/animation/TimingFunction.h:
(WebCore::LinearTimingFunction::create): Return Ref instead of PassRefPtr.
(WebCore::CubicBezierTimingFunction::create): Ditto.
(WebCore::CubicBezierTimingFunction::defaultTimingFunction): Return a reference
instead of a pointer.
(WebCore::CubicBezierTimingFunction::createReversed): Return Ref instead of PassRefPtr.
(WebCore::CubicBezierTimingFunction::clone): Ditto.
(WebCore::StepsTimingFunction::create): Ditto.
(WebCore::StepsTimingFunction::clone): Ditto.
(WebCore::SpringTimingFunction::create): Ditto.
(WebCore::SpringTimingFunction::clone): Ditto.

* platform/audio/AudioBus.h:
(WebCore::AudioBus::channel): Removed no-longer-needed const_cast.

* platform/cf/KeyedEncoderCF.cpp:
(WebCore::KeyedEncoderCF::finishEncoding): Return RefPtr instead of PassRefPtr.
* platform/cf/KeyedEncoderCF.h: Use final instead of override. Made even more
private. Changed return value of finishEncoding to Ref instead of PassRefPtr.

* platform/efl/PlatformSpeechSynthesisProviderEfl.h: Removed include of PassRefPtr.h.

* platform/glib/KeyedEncoderGlib.cpp:
(WebCore::KeyedEncoderGlib::finishEncoding): Return RefPtr instead of PassRefPtr.
* platform/glib/KeyedEncoderGlib.h: Use final instead of override. Made even more
private. Changed return value of finishEncoding to Ref instead of PassRefPtr.

* platform/graphics/filters/FilterOperations.cpp:
(WebCore::outsetSizeForBlur): Simplified, removing unnecessary floating point math.
(WebCore::FilterOperations::FilterOperations): Deleted. Let the compiler generate this.
(WebCore::FilterOperations::operator=): Deleted. Let the compiler generate this.
(WebCore::FilterOperations::operator==): Streamlined.
(WebCore::FilterOperations::operationsMatch): Ditto.
(WebCore::FilterOperations::hasReferenceFilter): Ditto.
(WebCore::FilterOperations::hasOutsets): Ditto.
(WebCore::FilterOperations::outsets): Ditto.
(WebCore::FilterOperations::hasFilterThatAffectsOpacity): Ditto.
(WebCore::FilterOperations::hasFilterThatMovesPixels): Ditto.
* platform/graphics/filters/FilterOperations.h: Updated for above changes.

* platform/graphics/FontCache.h: Removed included of PassRefPtr.h.

* platform/graphics/FontPlatformData.h: Tweaked formatting. Removed nesting
from #if since our formatting makes it hard to see nesting. Let the compiler
generate the default move and copy constructors and assignemnt operators except
in the USE(FREETYPE) case.

* platform/graphics/GraphicsLayer.h:
(WebCore::AnimationValue::AnimationValue): Updated since clone now returns a Ref
rather than a RefPtr.
(WebCore::FloatAnimationValue::FloatAnimationValue): Deleted. Let the compiler
generate the copy constructor without defining it explicitly.
(WebCore::TransformAnimationValue::TransformAnimationValue): Use a modern for
loop, reserveInitialCapacity, and unchecked append. Also tell the compiler to
generate the move constructor, since the special work is only needed for the
copy constructor.
(WebCore::FilterAnimationValue::FilterAnimationValue): Ditto.
(WebCore::KeyframeValueList::KeyframeValueList): Ditto.

* platform/graphics/LegacyCDMSession.h: Removed include of PassRefPtr.h.

* platform/graphics/PathUtilities.cpp:
(WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline): Updated
for LengthSize struct.

* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
(WebCore::CDMSessionAVFoundationCF::CDMSessionAVFoundationCF): Take a reference.
Don't bother setting m_client since we never use it.
(WebCore::CDMSessionAVFoundationCF::generateKeyRequest): Clean up code a bit
by using auto a lot more.
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h: Added include
that is now needed since it was removed from the base class. Tidied the class
up a bit, marking it final, making everything private, taking a reference, and
removing an unused data member, m_client.

* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::createSession): Pass a reference.

* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
added include of WTFString.h, now needed because of removing an unneeded
include from another header file.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::animationCanBeAccelerated): Updated since trigger
is a raw pointer now.
(WebCore::GraphicsLayerCA::timingFunctionForAnimationValue): Updated to
return a reference rather than a pointer.
(WebCore::GraphicsLayerCA::setAnimationEndpoints): Updated for the above change.
(WebCore::GraphicsLayerCA::setAnimationKeyframes): Ditto.
(WebCore::GraphicsLayerCA::setTransformAnimationEndpoints): Ditto.
(WebCore::GraphicsLayerCA::setTransformAnimationKeyframes): Ditto.
(WebCore::GraphicsLayerCA::setFilterAnimationEndpoints): Ditto.
(WebCore::GraphicsLayerCA::setFilterAnimationKeyframes): Ditto.
* platform/graphics/ca/GraphicsLayerCA.h: Ditto.

* platform/ios/PlatformSpeechSynthesizerIOS.mm:
(-[WebSpeechSynthesisWrapper speakUtterance:]): CHanged argument to be a
RefPtr&& instead of a PassRefPtr.

* platform/mac/ThemeMac.mm:
(WebCore::sizeFromNSControlSize): Updated for LenghtSize struct.
(WebCore::checkboxSize): Ditto.
(WebCore::radioSize): Ditto.
(WebCore::ThemeMac::controlSize): Ditto.
(WebCore::ThemeMac::minimumControlSize): Ditto.

* platform/mac/WidgetMac.mm:
(WebCore::Widget::setFocus): Updated to pass a reference.

* platform/mock/DeviceMotionClientMock.cpp: Removed. Unused.
* platform/mock/DeviceMotionClientMock.h: Removed. Unused.

* platform/win/CursorWin.cpp:
(WebCore::createSharedCursor): Return a Ref instead of a PassRefPtr.
(WebCore::loadSharedCursor): Ditto.
(WebCore::loadCursorByName): Ditto.

* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::output): Removed a no-longer-needed const_cast.
(WebCore::FilterEffectRenderer::outputRect): Ditto.

* rendering/ImageQualityController.cpp:
(WebCore::ImageQualityController::chooseInterpolationQuality): Tweaked formatting.

* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paintFillLayers): Updated to take a reference. Also
used a vector to iterate the linked list in reverse order instead of recursion.
(WebCore::InlineFlowBox::paintFillLayer): Take a reference.
(WebCore::InlineFlowBox::paintMask):
* rendering/InlineFlowBox.h: Updated for the above.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintRootBoxFillLayers): Use auto a bit.
(WebCore::RenderBox::getBackgroundPaintedExtent): Use reference for the layers.
(WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect): Ditto.
(WebCore::RenderBox::backgroundHasOpaqueTopLayer): Ditto.
(WebCore::RenderBox::paintMaskImages): Ditto.
(WebCore::RenderBox::maskClipRect): Ditto.
(WebCore::RenderBox::paintFillLayers): Ditto.
(WebCore::RenderBox::paintFillLayer): Ditto.
(WebCore::layersUseImage): Ditto.
(WebCore::RenderBox::repaintLayerRectsForImage): Ditto.
* rendering/RenderBox.h: Updated for the above.

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended): Use reference for
the layers.
(WebCore::RenderBoxModelObject::calculateFillTileSize): Ditto.
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): Ditto.
(WebCore::RenderBoxModelObject::getGeometryForBackgroundImage): Ditto.
(WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground): Ditto.
* rendering/RenderBoxModelObject.h: Updated for the above.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::~RenderElement): Use references for the layers.
(WebCore::RenderElement::adjustStyleDifference): Ditto.
(WebCore::RenderElement::updateFillImages): Ditto.
(WebCore::RenderElement::setStyle): Use RenderStyle::replace to replace the
old style with the new style, and get the old one out at the same time.
(WebCore::RenderElement::styleDidChange): Use references for the layers.
(WebCore::mustRepaintFillLayers): Ditto.
(WebCore::RenderElement::repaintAfterLayoutIfNeeded): Ditto.
* rendering/RenderElement.h: Updated for the above.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeContentPositionAndDistributionOffset):
Refactor so we don't need so many functions in RenderStyle.
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::adjustInnerStyle): Ditto.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::createScrollbar): Pass widget as reference to addChild.
Also did a few other tweaks and used more specific types.

* rendering/RenderLayerBacking.cpp:
(WebCore::canCreateTiledImage): Updated since layers are references.
(WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage): Ditto.

* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::createScrollbar): Pass widget as reference to addChild.

* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paintBackgroundsBehindCell): Updated to use
references for layers.

* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle): Use WTFMove to pass a LengthBox.
(WebCore::RenderTheme::isControlStyled): Updated since LengthSize is a struct,
more WTFMove, change since layers are ferences.

* rendering/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::adjustSizeConstraints): Update for Length and
LengthSize changes.
(WebCore::RenderThemeEfl::paintThemePart): Use reference instead of pointer.
(WebCore::RenderThemeEfl::applyPartDescriptionFallback): Update for Length and
LengthSize changes.
(WebCore::RenderThemeEfl::applyPartDescription): Ditto.
(WebCore::RenderThemeEfl::adjustCheckboxStyle): Ditto.
(WebCore::RenderThemeEfl::adjustRadioStyle): Ditto.

* rendering/RenderThemeGtk.cpp:
(WebCore::borderRadiiFromStyle): Update for Length and LengthSize changes.

* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::adjustCheckboxStyle): Update for Length and
LengthSize changes.
(WebCore::RenderThemeIOS::isControlStyled): Ditto.
(WebCore::RenderThemeIOS::adjustRadioStyle): Ditto.
(WebCore::RenderThemeIOS::adjustRoundBorderRadius): Ditto.
(WebCore::RenderThemeIOS::paintMenuListButtonDecorations): Ditto.
(WebCore::RenderThemeIOS::adjustSliderTrackStyle): Ditto.
(WebCore::RenderThemeIOS::adjustSliderThumbSize): Ditto.

* rendering/RenderWidget.cpp:
(WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets): Use move
insteead of swap and modern for loop instead of iterators.
(WebCore::moveWidgetToParentSoon): Take a reference instead of a pointer.
(WebCore::RenderWidget::setWidget): Update for above change.
(WebCore::RenderWidget::find): Take a reference instead of a pointer.
* rendering/RenderWidget.h: Updated for above changes.

* rendering/TextAutoSizing.cpp:
(WebCore::TextAutoSizingValue::reset): Updated since Length is passed as
rvalue reference now.

* rendering/mathml/MathMLStyle.cpp:
(WebCore::MathMLStyle::getMathMLStyle): Updated since mathMLStyle returns
a reference.
(WebCore::MathMLStyle::resolveMathMLStyleTree): Ditto.

* rendering/mathml/RenderMathMLBlock.h:
(WebCore::RenderMathMLBlock::mathMLStyle): Removed no-longer needed const_cast,
changed to return a reference rather than a pointer.
(WebCore::RenderMathMLTable::mathMLStyle): Ditto.

* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::fractionParameters): Updated since mathMLStyle
returns a reference.
(WebCore::RenderMathMLFraction::stackParameters): Ditto.
* rendering/mathml/RenderMathMLOperator.h:
(WebCore::RenderMathMLOperator::isLargeOperatorInDisplayStyle): Ditto.
(WebCore::RenderMathMLOperator::shouldMoveLimits): Ditto.
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::verticalParameters): Ditto.
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::RenderMathMLToken::updateMathVariantGlyph): Ditto.

* rendering/style/BasicShapes.cpp:
(WebCore::floatSizeForLengthSize): Updated for LengthSize struct.
* rendering/style/BorderData.h:
(WebCore::BorderData::BorderData): Ditto.
(WebCore::BorderData::hasBorderRadius): Ditto.

* rendering/style/ContentData.cpp:
(WebCore::ContentData::clone): Updated member names.
* rendering/style/ContentData.h: Ditto.

* rendering/style/NinePieceImage.cpp:
(WebCore::NinePieceImage::computeSlices): Use initializer lists so we get
move optimization without requiring explicit WTFMove.

* rendering/style/DataRef.h:
(WebCore::DataRef::DataRef): Removed no-longer needed const_cast.
(WebCore::DataRef::replace): Added. This function is like Ref::replace, and
can be used to put a new value in and get an old value out without running into
the rule Ref has about not being reused once it becomes null because of being
moved out of. This function is a lot like std::exchange.
(WebCore::DataRef::operator const T&): Added operator so we can use these
as references without any function call in read-only contexts.
(WebCore::DataRef::get): Changed to return a reference rather than pointer.
(WebCore::DataRef::access): Ditto.

* rendering/style/KeyframeList.cpp:
(WebCore::KeyframeValue::timingFunction): Updated since timingFunction
returns a raw pointer.
(WebCore::KeyframeList::~KeyframeList): Removed unneeded call to clear,
which does things that are redundant since we are about to destroy all the
data members.
(WebCore::KeyframeList::operator==): Tweaked codign style a bit.

* rendering/style/NinePieceImage.h: Updated most functions in this class
for the changes to DataRef.

* rendering/style/RenderStyle.cpp: Updated nearly every function in this
class for the changes to DataRef, to eliminate the peculiar naming and use
our standard data member naming, m_memberName in a class, and memberName in a
struct or struct-like class for publicly accessible members, to pass, take,
and return more references and rvalue references, and to use modern for loops.
Other changes listed below function by function.
(WebCore::RenderStyle::defaultStyle): Use NeverDestroyed instead of allocating
on the heap.
(WebCore::RenderStyle::RenderStyle): Added a new constructor that performs
the replace operation, using a combination of DataRef::replace and std::exchange.
(WebCore::RenderStyle::replace): Added. Calls the above constructor.
(WebCore::RenderStyle::setScrollSnapType): Use SET_NESTED_VAR so we get equality
checks on this property, for the normal efficiency benefit.
(WebCore::RenderStyle::setDashboardRegion): Moved this here from the header.
(WebCore::RenderStyle::appendContent): Deleted.
(WebCore::RenderStyle::setContent): Refactored this set of functions to simplify.

* rendering/style/RenderStyle.h: Updated most functions as mentioned above.
Also updated macros to use the do/while(0) technique. Removed the long list of
friend classes with the elaborate comments; turned out none needed friendship
despite the comments. Made more things private. Moved large functions out of the
class definition.
(WebCore::RenderStyle::getTextShadowExtent): Deleted.
(WebCore::RenderStyle::getTextShadowHorizontalExtent): Deleted.
(WebCore::RenderStyle::getTextShadowVerticalExtent): Deleted.
(WebCore::RenderStyle::aspectRatio): Deleted.
(WebCore::RenderStyle::alignContentPosition): Deleted.
(WebCore::RenderStyle::alignContentDistribution): Deleted.
(WebCore::RenderStyle::alignContentOverflowAlignment): Deleted.
(WebCore::RenderStyle::alignItemsPosition): Deleted.
(WebCore::RenderStyle::alignItemsOverflowAlignment): Deleted.
(WebCore::RenderStyle::alignSelfPosition): Deleted.
(WebCore::RenderStyle::alignSelfOverflowAlignment): Deleted.
(WebCore::RenderStyle::justifyContentPosition): Deleted.
(WebCore::RenderStyle::justifyContentDistribution): Deleted.
(WebCore::RenderStyle::justifyContentOverflowAlignment): Deleted.
(WebCore::RenderStyle::justifyItemsPosition): Deleted.
(WebCore::RenderStyle::justifyItemsOverflowAlignment): Deleted.
(WebCore::RenderStyle::justifyItemsPositionType): Deleted.
(WebCore::RenderStyle::justifySelfPosition): Deleted.
(WebCore::RenderStyle::justifySelfOverflowAlignment): Deleted.
(WebCore::RenderStyle::setAlignContentPosition): Deleted.
(WebCore::RenderStyle::setAlignContentOverflow): Deleted.
(WebCore::RenderStyle::setAlignContentDistribution): Deleted.
(WebCore::RenderStyle::setAlignItemsOverflow): Deleted.
(WebCore::RenderStyle::setAlignSelfOverflow): Deleted.
(WebCore::RenderStyle::setJustifyContentOverflow): Deleted.
(WebCore::RenderStyle::setJustifyContentDistribution): Deleted.
(WebCore::RenderStyle::setJustifyItemsPosition): Deleted.
(WebCore::RenderStyle::setJustifyItemsOverflow): Deleted.
(WebCore::RenderStyle::setJustifyItemsPositionType): Deleted.
(WebCore::RenderStyle::setJustifySelfPosition): Deleted.
(WebCore::RenderStyle::setJustifySelfOverflow): Deleted.
(WebCore::RenderStyle::noninheritedFlagsMemoryOffset): Deleted.

* rendering/style/SVGRenderStyle.cpp: Similar changes to RenderStyle.cpp above.
* rendering/style/SVGRenderStyle.h: Ditto.

* rendering/style/ShapeValue.h:
(WebCore::ShapeValue::create): Take a Ref&& instead of a RefPtr.
(WebCore::ShapeValue::ShapeValue): Ditto.

* rendering/style/StyleBackgroundData.cpp: Update data member names.
* rendering/style/StyleBackgroundData.h: Ditto; make them public and remove the
getter functions.

* rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::cssValue): Removed no-longer-needed const_cast.

* rendering/style/StyleCustomPropertyData.h: Update data member names.
(WebCore::StyleCustomPropertyData::operator==): Removed unnecessary reference
count churn.
(WebCore::StyleCustomPropertyData::setCustomPropertyValue): Take an rvalue
reference.
(WebCore::StyleCustomPropertyData::getCustomPropertyValue): Deleted.
(WebCore::StyleCustomPropertyData::values): Deleted.
(WebCore::StyleCustomPropertyData::hasCustomProperty): Deleted.
(WebCore::StyleCustomPropertyData::containsVariables): Deleted.
(WebCore::StyleCustomPropertyData::setContainsVariables): Deleted.

* rendering/style/StyleFilterData.cpp: Update data member names.
* rendering/style/StyleFilterData.h: Ditto.
* rendering/style/StyleFlexibleBoxData.cpp: Ditto.
* rendering/style/StyleFlexibleBoxData.h: Ditto.
* rendering/style/StyleGridData.cpp: Ditto.
* rendering/style/StyleGridData.h: Ditto.
* rendering/style/StyleGridItemData.cpp: Ditto.
* rendering/style/StyleGridItemData.h: Ditto.

* rendering/style/StyleGeneratedImage.cpp:
(WebCore::StyleGeneratedImage::cssValue): Removed no-longer-needed const_cast.
(WebCore::StyleGeneratedImage::imageSize): Ditto.
(WebCore::StyleGeneratedImage::image): Ditto.

* rendering/style/StyleInheritedData.cpp: Update data member names.
* rendering/style/StyleInheritedData.h: Ditto.
* rendering/style/StyleRareInheritedData.cpp: Ditto.
* rendering/style/StyleRareInheritedData.h: Ditto.
* rendering/style/StyleMultiColData.cpp: Ditto.
* rendering/style/StyleMultiColData.h: Ditto.
* rendering/style/StyleRareNonInheritedData.cpp: Ditto.
* rendering/style/StyleRareNonInheritedData.h: Ditto.
* rendering/style/StyleTransformData.cpp: Ditto.
* rendering/style/StyleTransformData.h: Ditto.
* rendering/style/StyleVisualData.cpp: Ditto.
* rendering/style/StyleVisualData.h: Ditto.

* style/StylePendingResources.cpp:
(WebCore::Style::loadPendingResources): Update since layers are references.

Source/WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.mm:
(NetscapePluginWidget::handleEvent): Pass a reference.
* WebView/WebView.mm:
(-[WebView _addScrollerDashboardRegionsForFrameView:dashboardRegions:]):
Updated since the children set now contains Ref instead of RefPtr.

Source/WebKit2:

* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
(IPC::ArgumentCoder<TextureMapperAnimation>::encode): Updated since timing function
returns a raw pointer.
(IPC::ArgumentCoder<TextureMapperAnimation>::decode): Updated since timing function
setters now takes an rvalue reference.

* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
(WebKit::PDFPlugin::createScrollbar): Updated since addChild now takes a reference.

Source/WTF:

* wtf/Ref.h: Changed the template so that a const Ref<T> does not prohibit non-const
use of T. We can still use const Ref<const T> to express that. The earlier design
was intentional, but was not consistent with either actual references or with
other smart pointer classes like RefPtr. One way to see how much better this is,
is to see all the many, many cases where we have const_cast just to work around
this. I searched for those and included fixes for many in this patch.

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

3 years ago26 MotionMark performance tests failing
commit-queue@webkit.org [Sat, 14 Jan 2017 03:17:54 +0000 (03:17 +0000)]
26 MotionMark performance tests failing
https://bugs.webkit.org/show_bug.cgi?id=166854

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-01-13
Reviewed by Ryosuke Niwa.
PerformanceTests:

Skip running MotionMark on WebKit perf bots.

* Skipped:

Tools:

Unrelated change. This is the last place that we need to rename Animometer
to MotionMark.

* Scripts/webkitpy/common/config/watchlist:

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

3 years agoWeb Inspector: the 'lock' icon for non-editable rules in the Style Rules sidebar...
nvasilyev@apple.com [Sat, 14 Jan 2017 03:07:31 +0000 (03:07 +0000)]
Web Inspector: the 'lock' icon for non-editable rules in the Style Rules sidebar lacks a tooltip
https://bugs.webkit.org/show_bug.cgi?id=166909
<rdar://problem/29959406>

Reviewed by Matt Baker.

Convert the lock icon from a pseudo-element to an 'img' element and add a title attribute.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/CSSStyleDeclarationSection.css:
(.style-declaration-section.locked > .header > .locked-icon):
(.style-declaration-section.locked > .header::before): Deleted.
* UserInterface/Views/CSSStyleDeclarationSection.js:
(WebInspector.CSSStyleDeclarationSection):

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

3 years agoInstrument calls to render()
rniwa@webkit.org [Sat, 14 Jan 2017 02:53:57 +0000 (02:53 +0000)]
Instrument calls to render()
https://bugs.webkit.org/show_bug.cgi?id=167037

Reviewed by Sam Weinig.

Wrap every call to render() by newly added ComponentBase.updateRendering() to instrument it.
Also, use arrow functions instead of this.render.bind or regular closures for simplicity.

Currently, we're making 5100 calls to render() while opening the summary page, and that's way too high.

* public/v3/components/analysis-results-viewer.js:
(AnalysisResultsViewer.prototype._expandBetween):
* public/v3/components/bar-graph-group.js:
(BarGraphGroup.prototype.updateGroupRendering): Renamed form render() as BarGraphGroup is not a component.
* public/v3/components/base.js:
(ComponentBase.prototype.updateRendering): Added. Instruments render() call.
* public/v3/components/chart-pane-base.js:
(ChartPaneBase.prototype.fetchAnalysisTasks):
(ChartPaneBase.prototype._mainSelectionDidZoom):
(ChartPaneBase.prototype._updateStatus):
(ChartPaneBase.prototype._requestOpeningCommitViewer):
(ChartPaneBase.prototype._keyup):
(ChartPaneBase.prototype.render):
* public/v3/components/commit-log-viewer.js:
* public/v3/components/customizable-test-group-form.js:
(CustomizableTestGroupForm):
(CustomizableTestGroupForm.prototype._customize):
* public/v3/components/editable-text.js:
(EditableText.prototype._didUpdate):
* public/v3/components/pane-selector.js:
(PaneSelector.prototype._selectedItem):
* public/v3/components/results-table.js:
(ResultsTable.prototype.render):
* public/v3/components/time-series-chart.js:
(TimeSeriesChart._renderEnqueuedCharts):
* public/v3/pages/analysis-category-page.js:
(AnalysisCategoryPage.prototype.open):
(AnalysisCategoryPage.prototype.updateFromSerializedState):
(AnalysisCategoryPage.prototype.filterDidChange):
(AnalysisCategoryPage.prototype.render):
* public/v3/pages/analysis-task-page.js:
(AnalysisTaskChartPane.prototype._updateStatus):
(AnalysisTaskPage.prototype.updateFromSerializedState):
(AnalysisTaskPage.prototype._didFetchTask):
(AnalysisTaskPage.prototype._didFetchRelatedAnalysisTasks):
(AnalysisTaskPage.prototype._didFetchMeasurement):
(AnalysisTaskPage.prototype._didFetchTestGroups):
(AnalysisTaskPage.prototype._showAllTestGroups):
(AnalysisTaskPage.prototype._didFetchAnalysisResults):
(AnalysisTaskPage.prototype.render):
(AnalysisTaskPage.prototype._renderTestGroupList.):
(AnalysisTaskPage.prototype._renderTestGroupList):
(AnalysisTaskPage.prototype._createTestGroupListItem):
(AnalysisTaskPage.prototype._showTestGroup):
(AnalysisTaskPage.prototype._didStartEditingTaskName):
(AnalysisTaskPage.prototype._updateTaskName):
(AnalysisTaskPage.prototype._updateTestGroupName):
(AnalysisTaskPage.prototype._hideCurrentTestGroup):
(AnalysisTaskPage.prototype._updateChangeType):
(AnalysisTaskPage.prototype._associateBug):
(AnalysisTaskPage.prototype._dissociateBug):
(AnalysisTaskPage.prototype._associateCommit):
(AnalysisTaskPage.prototype._dissociateCommit):
(AnalysisTaskPage.prototype._chartSelectionDidChange):
(AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer):
* public/v3/pages/build-request-queue-page.js:
(BuildRequestQueuePage.prototype.open.):
(BuildRequestQueuePage.prototype.open):
* public/v3/pages/chart-pane.js:
(ChartPane.prototype.setOpenRepository):
(ChartPane.prototype._trendLineTypeDidChange):
(ChartPane.prototype._updateTrendLine):
* public/v3/pages/charts-page.js:
(ChartsPage.prototype.updateFromSerializedState):
(ChartsPage.prototype._updateDomainsFromSerializedState):
(ChartsPage.prototype.setNumberOfDaysFromToolbar):
(ChartsPage.prototype._didMutatePaneList):
(ChartsPage.prototype.render):
* public/v3/pages/charts-toolbar.js:
(ChartsToolbar.prototype.render):
* public/v3/pages/create-analysis-task-page.js:
(CreateAnalysisTaskPage.prototype.updateFromSerializedState):
* public/v3/pages/dashboard-page.js:
(DashboardPage.prototype.updateFromSerializedState):
(DashboardPage.prototype._fetchedData):
* public/v3/pages/heading.js:
(Heading.prototype.render):
* public/v3/pages/page-with-heading.js:
(PageWithHeading.prototype.render):
* public/v3/pages/page.js:
(Page.prototype.open):
* public/v3/pages/summary-page.js:
(SummaryPage.prototype.open):
(SummaryPage.prototype.this._renderQueue.push):
(SummaryPage):
(SummaryPage.prototype._renderCell):

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

3 years agoMarking inspector/worker/debugger-scripts.html as flaky on macOS.
ryanhaddad@apple.com [Sat, 14 Jan 2017 01:32:50 +0000 (01:32 +0000)]
Marking inspector/worker/debugger-scripts.html as flaky on macOS.
https://trac.webkit.org/changeset/209517

Unreviewed test gardening.

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

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

3 years ago[WK2] Add diagnostic logging to measure WebGL usage
cdumez@apple.com [Sat, 14 Jan 2017 01:05:32 +0000 (01:05 +0000)]
[WK2] Add diagnostic logging to measure WebGL usage
https://bugs.webkit.org/show_bug.cgi?id=166730
<rdar://problem/29883469>

Reviewed by Alex Christensen.

Add diagnostic logging to measure high performance WebGL usage. We report
at regular intervals in which WebGL state Safari is:
- Inactive
- ActiveInForegroundTab
- ActiveInBackgroundTabOnly

This should give us an estimate of:
- What % of the time is Safari using high performance graphics
- What % of this time is only due to background tabs

Source/WebCore:

No new tests, no Web-facing behavior change.

* WebCore.xcodeproj/project.pbxproj:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::registerWithWebGLStateTracker):
* html/canvas/WebGLRenderingContextBase.h:
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::inactiveKey):
(WebCore::DiagnosticLoggingKeys::activeInForegroundTabKey):
(WebCore::DiagnosticLoggingKeys::activeInBackgroundTabOnlyKey):
(WebCore::DiagnosticLoggingKeys::stateKey):
(WebCore::WebCore::DiagnosticLoggingKeys::webGLKey):
* page/DiagnosticLoggingKeys.h:
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::webGLStateTracker):
* page/PageConfiguration.cpp:
* page/PageConfiguration.h:
* platform/WebGLStateTracker.cpp: Copied from Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h.
(WebCore::WebGLStateTracker::WebGLStateTracker):
(WebCore::m_stateChangeHandler):
(WebCore::WebGLStateTracker::updateWebGLState):
* platform/WebGLStateTracker.h: Copied from Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h.
* platform/graphics/GraphicsContext3DAttributes.h:

Source/WebKit2:

* UIProcess/HighPerformanceGraphicsUsageSampler.cpp: Added.
(WebKit::HighPerformanceGraphicsUsageSampler::HighPerformanceGraphicsUsageSampler):
(WebKit::HighPerformanceGraphicsUsageSampler::timerFired):
* UIProcess/HighPerformanceGraphicsUsageSampler.h: Copied from Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::setIsUsingHighPerformanceWebGL):
(WebKit::WebPageProxy::isUsingHighPerformanceWebGL):
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::m_highPerformanceGraphicsUsageSampler):
* UIProcess/WebProcessPool.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_userInterfaceLayoutDirection):

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

3 years agoUnreviewed, rolling out r210735.
ryanhaddad@apple.com [Sat, 14 Jan 2017 01:03:17 +0000 (01:03 +0000)]
Unreviewed, rolling out r210735.

This change introduced LayoutTest and JSC test flakiness.

Reverted changeset:

"Reserve capacity for StringBuilder in unescape"
https://bugs.webkit.org/show_bug.cgi?id=167008
http://trac.webkit.org/changeset/210735

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

3 years agoImport innerText/ w3c web-platform-tests
cdumez@apple.com [Sat, 14 Jan 2017 00:46:12 +0000 (00:46 +0000)]
Import innerText/ w3c web-platform-tests
https://bugs.webkit.org/show_bug.cgi?id=167024

Reviewed by Alex Christensen.

Import innerText/ w3c web-platform-tests from upstream 4b4b2eeb.

* web-platform-tests/innerText/getter-expected.txt: Added.
* web-platform-tests/innerText/getter-tests.js: Added.
(CSS.supports):
* web-platform-tests/innerText/getter.html: Added.
* web-platform-tests/innerText/setter-expected.txt: Added.
* web-platform-tests/innerText/setter-tests.js: Added.
(string_appeared_here.forEach):
* web-platform-tests/innerText/setter.html: Added.
* web-platform-tests/innerText/w3c-import.log: Added.

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

3 years agoAvoid nullptr frame dereference when scrollTo is called on a disconnected DOMWindow
bfulgham@apple.com [Sat, 14 Jan 2017 00:36:53 +0000 (00:36 +0000)]
Avoid nullptr frame dereference when scrollTo is called on a disconnected DOMWindow
https://bugs.webkit.org/show_bug.cgi?id=167030
<rdar://problem/29995070>

Reviewed by Dean Jackson.

Correct DOMWindow::scrollTo to match all other functions in the class so that the it
checks that the current frame is valid before attempting to use it.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::scrollTo):

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

3 years agoResync domparsing/ web-platform-tests from upstream
cdumez@apple.com [Sat, 14 Jan 2017 00:16:10 +0000 (00:16 +0000)]
Resync domparsing/ web-platform-tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=167023

Reviewed by Alex Christensen.

Resync domparsing/ web-platform-tests from upstream 4b4b2eeb.

* web-platform-tests/domparsing/DOMParser-parseFromString-xml-doctype-expected.txt: Added.
* web-platform-tests/domparsing/DOMParser-parseFromString-xml-doctype.html: Added.
* web-platform-tests/domparsing/DOMParser-parseFromString-xml-expected.txt: Added.
* web-platform-tests/domparsing/DOMParser-parseFromString-xml.html: Added.
* web-platform-tests/domparsing/XMLSerializer-serializeToString-expected.txt: Added.
* web-platform-tests/domparsing/XMLSerializer-serializeToString.html: Added.
* web-platform-tests/domparsing/createContextualFragment-expected.txt:
* web-platform-tests/domparsing/createContextualFragment.html:
* web-platform-tests/domparsing/insert_adjacent_html-xhtml-expected.txt: Added.
* web-platform-tests/domparsing/insert_adjacent_html-xhtml.xhtml: Added.
* web-platform-tests/domparsing/style_attribute_html-expected.txt: Added.
* web-platform-tests/domparsing/style_attribute_html.html: Added.
* web-platform-tests/domparsing/w3c-import.log:

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

3 years agoUse a strong reference when calling callOnMainThread to schedule events in AudioSched...
jer.noble@apple.com [Fri, 13 Jan 2017 23:46:22 +0000 (23:46 +0000)]
Use a strong reference when calling callOnMainThread to schedule events in AudioScheduledSourceNode.
https://bugs.webkit.org/show_bug.cgi?id=166983

Reviewed by Brent Fulgham.

* Modules/webaudio/AudioScheduledSourceNode.cpp:
(WebCore::AudioScheduledSourceNode::finish):
* Modules/webaudio/AudioScheduledSourceNode.h:

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

3 years agoProtect MediaPlayer from being destroyed mid-load()
jer.noble@apple.com [Fri, 13 Jan 2017 23:42:02 +0000 (23:42 +0000)]
Protect MediaPlayer from being destroyed mid-load()
https://bugs.webkit.org/show_bug.cgi?id=166976

Reviewed by Eric Carlson.

It's possible for a message sent by MediaPlayer to HTMLMediaElement to cause
MediaPlayer to be destroyed before MediaPlayer::load() completes. We have
previously protected against this same problem in HTMLMediaElement::loadResource()
by ref'ing at the beginning of the function and deref'ing on exit. To do the
same in MediaPlayer, it must become RefCounted.

To keep the same semantics about m_client in MediaPlayer (always available without
requiring a null-check), make a new static MediaPlayerClient object which can
replace the real (HTMLMediaElement) client when the MediaPlayer is invalidated.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement):
(WebCore::HTMLMediaElement::clearMediaPlayer):
(WebCore::HTMLMediaElement::createMediaPlayer):
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::nullMediaPlayerClient):
(WebCore::MediaPlayer::create):
(WebCore::MediaPlayer::MediaPlayer):
(WebCore::MediaPlayer::invalidate):
(WebCore::MediaPlayer::load):
(WebCore::MediaPlayer::loadWithNextMediaEngine):
(WebCore::MediaPlayer::inMediaDocument):
(WebCore::MediaPlayer::fullscreenMode):
(WebCore::MediaPlayer::requestedRate):
(WebCore::MediaPlayer::currentPlaybackTargetIsWirelessChanged):
(WebCore::MediaPlayer::networkStateChanged):
(WebCore::MediaPlayer::readyStateChanged):
(WebCore::MediaPlayer::volumeChanged):
(WebCore::MediaPlayer::muteChanged):
(WebCore::MediaPlayer::timeChanged):
(WebCore::MediaPlayer::sizeChanged):
(WebCore::MediaPlayer::repaint):
(WebCore::MediaPlayer::durationChanged):
(WebCore::MediaPlayer::rateChanged):
(WebCore::MediaPlayer::playbackStateChanged):
(WebCore::MediaPlayer::firstVideoFrameAvailable):
(WebCore::MediaPlayer::characteristicChanged):
(WebCore::MediaPlayer::cachedKeyForKeyId):
(WebCore::MediaPlayer::keyNeeded):
(WebCore::MediaPlayer::mediaKeysStorageDirectory):
(WebCore::MediaPlayer::referrer):
(WebCore::MediaPlayer::userAgent):
(WebCore::MediaPlayer::graphicsDeviceAdapter):
(WebCore::MediaPlayer::cachedResourceLoader):
(WebCore::MediaPlayer::createResourceLoader):
(WebCore::MediaPlayer::addAudioTrack):
(WebCore::MediaPlayer::removeAudioTrack):
(WebCore::MediaPlayer::addTextTrack):
(WebCore::MediaPlayer::removeTextTrack):
(WebCore::MediaPlayer::addVideoTrack):
(WebCore::MediaPlayer::removeVideoTrack):
(WebCore::MediaPlayer::outOfBandTrackSources):
(WebCore::MediaPlayer::shouldWaitForResponseToAuthenticationChallenge):
(WebCore::MediaPlayer::handlePlaybackCommand):
(WebCore::MediaPlayer::sourceApplicationIdentifier):
(WebCore::MediaPlayer::preferredAudioCharacteristics):
(WebCore::MediaPlayer::doesHaveAttribute):
(WebCore::MediaPlayer::mediaPlayerNetworkInterfaceName):
(WebCore::MediaPlayer::getRawCookies):
(WebCore::MediaPlayer::shouldDisableSleep):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayer::platformVolumeConfigurationRequired):
(WebCore::MediaPlayer::client):

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

3 years agobmalloc: Use a separate zone when using system malloc
ggaren@apple.com [Fri, 13 Jan 2017 23:39:09 +0000 (23:39 +0000)]
bmalloc: Use a separate zone when using system malloc
https://bugs.webkit.org/show_bug.cgi?id=167014

Reviewed by Filip Pizlo.

Harris asked for this so he could separate Safari and WebKit memory use
when doing memory analysis.

This patch adds an explicit DebugHeap class that contains all our
code for specialized allocation with debugging.

* bmalloc.xcodeproj/project.pbxproj:

* bmalloc/Allocator.cpp:
(bmalloc::Allocator::Allocator):
(bmalloc::Allocator::tryAllocate):
(bmalloc::Allocator::allocateImpl):
(bmalloc::Allocator::reallocate):
(bmalloc::Allocator::allocateSlowCase):
* bmalloc/Allocator.h: Forward to DebugHeap instead of inlining all the
code. This is required for our new interface, and it is also a nice
simplification that moves some not-very-important code out of the way.

* bmalloc/Deallocator.cpp:
(bmalloc::Deallocator::Deallocator):
(bmalloc::Deallocator::scavenge):
(bmalloc::Deallocator::deallocateSlowCase):
* bmalloc/Deallocator.h: Ditto.

* bmalloc/DebugHeap.cpp: Added.
(bmalloc::DebugHeap::DebugHeap):
(bmalloc::DebugHeap::malloc):
(bmalloc::DebugHeap::memalign):
(bmalloc::DebugHeap::realloc):
(bmalloc::DebugHeap::free):
* bmalloc/DebugHeap.h: Added. New class for overriding normal heap
behavior. Right now, it just adds a malloc zone and then forwards to
system malloc -- but we can add lots more kinds of debug heaps in the
future if we find them useful.

* bmalloc/Environment.cpp:
(bmalloc::Environment::Environment):
(bmalloc::Environment::computeIsDebugHeapEnabled):
(bmalloc::Environment::computeIsBmallocEnabled): Deleted.
* bmalloc/Environment.h:
(bmalloc::Environment::isDebugHeapEnabled):
(bmalloc::Environment::isBmallocEnabled): Deleted. Renamed everything to
reflect our new use of DebugHeap.

* bmalloc/Heap.cpp:
(bmalloc::Heap::Heap):
* bmalloc/Heap.h:
(bmalloc::Heap::debugHeap): Updated to use DebugHeap.
(bmalloc::Heap::environment): Deleted.

* bmalloc/bmalloc.h:
(bmalloc::api::isEnabled): Updated to use DebugHeap.

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

3 years agoInitialize the ArraySpecies watchpoint as Clear and transition to IsWatched once...
sbarati@apple.com [Fri, 13 Jan 2017 23:30:45 +0000 (23:30 +0000)]
Initialize the ArraySpecies watchpoint as Clear and transition to IsWatched once slice is called for the first time
https://bugs.webkit.org/show_bug.cgi?id=167017
<rdar://problem/30019309>

Reviewed by Keith Miller and Filip Pizlo.

This patch is to reverse the JSBench regression from r210695.

The new state diagram for the array species watchpoint is as
follows:

1. On GlobalObject construction, it starts life out as ClearWatchpoint.
2. When slice is called for the first time, we observe the state
of the world, and either transition it to IsWatched if we were able
to set up the object property conditions, or to IsInvalidated if we
were not.
3. The DFG compiler will now only lower slice as an intrinsic if
it observed the speciesWatchpoint.state() as IsWatched.
4. The IsWatched => IsInvalidated transition happens only when
one of the object property condition watchpoints fire.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* runtime/ArrayPrototype.cpp:
(JSC::speciesWatchpointIsValid):
(JSC::speciesConstructArray):
(JSC::arrayProtoPrivateFuncConcatMemcpy):
(JSC::ArrayPrototype::tryInitializeSpeciesWatchpoint):
(JSC::ArrayPrototype::initializeSpeciesWatchpoint): Deleted.
* runtime/ArrayPrototype.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::JSGlobalObject):
(JSC::JSGlobalObject::init):

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

3 years ago[MediaStream, Mac] Add mock audio source
eric.carlson@apple.com [Fri, 13 Jan 2017 21:27:30 +0000 (21:27 +0000)]
[MediaStream, Mac] Add mock audio source
https://bugs.webkit.org/show_bug.cgi?id=166974

Reviewed by Jer Noble.
Source/WebCore:

Add a mock audio source for testing media streams.

No new tests, updated webaudio/mediastreamaudiosourcenode.html.

* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueAudioSample):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):

* platform/mediastream/mac/AVAudioCaptureSource.h:
(WebCore::AVAudioCaptureSource::Observer::~Observer): Deleted.

* platform/mediastream/mac/AVAudioCaptureSource.mm:
(WebCore::AVAudioCaptureSource::addObserver):
(WebCore::AVAudioCaptureSource::removeObserver):
(WebCore::AVAudioCaptureSource::start):

* platform/mediastream/mac/MockRealtimeAudioSourceMac.h: Added.
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm: Added.
(WebCore::MockRealtimeAudioSource::create):
(WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac):
(WebCore::MockRealtimeAudioSource::createMuted):
(WebCore::MockRealtimeAudioSourceMac::addObserver):
(WebCore::MockRealtimeAudioSourceMac::removeObserver):
(WebCore::MockRealtimeAudioSourceMac::start):
(WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers):
(WebCore::MockRealtimeAudioSourceMac::reconfigure):
(WebCore::MockRealtimeAudioSourceMac::render):
(WebCore::MockRealtimeAudioSourceMac::applySampleRate):
(WebCore::MockRealtimeAudioSourceMac::audioSourceProvider):

* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
(WebCore::WebAudioSourceProviderAVFObjC::create):
(WebCore::WebAudioSourceProviderAVFObjC::WebAudioSourceProviderAVFObjC):
(WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC):
(WebCore::WebAudioSourceProviderAVFObjC::provideInput):
(WebCore::WebAudioSourceProviderAVFObjC::setClient):
(WebCore::WebAudioSourceProviderAVFObjC::startProducingData): Deleted.
(WebCore::WebAudioSourceProviderAVFObjC::stopProducingData): Deleted.

* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource):
(WebCore::MockRealtimeAudioSource::startProducingData):
(WebCore::MockRealtimeAudioSource::stopProducingData):
(WebCore::MockRealtimeAudioSource::elapsedTime):
(WebCore::MockRealtimeAudioSource::tick):

* platform/mock/MockRealtimeAudioSource.h:
(WebCore::MockRealtimeAudioSource::render):
(WebCore::MockRealtimeAudioSource::renderInterval):
(WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource): Deleted.

LayoutTests:

* webaudio/mediastreamaudiosourcenode-expected.txt:
* webaudio/mediastreamaudiosourcenode.html:

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

3 years ago[WebIDL] Remove custom bindings for DeviceMotionEvent and DeviceOrientationEvent
weinig@apple.com [Fri, 13 Jan 2017 21:19:55 +0000 (21:19 +0000)]
[WebIDL] Remove custom bindings for DeviceMotionEvent and DeviceOrientationEvent
https://bugs.webkit.org/show_bug.cgi?id=167006

Reviewed by Geoffrey Garen.

Source/WebCore:

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSDeviceMotionEventCustom.cpp: Removed.
* bindings/js/JSDeviceOrientationEventCustom.cpp: Removed.
Remove Custom bindings files.

* dom/DeviceMotionData.cpp:
(WebCore::DeviceMotionData::create):
(WebCore::DeviceMotionData::DeviceMotionData):
(WebCore::DeviceMotionData::Acceleration::create): Deleted.
(WebCore::DeviceMotionData::Acceleration::Acceleration): Deleted.
(WebCore::DeviceMotionData::RotationRate::create): Deleted.
(WebCore::DeviceMotionData::RotationRate::RotationRate): Deleted.
* dom/DeviceMotionData.h:
(WebCore::DeviceMotionData::Acceleration::create):
(WebCore::DeviceMotionData::Acceleration::x):
(WebCore::DeviceMotionData::Acceleration::y):
(WebCore::DeviceMotionData::Acceleration::z):
(WebCore::DeviceMotionData::Acceleration::Acceleration):
(WebCore::DeviceMotionData::RotationRate::create):
(WebCore::DeviceMotionData::RotationRate::alpha):
(WebCore::DeviceMotionData::RotationRate::beta):
(WebCore::DeviceMotionData::RotationRate::gamma):
(WebCore::DeviceMotionData::RotationRate::RotationRate):
(WebCore::DeviceMotionData::interval):
(WebCore::DeviceMotionData::Acceleration::canProvideX): Deleted.
(WebCore::DeviceMotionData::Acceleration::canProvideY): Deleted.
(WebCore::DeviceMotionData::Acceleration::canProvideZ): Deleted.
(WebCore::DeviceMotionData::RotationRate::canProvideAlpha): Deleted.
(WebCore::DeviceMotionData::RotationRate::canProvideBeta): Deleted.
(WebCore::DeviceMotionData::RotationRate::canProvideGamma): Deleted.
(WebCore::DeviceMotionData::canProvideInterval): Deleted.
Re-work using std::optional rather than an explicit bool/value pair.

* dom/DeviceMotionEvent.cpp:
(WebCore::convert):
(WebCore::DeviceMotionEvent::acceleration):
(WebCore::DeviceMotionEvent::accelerationIncludingGravity):
(WebCore::DeviceMotionEvent::rotationRate):
(WebCore::DeviceMotionEvent::interval):
(WebCore::DeviceMotionEvent::initDeviceMotionEvent):
* dom/DeviceMotionEvent.h:
Implement IDL interface. For now, we have duplicate structs for
Acceleration and RotationRate (one here, one in DeviceMotionData)
which can be consolidated in the future.

* dom/DeviceMotionEvent.idl:
Add dictionaries for Acceleration and RotationRate, and update IDL to
specify the correct nullability of attributes and arguments.

* dom/DeviceOrientationData.cpp:
(WebCore::DeviceOrientationData::create):
(WebCore::DeviceOrientationData::DeviceOrientationData):
(WebCore::DeviceOrientationData::alpha): Deleted.
(WebCore::DeviceOrientationData::beta): Deleted.
(WebCore::DeviceOrientationData::gamma): Deleted.
(WebCore::DeviceOrientationData::absolute): Deleted.
(WebCore::DeviceOrientationData::canProvideAlpha): Deleted.
(WebCore::DeviceOrientationData::canProvideBeta): Deleted.
(WebCore::DeviceOrientationData::canProvideGamma): Deleted.
(WebCore::DeviceOrientationData::compassHeading): Deleted.
(WebCore::DeviceOrientationData::compassAccuracy): Deleted.
(WebCore::DeviceOrientationData::canProvideCompassHeading): Deleted.
(WebCore::DeviceOrientationData::canProvideCompassAccuracy): Deleted.
(WebCore::DeviceOrientationData::canProvideAbsolute): Deleted.
* dom/DeviceOrientationData.h:
(WebCore::DeviceOrientationData::create):
(WebCore::DeviceOrientationData::alpha):
(WebCore::DeviceOrientationData::beta):
(WebCore::DeviceOrientationData::gamma):
(WebCore::DeviceOrientationData::compassHeading):
(WebCore::DeviceOrientationData::compassAccuracy):
(WebCore::DeviceOrientationData::absolute):
Re-work using std::optional rather than an explicit bool/value pair.

* dom/DeviceOrientationEvent.cpp:
(WebCore::DeviceOrientationEvent::alpha):
(WebCore::DeviceOrientationEvent::beta):
(WebCore::DeviceOrientationEvent::gamma):
(WebCore::DeviceOrientationEvent::compassHeading):
(WebCore::DeviceOrientationEvent::compassAccuracy):
(WebCore::DeviceOrientationEvent::initDeviceOrientationEvent):
(WebCore::DeviceOrientationEvent::absolute):
* dom/DeviceOrientationEvent.h:
Implement IDL interface.

* dom/DeviceOrientationEvent.idl:
Update IDL to specify the correct nullability of attributes and arguments.

* platform/ios/DeviceMotionClientIOS.mm:
(WebCore::DeviceMotionClientIOS::motionChanged):
* platform/ios/DeviceOrientationClientIOS.mm:
(WebCore::DeviceOrientationClientIOS::orientationChanged):
Update for use of std:optional.

Source/WebKit/mac:

* WebView/WebDeviceOrientation.mm:
(convert):
(-[WebDeviceOrientation initWithCanProvideAlpha:alpha:canProvideBeta:beta:canProvideGamma:gamma:]):
Update for new use of std::optional.

LayoutTests:

* fast/dom/DeviceMotion/optional-event-properties-expected.txt:
* fast/dom/DeviceMotion/script-tests/optional-event-properties.js:
Update test to account for slightly stricter, but more consistent IDL conversion rules.

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

3 years ago[GStreamer] Cache the accelerated capability of MediaPlayerClient in MediaPlayerPriva...
zandobersek@gmail.com [Fri, 13 Jan 2017 20:53:15 +0000 (20:53 +0000)]
[GStreamer] Cache the accelerated capability of MediaPlayerClient in MediaPlayerPrivateGStreamerBase
https://bugs.webkit.org/show_bug.cgi?id=167015

Reviewed by Jer Noble.

In MediaPlayerPrivateGStreamerBase, avoid continuously querying the MediaPlayerClient
object about the accelerated compositing capabilities. Instead, cache this information
when creating the video sink (which is most affected by this information anyway), storing
it in a new protected boolean member variable in the MediaPlayerPrivateGStreamerBase class.

All calls to MediaPlayerClient::mediaPlayerRenderingCanBeAccelerated() and
MediaPlayerClient::mediaPlayerAcceleratedCompositingEnabled() are replaced by tests
on the value of this new member variable.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::naturalSize):
(WebCore::MediaPlayerPrivateGStreamerBase::repaint):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
(WebCore::MediaPlayerPrivateGStreamerBase::paint):
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:

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

3 years agoDefer use of autoplay heuristics to clients
commit-queue@webkit.org [Fri, 13 Jan 2017 19:16:34 +0000 (19:16 +0000)]
Defer use of autoplay heuristics to clients
https://bugs.webkit.org/show_bug.cgi?id=167010

Patch by Matt Rajca <mrajca@apple.com> on 2017-01-13
Reviewed by Alex Christensen.

Switch the autoplay policy tristate to an on/off option since clients should run any
heuristics and simply send their final decision to WebKit.

* Shared/WebsitePolicies.h:
(WebKit::WebsitePolicies::encode):
(WebKit::WebsitePolicies::decode):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesGetAutoplayEnabled):
(WKWebsitePoliciesSetAutoplayEnabled):
(WKWebsitePoliciesGetAutoplayPolicy): Replaced.
(WKWebsitePoliciesSetAutoplayPolicy): Replaced.
* UIProcess/API/C/WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies setAutoplayEnabled:]):
(-[_WKWebsitePolicies autoplayEnabled]):
(-[_WKWebsitePolicies setAutoplayPolicy:]): Replaced.
(-[_WKWebsitePolicies autoplayPolicy]): Replaced.

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

3 years agorun-jsc-benchmarks' echo should have -e option
utatane.tea@gmail.com [Fri, 13 Jan 2017 19:00:29 +0000 (19:00 +0000)]
run-jsc-benchmarks' echo should have -e option
https://bugs.webkit.org/show_bug.cgi?id=167009

Reviewed by Sam Weinig.

echo requires `-e` option to use escape sequence.
Without it, in some environment (in my Fedora 25), the escape sequence is not
recognized and just dumped as `\c` etc.

* Scripts/run-jsc-benchmarks:

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

3 years agoReserve capacity for StringBuilder in unescape
utatane.tea@gmail.com [Fri, 13 Jan 2017 18:30:09 +0000 (18:30 +0000)]
Reserve capacity for StringBuilder in unescape
https://bugs.webkit.org/show_bug.cgi?id=167008

Reviewed by Sam Weinig.

`unescape` function is frequently called in Kraken sha256-iterative.
This patch just reserves the capacity for the StringBuilder.

Currently, we select the length of the string for the reserved capacity.
It improves the performance 2.73%.

    Benchmark report for Kraken on sakura-trick.

    VMs tested:
    "baseline" at /home/yusukesuzuki/dev/WebKit/WebKitBuild/untot/Release/bin/jsc
    "patched" at /home/yusukesuzuki/dev/WebKit/WebKitBuild/un/Release/bin/jsc

    Collected 100 samples per benchmark/VM, with 100 VM invocations per benchmark. Emitted a call to gc() between
    sample measurements. Used 1 benchmark iteration per VM invocation for warm-up. Used the jsc-specific preciseTime()
    function to get microsecond-level timing. Reporting benchmark execution times with 95% confidence intervals in
    milliseconds.

                                               baseline                  patched

    stanford-crypto-sha256-iterative        51.609+-0.672             50.237+-0.860           might be 1.0273x faster

    <arithmetic>                            51.609+-0.672             50.237+-0.860           might be 1.0273x faster

* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncUnescape):

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

3 years ago[CMake] Clean up SHARED_CORE option
mcatanzaro@igalia.com [Fri, 13 Jan 2017 18:09:34 +0000 (18:09 +0000)]
[CMake] Clean up SHARED_CORE option
https://bugs.webkit.org/show_bug.cgi?id=167004

Reviewed by Alex Christensen.

* CMakeLists.txt:

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

3 years agoReport post-page load CPU usage using diagnostic logging
cdumez@apple.com [Fri, 13 Jan 2017 17:54:53 +0000 (17:54 +0000)]
Report post-page load CPU usage using diagnostic logging
https://bugs.webkit.org/show_bug.cgi?id=166950
<rdar://problem/30014496>

Reviewed by Alex Christensen.

Shortly after page load (5 seconds), we measure the WebContent process'
CPU usage over 10 seconds and report the percentage back via release
logging. We also log the percentage using diagnostic logging using the
following buckets:
- Below 10%
- 10 to 20%
- 20 to 40%
- 60 to 80%
- Over 80%

The logging works on both Mac and iOS. I verified that I get results
consistent with Activity Monitor or top.

No new tests, no Web-facing behavior change, only extra logging.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::postPageLoadKey):
(WebCore::DiagnosticLoggingKeys::cpuUsageKey):
* page/DiagnosticLoggingKeys.h:
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::didFinishLoad):
(WebCore::cpuUsageToDiagnosticLogginKey):
(WebCore::Page::measurePostLoadCPUUsage):
* page/Page.h:
* page/Settings.cpp:
(WebCore::Settings::isPostLoadCPUUsageMeasurementEnabled):
* page/Settings.h:
* platform/CPUTime.cpp: Added.
(WebCore::getCPUTime):
(WebCore::CPUTime::percentageCPUUsageSince):
* platform/CPUTime.h: Added.
* platform/cocoa/CPUTimeCocoa.mm: Added.
(WebCore::timeValueToMicroseconds):
(WebCore::getCPUTime):

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

3 years agoUnreviewed, rolling out r210677.
mcatanzaro@igalia.com [Fri, 13 Jan 2017 17:54:30 +0000 (17:54 +0000)]
Unreviewed, rolling out r210677.
https://bugs.webkit.org/show_bug.cgi?id=167007

Caused many layout test timeouts on GTK+ bots

Reverted changeset:

"Protect MediaPlayer from being destroyed mid-load()"
https://bugs.webkit.org/show_bug.cgi?id=166976
http://trac.webkit.org/changeset/210677

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

3 years agoAdded preprocessor guard for iOS-specific piece of code in GraphicsContext3DOpenGL
annulen@yandex.ru [Fri, 13 Jan 2017 17:23:30 +0000 (17:23 +0000)]
Added preprocessor guard for iOS-specific piece of code in GraphicsContext3DOpenGL
https://bugs.webkit.org/show_bug.cgi?id=167005

Reviewed by Alex Christensen.

Variable "boundFrameBuffer" is used only in iOS-specific code

No new tests needed.

* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):

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

3 years agoREGRESSION (r210621): [mac-wk2] LayoutTest fast/mediastream/MediaStream-video-element...
eric.carlson@apple.com [Fri, 13 Jan 2017 14:26:17 +0000 (14:26 +0000)]
REGRESSION (r210621): [mac-wk2] LayoutTest fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html timing out
https://bugs.webkit.org/show_bug.cgi?id=166980
Source/WebCore:

Unreviewed, fix test broken by r210621.

No new tests, updated fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html
and results.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
  Drive-by fix: null-check parent.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerStatusDidChange): Do nothing if the layer
  has changed since the KVO notification.

LayoutTests:

Unreviewed, fix test broken by r210621.

* fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled-expected.txt:
* fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html:
* platform/mac-wk2/TestExpectations: Un-skip fixed test.

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

3 years ago[SOUP] Simplify cookie storage handling
carlosgc@webkit.org [Fri, 13 Jan 2017 08:24:54 +0000 (08:24 +0000)]
[SOUP] Simplify cookie storage handling
https://bugs.webkit.org/show_bug.cgi?id=166967

Reviewed by Sergio Villar Senin.

Source/WebCore:

We currently have a global cookie storage, and several create() methods in SoupNetworkSession to create sessions
with different cookie jars. This could be simplified by moving the cookie storage handling to
NetworkStorageSession and removing all create() methods from SoupNetworkSession. This patch also removes the
default SoupNetworkSession in favor of using the default NetworkStorageSession.

* platform/network/NetworkStorageSession.h: Add a default cookie storage to be used when the
NetworkStorageSession doesn't have a platform soup session.
* platform/network/soup/CookieJarSoup.cpp: Remove the global cookie storage handling.
(WebCore::setCookiesFromDOM): Use NetworkStorageSession::cookieStorage() instead.
(WebCore::cookiesForSession): Ditto.
(WebCore::cookiesEnabled): Check the policy instead like all other ports do, since now we will always have a
default shared cookie jar.
(WebCore::getRawCookies): Use NetworkStorageSession::cookieStorage() instead.
(WebCore::deleteCookie): Ditto.
(WebCore::addCookie): Ditto.
(WebCore::getHostnamesWithCookies): Ditto.
(WebCore::deleteCookiesForHostnames): Ditto.
(WebCore::deleteAllCookies): Ditto.
* platform/network/soup/CookieJarSoup.h: Removed.
* platform/network/soup/CookieStorageSoup.cpp:
(WebCore::soupCookiesChanged): Use the cookie storage from the NetworkStorageSession::defaultStorageSession().
(WebCore::startObservingCookieChanges): Ditto.
(WebCore::stopObservingCookieChanges): Ditto.
* platform/network/soup/DNSSoup.cpp:
(WebCore::DNSResolveQueue::updateIsUsingProxy): Get the SoupSession from the NetworkStorageSession::defaultStorageSession().
(WebCore::DNSResolveQueue::platformResolve): Ditto.
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::NetworkStorageSession):
(WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): Create a new SoupNetworkSession without
providing a cookie storage to ensure it creates its own private one.
(WebCore::NetworkStorageSession::switchToNewTestingSession): Ditto.
(WebCore::NetworkStorageSession::soupNetworkSession): Create the SoupNetworkSession on demand passing the global
shared cookie storage.
(WebCore::NetworkStorageSession::cookieStorage): Return the cookie storage from the SoupNetworkSession if we
have one, otherwise create the global shared one and return it.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::sessionFromContext): Get the SoupSession from the NetworkStorageSession::defaultStorageSession().
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession): Remove all create methods and the unused constructor that
receives a SoupSession. Allow to pass a nullptr SoupCookieJar and create one in such case.
* platform/network/soup/SoupNetworkSession.h:

Source/WebKit2:

Get the SoupSession from NetworkStorageSession::defaultStorageSession().

* NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
(WebKit::CustomProtocolManager::registerScheme): Get the SoupSession from NetworkStorageSession::defaultStorageSession().
* NetworkProcess/efl/NetworkProcessMainEfl.cpp: Ditto.
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::userPreferredLanguagesChanged): Ditto.
(WebKit::NetworkProcess::platformInitializeNetworkProcess): SoupNetworkSession::clearOldSoupCache is static.
* WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
(WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy): Use the cookie storage from NetworkStorageSession::defaultStorageSession().
(WebKit::WebCookieManager::setCookiePersistentStorage): Ditto.
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
(WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts): Ditto.
* WebProcess/efl/WebProcessMainEfl.cpp:

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

3 years ago[SOUP] Do not use the legacy session ID in WebFrameNetworkingContext::storageSession()
carlosgc@webkit.org [Fri, 13 Jan 2017 08:17:13 +0000 (08:17 +0000)]
[SOUP] Do not use the legacy session ID in WebFrameNetworkingContext::storageSession()
https://bugs.webkit.org/show_bug.cgi?id=166970

Reviewed by Sergio Villar Senin.

Get the session for the current page instead.

* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
(WebKit::WebFrameNetworkingContext::storageSession):

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

3 years agoKeyboard accessory bar can appear on top of full-screen video
timothy_horton@apple.com [Fri, 13 Jan 2017 07:36:54 +0000 (07:36 +0000)]
Keyboard accessory bar can appear on top of full-screen video
https://bugs.webkit.org/show_bug.cgi?id=166902
<rdar://problem/29668223>

Reviewed by Darin Adler.

* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::setupFullscreen):
Increase the full-screen video window level to one above the keyboard,
to ensure that the video is never obscured by the keyboard or its
accessory views.

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

3 years agoRemove unnecessary includes of Page.h
commit-queue@webkit.org [Fri, 13 Jan 2017 06:01:38 +0000 (06:01 +0000)]
Remove unnecessary includes of Page.h
https://bugs.webkit.org/show_bug.cgi?id=166996

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-12
Reviewed by Yusuke Suzuki.

Source/WebCore:

* Modules/plugins/QuickTimePluginReplacement.mm:
* Modules/plugins/YouTubePluginReplacement.cpp:
* Modules/webdatabase/Database.cpp:
* Modules/webdatabase/DatabaseTracker.cpp:
* Modules/webdriver/NavigatorWebDriver.cpp:
* accessibility/AccessibilityNodeObject.cpp:
* dom/Range.cpp:
* dom/ScriptElement.cpp:
* dom/ViewportArguments.cpp:
* html/HTMLBodyElement.cpp:
* html/HTMLCanvasElement.cpp:
* html/HTMLDocument.cpp:
* html/HTMLFormControlElementWithState.cpp:
* html/HTMLImageElement.cpp:
* html/HTMLLinkElement.cpp:
* html/PluginDocument.cpp:
* inspector/InspectorApplicationCacheAgent.cpp:
* loader/LoadTiming.cpp:
* loader/cache/CachedImage.cpp:
* loader/cache/CachedResource.cpp:
* page/DeviceController.cpp:
* page/TextIndicator.cpp:
* page/efl/DragControllerEfl.cpp:
* platform/audio/ios/AudioDestinationIOS.cpp:
* platform/ios/PasteboardIOS.mm:
* platform/ios/ScrollAnimatorIOS.mm:
* platform/ios/WidgetIOS.mm:
* platform/mac/PasteboardMac.mm:
* platform/network/mac/ResourceHandleMac.mm:
* platform/win/MainThreadSharedTimerWin.cpp:
* platform/win/PasteboardWin.cpp:
* platform/win/PlatformScreenWin.cpp:
* platform/win/WidgetWin.cpp:
* rendering/InlineBox.cpp:
* rendering/RenderAttachment.cpp:
* rendering/RenderBoxModelObject.cpp:
* rendering/RenderIFrame.cpp:
* rendering/RenderInline.cpp:
* rendering/RenderReplaced.cpp:
* rendering/RenderTextControlSingleLine.cpp:
* rendering/RootInlineBox.cpp:
* rendering/svg/RenderSVGResourceFilter.cpp:
* rendering/svg/SVGRenderingContext.cpp:
* style/StyleScope.cpp:
* svg/SVGDocumentExtensions.cpp:
* svg/graphics/SVGImageCache.cpp:
* xml/XSLTProcessor.cpp:
* xml/parser/XMLDocumentParserLibxml2.cpp:

Source/WebKit/mac:

* DOM/DOMHTML.mm:
* History/WebBackForwardList.mm:
* Plugins/WebPluginController.mm:
* WebCoreSupport/WebNotificationClient.mm:
* WebCoreSupport/WebPlatformStrategies.mm:
* WebCoreSupport/WebUserMediaClient.mm:
* WebView/WebFullScreenController.mm:

Source/WebKit/win:

* AccessibleTextImpl.cpp:
* BackForwardList.cpp:

Source/WebKit2:

* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:

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

3 years ago[EFL] Skip to test imported/w3c/web-platform-tests
gyuyoung.kim@webkit.org [Fri, 13 Jan 2017 05:44:59 +0000 (05:44 +0000)]
[EFL] Skip to test imported/w3c/web-platform-tests

Unreviewed EFL gardening. There are too many timeout and crash.

* platform/efl/TestExpectations:

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

3 years agoAdd a slice intrinsic to the DFG/FTL
sbarati@apple.com [Fri, 13 Jan 2017 04:03:47 +0000 (04:03 +0000)]
Add a slice intrinsic to the DFG/FTL
https://bugs.webkit.org/show_bug.cgi?id=166707
<rdar://problem/29913445>

Reviewed by Filip Pizlo.

JSTests:

* stress/array-slice-intrinsic.js: Added.
(assert):
(shallowEq):
(runTest1):
(runTest2):
* stress/array-slice-jettison-on-constructor-change.js: Added.
(assert):
(runTest1):
(runTest2):
(addRandomProperties):
(runTests):
* stress/array-slice-osr-exit-2.js: Added.
(assert):
(Foo):
(shallowEq):
(runTest1):
(runTest2):
(addRandomProperties):
(runTests):
* stress/array-slice-osr-exit.js: Added.
(assert):
(Foo):
(shallowEq):
(runTest1):
(runTest2):
(addRandomProperties):
(runTests):

Source/JavaScriptCore:

The gist of this patch is to inline Array.prototype.slice
into the DFG/FTL. The implementation in the DFG-backend
and FTLLowerDFGToB3 is just a straight forward implementation
of what the C function is doing. The more interesting bits
of this patch are setting up the proper watchpoints and conditions
in the executing code to prove that its safe to skip all of the
observable JS actions that Array.prototype.slice normally does.

We perform the following proofs:
1. Array.prototype.constructor has not changed (via a watchpoint).
2. That Array.prototype.constructor[Symbol.species] has not changed (via a watchpoint).
3. The global object is not having a bad time.
4. The array that is being sliced has an original array structure.
5. Array.prototype/Object.prototype have not transitioned.

Conditions 1, 2, and 3 are strictly required.

4 is ensuring a couple things:
1. That a "constructor" property hasn't been added to the array
we're slicing since we're supposed to perform a Get(array, "constructor").
2. That we're not slicing an instance of a subclass of Array.

We could relax 4.1 in the future if we find other ways to test if
the incoming array hasn't changed the "constructor" property. We
would probably use TryGetById to do this.

I'm seeing a 5% speedup on crypto-pbkdf2 and often a 1% speedup on
the total benchmark (the results are sometimes noisy).

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGCallArrayAllocatorSlowPathGenerator.h:
(JSC::DFG::CallArrayAllocatorWithVariableStructureVariableSizeSlowPathGenerator::CallArrayAllocatorWithVariableStructureVariableSizeSlowPathGenerator):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArraySlice):
(JSC::DFG::SpeculativeJIT::emitAllocateButterfly):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
(JSC::DFG::SpeculativeJIT::emitInitializeButterfly):
(JSC::DFG::SpeculativeJIT::compileAllocateNewArrayWithSize):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
(JSC::DFG::SpeculativeJIT::emitInitializeButterfly):
(JSC::DFG::SpeculativeJIT::compileAllocateNewArrayWithSize):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileArraySlice):
(JSC::FTL::DFG::LowerDFGToB3::compileNewArrayWithSize):
(JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewObject):
(JSC::FTL::DFG::LowerDFGToB3::initializeArrayElements):
(JSC::FTL::DFG::LowerDFGToB3::storeStructure):
(JSC::FTL::DFG::LowerDFGToB3::allocateCell):
(JSC::FTL::DFG::LowerDFGToB3::allocateObject):
(JSC::FTL::DFG::LowerDFGToB3::allocateJSArray):
(JSC::FTL::DFG::LowerDFGToB3::allocateUninitializedContiguousJSArray):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitLoadStructure):
* runtime/ArrayPrototype.cpp:
(JSC::ArrayPrototype::finishCreation):
(JSC::speciesWatchpointIsValid):
(JSC::speciesConstructArray):
(JSC::arrayProtoFuncSlice):
(JSC::arrayProtoPrivateFuncConcatMemcpy):
(JSC::ArrayPrototype::initializeSpeciesWatchpoint):
(JSC::ArrayPrototypeAdaptiveInferredPropertyWatchpoint::handleFire):
(JSC::speciesWatchpointsValid): Deleted.
(JSC::ArrayPrototype::attemptToInitializeSpeciesWatchpoint): Deleted.
* runtime/ArrayPrototype.h:
(JSC::ArrayPrototype::speciesWatchpointStatus): Deleted.
(): Deleted.
* runtime/Intrinsic.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::JSGlobalObject):
(JSC::JSGlobalObject::init):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::arraySpeciesWatchpoint):
* runtime/Structure.h:

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

3 years agoConcurrent GC has a bug where we would detect a race but fail to rescan the object
sbarati@apple.com [Fri, 13 Jan 2017 03:12:09 +0000 (03:12 +0000)]
Concurrent GC has a bug where we would detect a race but fail to rescan the object
https://bugs.webkit.org/show_bug.cgi?id=166960
<rdar://problem/29983526>

Reviewed by Filip Pizlo and Mark Lam.

We have code like this in JSC:

```
Butterfly* butterfly = allocateMoreOutOfLineStorage(vm, oldOutOfLineCapacity, newOutOfLineCapacity);
nukeStructureAndSetButterfly(vm, structureID, butterfly);
structure->setLastOffset(newLastOffset);
WTF::storeStoreFence();
setStructureIDDirectly(structureID);
```

Note that the collector could detect a race here, which sometimes
incorrectly caused us to not visit the object again.

Mutator Thread: M, Collector Thread: C, assuming sequential consistency via
proper barriers:

M: allocate new butterfly
M: Set nuked structure ID
M: Set butterfly (this does a barrier)
C: Start scanning O
C: load structure ID
C: See it's nuked and bail, (we used to rely on a write barrier to rescan).

We sometimes never rescanned here because we were calling
setStructureIDDirectly which doesn't do a write barrier.
(Note, the places that do this but call setStructure were
OK because setStructure will perform a write barrier.)

(This same issue also existed in places where the collector thread
detected races for Structure::m_offset, but places that changed
Structure::m_offset didn't perform a write barrier on the object
after changing its Structure's m_offset.)

To prevent such code from requiring every call site to perform
a write barrier on the object, I've changed the collector code
to keep a stack of cells to be revisited due to races. This stack
is then consulted when we do marking. Because such races are rare,
we have a single stack on Heap that is guarded by a lock.

* heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::~Heap):
(JSC::Heap::markToFixpoint):
(JSC::Heap::endMarking):
(JSC::Heap::buildConstraintSet):
(JSC::Heap::addToRaceMarkStack):
* heap/Heap.h:
(JSC::Heap::collectorSlotVisitor):
(JSC::Heap::mutatorMarkStack): Deleted.
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::didRace):
* heap/SlotVisitor.h:
(JSC::SlotVisitor::didRace):
(JSC::SlotVisitor::didNotRace): Deleted.
* heap/SlotVisitorInlines.h:
(JSC::SlotVisitor::didNotRace): Deleted.
* runtime/JSObject.cpp:
(JSC::JSObject::visitButterfly):
(JSC::JSObject::visitButterflyImpl):
* runtime/JSObjectInlines.h:
(JSC::JSObject::prepareToPutDirectWithoutTransition):
* runtime/Structure.cpp:
(JSC::Structure::flattenDictionaryStructure):

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

3 years agoAdd KEYBOARD_KEY_ATTRIBUTE / KEYBOARD_CODE_ATTRIBUTE to FeatureDefines.xcconfig
cdumez@apple.com [Fri, 13 Jan 2017 02:46:50 +0000 (02:46 +0000)]
Add KEYBOARD_KEY_ATTRIBUTE / KEYBOARD_CODE_ATTRIBUTE to FeatureDefines.xcconfig
https://bugs.webkit.org/show_bug.cgi?id=166995

Reviewed by Jer Noble.

Add KEYBOARD_KEY_ATTRIBUTE / KEYBOARD_CODE_ATTRIBUTE to FeatureDefines.xcconfig
as some people are having trouble building without it.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:
* Shared/WebKeyboardEvent.cpp:
(WebKit::WebKeyboardEvent::WebKeyboardEvent):

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

3 years agoUnreviewed, rolling out r210680.
ryanhaddad@apple.com [Fri, 13 Jan 2017 01:42:59 +0000 (01:42 +0000)]
Unreviewed, rolling out r210680.

This change caused LayoutTest timeouts and assertion failures.

Reverted changeset:

"Use GenericEventQueue rather than callOnMainThread to
schedule events in AudioScheduledSourceNode."
https://bugs.webkit.org/show_bug.cgi?id=166983
http://trac.webkit.org/changeset/210680

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

3 years agoREGRESSION (r209711): Web Inspector: in Elements Tab, selecting a deeply nested DOM...
nvasilyev@apple.com [Fri, 13 Jan 2017 01:30:02 +0000 (01:30 +0000)]
REGRESSION (r209711): Web Inspector: in Elements Tab, selecting a deeply nested DOM element causes navigation bar buttons to be pushed off the leading edge
https://bugs.webkit.org/show_bug.cgi?id=166898
<rdar://problem/29951737>

Reviewed by Timothy Hatcher.

* UserInterface/Views/HierarchicalPathComponent.js:
(WebInspector.HierarchicalPathComponent.prototype.set selectorArrows):
The following operations do NOT produce the same result:

    classList.toogle(aString, undefined)
    classList.toogle(aString, false)

The former is an equivalent of classList.toogle(aString), e.g. it set a class if it wasn't set before.

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

3 years agoSource/WebCore:
cdumez@apple.com [Fri, 13 Jan 2017 00:59:34 +0000 (00:59 +0000)]
Source/WebCore:
[iOS] HTML form validation popover sometimes does not go away
https://bugs.webkit.org/show_bug.cgi?id=166990
<rdar://problem/29985957>

Reviewed by Tim Horton.

The issue was that [UIViewController presentViewController:] is asynchronous
and that we sometimes tried to call [m_popoverController dismissViewControllerAnimated:]
before presentViewController had completed. This is something that UIKit does
not handle nicely and the popover just stays visible even though we have
asked for the controller to be dismissed and destroyed the ValidationBubble
object.

To address the issue, I made ValidationBubble RefCounted and make sure the
ValidationBubble object stays alive at least until the completion handler for
[UIViewController presentViewController:] has been called. This is done via
protecting the object using a RefPtr<> and capturing it in the lambda.
Because dismissViewControllerAnimated is called in the destructor, it is no
longer possible to call dismissViewControllerAnimated before the call to
presentViewController has completed.

No new tests, no easily testable since the popover was staying visible
after being destroyed (held on by UIKit).

* platform/ValidationBubble.h:
(WebCore::ValidationBubble::create):
* platform/ios/ValidationBubbleIOS.mm:
(WebCore::ValidationBubble::show):

Source/WebKit/mac:
HTML form validation popover sometimes does not go away
https://bugs.webkit.org/show_bug.cgi?id=166990
<rdar://problem/29985957>

Reviewed by Tim Horton.

Update code using ValidationBubble now that it is RefCounted.

* WebView/WebView.mm:
(-[WebView showFormValidationMessage:withAnchorRect:]):

Source/WebKit2:
[iOS] HTML form validation popover sometimes does not go away
https://bugs.webkit.org/show_bug.cgi?id=166990
<rdar://problem/29985957>

Reviewed by Tim Horton.

Update code using ValidationBubble now that it is RefCounted.

* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::createValidationBubble):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::createValidationBubble):

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

3 years ago[iOS] Purge GraphicsServices font cache on memory warning.
akling@apple.com [Fri, 13 Jan 2017 00:47:37 +0000 (00:47 +0000)]
[iOS] Purge GraphicsServices font cache on memory warning.
<https://webkit.org/b/154343>

Reviewed by Antti Koivisto.

Source/WebCore:

The GS font cache was retaining CSS fonts after we stopped using them.
Call SPI to release them on memory pressure. This is one of multiple
steps necessary to actually free the fonts.

* Configurations/WebCore.xcconfig:
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::platformReleaseMemory):
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
* platform/spi/ios/GraphicsServicesSPI.h:

WebKitLibraries:

* WebKitPrivateFrameworkStubs/iOS/10/GraphicsServices.framework/GraphicsServices.tbd: Add SPI.

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

3 years agoDo not allow selection of editable content when not editing.
enrica@apple.com [Fri, 13 Jan 2017 00:36:58 +0000 (00:36 +0000)]
Do not allow selection of editable content when not editing.
https://bugs.webkit.org/show_bug.cgi?id=166897
<rdar://problem/29388806>

Reviewed by Tim Horton.

Source/WebKit2:

Test: fast/events/touch/ios/long-press-on-editable.html

When retrieving the position information, we should not consider
as candidates for selection editable elements, since this is only
used for non editable selections.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::isAssistableElement): Moved within the file.
(WebKit::WebPage::getPositionInformation):

LayoutTests:

* fast/events/touch/ios/long-press-on-editable-expected.txt: Added.
* fast/events/touch/ios/long-press-on-editable.html: Added.

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

3 years agoUnreviewed EFL/GTK build fix after r210684.
cdumez@apple.com [Fri, 13 Jan 2017 00:11:56 +0000 (00:11 +0000)]
Unreviewed EFL/GTK build fix after r210684.

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

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

3 years agoREGRESSION (r209977): Crash in UniqueIDBDatabase::executeNextDatabaseTask.
beidson@apple.com [Thu, 12 Jan 2017 23:48:38 +0000 (23:48 +0000)]
REGRESSION (r209977): Crash in UniqueIDBDatabase::executeNextDatabaseTask.
https://bugs.webkit.org/show_bug.cgi?id=166984

Reviewed by Alex Christensen.

No new tests (Unable to reproduce, speculative fix).

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor): If we're not already prefetching for this cursor,
  starting doing so after holding a protector ref.
(WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor): If we're now done prefetching for this cursor,
  schedule the protector ref to be destroyed on the main thread.
* Modules/indexeddb/server/UniqueIDBDatabase.h:

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

3 years agoDouble Check URLs on UI side before putting in pasteboard
megan_gardner@apple.com [Thu, 12 Jan 2017 23:45:24 +0000 (23:45 +0000)]
Double Check URLs on UI side before putting in pasteboard
https://bugs.webkit.org/show_bug.cgi?id=166945
<rdar://problem/11187315>

Reviewed by Tim Horton.

Check URLs sent from the web process before putting the on pasteboard.

* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::setPasteboardPathnamesForType):
Add a check to make sure the URLs we've received are valid and not compromising to the user's system.

* UIProcess/WebPasteboardProxy.cpp:
(WebKit::WebPasteboardProxy::addWebProcessProxy):
Keep track of the webProcesses associated with the pasteboard proxies specifically, so that we can
use it to check the URLs before putting them on pasteboard.
(WebKit::WebPasteboardProxy::removeWebProcessProxy):
Remove dead webProcesses.

* UIProcess/WebPasteboardProxy.h:
* UIProcess/WebPasteboardProxy.messages.in:
Allow for the connection to be passed in, so that we can determine which webProcess we need to
check the URLs of.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::~WebProcessProxy):
Make sure to remove WebProcessProxys from the list stored in WebPasteboardProxy

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

3 years agoMake ApplicationCacheHost::maybeLoadSynchronously more robust
commit-queue@webkit.org [Thu, 12 Jan 2017 23:12:13 +0000 (23:12 +0000)]
Make ApplicationCacheHost::maybeLoadSynchronously more robust
https://bugs.webkit.org/show_bug.cgi?id=165192

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

No change of behavior.
Currently, in case out parameter "data" is not null and shouldLoadResourceFromApplicationCache returns false and resource is null, we might dereference a null pointer when calling maybeLoadSynchronously.
We refactor the code to ensure that this case cannot happen anymore.

* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::bufferFromResource):
(WebCore::ApplicationCacheHost::maybeLoadSynchronously):

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

3 years agoUpdate style of ResourceHandleInternal
commit-queue@webkit.org [Thu, 12 Jan 2017 22:49:51 +0000 (22:49 +0000)]
Update style of ResourceHandleInternal
https://bugs.webkit.org/show_bug.cgi?id=166952

Patch by Alex Christensen <achristensen@webkit.org> on 2017-01-12
Reviewed by Andreas Kling.

No change in behavior.  Just un-indent and use initializer lists.

* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
(WebCore::ResourceHandleInternal::client):

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

3 years agoUse GenericEventQueue rather than callOnMainThread to schedule events in AudioSchedul...
jer.noble@apple.com [Thu, 12 Jan 2017 22:14:44 +0000 (22:14 +0000)]
Use GenericEventQueue rather than callOnMainThread to schedule events in AudioScheduledSourceNode.
https://bugs.webkit.org/show_bug.cgi?id=166983

Reviewed by Brent Fulgham.

* Modules/webaudio/AudioScheduledSourceNode.cpp:
(WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode):
(WebCore::AudioScheduledSourceNode::finish):
* Modules/webaudio/AudioScheduledSourceNode.h:

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

3 years agoOneDrive application crashes upon launch
commit-queue@webkit.org [Thu, 12 Jan 2017 21:26:48 +0000 (21:26 +0000)]
OneDrive application crashes upon launch
https://bugs.webkit.org/show_bug.cgi?id=166975

Patch by Youenn Fablet <youenn@apple.com> on 2017-01-12
Reviewed by Brady Eidson.

Checking whether load is terminated just after calling ResourceLoader::willSendRequestInternal.
The reason is that delegate call may actually cancel the load at that point.

* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):

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

3 years agoMarking fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled...
ryanhaddad@apple.com [Thu, 12 Jan 2017 21:05:28 +0000 (21:05 +0000)]
Marking fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html as a timeout on mac-wk2.
https://bugs.webkit.org/show_bug.cgi?id=166980

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoProtect MediaPlayer from being destroyed mid-load()
jer.noble@apple.com [Thu, 12 Jan 2017 20:57:32 +0000 (20:57 +0000)]
Protect MediaPlayer from being destroyed mid-load()
https://bugs.webkit.org/show_bug.cgi?id=166976

Reviewed by Eric Carlson.

It's possible for a message sent by MediaPlayer to HTMLMediaElement to cause
MediaPlayer to be destroyed before MediaPlayer::load() completes. We have
previously protected against this same problem in HTMLMediaElement::loadResource()
by ref'ing at the beginning of the function and deref'ing on exit. To do the
same in MediaPlayer, it must become RefCounted.

To keep the same semantics about m_client in MediaPlayer (always available without
requiring a null-check), make a new static MediaPlayerClient object which can
replace the real (HTMLMediaElement) client when the MediaPlayer is invalidated.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement):
(WebCore::HTMLMediaElement::clearMediaPlayer):
(WebCore::HTMLMediaElement::createMediaPlayer):
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::nullMediaPlayerClient):
(WebCore::MediaPlayer::create):
(WebCore::MediaPlayer::MediaPlayer):
(WebCore::MediaPlayer::invalidate):
(WebCore::MediaPlayer::load):
(WebCore::MediaPlayer::loadWithNextMediaEngine):
(WebCore::MediaPlayer::inMediaDocument):
(WebCore::MediaPlayer::fullscreenMode):
(WebCore::MediaPlayer::requestedRate):
(WebCore::MediaPlayer::currentPlaybackTargetIsWirelessChanged):
(WebCore::MediaPlayer::networkStateChanged):
(WebCore::MediaPlayer::readyStateChanged):
(WebCore::MediaPlayer::volumeChanged):
(WebCore::MediaPlayer::muteChanged):
(WebCore::MediaPlayer::timeChanged):
(WebCore::MediaPlayer::sizeChanged):
(WebCore::MediaPlayer::repaint):
(WebCore::MediaPlayer::durationChanged):
(WebCore::MediaPlayer::rateChanged):
(WebCore::MediaPlayer::playbackStateChanged):
(WebCore::MediaPlayer::firstVideoFrameAvailable):
(WebCore::MediaPlayer::characteristicChanged):
(WebCore::MediaPlayer::cachedKeyForKeyId):
(WebCore::MediaPlayer::keyNeeded):
(WebCore::MediaPlayer::mediaKeysStorageDirectory):
(WebCore::MediaPlayer::referrer):
(WebCore::MediaPlayer::userAgent):
(WebCore::MediaPlayer::graphicsDeviceAdapter):
(WebCore::MediaPlayer::cachedResourceLoader):
(WebCore::MediaPlayer::createResourceLoader):
(WebCore::MediaPlayer::addAudioTrack):
(WebCore::MediaPlayer::removeAudioTrack):
(WebCore::MediaPlayer::addTextTrack):
(WebCore::MediaPlayer::removeTextTrack):
(WebCore::MediaPlayer::addVideoTrack):
(WebCore::MediaPlayer::removeVideoTrack):
(WebCore::MediaPlayer::outOfBandTrackSources):
(WebCore::MediaPlayer::shouldWaitForResponseToAuthenticationChallenge):
(WebCore::MediaPlayer::handlePlaybackCommand):
(WebCore::MediaPlayer::sourceApplicationIdentifier):
(WebCore::MediaPlayer::preferredAudioCharacteristics):
(WebCore::MediaPlayer::doesHaveAttribute):
(WebCore::MediaPlayer::mediaPlayerNetworkInterfaceName):
(WebCore::MediaPlayer::getRawCookies):
(WebCore::MediaPlayer::shouldDisableSleep):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayer::platformVolumeConfigurationRequired):
(WebCore::MediaPlayer::client):

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

3 years agoAdd the ability to filter the set of bindings tests you want to run
weinig@apple.com [Thu, 12 Jan 2017 20:39:40 +0000 (20:39 +0000)]
Add the ability to filter the set of bindings tests you want to run
https://bugs.webkit.org/show_bug.cgi?id=166977

Reviewed by Tim Horton.

Allows doing things like:
    run-bindings-tests TestObj* TestCEReactions*

to run only those tests that match the patterns.

* Scripts/run-bindings-tests:
(main):
Switch to using optparse and pass the remaining args as the filters.

* Scripts/webkitpy/bindings/main.py:
(BindingsTests.__init__):
Store the pattens.

(BindingsTests.test_matches_patterns):
Add helper predicate to determine if a test should be run. When no
patterns are present, all tests should run.

(BindingsTests.run_tests):
Filter tests using the passed in patterns.

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

3 years agoUpdate bindings test results.
weinig@apple.com [Thu, 12 Jan 2017 20:38:31 +0000 (20:38 +0000)]
Update bindings test results.

* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::JSTestCustomNamedGetter::getOwnPropertySlot):
(WebCore::JSTestCustomNamedGetter::getOwnPropertySlotByIndex):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTarget::getOwnPropertySlot):
(WebCore::JSTestEventTarget::getOwnPropertySlotByIndex):
(WebCore::JSTestEventTarget::getOwnPropertyNames):
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterface::put):
(WebCore::JSTestInterface::putByIndex):
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObj::getOwnPropertySlot):
(WebCore::JSTestObj::getOwnPropertySlotByIndex):
(WebCore::JSTestObj::getOwnPropertyNames):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::JSTestOverrideBuiltins::getOwnPropertySlot):
(WebCore::JSTestOverrideBuiltins::getOwnPropertySlotByIndex):
(WebCore::JSTestOverrideBuiltins::getOwnPropertyNames):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.h:

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

3 years agoWeb Inspector: cubic-bezier editor behaves poorly for invalid inputs in component...
commit-queue@webkit.org [Thu, 12 Jan 2017 20:21:58 +0000 (20:21 +0000)]
Web Inspector: cubic-bezier editor behaves poorly for invalid inputs in component fields
https://bugs.webkit.org/show_bug.cgi?id=166928

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2017-01-12
Reviewed by Brian Burg.

* UserInterface/Views/BezierEditor.css:
(.bezier-editor):
(.bezier-editor > .number-input-container > input):

* UserInterface/Views/BezierEditor.js:
(WebInspector.BezierEditor.createBezierInput):
(WebInspector.BezierEditor):
Add type, step, min, and max to the bezier component inputs to better control user input.

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

3 years agoOutliers are not hidden in v3 UI
rniwa@webkit.org [Thu, 12 Jan 2017 19:32:20 +0000 (19:32 +0000)]
Outliers are not hidden in v3 UI
https://bugs.webkit.org/show_bug.cgi?id=166966

Reviewed by Andreas Kling.

Fixed the typo in addToSeries. An outlier has markedOutlier set to true, not isOutlier.

Also fixed a bug unveiled by new tests in MeasurementRootSet.ensureSingleton. It was was creating
a new MeasurementRootSet each time it was called instead of finding an existing instance. Fixed the bug
by merging the static maps of MeasurementRootSet and RootSet.

* public/v3/models/measurement-cluster.js:
(MeasurementCluster.prototype.addToSeries): Fixed the bug.
* public/v3/models/root-set.js:
(MeasurementRootSet.prototype.namedStaticMap): Added.
(MeasurementRootSet.prototype.ensureNamedStaticMap): Added.
(MeasurementRootSet.namedStaticMap): Added.
(MeasurementRootSet.ensureNamedStaticMap): Added.
* unit-tests/measurement-set-tests.js: Added tests for adopting time series data from a cluster.

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

3 years ago[GTK] WebKitWebProcess at 100% CPU loading hyphenation dictionaries
zandobersek@gmail.com [Thu, 12 Jan 2017 18:44:48 +0000 (18:44 +0000)]
[GTK] WebKitWebProcess at 100% CPU loading hyphenation dictionaries
https://bugs.webkit.org/show_bug.cgi?id=165601

Reviewed by Carlos Garcia Campos.

In HyphenationLibHyphen, retrieve the canonicalized absolute pathname of the dictionary file
in order to avoid storing symbolic links as the target files for specific locales. libhyphen
distributes its dictionary files by linking a set of similar locales files to a single file.
Not resolving those symbolic links means we'll be opening a single file via multiple
HyphenationDictionary objects, which is far from optimal.

To add insult to injury, these HyphenationDictionary objects were stored in a TinyLRUCache
with a slim capacity of 4. This meant that while already loading one single file through
multiple symlinks, because of continuous eviciton from this LRU cache the same symlinks
continued to be processed, in some cases resulting in opening the same dictionary file
hundreds or thousands of times. The capacity of this TinyLRUCache is increased to 32
to keep the amount of open libhyphen dictionaries capped at some reasonable number.

* platform/text/hyphen/HyphenationLibHyphen.cpp:
(WebCore::scanDirectoryForDicionaries):

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

3 years ago[css-grid] Make the grid sizing data persistent through layouts
jfernandez@igalia.com [Thu, 12 Jan 2017 18:41:28 +0000 (18:41 +0000)]
[css-grid] Make the grid sizing data persistent through layouts
https://bugs.webkit.org/show_bug.cgi?id=166883

Reviewed by Darin Adler and Manuel Rego Casasnovas.

Source/WebCore:

We want to keep the grid sizing data structures through different
layouts. This will allow to optimize some operations, reusing
these data while still valid. Additionally, operations like
determining the baseline position when the grid container is under
an inline formatting context need these data once the grid has
been laid out.

This patch controls the sizing data validity and make the data
structures persistent after layout.

Tests: fast/css-grid-layout/grid-add-item-with-positioned-items.html
       fast/css-grid-layout/grid-add-positioned-block-item-after-inline-item.html
       fast/css-grid-layout/grid-container-change-explicit-grid-recompute-child.html
       fast/css-grid-layout/grid-item-change-order-auto-flow.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleDidChange): Evaluate if the style change made the grid data invalid.
(WebCore::RenderBox::updateGridPositionAfterStyleChange): Evaluate if the style change made the grid data invalid.
* rendering/RenderBox.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::Grid::setNeedsItemsPlacement): The grid must execute the items placement logic before continue processing the layout.
(WebCore::RenderGrid::addChild): Mark the grid data as dirty.
(WebCore::RenderGrid::removeChild): Mark the grid data as dirty.
(WebCore::RenderGrid::styleDidChange): Evaluate grid data validity.
(WebCore::RenderGrid::explicitGridDidResize): Mark the grid data as dirty.
(WebCore::RenderGrid::namedGridLinesDefinitionDidChange): Mark the grid data as dirty.
(WebCore::RenderGrid::layoutBlock): We don't need to clear the grid data anymore.
(WebCore::RenderGrid::dirtyGrid): Clearing the grid data and mark is as needing to execute the items placement logic.
(WebCore::RenderGrid::trackSizesForComputedStyle): Assert we don't need to perform the items placement logic.
(WebCore::RenderGrid::paintChildren): Assert we don't need to perform the items placement logic.
* rendering/RenderGrid.h:
(WebCore::RenderGrid::clear): Deleted.

LayoutTests:

The tests added are now needed to verify we perform correctly the
data validation after certain style changes.

* fast/css-grid-layout/grid-add-item-with-positioned-items-expected.txt: Added.
* fast/css-grid-layout/grid-add-item-with-positioned-items.html: Added.
* fast/css-grid-layout/grid-add-positioned-block-item-after-inline-item-expected.txt: Added.
* fast/css-grid-layout/grid-add-positioned-block-item-after-inline-item.html: Added.
* fast/css-grid-layout/grid-container-change-explicit-grid-recompute-child-expected.txt: Added.
* fast/css-grid-layout/grid-container-change-explicit-grid-recompute-child.html: Added.
* fast/css-grid-layout/grid-item-change-order-auto-flow-expected.txt: Added.
* fast/css-grid-layout/grid-item-change-order-auto-flow.html: Added.

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

3 years ago[iOS] Implement support for KeyboardEvent.code
cdumez@apple.com [Thu, 12 Jan 2017 18:34:20 +0000 (18:34 +0000)]
[iOS] Implement support for KeyboardEvent.code
https://bugs.webkit.org/show_bug.cgi?id=166932
<rdar://problem/29972518>

Reviewed by Darin Adler.

Source/WebCore:

Implement support for KeyboardEvent.code on iOS.

No new tests, updated existing test.

* platform/ios/PlatformEventFactoryIOS.h:
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::codeForKeyEvent):
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):

Source/WebKit2:

Make sure KeyboardEvent.code is properly initialized on
iOS WK2.

* Shared/WebEvent.h:
* Shared/WebKeyboardEvent.cpp:
(WebKit::WebKeyboardEvent::WebKeyboardEvent):
* Shared/ios/WebIOSEventFactory.mm:
(WebIOSEventFactory::createWebKeyboardEvent):

Source/WTF:

Enable KEYBOARD_CODE_ATTRIBUTE feature on iOS.

* wtf/FeatureDefines.h:

LayoutTests:

Extend layout test coverage and rebaseline a couple of existing tests
now that more checks are passing.

* fast/events/ios/keyboard-event-key-attribute-expected.txt:
* fast/events/ios/keyboard-event-key-attribute.html:
* platform/ios-simulator/fast/events/constructors/keyboard-event-constructor-expected.txt:
* platform/ios-simulator/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt:

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

3 years ago[WebIDL] Autogenerate named getters
commit-queue@webkit.org [Thu, 12 Jan 2017 18:30:53 +0000 (18:30 +0000)]
[WebIDL] Autogenerate named getters
https://bugs.webkit.org/show_bug.cgi?id=166835

Patch by Sam Weinig <sam@webkit.org> on 2017-01-12
Reviewed by Alex Christensen.

Source/WebCore:

* Modules/mediastream/RTCStatsResponse.idl:
Update type to be nullable, since generator expects that for now.

* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCustomSQLStatementErrorCallback.cpp: Removed.
* bindings/js/JSDOMMimeTypeArrayCustom.cpp: Removed.
* bindings/js/JSDOMNamedFlowCollectionCustom.cpp: Removed.
* bindings/js/JSDOMPluginArrayCustom.cpp: Removed.
* bindings/js/JSDOMPluginCustom.cpp: Removed.
* bindings/js/JSNamedNodeMapCustom.cpp: Removed.
* bindings/js/JSRTCStatsResponseCustom.cpp: Removed.
* bindings/js/JSStyleSheetListCustom.cpp: Removed.
Remove deleted files.

* bindings/js/JSSQLStatementErrorCallbackCustom.cpp:
Renamed from Source/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp for consistency.

* bindings/IDLTypes.h:
(WebCore::IDLNullable::nullValue):
(WebCore::IDLNullable::isNullValue):
(WebCore::IDLNullable::extractValueFromNullable):
Add Nullable traits for IDLNullable, that call down to the underlying type. This allows
us to more easily tests for nullability without stripping the IDLNullable off.

* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::getOwnPropertySlotDelegate): Deleted.
(WebCore::JSDOMStringMap::getOwnPropertyNames): Deleted.
Remove overriden getOwnPropertySlot and getOwnPropertyNames.

* bindings/js/JSHTMLCollectionCustom.cpp:
(WebCore::JSHTMLCollection::nameGetter): Deleted.
* bindings/js/JSHTMLFormElementCustom.cpp:
(WebCore::JSHTMLFormElement::nameGetter): Deleted.
* bindings/js/JSHTMLOptionsCollectionCustom.cpp:
(WebCore::JSHTMLOptionsCollection::nameGetter): Deleted.
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::nameGetter): Deleted.
Remove custom name getters.

* bindings/js/JSHTMLSelectElementCustom.cpp:
(WebCore::selectElementIndexSetter):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::setItem):
(WebCore::HTMLSelectElement::setLength):
(WebCore::HTMLSelectElement::setOption): Deleted.
* html/HTMLSelectElement.h:
Add implementation of HTMLSelectElement::setItem() that does properly
removes if the option is null. Re-implement selectElementIndexSetter to
use it and switch conversion code to use JSDOMConvert.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateIndexedGetter):
(GenerateNamedGetter):
Extract typed getter generation into their own functions.

(GenerateGetOwnPropertySlotBody):
(GenerateGetOwnPropertySlotBodyByIndex):
Extract getOwnPropertySlotBody / getOwnPropertySlotBodyByIndex generation
into their own functions. Add support for generating name getters.

(GenerateGetOwnPropertyNames):
Extract getOwnPropertyNames generation into its own function, adding support
for respecting the LegacyUnenumerableNamedProperties attribute and switching
the default to not include named properties in the enumerated names.

(GeneratePut):
(GeneratePutByIndex):
Extract put / putByIndex generators into their own functions in preparation
of supporting namedSetters in the future.

(GetIndexedSetterFunction):
(GetNamedSetterFunction):
(GetNamedDeleterFunction):
Add helper getter functions to extract named/index setter/deleters.

(InstanceOverridesPut):
Add helper predicate to determine if an interface needs an implementation
of put.

(GenerateHeader):
Place custom helper functions (e.g. nameGetter/putDelegate/etc.) together
in the generated header.

(GenerateImplementation):
(GenerateCallbackImplementationContent):
Replace inline generation with calls to the new helper generator functions.

(NativeToJSValueUsingReferences):
(NativeToJSValueUsingPointers):
(NativeToJSValue):
Remove unused inFunctionCall parameter, and add new suppressExceptionCheck
parameter, which is used for nameGetters.

* bindings/scripts/IDLAttributes.txt:
Add LegacyUnenumerableNamedProperties.

* css/StyleSheetList.cpp:
(WebCore::StyleSheetList::namedItem):
(WebCore::StyleSheetList::getNamedItem): Deleted.
* css/StyleSheetList.h:
* css/StyleSheetList.idl:
Rename getNamedItem to namedItem, and make it return a CSSStyleSheet*
which is what the bindings specify.

* dom/DOMNamedFlowCollection.idl:
Add LegacyUnenumerableNamedProperties to match existing behavior.

* dom/DOMStringMap.h:
Switch from typedef to type alias.

* dom/DOMStringMap.idl:
Remove CustomEnumerateProperty and JSCustomGetOwnPropertySlotAndDescriptor
and add the getter. Also add the missing setter and deleter commented out.

* dom/DatasetDOMStringMap.h:
* dom/DatasetDOMStringMap.cpp:
(WebCore::DatasetDOMStringMap::supportedPropertyNames):
(WebCore::DatasetDOMStringMap::names): Deleted.
Rename names to supportedPropertyNames to support the bindings.

(WebCore::DatasetDOMStringMap::item):
(WebCore::DatasetDOMStringMap::namedItem):
Add namedItems (to support the bindings), and rework item to return
an optional rather than using a bool out parameter.

* dom/NamedNodeMap.idl:
Add LegacyUnenumerableNamedProperties matching the spec.

* html/HTMLAllCollection.idl:
Add CustomNamedGetter and LegacyUnenumerableNamedProperties. Update signatures
to match the spec. Commenting out ones not implemented yet.

* html/HTMLCollection.idl:
Add LegacyUnenumerableNamedProperties matching the spec.

* html/HTMLFormControlsCollection.idl:
Add CustomNamedGetter. Update signature of the getter to match the spec.
The reason this can't be generated yet is that we don't have a good strategy
for functions with differing return types that shadow each other.

* html/HTMLFormElement.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::namedItem):
(WebCore::HTMLFormElement::supportedPropertyNames):
Add implementation of namedItem and stub of supportedPropertyNames.

* html/HTMLFormElement.idl:
Add LegacyUnenumerableNamedProperties and remove CustomNamedGetter. Update
the signatures to match the spec.

* page/DOMWindow.idl:
Add LegacyUnenumerableNamedProperties matching the spec.

* plugins/DOMMimeTypeArray.idl:
* plugins/DOMPlugin.idl:
* plugins/DOMPluginArray.idl:
Add LegacyUnenumerableNamedProperties and add nullability to return types.

LayoutTests:

* fast/dom/HTMLSelectElement/select-selectedIndex-expected.txt:
* fast/dom/HTMLSelectElement/select-selectedIndex-multiple-expected.txt:
* js/dom/reflect-set-onto-dom-expected.txt:
Update exception text.

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

3 years agoWebBackForwardListProxy should remove restored session history items from PageCache...
akling@apple.com [Thu, 12 Jan 2017 17:52:59 +0000 (17:52 +0000)]
WebBackForwardListProxy should remove restored session history items from PageCache on close.
<https://webkit.org/b/166972>
<rdar://problem/28904157>

Reviewed by Brady Eidson.

Register history item ID's from the UIProcess with the associated-items map
so that we can remove any PageCache entries associated with them immediately
when closing a WebPage.

Otherwise they might not get removed until the next PageCache pruning happens.
This patch is a speculative fix for what looks like it might be weirdness
related to a PageCache entry outliving its originating Page.

* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::WebBackForwardListProxy::addItemFromUIProcess):
* WebProcess/WebPage/WebBackForwardListProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::restoreSessionInternal):

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

3 years agoRebaseline inspector/dom/getAccessibilityPropertiesForNode.html after r210605.
ryanhaddad@apple.com [Thu, 12 Jan 2017 17:49:32 +0000 (17:49 +0000)]
Rebaseline inspector/dom/getAccessibilityPropertiesForNode.html after r210605.

Unreviewed test gardening.

* inspector/dom/getAccessibilityPropertiesForNode-expected.txt:

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

3 years ago[GTK] Correct license on WebKitSecurityOrigin headers
mcatanzaro@igalia.com [Thu, 12 Jan 2017 17:31:20 +0000 (17:31 +0000)]
[GTK] Correct license on WebKitSecurityOrigin headers

These ought to be LGPLv2+, because the rest of the GTK+ API is LPGLv2+.

* UIProcess/API/gtk/WebKitSecurityOrigin.cpp:
* UIProcess/API/gtk/WebKitSecurityOrigin.h:
* UIProcess/API/gtk/WebKitSecurityOriginPrivate.h:

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

3 years ago[iOS][WK1] Fix initialization of CADisplayLink::preferredFramesPerSecond
commit-queue@webkit.org [Thu, 12 Jan 2017 17:06:50 +0000 (17:06 +0000)]
[iOS][WK1] Fix initialization of CADisplayLink::preferredFramesPerSecond
https://bugs.webkit.org/show_bug.cgi?id=166956

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-01-12
Reviewed by Tim Horton.

Set this option to 60fps instead of leaving set to the default.

* platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
(-[WebDisplayLinkHandler initWithMonitor:]):

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

3 years ago[EFL] Gardening on 13th Jan.
gyuyoung.kim@webkit.org [Thu, 12 Jan 2017 16:07:02 +0000 (16:07 +0000)]
[EFL] Gardening on 13th Jan.

Unreviewed EFL Gardening. Update crash and timeout tests after bumping Ubuntu version.

* platform/efl/TestExpectations:

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