WebKit-https.git
21 months agoputDirectIndexSlowOrBeyondVectorLength needs to convert to dictionary indexing mode...
sbarati@apple.com [Wed, 14 Feb 2018 05:07:07 +0000 (05:07 +0000)]
putDirectIndexSlowOrBeyondVectorLength needs to convert to dictionary indexing mode always if attributes are present
https://bugs.webkit.org/show_bug.cgi?id=182755
<rdar://problem/37080864>

Reviewed by Keith Miller.

JSTests:

* stress/always-enter-dictionary-indexing-mode-with-getter.js: Added.
(test1.o.get 10005):
(test1):
(test2.o.get 1000):
(test2):

Source/JavaScriptCore:

putDirectIndexSlowOrBeyondVectorLength with non-zero attributes only converted
the object in question to a dictionary indexing mode when the index is less than
the vector length. This makes no sense. If we're defining a getter, setter, or read
only property, we must always enter the dictionary indexing mode irrespective
of the index in relation to the vector length.

* runtime/JSObject.cpp:
(JSC::JSObject::putDirectIndexSlowOrBeyondVectorLength):

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

21 months agoREGRESSION(r228313): Membuster | macOS | All Devices | 1.5 MB
antti@apple.com [Wed, 14 Feb 2018 04:38:33 +0000 (04:38 +0000)]
REGRESSION(r228313): Membuster | macOS | All Devices | 1.5 MB
https://bugs.webkit.org/show_bug.cgi?id=182744
<rdar://problem/37463770>

Reviewed by Zalan Bujtas.

We need to respect low memory notifications explicitly now that the compiled selectors are not part of RuleData.

* css/StyleRule.cpp:
(WebCore::StyleRule::StyleRule):
* css/StyleRule.h:

Switch to std::unique_ptr<[]> from Vector to avoid unnecessary bloat.

* css/StyleSheetContents.cpp:
(WebCore::traverseRulesInVector):
(WebCore::StyleSheetContents::traverseRules const):

Add a rule traversal function, similar to the existing traverseSubresources.

(WebCore::StyleSheetContents::traverseSubresources const):

Use traverseRules to implement traverseSubresources.

(WebCore::traverseSubresourcesInRules): Deleted.
* css/StyleSheetContents.h:
* page/MemoryRelease.cpp:
(WebCore::releaseCriticalMemory):
* style/StyleScope.cpp:
(WebCore::Style::Scope::releaseMemory):

Release memory for compiled selectors on memory notification.

* style/StyleScope.h:

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

21 months agoUnreviewed GTK test gardening
mcatanzaro@igalia.com [Wed, 14 Feb 2018 04:32:04 +0000 (04:32 +0000)]
Unreviewed GTK test gardening

* platform/gtk/TestExpectations:
* platform/gtk/js/dom/dom-static-property-for-in-iteration-expected.txt:

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

21 months agoUnreviewed, rolling out r228431.
commit-queue@webkit.org [Wed, 14 Feb 2018 04:25:09 +0000 (04:25 +0000)]
Unreviewed, rolling out r228431.
https://bugs.webkit.org/show_bug.cgi?id=182766

Regressed CMake build stability (Requested by dolmstead on
#webkit).

Reverted changeset:

"[CMake] Make WebCore headers copies"
https://bugs.webkit.org/show_bug.cgi?id=182512
https://trac.webkit.org/changeset/228431

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

21 months agoUnreviewed, rolling out r228437, r228439, and r228440.
jlewis3@apple.com [Wed, 14 Feb 2018 01:40:15 +0000 (01:40 +0000)]
Unreviewed, rolling out r228437, r228439, and r228440.
https://bugs.webkit.org/show_bug.cgi?id=182756

Introduced LayoutTest failures (Requested by ryanhadd_ on
#webkit).

Reverted changesets:

"[Web Animations] Make KeyframeEffect target nullable and
read-write"
https://bugs.webkit.org/show_bug.cgi?id=182741
https://trac.webkit.org/changeset/228437

"Unreviewed attempt to fix build after r228437."
https://trac.webkit.org/changeset/228439

"[Web Animations] Make KeyframeEffect target nullable and
read-write"
https://bugs.webkit.org/show_bug.cgi?id=182741
https://trac.webkit.org/changeset/228440

Patch by Commit Queue <commit-queue@webkit.org> on 2018-02-13

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

21 months agoRemoving the controls attribute from a <video> element does not tear down the control...
graouts@webkit.org [Wed, 14 Feb 2018 01:36:22 +0000 (01:36 +0000)]
Removing the controls attribute from a <video> element does not tear down the controls shadow DOM nor cancel event listeners.
https://bugs.webkit.org/show_bug.cgi?id=182668
Source/WebCore:

<rdar://problem/33793004>

Reviewed by Jer Noble.

When controls were turned off for inline media players, we would remove all media controls elements from the shadow root,
but we would nevertheless continue to listen to media events and, as a result, update properties of the media controls
which would lead to requestAnimationFrame() calls that would update the detached DOM nodes.

We now only listent to media events if controls are turned on.

* Modules/modern-media-controls/media/controls-visibility-support.js:
(ControlsVisibilitySupport.prototype.enable): Remove the mutation observer from ControlsVisibilitySupport since observing
changes to the controls attribute is now performed directly in MediaController. We need to make sure that we update the
controls however since fadesWhileIdle is turned off in the disable() call to ensure that the auto-hide behavior is disabled
as well.
(ControlsVisibilitySupport.prototype.disable): Disable the auto-hide controller as well.
(ControlsVisibilitySupport.prototype._updateControls): Remove code that has now been moved into MediaController._updateControlsAvailability().
* Modules/modern-media-controls/media/media-controller.js:
(MediaController): Listen to the "play" event on the media so that we call _updateControlsAvailability() in this situation to account for
shouldForceControlsDisplay on MediaControlsHost. We also register for a mutation observer to track when the controls attribute availability
changes in which case we want to call _updateControlsAvailability() as well.
(MediaController.prototype.handleEvent): Call _updateControlsAvailability() instead of _updateiOSFullscreenProperties() which has been renamed
and expanded.
(MediaController.prototype._updateControlsIfNeeded): Call _updateControlsAvailability() after controls have been updated.
(MediaController.prototype._updateControlsAvailability): We now disable supporting media controller objects when we know that controls should
be hidden in all cases except when in fullscreen on macOS.
(MediaController.prototype._updateiOSFullscreenProperties): Deleted.
* Modules/modern-media-controls/media/placard-support.js:
(PlacardSupport.prototype.disable): Only allow the media events required to track when to show placards when in fullscreen since inline media
players need to show the AirPlay and picture-in-picture placards even when controls are disabled.

LayoutTests:

Reviewed by Jer Noble.

Ensure controls are turned on for a number of tests that would fail otherwise since media events would not be handled by media
controls without it.

* http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast.html:
* http/tests/media/modern-media-controls/pip-support/pip-support-live-broadcast.html:
* http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click.html:
* http/tests/media/modern-media-controls/skip-back-support/skip-back-support-live-broadcast.html:
* http/tests/media/modern-media-controls/status-support/status-support-live-broadcast.html:
* http/tests/media/modern-media-controls/status-support/status-support-loading.html:
* media/modern-media-controls/airplay-support/airplay-support.html:
* media/modern-media-controls/mute-support/mute-support-media-api.html:
* media/modern-media-controls/playback-support/playback-support-autoplay.html:
* media/modern-media-controls/playback-support/playback-support-media-api.html:
* media/modern-media-controls/start-support/start-support-error.html:
* media/modern-media-controls/start-support/start-support-lowPowerMode.html:
* media/modern-media-controls/start-support/start-support-manual-play.html:
* media/modern-media-controls/status-support/status-support-error.html:
* media/modern-media-controls/time-labels-support/elapsed-time.html:
* media/modern-media-controls/time-labels-support/remaining-time.html:
* media/modern-media-controls/tracks-support/tracks-support-audio-tracks.html:
* media/modern-media-controls/tracks-support/tracks-support-text-tracks.html:
* media/modern-media-controls/volume-support/volume-support-media-api-mute.html:
* media/modern-media-controls/volume-support/volume-support-media-api.html:

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

21 months ago[WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting
jiewen_tan@apple.com [Wed, 14 Feb 2018 01:34:21 +0000 (01:34 +0000)]
[WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting
https://bugs.webkit.org/show_bug.cgi?id=181946
<rdar://problem/37258262>

Reviewed by Chris Dumez.

Source/WebCore:

This patch changes the original async model from a work queue to IPC between WebProcess
and UIProcess. Since all authenticator operations must be handled in the UIProcess due
to sandboxing, this message passing IPC async model then surpasses the original multi
threading model. To cooperate that, a CredentialsMessenger class is then created and
all task dispatching code is moved thre.

As an improvement over existing code, static functions from PublicKeyCredential are
moved to AuthenticatorManager. AuthenticatorManager is made as a singleton such that
when static functions are called, they could reach the CredentialsMessenger to interact
with UIProccess. CredentialsMessenger and AuthenticatorManager are separated so later
on when other Credential types are created, they can reuse the same IPC messenger.

What's more, a mock CredentialsMessenger is then created to mock behaviors of UIProcess
for testing purpose.

Covered by existing tests.

* DerivedSources.make:
* Modules/credentialmanagement/BasicCredential.h:
* Modules/credentialmanagement/CredentialsContainer.cpp:
(WebCore::CredentialsContainer::CredentialsContainer):
(WebCore::CredentialsContainer::doesHaveSameOriginAsItsAncestors):
(WebCore::CredentialsContainer::get):
(WebCore::CredentialsContainer::isCreate):
(WebCore::CredentialsContainer::PendingPromise::PendingPromise): Deleted.
(WebCore::CredentialsContainer::dispatchTask): Deleted.
* Modules/credentialmanagement/CredentialsContainer.h:
(WebCore::CredentialsContainer::PendingPromise::create): Deleted.
* Modules/credentialmanagement/CredentialsMessenger.cpp: Added.
(WebCore::CredentialsMessenger::exceptionReply):
(WebCore::CredentialsMessenger::addCreationCompletionHandler):
(WebCore::CredentialsMessenger::takeCreationCompletionHandler):
(WebCore::CredentialsMessenger::addRequestCompletionHandler):
(WebCore::CredentialsMessenger::takeRequestCompletionHandler):
(WebCore::CredentialsMessenger::addQueryCompletionHandler):
(WebCore::CredentialsMessenger::takeQueryCompletionHandler):
(WebCore::getIdFromAttestationObject):
* Modules/credentialmanagement/CredentialsMessenger.h: Added.
(WebCore::CreationReturnBundle::CreationReturnBundle):
(WebCore::AssertionReturnBundle::AssertionReturnBundle):
(WebCore::CredentialsMessenger::weakPtrFactory const):
* Modules/webauthn/Authenticator.cpp: Removed.
* Modules/webauthn/Authenticator.h: Removed.
* Modules/webauthn/AuthenticatorManager.cpp: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp.
(WebCore::AuthenticatorManagerInternal::produceClientDataJson):
(WebCore::AuthenticatorManagerInternal::produceClientDataJsonHash):
(WebCore::AuthenticatorManagerInternal::initTimer):
(WebCore::AuthenticatorManagerInternal::didTimerFire):
(WebCore::AuthenticatorManager::singleton):
(WebCore::AuthenticatorManager::setMessenger):
(WebCore::AuthenticatorManager::create const):
(WebCore::AuthenticatorManager::discoverFromExternalSource const):
* Modules/webauthn/AuthenticatorManager.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
* Modules/webauthn/AuthenticatorResponse.h:
* Modules/webauthn/PublicKeyCredential.cpp:
(WebCore::PublicKeyCredentialInternal::produceClientDataJson): Deleted.
(WebCore::PublicKeyCredentialInternal::produceClientDataJsonHash): Deleted.
(WebCore::PublicKeyCredentialInternal::getIdFromAttestationObject): Deleted.
(WebCore::PublicKeyCredential::collectFromCredentialStore): Deleted.
(WebCore::PublicKeyCredential::discoverFromExternalSource): Deleted.
(WebCore::PublicKeyCredential::store): Deleted.
(WebCore::PublicKeyCredential::create): Deleted.
(WebCore::PublicKeyCredential::rawId const): Deleted.
(WebCore::PublicKeyCredential::response const): Deleted.
* Modules/webauthn/PublicKeyCredential.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* testing/Internals.cpp:
(WebCore::Internals::Internals):
(WebCore::Internals::mockCredentialsMessenger const):
* testing/Internals.h:
* testing/Internals.idl:
* testing/MockCredentialsMessenger.cpp: Added.
(WebCore::MockCredentialsMessenger::setAttestationObject):
(WebCore::MockCredentialsMessenger::setAssertionReturnBundle):
(WebCore::MockCredentialsMessenger::makeCredential):
(WebCore::MockCredentialsMessenger::getAssertion):
(WebCore::MockCredentialsMessenger::makeCredentialReply):
(WebCore::MockCredentialsMessenger::getAssertionReply):
* testing/MockCredentialsMessenger.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
* testing/MockCredentialsMessenger.idl: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.

Source/WebKit:

Dummy WebCredentialsMessenger and WebCredentialsMessengerProxy are crafted to establish
a message exchange channel between UIProcess and WebProcess.

* DerivedSources.make:
* UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
(WebKit::WebCredentialsMessengerProxy::WebCredentialsMessengerProxy):
(WebKit::WebCredentialsMessengerProxy::~WebCredentialsMessengerProxy):
(WebKit::WebCredentialsMessengerProxy::makeCredential):
(WebKit::WebCredentialsMessengerProxy::getAssertion):
* UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
* UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in: Added.
* UIProcess/WebPageProxy.cpp:
(WebKit::m_configurationPreferenceValues):
(WebKit::WebPageProxy::reattachToWebProcess):
* UIProcess/WebPageProxy.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/CredentialManagement/WebCredentialsMessenger.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
(WebKit::WebCredentialsMessenger::WebCredentialsMessenger):
(WebKit::WebCredentialsMessenger::~WebCredentialsMessenger):
(WebKit::WebCredentialsMessenger::makeCredential):
(WebKit::WebCredentialsMessenger::getAssertion):
(WebKit::WebCredentialsMessenger::makeCredentialReply):
(WebKit::WebCredentialsMessenger::getAssertionReply):
* WebProcess/CredentialManagement/WebCredentialsMessenger.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
* WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in: Added.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_credentialsMessenger):
(WebKit::m_cpuLimit): Deleted.
* WebProcess/WebPage/WebPage.h:

LayoutTests:

* http/wpt/credential-management/credentialscontainer-store-basics.https.html:
* http/wpt/webauthn/idl.https.html:
* http/wpt/webauthn/public-key-credential-create-failure.https.html:
* http/wpt/webauthn/public-key-credential-create-success.https.html:
* http/wpt/webauthn/public-key-credential-get-failure.https.html:
* http/wpt/webauthn/public-key-credential-get-success.https.html:
* http/wpt/webauthn/resources/util.js:

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

21 months agoAdd support for configuring WebsiteDatastore service worker and cache storage path
commit-queue@webkit.org [Wed, 14 Feb 2018 00:08:39 +0000 (00:08 +0000)]
Add support for configuring WebsiteDatastore service worker and cache storage path
https://bugs.webkit.org/show_bug.cgi?id=182674

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

Beef up WKWebsiteDataStoreConfiguration to easily set the WebsiteDataStore
service worker registration and cache storage directory path.

* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _initWithConfiguration:]):
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(-[_WKWebsiteDataStoreConfiguration _cacheStorageDirectory]):
(-[_WKWebsiteDataStoreConfiguration _setCacheStorageDirectory:]):
(-[_WKWebsiteDataStoreConfiguration _serviceWorkerRegistrationDirectory]):
(-[_WKWebsiteDataStoreConfiguration _setServiceWorkerRegistrationDirectory:]):

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

21 months ago[RenderTreeBuilder] Move RenderBlock::takeChild() to RenderTreeBuilder
zalan@apple.com [Tue, 13 Feb 2018 23:34:49 +0000 (23:34 +0000)]
[RenderTreeBuilder] Move RenderBlock::takeChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182746
<rdar://problem/37512871>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::takeChild): Deleted.
* rendering/RenderBlock.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChild):
(WebCore::RenderTreeBuilder::takeChildFromRenderMenuList):
(WebCore::RenderTreeBuilder::takeChildFromRenderButton):
(WebCore::RenderTreeBuilder::takeChildFromRenderGrid):
(WebCore::RenderTreeBuilder::takeChildFromRenderBlock): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::takeChild):

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

21 months ago[Web Animations] Make KeyframeEffect target nullable and read-write
graouts@webkit.org [Tue, 13 Feb 2018 23:23:09 +0000 (23:23 +0000)]
[Web Animations] Make KeyframeEffect target nullable and read-write
https://bugs.webkit.org/show_bug.cgi?id=182741

Additional unreviewed attempt to fix build after r228437.

* dom/Element.h:

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

21 months agoUnreviewed attempt to fix build after r228437.
cdumez@apple.com [Tue, 13 Feb 2018 23:18:16 +0000 (23:18 +0000)]
Unreviewed attempt to fix build after r228437.

* dom/Element.h:

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

21 months agoFollup fix to r228411 for 32-bit builds. I missed a place where we used non vararg...
sbarati@apple.com [Tue, 13 Feb 2018 23:03:21 +0000 (23:03 +0000)]
Follup fix to r228411 for 32-bit builds. I missed a place where we used non vararg getter for child2().

* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):

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

21 months ago[Web Animations] Make KeyframeEffect target nullable and read-write
graouts@webkit.org [Tue, 13 Feb 2018 22:43:50 +0000 (22:43 +0000)]
[Web Animations] Make KeyframeEffect target nullable and read-write
https://bugs.webkit.org/show_bug.cgi?id=182741

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Update test expectations for tests that use null KeyframeEffect targets and tests that update their target.

* web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/discrete-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/visibility-expected.txt:
* web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation-expected.txt:
* web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-transformed-distance-expected.txt:
* web-platform-tests/web-animations/interfaces/Animatable/animate-no-browsing-context-expected.txt:
* web-platform-tests/web-animations/interfaces/Animation/cancel-expected.txt:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/idlharness-expected.txt:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/iterationComposite-expected.txt:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-001-expected.txt:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/target-expected.txt:
* web-platform-tests/web-animations/timing-model/timelines/document-timelines-expected.txt:

Source/WebCore:

We used to completely disregard null targets, for instance not parsing keyframes, but targets
can be null and are also supposed to be read-write for KeyframeEffect. We now update the IDL
for KeyframeEffect to mark the target property as read-write and update the implementation
to correctly handle null targets by creating a StyleResolver based on the ScriptExecutionContext's
document's document element (the <html> element in practice) and not the target itself, since it
can be null.

This revealed a few issues in our implementation by allowing more WPT tests to run. So we also
ensure that:

- we don't crash when parsing font-related properties by calling update() on the generated
RenderStyle's FontCascade when parsing keyframes.

- CSS properties are provided as camel-case and not as hyphenated form

- values provided in keyframes dictionaries are only read for valid properties

- styles for effect targets are invalidated as soon as the timing model for that animation
is changed

We also rename AnimationTimeline::animationTimingModelDidChange() to AnimationTimeline::timingModelDidChange()
since the previous name didn't add useful information and we're adding a new WebAnimation::timingModelDidChange()
method, so having the two methods have a similar name made more sense.

* animation/Animatable.idl: Call animate() with a ScriptExecutionContext rather than a ScriptState
so that the ScriptExecutionContext can be passed to the KeyframeEffectReadOnly constructor.
* animation/AnimationEffectReadOnly.h: Add a new invalidate() method, designed to be subclassed, that
is called when the timing model for this effect or owning animation has changed.
* animation/AnimationTimeline.cpp: Rename animationTimingModelDidChange() to timingModelDidChange().
(WebCore::AnimationTimeline::addAnimation):
(WebCore::AnimationTimeline::removeAnimation):
(WebCore::AnimationTimeline::setCurrentTime):
* animation/AnimationTimeline.h: Rename animationTimingModelDidChange() to timingModelDidChange().
(WebCore::AnimationTimeline::timingModelDidChange):
(WebCore::AnimationTimeline::animationTimingModelDidChange): Deleted.
* animation/DocumentTimeline.cpp: Rename animationTimingModelDidChange() to timingModelDidChange().
(WebCore::DocumentTimeline::timingModelDidChange):
(WebCore::DocumentTimeline::updateAnimations):
(WebCore::DocumentTimeline::animationTimingModelDidChange): Deleted.
* animation/DocumentTimeline.h: Rename animationTimingModelDidChange() to timingModelDidChange().
* animation/KeyframeEffect.cpp: Expect a ScriptExecutionContext rather than a ScriptState.
(WebCore::KeyframeEffect::create):
(WebCore::KeyframeEffect::setKeyframes):
* animation/KeyframeEffect.h: Expect a ScriptExecutionContext rather than a ScriptState.
* animation/KeyframeEffect.idl: Expect a ScriptExecutionContext rather than a ScriptState and make the
target property read-write.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::IDLAttributeNameToAnimationPropertyName): Move this function below CSSPropertyIDToIDLAttributeName
so that it can call that function. We also check that we reject CSS properties that are not provided in
camel-case form (eg. "font-size" vs. "fontSize").
(WebCore::processIterableKeyframes): Only read the JS values if we know that the provided JS property name
maps to a valid CSS property.
(WebCore::KeyframeEffectReadOnly::create): Expect a ScriptExecutionContext rather than a ScriptState.
(WebCore::KeyframeEffectReadOnly::processKeyframes): Expect a ScriptExecutionContext rather than a ScriptState
and use the context's document to get an HTML element to create a StyleResolver. We also call update() on the
generated RenderStyle's FontCascade since otherwise we would hit an ASSERT in FontCascade when parsing font-related
CSS properties.
(WebCore::KeyframeEffectReadOnly::setTarget): Notify the animation that the effect target has changed and invalidate
the style of the new target and the old targets, if any.
(WebCore::KeyframeEffectReadOnly::invalidate): Invalidate the target's style. This method is called by setTarget()
and WebAnimation::timingModelDidChange().
* animation/KeyframeEffectReadOnly.h: Expect a ScriptExecutionContext rather than a ScriptState.
* animation/KeyframeEffectReadOnly.idl: Expect a ScriptExecutionContext rather than a ScriptState.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::timingModelDidChange): We add this new method such that any place in WebAnimation where we
know the animation's timing model has changed we can invalidate the associated effect, if any, as well as notify
the timeline, if any. We used to only notify the timeline and, as a result, only invalidate the associated effect
in the next display monitor refresh.
(WebCore::WebAnimation::effectTargetDidChange): This method is called in KeyframeEffectReadOnly::setTarget() to inform
the animation of the previous effect target and the new one upon a target change. This allows us to forward this information
onto the timeline so that we correctly add or remove the targets from the list of animated elements.
(WebCore::WebAnimation::setStartTime):
* animation/WebAnimation.h: Expose the new effectTargetDidChange() and timingModelDidChange() methods.
* dom/Element.cpp: Expect a ScriptExecutionContext rather than a ScriptState.
(WebCore::Element::animate):
* dom/Element.h: Expect a ScriptExecutionContext rather than a ScriptState.

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

21 months ago[YarrJIT][ARM] We need to save r8 as it is the initial start register
guijemont@igalia.com [Tue, 13 Feb 2018 22:43:15 +0000 (22:43 +0000)]
[YarrJIT][ARM] We need to save r8 as it is the initial start register
https://bugs.webkit.org/show_bug.cgi?id=182157

Reviewed by Saam Barati.

Register r8 is the initial start register since r224172, so we need to
save it. We still need to save r6 as well even though it is not the
initial start register any more, since it is used by the
MacroAssembler which we use (we get crashes in some situations if we
don't save r6). This issue was discovered because
stress/regress-174044.js crashes on a raspberry pi 2 when compiled in
-O2.

* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::generateEnter):
(JSC::Yarr::YarrGenerator::generateReturn):

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

21 months agoCrash when breakpoint hit in unload handler
antti@apple.com [Tue, 13 Feb 2018 22:39:47 +0000 (22:39 +0000)]
Crash when breakpoint hit in unload handler
https://bugs.webkit.org/show_bug.cgi?id=169855
<rdar://problem/28683567>

Source/WebCore:

Reviewed by Daniel Bates.

Test: inspector/debugger/reload-paused.html

CachedRawResource::updateBuffer may generate unload event in client notify callback. If Inspector was
paused, this even would spawn a nested runloop. CachedRawResource::finishLoading would get called in
the nested loop, confusing the DocumentLoader state machine and resulting in crashes later.

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

- Set a bit when entering the client callback.
- Ensure we don't re-enter updateBuffer.
- If finishLoading got delayed during client callback, do it at the end.

(WebCore::CachedRawResource::finishLoading):

If we are in updateBuffer client callback, save the buffer and bail out.

* loader/cache/CachedRawResource.h:

LayoutTests:

Reviewed by Daniel Bates and Joseph Pecoraro.

* inspector/debugger/reload-paused-expected.txt: Added.
* inspector/debugger/reload-paused.html: Added.

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

21 months agoWeb Automation: don't return an error if resizing/moving a window has no effect
bburg@apple.com [Tue, 13 Feb 2018 22:36:15 +0000 (22:36 +0000)]
Web Automation: don't return an error if resizing/moving a window has no effect
https://bugs.webkit.org/show_bug.cgi?id=182742

Reviewed by Tim Horton.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
(WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
Unify the behavior for all ports. Don't raise an error if the command was
idempotent (by mistake or not). It should not be an error to re-maximize a window.

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

21 months agoAdded a redirect for /nightly to /downloads/.
jond@apple.com [Tue, 13 Feb 2018 22:17:29 +0000 (22:17 +0000)]
Added a redirect for /nightly to /downloads/.
https://bugs.webkit.org/show_bug.cgi?id=182743
<rdar://problem/35126697>

Reviewed by Lucas Forschler.

* .htaccess:

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

21 months ago[RenderTreeBuilder] Move RenderBlockFlow::takeChild() to RenderTreeBuilder
zalan@apple.com [Tue, 13 Feb 2018 21:58:58 +0000 (21:58 +0000)]
[RenderTreeBuilder] Move RenderBlockFlow::takeChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182739
<rdar://problem/37506542>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::takeChild): Deleted.
* rendering/RenderBlockFlow.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChild):
(WebCore::RenderTreeBuilder::multiColumnRelativeWillBeRemoved): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::takeChild):
* rendering/updating/RenderTreeBuilderBlock.h:

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

21 months ago[CMake] Make WebCore headers copies
don.olmstead@sony.com [Tue, 13 Feb 2018 21:31:41 +0000 (21:31 +0000)]
[CMake] Make WebCore headers copies
https://bugs.webkit.org/show_bug.cgi?id=182512

Reviewed by Keith Miller.

Source/WebCore:

No new tests. No change in behavior.

* CMakeLists.txt:
* PlatformAppleWin.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWPE.cmake:
* PlatformWin.cmake:
* PlatformWinCairo.cmake:
* platform/Cairo.cmake:
* platform/Curl.cmake:
* platform/FreeType.cmake:
* platform/GStreamer.cmake:
* platform/ImageDecoders.cmake:
* platform/TextureMapper.cmake:
* platform/graphics/win/LocalWindowsContext.h:

Source/WebKit:

* CMakeLists.txt:
* NetworkProcess/capture/NetworkCaptureManager.cpp:
* NetworkProcess/webrtc/NetworkRTCMonitor.h:
* PlatformWPE.cmake:
* Scripts/generate-forwarding-headers.pl:
* Shared/gtk/WebEventFactory.cpp:
* UIProcess/API/gtk/PageClientImpl.cpp:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
* UIProcess/gtk/WebPageProxyGtk.cpp:
* WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
* WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
* WebProcess/WebPage/wpe/WebPageWPE.cpp:

Source/WebKitLegacy:

* PlatformWin.cmake:

Source/WebKitLegacy/win:

* FullscreenVideoController.h:
* Plugins/PluginDatabase.cpp:
* Plugins/PluginDatabaseWin.cpp:
* Plugins/PluginDebug.cpp:
* Plugins/PluginMainThreadScheduler.cpp:
* Plugins/PluginMessageThrottlerWin.cpp:
* Plugins/PluginPackage.cpp:
* Plugins/PluginPackageWin.cpp:
* Plugins/PluginStream.cpp:
* Plugins/PluginView.cpp:
* Plugins/PluginViewWin.cpp:
* Plugins/npapi.cpp:
* WebKitMessageLoop.cpp:
* WebKitPrefix.h:
* storage/WebDatabaseProvider.cpp:

Tools:

* DumpRenderTree/CMakeLists.txt:
* DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt:
* DumpRenderTree/TestNetscapePlugIn/ForwardingHeaders/WebKit/npapi.h:
* DumpRenderTree/TestNetscapePlugIn/ForwardingHeaders/WebKit/npfunctions.h:
* DumpRenderTree/TestNetscapePlugIn/ForwardingHeaders/WebKit/npruntime.h:
* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/PlatformWPE.cmake:
* TestWebKitAPI/PlatformWin.cmake:
* TestWebKitAPI/win/TestWebCoreStubs.cpp:
(loadResourceIntoBuffer):
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
* WebKitTestRunner/InjectedBundle/wpe/AccessibilityControllerWPE.cpp:
* WebKitTestRunner/InjectedBundle/wpe/AccessibilityUIElementWPE.cpp:
* WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
* WebKitTestRunner/wpe/EventSenderProxyWPE.cpp:

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

21 months agoREGRESSION (r228299): Broke reader mode in Safari
cdumez@apple.com [Tue, 13 Feb 2018 20:46:47 +0000 (20:46 +0000)]
REGRESSION (r228299): Broke reader mode in Safari
https://bugs.webkit.org/show_bug.cgi?id=182697
<rdar://problem/37399012>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Rework the fix for r228299 to be more targeted. I moved the policy check
cencelation from FrameLoader::stopLoading() to NavigationScheduler::schedule()
when a pending load is cancelled by another load. I have verified that the
sites fixed by r228299 still work with this more limited change. However,
reader mode is now working again.

The issue seems to be that we tell CFNetwork to continue with the load after
receiving the response, even if the client has not responded to the
decidePolicyForNavigationResponse delegate yet. As a result, CFNetwork sends
us the resource data and we may commit the provisional load before receiving
the policy response from the client. When the provisional load is committed,
we call FrameLoader::stopLoading() which after r228299 cancelled pending
policy checks. Because we did not wait for the policy check response to
commit the load, we would cancel it which would make the load fail.

The real fix here would be to make not tell CFNetwork to continue until after
we've received the policy delegate response. However, this is a larger and
riskier change at this point. I will follow-up on this issue.

Covered by new API test.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::stopLoading):
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::schedule):

Tools:

Add API test coverage for responding asynchronously to the decidePolicyForNavigationResponse
delegate.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/AsyncPolicyForNavigationResponse.mm: Added.
(-[TestAsyncNavigationDelegate webView:didFinishNavigation:]):
(-[TestAsyncNavigationDelegate webView:didFailNavigation:withError:]):
(-[TestAsyncNavigationDelegate webView:didFailProvisionalNavigation:withError:]):
(-[TestAsyncNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
(-[TestAsyncNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
(TestWebKitAPI::TEST):

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

21 months ago[RenderTreeBuilder] Move RenderSVG*::takeChild() to RenderTreeBuilder
zalan@apple.com [Tue, 13 Feb 2018 20:36:41 +0000 (20:36 +0000)]
[RenderTreeBuilder] Move RenderSVG*::takeChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182736
<rdar://problem/37503107>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::takeChild): Deleted.
* rendering/svg/RenderSVGContainer.h:
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::takeChild): Deleted.
* rendering/svg/RenderSVGInline.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::takeChild): Deleted.
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::takeChild): Deleted.
* rendering/svg/RenderSVGText.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChild):
* rendering/updating/RenderTreeBuilderSVG.cpp:
(WebCore::RenderTreeBuilder::SVG::takeChild):
* rendering/updating/RenderTreeBuilderSVG.h:

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

21 months ago[RenderTreeBuilder] Move RenderGrid::takeChild() to RenderTreeBuilder
zalan@apple.com [Tue, 13 Feb 2018 19:52:46 +0000 (19:52 +0000)]
[RenderTreeBuilder] Move RenderGrid::takeChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182734
<rdar://problem/37500876>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::takeChild): Deleted.
* rendering/RenderGrid.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChildFromRenderGrid):
* rendering/updating/RenderTreeBuilder.h:

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

21 months agoAX: Remove AccessibleNode class
n_wang@apple.com [Tue, 13 Feb 2018 19:14:47 +0000 (19:14 +0000)]
AX: Remove AccessibleNode class
https://bugs.webkit.org/show_bug.cgi?id=182724
<rdar://problem/37486024>

Reviewed by Chris Fleizach.

Source/WebCore:

Removed all the AccessibleNode related code since AOM has
an alternate direction now.

No new tests. Made sure existing tests don't break.

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::findModalNodes):
(WebCore::nodeHasRole):
(WebCore::AXObjectCache::handleLiveRegionCreated):
(WebCore::AXObjectCache::handleMenuItemSelected):
(WebCore::AXObjectCache::handleModalChange):
(WebCore::isNodeAriaVisible):
* accessibility/AccessibilityARIAGrid.cpp:
(WebCore::AccessibilityARIAGrid::isMultiSelectable const):
* accessibility/AccessibilityARIAGridCell.cpp:
(WebCore::AccessibilityARIAGridCell::readOnlyValue const):
* accessibility/AccessibilityAllInOne.cpp:
* accessibility/AccessibilityImageMapLink.cpp:
(WebCore::AccessibilityImageMapLink::roleValue const):
(WebCore::AccessibilityImageMapLink::accessibilityDescription const):
* accessibility/AccessibilityListBoxOption.cpp:
(WebCore::AccessibilityListBoxOption::isEnabled const):
(WebCore::AccessibilityListBoxOption::stringValue const):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::isEnabled const):
(WebCore::AccessibilityNodeObject::isPressed const):
(WebCore::AccessibilityNodeObject::isChecked const):
(WebCore::AccessibilityNodeObject::isMultiSelectable const):
(WebCore::AccessibilityNodeObject::isRequired const):
(WebCore::AccessibilityNodeObject::headingLevel const):
(WebCore::AccessibilityNodeObject::valueDescription const):
(WebCore::AccessibilityNodeObject::valueForRange const):
(WebCore::AccessibilityNodeObject::maxValueForRange const):
(WebCore::AccessibilityNodeObject::minValueForRange const):
(WebCore::AccessibilityNodeObject::ariaAccessibilityDescription const):
(WebCore::siblingWithAriaRole):
(WebCore::AccessibilityNodeObject::textForLabelElement const):
(WebCore::AccessibilityNodeObject::alternativeText const):
(WebCore::AccessibilityNodeObject::alternativeTextForWebArea const):
(WebCore::AccessibilityNodeObject::hierarchicalLevel const):
(WebCore::shouldUseAccessibilityObjectInnerText):
(WebCore::AccessibilityNodeObject::stringValue const):
(WebCore::accessibleNameForNode):
(WebCore::AccessibilityNodeObject::determineAriaRoleAttribute const):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::readOnlyValue const):
(WebCore::AccessibilityObject::supportsAutoComplete const):
(WebCore::AccessibilityObject::autoCompleteValue const):
(WebCore::AccessibilityObject::ariaIsMultiline const):
(WebCore::AccessibilityObject::invalidStatus const):
(WebCore::AccessibilityObject::supportsCurrent const):
(WebCore::AccessibilityObject::currentState const):
(WebCore::AccessibilityObject::roleDescription const):
(WebCore::AccessibilityObject::keyShortcutsValue const):
(WebCore::AccessibilityObject::placeholderValue const):
(WebCore::AccessibilityObject::supportsARIAAttributes const):
(WebCore::AccessibilityObject::sortDirection const):
(WebCore::AccessibilityObject::supportsHasPopup const):
(WebCore::AccessibilityObject::hasPopupValue const):
(WebCore::AccessibilityObject::supportsSetSize const):
(WebCore::AccessibilityObject::supportsPosInSet const):
(WebCore::AccessibilityObject::setSize const):
(WebCore::AccessibilityObject::posInSet const):
(WebCore::AccessibilityObject::supportsPressed const):
(WebCore::AccessibilityObject::supportsExpanded const):
(WebCore::AccessibilityObject::isExpanded const):
(WebCore::AccessibilityObject::checkboxOrRadioValue const):
(WebCore::AccessibilityObject::pressedIsPresent const):
(WebCore::AccessibilityObject::isAXHidden const):
(WebCore::AccessibilityObject::ariaActiveDescendantReferencingElements const):
(WebCore::AccessibilityObject::ariaDetailsElements const):
(WebCore::AccessibilityObject::ariaDetailsReferencingElements const):
(WebCore::AccessibilityObject::ariaErrorMessageElements const):
(WebCore::AccessibilityObject::ariaErrorMessageReferencingElements const):
(WebCore::AccessibilityObject::setIsIgnoredFromParentDataForChild):
(WebCore::AccessibilityObject::hasProperty const): Deleted.
(WebCore::AccessibilityObject::stringValueForProperty const): Deleted.
(WebCore::AccessibilityObject::boolValueForProperty const): Deleted.
(WebCore::AccessibilityObject::intValueForProperty const): Deleted.
(WebCore::AccessibilityObject::unsignedValueForProperty const): Deleted.
(WebCore::AccessibilityObject::doubleValueForProperty const): Deleted.
(WebCore::AccessibilityObject::elementValueForProperty const): Deleted.
(WebCore::AccessibilityObject::elementsFromProperty const): Deleted.
(WebCore::AccessibilityObject::elementsReferencedByProperty const): Deleted.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::stringValue const):
(WebCore::AccessibilityRenderObject::exposesTitleUIElement const):
(WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
(WebCore::AccessibilityRenderObject::isSelected const):
(WebCore::AccessibilityRenderObject::activeDescendant const):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
(WebCore::AccessibilityRenderObject::orientation const):
(WebCore::AccessibilityRenderObject::canSetExpandedAttribute const):
(WebCore::AccessibilityRenderObject::liveRegionStatus const):
(WebCore::AccessibilityRenderObject::liveRegionRelevant const):
(WebCore::AccessibilityRenderObject::liveRegionAtomic const):
(WebCore::AccessibilityRenderObject::isBusy const):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::isDataTable const):
(WebCore::AccessibilityTable::axColumnCount const):
(WebCore::AccessibilityTable::axRowCount const):
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::axColumnIndex const):
(WebCore::AccessibilityTableCell::axRowIndex const):
(WebCore::AccessibilityTableCell::axColumnSpan const):
(WebCore::AccessibilityTableCell::axRowSpan const):
* accessibility/AccessibilityTableRow.cpp:
(WebCore::AccessibilityTableRow::axColumnIndex const):
(WebCore::AccessibilityTableRow::axRowIndex const):
* accessibility/AccessibleNode.cpp: Removed.
* accessibility/AccessibleNode.h: Removed.
* accessibility/AccessibleNode.idl: Removed.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* bindings/js/WebCoreBuiltinNames.h:
* dom/Element.cpp:
(WebCore::Element::canContainRangeEndPoint const):
(WebCore::Element::accessibleNode): Deleted.
(WebCore::Element::existingAccessibleNode const): Deleted.
* dom/Element.h:
* dom/Element.idl:
* dom/ElementRareData.cpp:
* dom/ElementRareData.h:
(WebCore::ElementRareData::accessibleNode const): Deleted.
(WebCore::ElementRareData::setAccessibleNode): Deleted.
* editing/TextIterator.cpp:
(WebCore::isRendererReplacedElement):
* rendering/RenderMenuList.cpp:
(RenderMenuList::itemAccessibilityText const):

LayoutTests:

* accessibility/accessibility-object-model-expected.txt: Removed.
* accessibility/accessibility-object-model.html: Removed.
* accessibility/mac/AOM-bool-properties-expected.txt: Removed.
* accessibility/mac/AOM-bool-properties.html: Removed.
* accessibility/mac/AOM-number-properties-expected.txt: Removed.
* accessibility/mac/AOM-number-properties.html: Removed.
* accessibility/mac/AOM-relation-property-expected.txt: Removed.
* accessibility/mac/AOM-relation-property.html: Removed.
* accessibility/mac/AOM-string-properties-expected.txt: Removed.
* accessibility/mac/AOM-string-properties.html: Removed.
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

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

21 months ago[RenderTreeBuilder] Move RenderButton::takeChild() to RenderTreeBuilder
zalan@apple.com [Tue, 13 Feb 2018 18:24:20 +0000 (18:24 +0000)]
[RenderTreeBuilder] Move RenderButton::takeChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182732
<rdar://problem/37500564>

Reviewed by Antti Koivisto.

No change of functionality.

* rendering/RenderButton.cpp:
(WebCore::RenderButton::setInnerRenderer):
(WebCore::RenderButton::takeChild): Deleted.
* rendering/RenderButton.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChildFromRenderButton):
* rendering/updating/RenderTreeBuilder.h:

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

21 months ago[JSC] cache TaggedTemplate arrays by callsite rather than by contents
caitp@igalia.com [Tue, 13 Feb 2018 18:10:30 +0000 (18:10 +0000)]
[JSC] cache TaggedTemplate arrays by callsite rather than by contents
https://bugs.webkit.org/show_bug.cgi?id=182717

Reviewed by Yusuke Suzuki.

https://github.com/tc39/ecma262/pull/890 imposes a change to template
literals, to allow template callsite arrays to be collected when the
code containing the tagged template call is collected. This spec change
has received concensus and been ratified.

This change eliminates the eternal map associating template contents
with arrays.

JSTests:

* stress/tagged-template-object-collect.js: Renamed from JSTests/stress/tagged-template-registry-key-collect.js.
* stress/tagged-template-object.js: Renamed from JSTests/stress/tagged-template-registry-key.js.
* stress/tagged-templates-identity.js:
* stress/template-string-tags-eval.js:
* test262.yaml:

Source/JavaScriptCore:

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::setConstantRegisters):
* bytecode/DirectEvalCodeCache.cpp:
(JSC::DirectEvalCodeCache::setSlow):
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::allowDirectEvalCache const):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::addTemplateObjectConstant):
(JSC::BytecodeGenerator::emitGetTemplateObject):
(JSC::BytecodeGenerator::addTemplateRegistryKeyConstant): Deleted.
* bytecompiler/BytecodeGenerator.h:
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::parseMemberExpression):
* parser/Parser.h:
* parser/ParserModes.h:
* runtime/EvalExecutable.h:
(JSC::EvalExecutable::allowDirectEvalCache const):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::JSGlobalObject):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::templateRegistry): Deleted.
* runtime/JSTemplateObjectDescriptor.cpp: Renamed from Source/JavaScriptCore/runtime/TemplateRegistry.cpp.
(JSC::JSTemplateObjectDescriptor::JSTemplateObjectDescriptor):
(JSC::JSTemplateObjectDescriptor::create):
(JSC::JSTemplateObjectDescriptor::destroy):
(JSC::JSTemplateObjectDescriptor::createTemplateObject):
* runtime/JSTemplateObjectDescriptor.h: Renamed from Source/JavaScriptCore/runtime/JSTemplateRegistryKey.h.
(JSC::isTemplateObjectDescriptor):
* runtime/JSTemplateRegistryKey.cpp: Removed.
* runtime/TemplateObjectDescriptor.cpp: Renamed from Source/JavaScriptCore/runtime/TemplateRegistryKey.cpp.
(JSC::TemplateObjectDescriptor::~TemplateObjectDescriptor):
* runtime/TemplateObjectDescriptor.h: Renamed from Source/JavaScriptCore/runtime/TemplateRegistryKey.h.
(JSC::TemplateObjectDescriptor::operator== const):
(JSC::TemplateObjectDescriptor::operator!= const):
(JSC::TemplateObjectDescriptor::Hasher::hash):
(JSC::TemplateObjectDescriptor::Hasher::equal):
(JSC::TemplateObjectDescriptor::create):
(JSC::TemplateObjectDescriptor::TemplateObjectDescriptor):
(JSC::TemplateObjectDescriptor::calculateHash):
* runtime/TemplateRegistry.h: Removed.
* runtime/TemplateRegistryKeyTable.cpp: Removed.
* runtime/TemplateRegistryKeyTable.h: Removed.
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
(JSC::VM::templateRegistryKeyTable): Deleted.
* runtime/VMEntryScope.cpp:

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::setConstantRegisters):
* bytecode/DirectEvalCodeCache.cpp:
(JSC::DirectEvalCodeCache::setSlow):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::allowDirectEvalCache const):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::addTemplateObjectConstant):
(JSC::BytecodeGenerator::emitGetTemplateObject):
(JSC::BytecodeGenerator::addTemplateRegistryKeyConstant): Deleted.
* bytecompiler/BytecodeGenerator.h:
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::parseMemberExpression):
* parser/Parser.h:
* parser/ParserModes.h:
* runtime/EvalExecutable.h:
(JSC::EvalExecutable::allowDirectEvalCache const):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::JSGlobalObject):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::templateRegistry): Deleted.
* runtime/JSTemplateObjectDescriptor.cpp: Renamed from Source/JavaScriptCore/runtime/TemplateRegistry.cpp.
(JSC::JSTemplateObjectDescriptor::JSTemplateObjectDescriptor):
(JSC::JSTemplateObjectDescriptor::create):
(JSC::JSTemplateObjectDescriptor::destroy):
(JSC::JSTemplateObjectDescriptor::createTemplateObject):
* runtime/JSTemplateObjectDescriptor.h: Renamed from Source/JavaScriptCore/runtime/JSTemplateRegistryKey.h.
(JSC::isTemplateObjectDescriptor):
* runtime/JSTemplateRegistryKey.cpp: Removed.
* runtime/TemplateObjectDescriptor.cpp: Renamed from Source/JavaScriptCore/runtime/TemplateRegistryKey.cpp.
(JSC::TemplateObjectDescriptor::~TemplateObjectDescriptor):
* runtime/TemplateObjectDescriptor.h: Renamed from Source/JavaScriptCore/runtime/TemplateRegistryKey.h.
(JSC::TemplateObjectDescriptor::operator== const):
(JSC::TemplateObjectDescriptor::operator!= const):
(JSC::TemplateObjectDescriptor::Hasher::hash):
(JSC::TemplateObjectDescriptor::Hasher::equal):
(JSC::TemplateObjectDescriptor::create):
(JSC::TemplateObjectDescriptor::TemplateObjectDescriptor):
(JSC::TemplateObjectDescriptor::calculateHash):
* runtime/TemplateRegistry.h: Removed.
* runtime/TemplateRegistryKeyTable.cpp: Removed.
* runtime/TemplateRegistryKeyTable.h: Removed.
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
(JSC::VM::templateRegistryKeyTable): Deleted.
* runtime/VMEntryScope.cpp:

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::setConstantRegisters):
* bytecode/DirectEvalCodeCache.cpp:
(JSC::DirectEvalCodeCache::setSlow):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::allowDirectEvalCache const):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::addTemplateObjectConstant):
(JSC::BytecodeGenerator::emitGetTemplateObject):
(JSC::BytecodeGenerator::addTemplateRegistryKeyConstant): Deleted.
* bytecompiler/BytecodeGenerator.h:
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::parseMemberExpression):
* parser/Parser.h:
* parser/ParserModes.h:
* runtime/EvalExecutable.h:
(JSC::EvalExecutable::allowDirectEvalCache const):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::JSGlobalObject):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::templateRegistry): Deleted.
* runtime/JSTemplateObjectDescriptor.cpp: Renamed from Source/JavaScriptCore/runtime/TemplateRegistry.cpp.
(JSC::JSTemplateObjectDescriptor::JSTemplateObjectDescriptor):
(JSC::JSTemplateObjectDescriptor::create):
(JSC::JSTemplateObjectDescriptor::destroy):
(JSC::JSTemplateObjectDescriptor::createTemplateObject):
* runtime/JSTemplateObjectDescriptor.h: Renamed from Source/JavaScriptCore/runtime/JSTemplateRegistryKey.h.
(JSC::isTemplateObjectDescriptor):
* runtime/JSTemplateRegistryKey.cpp: Removed.
* runtime/TemplateObjectDescriptor.cpp: Renamed from Source/JavaScriptCore/runtime/TemplateRegistryKey.cpp.
(JSC::TemplateObjectDescriptor::~TemplateObjectDescriptor):
* runtime/TemplateObjectDescriptor.h: Renamed from Source/JavaScriptCore/runtime/TemplateRegistryKey.h.
(JSC::TemplateObjectDescriptor::operator== const):
(JSC::TemplateObjectDescriptor::operator!= const):
(JSC::TemplateObjectDescriptor::Hasher::hash):
(JSC::TemplateObjectDescriptor::Hasher::equal):
(JSC::TemplateObjectDescriptor::create):
(JSC::TemplateObjectDescriptor::TemplateObjectDescriptor):
(JSC::TemplateObjectDescriptor::calculateHash):
* runtime/TemplateRegistry.h: Removed.
* runtime/TemplateRegistryKeyTable.cpp: Removed.
* runtime/TemplateRegistryKeyTable.h: Removed.
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
(JSC::VM::templateRegistryKeyTable): Deleted.
* runtime/VMEntryScope.cpp:

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

21 months agoSupport GetArrayLength on ArrayStorage in the FTL
utatane.tea@gmail.com [Tue, 13 Feb 2018 17:29:07 +0000 (17:29 +0000)]
Support GetArrayLength on ArrayStorage in the FTL
https://bugs.webkit.org/show_bug.cgi?id=182625

Reviewed by Saam Barati.

JSTests:

* stress/array-storage-length.js: Added.
(shouldBe):
(testInBound):
(testUncountable):
(testSlowPutInBound):
(testSlowPutUncountable):
* stress/undecided-length.js: Added.
(shouldBe):
(test2):

Source/JavaScriptCore:

This patch adds GetArrayLength and CheckArray + ArrayStorage & SlowPutArrayStorage support for FTL.
The implementation is trivial; just porting one in DFG to FTL.

This fixes several FTL compilation failures in web-tooling-benchmarks while we still need to support
ArrayPush, ArrayPop, Arrayify, and PutByVal.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::checkArray):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetArrayLength):
(JSC::FTL::DFG::LowerDFGToB3::isArrayTypeForArrayify):
(JSC::FTL::DFG::LowerDFGToB3::isArrayTypeForCheckArray):

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

21 months agoLock down JSFunction
fpizlo@apple.com [Tue, 13 Feb 2018 17:02:45 +0000 (17:02 +0000)]
Lock down JSFunction
https://bugs.webkit.org/show_bug.cgi?id=182652

Reviewed by Saam Barati.

This poisons pointers in JSFunction and puts all of the types in the JSFunction hierarchy in
isospaces.

This is so neutral on JetStream: 0.01% slower with p = 0.969211.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileNewFunctionCommon):
(JSC::DFG::SpeculativeJIT::compileNewFunction):
(JSC::DFG::SpeculativeJIT::compileCreateThis):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::TrustedImmPtr::TrustedImmPtr):
(JSC::DFG::SpeculativeJIT::TrustedImmPtr::weakPointer):
(JSC::DFG::SpeculativeJIT::TrustedImmPtr::weakPoisonedPointer):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetExecutable):
(JSC::FTL::DFG::LowerDFGToB3::compileNewFunction):
(JSC::FTL::DFG::LowerDFGToB3::weakPointer):
(JSC::FTL::DFG::LowerDFGToB3::weakPoisonedPointer):
* ftl/FTLOutput.h:
(JSC::FTL::Output::weakPointer):
(JSC::FTL::Output::weakPoisonedPointer):
* heap/MarkedSpace.cpp:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_create_this):
* jit/ThunkGenerators.cpp:
(JSC::virtualThunkFor):
(JSC::nativeForGenerator):
(JSC::boundThisNoArgsFunctionCallGenerator):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/JSAsyncFunction.h:
(JSC::JSAsyncFunction::subspaceFor):
* runtime/JSAsyncGeneratorFunction.h:
(JSC::JSAsyncGeneratorFunction::subspaceFor):
* runtime/JSBoundFunction.h:
(JSC::JSBoundFunction::subspaceFor):
* runtime/JSCPoison.h:
* runtime/JSCustomGetterSetterFunction.h:
(JSC::JSCustomGetterSetterFunction::subspaceFor):
* runtime/JSFunction.h:
(JSC::JSFunction::subspaceFor):
* runtime/JSGeneratorFunction.h:
(JSC::JSGeneratorFunction::subspaceFor):
* runtime/JSNativeStdFunction.h:
(JSC::JSNativeStdFunction::subspaceFor):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
* wasm/js/WebAssemblyFunction.h:
* wasm/js/WebAssemblyWrapperFunction.h:

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

21 months ago[iOS] whitelist iokit-get-properties
bfulgham@apple.com [Tue, 13 Feb 2018 16:51:10 +0000 (16:51 +0000)]
[iOS] whitelist iokit-get-properties
https://bugs.webkit.org/show_bug.cgi?id=182722
<rdar://problem/30929165>

Reviewed by Eric Carlson.

Update the iOS sandbox to block access to IOKit properties that are not needed for
legitimate WebContent process use. This brings the iOS sandbox in line with the
work done under macOS.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

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

21 months ago[Gstreamer][MSE] Add string representation for GStreamerMediaSample
aboya@igalia.com [Tue, 13 Feb 2018 12:11:33 +0000 (12:11 +0000)]
[Gstreamer][MSE] Add string representation for GStreamerMediaSample
https://bugs.webkit.org/show_bug.cgi?id=180262

Reviewed by Xabier Rodriguez-Calvar.

* platform/graphics/gstreamer/mse/GStreamerMediaSample.cpp:
(WebCore::GStreamerMediaSample::offsetTimestampsBy):
* platform/graphics/gstreamer/mse/GStreamerMediaSample.h:

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

21 months agoAX: defer focusedUIElement notifications
cfleizach@apple.com [Tue, 13 Feb 2018 07:59:28 +0000 (07:59 +0000)]
AX: defer focusedUIElement notifications
https://bugs.webkit.org/show_bug.cgi?id=182643
<rdar://problem/37394310>

Reviewed by Zalan Bujtas.

Source/WebCore:

Deferring focus changes for accessibility has a number of benefits.
    1) Reduces the chance of calling into layout during layout.
    2) Coalesces multiple focus notifications that would be needlessly sent.
    3) Improves performance by not calling out to the accessibility notification machinery during layout.

In this patch, I also started making more AXObjectCache calls private. This will reduce the chance that clients
will call into AXObjectCache during unexpected times.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::deferFocusedUIElementChangeIfNeeded):
(WebCore::conditionallyAddNodeToFilterList):
(WebCore::filterVectorPairForRemoval):
(WebCore::filterMapForRemoval):
(WebCore::filterListForRemoval):
(WebCore::AXObjectCache::prepareForDocumentDestruction):
(WebCore::AXObjectCache::performDeferredCacheUpdate):
* accessibility/AXObjectCache.h:
* dom/Document.cpp:
(WebCore::Document::setFocusedElement):

LayoutTests:

* accessibility/mac/aria-menu-item-selected-notification.html:
     Rewrite test to accomodate that focus changes happen asynchronously.
* accessibility/mac/selection-notification-focus-change-expected.txt:
* platform/mac-wk2/accessibility/mac/selection-notification-focus-change-expected.txt:
     The order of notifications is different now that focus changes happen later.

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

21 months agoResource Load Statistics: Classify resources as prevalent based on redirects to other...
wilander@apple.com [Tue, 13 Feb 2018 06:08:18 +0000 (06:08 +0000)]
Resource Load Statistics: Classify resources as prevalent based on redirects to other prevalent resources
https://bugs.webkit.org/show_bug.cgi?id=182664
<rdar://problem/37372572>

Reviewed by Brent Fulgham.

Source/WebCore:

Tests: http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion.html
       http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html
       http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to.html

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logFrameNavigation):
    We now collect statistics on top frame navigational redirects too, both to and from.
(WebCore::ResourceLoadObserver::logSubresourceLoading):
    We now collect statistics on redirects from in addition to the existing redirects to.
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::encode const):
(WebCore::ResourceLoadStatistics::decode):
(WebCore::ResourceLoadStatistics::toString const):
(WebCore::ResourceLoadStatistics::merge):
* loader/ResourceLoadStatistics.h:
    Three new fields:
    - topFrameUniqueRedirectsTo
    - topFrameUniqueRedirectsFrom
    - subresourceUniqueRedirectsFrom

Source/WebKit:

* Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
(WebKit::ResourceLoadStatisticsClassifier::hasPrevalentResourceCharacteristics):
    Unique top frame redirects now counts toward classification as prevalent.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
(IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
(WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
(WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
    Test infrastructure.
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
    Bumped the statistics model to 11 because of the added fields.
(WebKit::WebResourceLoadStatisticsStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain):
    This function back traces redirect chains to classify domains
    that have redirected to a newly classified prevalent resource.
(WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
    Now uses the new convenience function WebResourceLoadStatisticsStore::setPrevalentResource().
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
    New convenience function to make sure we always call
    WebResourceLoadStatisticsStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain()
    and capture redirect chains backward.
(WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
(WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
(WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
    Test infrastructure.
* UIProcess/WebResourceLoadStatisticsStore.h:

Tools:

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setStatisticsSubresourceUniqueRedirectFrom):
(WTR::TestRunner::setStatisticsTopFrameUniqueRedirectTo):
(WTR::TestRunner::setStatisticsTopFrameUniqueRedirectFrom):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::setStatisticsSubresourceUniqueRedirectFrom):
(WTR::TestController::setStatisticsTopFrameUniqueRedirectTo):
(WTR::TestController::setStatisticsTopFrameUniqueRedirectFrom):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

LayoutTests:

* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion-expected.txt: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion.html: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion-expected.txt: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to-expected.txt: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to.html: Added.
* platform/wk2/TestExpectations:
    New tests added as [ Pass ].

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

21 months agoUpdate NetworkCache::Storage::lastStableVersion after r226349
antti@apple.com [Tue, 13 Feb 2018 04:44:21 +0000 (04:44 +0000)]
Update NetworkCache::Storage::lastStableVersion after r226349
https://bugs.webkit.org/show_bug.cgi?id=182723
<rdar://problem/37469554>

Reviewed by Ryosuke Niwa.

* NetworkProcess/cache/NetworkCacheStorage.h:

Allow deleting version 11 caches.

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

21 months ago[RenderTreeBuilder] Move RenderMenuList::takeChild() to RenderTreeBuilder
zalan@apple.com [Tue, 13 Feb 2018 03:26:50 +0000 (03:26 +0000)]
[RenderTreeBuilder] Move RenderMenuList::takeChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182715
<rdar://problem/37477050>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/RenderMenuList.cpp:
(RenderMenuList::takeChild): Deleted.
* rendering/RenderMenuList.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChild):
(WebCore::RenderTreeBuilder::takeChildFromRenderMenuList):
* rendering/updating/RenderTreeBuilder.h:

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

21 months agoUnify UserAgent into WebCore/platform.
ross.kirsling@sony.com [Tue, 13 Feb 2018 02:26:17 +0000 (02:26 +0000)]
Unify UserAgent into WebCore/platform.
https://bugs.webkit.org/show_bug.cgi?id=182716

Reviewed by Michael Catanzaro.

No change in functionality.

* SourcesCocoa.txt:
* SourcesIOS.txt:
* SourcesMac.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/cocoa/UserAgent.h: Removed.
* platform/UserAgent.h:
* platform/cocoa/UserAgentCocoa.mm: Renamed from Source/WebCore/page/cocoa/UserAgent.mm.
* platform/ios/UserAgentIOS.mm: Renamed from Source/WebCore/page/ios/UserAgentIOS.mm.
* platform/mac/UserAgentMac.mm: Renamed from Source/WebCore/page/mac/UserAgentMac.mm.

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

21 months ago[Web Animations] Support the copy constructors for KeyframeEffectReadOnly and Keyfram...
commit-queue@webkit.org [Tue, 13 Feb 2018 01:28:27 +0000 (01:28 +0000)]
[Web Animations] Support the copy constructors for KeyframeEffectReadOnly and KeyframeEffect
https://bugs.webkit.org/show_bug.cgi?id=182712

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

LayoutTests/imported/w3c:

Update test expectations for tests relevant to the copy constructors.

* web-platform-tests/web-animations/interfaces/KeyframeEffect/copy-constructor-expected.txt:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/idlharness-expected.txt:

Source/WebCore:

We now support the variants for the KeyframeEffectReadOnly and KeyframeEffect constructors where
another KeyframeEffectReadOnly is provided as a source. All timing, keyframe and target properties
of that source are copied on the newly-constructed KeyframeEffect.

To support copying properties, we add new copyPropertiesFromSource() methods to
AnimationEffectTimingReadOnly and KeyframeEffectReadOnly to encapsulate copying various
member variables in the relevant classes. Copying properties of the backing KeyframeList
is performed in KeyframeEffectReadOnly::copyPropertiesFromSource() via public KeyframeList
methods.

* animation/AnimationEffectTimingReadOnly.cpp:
(WebCore::AnimationEffectTimingReadOnly::copyPropertiesFromSource):
* animation/AnimationEffectTimingReadOnly.h:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::create):
* animation/KeyframeEffect.h:
* animation/KeyframeEffect.idl:
* animation/KeyframeEffectOptions.idl:
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::create):
(WebCore::KeyframeEffectReadOnly::copyPropertiesFromSource):
* animation/KeyframeEffectReadOnly.h:
* animation/KeyframeEffectReadOnly.idl:

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

21 months agoAdd a GetIndexMask node and make it an input to GetByVal for array and typed array...
sbarati@apple.com [Tue, 13 Feb 2018 01:12:28 +0000 (01:12 +0000)]
Add a GetIndexMask node and make it an input to GetByVal for array and typed array accesses in DFG SSA
https://bugs.webkit.org/show_bug.cgi?id=182633
<rdar://problem/37441037>

Reviewed by Keith Miller.

This patch introduces a GetIndexMask node to DFG SSA. This is an input to
GetByVal for the GetByVal variants that do conservative index masking.
The reason I'm adding this node is I realized there were loads of
the butterfly index mask inside loops that B3 couldn't reason about
because B3 can't arbitrarily hoist loads out of loops if those loops
have side exits (because the side exit might be protecting the safety of the
load). However, for these loops I analyzed, the DFG would be able to hoist
these loads out of loops because it knows about JS semantics to correctly
reason about the safety of hoisting the load.

This is a 1% speedup on JetStream on Mac and iOS in my testing.

This patch also adds some infrastructure for eliminating and doing CSE on
varargs nodes. Because this patch makes GetByVal a varargs node, I ran into
issues we never had before. We never had a varargs node that could be CSEd or be
hoisted out of a loop until I made GetByVal varargs. To make it all work,
I added a CheckVarargs node. This is just like Check, but it's varargs.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGAdjacencyList.h:
(JSC::DFG::AdjacencyList::AdjacencyList):
* dfg/DFGArgumentsEliminationPhase.cpp:
* dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::propagate):
* dfg/DFGBasicBlock.cpp:
(JSC::DFG::BasicBlock::replaceTerminal):
* dfg/DFGBasicBlock.h:
(JSC::DFG::BasicBlock::findTerminal const):
* dfg/DFGBasicBlockInlines.h:
(JSC::DFG::BasicBlock::replaceTerminal):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCFGSimplificationPhase.cpp:
(JSC::DFG::CFGSimplificationPhase::mergeBlocks):
* dfg/DFGCPSRethreadingPhase.cpp:
(JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocalFor):
(JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
* dfg/DFGCSEPhase.cpp:
* dfg/DFGCleanUpPhase.cpp:
(JSC::DFG::CleanUpPhase::run):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
(JSC::DFG::ConstantFoldingPhase::fixUpsilons):
* dfg/DFGDCEPhase.cpp:
(JSC::DFG::DCEPhase::run):
(JSC::DFG::DCEPhase::fixupBlock):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::fixupChecksInBlock):
* dfg/DFGHeapLocation.cpp:
(WTF::printInternal):
* dfg/DFGHeapLocation.h:
* dfg/DFGIntegerCheckCombiningPhase.cpp:
(JSC::DFG::IntegerCheckCombiningPhase::handleBlock):
* dfg/DFGIntegerRangeOptimizationPhase.cpp:
* dfg/DFGLICMPhase.cpp:
(JSC::DFG::LICMPhase::attemptHoist):
* dfg/DFGMayExit.cpp:
* dfg/DFGNode.cpp:
(JSC::DFG::Node::remove):
(JSC::DFG::Node::convertToIdentityOn):
* dfg/DFGNode.h:
(JSC::DFG::Node::replaceWith):
* dfg/DFGNodeType.h:
* dfg/DFGObjectAllocationSinkingPhase.cpp:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGPureValue.cpp:
(JSC::DFG::PureValue::dump const):
* dfg/DFGPureValue.h:
(JSC::DFG::PureValue::PureValue):
* dfg/DFGPutStackSinkingPhase.cpp:
* dfg/DFGSSAConversionPhase.cpp:
(JSC::DFG::SSAConversionPhase::run):
* dfg/DFGSSALoweringPhase.cpp:
(JSC::DFG::SSALoweringPhase::handleNode):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::SpeculativeJIT):
(JSC::DFG::SpeculativeJIT::compileGetByValOnString):
(JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
(JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray):
(JSC::DFG::SpeculativeJIT::compileGetByValForObjectWithString):
(JSC::DFG::SpeculativeJIT::compileGetByValForObjectWithSymbol):
(JSC::DFG::SpeculativeJIT::compileGetByValOnDirectArguments):
(JSC::DFG::SpeculativeJIT::compileGetByValOnScopedArguments):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGStoreBarrierClusteringPhase.cpp:
* dfg/DFGValidate.cpp:
* dfg/DFGVarargsForwardingPhase.cpp:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileGetArrayMask):
(JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
(JSC::FTL::DFG::LowerDFGToB3::compileStringCharAt):
(JSC::FTL::DFG::LowerDFGToB3::maskedIndex):
(JSC::FTL::DFG::LowerDFGToB3::pointerIntoTypedArray):

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

21 months agoMarked multiple http/tests/resourceLoadStatistics tests as flaky and skip.
jlewis3@apple.com [Mon, 12 Feb 2018 23:58:45 +0000 (23:58 +0000)]
Marked multiple http/tests/resourceLoadStatistics tests as flaky and skip.

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

21 months agoMiscellaneous refactoring of offlineasm.
mark.lam@apple.com [Mon, 12 Feb 2018 23:43:30 +0000 (23:43 +0000)]
Miscellaneous refactoring of offlineasm.
https://bugs.webkit.org/show_bug.cgi?id=182702
<rdar://problem/37467887>

Reviewed by Filip Pizlo.

1. Refactor out the emission of $asm.comment, $asm.codeOrigin, $asm.annotation,
   and $asm.debugAnnotation into a recordMetaData method.  This standardizes how
   we emit this metadata and makes all backends do it the same way.

2. Add the ability to include custom offlineasm scripts from WebKitAdditions in
   the future.

* offlineasm/arm.rb:
* offlineasm/arm64.rb:
* offlineasm/ast.rb:
* offlineasm/backends.rb:
* offlineasm/cloop.rb:
* offlineasm/config.rb:
* offlineasm/mips.rb:
* offlineasm/risc.rb:
* offlineasm/x86.rb:

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

21 months agoDFG::emitCodeToGetArgumentsArrayLength needs to handle NewArrayBuffer/PhantomNewArray...
sbarati@apple.com [Mon, 12 Feb 2018 23:41:17 +0000 (23:41 +0000)]
DFG::emitCodeToGetArgumentsArrayLength needs to handle NewArrayBuffer/PhantomNewArrayBuffer
https://bugs.webkit.org/show_bug.cgi?id=182706
<rdar://problem/36833681>

Reviewed by Filip Pizlo.

JSTests:

* stress/get-array-length-phantom-new-array-buffer.js: Added.
(effects):
(foo):

Source/JavaScriptCore:

When we added support for PhantomNewArrayBuffer, we forgot to update
the emitCodeToGetArgumentsArrayLength function to handle PhantomNewArrayBuffer.
This patch adds that support. It's trivial to generate the length for
a PhantomNewArrayBuffer node since it's a constant buffer, with a constant
length.

* dfg/DFGArgumentsUtilities.cpp:
(JSC::DFG::emitCodeToGetArgumentsArrayLength):

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

21 months ago[RenderTreeBuilder] Introduce RenderTreebuilder::takeChild
zalan@apple.com [Mon, 12 Feb 2018 23:28:51 +0000 (23:28 +0000)]
[RenderTreeBuilder] Introduce RenderTreebuilder::takeChild
https://bugs.webkit.org/show_bug.cgi?id=182707
<rdar://problem/37473433>

Reviewed by Antti Koivisto.

All takeChild calls should go through RenderTreeBuilder::takeChild from now on.
This patch also moves the Ruby related takeChild calls to RenderTreeBuilder.

No change in functionality.

* rendering/RenderButton.cpp:
(WebCore::RenderButton::takeChild):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::removeAndDestroyChild):
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::wrapExistingRenderer):
(WebCore::RenderFullScreen::unwrapRenderer):
* rendering/RenderMenuList.cpp:
(RenderMenuList::takeChild):
* rendering/RenderRuby.cpp:
(WebCore::RenderRubyAsInline::takeChild): Deleted.
(WebCore::RenderRubyAsBlock::takeChild): Deleted.
* rendering/RenderRuby.h:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::takeChild): Deleted.
* rendering/RenderRubyRun.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChild):
(WebCore::RenderTreeBuilder::takeChildFromRenderRubyAsInline): Deleted.
(WebCore::RenderTreeBuilder::takeChildFromRenderRubyAsBlock): Deleted.
(WebCore::RenderTreeBuilder::takeChildFromRenderRubyRun): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
* rendering/updating/RenderTreeBuilderList.cpp:
(WebCore::RenderTreeBuilder::List::updateItemMarker):
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::takeChild):
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):

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

21 months agoAdd more support for pointer preparations.
mark.lam@apple.com [Mon, 12 Feb 2018 22:49:02 +0000 (22:49 +0000)]
Add more support for pointer preparations.
https://bugs.webkit.org/show_bug.cgi?id=182703
<rdar://problem/37469451>

Reviewed by Saam Barati.

Source/JavaScriptCore:

* llint/LLIntData.h:
(JSC::LLInt::getCodePtr):
* llint/LLIntPCRanges.h:
(JSC::LLInt::isLLIntPC):
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):

Source/WTF:

* wtf/PointerPreparations.h:

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

21 months agodownload-latest-github-release .py should not use "browser download URL".
ross.kirsling@sony.com [Mon, 12 Feb 2018 22:37:57 +0000 (22:37 +0000)]
download-latest-github-release .py should not use "browser download URL".
https://bugs.webkit.org/show_bug.cgi?id=182646

Reviewed by Per Arne Vollan.

* Scripts/download-latest-github-release.py:
Download request should be a proper GitHub API call and should actually include the token when applicable.
(Also clean up usage of args and print while we're in here.)

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

21 months ago[Extra zoom mode] Add support for <input type='time'> using time picker UI
wenson_hsieh@apple.com [Mon, 12 Feb 2018 22:07:10 +0000 (22:07 +0000)]
[Extra zoom mode] Add support for <input type='time'> using time picker UI
https://bugs.webkit.org/show_bug.cgi?id=182683
<rdar://problem/35143162>

Reviewed by Tim Horton.

Adds support for showing a time picker when an input of type time is focused in extra zoomed mode.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _stopAssistingNode]):
(-[WKContentView presentTimePickerViewController:]):
(-[WKContentView dismissTimePickerViewController:]):

Add helpers to dismiss and present the time picker view controller.

(-[WKContentView presentViewControllerForAssistedNode:]):

When focusing InputType::Time, present a time picker. Additionally, tweak the logic here to use the generic text
input view controller as a fallback when the other input view controllers (number pads, select menus and time
pickers thus far) are not relevant. This prevents us from completely being unable to edit form controls that are
currently unsupported.

(-[WKContentView textInputController:didCommitText:]):
(-[WKContentView textInputControllerDidRequestDismissal:]):

Tweak WKContentView for changes to WKTextFormControlViewControllerDelegate.

(-[WKContentView actionNameForFocusedFormControlController:]):

Adjust this implementation to hide the focused form control "Go" button for selects and time inputs. This
currently doesn't work for these form controls because it relies on implicit form submission; this should be
fixed by future changes, after which we should revert this adjustment.

(-[WKContentView _wheelChangedWithEvent:]):

Delegate wheel events to the time picker if needed.

(-[WKContentView textInputController:didRequestDismissalWithAction:]): Deleted.

Renamed to -textInputControllerDidRequestDismissal:.

* UIProcess/ios/forms/WKTimePickerViewController.h: Added.
* UIProcess/ios/forms/WKTimePickerViewController.mm: Added.
* WebKit.xcodeproj/project.pbxproj:

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

21 months agoMarked http/tests/workers/service/basic-messageport.html as flaky on macOS WK2.
jlewis3@apple.com [Mon, 12 Feb 2018 21:57:15 +0000 (21:57 +0000)]
Marked http/tests/workers/service/basic-messageport.html as flaky on macOS WK2.
https://bugs.webkit.org/show_bug.cgi?id=182630

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

21 months ago[RenderTreeBuilder] Move RenderBlock::dropAnonymousBoxChild to RenderTreeBuilder
zalan@apple.com [Mon, 12 Feb 2018 21:49:51 +0000 (21:49 +0000)]
[RenderTreeBuilder] Move RenderBlock::dropAnonymousBoxChild to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182704
<rdar://problem/37469469>

Reviewed by Antti Koivisto.

All the callsites are now in RenderTreeBuilder.

No change in functionality.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::dropAnonymousBoxChild): Deleted.
* rendering/RenderBlock.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::removeAnonymousWrappersForInlineChildrenIfNeeded):
(WebCore::RenderTreeBuilder::dropAnonymousBoxChild):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::takeChild):
(WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild):
* rendering/updating/RenderTreeBuilderBlock.h:

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

21 months agoUnreviewed, rolling out r228376.
jlewis3@apple.com [Mon, 12 Feb 2018 20:40:23 +0000 (20:40 +0000)]
Unreviewed, rolling out r228376.

This caused accessibility/mac/selection-notification-focus-
change.html to become flaky on macOS.

Reverted changeset:

"AX: defer focusedUIElement notifications"
https://bugs.webkit.org/show_bug.cgi?id=182643
https://trac.webkit.org/changeset/228376

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

21 months ago[iOS] media tests failing ASSERT_NOT_REACHED() in WebCore::VideoFullscreenInterfaceAV...
ryanhaddad@apple.com [Mon, 12 Feb 2018 20:30:51 +0000 (20:30 +0000)]
[iOS] media tests failing ASSERT_NOT_REACHED() in WebCore::VideoFullscreenInterfaceAVKit::cleanupFullscreen()
https://bugs.webkit.org/show_bug.cgi?id=182527

Reviewed by Alexey Proskuryakov.

Temporarily remove an assertion from VideoFullscreenInterfaceAVKit to stop tests from crashing on iOS
while the root cause is being investigated.

* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::exitFullscreenHandler):

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

21 months agoFix missing exception check in RegExpObject::matchGlobal().
mark.lam@apple.com [Mon, 12 Feb 2018 20:28:02 +0000 (20:28 +0000)]
Fix missing exception check in RegExpObject::matchGlobal().
https://bugs.webkit.org/show_bug.cgi?id=182701
<rdar://problem/37465865>

Reviewed by Michael Saboff.

This issue was discovered when running JSC tests on an asm LLInt build with
JSC_useJIT=false.

* runtime/RegExpObject.cpp:
(JSC::RegExpObject::matchGlobal):

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

21 months ago[RenderTreeBuilder] Remove redundant RenderTreeBuilder instance
zalan@apple.com [Mon, 12 Feb 2018 20:12:35 +0000 (20:12 +0000)]
[RenderTreeBuilder] Remove redundant RenderTreeBuilder instance
https://bugs.webkit.org/show_bug.cgi?id=182700
<rdar://problem/37463958>

Reviewed by Antti Koivisto.

* rendering/RenderView.cpp:
(WebCore::RenderView::willBeDestroyed):

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

21 months agoMark imported/mozilla/svg/conditions-07.svg as a flaky failure on Windows.
pvollan@apple.com [Mon, 12 Feb 2018 18:58:16 +0000 (18:58 +0000)]
Mark imported/mozilla/svg/conditions-07.svg as a flaky failure on Windows.

Unreviewed test gardening.

* platform/win/TestExpectations:

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

21 months agoEWS should run Windows tests.
pvollan@apple.com [Mon, 12 Feb 2018 18:43:59 +0000 (18:43 +0000)]
EWS should run Windows tests.
https://bugs.webkit.org/show_bug.cgi?id=177967

Reviewed by Lucas Forschler.

This will help catch regressions at an early stage.

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

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

21 months agoSkipped webgl/1.0.3/conformance/rendering/many-draw-calls.html on iOS Simulator Debug WK2
jlewis3@apple.com [Mon, 12 Feb 2018 17:59:12 +0000 (17:59 +0000)]
Skipped webgl/1.0.3/conformance/rendering/many-draw-calls.html on iOS Simulator Debug WK2
https://bugs.webkit.org/show_bug.cgi?id=182144

Unreviewed test expectations.

* platform/ios-wk2/TestExpectations:

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

21 months ago[l10n] Updated Polish translation of WebKitGTK+ for 2.20
mcatanzaro@igalia.com [Mon, 12 Feb 2018 17:21:28 +0000 (17:21 +0000)]
[l10n] Updated Polish translation of WebKitGTK+ for 2.20
https://bugs.webkit.org/show_bug.cgi?id=182693

Patch by Piotr Drąg <piotrdrag@gmail.com> on 2018-02-12
Rubber-stamped by Michael Catanzaro.

* pl.po:

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

21 months agoAX: defer focusedUIElement notifications
cfleizach@apple.com [Mon, 12 Feb 2018 17:16:17 +0000 (17:16 +0000)]
AX: defer focusedUIElement notifications
https://bugs.webkit.org/show_bug.cgi?id=182643
<rdar://problem/37394310>

Reviewed by Zalan Bujtas.

Source/WebCore:

Deferring focus changes for accessibility has a number of benefits.
    1) Reduces the chance of calling into layout during layout.
    2) Coalesces multiple focus notifications that would be needlessly sent.
    3) Improves performance by not calling out to the accessibility notification machinery during layout.

In this patch, I also started making more AXObjectCache calls private. This will reduce the chance that clients
will call into AXObjectCache during unexpected times.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::deferFocusedUIElementChangeIfNeeded):
(WebCore::conditionallyAddNodeToFilterList):
(WebCore::filterVectorPairForRemoval):
(WebCore::filterMapForRemoval):
(WebCore::filterListForRemoval):
(WebCore::AXObjectCache::prepareForDocumentDestruction):
(WebCore::AXObjectCache::performDeferredCacheUpdate):
* accessibility/AXObjectCache.h:
* dom/Document.cpp:
(WebCore::Document::setFocusedElement):

LayoutTests:

* accessibility/mac/aria-menu-item-selected-notification.html:
     Rewrite test to accomodate that focus changes happen asynchronously.
* accessibility/mac/selection-notification-focus-change-expected.txt:
* platform/mac-wk2/accessibility/mac/selection-notification-focus-change-expected.txt:
     The order of notifications is different now that focus changes happen later.

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

21 months agoUpdate test expectations for some tests which are failing on only one ews Windows...
pvollan@apple.com [Mon, 12 Feb 2018 16:56:50 +0000 (16:56 +0000)]
Update test expectations for some tests which are failing on only one ews Windows bot.
https://bugs.webkit.org/show_bug.cgi?id=182694

Unreviewed test gardening.

* platform/win/TestExpectations:

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

21 months ago[GTK] Unify builds for platform-specific files in WebKit layer
mcatanzaro@igalia.com [Mon, 12 Feb 2018 16:30:03 +0000 (16:30 +0000)]
[GTK] Unify builds for platform-specific files in WebKit layer
https://bugs.webkit.org/show_bug.cgi?id=182450

Reviewed by Carlos Garcia Campos.

Add most GTK-specific sources to unified build. API files are exempted, except for the DOM
API. Files shared with PluginProcessGTK2 are also exempted. Finally, files with name
conflicts in headers, which appears difficult to fix, are also exempted.

* CMakeLists.txt:
* NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
* NetworkProcess/soup/NetworkProcessSoup.cpp:
* NetworkProcess/soup/NetworkSessionSoup.cpp:
* NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
* Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
* PlatformGTK.cmake:
* PluginProcess/unix/PluginControllerProxyUnix.cpp:
* Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
* Shared/CoordinatedGraphics/SimpleViewportController.cpp:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
* Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
* Shared/Plugins/unix/PluginSearchPath.cpp:
* Shared/cairo/ShareableBitmapCairo.cpp:
* Shared/glib/WebContextMenuItemGlib.cpp:
* Shared/glib/WebErrorsGlib.cpp:
* Shared/gtk/ArgumentCodersGtk.cpp:
* Shared/gtk/NativeWebKeyboardEventGtk.cpp:
* Shared/gtk/ProcessExecutablePathGtk.cpp:
* Shared/gtk/WebErrorsGtk.cpp:
* Shared/gtk/WebEventFactory.cpp:
* Shared/linux/WebMemorySamplerLinux.cpp:
* Shared/soup/WebCoreArgumentCodersSoup.cpp:
* Shared/soup/WebErrorsSoup.cpp:
* SourcesGTK.txt: Added.
* UIProcess/AcceleratedDrawingAreaProxy.cpp:
* UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp:
* UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
* UIProcess/BackingStore.cpp:
* UIProcess/DrawingAreaProxyImpl.cpp:
* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
* UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
* UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
* UIProcess/WebStorage/StorageManager.cpp:
* UIProcess/cairo/BackingStoreCairo.cpp:
* UIProcess/gtk/AcceleratedBackingStore.cpp:
* UIProcess/gtk/DragAndDropHandler.cpp:
* UIProcess/gtk/GestureController.cpp:
* UIProcess/gtk/HardwareAccelerationManager.cpp:
* UIProcess/gtk/InputMethodFilter.cpp:
* UIProcess/gtk/TextCheckerGtk.cpp:
* UIProcess/gtk/WaylandCompositor.cpp:
* UIProcess/gtk/WebColorPickerGtk.cpp:
* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
* UIProcess/gtk/WebPasteboardProxyGtk.cpp:
* UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
* WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
(webkit_dom_attr_dom_event_target_init):
(webkit_dom_attr_set_property):
(webkit_dom_attr_get_property):
(webkit_dom_attr_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
(webkit_dom_cdata_section_dom_event_target_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
(webkit_dom_css_rule_set_property):
(webkit_dom_css_rule_get_property):
(webkit_dom_css_rule_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
(webkit_dom_css_rule_list_get_property):
(webkit_dom_css_rule_list_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
(webkit_dom_css_style_declaration_set_property):
(webkit_dom_css_style_declaration_get_property):
(webkit_dom_css_style_declaration_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
(webkit_dom_css_style_sheet_get_property):
(webkit_dom_css_style_sheet_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
(webkit_dom_css_value_set_property):
(webkit_dom_css_value_get_property):
(webkit_dom_css_value_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
(webkit_dom_character_data_dom_event_target_init):
(webkit_dom_character_data_set_property):
(webkit_dom_character_data_get_property):
(webkit_dom_character_data_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
(webkit_dom_client_rect_get_property):
(webkit_dom_client_rect_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
(webkit_dom_client_rect_list_get_property):
(webkit_dom_client_rect_list_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
(webkit_dom_comment_dom_event_target_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
(webkit_dom_dom_selection_get_property):
(webkit_dom_dom_selection_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
(webkit_dom_dom_token_list_set_property):
(webkit_dom_dom_token_list_get_property):
(webkit_dom_dom_token_list_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
(webkit_dom_dom_window_dom_event_target_init):
(webkit_dom_dom_window_set_property):
(webkit_dom_dom_window_get_property):
(webkit_dom_dom_window_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
(webkit_dom_document_dom_event_target_init):
(webkit_dom_document_set_property):
(webkit_dom_document_get_property):
(webkit_dom_document_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
(webkit_dom_document_fragment_dom_event_target_init):
(webkit_dom_document_fragment_get_property):
(webkit_dom_document_fragment_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
(webkit_dom_document_type_dom_event_target_init):
(webkit_dom_document_type_get_property):
(webkit_dom_document_type_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
(webkit_dom_element_dom_event_target_init):
(webkit_dom_element_set_property):
(webkit_dom_element_get_property):
(webkit_dom_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
(webkit_dom_event_set_property):
(webkit_dom_event_get_property):
(webkit_dom_event_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
(webkit_dom_file_get_property):
(webkit_dom_file_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
(webkit_dom_file_list_get_property):
(webkit_dom_file_list_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
(webkit_dom_html_anchor_element_dom_event_target_init):
(webkit_dom_html_anchor_element_set_property):
(webkit_dom_html_anchor_element_get_property):
(webkit_dom_html_anchor_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
(webkit_dom_html_applet_element_dom_event_target_init):
(webkit_dom_html_applet_element_set_property):
(webkit_dom_html_applet_element_get_property):
(webkit_dom_html_applet_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
(webkit_dom_html_area_element_dom_event_target_init):
(webkit_dom_html_area_element_set_property):
(webkit_dom_html_area_element_get_property):
(webkit_dom_html_area_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
(webkit_dom_html_br_element_dom_event_target_init):
(webkit_dom_html_br_element_set_property):
(webkit_dom_html_br_element_get_property):
(webkit_dom_html_br_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
(webkit_dom_html_base_element_dom_event_target_init):
(webkit_dom_html_base_element_set_property):
(webkit_dom_html_base_element_get_property):
(webkit_dom_html_base_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
(webkit_dom_html_body_element_dom_event_target_init):
(webkit_dom_html_body_element_set_property):
(webkit_dom_html_body_element_get_property):
(webkit_dom_html_body_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
(webkit_dom_html_button_element_dom_event_target_init):
(webkit_dom_html_button_element_set_property):
(webkit_dom_html_button_element_get_property):
(webkit_dom_html_button_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
(webkit_dom_html_canvas_element_dom_event_target_init):
(webkit_dom_html_canvas_element_set_property):
(webkit_dom_html_canvas_element_get_property):
(webkit_dom_html_canvas_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
(webkit_dom_html_collection_get_property):
(webkit_dom_html_collection_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
(webkit_dom_html_d_list_element_dom_event_target_init):
(webkit_dom_html_d_list_element_set_property):
(webkit_dom_html_d_list_element_get_property):
(webkit_dom_html_d_list_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
(webkit_dom_html_directory_element_dom_event_target_init):
(webkit_dom_html_directory_element_set_property):
(webkit_dom_html_directory_element_get_property):
(webkit_dom_html_directory_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
(webkit_dom_html_div_element_dom_event_target_init):
(webkit_dom_html_div_element_set_property):
(webkit_dom_html_div_element_get_property):
(webkit_dom_html_div_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
(webkit_dom_html_document_dom_event_target_init):
(webkit_dom_html_document_set_property):
(webkit_dom_html_document_get_property):
(webkit_dom_html_document_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
(webkit_dom_html_element_dom_event_target_init):
(webkit_dom_html_element_set_property):
(webkit_dom_html_element_get_property):
(webkit_dom_html_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
(webkit_dom_html_embed_element_dom_event_target_init):
(webkit_dom_html_embed_element_set_property):
(webkit_dom_html_embed_element_get_property):
(webkit_dom_html_embed_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
(webkit_dom_html_field_set_element_dom_event_target_init):
(webkit_dom_html_field_set_element_get_property):
(webkit_dom_html_field_set_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
(webkit_dom_html_font_element_dom_event_target_init):
(webkit_dom_html_font_element_set_property):
(webkit_dom_html_font_element_get_property):
(webkit_dom_html_font_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
(webkit_dom_html_form_element_dom_event_target_init):
(webkit_dom_html_form_element_set_property):
(webkit_dom_html_form_element_get_property):
(webkit_dom_html_form_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
(webkit_dom_html_frame_element_dom_event_target_init):
(webkit_dom_html_frame_element_set_property):
(webkit_dom_html_frame_element_get_property):
(webkit_dom_html_frame_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
(webkit_dom_html_frame_set_element_dom_event_target_init):
(webkit_dom_html_frame_set_element_set_property):
(webkit_dom_html_frame_set_element_get_property):
(webkit_dom_html_frame_set_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
(webkit_dom_html_hr_element_dom_event_target_init):
(webkit_dom_html_hr_element_set_property):
(webkit_dom_html_hr_element_get_property):
(webkit_dom_html_hr_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
(webkit_dom_html_head_element_dom_event_target_init):
(webkit_dom_html_head_element_set_property):
(webkit_dom_html_head_element_get_property):
(webkit_dom_html_head_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
(webkit_dom_html_heading_element_dom_event_target_init):
(webkit_dom_html_heading_element_set_property):
(webkit_dom_html_heading_element_get_property):
(webkit_dom_html_heading_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
(webkit_dom_html_html_element_dom_event_target_init):
(webkit_dom_html_html_element_set_property):
(webkit_dom_html_html_element_get_property):
(webkit_dom_html_html_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
(webkit_dom_html_iframe_element_dom_event_target_init):
(webkit_dom_html_iframe_element_set_property):
(webkit_dom_html_iframe_element_get_property):
(webkit_dom_html_iframe_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
(webkit_dom_html_image_element_dom_event_target_init):
(webkit_dom_html_image_element_set_property):
(webkit_dom_html_image_element_get_property):
(webkit_dom_html_image_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
(webkit_dom_html_input_element_dom_event_target_init):
(webkit_dom_html_input_element_set_property):
(webkit_dom_html_input_element_get_property):
(webkit_dom_html_input_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
(webkit_dom_html_li_element_dom_event_target_init):
(webkit_dom_html_li_element_set_property):
(webkit_dom_html_li_element_get_property):
(webkit_dom_html_li_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
(webkit_dom_html_label_element_dom_event_target_init):
(webkit_dom_html_label_element_set_property):
(webkit_dom_html_label_element_get_property):
(webkit_dom_html_label_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
(webkit_dom_html_legend_element_dom_event_target_init):
(webkit_dom_html_legend_element_set_property):
(webkit_dom_html_legend_element_get_property):
(webkit_dom_html_legend_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
(webkit_dom_html_link_element_dom_event_target_init):
(webkit_dom_html_link_element_set_property):
(webkit_dom_html_link_element_get_property):
(webkit_dom_html_link_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
(webkit_dom_html_map_element_dom_event_target_init):
(webkit_dom_html_map_element_set_property):
(webkit_dom_html_map_element_get_property):
(webkit_dom_html_map_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
(webkit_dom_html_marquee_element_dom_event_target_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
(webkit_dom_html_menu_element_dom_event_target_init):
(webkit_dom_html_menu_element_set_property):
(webkit_dom_html_menu_element_get_property):
(webkit_dom_html_menu_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
(webkit_dom_html_meta_element_dom_event_target_init):
(webkit_dom_html_meta_element_set_property):
(webkit_dom_html_meta_element_get_property):
(webkit_dom_html_meta_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
(webkit_dom_html_mod_element_dom_event_target_init):
(webkit_dom_html_mod_element_set_property):
(webkit_dom_html_mod_element_get_property):
(webkit_dom_html_mod_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
(webkit_dom_html_o_list_element_dom_event_target_init):
(webkit_dom_html_o_list_element_set_property):
(webkit_dom_html_o_list_element_get_property):
(webkit_dom_html_o_list_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
(webkit_dom_html_object_element_dom_event_target_init):
(webkit_dom_html_object_element_set_property):
(webkit_dom_html_object_element_get_property):
(webkit_dom_html_object_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
(webkit_dom_html_opt_group_element_dom_event_target_init):
(webkit_dom_html_opt_group_element_set_property):
(webkit_dom_html_opt_group_element_get_property):
(webkit_dom_html_opt_group_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
(webkit_dom_html_option_element_dom_event_target_init):
(webkit_dom_html_option_element_set_property):
(webkit_dom_html_option_element_get_property):
(webkit_dom_html_option_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
(webkit_dom_html_options_collection_set_property):
(webkit_dom_html_options_collection_get_property):
(webkit_dom_html_options_collection_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
(webkit_dom_html_paragraph_element_dom_event_target_init):
(webkit_dom_html_paragraph_element_set_property):
(webkit_dom_html_paragraph_element_get_property):
(webkit_dom_html_paragraph_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
(webkit_dom_html_param_element_dom_event_target_init):
(webkit_dom_html_param_element_set_property):
(webkit_dom_html_param_element_get_property):
(webkit_dom_html_param_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
(webkit_dom_html_pre_element_dom_event_target_init):
(webkit_dom_html_pre_element_set_property):
(webkit_dom_html_pre_element_get_property):
(webkit_dom_html_pre_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
(webkit_dom_html_quote_element_dom_event_target_init):
(webkit_dom_html_quote_element_set_property):
(webkit_dom_html_quote_element_get_property):
(webkit_dom_html_quote_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
(webkit_dom_html_script_element_dom_event_target_init):
(webkit_dom_html_script_element_set_property):
(webkit_dom_html_script_element_get_property):
(webkit_dom_html_script_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
(webkit_dom_html_select_element_dom_event_target_init):
(webkit_dom_html_select_element_set_property):
(webkit_dom_html_select_element_get_property):
(webkit_dom_html_select_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
(webkit_dom_html_style_element_dom_event_target_init):
(webkit_dom_html_style_element_set_property):
(webkit_dom_html_style_element_get_property):
(webkit_dom_html_style_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
(webkit_dom_html_table_caption_element_dom_event_target_init):
(webkit_dom_html_table_caption_element_set_property):
(webkit_dom_html_table_caption_element_get_property):
(webkit_dom_html_table_caption_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
(webkit_dom_html_table_cell_element_dom_event_target_init):
(webkit_dom_html_table_cell_element_set_property):
(webkit_dom_html_table_cell_element_get_property):
(webkit_dom_html_table_cell_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
(webkit_dom_html_table_col_element_dom_event_target_init):
(webkit_dom_html_table_col_element_set_property):
(webkit_dom_html_table_col_element_get_property):
(webkit_dom_html_table_col_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
(webkit_dom_html_table_element_dom_event_target_init):
(webkit_dom_html_table_element_set_property):
(webkit_dom_html_table_element_get_property):
(webkit_dom_html_table_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
(webkit_dom_html_table_row_element_dom_event_target_init):
(webkit_dom_html_table_row_element_set_property):
(webkit_dom_html_table_row_element_get_property):
(webkit_dom_html_table_row_element_class_init):
(webkit_dom_html_table_row_element_insert_cell):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
(webkit_dom_html_table_section_element_dom_event_target_init):
(webkit_dom_html_table_section_element_set_property):
(webkit_dom_html_table_section_element_get_property):
(webkit_dom_html_table_section_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
(webkit_dom_html_text_area_element_dom_event_target_init):
(webkit_dom_html_text_area_element_set_property):
(webkit_dom_html_text_area_element_get_property):
(webkit_dom_html_text_area_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
(webkit_dom_html_title_element_dom_event_target_init):
(webkit_dom_html_title_element_set_property):
(webkit_dom_html_title_element_get_property):
(webkit_dom_html_title_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
(webkit_dom_html_u_list_element_dom_event_target_init):
(webkit_dom_html_u_list_element_set_property):
(webkit_dom_html_u_list_element_get_property):
(webkit_dom_html_u_list_element_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
(webkit_dom_keyboard_event_get_property):
(webkit_dom_keyboard_event_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
(webkit_dom_media_list_set_property):
(webkit_dom_media_list_get_property):
(webkit_dom_media_list_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
(webkit_dom_mouse_event_get_property):
(webkit_dom_mouse_event_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
(webkit_dom_named_node_map_get_property):
(webkit_dom_named_node_map_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp:
(webkit_dom_node_dom_event_target_init):
(webkit_dom_node_set_property):
(webkit_dom_node_get_property):
(webkit_dom_node_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
(webkit_dom_node_iterator_get_property):
(webkit_dom_node_iterator_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
(webkit_dom_node_list_get_property):
(webkit_dom_node_list_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.cpp:
(webkitDOMObjectSetProperty):
(webkit_dom_object_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
(webkit_dom_processing_instruction_dom_event_target_init):
(webkit_dom_processing_instruction_get_property):
(webkit_dom_processing_instruction_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
(webkit_dom_range_get_property):
(webkit_dom_range_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
(webkit_dom_style_sheet_set_property):
(webkit_dom_style_sheet_get_property):
(webkit_dom_style_sheet_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
(webkit_dom_style_sheet_list_get_property):
(webkit_dom_style_sheet_list_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
(webkit_dom_text_dom_event_target_init):
(webkit_dom_text_get_property):
(webkit_dom_text_class_init):
(webkit_dom_event_target_init): Deleted.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
(webkit_dom_tree_walker_get_property):
(webkit_dom_tree_walker_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
(webkit_dom_ui_event_get_property):
(webkit_dom_ui_event_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
(webkit_dom_wheel_event_get_property):
(webkit_dom_wheel_event_class_init):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
(webkit_dom_xpath_result_get_property):
(webkit_dom_xpath_result_class_init):
* WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp:
* WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
* WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp:
* WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
* WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp:
* WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
* WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
* WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
* WebProcess/WebPage/AcceleratedSurface.cpp:
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
* WebProcess/WebPage/DrawingAreaImpl.cpp:
* WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp:
* WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
* WebProcess/gtk/WaylandCompositorDisplay.cpp:
* WebProcess/gtk/WebProcessMainGtk.cpp:

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

21 months agoWebDriver: addCookie command should prepend a dot to domain if missing
carlosgc@webkit.org [Mon, 12 Feb 2018 07:33:46 +0000 (07:33 +0000)]
WebDriver: addCookie command should prepend a dot to domain if missing
https://bugs.webkit.org/show_bug.cgi?id=182328
<rdar://problem/37116398>

Reviewed by Michael Catanzaro.

RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot.

Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::addSingleCookie):

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

21 months ago[MIPS] JSC needs to be built with -latomic
guijemont@igalia.com [Mon, 12 Feb 2018 07:32:16 +0000 (07:32 +0000)]
[MIPS] JSC needs to be built with -latomic
https://bugs.webkit.org/show_bug.cgi?id=182610

Reviewed by Žan Doberšek.

Since r228149, on MIPS we need to link with -latomic, because
__atomic_fetch_add_8 is not available as a compiler intrinsic.

* CMakeLists.txt:

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

21 months ago[WinCairo] Add WKBaseWin.h
commit-queue@webkit.org [Mon, 12 Feb 2018 06:22:57 +0000 (06:22 +0000)]
[WinCairo] Add WKBaseWin.h
https://bugs.webkit.org/show_bug.cgi?id=182681

Patch by Yousuke Kimoto <yousuke.kimoto@sony.com> on 2018-02-11
Reviewed by Yusuke Suzuki.

* PlatformWin.cmake:
* Shared/API/c/win/WKBaseWin.h: Added.

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

21 months ago[GTK] Scrolling sometimes jumps around
commit-queue@webkit.org [Sun, 11 Feb 2018 20:09:57 +0000 (20:09 +0000)]
[GTK] Scrolling sometimes jumps around
https://bugs.webkit.org/show_bug.cgi?id=178519

Patch by Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> on 2018-02-11
Reviewed by Michael Catanzaro.

* platform/gtk/ScrollAnimatorGtk.cpp:
(WebCore::ScrollAnimatorGtk::computeVelocity): use -1 as the multiplier for the accumulated deltas,
since all we need is to make them negative. Multiplying by -1000 leads to very high velocities being
returned, causing the viewport to scroll to the end of the page.

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

21 months agoRemove an unused static variable in DeprecatedGlobalSettings.h
wenson_hsieh@apple.com [Sun, 11 Feb 2018 01:53:35 +0000 (01:53 +0000)]
Remove an unused static variable in DeprecatedGlobalSettings.h
https://bugs.webkit.org/show_bug.cgi?id=182672

Reviewed by Joseph Pecoraro.

After r227282, this flag is no longer used anywhere. No change in behavior.

* page/DeprecatedGlobalSettings.h:

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

21 months agoDon't waste memory for error.stack
fpizlo@apple.com [Sat, 10 Feb 2018 23:49:54 +0000 (23:49 +0000)]
Don't waste memory for error.stack
https://bugs.webkit.org/show_bug.cgi?id=182656

Reviewed by Saam Barati.

JSTests:

Tests the policy.

* stress/gc-error-stack.js: Added. Shows that the GC forgets frames now.
* stress/no-gc-error-stack.js: Added. Shows that the GC won't forget things if you ask for the stack.

Source/JavaScriptCore:

This makes the StackFrames in ErrorInstance and Exception weak. We simply forget their
contents if we GC.

This isn't going to happen under normal operation since your callees and code blocks will
still be alive when you ask for .stack.

Bug 182650 tracks improving this so that it's not lossy. For now, I think it's worth it,
since it is likely to recover 3-5 MB on membuster.

* heap/Heap.cpp:
(JSC::Heap::finalizeUnconditionalFinalizers):
* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::visitChildren):
(JSC::ErrorInstance::finalizeUnconditionally):
* runtime/ErrorInstance.h:
(JSC::ErrorInstance::subspaceFor):
* runtime/Exception.cpp:
(JSC::Exception::visitChildren):
(JSC::Exception::finalizeUnconditionally):
* runtime/Exception.h:
(JSC::Exception::valueOffset): Deleted.
(JSC::Exception::value const): Deleted.
(JSC::Exception::stack const): Deleted.
(JSC::Exception::didNotifyInspectorOfThrow const): Deleted.
(JSC::Exception::setDidNotifyInspectorOfThrow): Deleted.
* runtime/StackFrame.cpp:
(JSC::StackFrame::isFinalizationCandidate):
(JSC::StackFrame::finalizeUnconditionally):
(JSC::StackFrame::visitChildren): Deleted.
* runtime/StackFrame.h:
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

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

21 months ago[RenderTreeBuilder] Move RenderBlock::takeChild mutation to a RenderTreeBuilder
zalan@apple.com [Sat, 10 Feb 2018 15:44:55 +0000 (15:44 +0000)]
[RenderTreeBuilder] Move RenderBlock::takeChild mutation to a RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182662
<rdar://problem/37408571>

Reviewed by Simon Fraser.

No change in functionality.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::takeChild):
(WebCore::canDropAnonymousBlock): Deleted.
(WebCore::canMergeContiguousAnonymousBlocks): Deleted.
* rendering/RenderBlock.h:
(WebCore::RenderBlock::moveAllChildrenIncludingFloatsTo):
* rendering/RenderBlockFlow.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takenChildFromRenderBlock):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::canDropAnonymousBlock):
(WebCore::canMergeContiguousAnonymousBlocks):
(WebCore::RenderTreeBuilder::Block::takeChild):
* rendering/updating/RenderTreeBuilderBlock.h:

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

21 months agoWeb Inspector: Canvas tab: tree selection abruptly changes when selecting a recording...
mattbaker@apple.com [Sat, 10 Feb 2018 06:15:46 +0000 (06:15 +0000)]
Web Inspector: Canvas tab: tree selection abruptly changes when selecting a recording frame
https://bugs.webkit.org/show_bug.cgi?id=182667
<rdar://problem/37412639>

Reviewed by Devin Rousso.

* UserInterface/Views/CanvasSidebarPanel.css:
(.sidebar > .panel.navigation.canvas > .content > .recording-content > .navigation-bar):
(.sidebar > .panel.navigation.canvas:not(.has-recordings) > .filter-bar,):
(.sidebar > .panel.navigation.canvas > .content > .recording-content > .tree-outline .item.recording > .icon):
(.sidebar > .panel.navigation.canvas > .content > .recording-content > .tree-outline .item.folder-icon > .icon):
(.sidebar > .panel.navigation.canvas > .content > .recording-content > .tree-outline .item.folder-icon > .status):
(.sidebar > .panel.navigation.canvas > .content > .navigation-bar): Deleted.
(.sidebar > .panel.navigation.canvas > .content > .tree-outline .item.recording > .icon): Deleted.
(.sidebar > .panel.navigation.canvas > .content > .tree-outline .item.folder-icon > .icon): Deleted.
(.sidebar > .panel.navigation.canvas > .content > .tree-outline .item.folder-icon > .status): Deleted.
Style changes for the additional DOM element required to virtualize the recording tree outline.

* UserInterface/Views/CanvasSidebarPanel.js:
(WI.CanvasSidebarPanel):
In order to be virtualized, the tree must be the only child of its parent.

(WI.CanvasSidebarPanel.prototype.set action):
Ensure that a frame tree element isn't deselected when the last action
in the frame becomes selected in the RecordingContentView.

(WI.CanvasSidebarPanel.prototype.shown):
Refresh the sidebar, as represented objects may have changed while hidden.

(WI.CanvasSidebarPanel.prototype._currentRepresentedObjectsDidChange):
Unset the recording when no valid represented objects are found, to
prevent a stale recording tree from being shown when viewing the overview.

(WI.CanvasSidebarPanel.prototype._canvasChanged):
(WI.CanvasSidebarPanel.prototype._recordingChanged):
(WI.CanvasSidebarPanel.prototype._updateRecordingScopeBar):
Moved toggling of the "has-recordings" style to _canvasChanged, since
the navigation bar should be hidden when no canvas exists.

* UserInterface/Views/CollectionContentView.js:
(WI.CollectionContentView.prototype.addContentViewForItem):
(WI.CollectionContentView.prototype.removeContentViewForItem):
Drive by fixes for child view visible state.

* UserInterface/Views/TreeOutline.css:
(.tree-outline:not(.large):matches(:focus, .force-focus) .item.selected .status .indeterminate-progress-spinner):
Make spinner easier to see against the selection background color.

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

21 months agoMake run-perf-tests work with Speedometer 2.0 and re-enable the test
rniwa@webkit.org [Sat, 10 Feb 2018 06:14:52 +0000 (06:14 +0000)]
Make run-perf-tests work with Speedometer 2.0 and re-enable the test
https://bugs.webkit.org/show_bug.cgi?id=182088

Reviewed by Antti Koivisto.

This patch updates the test harness to report new metrics of Speedometer 2.0.

Replaced the total time by the geometric mean of the time spent in each suite, and added scores
as a metric in addition to time. Also, updated the PerfTestRunner harness and the results template
to support "Score" metric with "pt" as its unit.

* Skipped: Unskipped the test.
* Speedometer/resources/benchmark-report.js:
(window.benchmarkClient.willStartFirstIteration..createTest): Added the unit as an optional argument
to report the score in addition to time. Also report the geomean of time instead of the total time.
(window.benchmarkClient.willStartFirstIteration): Report the geomean of time.
(window.benchmarkClient.didRunSuites): Record the entire measuredValues instead of just tests.
(window.benchmarkClient.didFinishLastIteration): Report the scores.

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

21 months agoREGRESSION (r223440): Copying & pasting a list from Microsoft Word to TinyMCE fails
rniwa@webkit.org [Sat, 10 Feb 2018 05:07:56 +0000 (05:07 +0000)]
REGRESSION (r223440): Copying & pasting a list from Microsoft Word to TinyMCE fails
https://bugs.webkit.org/show_bug.cgi?id=182564

Reviewed by Wenson Hsieh.

Source/WebCore:

Turns out that Microsoft Word generates p and span elements with special styles instead of standard
ul and ol elements when copying a list items, and TinyMCE has a specialized code path to process
this proprietary format of Microsoft Word. The regression was caused by WebKit's sanitization code
stripping away these non-standard CSS rules and inline styles.

To preseve pre-r223440 behavior in TinyMCE, we preserve the following in a HTML markup:

1. The "html" element at the beginning with xmlns content attributes
2. @list rules in a style element starting with "/* List Definitions */" comment
3. inline style content attribute with "mso-list" property
4. comments conditional sections with "[if !supportLists]" and "[endif]"

(1) is needed for TinyMCE to trigger the specialized code path for Microsoft Word. (2) contains
the information about the structure of list items. (3) is needed to associate each p element with
a rule in (2). (4) is needed to strip away the content generated as list markers (e.g. dots).

We enable this "MSO list quirks" when the content comes from a non-WebKit client or a WebKit client
that doesn't enable custom pasteboard data (detected by the content origin being null), and the HTML
markup starts with a specific sequence of characters generated by Microsoft Word.

Test: http/tests/security/clipboard/copy-paste-html-across-origin-strips-mso-list.html
      PasteHTML.PreservesMSOList
      PasteHTML.StripsMSOListWhenMissingMSOHTMLElement
      PasteWebArchive.PreservesMSOList
      PasteWebArchive.StripsMSOListWhenMissingMSOHTMLElement

* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::appendTextSubstring): Added.
* editing/MarkupAccumulator.h:
* editing/WebContentReader.cpp:
(WebCore::FrameWebContentReader::msoListQuirksForMarkup const): Added. Enables the MSO list quirks
if the content origin is null. The content origin specifies the pasteboard content's origin if it's
copied in WebKit with custom pasteboard data types enabled. In all other applications, it would be
set to null.
* editing/WebContentReader.h:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::markupForFragmentInDocument): Moved to markup.cpp as sanitizedMarkupForFragmentInDocument.
(WebCore::sanitizeMarkupWithArchive):
(WebCore::WebContentReader::readWebArchive): Always disables MSO list quirks since this code path is
only used by WebKit's native code to paste content.
(WebCore::WebContentMarkupReader::readWebArchive): Calls msoListQuirksForMarkup since this is the code
path used by DataTransfer.
(WebCore::WebContentReader::readHTML): Always disables MSO list quirks since this code path is only
used by WebKit's native code to paste content.
(WebCore::WebContentMarkupReader::readHTML): Calls msoListQuirksForMarkup since this is the code path
used by DataTransfer.
* editing/markup.cpp:
(WebCore::sanitizeMarkup): Use sanitizedMarkupForFragmentInDocument to share code.
(WebCore::MSOListMode): Added. Set to Preserve if the sanitized markup is the one generated by
Microsoft Word, and MSO list quirks should actually kick in. This is unlike MSOListQuirks, which is
set to Enable whenever the content COULD be the one generated by Microsoft Word.
(WebCore::StyledMarkupAccumulator): Added a special MSO list preservation mode enabled by MSOListMode.
(WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator):
(WebCore::StyledMarkupAccumulator::appendElement): Preseve (3). Unfortunately, TinyMCE only recognizes
mso-list and related properties only if they appear on their own. But we also need to preserve
the inline style generated using the computed style since we would lose the inline styles of the text
otherwise (e.g. red text and bold font). To workaround this, we generate two style content attributes,
one containing computed styles and another one containing mso-list. Luckily, the HTML parsing algorithm
dictates that the first attribute always wins when more than one attributes of the same name appears,
so we place the computed style's style attribute first so that the pasted content in non-TinyMCE
environment will continue to work.
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
(WebCore::StyledMarkupAccumulator::appendNodeToPreserveMSOList): Added. Generates special markup for
the conditional statements and the special style element with @list rules.
(WebCore::createMarkupInternal):
(WebCore::createMarkup):
(WebCore::sanitizedMarkupForFragmentInDocument): Moved from WebContentReaderCocoa.mm. If MSOListQuirks
is set to Enable, and the markup starts with a specific sequence of characters, generate the markup
with the newly added quirks code in StyledMarkupAccumulator, and wrap it in a special "html" element
TinyMCE recognizes.
* editing/markup.h:
(WebCore::MSOListQuirks): Added. Set to CheckIfNeeded if the content COULD require MSO list quirks.

Tools:

Added tests for pasting HTML with list items generated by Microsoft Word as well as HTML which looks like
the one generated by Microsoft Word but missing a proper "html" element at the beginning.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/PasteHTML.mm: Added test cases.
* TestWebKitAPI/Tests/WebKitCocoa/PasteWebArchive.mm: Added test cases.
(msoListMarkupWithoutProperHTMLElement): Added.
* TestWebKitAPI/Tests/WebKitCocoa/mso-list.html: Added.

LayoutTests:

Added a test to make sure special Microsoft Word quirks would not get triggered
when pasting content copied within WebKit.

* http/tests/security/clipboard/copy-paste-html-across-origin-strips-mso-list-expected.txt: Added.
* http/tests/security/clipboard/copy-paste-html-across-origin-strips-mso-list.html: Added.
* http/tests/security/clipboard/resources/copy-mso-list.html: Added.

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

21 months agoRemove invalidated WebPage::handleEditingKeyboardEvent default implementation after...
ross.kirsling@sony.com [Sat, 10 Feb 2018 04:44:39 +0000 (04:44 +0000)]
Remove invalidated WebPage::handleEditingKeyboardEvent default implementation after r228260.
https://bugs.webkit.org/show_bug.cgi?id=182663

Reviewed by Chris Dumez.

This would need to be updated to turn `keyEvent` into `underlyingPlatformEvent`;
instead, we can remove it, as it's only for Windows, which doesn't yet support WK2.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::handleEditingKeyboardEvent): Deleted.

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

21 months agoAX: Accessibility is not notified when a web process cancels the suspension
n_wang@apple.com [Sat, 10 Feb 2018 01:46:04 +0000 (01:46 +0000)]
AX: Accessibility is not notified when a web process cancels the suspension
https://bugs.webkit.org/show_bug.cgi?id=182659

Reviewed by Ryosuke Niwa.

We were notifying Accessibility with the web process suspended information in actualPrepareToSuspend
and processDidResume. However, the suspension can be canceled during the prepare call. So that we
should also post a notification in cancelPrepareToSuspend.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::cancelPrepareToSuspend):

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

21 months agoImageBitmapRenderingContext should be Runtime guarded
dino@apple.com [Sat, 10 Feb 2018 01:24:49 +0000 (01:24 +0000)]
ImageBitmapRenderingContext should be Runtime guarded
https://bugs.webkit.org/show_bug.cgi?id=182665
<rdar://problem/37411410>

Reviewed by Sam Weinig.

Add a flag to ensure the ImageBitmapRenderingContext interface is only
visible when the runtime feature is enabled.

* bindings/js/WebCoreBuiltinNames.h:
* html/canvas/ImageBitmapRenderingContext.idl:

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

21 months agoMark two service worker LayoutTests as flaky.
ryanhaddad@apple.com [Sat, 10 Feb 2018 01:13:27 +0000 (01:13 +0000)]
Mark two service worker LayoutTests as flaky.

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

21 months ago[CMake] Make PAL headers copies
don.olmstead@sony.com [Sat, 10 Feb 2018 00:51:11 +0000 (00:51 +0000)]
[CMake] Make PAL headers copies
https://bugs.webkit.org/show_bug.cgi?id=182645

Reviewed by Alex Christensen.

Source/WebCore:

No new tests. No change in behavior.

* CMakeLists.txt:

Source/WebCore/PAL:

* pal/CMakeLists.txt:
* pal/PlatformAppleWin.cmake:
* pal/PlatformGTK.cmake:
* pal/PlatformMac.cmake:
* pal/PlatformWPE.cmake:
* pal/PlatformWin.cmake:
* pal/PlatformWinCairo.cmake:

Tools:

* TestWebKitAPI/CMakeLists.txt:

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

21 months agoSimplify .gitignore's WebKitLibraries/win section.
ross.kirsling@sony.com [Sat, 10 Feb 2018 00:48:52 +0000 (00:48 +0000)]
Simplify .gitignore's WebKitLibraries/win section.
https://bugs.webkit.org/show_bug.cgi?id=182618

Reviewed by Per Arne Vollan.

We need to update this section for WinCairoRequirements regardless, but
it never needed to be this longwinded in the first place.

* .gitignore:

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

21 months ago[RenderTreeBuilder] Move RenderRubyRun::takeChild mutation to a RenderTreeBuilder
zalan@apple.com [Sat, 10 Feb 2018 00:45:25 +0000 (00:45 +0000)]
[RenderTreeBuilder] Move RenderRubyRun::takeChild mutation to a RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182655
<rdar://problem/37406801>

Reviewed by Simon Fraser.

No change in functionality.

* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::takeChild):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChildFromRenderRubyRun):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::takeChild):
* rendering/updating/RenderTreeBuilderRuby.h:

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

21 months agoUnreviewed, updated GTK test expectations after r228276
mcatanzaro@igalia.com [Sat, 10 Feb 2018 00:18:03 +0000 (00:18 +0000)]
Unreviewed, updated GTK test expectations after r228276

* platform/gtk/TestExpectations:

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

21 months ago[Payment Request] Apple Pay sheet does not dismiss when calling complete() with resul...
aestes@apple.com [Sat, 10 Feb 2018 00:03:13 +0000 (00:03 +0000)]
[Payment Request] Apple Pay sheet does not dismiss when calling complete() with result "unknown" or "fail"
https://bugs.webkit.org/show_bug.cgi?id=182658
<rdar://problem/37293917>

Reviewed by Brady Eidson.

When PaymentResponse::complete() is called with a result of "unknown" or "fail", we should
treat this as a fatal error and dismiss the Apple Pay sheet. However, we were adding an
error with code "unknown" to the authorization result, which PassKit interprets as a
non-fatal error. Instead, we should not set any errors and just use a status code of
PaymentAuthorizationStatus::Failure, which PassKit interprets as a fatal error, dismissing
the sheet.

No test possible.

* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::complete):

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

21 months agoSandbox violating attempting to read log formatting preference file
bfulgham@apple.com [Fri, 9 Feb 2018 23:56:41 +0000 (23:56 +0000)]
Sandbox violating attempting to read log formatting preference file
https://bugs.webkit.org/show_bug.cgi?id=182648
<rdar://problem/36629495>

Reviewed by Eric Carlson.

Various frameworks attempt to read logging format information from /usr/local/lib/log. The sandbox is blocking
this, generating log spam and preventing some logging features from working properly. We should allow read
access to this path.

* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* WebProcess/com.apple.WebProcess.sb.in:

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

21 months agoPasting from Excel no longer provides text/html data
wenson_hsieh@apple.com [Fri, 9 Feb 2018 23:41:34 +0000 (23:41 +0000)]
Pasting from Excel no longer provides text/html data
https://bugs.webkit.org/show_bug.cgi?id=182636
<rdar://problem/37087060>

Reviewed by Ryosuke Niwa.

Source/WebCore:

After r222656, we treat images on the pasteboard as files. However, we also have an existing policy which hides
text data ("text/uri-list", "text/html", "text/plain") from the page when files are present on the pasteboard.
When copying a table, Microsoft Excel writes a rendering of the table to the pasteboard as an image. This means
that we'll hide other data types (importantly, 'text/html') upon pasting, even though important clients (such as
Google Docs and Confluence) depend on the 'text/html' data in order to correctly handle the paste (rather than
paste as an image of a table).

To fix this, we add an exception to the DataTransfer.getData codepath when the pasteboard contains files.
Instead of always returning the empty string for text/html, we still allow pasteboard access, but only read
from a limited set of rich text types, i.e. web archive, RTF(D), and HTML markup. Importantly, this prevents
us from exposing any file paths that appear as plain text or URLs on the pasteboard. Just as in the regular
codepath for getData(), if the pasteboard data comes from the same origin, we allow unsanitized access;
otherwise, we use WebContentMarkupReader to extract markup from the pasteboard.

Tests:  PasteMixedContent.ImageFileAndPlainText
        PasteMixedContent.ImageFileAndWebArchive
        PasteMixedContent.ImageFileAndHTML
        PasteMixedContent.ImageFileAndRTF
        PasteMixedContent.ImageFileAndURL
        PasteMixedContent.ImageFileWithHTMLAndURL
        DataInteractionTests.DataTransferGetDataWhenDroppingImageAndMarkup

Also rebaselined some layout tests, which cover changes in behavior when dropping on macOS and pasting on iOS.

* dom/DataTransfer.cpp:
(WebCore::DataTransfer::getDataForItem const):

Augment the codepath handling the case where the pasteboard contains files, such that we allow reading
"text/html", but only from rich text types.

(WebCore::DataTransfer::readStringFromPasteboard const):

Factor out logic for reading from the pasteboard into a private helper. This is called in two places from
getDataForItem: in the normal (existing) path, and in the case where we allow 'text/html' to be read despite
files appearing in the pasteboard.

One important difference here is that this helper now takes a WebContentReadingPolicy, whose purpose is to
prevent reading from non-rich-text types when files appear in the pasteboard.

Another tweak here is that we now use `lowercaseType` instead of the original (unadjusted) `type` when reading
from the pasteboard. This doesn't seem to be intended in the first place.

(WebCore::DataTransfer::types const):

Tweak the implementation of DataTransfer.types() in the case where files exist on the pasteboard, such that we
also add "text/html" if it is present in the list of DOM-safe types.

* dom/DataTransfer.h:
* platform/Pasteboard.h:

Introduce WebContentReadingPolicy, which indicates whether or not we should limit web content reading from the
pasteboard to only rich text types upon paste or drop. Normally, we allow all types to be read as web content
(::AnyType), but when files appear on the pasteboard, we force OnlyRichTextTypes to ensure that no other types
can unintentionally be read back as web content.

* platform/StaticPasteboard.h:
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::read):
* platform/ios/PasteboardIOS.mm:

Teach Pasteboard (on iOS) to respect WebContentReadingPolicy.

(WebCore::isTypeAllowedByReadingPolicy):
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::readRespectingUTIFidelities):
* platform/mac/PasteboardMac.mm:

Teach Pasteboard (on macOS) to respect WebContentReadingPolicy.

(WebCore::Pasteboard::read):
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::read):
* platform/wpe/PasteboardWPE.cpp:
(WebCore::Pasteboard::read):

Adjust non-Cocoa Pasteboard implementations for an interface change.

Tools:

Add new API tests to exercise pasting images with various other content types on macOS, and when dropping images
and HTML markup on iOS. See the WebCore ChangeLog for more detail.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/DataTransfer.html: Added.

Add a new API test harness that dumps various bits of information about a DataTransfer upon paste and drop.
While somewhat similar to some existing harnesses, this makes a distinction between the raw HTML data on the
pasteboard and the actual result of inserting said HTML into the DOM. This allows us to check that the HTML has
been sanitized, while making checks for the actual content of the HTML robust against inline style changes.

* TestWebKitAPI/Tests/WebKitCocoa/PasteImage.mm:
* TestWebKitAPI/Tests/WebKitCocoa/PasteMixedContent.mm: Added.

Add a new test suite to exercise pasting mixed content types. In these test cases, the pasteboard contains a
file, with some combination of plain text, rich text, and URLs.

(imagePath):
(writeTypesAndDataToPasteboard):

Add a helper to write a var-arg list of content types and data to the general NSPasteboard.

(setUpWebView):
(markupString):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(TestWebKitAPI::testIconImageData):
(TestWebKitAPI::TEST):
* TestWebKitAPI/cocoa/TestWKWebView.h:

Move a private declaration of -[WKWebView paste:] out to TestWKWebView.h, so that it can be shared across
multiple tests. Currently, it only resides in PasteImage.mm, but I need it in PasteMixedContent.mm as well.

LayoutTests:

Rebaseline some existing layout tests. We now expose "text/html" alongside "Files" on DataTransfer.types() in
some circumstances. This also provides some test coverage for ensuring that the paste codepath iOS allows the
page to request HTML, even if there are files on the pasteboard. See the WebCore ChangeLog for more detail.

* editing/pasteboard/data-transfer-item-list-add-file-multiple-times-expected.txt:
* editing/pasteboard/data-transfer-item-list-add-file-on-copy-expected.txt:
* editing/pasteboard/data-transfer-item-list-add-file-on-drag-expected.txt:

Adjust test expectations for the additional "text/html" type.

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

Instead of checking that types is [ "Files" ], just check that types contains "Files". On iOS, copying a
selected image does not also copy HTML, but on macOS it does; this covers both cases.

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

21 months ago[RenderTreeBuilder] Move RenderRubyAsInline/AsBlock::takeChild mutation to a RenderTr...
zalan@apple.com [Fri, 9 Feb 2018 23:23:02 +0000 (23:23 +0000)]
[RenderTreeBuilder] Move RenderRubyAsInline/AsBlock::takeChild mutation to a RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182651
<rdar://problem/37405042>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/RenderRuby.cpp:
(WebCore::RenderRubyAsInline::takeChild):
(WebCore::RenderRubyAsBlock::takeChild):
(WebCore::isAnonymousRubyInlineBlock): Deleted.
(WebCore::isRubyChildForNormalRemoval): Deleted.
(WebCore::findRubyRunParent): Deleted.
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChildFromRenderRubyAsInline):
(WebCore::RenderTreeBuilder::takeChildFromRenderRubyAsBlock):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::findRubyRunParent):
(WebCore::RenderTreeBuilder::Ruby::takeChild):
* rendering/updating/RenderTreeBuilderRuby.h:

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

21 months agoAssert that NSApp is not running in the WebProcess.
pvollan@apple.com [Fri, 9 Feb 2018 22:13:00 +0000 (22:13 +0000)]
Assert that NSApp is not running in the WebProcess.
https://bugs.webkit.org/show_bug.cgi?id=182553

Reviewed by Simon Fraser.

In WebCore, there are a few places where NSApp is referenced. Since the WebContent process
is no longer using the NSApplication run loop, and NSApp is no longer guaranteed to be
valid, we should make sure that the NSApp is not referenced by the WebContent process or
the Network process, by asserting that the NSApplication event loop is running when NSApp
is referenced. It is still ok for the UIProcess to reference NSApp. Adding these assert
will help catch NSApp references when the NSApplication run loop is not used.

Also, do not post a fake mouse event in PasteBoard::setDragImage when the NSApplication
run loop is not running, since this is only relevant in WK1.

No new tests, covered by existing tests.

* page/mac/EventHandlerMac.mm:
(WebCore::lastEventIsMouseUp):
(WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::setDragImage):

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

21 months ago[RenderTreeBuilder] Introduce RenderTreeBuilder to willBeDestoryed/removeFromParentAn...
zalan@apple.com [Fri, 9 Feb 2018 20:50:58 +0000 (20:50 +0000)]
[RenderTreeBuilder] Introduce RenderTreeBuilder to willBeDestoryed/removeFromParentAndDestroy
https://bugs.webkit.org/show_bug.cgi?id=182635
<rdar://problem/37377489>

Reviewed by Antti Koivisto.

This patch helps finding callsites where we don't have a RenderTreeBuilder instance.

No change in functionality.

* dom/Document.cpp:
(WebCore::Document::setFullScreenRenderer):
* dom/Document.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::willBeDestroyed):
(WebCore::RenderBlock::takeChild):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::willBeDestroyed):
* rendering/RenderBlockFlow.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::willBeDestroyed):
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::willBeDestroyed):
(WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations):
* rendering/RenderBoxModelObject.h:
* rendering/RenderButton.cpp:
(WebCore::RenderButton::setText):
* rendering/RenderCounter.cpp:
(WebCore::RenderCounter::willBeDestroyed):
* rendering/RenderCounter.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::willBeDestroyed):
* rendering/RenderElement.h:
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::willBeDestroyed):
* rendering/RenderEmbeddedObject.h:
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::willBeDestroyed):
* rendering/RenderFragmentedFlow.h:
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::willBeDestroyed):
(WebCore::RenderFullScreen::wrapNewRenderer):
(WebCore::RenderFullScreen::wrapExistingRenderer):
(WebCore::RenderFullScreen::unwrapRenderer):
* rendering/RenderFullScreen.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::willBeDestroyed):
* rendering/RenderImage.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::willBeDestroyed):
* rendering/RenderInline.h:
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::willBeDestroyed):
* rendering/RenderLayerModelObject.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::willBeDestroyed):
* rendering/RenderListBox.h:
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::willBeDestroyed):
* rendering/RenderListItem.h:
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::willBeDestroyed):
* rendering/RenderListMarker.h:
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::willBeDestroyed):
* rendering/RenderMenuList.h:
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::handleSpannerRemoval):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::removeFromParentAndDestroy):
(WebCore::RenderObject::willBeDestroyed):
(WebCore::RenderObject::destroy):
* rendering/RenderObject.h:
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::willBeDestroyed):
* rendering/RenderReplaced.h:
* rendering/RenderRuby.cpp:
(WebCore::RenderRubyAsInline::takeChild):
(WebCore::RenderRubyAsBlock::takeChild):
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::willBeDestroyed):
* rendering/RenderSearchField.h:
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::willBeDestroyed):
* rendering/RenderSnapshottedPlugIn.h:
* rendering/RenderText.cpp:
(WebCore::RenderText::willBeDestroyed):
* rendering/RenderText.h:
* rendering/RenderTextControlMultiLine.cpp:
(WebCore::RenderTextControlMultiLine::willBeDestroyed):
* rendering/RenderTextControlMultiLine.h:
* rendering/RenderTextFragment.cpp:
(WebCore::RenderTextFragment::willBeDestroyed):
(WebCore::RenderTextFragment::setText):
* rendering/RenderTextFragment.h:
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::willBeDestroyed):
* rendering/RenderVideo.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::willBeDestroyed):
* rendering/RenderView.h:
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::willBeDestroyed):
* rendering/RenderWidget.h:
* rendering/svg/RenderSVGBlock.cpp:
(WebCore::RenderSVGBlock::willBeDestroyed):
* rendering/svg/RenderSVGBlock.h:
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::willBeDestroyed):
* rendering/svg/RenderSVGImage.h:
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::willBeDestroyed):
* rendering/svg/RenderSVGInline.h:
* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::willBeDestroyed):
* rendering/svg/RenderSVGModelObject.h:
* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::willBeDestroyed):
* rendering/svg/RenderSVGResourceContainer.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::willBeDestroyed):
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::willBeDestroyed):
* rendering/svg/RenderSVGText.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
* rendering/updating/RenderTreeBuilderList.cpp:
(WebCore::RenderTreeBuilder::List::updateItemMarker):
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):

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

21 months agoWeb Inspector: Object.shallowEqual always fails when comparing array property values
mattbaker@apple.com [Fri, 9 Feb 2018 20:40:10 +0000 (20:40 +0000)]
Web Inspector: Object.shallowEqual always fails when comparing array property values
https://bugs.webkit.org/show_bug.cgi?id=182634
<rdar://problem/37374639>

Reviewed by Devin Rousso.

Source/WebInspectorUI:

Object.shallowEqual should use Array.shallowEqual when comparing property
values, since strictly comparing objects/arrays is only true if both
operands reference the same Object.

* UserInterface/Base/Utilities.js:
(value):

LayoutTests:

* inspector/unit-tests/object-utilities-expected.txt:
* inspector/unit-tests/object-utilities.html:

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

21 months ago[macOS, iOS] Expose OS marketing version in UserAgent
bfulgham@apple.com [Fri, 9 Feb 2018 19:19:41 +0000 (19:19 +0000)]
[macOS, iOS] Expose OS marketing version in UserAgent
https://bugs.webkit.org/show_bug.cgi?id=182629
<rdar://problem/37370975>

Reviewed by Daniel Bates.

Revert back to dynamically reading the operating system marketing version
rather than using a hard-coded version.

* page/cocoa/UserAgent.mm:
(WebCore::systemMarketingVersionForUserAgentString):

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

21 months ago[Web Animations] Refactor AnimationEffect and KeyframeEffect into AnimationEffectRead...
graouts@webkit.org [Fri, 9 Feb 2018 19:11:32 +0000 (19:11 +0000)]
[Web Animations] Refactor AnimationEffect and KeyframeEffect into AnimationEffectReadOnly, KeyframeEffectReadOnly and KeyframeEffect
https://bugs.webkit.org/show_bug.cgi?id=182608

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Update WPT expectations with progressions and updated failure points for all tests that involved
either AnimationEffectReadOnly or KeyframeEffectReadOnly.

* web-platform-tests/web-animations/interfaces/Animation/constructor-expected.txt:
* web-platform-tests/web-animations/interfaces/Animation/effect-expected.txt:
* web-platform-tests/web-animations/interfaces/AnimationEffectTiming/idlharness-expected.txt:
* web-platform-tests/web-animations/interfaces/Document/getAnimations-expected.txt:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/constructor-expected.txt:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/copy-constructor-expected.txt:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/idlharness-expected.txt:

Source/WebCore:

Currently, we have an AnimationEffect class with read-write members and a KeyframeEffect subclass with read-write
members. The spec has an AnimationEffectReadOnly class, with read-only members, a KeyframeEffectReadOnly subclass,
with read-only members, and then the KeyframeEffect subclass (of KeyframeEffectReadOnly) with read-write members.

Likewise, currently we have an AnimationEffectTiming class with read-write members. While the spec has this class
as well, it also specifies a read-only AnimationEffectTimingReadOnly superclass.

In this patch we refactor the code to match the spec, which gives us a big boost in our WPT pass rate. The vast
majority of the code is just copied from one class to another verbatim. The limited actual code changes, all related
to the new subclassing, are:

- AnimationEffectTimingReadOnly is not actually read-only as far as WebCore is concerned, it actually exposes setters
for all of its properties, but the IDL for this class specifies all properties as read-only, so we match the spec. The
reason for this is that it is necessary to be able to set members of an AnimationEffectTimingReadOnly object based on
a Variant<double, KeyframeEffectOptions> provided to Element.animate() or the KeyframeEffectReadOnly and KeyframeEffect
constructors, and the logic to handle properties in such dictionaries is the same as the logic required to set individual
members in AnimationEffectTiming. So in essence, the sole role of AnimationTimingEffect is to provide an IDL interface
with read-write members, but the parent class is itself read-write as far as WebCore is concerned.

- AnimationEffectTimingReadOnly exposes a new setProperties() method which takes in a nullable Variant<double, KeyframeEffectOptions>
so that code that was previously specific to KeyframeEffect can be factored into this method and both the constructors of
KeyframeEffectReadOnly and KeyframeEffect can make use of it without code duplication.

- The AnimationEffectReadOnly constructor now takes an AnimationEffectTimingReadOnly as input since that class and
KeyframeEffectReadOnly expose an AnimationEffectTimingReadOnly object, while KeyframeEffect exposes an
AnimationEffectTiming read-write object. This allows the KeyframeEffect constructor to provide the right object type.

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/AnimationEffectReadOnly.cpp: Renamed from Source/WebCore/animation/AnimationEffect.cpp.
(WebCore::AnimationEffectReadOnly::AnimationEffectReadOnly):
(WebCore::AnimationEffectReadOnly::localTime const):
(WebCore::AnimationEffectReadOnly::phase const):
(WebCore::AnimationEffectReadOnly::activeTime const):
(WebCore::AnimationEffectReadOnly::overallProgress const):
(WebCore::AnimationEffectReadOnly::simpleIterationProgress const):
(WebCore::AnimationEffectReadOnly::currentIteration const):
(WebCore::AnimationEffectReadOnly::currentDirection const):
(WebCore::AnimationEffectReadOnly::directedProgress const):
(WebCore::AnimationEffectReadOnly::transformedProgress const):
(WebCore::AnimationEffectReadOnly::iterationProgress const):
(WebCore::AnimationEffectReadOnly::getComputedTiming):
* animation/AnimationEffectReadOnly.h: Renamed from Source/WebCore/animation/AnimationEffect.h.
(WebCore::AnimationEffectReadOnly::isKeyframeEffectReadOnly const):
(WebCore::AnimationEffectReadOnly::timing const):
* animation/AnimationEffectReadOnly.idl: Copied from Source/WebCore/animation/AnimationEffect.idl.
* animation/AnimationEffectTiming.cpp:
(WebCore::AnimationEffectTiming::AnimationEffectTiming):
(WebCore::AnimationEffectTiming::setIterationStart): Deleted.
(WebCore::AnimationEffectTiming::setIterations): Deleted.
(WebCore::AnimationEffectTiming::bindingsDuration const): Deleted.
(WebCore::AnimationEffectTiming::setBindingsDuration): Deleted.
(WebCore::AnimationEffectTiming::endTime const): Deleted.
(WebCore::AnimationEffectTiming::activeDuration const): Deleted.
(WebCore::AnimationEffectTiming::setEasing): Deleted.
* animation/AnimationEffectTiming.h:
(): Deleted.
* animation/AnimationEffectTiming.idl:
* animation/AnimationEffectTimingReadOnly.cpp: Copied from Source/WebCore/animation/AnimationEffectTiming.cpp.
(WebCore::AnimationEffectTimingReadOnly::create):
(WebCore::AnimationEffectTimingReadOnly::AnimationEffectTimingReadOnly):
(WebCore::AnimationEffectTimingReadOnly::~AnimationEffectTimingReadOnly):
(WebCore::AnimationEffectTimingReadOnly::setProperties):
(WebCore::AnimationEffectTimingReadOnly::setIterationStart):
(WebCore::AnimationEffectTimingReadOnly::setIterations):
(WebCore::AnimationEffectTimingReadOnly::bindingsDuration const):
(WebCore::AnimationEffectTimingReadOnly::setBindingsDuration):
(WebCore::AnimationEffectTimingReadOnly::setEasing):
(WebCore::AnimationEffectTimingReadOnly::endTime const):
(WebCore::AnimationEffectTimingReadOnly::activeDuration const):
* animation/AnimationEffectTimingReadOnly.h: Copied from Source/WebCore/animation/AnimationEffectTiming.h.
(WebCore::AnimationEffectTimingReadOnly::isAnimationEffectTiming const):
(WebCore::AnimationEffectTimingReadOnly::bindingsDelay const):
(WebCore::AnimationEffectTimingReadOnly::setBindingsDelay):
(WebCore::AnimationEffectTimingReadOnly::bindingsEndDelay const):
(WebCore::AnimationEffectTimingReadOnly::setBindingsEndDelay):
(WebCore::AnimationEffectTimingReadOnly::delay const):
(WebCore::AnimationEffectTimingReadOnly::setDelay):
(WebCore::AnimationEffectTimingReadOnly::endDelay const):
(WebCore::AnimationEffectTimingReadOnly::setEndDelay):
(WebCore::AnimationEffectTimingReadOnly::fill const):
(WebCore::AnimationEffectTimingReadOnly::setFill):
(WebCore::AnimationEffectTimingReadOnly::iterationStart const):
(WebCore::AnimationEffectTimingReadOnly::iterations const):
(WebCore::AnimationEffectTimingReadOnly::iterationDuration const):
(WebCore::AnimationEffectTimingReadOnly::setIterationDuration):
(WebCore::AnimationEffectTimingReadOnly::direction const):
(WebCore::AnimationEffectTimingReadOnly::setDirection):
(WebCore::AnimationEffectTimingReadOnly::easing const):
(WebCore::AnimationEffectTimingReadOnly::timingFunction const):
(WebCore::AnimationEffectTimingReadOnly::classType const):
* animation/AnimationEffectTimingReadOnly.idl: Renamed from Source/WebCore/animation/AnimationEffect.idl.
* animation/AnimationTimeline.h:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::create):
(WebCore::KeyframeEffect::KeyframeEffect):
(WebCore::IDLAttributeNameToAnimationPropertyName): Deleted.
(WebCore::CSSPropertyIDToIDLAttributeName): Deleted.
(WebCore::computeMissingKeyframeOffsets): Deleted.
(WebCore::processIterableKeyframes): Deleted.
(WebCore::processKeyframeLikeObject): Deleted.
(WebCore::processPropertyIndexedKeyframes): Deleted.
(WebCore::KeyframeEffect::getKeyframes): Deleted.
(WebCore::KeyframeEffect::processKeyframes): Deleted.
(WebCore::KeyframeEffect::computeStackingContextImpact): Deleted.
(WebCore::KeyframeEffect::apply): Deleted.
(WebCore::KeyframeEffect::shouldRunAccelerated): Deleted.
(WebCore::KeyframeEffect::getAnimatedStyle): Deleted.
(WebCore::KeyframeEffect::setAnimatedPropertiesInStyle): Deleted.
(WebCore::KeyframeEffect::startOrStopAccelerated): Deleted.
(WebCore::KeyframeEffect::renderer const): Deleted.
(WebCore::KeyframeEffect::currentStyle const): Deleted.
* animation/KeyframeEffect.h:
* animation/KeyframeEffect.idl:
* animation/KeyframeEffectReadOnly.cpp: Copied from Source/WebCore/animation/KeyframeEffect.cpp.
(WebCore::IDLAttributeNameToAnimationPropertyName):
(WebCore::CSSPropertyIDToIDLAttributeName):
(WebCore::computeMissingKeyframeOffsets):
(WebCore::processIterableKeyframes):
(WebCore::processKeyframeLikeObject):
(WebCore::processPropertyIndexedKeyframes):
(WebCore::KeyframeEffectReadOnly::create):
(WebCore::KeyframeEffectReadOnly::KeyframeEffectReadOnly):
(WebCore::KeyframeEffectReadOnly::getKeyframes):
(WebCore::KeyframeEffectReadOnly::processKeyframes):
(WebCore::KeyframeEffectReadOnly::computeStackingContextImpact):
(WebCore::KeyframeEffectReadOnly::apply):
(WebCore::KeyframeEffectReadOnly::shouldRunAccelerated):
(WebCore::KeyframeEffectReadOnly::getAnimatedStyle):
(WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle):
(WebCore::KeyframeEffectReadOnly::startOrStopAccelerated):
(WebCore::KeyframeEffectReadOnly::renderer const):
(WebCore::KeyframeEffectReadOnly::currentStyle const):
* animation/KeyframeEffectReadOnly.h: Copied from Source/WebCore/animation/KeyframeEffect.h.
(WebCore::KeyframeEffectReadOnly::~KeyframeEffectReadOnly):
(WebCore::KeyframeEffectReadOnly::target const):
(WebCore::KeyframeEffectReadOnly::iterationComposite const):
(WebCore::KeyframeEffectReadOnly::composite const):
(WebCore::KeyframeEffectReadOnly::isRunningAccelerated const):
* animation/KeyframeEffectReadOnly.idl: Copied from Source/WebCore/animation/KeyframeEffect.idl.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::create):
(WebCore::WebAnimation::setEffect):
* animation/WebAnimation.h:
* animation/WebAnimation.idl:
* bindings/js/JSAnimationEffectReadOnlyCustom.cpp: Copied from Source/WebCore/bindings/js/JSAnimationEffectCustom.cpp.
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/JSAnimationEffectTimingReadOnlyCustom.cpp: Renamed from Source/WebCore/bindings/js/JSAnimationEffectCustom.cpp.
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/JSCustomEventCustom.cpp:
(WebCore::JSCustomEvent::detail const): Fix an error introduced in webkit.org/b/179591.
* bindings/js/JSWebAnimationCustom.cpp:
(WebCore::constructJSWebAnimation):
* bindings/js/WebCoreBuiltinNames.h:

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

21 months ago[Payment Request] Crash in PaymentRequest::canMakePayment() when Apple Pay payment...
aestes@apple.com [Fri, 9 Feb 2018 19:07:28 +0000 (19:07 +0000)]
[Payment Request] Crash in PaymentRequest::canMakePayment() when Apple Pay payment method data is missing required fields
https://bugs.webkit.org/show_bug.cgi?id=182631

Reviewed by Mark Lam.

Source/WebCore:

PaymentRequest::canMakePayment() needs to parse each payment method's serialized data to
determine if it is a supported payment method. If parsing fails by raising an exception, we
intend to skip over that payment method and try the next one. If all payment method data
fail to parse, we resolve the returned promise with false. At no point do we intend to
propagate the parsing exception up to the calling script, however.

Even though we intend to swallow any exceptions from parsing, we failed to clear the
JavaScript VM's exception state. The next time WebCore tries to execute JavaScript, a
release assertion is raised due to seeing an unexpected exception in the VM.

Fix this by using a CatchScope in PaymentRequest::canMakePayment(), and calling
CatchScope::clearException() in the places we intend to swallow exceptions.

Added a test case to http/tests/paymentrequest/payment-request-canmakepayment-method.https.html.

* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::canMakePayment):

LayoutTests:

* http/tests/paymentrequest/payment-request-canmakepayment-method.https-expected.txt:
* http/tests/paymentrequest/payment-request-canmakepayment-method.https.html:

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

21 months agoUse REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR on any non-Windows port.
ross.kirsling@sony.com [Fri, 9 Feb 2018 18:59:54 +0000 (18:59 +0000)]
Use REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR on any non-Windows port.
https://bugs.webkit.org/show_bug.cgi?id=182623

Reviewed by Alex Christensen.

PerformanceTests:

* StitchMarker/wtf/Platform.h:
Simplify #if.

Source/WTF:

* wtf/Platform.h:
Simplify #if.

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

21 months agoUpdate TestExpectations for fast/forms/textarea/textarea-state-restore.html
ryanhaddad@apple.com [Fri, 9 Feb 2018 18:47:37 +0000 (18:47 +0000)]
Update TestExpectations for fast/forms/textarea/textarea-state-restore.html
https://bugs.webkit.org/show_bug.cgi?id=90980

Unreviewed test gardening.

* TestExpectations:
* platform/wk2/TestExpectations:

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

21 months agoFollow-up fixes after moving WebVideoFullscreenController from WebCore to WebKitLegacy.
pvollan@apple.com [Fri, 9 Feb 2018 18:40:08 +0000 (18:40 +0000)]
Follow-up fixes after moving WebVideoFullscreenController from WebCore to WebKitLegacy.
https://bugs.webkit.org/show_bug.cgi?id=182641

Reviewed by Dan Bernstein.

Remove incorrect use of WEBCORE_EXPORT and namespace WebCore after the files were moved in
https://trac.webkit.org/changeset/228308.

* WebView/WebVideoFullscreenController.h:
* WebView/WebVideoFullscreenHUDWindowController.mm:
* WebView/WebWindowAnimation.h:
* WebView/WebWindowAnimation.mm:
(WebCore::WebWindowAnimationDurationFromDuration): Deleted.
(WebCore::scaledRect): Deleted.
(WebCore::squaredDistance): Deleted.

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

21 months ago[RenderTreeBuilder] Move multicolumn descendant/sibling removal logic to RenderTreeBu...
zalan@apple.com [Fri, 9 Feb 2018 18:31:29 +0000 (18:31 +0000)]
[RenderTreeBuilder] Move multicolumn descendant/sibling removal logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182628
<rdar://problem/37369528>

Reviewed by Antti Koivisto.

No change in functionality

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::takeChild):
* rendering/RenderFragmentedFlow.h:
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::handleSpannerRemoval): Deleted.
(WebCore::RenderMultiColumnFlow::fragmentedFlowRelativeWillBeRemoved): Deleted.
* rendering/RenderMultiColumnFlow.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::multiColumnRelativeWillBeRemoved):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::handleSpannerRemoval):
(WebCore::RenderTreeBuilder::MultiColumn::multiColumnRelativeWillBeRemoved):
* rendering/updating/RenderTreeBuilderMultiColumn.h:

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

21 months agoAdd support for cache storage of blob response
commit-queue@webkit.org [Fri, 9 Feb 2018 18:27:13 +0000 (18:27 +0000)]
Add support for cache storage of blob response
https://bugs.webkit.org/show_bug.cgi?id=182637

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-09
Reviewed by Brady Eidson.

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/cache-storage/script-tests/cache-put.js:
(cache_test.async):
* web-platform-tests/service-workers/cache-storage/serviceworker/cache-put.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/window/cache-put.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/worker/cache-put.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/window/cache-put.https.html:

Source/WebCore:

Covered by updated WPT test.
When putting a blob response in cache, create a readable stream to easily get the body.
Make clear that caching form data is not supported.

* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::put):
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::isBlob const):
(WebCore::FetchBody::isFormData const):
* Modules/fetch/FetchResponse.h:

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

21 months agoMake CoreAudioCaptureSource error logging be release logging
commit-queue@webkit.org [Fri, 9 Feb 2018 18:10:53 +0000 (18:10 +0000)]
Make CoreAudioCaptureSource error logging be release logging
https://bugs.webkit.org/show_bug.cgi?id=182614

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-09
Reviewed by Eric Carlson.

No change of behavior.

* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioSharedUnit::addEchoCancellationSource):
(WebCore::CoreAudioSharedUnit::setupAudioUnit):
(WebCore::CoreAudioSharedUnit::configureMicrophoneProc):
(WebCore::CoreAudioSharedUnit::configureSpeakerProc):
(WebCore::CoreAudioSharedUnit::checkTimestamps):
(WebCore::CoreAudioSharedUnit::provideSpeakerData):
(WebCore::CoreAudioSharedUnit::processMicrophoneSamples):
(WebCore::CoreAudioSharedUnit::cleanupAudioUnit):
(WebCore::CoreAudioSharedUnit::reconfigureAudioUnit):
(WebCore::CoreAudioSharedUnit::startInternal):
(WebCore::CoreAudioSharedUnit::verifyIsCapturing):
(WebCore::CoreAudioSharedUnit::stopInternal):
(WebCore::CoreAudioSharedUnit::defaultInputDevice):

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

21 months agoImprove of string.h include after r228317.
clopez@igalia.com [Fri, 9 Feb 2018 18:03:02 +0000 (18:03 +0000)]
Improve of string.h include after r228317.
https://bugs.webkit.org/show_bug.cgi?id=182642

Reviewed by Mark Lam.

* bmalloc/Algorithm.h: Avoid an architecture-specific #include.

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

21 months agoAdd a way to check if a host is an IP address
commit-queue@webkit.org [Fri, 9 Feb 2018 17:32:57 +0000 (17:32 +0000)]
Add a way to check if a host is an IP address
https://bugs.webkit.org/show_bug.cgi?id=182427

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2018-02-09
Reviewed by Alex Christensen.

Source/WebCore:

There are several places where this is needed. We currently just assume that any host ending in a digit is an IP
address, except in PublicSuffix where platform specific code is used. This patch adds URL::hostIsIPAddress()
platform specific implementations, falling back to current assumption if there isn't an implementation for the
platform.

* page/OriginAccessEntry.cpp:
(WebCore::OriginAccessEntry::OriginAccessEntry): Use URL::hostIsIPAddress().
* platform/URL.cpp:
(WebCore::URL::hostIsIPAddress): Fallback implementation.
* platform/URL.h:
* platform/mac/PublicSuffixMac.mm:
(WebCore::topPrivatelyControlledDomain): Use URL::hostIsIPAddress().
* platform/mac/URLMac.mm:
(WebCore::URL::hostIsIPAddress): Move implementation from PublicSuffixMac.mm.
* platform/network/curl/CookieUtil.cpp:
(WebCore::CookieUtil::isIPAddress): Use URL::hostIsIPAddress().
* platform/soup/URLSoup.cpp:
(WebCore::URL::hostIsIPAddress): Use g_hostname_is_ip_address().

Tools:

Add unit test for URL::hostIsIPAddress().

* TestWebKitAPI/Tests/WebCore/URL.cpp:
(TestWebKitAPI::TEST_F):

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

21 months agoUnreviewed 32-bit build fix after <https://trac.webkit.org/changeset/228308>.
pvollan@apple.com [Fri, 9 Feb 2018 17:26:47 +0000 (17:26 +0000)]
Unreviewed 32-bit build fix after <https://trac.webkit.org/changeset/228308>.

* WebView/WebWindowAnimation.mm:
(-[WebWindowScaleAnimation additionalDurationNeededToReachFinalFrame]):

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

21 months ago[GStreamer][WebAudio] Winamp2-js woes
philn@webkit.org [Fri, 9 Feb 2018 16:48:53 +0000 (16:48 +0000)]
[GStreamer][WebAudio] Winamp2-js woes
https://bugs.webkit.org/show_bug.cgi?id=182612

Reviewed by Xabier Rodriguez Calvar and Carlos Alberto Lopez Perez.

Source/WebCore:

Test: webaudio/silence-after-playback.html

* platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
(WebCore::copyGStreamerBuffersToAudioChannel): Clear the bus if
the adapter can't provide enough data. This prevents a nasty noise
after playing songs in Winamp.
(WebCore::AudioSourceProviderGStreamer::setClient): No need to set
the client more than once, this fixes runtime warnings.

LayoutTests:

* webaudio/silence-after-playback-expected.wav: Added.
* webaudio/silence-after-playback.html: Added.

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

21 months ago[RenderTreeBuilder] Move multicolumn spanner mutation logic to RenderTreeBuilder
zalan@apple.com [Fri, 9 Feb 2018 15:05:15 +0000 (15:05 +0000)]
[RenderTreeBuilder] Move multicolumn spanner mutation logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182627
<rdar://problem/37367284>

Reviewed by Antti Koivisto.

Move spanner triggered mutation logic to RenderTreeBuilder.

No change in functionality.

* rendering/RenderFragmentedFlow.h:
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::isColumnSpanningDescendant const):
(WebCore::findSetRendering): Deleted.
(WebCore::isValidColumnSpanner): Deleted.
(WebCore::spannerPlacehoderCandidate): Deleted.
(WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant): Deleted.
(WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted): Deleted.
* rendering/RenderMultiColumnFlow.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::insertedIntoTree):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::multiColumnDescendantInserted):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::findSetRendering):
(WebCore::spannerPlacehoderCandidate):
(WebCore::isValidColumnSpanner):
(WebCore::RenderTreeBuilder::MultiColumn::multiColumnDescendantInserted):
(WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
* rendering/updating/RenderTreeBuilderMultiColumn.h:

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

21 months ago[css-align] Implement the new behavior of 'legacy' for justify-items
jfernandez@igalia.com [Fri, 9 Feb 2018 14:57:12 +0000 (14:57 +0000)]
[css-align] Implement the new behavior of 'legacy' for justify-items
https://bugs.webkit.org/show_bug.cgi?id=172712

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Rebaselined Default Alignment related tests because of the new 'legacy' value.

* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html:
* web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt:
* web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html:
* web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt:
* web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt:
* web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html:

Source/WebCore:

The syntax of the 'justify-items' property accepts a new 'legacy' value,
replacing the 'auto' value which is now parsed as invalid.

https://github.com/w3c/csswg-drafts/issues/1318

This change affects also to the 'place-items' shorthand, which doesn't
accept 'auto' and, for the time being, neither 'legacy'.

Since the new value 'legacy' is also the default value, I don't expect
this change to break content of sites currently using the 'justify-items'
property.

No new tests, rebaselined existing test.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForItemPositionWithOverflowAlignment):
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ItemPosition const):
* css/CSSProperties.json:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
* css/parser/CSSPropertyParser.cpp:
(WebCore::isAuto):
(WebCore::isNormalOrStretch):
(WebCore::consumeSelfPositionOverflowPosition):
(WebCore::consumeJustifyItems):
(WebCore::consumeSimplifiedDefaultPosition):
(WebCore::consumeSimplifiedSelfPosition):
(WebCore::CSSPropertyParser::consumePlaceItemsShorthand):
(WebCore::CSSPropertyParser::consumePlaceSelfShorthand):
* rendering/RenderFlexibleBox.cpp:
(WebCore::alignmentOffset):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::columnAxisPositionForChild const):
(WebCore::RenderGrid::rowAxisPositionForChild const):
* rendering/style/RenderStyle.cpp:
(WebCore::resolvedSelfAlignment):
(WebCore::RenderStyle::resolvedJustifyItems const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::initialJustifyItems):
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):

LayoutTests:

Rebaselined Default Alignment related tests because of the new 'legacy' value.

* css3/parse-alignment-of-root-elements.html:
* css3/parse-place-items.html:
* fast/css/parse-justify-items.html:

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

21 months agoFix build on ARMv7 traditional JSCOnly bot after r228306
clopez@igalia.com [Fri, 9 Feb 2018 13:50:39 +0000 (13:50 +0000)]
Fix build on ARMv7 traditional JSCOnly bot after r228306
https://bugs.webkit.org/show_bug.cgi?id=182563

Unreviewed build fix.

* assembler/AssemblerBuffer.h:

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

21 months agoFix build for !BCPU(X86_64) after r228306
clopez@igalia.com [Fri, 9 Feb 2018 13:37:40 +0000 (13:37 +0000)]
Fix build for !BCPU(X86_64) after r228306
https://bugs.webkit.org/show_bug.cgi?id=182563

Unreviewed build fix.

* bmalloc/Algorithm.h:

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

21 months ago[EME][GStreamer] Add support for encrypted caps in GStreamerUtilities
commit-queue@webkit.org [Fri, 9 Feb 2018 12:11:10 +0000 (12:11 +0000)]
[EME][GStreamer] Add support for encrypted caps in GStreamerUtilities
https://bugs.webkit.org/show_bug.cgi?id=181990

Patch by Yacine Bandou <yacine.bandou_ext@softathome.com> on 2018-02-09
Reviewed by Xabier Rodriguez-Calvar.

Add the support of encrypted caps in GStreamerUtilities.
Refactor the manner that the caps are handled, such as how to extract the resolution
from the video caps or how to check if the caps are encrypted.

The attachTrack function in PlaybackPipeline doesn't need the "structure" parameter,
it is already included in the "caps" parameter.

Replace the "mediaType" parameter by the "caps" parameter in reattachTrack function,
it allows to use the new functions that handle the caps in GStreamerUtilities.

Tests:
    media/encrypted-media/clearKey/clearKey-cenc-audio-playback-mse.html
    media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse.html

* platform/graphics/gstreamer/GStreamerUtilities.cpp:
(WebCore::getVideoSizeAndFormatFromCaps): Add the support of video encrypted caps.
(WebCore::getVideoResolutionFromCaps):
(WebCore::capsMediaType):
(WebCore::doCapsHaveType):
(WebCore::areEncryptedCaps): Add a new functions in order to handle the caps properly.
* platform/graphics/gstreamer/GStreamerUtilities.h:
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
* platform/graphics/gstreamer/mse/GStreamerMediaDescription.cpp:
(WebCore::GStreamerMediaDescription::codec const):
(WebCore::GStreamerMediaDescription::isVideo const):
(WebCore::GStreamerMediaDescription::isAudio const):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::attachTrack):
(WebCore::PlaybackPipeline::reattachTrack):
* platform/graphics/gstreamer/mse/PlaybackPipeline.h:
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
(webKitMediaSrcUpdatePresentationSize): Refactor some parts by using the new added functions.

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

21 months ago[GStreamer] Layout test fast/replaced/border-radius-clip.html crashes with GStreamer...
philn@webkit.org [Fri, 9 Feb 2018 09:14:59 +0000 (09:14 +0000)]
[GStreamer] Layout test fast/replaced/border-radius-clip.html crashes with GStreamer-CRITICAL **: gst_segment_to_stream_time: assertion 'segment->format == format' failed in gst_segment_to_stream_time()
https://bugs.webkit.org/show_bug.cgi?id=176802

Source/WebCore:

Reviewed by Xabier Rodriguez Calvar.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::load): Prevent the player from loading animated gifs.

Tools:

Reviewed by Xabier Rodriguez-Calvar.

* gstreamer/jhbuild.modules:
* gstreamer/patches/gst-plugins-good-0001-gstgdkpixbufdec-stop-pretending-to-decode-gifs.patch: Added.

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