WebKit-https.git
12 months agoImplement Promise.allSettled
dino@apple.com [Wed, 29 May 2019 21:28:09 +0000 (21:28 +0000)]
Implement Promise.allSettled
https://bugs.webkit.org/show_bug.cgi?id=197600
<rdar://problem/50483885>

Reviewed by Keith Miller.

JSTests:

Start testing Promise.allSettled. We pass most of the tests.
The ones that fail are similar to the Promise.all tests we already fail.

* test262/config.yaml: Remove Promise.allSettled from skipped tests.
* test262/expectations.yaml: Add new expectations for allSettled tests.

Source/JavaScriptCore:

Implement Promise.allSettled
https://github.com/tc39/proposal-promise-allSettled/

Shipping in Firefox since version 68.
Shipping in V8 since https://chromium.googlesource.com/v8/v8.git/+/1f6d27e8df819b448712dface6ad367fb8de426b

* builtins/PromiseConstructor.js:
(allSettled.newResolveRejectElements.resolveElement):
(allSettled.newResolveRejectElements.rejectElement):
(allSettled.newResolveRejectElements):
(allSettled): Added.
* runtime/JSPromiseConstructor.cpp: Add ref to allSettled.

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

12 months agoWeakPtr breaks vtables when upcasting to base classes
ggaren@apple.com [Wed, 29 May 2019 21:15:54 +0000 (21:15 +0000)]
WeakPtr breaks vtables when upcasting to base classes
https://bugs.webkit.org/show_bug.cgi?id=188799

Reviewed by Youenn Fablet.

Source/WebCore:

* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::MediaKeySession):
* Modules/encryptedmedia/MediaKeySession.h: Adopted modern WeakPtr APIs.
Removed redundant WeakPtrFactory.

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::existingWrapper):
* css/CSSFontFace.h: Moved functions out of line to avoid #include
explosion for .get().

* dom/ContainerNode.h:
* dom/Document.h:
* dom/Element.h: Moved CanMakeWeakPtr to ContainerNode because all
subclasses except for DocumentFragment were already so, and we have
code that uses WeakPtr<ContainerNode>, which, now that WeakPtr is
type-safe, is awkward to do when ContainerNode isn't CanMakeWeakPtr.

* dom/FullscreenManager.cpp:
(WebCore::FullscreenManager::fullscreenRenderer const):
* dom/FullscreenManager.h:
(WebCore::FullscreenManager::fullscreenRenderer const): Deleted.
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::form const):
* html/FormAssociatedElement.h:
(WebCore::FormAssociatedElement::form const): Deleted. Moved functions
out of line to avoid #include explosion for .get().

* html/HTMLMediaElement.h: It takes an extra using declaration
to disambiguate multiple CanMakeWeakPtr base classes now.

* loader/MediaResourceLoader.cpp:
(WebCore::MediaResourceLoader::requestResource): Removed redundant .get().

* page/DOMWindowProperty.cpp:
(WebCore::DOMWindowProperty::window const):
* page/DOMWindowProperty.h:
(WebCore::DOMWindowProperty::window const): Deleted.
* page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::subtreeLayoutRoot const):
* page/FrameViewLayoutContext.h:
(WebCore::FrameViewLayoutContext::subtreeLayoutRoot const): Deleted.
* page/UndoItem.cpp:
(WebCore::UndoItem::undoManager const):
* page/UndoItem.h:
(WebCore::UndoItem::undoManager const): Deleted. Moved functions out of
line to avoid #include explosion for .get().

* platform/ScrollView.h: It takes an extra using declaration
to disambiguate multiple CanMakeWeakPtr base classes now.

* platform/Widget.cpp:
(WebCore::Widget::parent const):
* platform/Widget.h:
(WebCore::Widget::parent const): Deleted. Moved functions out of line to avoid #include
explosion for .get().

* platform/encryptedmedia/CDMInstanceSession.h: Made
CDMInstanceSessionClient CanMakeWeakPtr because we use WeakPtr<CDMInstanceSessionClient>.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
CanMakeWeakPtr is inherited now.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
(WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmSession const): Deleted.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::createWeakPtr): Deleted.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::CMTimebaseEffectiveRateChangedCallback):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmSession const):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
(WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
(WebCore::SourceBufferPrivateAVFObjC::flushVideo):
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
(WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples):
(WebCore::SourceBufferPrivateAVFObjC::setVideoLayer):
(WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession): Modernized WeakPtr API usage.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::multiColumnFlowSlowCase const):
* rendering/RenderBlockFlow.h:
(WebCore::RenderBlockFlow::multiColumnFlow const):
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::findColumnSpannerPlaceholder const):
* rendering/RenderMultiColumnFlow.h:
* rendering/RenderTable.cpp:
(WebCore::RenderTable::header const):
(WebCore::RenderTable::footer const):
(WebCore::RenderTable::firstBody const):
(WebCore::RenderTable::topSection const):
* rendering/RenderTable.h:
(WebCore::RenderTable::header const): Deleted.
(WebCore::RenderTable::footer const): Deleted.
(WebCore::RenderTable::firstBody const): Deleted.
(WebCore::RenderTable::topSection const): Deleted. Moved functions out
of line to avoid #include explosion for .get().

Source/WebKit:

* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::networkSession):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::suspendedPage const):
* Shared/WebBackForwardListItem.h:
(WebKit::WebBackForwardListItem::suspendedPage const): Deleted. Moved
functions out of line to avoid #include explosion for .get().

* UIProcess/Authentication/cocoa/SecKeyProxyStore.h:
(WebKit::SecKeyProxyStore::get const):
(WebKit::SecKeyProxyStore::weakPtrFactory const): Deleted. Adopted
CanMakeWeakPtr.

* UIProcess/WebAuthentication/AuthenticatorManager.h:
* UIProcess/WebProcessProxy.cpp: It takes an extra using declaration
to disambiguate multiple CanMakeWeakPtr base classes now.

(WebKit::WebProcessProxy::processPool const):
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::processPool const): Deleted. Moved
functions out of line to avoid #include explosion for .get().

Source/WTF:

This patch switches from reinterpret_cast to static_cast when loading
from WeakReference storage.

We know which type to cast *to* because it's specified by the type of
the calling WeakPtr.

We know which type to cast *from* because it's specified by a typedef
in CanMakeWeakPtr.

(Our convention is that we store a pointer to the class that derives
from CanMakeWeakPtr. We cast from that pointer to derived pointers when
we get(). This means that #include of the derived type header is now
required in order to get() the pointer.)

* wtf/WeakHashSet.h:
(WTF::HashTraits<Ref<WeakReference>>::isReleasedWeakValue): Definition
is now eagerly required because WeakReference is not a template anymore.

(WTF::WeakHashSet::WeakHashSetConstIterator::get const):
(WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets):
(WTF::WeakHashSet::remove):
(WTF::WeakHashSet::contains const):
(WTF::WeakHashSet::computesEmpty const):
(WTF::WeakHashSet::hasNullReferences const):
(WTF::WeakHashSet::computeSize const):
(WTF::HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue): Deleted.
Updated for new WeakReference get() API.

* wtf/WeakPtr.h: Use a macro for TestAPI support. We can't use template
specialization because WeakReference is not a class template anymore.
(Or maybe we could have kept it working with a dummy template argument?
Felt weird, so I switched.)

(WTF::WeakReference::create):
(WTF::WeakReference::~WeakReference):
(WTF::WeakReference::get const):
(WTF::WeakReference::operator bool const):
(WTF::WeakReference::WeakReference): WeakReference is just a void* now.
It's the caller's responsibility, when creating and getting, to use
a consistent storage type. We ensure a canonical storage type using a
typedef inside CanMakeWeakPtr.

(WTF::WeakPtr::WeakPtr):
(WTF::WeakPtr::get const):
(WTF::WeakPtr::operator bool const):
(WTF::WeakPtr::operator-> const):
(WTF::WeakPtr::operator* const): Adopted new WeakReference API.

(WTF::WeakPtrFactory::createWeakPtr const): No need for reinterpret_cast.

(WTF::weak_reference_cast): This isn't required for correctness, but it's
nice to show a complier error at WeakPtr construction sites when you know
that the types won't work. Otherwise, you get compiler errors at
dereference sites, which are slightly more mysterious ways of saying that
you constructed your WeakPtr incorrectly.

(WTF::WeakPtr<T>::WeakPtr):
(WTF::=):
(WTF::makeWeakPtr):
(WTF::weak_reference_upcast): Deleted.
(WTF::weak_reference_downcast): Deleted.

Tools:

* TestWebKitAPI/Tests/WTF/WeakPtr.cpp: Adopt the new macro API instead
of template specialization for observing weak references.

(TestWebKitAPI::Int::Int):
(TestWebKitAPI::Int::operator int const):
(TestWebKitAPI::Int::operator== const): Use a class for integer tests
because WeakPtr doesn't naturally support pointing to non-class objects
now.

(TestWebKitAPI::Base::foo):
(TestWebKitAPI::Derived::foo): Inherit from CanMakeWeakPtr to enable
deduction of the weak pointer type.

(TestWebKitAPI::TEST): Updated to use Int.

(TestWebKitAPI::Base::weakPtrFactory const): Deleted.
(WTF::WeakReference<TestWebKitAPI::Base>::WeakReference): Deleted.
(WTF::WeakReference<TestWebKitAPI::Base>::~WeakReference): Deleted.

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

12 months ago[Pointer Events] toElement and fromElement should be null
commit-queue@webkit.org [Wed, 29 May 2019 21:04:55 +0000 (21:04 +0000)]
[Pointer Events] toElement and fromElement should be null
https://bugs.webkit.org/show_bug.cgi?id=198338

Patch by Antoine Quint <graouts@apple.com> on 2019-05-29
Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark WPT progressions now that we return the correct values for toElement and fromElement.

* web-platform-tests/pointerevents/pointerevent_pointerenter_does_not_bubble-expected.txt:
* web-platform-tests/pointerevents/pointerevent_pointerleave_does_not_bubble-expected.txt:

Source/WebCore:

* dom/MouseEvent.h:
* dom/PointerEvent.h:

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

12 months agoVersioning.
kocsen_chung@apple.com [Wed, 29 May 2019 20:29:26 +0000 (20:29 +0000)]
Versioning.

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

12 months agoUnreviewed, rolling out r245857.
ryanhaddad@apple.com [Wed, 29 May 2019 20:07:56 +0000 (20:07 +0000)]
Unreviewed, rolling out r245857.

Breaks internal builds.

Reverted changeset:

"WeakPtr breaks vtables when upcasting to base classes"
https://bugs.webkit.org/show_bug.cgi?id=188799
https://trac.webkit.org/changeset/245857

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

12 months agoFix internal watchOS build
achristensen@apple.com [Wed, 29 May 2019 19:37:14 +0000 (19:37 +0000)]
Fix internal watchOS build
https://bugs.webkit.org/show_bug.cgi?id=198344
<rdar://problem/51128965>

Reviewed by Geoff Garen.

* Misc/WebDownload.h:
Fix watchOS like we did iosmac in r245596

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

12 months agoFix builds that don't use makeWindowFromView
krollin@apple.com [Wed, 29 May 2019 19:16:35 +0000 (19:16 +0000)]
Fix builds that don't use makeWindowFromView
https://bugs.webkit.org/show_bug.cgi?id=198342
<rdar://problem/51228563>

Reviewed by Wenson Hsieh.

In some configurations, VideoFullscreenInterfaceAVKit.mm declares but
does not use makeWindowFromView. Fix by conditionalizing the the
declaration on the same symbol as point where it's used.

No new tests -- no new functionality.

* platform/ios/VideoFullscreenInterfaceAVKit.mm:

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

12 months ago[iOS] The WebContent process needs proper entitlement to do secure drawing
cdumez@apple.com [Wed, 29 May 2019 19:15:26 +0000 (19:15 +0000)]
[iOS] The WebContent process needs proper entitlement to do secure drawing
https://bugs.webkit.org/show_bug.cgi?id=198343
<rdar://problem/50671257>

Reviewed by Tim Horton.

The WebContent process needs proper entitlement to do secure drawing on iOS.

* Configurations/WebContent-iOS.entitlements:

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

12 months agoUserMediaCaptureManager should remove a source from its map once the source is ended
youenn@apple.com [Wed, 29 May 2019 18:51:25 +0000 (18:51 +0000)]
UserMediaCaptureManager should remove a source from its map once the source is ended
https://bugs.webkit.org/show_bug.cgi?id=198337

Reviewed by Eric Carlson.

When the source is stopped, for instance using MediaStreamTrack.stop,
remove the source from UserMediaCaptureManager sources map.
This makes sure the map will not grow over time.
Add an if check to ensure that the source is still there before processing an incoming IPC call.

When UIProcess tells us the capture is finished (typically capture failed), remove the entry on WebProcess side as well.

* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::createCaptureSource):
(WebKit::UserMediaCaptureManager::sourceStopped):
(WebKit::UserMediaCaptureManager::captureFailed):
(WebKit::UserMediaCaptureManager::sourceMutedChanged):
(WebKit::UserMediaCaptureManager::sourceSettingsChanged):
(WebKit::UserMediaCaptureManager::storageChanged):
(WebKit::UserMediaCaptureManager::ringBufferFrameBoundsChanged):
(WebKit::UserMediaCaptureManager::audioSamplesAvailable):
(WebKit::UserMediaCaptureManager::remoteVideoSampleAvailable):
(WebKit::UserMediaCaptureManager::sourceEnded):
(WebKit::UserMediaCaptureManager::applyConstraintsSucceeded):
(WebKit::UserMediaCaptureManager::applyConstraintsFailed):

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

12 months agoUserMediaCaptureManagerProxy::SourceProxy should directly have access to its IPC...
youenn@apple.com [Wed, 29 May 2019 18:36:06 +0000 (18:36 +0000)]
UserMediaCaptureManagerProxy::SourceProxy should directly have access to its IPC connection
https://bugs.webkit.org/show_bug.cgi?id=198335

Reviewed by Eric Carlson.

Previously, SourceProxy was getting its IPC connection by going through its manager, then its process proxy.
As some calls can be done from a background thread, it is safer to directly make SourceProxy own a Ref of its IPC connection.

* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::SourceProxy::SourceProxy):
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):

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

12 months agoWeakPtr breaks vtables when upcasting to base classes
ggaren@apple.com [Wed, 29 May 2019 18:22:00 +0000 (18:22 +0000)]
WeakPtr breaks vtables when upcasting to base classes
https://bugs.webkit.org/show_bug.cgi?id=188799

Reviewed by Youenn Fablet.

Source/WebCore:

* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::MediaKeySession):
* Modules/encryptedmedia/MediaKeySession.h: Adopted modern WeakPtr APIs.
Removed redundant WeakPtrFactory.

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::existingWrapper):
* css/CSSFontFace.h: Moved functions out of line to avoid #include
explosion for .get().

* dom/ContainerNode.h:
* dom/Document.h:
* dom/Element.h: Moved CanMakeWeakPtr to ContainerNode because all
subclasses except for DocumentFragment were already so, and we have
code that uses WeakPtr<ContainerNode>, which, now that WeakPtr is
type-safe, is awkward to do when ContainerNode isn't CanMakeWeakPtr.

* dom/FullscreenManager.cpp:
(WebCore::FullscreenManager::fullscreenRenderer const):
* dom/FullscreenManager.h:
(WebCore::FullscreenManager::fullscreenRenderer const): Deleted.
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::form const):
* html/FormAssociatedElement.h:
(WebCore::FormAssociatedElement::form const): Deleted. Moved functions
out of line to avoid #include explosion for .get().

* html/HTMLMediaElement.h: It takes an extra using declaration
to disambiguate multiple CanMakeWeakPtr base classes now.

* loader/MediaResourceLoader.cpp:
(WebCore::MediaResourceLoader::requestResource): Removed redundant .get().

* page/DOMWindowProperty.cpp:
(WebCore::DOMWindowProperty::window const):
* page/DOMWindowProperty.h:
(WebCore::DOMWindowProperty::window const): Deleted.
* page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::subtreeLayoutRoot const):
* page/FrameViewLayoutContext.h:
(WebCore::FrameViewLayoutContext::subtreeLayoutRoot const): Deleted.
* page/UndoItem.cpp:
(WebCore::UndoItem::undoManager const):
* page/UndoItem.h:
(WebCore::UndoItem::undoManager const): Deleted. Moved functions out of
line to avoid #include explosion for .get().

* platform/ScrollView.h: It takes an extra using declaration
to disambiguate multiple CanMakeWeakPtr base classes now.

* platform/Widget.cpp:
(WebCore::Widget::parent const):
* platform/Widget.h:
(WebCore::Widget::parent const): Deleted. Moved functions out of line to avoid #include
explosion for .get().

* platform/encryptedmedia/CDMInstanceSession.h: Made
CDMInstanceSessionClient CanMakeWeakPtr because we use WeakPtr<CDMInstanceSessionClient>.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
CanMakeWeakPtr is inherited now.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
(WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmSession const): Deleted.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::createWeakPtr): Deleted.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::CMTimebaseEffectiveRateChangedCallback):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmSession const):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
(WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
(WebCore::SourceBufferPrivateAVFObjC::flushVideo):
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
(WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples):
(WebCore::SourceBufferPrivateAVFObjC::setVideoLayer):
(WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession): Modernized WeakPtr API usage.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::multiColumnFlowSlowCase const):
* rendering/RenderBlockFlow.h:
(WebCore::RenderBlockFlow::multiColumnFlow const):
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::findColumnSpannerPlaceholder const):
* rendering/RenderMultiColumnFlow.h:
* rendering/RenderTable.cpp:
(WebCore::RenderTable::header const):
(WebCore::RenderTable::footer const):
(WebCore::RenderTable::firstBody const):
(WebCore::RenderTable::topSection const):
* rendering/RenderTable.h:
(WebCore::RenderTable::header const): Deleted.
(WebCore::RenderTable::footer const): Deleted.
(WebCore::RenderTable::firstBody const): Deleted.
(WebCore::RenderTable::topSection const): Deleted. Moved functions out
of line to avoid #include explosion for .get().

Source/WebKit:

* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::networkSession):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::suspendedPage const):
* Shared/WebBackForwardListItem.h:
(WebKit::WebBackForwardListItem::suspendedPage const): Deleted. Moved
functions out of line to avoid #include explosion for .get().

* UIProcess/Authentication/cocoa/SecKeyProxyStore.h:
(WebKit::SecKeyProxyStore::get const):
(WebKit::SecKeyProxyStore::weakPtrFactory const): Deleted. Adopted
CanMakeWeakPtr.

* UIProcess/WebAuthentication/AuthenticatorManager.h:
* UIProcess/WebProcessProxy.cpp: It takes an extra using declaration
to disambiguate multiple CanMakeWeakPtr base classes now.

(WebKit::WebProcessProxy::processPool const):
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::processPool const): Deleted. Moved
functions out of line to avoid #include explosion for .get().

Source/WTF:

This patch switches from reinterpret_cast to static_cast when loading
from WeakReference storage.

We know which type to cast *to* because it's specified by the type of
the calling WeakPtr.

We know which type to cast *from* because it's specified by a typedef
in CanMakeWeakPtr.

(Our convention is that we store a pointer to the class that derives
from CanMakeWeakPtr. We cast from that pointer to derived pointers when
we get(). This means that #include of the derived type header is now
required in order to get() the pointer.)

* wtf/WeakHashSet.h:
(WTF::HashTraits<Ref<WeakReference>>::isReleasedWeakValue): Definition
is now eagerly required because WeakReference is not a template anymore.

(WTF::WeakHashSet::WeakHashSetConstIterator::get const):
(WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets):
(WTF::WeakHashSet::remove):
(WTF::WeakHashSet::contains const):
(WTF::WeakHashSet::computesEmpty const):
(WTF::WeakHashSet::hasNullReferences const):
(WTF::WeakHashSet::computeSize const):
(WTF::HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue): Deleted.
Updated for new WeakReference get() API.

* wtf/WeakPtr.h: Use a macro for TestAPI support. We can't use template
specialization because WeakReference is not a class template anymore.
(Or maybe we could have kept it working with a dummy template argument?
Felt weird, so I switched.)

(WTF::WeakReference::create):
(WTF::WeakReference::~WeakReference):
(WTF::WeakReference::get const):
(WTF::WeakReference::operator bool const):
(WTF::WeakReference::WeakReference): WeakReference is just a void* now.
It's the caller's responsibility, when creating and getting, to use
a consistent storage type. We ensure a canonical storage type using a
typedef inside CanMakeWeakPtr.

(WTF::WeakPtr::WeakPtr):
(WTF::WeakPtr::get const):
(WTF::WeakPtr::operator bool const):
(WTF::WeakPtr::operator-> const):
(WTF::WeakPtr::operator* const): Adopted new WeakReference API.

(WTF::WeakPtrFactory::createWeakPtr const): No need for reinterpret_cast.

(WTF::weak_reference_cast): This isn't required for correctness, but it's
nice to show a complier error at WeakPtr construction sites when you know
that the types won't work. Otherwise, you get compiler errors at
dereference sites, which are slightly more mysterious ways of saying that
you constructed your WeakPtr incorrectly.

(WTF::WeakPtr<T>::WeakPtr):
(WTF::=):
(WTF::makeWeakPtr):
(WTF::weak_reference_upcast): Deleted.
(WTF::weak_reference_downcast): Deleted.

Tools:

* TestWebKitAPI/Tests/WTF/WeakPtr.cpp: Adopt the new macro API instead
of template specialization for observing weak references.

(TestWebKitAPI::Int::Int):
(TestWebKitAPI::Int::operator int const):
(TestWebKitAPI::Int::operator== const): Use a class for integer tests
because WeakPtr doesn't naturally support pointing to non-class objects
now.

(TestWebKitAPI::Base::foo):
(TestWebKitAPI::Derived::foo): Inherit from CanMakeWeakPtr to enable
deduction of the weak pointer type.

(TestWebKitAPI::TEST): Updated to use Int.

(TestWebKitAPI::Base::weakPtrFactory const): Deleted.
(WTF::WeakReference<TestWebKitAPI::Base>::WeakReference): Deleted.
(WTF::WeakReference<TestWebKitAPI::Base>::~WeakReference): Deleted.

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

12 months agoModernize getting proxies of UserMediaCaptureManagerProxy
youenn@apple.com [Wed, 29 May 2019 18:12:40 +0000 (18:12 +0000)]
Modernize getting proxies of UserMediaCaptureManagerProxy
https://bugs.webkit.org/show_bug.cgi?id=198336

Reviewed by Eric Carlson.

No change of behavior, use HashMap::get instead of find.

* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::startProducingData):
(WebKit::UserMediaCaptureManagerProxy::stopProducingData):
(WebKit::UserMediaCaptureManagerProxy::capabilities):
(WebKit::UserMediaCaptureManagerProxy::setMuted):
(WebKit::UserMediaCaptureManagerProxy::applyConstraints):

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

12 months ago[watchOS] Remove an unneeded #import
aestes@apple.com [Wed, 29 May 2019 17:59:31 +0000 (17:59 +0000)]
[watchOS] Remove an unneeded #import
https://bugs.webkit.org/show_bug.cgi?id=198339
<rdar://problem/51195415>

Reviewed by Wenson Hsieh.

* UIProcess/ios/forms/WKTimePickerViewController.mm:

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

12 months agoScrolling node ordering wrong when a layer has both positioning and fixed/sticky...
antti@apple.com [Wed, 29 May 2019 17:41:28 +0000 (17:41 +0000)]
Scrolling node ordering wrong when a layer has both positioning and fixed/sticky node
https://bugs.webkit.org/show_bug.cgi?id=198329

Reviewed by Darin Adler.

Source/WebCore:

Test: scrollingcoordinator/scrolling-tree/sticky-in-overflow.html

With sticky positioning in non-stacking context overflow you currently get structure like

FrameScrollingNode
  OverflowScrollingNode
  StickyNode
    PositionedNode

where StickyNode and PositionedNode reference the same layer. Sticky doesn't get applied at all when the overflow moves.

This patch reverses the order of sticky and positioned. It doesn't fix sticky positioning during scrolling yet,
but it does make it less jumpy. It is a prerequisite for the full fix.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):

LayoutTests:

* platform/ios-wk2/scrollingcoordinator/scrolling-tree/sticky-in-overflow-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/sticky-in-overflow-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/sticky-in-overflow.html: Added.

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

12 months agoPrepend KEY_ to the last key alias in PlatformEventKeyboardGtk
commit-queue@webkit.org [Wed, 29 May 2019 17:23:16 +0000 (17:23 +0000)]
Prepend KEY_ to the last key alias in PlatformEventKeyboardGtk
https://bugs.webkit.org/show_bug.cgi?id=198331

Patch by Ludovico de Nittis <ludovico.denittis@collabora.com> on 2019-05-29
Reviewed by Michael Catanzaro.

No behavior change.

With the commit
https://bugs.webkit.org/show_bug.cgi?id=198326
A gdk key slipped away from the renaming.

* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::modifiersForGdkKeyEvent):

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

12 months agoCorrect flaky WebAuthN test cases
bfulgham@apple.com [Wed, 29 May 2019 17:05:02 +0000 (17:05 +0000)]
Correct flaky WebAuthN test cases
https://bugs.webkit.org/show_bug.cgi?id=198308
<rdar://problem/48677219>

Reviewed by David Kilzer.

Correct offset math in the MockHidConnection implementation. The write position of
the payload buffer was computed using the value of 'size()', which is set to the full
capacity of the vector after a 'grow()' operation.

Tests: http/wpt/webauthn

* UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
(WebKit::MockHidConnection::feedReports):

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

12 months agoDisable Flaky API Test TestWebKitAPI._WKDownload.DownloadMonitorCancel
aakash_jain@apple.com [Wed, 29 May 2019 16:58:56 +0000 (16:58 +0000)]
Disable Flaky API Test TestWebKitAPI._WKDownload.DownloadMonitorCancel
https://bugs.webkit.org/show_bug.cgi?id=198328

Reviewed by Alexey Proskuryakov.

* TestWebKitAPI/Tests/WebKitCocoa/Download.mm:

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

12 months ago[LFC][IFC] Move Line class to a dedicated file
zalan@apple.com [Wed, 29 May 2019 16:07:19 +0000 (16:07 +0000)]
[LFC][IFC] Move Line class to a dedicated file
https://bugs.webkit.org/show_bug.cgi?id=198332
<rdar://problem/51221403>

Reviewed by Antti Koivisto.

An upcoming refactoring requires the Line class to be in a .h.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/displaytree/DisplayRun.h:
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::LineLayout::initializeLine const):
(WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const):
(WebCore::Layout::halfLeadingMetrics): Deleted.
(WebCore::Layout::Line::availableWidth const): Deleted.
(WebCore::Layout::Line::contentLogicalRight const): Deleted.
(WebCore::Layout::Line::contentLogicalWidth const): Deleted.
(WebCore::Layout::Line::logicalTop const): Deleted.
(WebCore::Layout::Line::logicalLeft const): Deleted.
(WebCore::Layout::Line::logicalRight const): Deleted.
(WebCore::Layout::Line::logicalBottom const): Deleted.
(WebCore::Layout::Line::logicalWidth const): Deleted.
(WebCore::Layout::Line::logicalHeight const): Deleted.
(WebCore::Layout::Line::LineItem::LineItem): Deleted.
(WebCore::Layout::Line::Line): Deleted.
(WebCore::Layout::Line::reset): Deleted.
(WebCore::Layout::Line::close): Deleted.
(WebCore::Layout::Line::removeTrailingTrimmableContent): Deleted.
(WebCore::Layout::Line::moveLogicalLeft): Deleted.
(WebCore::Layout::Line::moveLogicalRight): Deleted.
(WebCore::Layout::isTrimmableContent): Deleted.
(WebCore::Layout::Line::trailingTrimmableWidth const): Deleted.
(WebCore::Layout::Line::hasContent const): Deleted.
(WebCore::Layout::Line::appendNonBreakableSpace): Deleted.
(WebCore::Layout::Line::appendInlineContainerStart): Deleted.
(WebCore::Layout::Line::appendInlineContainerEnd): Deleted.
(WebCore::Layout::Line::appendTextContent): Deleted.
(WebCore::Layout::Line::appendNonReplacedInlineBox): Deleted.
(WebCore::Layout::Line::appendReplacedInlineBox): Deleted.
(WebCore::Layout::Line::appendHardLineBreak): Deleted.
* layout/inlineformatting/InlineTextItem.h:
* layout/inlineformatting/text/TextUtil.cpp:
(WebCore::Layout::TextUtil::isTrimmableContent):
* layout/inlineformatting/text/TextUtil.h:

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

12 months agoPlatformEventKeyboardGtk still uses old key aliases
commit-queue@webkit.org [Wed, 29 May 2019 13:07:02 +0000 (13:07 +0000)]
PlatformEventKeyboardGtk still uses old key aliases
https://bugs.webkit.org/show_bug.cgi?id=198326

Patch by Ludovico de Nittis <ludovico.denittis@collabora.com> on 2019-05-29
Reviewed by Carlos Garcia Campos.

No behavior change.

Use the new key names convention prepending "KEY_".

* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::PlatformKeyboardEvent::keyIdentifierForGdkKeyCode):
(WebCore::PlatformKeyboardEvent::windowsKeyCodeForGdkKeyCode):
(WebCore::PlatformKeyboardEvent::singleCharacterString):
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):

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

12 months ago[MSE][GStreamer] update the readyState correctly in MediaPlayerPrivateGStreamerMSE
commit-queue@webkit.org [Wed, 29 May 2019 06:00:40 +0000 (06:00 +0000)]
[MSE][GStreamer] update the readyState correctly in MediaPlayerPrivateGStreamerMSE
https://bugs.webkit.org/show_bug.cgi?id=197834

Patch by Yacine Bandou <yacine.bandou@softathome.com> on 2019-05-28
Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

The buffering state and the m_downloadFinished boolean aren't supported in the MSE case.
When the readyState is already "HaveEnoughData", we don't want to revert it to "HaveFutureData",
or else the MediaPlayer would send a "canplay" event instead of a "canplaythrough".

Test: media/media-source/media-source-canplaythrough-event.html

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

LayoutTests:

Add a new test that checks if the MediaElement receives the "canplaythrough"
event when the media content is entirely injected to MSE sourceBuffer.

* media/media-source/media-source-canplaythrough-event-expected.txt: Added.
* media/media-source/media-source-canplaythrough-event.html: Added.

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

12 months ago[WinCairo] REGRESSION(r245186) Crash in NetworkCache::IOChannel::read in http/tests...
Hironori.Fujii@sony.com [Wed, 29 May 2019 04:40:00 +0000 (04:40 +0000)]
[WinCairo] REGRESSION(r245186) Crash in NetworkCache::IOChannel::read in http/tests/IndexedDB some tests
https://bugs.webkit.org/show_bug.cgi?id=197941

Reviewed by Don Olmstead.

http/tests/IndexedDB some tests were crashing in
NetworkCache::IOChannel::read in order to allocate a buffer with
std::numeric_limits<size_t>::max() as the size.

IOChannel::read should check the file size, and calculate the read
size.

* NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp:
(WebKit::NetworkCache::IOChannel::read): Limit the read buffer
size by calling FileSystem::getFileSize.

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

12 months ago[WinCairo] ASSERTION FAILED: !m_preparingToPlay in MediaPlayerPrivateMediaFoundation...
Hironori.Fujii@sony.com [Wed, 29 May 2019 04:38:04 +0000 (04:38 +0000)]
[WinCairo] ASSERTION FAILED: !m_preparingToPlay in MediaPlayerPrivateMediaFoundation::prepareToPlay
https://bugs.webkit.org/show_bug.cgi?id=190747

Reviewed by Alex Christensen.

HTMLMediaElement::prepareToPlay had a assertion ensuring that it
was not called twice. However, it was called twice. The first from
HTMLMediaElement::load, the second from
MediaPlayerPrivateMediaFoundation::onTopologySet.

prepareToPlay started loading. And, loading should be started
after onTopologySet is called back.

Covered by existing tests.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::onTopologySet): Moved code from prepareToPlay.
(WebCore::MediaPlayerPrivateMediaFoundation::prepareToPlay): Deleted and moved the code to onTopologySet.
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: Removed prepareToPlay declaration.

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

12 months ago[WinCairo][MediaFoundation] Assertion failure in MediaPlayerPrivateMediaFoundation...
Hironori.Fujii@sony.com [Wed, 29 May 2019 04:33:26 +0000 (04:33 +0000)]
[WinCairo][MediaFoundation] Assertion failure in MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample
https://bugs.webkit.org/show_bug.cgi?id=198290

Reviewed by Per Arne Vollan.

Covered by existing tests.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample):
Call clear() of m_memSurface before assigning new value.

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

12 months ago[WHLSL] Type of dereference is the type of the thing we point to, not a pointer to...
sbarati@apple.com [Wed, 29 May 2019 04:13:53 +0000 (04:13 +0000)]
[WHLSL] Type of dereference is the type of the thing we point to, not a pointer to that type
https://bugs.webkit.org/show_bug.cgi?id=198321

Reviewed by Myles C. Maxfield.

Source/WebCore:

Consider this program:
```
thread int* x;
*x = 42
```

In the Checker, we were saying the type of "*x" was "int*" instead of "int".

Test: webgpu/whlsl-dereference-pointer-should-type-check.html

* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
(WebCore::WHLSL::Checker::visit):

LayoutTests:

* webgpu/whlsl-dereference-pointer-should-type-check-expected.html: Added.
* webgpu/whlsl-dereference-pointer-should-type-check.html: Added.

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

12 months agoAttempt to fix JSC test timeouts after adding collectContinuously to WASM tests.
justin_michaud@apple.com [Wed, 29 May 2019 03:27:47 +0000 (03:27 +0000)]
Attempt to fix JSC test timeouts after adding collectContinuously to WASM tests.
https://bugs.webkit.org/show_bug.cgi?id=198322

Reviewed by Saam Barati.

Increases the collection period from 1 to slightly higher to try to speed up the tests. Any higher and
the test runner does not detect the bug that required the memset in Wasm::Instance::Instance().

* Scripts/run-jsc-stress-tests:

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

12 months ago[iOS] Respect NSItemProvider's registered types when dropping files that are loaded...
wenson_hsieh@apple.com [Wed, 29 May 2019 02:56:09 +0000 (02:56 +0000)]
[iOS] Respect NSItemProvider's registered types when dropping files that are loaded in-place
https://bugs.webkit.org/show_bug.cgi?id=198315
<rdar://problem/51183762>

Reviewed by Tim Horton.

Source/WebCore:

Currently, logic in PasteboardIOS.mm and WebContentReaderCocoa.mm attempts to deduce the content type from the
file path when dropping attachments on iOS. Instead, we should be plumbing the content type through to the
reader.

Test: WKAttachmentTestsIOS.InsertDroppedImageWithNonImageFileExtension

* editing/WebContentReader.h:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::typeForAttachmentElement):

Add a helper method to determine which type to use in attachment elements. This makes the paste
(attachmentForData) and drop (attachmentForFilePaths) behave the same way, with respect to the type attribute
used to represent the attachment.

(WebCore::attachmentForFilePath):

Use the content type, if specified; otherwise, fall back to deducing it from the file path.

(WebCore::attachmentForData):
(WebCore::WebContentReader::readFilePath):
* platform/Pasteboard.h:
(WebCore::PasteboardWebContentReader::readFilePath):

Pass the highest fidelity representation's content type to the web content reader.

* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::readRespectingUTIFidelities):

Tools:

Adds a new API test to verify that when dropping a file that is loaded in-place with a file extension that is
not a .png (but was registered to the item provider as "public.png"), the resulting attachment is contained in
an image element, and the resulting attachment info indicates that the dropped attachment is a png file.

Additionally, rebaseline some existing tests.

* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(runTestWithTemporaryImageFile):
(TestWebKitAPI::TEST):

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

12 months agoMove idempotent text autosizing to StyleTreeResolver
mmaxfield@apple.com [Wed, 29 May 2019 02:27:20 +0000 (02:27 +0000)]
Move idempotent text autosizing to StyleTreeResolver
https://bugs.webkit.org/show_bug.cgi?id=197808
<rdar://problem/50283983>

Reviewed by Antti Koivisto.

Source/WebCore:

This patch migrates the idempotent text autosizing code to live inside style resolution. This is almost
the same as the algorithm that uses the result of layout to calculate autosizing, but this version only
operates on style (and thus doesn't require double layouts). Because it is being run in an environment
with less information, autosizing is occurring in more places, so the curves have been adjusted to make
autosizing not boost as much as the previous implementation did. The new algorithm is modelled after
text-decorations-in-effect. I've claimed 4 of the unused bits in RenderStyle to contain the state of the
autosizing algorithm. StyleResolver::adjustRenderStyle() is where the algorithm is implemented:
- Look at the inherited bits
- Interogate the element's RenderStyle
- Compute new bits for the element, and set them in its RenderStyle
- Based on the newly computed bits, determine whether we should increase the text size
- If so, determine how much using the specified font size, and apply the result to the computed font size

This works because StyleBuilderCustom::applyInheritFontSize() inherits from the specified font size, not
the computed font size.

This patch also will disable autosizing using the other methods (so there aren't two methods of autosizing
fighting each other) and will honor text-size-adjust:none. However, it won't honor text-size-adjust:100%.
If content says text-size-adjust:100%, we will disregard it and take this code path.

Tests: fast/text-autosizing/ios/idempotentmode/css-exposure.html
       fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-skip.html
       fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-identity.html
       fast/text-autosizing/ios/idempotentmode/idempotent-autosizing.html

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/StyleBuilderCustom.h:
(WebCore::computeBaseSpecifiedFontSize):
(WebCore::computeLineHeightMultiplierDueToFontSize):
* css/StyleResolver.cpp:
(WebCore::idempotentTextSize):
(WebCore::hasTextChildren):
(WebCore::StyleResolver::adjustRenderStyle):
(WebCore::StyleResolver::checkForTextSizeAdjust):
* page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::applyTextSizingIfNeeded):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustComputedFontSizes):
(WebCore::idempotentTextSize): Deleted.
* rendering/RenderBlockFlow.h:
* rendering/RenderElement.cpp:
(WebCore::includeNonFixedHeight):
(WebCore::RenderElement::adjustComputedFontSizesOnBlocks):
(WebCore::RenderElement::resetTextAutosizing):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::RenderStyle):
(WebCore::RenderStyle::autosizeStatus const):
(WebCore::RenderStyle::setAutosizeStatus):
* rendering/style/RenderStyle.h:
* rendering/style/TextSizeAdjustment.cpp: Added.
(WebCore::AutosizeStatus::AutosizeStatus):
(WebCore::AutosizeStatus::contains const):
(WebCore::AutosizeStatus::modifiedStatus const):
(WebCore::AutosizeStatus::shouldSkipSubtree const):
* rendering/style/TextSizeAdjustment.h:

LayoutTests:

* fast/text-autosizing/ios/idempotentmode/css-exposure-expected.txt: Added.
* fast/text-autosizing/ios/idempotentmode/css-exposure.html: Added.
* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-skip-expected.html: Added.
* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-skip.html: Added.
* platform/ipad/fast/text-autosizing/text-size-adjust-inline-style-expected.html: Removed.
* platform/ipad/fast/text-autosizing/text-size-adjust-inline-style.html: Removed.
We're intentionally not honoring percentages, because this is the most common way that
text autosizing is disabled (by setting it to 100%) on the Web today. However, Web authors
that have done this did it without knowing the full extent of the behavior change, and
the new idempotent text autosizing code path seems to be a progression in most cases
we've seen.

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

12 months agoUse scroll-velocity-based tile coverage for overflow:scroll
simon.fraser@apple.com [Wed, 29 May 2019 01:07:03 +0000 (01:07 +0000)]
Use scroll-velocity-based tile coverage for overflow:scroll
https://bugs.webkit.org/show_bug.cgi?id=198294
rdar://problem/48942184

Reviewed by Tim Horton.

Source/WebCore:

Start using a velocity-based tile coverage computation on layers with Type::ScrolledContents,
which is the content layers for overflow:scroll when they get big enough to get tiled.

Move legacy macOS coverage code into adjustTileCoverageForDesktopPageScrolling() because
I don't want to change its behavior in this patch. Use TileController::adjustTileCoverageRectForScrolling()
for iOS and macOS overflow scrolling. Since only iOS page scrolling gets velocity data from the UI
process, compute velocity in TileController using the visible rect top-left.

For overflow scroll, we have to plumb horizontal and vertical coverage in from
RenderLayerBacking.

Tests: tiled-drawing/scrolling/overflow/overflow-scrolled-down-tile-coverage.html
       tiled-drawing/scrolling/overflow/overflow-scrolled-up-tile-coverage.html
       tiled-drawing/scrolling/overflow/overflow-tile-coverage.html

* platform/graphics/TiledBacking.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::adjustCoverageRect const):
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::setVelocity):
(WebCore::TileController::adjustTileCoverageRect):
(WebCore::TileController::adjustTileCoverageForDesktopPageScrolling const):
(WebCore::TileController::adjustTileCoverageWithScrollingVelocity const):
(WebCore::TileController::adjustTileCoverageRectForScrolling):
(WebCore::expandRectWithinRect): Deleted.
(WebCore::TileController::adjustTileCoverageRect const): Deleted.
(WebCore::TileController::adjustTileCoverageRectForScrolling const): Deleted.
* platform/graphics/ca/TileController.h:
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::computePageTiledBackingCoverage):
(WebCore::computeOverflowTiledBackingCoverage):
(WebCore::RenderLayerBacking::adjustTiledBackingCoverage):
(WebCore::RenderLayerBacking::updateGeometry):

LayoutTests:

* tiled-drawing/scrolling/overflow/overflow-scrolled-down-tile-coverage-expected.txt: Added.
* tiled-drawing/scrolling/overflow/overflow-scrolled-down-tile-coverage.html: Added.
* tiled-drawing/scrolling/overflow/overflow-scrolled-up-tile-coverage-expected.txt: Added.
* tiled-drawing/scrolling/overflow/overflow-scrolled-up-tile-coverage.html: Added.
* tiled-drawing/scrolling/overflow/overflow-tile-coverage-expected.txt: Added.
* tiled-drawing/scrolling/overflow/overflow-tile-coverage.html: Added.

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

12 months agoGCHeapInspector should accept weird filename
ysuzuki@apple.com [Wed, 29 May 2019 01:05:45 +0000 (01:05 +0000)]
GCHeapInspector should accept weird filename
https://bugs.webkit.org/show_bug.cgi?id=198314

Reviewed by Simon Fraser.

GCHeapInspector filenameForPath should have a fallback path if regexp does not match against the given path.

* GCHeapInspector/script/interface.js:
(filenameForPath):

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

12 months agoFix sandbox violation when using QuickLook on iOS
bfulgham@apple.com [Wed, 29 May 2019 00:34:54 +0000 (00:34 +0000)]
Fix sandbox violation when using QuickLook on iOS
https://bugs.webkit.org/show_bug.cgi?id=198312
<rdar://problem/51134351>

Reviewed by Alexey Proskuryakov.

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

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

12 months agoWeb Inspector: Timelines: spacing around pie chart is different between CPU and Memory
drousso@apple.com [Wed, 29 May 2019 00:14:35 +0000 (00:14 +0000)]
Web Inspector: Timelines: spacing around pie chart is different between CPU and Memory
https://bugs.webkit.org/show_bug.cgi?id=198299

Reviewed by Matt Baker.

"Style Resolution" is a much longer string than any of the legend strings in the Memory
timeline, and causes the CPU timeline legend to shift as a result.

Rename "Script" to "JavaScript" and "Style Resolution" to "Styles" so that the strings are
roughly the same length between the CPU and Memory timelines, meaning that they will appear
in the same spot with similar sizing.

* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.displayNameForSampleType):
(WI.CPUTimelineView.prototype.initialLayout):
(WI.CPUTimelineView.prototype._computeStatisticsData):
Drive-by: remove the `WI` prefix from all `CPUTimelineView.SampleType` since it's within the
same class.

* UserInterface/Views/CPUTimelineView.css:
(.timeline-view.cpu > .content > .overview .legend > .row > .swatch.sample-type-javascript): Added.
(.timeline-view.cpu > .content > .overview .legend > .row > .swatch.sample-type-script): Deleted.
Drive-by: move the `.overview` rules lower to be in the same area as the `.overview *` rules.
* UserInterface/Views/MemoryTimelineView.css:
(.timeline-view.memory > .content > .overview):
Drive-by: remove duplicate CSS rule.
* Localizations/en.lproj/localizedStrings.js:

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

12 months agoHorizontal scrollbar flashes after scrolling vertically with keyboard
timothy_horton@apple.com [Tue, 28 May 2019 23:57:27 +0000 (23:57 +0000)]
Horizontal scrollbar flashes after scrolling vertically with keyboard
https://bugs.webkit.org/show_bug.cgi?id=197942
<rdar://problem/46169578>

Reviewed by Dean Jackson.

* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(axesForDelta):
(-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
Only flash relevant axes.

* Platform/spi/ios/UIKitSPI.h:

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

12 months agoBuild Fix.
achristensen@apple.com [Tue, 28 May 2019 23:40:24 +0000 (23:40 +0000)]
Build Fix.

* UIProcess/WKImagePreviewViewController.mm:
(-[WKImagePreviewViewController IGNORE_WARNINGS_END]):
(-[WKImagePreviewViewController previewActionItems]): Deleted.

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

12 months agoREGRESSION(r245795): causing internal testers to exit early after 50 crashes.
timothy_horton@apple.com [Tue, 28 May 2019 23:27:54 +0000 (23:27 +0000)]
REGRESSION(r245795): causing internal testers to exit early after 50 crashes.
https://bugs.webkit.org/show_bug.cgi?id=198310
<rdar://problem/51192535>

Reviewed by Simon Fraser.

* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(WebKit::touchActionsForPoint):
Initialize hitView to nil.

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

12 months agocreateAnswer() SDP Rejected by setLocalDescription()
youenn@apple.com [Tue, 28 May 2019 23:13:55 +0000 (23:13 +0000)]
createAnswer() SDP Rejected by setLocalDescription()
https://bugs.webkit.org/show_bug.cgi?id=195930
<rdar://problem/49030489>

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

Make sure to check packetization mode parameter when matching H264 video codec.

* Source/webrtc/media/base/codec.cc:
* WebKit/0001-fix-195930.patch: Added.

LayoutTests:

* webrtc/h264-packetization-mode-expected.txt: Added.
* webrtc/h264-packetization-mode.html: Added.

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

12 months ago[MacOS] Filter GVA warning logged to stdout
eric.carlson@apple.com [Tue, 28 May 2019 22:41:05 +0000 (22:41 +0000)]
[MacOS] Filter GVA warning logged to stdout
https://bugs.webkit.org/show_bug.cgi?id=198303
<rdar://problem/50098041>

Reviewed by Jer Noble.

* Scripts/webkitpy/port/mac.py:
(MacPort.logging_patterns_to_strip): Filter GVA warnings.

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

12 months agoWeb Inspector: Provide UIString descriptions to improve localizations
nvasilyev@apple.com [Tue, 28 May 2019 22:22:20 +0000 (22:22 +0000)]
Web Inspector: Provide UIString descriptions to improve localizations
https://bugs.webkit.org/show_bug.cgi?id=195132
<rdar://problem/48457817>

Reviewed by Devin Rousso.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/LoadLocalizedStrings.js:
(WI.UIString):
(WI.repeatedUIString.timelineRecordLayout):
(WI.repeatedUIString.timelineRecordPaint):
(WI.repeatedUIString.timelineRecordComposite):
(WI.repeatedUIString.allExceptions):
(WI.repeatedUIString.uncaughtExceptions):
(WI.repeatedUIString.assertionFailures):
(WI.repeatedUIString.allRequests):
(WI.repeatedUIString.fetch):
(WI.repeatedUIString.revealInDOMTree):
* UserInterface/Models/LayoutTimelineRecord.js:
(WI.LayoutTimelineRecord.displayNameForEventType):
* UserInterface/Models/RenderingFrameTimelineRecord.js:
(WI.RenderingFrameTimelineRecord.displayNameForTaskType):
* UserInterface/Models/Resource.js:
(WI.Resource.displayNameForType):
* UserInterface/Views/AuditTestGroupContentView.js:
(WI.AuditTestGroupContentView.prototype.layout):
* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.displayNameForSampleType):
* UserInterface/Views/ContextMenuUtilities.js:
* UserInterface/Views/DOMBreakpointTreeElement.js:
(WI.DOMBreakpointTreeElement.displayNameForType):
* UserInterface/Views/DOMNodeTreeElement.js:
(WI.DOMNodeTreeElement.prototype.populateContextMenu):
(WI.DOMNodeTreeElement):
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.populateDOMNodeContextMenu):
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._addBreakpoint):
(WI.DebuggerSidebarPanel.prototype._handleCreateBreakpointMouseDown):
(WI.DebuggerSidebarPanel):
* UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
(WI.LayerTreeDetailsSidebarPanel.prototype._buildDataGridSection):
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.shortDisplayNameForResourceType):
(WI.NetworkTableContentView.prototype.initialLayout):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):
(WI.SourcesNavigationSidebarPanel.prototype._handleCreateBreakpointMouseDown):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._renderSelector):
* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):

Tools:

Allow WI.UIString to take:
- WI.UIString(string, key, comment)
- WI.UIString(string, comment)
- WI.UIString(string)

* Scripts/extract-localizable-js-strings:

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

12 months agoLimit run-benchmark http server to specific interface.
dewei_zhu@apple.com [Tue, 28 May 2019 21:55:50 +0000 (21:55 +0000)]
Limit run-benchmark http server to specific interface.
https://bugs.webkit.org/show_bug.cgi?id=198247

Reviewed by Ryosuke Niwa.

Add '--interface' option to 'twisted_http_server.py'.
'SimpleHTTPServerDriver' should specify interface for http server.
Update regex that determines http server port from 'lsof' output to support ipv6 address.

* Scripts/webkitpy/benchmark_runner/http_server_driver/http_server/twisted_http_server.py:
Added '--interface' argument.
* Scripts/webkitpy/benchmark_runner/http_server_driver/simple_http_server_driver.py:
Limited http server to a specific interfce.
Added '-P' option to 'lsof' invocation to inhibits the conversion of port numbers to port name so script won't
fail if it's listening on a 'well-known' port.
Abstracted '_check_http_server_is_running' to allow potential child class to have its own implementation.
(SimpleHTTPServerDriver.serve): Updated regex that determines http server port from 'lsof' output to support ipv6 address.
(SimpleHTTPServerDriver.kill_server): Added null check for 'self._server_process'.

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

12 months agoUnreviewed, rolling out r245475.
sroberts@apple.com [Tue, 28 May 2019 21:10:47 +0000 (21:10 +0000)]
Unreviewed, rolling out r245475.

Newly imported test is flaky. Features need flags.

Reverted changeset:

"Implement imagesrcset and imagesizes attributes on link
rel=preload"
https://bugs.webkit.org/show_bug.cgi?id=192950
https://trac.webkit.org/changeset/245475

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

12 months agowebkitpy: Switch run-webkit-tests to tailspin
commit-queue@webkit.org [Tue, 28 May 2019 21:04:44 +0000 (21:04 +0000)]
webkitpy: Switch run-webkit-tests to tailspin
https://bugs.webkit.org/show_bug.cgi?id=198144
<rdar://problem/32463212>

Patch by David Xiong <w_xiong@apple.com> on 2019-05-28
Reviewed by Jonathan Bedard.

Changes run-webkit-tests to run tailspin on test time out
rather than spindump, and edited tests to look for tailspin logs
instead.

* Scripts/webkitpy/port/darwin.py:
(DarwinPort.sample_process): Replaced spindump with tailspin (+ symbolication)
(DarwinPort):
(DarwinPort.tailspin_file_path):
(DarwinTest.spindump_file_path): Deleted.
* Scripts/webkitpy/port/darwin_testcase.py:
(DarwinTest.test_tailspin): Changed spindump test (below) to test for tailspin instead
(DarwinTest.test_spindump): Deleted.
(DarwinTest.test_spindump.logging_run_command): Deleted.
* Scripts/webkitpy/port/ios_device_unittest.py:
(IOSDeviceTest.test_tailspin): Changed spindump tests (inc. below) to test for tailspin instead
(IOSDeviceTest.test_sample_process.logging_run_command):
(IOSDeviceTest.test_sample_process_exception.throwing_run_command):
(IOSDeviceTest.test_spindump): Deleted.
(IOSDeviceTest.test_spindump.logging_run_command): Deleted.

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

12 months agoProtect frames during style and layout changes
bfulgham@apple.com [Tue, 28 May 2019 21:02:38 +0000 (21:02 +0000)]
Protect frames during style and layout changes
https://bugs.webkit.org/show_bug.cgi?id=198047
<rdar://problem/50954082>

Reviewed by Zalan Bujtas.

Be more careful about the scope and lifetime of objects that participate in layout or
style updates. If a method decides a layout or style update is needed, it needs to
confirm that the elements it was operating on are still valid and needed in the
current operation.

Source/WebCore:

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::getOrCreate):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::accessibilityHitTest const):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSComputedStyleDeclaration.h:
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::svgPropertyValue):
* dom/Document.cpp:
(WebCore::Document::setFocusedElement):
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::insertTextRunWithoutNewlines):
(WebCore::TypingCommand::insertLineBreak):
(WebCore::TypingCommand::insertParagraphSeparator):
(WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
* editing/ios/EditorIOS.mm:
(WebCore::Editor::setDictationPhrasesAsChildOfElement):
* html/HTMLLabelElement.cpp:
(WebCore::HTMLLabelElement::focus):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::appendFormData):
* html/ImageDocument.cpp:
(WebCore::ImageDocument::imageClicked):
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::buildBubbleTree):
* page/FrameView.cpp:
(WebCore::FrameView::autoSizeIfEnabled):
(WebCore::FrameView::trackedRepaintRectsAsText const):
* page/PrintContext.cpp:
(WebCore::PrintContext::pageProperty):
(WebCore::PrintContext::numberOfPages):
(WebCore::PrintContext::spoolAllPagesWithBoundaries):

Source/WebKitLegacy/mac:

* DOM/DOM.mm:
(-[DOMRange renderedImageForcingBlackText:renderedImageForcingBlackText:]):
* WebView/WebHTMLView.mm:
(-[WebHTMLView _selectionDraggingImage]):
(-[WebHTMLView selectionImageForcingBlackText:selectionImageForcingBlackText:]):

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

12 months agoRemove dead code from sandboxes
bfulgham@apple.com [Tue, 28 May 2019 19:29:25 +0000 (19:29 +0000)]
Remove dead code from sandboxes
https://bugs.webkit.org/show_bug.cgi?id=198300

Reviewed by Alexey Proskuryakov.

SSIA.

* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:

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

12 months agoREGRESSION (r244182): inspector/canvas/recording-webgl-snapshots.html became flaky...
drousso@apple.com [Tue, 28 May 2019 19:10:23 +0000 (19:10 +0000)]
REGRESSION (r244182): inspector/canvas/recording-webgl-snapshots.html became flaky on WK1
https://bugs.webkit.org/show_bug.cgi?id=196875
<rdar://problem/49873252>

Reviewed by Said Abou-Hallawa.

Remove the `frameLimit` configuration on these tests, as they're short enough that when
running in debug, the timing between the `InspectorCanvasAgent` automatically stopping the
recording and the test page's `LastFrame` event (which will manually stop the recording) is
too close and can result in a race condition.

Instead, just wait for the test page to say "done" (`LastFrame`) before stopping the
recording, ensuring that the full "flow" of the recording is under the control of the test.

This isn't an issue when using Web Inspector "normally" (e.g. not in a test), because the
frontend UI will "ignore" these types of errors, not to mention it would be much harder for
a person to get the timing just right to even encounter this situation.

* inspector/canvas/recording-webgl-snapshots.html:
* inspector/canvas/recording-webgl2-snapshots.html:
* platform/mac/TestExpectations:

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

12 months ago[Pointer Events WPT] Unflake imported/w3c/web-platform-tests/pointerevents/pointereve...
commit-queue@webkit.org [Tue, 28 May 2019 19:08:21 +0000 (19:08 +0000)]
[Pointer Events WPT] Unflake imported/w3c/web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_drag_mouse.html
https://bugs.webkit.org/show_bug.cgi?id=197008

Patch by Antoine Quint <graouts@apple.com> on 2019-05-28
Reviewed by Jon Lee.

We raised an issue on the WPT test which was testing the event timestamp in an invalid manner (see https://github.com/w3c/pointerevents/issues/284
and https://github.com/web-platform-tests/wpt/issues/170160). As a result this test now passes reliably, so we can update the expected out and
the TestExpectations.

LayoutTests/imported/w3c:

* web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_drag_mouse-expected.txt:
* web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_drag_mouse.html:

LayoutTests:

* platform/mac/TestExpectations:

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

12 months agowebkitpy: Using sudo on iOS device during timeout spindumps
commit-queue@webkit.org [Tue, 28 May 2019 19:06:18 +0000 (19:06 +0000)]
webkitpy: Using sudo on iOS device during timeout spindumps
https://bugs.webkit.org/show_bug.cgi?id=198142

Patch by David Xiong <w_xiong@apple.com> on 2019-05-28
Reviewed by Jonathan Bedard.

* Scripts/webkitpy/port/darwin.py:
(DarwinPort.sample_process): Check target host instead of source host for sudo command.

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

12 months ago[async scrolling] Fixed positioning inside stacking context overflow scroll is jumpy
antti@apple.com [Tue, 28 May 2019 18:11:52 +0000 (18:11 +0000)]
[async scrolling] Fixed positioning inside stacking context overflow scroll is jumpy
https://bugs.webkit.org/show_bug.cgi?id=198292

Reviewed by Darin Adler.

Source/WebCore:

Tests: scrollingcoordinator/ios/fixed-in-stacking-context-overflow-scroll-2.html
       scrollingcoordinator/ios/fixed-in-stacking-context-overflow-scroll.html

We were computing delta from the layout scroll position in ScrollingTree::notifyRelatedNodesAfterScrollPositionChange
based on the passed in node only. If any other node had deltas they were not taken into account at all. This would occur
frequently since the function is always invoked for the root node after layer tree commit.

Fix by moving the delta computation (and fetching layoutViewport) to ScrollingTreeFixedNode.

* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::applyLayerPositions):

No need to pass offset and layoutViewport around anymore.

(WebCore::ScrollingTree::applyLayerPositionsRecursive):
(WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):

Remove the offset and layoutViewport computations.

(WebCore::ScrollingTree::notifyRelatedNodesRecursive):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeFrameHostingNode.cpp:
(WebCore::ScrollingTreeFrameHostingNode::applyLayerPositions):
* page/scrolling/ScrollingTreeFrameHostingNode.h:
* page/scrolling/ScrollingTreeNode.cpp:
(WebCore::ScrollingTreeNode::relatedNodeScrollPositionDidChange):
* page/scrolling/ScrollingTreeNode.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::applyLayerPositions):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/cocoa/ScrollingTreeFixedNode.h:
* page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::applyLayerPositions):

Compute them here instead, always taking all overflow scrollers up to the closest frame into account.

* page/scrolling/cocoa/ScrollingTreePositionedNode.h:
* page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
(WebCore::ScrollingTreePositionedNode::applyLayerPositions):
(WebCore::ScrollingTreePositionedNode::relatedNodeScrollPositionDidChange):
* page/scrolling/cocoa/ScrollingTreeStickyNode.h:
* page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::applyLayerPositions):

LayoutTests:

* scrollingcoordinator/ios/fixed-in-stacking-context-overflow-scroll-2-expected.html: Added.
* scrollingcoordinator/ios/fixed-in-stacking-context-overflow-scroll-2.html: Added.
* scrollingcoordinator/ios/fixed-in-stacking-context-overflow-scroll-expected.html: Added.
* scrollingcoordinator/ios/fixed-in-stacking-context-overflow-scroll.html: Added.

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

12 months agoUpdate sandbox rules for more News use cases
bfulgham@apple.com [Tue, 28 May 2019 17:33:58 +0000 (17:33 +0000)]
Update sandbox rules for more News use cases
https://bugs.webkit.org/show_bug.cgi?id=198236
<rdar://problem/50054027>

Reviewed by Alexey Proskuryakov.

Update the WebContent and Network process sandboxes so that News has the same set of allowed
service access as regular WebKit views.

* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:

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

12 months ago[LFC][Verification] Add additional inline and block checks
zalan@apple.com [Tue, 28 May 2019 17:29:33 +0000 (17:29 +0000)]
[LFC][Verification] Add additional inline and block checks
https://bugs.webkit.org/show_bug.cgi?id=198252
<rdar://problem/51140687>

Reviewed by Antti Koivisto.

Now we also test the geometry of the blocks with inline formatting contexts.

* layout/Verification.cpp:
(WebCore::Layout::checkForMatchingTextRuns):
(WebCore::Layout::verifyAndOutputSubtree):

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

12 months ago[YARR] Properly handle RegExp's that require large ParenContext space
msaboff@apple.com [Tue, 28 May 2019 17:19:09 +0000 (17:19 +0000)]
[YARR] Properly handle RegExp's that require large ParenContext space
https://bugs.webkit.org/show_bug.cgi?id=198065

Reviewed by Keith Miller.

JSTests:

New test.

* stress/regexp-large-paren-context.js: Added.
(testLargeRegExp):

Source/JavaScriptCore:

Changed what happens when we exceed VM::patternContextBufferSize when compiling a RegExp
that needs ParenCOntextSpace to fail the RegExp JIT compilation and fall back to the YARR
interpreter.  This can save large amounts of JIT memory for a
JIT'ed function that cannot ever succeed.

* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::initParenContextFreeList):
(JSC::Yarr::YarrGenerator::compile):

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

12 months ago[ews-build] Remove unused buildbot tabs
aakash_jain@apple.com [Tue, 28 May 2019 17:09:01 +0000 (17:09 +0000)]
[ews-build] Remove unused buildbot tabs
https://bugs.webkit.org/show_bug.cgi?id=198108

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/templates/build.jade: Removed unused 'Changes' and 'Responsible Users' tabs.

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

12 months agoJITOperations putByVal should mark negative array indices as out-of-bounds
tzagallo@apple.com [Tue, 28 May 2019 16:03:02 +0000 (16:03 +0000)]
JITOperations putByVal should mark negative array indices as out-of-bounds
https://bugs.webkit.org/show_bug.cgi?id=198271

Reviewed by Saam Barati.

JSTests:

* microbenchmarks/get-by-val-negative-array-index.js:
(foo):
Update the getByVal microbenchmark added in r245769. This now shows that r245769
is 4.2x faster than the previous commit.

* microbenchmarks/put-by-val-negative-array-index.js: Added.
(foo):

Source/JavaScriptCore:

Similar to what was done to getByVal in r245769, we should also mark put_by_val as out-of-bounds
when we exit from DFG for putting to a negative index. This avoids the same scenario where we keep
recompiling a CodeBlock with DFG and exiting at the same bytecode.

This is a 3.7x improvement in the microbenchmark being added: put-by-val-negative-array-index.js.

* jit/JITOperations.cpp:

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

12 months ago[LFC][IFC] Decouple line layout and processing inline runs.
zalan@apple.com [Tue, 28 May 2019 15:36:04 +0000 (15:36 +0000)]
[LFC][IFC] Decouple line layout and processing inline runs.
https://bugs.webkit.org/show_bug.cgi?id=198282
<rdar://problem/51167954>

Reviewed by Antti Koivisto.

This is in preparation for using "createInlineRunsForLine" logic when computing preferred width.

* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::UncommittedContent::size const):
(WebCore::Layout::InlineFormattingContext::LineLayout::createInlineRunsForLine const):
(WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
(WebCore::Layout::InlineFormattingContext::LineLayout::processInlineRuns const):
(WebCore::Layout::InlineFormattingContext::LineLayout::closeLine const): Deleted.
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::addInlineItem):
* layout/inlineformatting/InlineTextItem.cpp:
(WebCore::Layout::InlineTextItem::createAndAppendTextItems):

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

12 months ago[LFC][IFC] Move intrinsic width computation from InlineFormattingContext to LineLayout
zalan@apple.com [Tue, 28 May 2019 14:51:16 +0000 (14:51 +0000)]
[LFC][IFC] Move intrinsic width computation from InlineFormattingContext to LineLayout
https://bugs.webkit.org/show_bug.cgi?id=198258

Reviewed by Antti Koivisto.

This is in preparation for sharing even more code between line layout and preferred width computation.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::LineLayout::initializeLine const):
(WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
(WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const):
(WebCore::Layout::InlineFormattingContext::LineLayout::closeLine const):

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

12 months ago[LFC[IFC] Ignore the initial strut's height when the line does not have any content.
zalan@apple.com [Tue, 28 May 2019 14:48:57 +0000 (14:48 +0000)]
[LFC[IFC] Ignore the initial strut's height when the line does not have any content.
https://bugs.webkit.org/show_bug.cgi?id=198268
<rdar://problem/51150057>

Reviewed by Antti Koivisto.

The strut (https://www.w3.org/TR/CSS22/visudet.html#leading) defines the initial logical height
for the line. This height should be ignored though when the line does not have any content.

* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::LineLayout::closeLine const):

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

12 months ago[Pointer Events] Check that capturing data managed by the PointerCaptureController...
graouts@webkit.org [Tue, 28 May 2019 12:33:11 +0000 (12:33 +0000)]
[Pointer Events] Check that capturing data managed by the PointerCaptureController gets cleared upon navigation
https://bugs.webkit.org/show_bug.cgi?id=198191

Reviewed by Dean Jackson.

When the document of the page's main frame changes, make sure we clear all of the data accumulated for the previous document.
I don't think this particular change is testable as none of the data contained in the PointerIdToCapturingDataMap maintained by
the PointerCaptureController contains any data that could be inspected by the page due to other fixes landed to fix wkb.ug/198129,
but I've checked that removing those fixes and using this patch correctly fixes that bug.

* page/Page.cpp:
(WebCore::Page::didChangeMainDocument):
* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::PointerCaptureController):
(WebCore::PointerCaptureController::reset):
* page/PointerCaptureController.h:

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

12 months agoUnreviewed, revert r242070 due to Membuster regression
ysuzuki@apple.com [Tue, 28 May 2019 08:45:02 +0000 (08:45 +0000)]
Unreviewed, revert r242070 due to Membuster regression
https://bugs.webkit.org/show_bug.cgi?id=195013

Membuster shows ~0.3% regression.

* heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::runBeginPhase):
* heap/Heap.h:
* heap/HeapInlines.h:
(JSC::Heap::forEachSlotVisitor):
(JSC::Heap::numberOfSlotVisitors): Deleted.
* heap/MarkingConstraintSolver.cpp:
(JSC::MarkingConstraintSolver::didVisitSomething const):
* heap/SlotVisitor.h:

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

12 months ago[GTK] Use WPEBackend-fdo for accelerating compositing in Wayland instead of the neste...
carlosgc@webkit.org [Tue, 28 May 2019 06:36:34 +0000 (06:36 +0000)]
[GTK] Use WPEBackend-fdo for accelerating compositing in Wayland instead of the nested compositor
https://bugs.webkit.org/show_bug.cgi?id=197944

Reviewed by Michael Catanzaro.

.:

Add USE_WPE_RENDERER option to use WPEBackend-fdo.

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsPlayStation.cmake:
* Source/cmake/OptionsWPE.cmake:

Source/WebCore:

* PlatformGTK.cmake:
* SourcesGTK.txt:
* platform/graphics/GLContext.cpp:
(WebCore::GLContext::createContextForWindow): Check current display is X11 before trying to create a GLX context.
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::createPlatformDisplay): Use USE(WPE_RENDERER) instead of USE(LIBWPE).
* platform/graphics/PlatformDisplay.h:
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::createWindowContext): Use USE(WPE_RENDERER) instead of PLATFORM(WPE).
(WebCore::GLContextEGL::createContext): Ditto.
(WebCore::GLContextEGL::createSharingContext): Ditto.
(WebCore::GLContextEGL::~GLContextEGL): Ditto.
* platform/graphics/egl/GLContextEGL.h:
* platform/graphics/egl/GLContextEGLLibWPE.cpp:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): Ditto.
* platform/graphics/libwpe/PlatformDisplayLibWPE.cpp:
(WebCore::PlatformDisplayLibWPE::PlatformDisplayLibWPE): In GTK port set the display as the shared one for compositing.
* platform/graphics/libwpe/PlatformDisplayLibWPE.h:

Source/WebKit:

The WPEBackend-fdo implementation is quite similar to our Wayland nested compositor, but more efficient (using
linux dmabuf, resource caching, etc.). This allows us to share even more code with WPE port too.

* PlatformGTK.cmake:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::forceRepaint): WPE doesn't support force repaint yet.
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const): Use USE(WPE_RENDERER) instead of PLATFORM(WPE).
(WebKit::WebPageCreationParameters::decode): Ditto.
* Shared/WebPageCreationParameters.h:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const): Ditto.
(WebKit::WebProcessCreationParameters::decode): Ditto.
* Shared/WebProcessCreationParameters.h:
* SourcesGTK.txt:
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::hostFileDescriptor): Implement it when using WPE just calling webkitWebViewBaseRenderHostFileDescriptor().
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseCreateWebPage): Initialize the web page after the accelerated backing store is created, since
it's used now during intialization.
(webkitWebViewBaseRenderHostFileDescriptor): Return AcceleratedBackingStore::renderHostFileDescriptor()
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters): Use USE(WPE_RENDERER) instead of PLATFORM(WPE).
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess): Remove wayland display name initialization.
* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess): Initialize wayland display name when not using WPE here
now. In case of using WPE, initialize hostClientFileDescriptor and implementationLibraryName.
* UIProcess/glib/WebProcessProxyGLib.cpp:
(WebKit::WebProcessProxy::platformGetLaunchOptions): Remove unused wayland socket command line process parameter.
* UIProcess/gtk/AcceleratedBackingStore.h:
(WebKit::AcceleratedBackingStore::renderHostFileDescriptor): Return -1 by default.
* UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
(WebKit::AcceleratedBackingStoreWayland::create): When using WPE call wpe_fdo_initialize_for_egl_display() and
check we have the required extensions.
(WebKit::AcceleratedBackingStoreWayland::AcceleratedBackingStoreWayland): When using WPE initialize the view backend.
(WebKit::AcceleratedBackingStoreWayland::~AcceleratedBackingStoreWayland): When using WPE release the EGL images
still in use and the view texture.
(WebKit::AcceleratedBackingStoreWayland::renderHostFileDescriptor): Call wpe_view_backend_get_renderer_host_fd().
(WebKit::AcceleratedBackingStoreWayland::displayBuffer): Create the view texture if needed, save the pending
image and schedule a redraw.
(WebKit::AcceleratedBackingStoreWayland::paint): When using WPE commit the pending image and use it as target of
the view texture.
* UIProcess/gtk/AcceleratedBackingStoreWayland.h:
* UIProcess/gtk/HardwareAccelerationManager.cpp:
(WebKit::HardwareAccelerationManager::HardwareAccelerationManager): When using WPE disable hardware acceleration
if wpe_fdo_initialize_for_egl_display() fails.
* UIProcess/gtk/WaylandCompositor.cpp:
* UIProcess/gtk/WaylandCompositor.h:
* WebProcess/WebPage/AcceleratedSurface.cpp:
(WebKit::AcceleratedSurface::create): Create an AcceleratedSurfaceLibWPE for GTK port when using WPE and shared
display is Wayland.
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.cpp:
(WebKit::AcceleratedSurfaceLibWPE::initialize): Use the shared display for compositing instead of shared display.
* WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.h:
* WebProcess/WebProcess.h:
* WebProcess/glib/WebProcessGLib.cpp:
(WebKit::WebProcess::platformInitializeWebProcess): Initialize the wpe display when using WPE.

Tools:

Add WPEBackend-fdo to jhbuild moduleset.

* gtk/jhbuild.modules:

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

12 months ago[iOS] Dropping in an editable element should result in a ranged selection
wenson_hsieh@apple.com [Tue, 28 May 2019 01:03:10 +0000 (01:03 +0000)]
[iOS] Dropping in an editable element should result in a ranged selection
https://bugs.webkit.org/show_bug.cgi?id=198267
<rdar://problem/51145977>

Reviewed by Tim Horton.

Source/WebKit:

When drag and drop was first implemented for iOS in iOS 11, selection behavior when dropping into editable
elements matched that of macOS, by leaving the inserted content selected after performing the drop. However, in
other parts of the platform (e.g. Notes), both the keyboard and selection views are not shown after a drop.

Instead of matching macOS behavior, WebKit on iOS should match the rest of the platform. This is a little
tricky, since we use the selection range after a drop to create a TextIndicator snapshot when creating a drag
preview. To resolve this, we refactor some of the logic introduced in r245778 to remember the DOM range to
snapshot before collapsing the range to the end of the inserted content.

Tested by adjusting some existing API tests.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):

Remove some logic that currently presents the keyboard while the user is performing a drop that focuses an
editable element.

* WebProcess/WebPage/WebPage.h:

Add a member variable to keep track of which range should be snapshotted when generating a drop preview.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::didConcludeDrop):
(WebKit::WebPage::didConcludeEditDrag):

Collapse the selection range to the end after an edit drag (i.e., a drop in an editable area that inserted
content).

(WebKit::WebPage::computeAndSendEditDragSnapshot):

Tools:

Adjust some existing API tests that currently check for selection rects after a drop. Instead of checking for
visible selection rects, simply check for the start caret rect, as determined by WKContentView's
-selectionRange.

* TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
(TestWebKitAPI::TEST):
(makeCGRectValue): Deleted.
(checkSelectionRectsWithLogging): Deleted.
* TestWebKitAPI/cocoa/DragAndDropSimulator.h:

Replace finalSelectionRects with finalSelectionStartRect.

* TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm:
(-[DragAndDropSimulator _resetSimulatedState]):
(-[DragAndDropSimulator runFrom:to:additionalItemRequestLocations:]):
(-[DragAndDropSimulator finalSelectionRects]): Deleted.

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

12 months ago[CURL] Fix crashing SocketStreamHandle.
commit-queue@webkit.org [Tue, 28 May 2019 00:10:41 +0000 (00:10 +0000)]
[CURL] Fix crashing SocketStreamHandle.
https://bugs.webkit.org/show_bug.cgi?id=197873

Patch by Takashi Komori <Takashi.Komori@sony.com> on 2019-05-27
Reviewed by Fujii Hironori.

Source/WebCore:

When NetworkSocketStream was destructed SocketStreamHandleImple::platformClose was called wrongly times.
This is because closed state is not set.

Test: http/tests/websocket/tests/hybi/workers/close.html

* platform/network/curl/SocketStreamHandleImpl.h:
* platform/network/curl/SocketStreamHandleImplCurl.cpp:
(WebCore::SocketStreamHandleImpl::platformSendInternal):
(WebCore::SocketStreamHandleImpl::platformClose):
(WebCore::SocketStreamHandleImpl::threadEntryPoint):
(WebCore::SocketStreamHandleImpl::handleError):
(WebCore::SocketStreamHandleImpl::callOnWorkerThread):
(WebCore::SocketStreamHandleImpl::executeTasks):

LayoutTests:

* platform/wincairo-wk1/TestExpectations:
* platform/wincairo/TestExpectations:

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

12 months agoUnreviewed Win Cairo build fix after r245796.
cdumez@apple.com [Mon, 27 May 2019 22:00:26 +0000 (22:00 +0000)]
Unreviewed Win Cairo build fix after r245796.

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::getAllStorageAccessEntries):

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

12 months agoFix opensource build of testapi
tzagallo@apple.com [Mon, 27 May 2019 21:51:40 +0000 (21:51 +0000)]
Fix opensource build of testapi
https://bugs.webkit.org/show_bug.cgi?id=198256

Reviewed by Alexey Proskuryakov.

In r245564, we added custom entitlements to testapi to allow caching
bytecode in data vaults, but we should only use the entitlements for
internal builds. Otherwises, testapi gets killed on launch. Also fix the
formatting for the errors added in the same patch, according to comments
in the bug after the patch had already landed.

* API/JSScript.mm:
(validateBytecodeCachePath):
* Configurations/ToolExecutable.xcconfig:

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

12 months agoUnreviewed Win Cairo build fix after r245796.
cdumez@apple.com [Mon, 27 May 2019 21:50:08 +0000 (21:50 +0000)]
Unreviewed Win Cairo build fix after r245796.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::decode):

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

12 months ago[css-grid] Preserve repeat() notation when serializing declared values
obrufau@igalia.com [Mon, 27 May 2019 21:27:15 +0000 (21:27 +0000)]
[css-grid] Preserve repeat() notation when serializing declared values
https://bugs.webkit.org/show_bug.cgi?id=197840

Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

Import WPT test.

* web-platform-tests/css/css-grid/grid-definition/grid-support-repeat-002-expected.txt: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-support-repeat-002.html: Added.
* web-platform-tests/css/css-grid/grid-definition/w3c-import.log:

Source/WebCore:

Tests: fast/css-grid-layout/grid-element-auto-repeat-get-set.html
       fast/css-grid-layout/grid-repeat-calc.html
       fast/css-grid-layout/named-grid-line-get-set.html
       imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-repeat-002.html

Before this change, a repeat() notation with an integral number of
repetitions was expanded at parse time. This was observable when reading
declared values using JS APIs.

This patch makes the parser preserve that notation, like it was already
happening when the number of repetitions was automatic and not integral.

The resolved value in getComputedStyle() will still be expanded, though,
as required by the spec.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSGridIntegerRepeatValue.cpp: Added.
(WebCore::CSSGridIntegerRepeatValue::customCSSText const):
(WebCore::CSSGridIntegerRepeatValue::equals const):
* css/CSSGridIntegerRepeatValue.h: Added.
* css/CSSValue.cpp:
(WebCore::CSSValue::equals const):
(WebCore::CSSValue::cssText const):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isGridIntegerRepeatValue const):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::createGridTrackList):
(WebCore::StyleBuilderConverter::convertGridTrackSizeList):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeGridTrackRepeatFunction):

Tools:

Adapt CSSPropertyParserTest to CSSGridIntegerRepeatValue.

* TestWebKitAPI/Tests/WebCore/CSSParser.cpp:
(TestWebKitAPI::computeNumberOfTracks):

LayoutTests:

Update test expectations.

* fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt:
* fast/css-grid-layout/grid-element-auto-repeat-get-set.html:
* fast/css-grid-layout/grid-repeat-calc-expected.txt:
* fast/css-grid-layout/grid-repeat-calc.html:
* fast/css-grid-layout/named-grid-line-get-set-expected.txt:
* fast/css-grid-layout/named-grid-line-get-set.html:

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

12 months agoUse a strongly-typed identifier for pages
cdumez@apple.com [Mon, 27 May 2019 20:30:51 +0000 (20:30 +0000)]
Use a strongly-typed identifier for pages
https://bugs.webkit.org/show_bug.cgi?id=198206

Reviewed by Youenn Fablet.

Source/WebCore:

* WebCore/*:

Source/WebKit:

* WebKit/*:

Source/WebKitLegacy:

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

Source/WebKitLegacy/mac:

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::pageID const):

Source/WTF:

* wtf/ObjectIdentifier.h:
(WTF::operator<<):

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

12 months ago[Pointer Events] Test at pointerevents/ios/touch-action-none-in-overflow-scrolling...
commit-queue@webkit.org [Mon, 27 May 2019 16:19:06 +0000 (16:19 +0000)]
[Pointer Events] Test at pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html times out
https://bugs.webkit.org/show_bug.cgi?id=198275
<rdar://problem/50618496>

Patch by Antoine Quint <graouts@apple.com> on 2019-05-27
Reviewed by Antti Koivisto.

Only WKCompositingView instances may have associated touch-action data, so we should filter out any hit-testing view
that isn't a WKCompositingView when finding the view that should hit-test when looking for touch-action information.

* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(WebKit::touchActionsForPoint):

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

12 months agoMove GraphicsLayerCA::adjustTiledLayerVisibleRect() to TileController
simon.fraser@apple.com [Mon, 27 May 2019 16:06:06 +0000 (16:06 +0000)]
Move GraphicsLayerCA::adjustTiledLayerVisibleRect() to TileController
https://bugs.webkit.org/show_bug.cgi?id=198266

Reviewed by Zalan Bujtas.

GraphicsLayerCA::adjustTiledLayerVisibleRect() was computing tile coverage for a
TiledBacking, just like TileController::adjustTileCoverageRect(), so move the code
into TileController as a first step to unifying more of this code. It's currently
used for tiled compositing layers, including overflow:scroll, and tiled layers
whose coverage may be affected by animations, so it's general-purpose.

TileController::adjustTileCoverageRect() is used for scrollable things, so rename
it to adjustTileCoverageRectForScrolling().

No behavior change.

* platform/graphics/TiledBacking.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::adjustCoverageRect const):
(WebCore::GraphicsLayerCA::adjustTiledLayerVisibleRect): Deleted.
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::adjustTileCoverageRect const):
(WebCore::TileController::adjustTileCoverageRectForScrolling const):
* platform/graphics/ca/TileController.h:

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

12 months agoFix Apple Internal builds after r245788.
simon.fraser@apple.com [Mon, 27 May 2019 16:00:42 +0000 (16:00 +0000)]
Fix Apple Internal builds after r245788.

* platform/PlatformScreen.h:
(WebCore::screenHasTouchDevice):
(WebCore::screenIsTouchPrimaryInputDevice):

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

12 months ago[LFC][IFC] Ignore collapsed runs when setting the width on the associated display...
zalan@apple.com [Mon, 27 May 2019 14:15:18 +0000 (14:15 +0000)]
[LFC][IFC] Ignore collapsed runs when setting the width on the associated display boxes.
https://bugs.webkit.org/show_bug.cgi?id=198260
<rdar://problem/51145704>

Reviewed by Antti Koivisto.

Collapsed runs don't contribute to the logical width of their containers.

Covered by existing tests.

* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::LineLayout::closeLine const):

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

12 months agoUnreviewed. Update OptionsGTK.cmake and NEWS for 2.25.1 release
carlosgc@webkit.org [Mon, 27 May 2019 09:54:16 +0000 (09:54 +0000)]
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.25.1 release

.:

* Source/cmake/OptionsGTK.cmake: Bump version numbers

Source/WebKit:

* gtk/NEWS: Add release notes for 2.25.1.

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

12 months agoUnreviewed. Fix GTK distcheck
carlosgc@webkit.org [Mon, 27 May 2019 09:52:19 +0000 (09:52 +0000)]
Unreviewed. Fix GTK distcheck

Source/WebCore:

Move mac headers to platform specific makefile.

* Headers.cmake:
* PlatformMac.cmake:

Source/WebKit:

Remove symbols that are not longer present in the library.

* webkitglib-symbols.map:

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

12 months agoTouch support is reported even when the device doesn't have a touch screen
carlosgc@webkit.org [Mon, 27 May 2019 08:34:35 +0000 (08:34 +0000)]
Touch support is reported even when the device doesn't have a touch screen
https://bugs.webkit.org/show_bug.cgi?id=139681

Reviewed by Michael Catanzaro.

Source/WebCore:

Add screenHasTouchDevice() and screenIsTouchPrimaryInputDevice() to PlatformScreen and use it to decide whether
to expose touch events functionality or not.

* bindings/js/WebCoreBuiltinNames.h:
* css/MediaQueryEvaluator.cpp:
(WebCore::hoverEvaluate): Use screenIsTouchPrimaryInputDevice() when touch events are enabled at build time.
(WebCore::anyHoverEvaluate): Use screenHasTouchDevice() when touch events are enabled at build time.
(WebCore::pointerEvaluate): Use screenIsTouchPrimaryInputDevice() when touch events are enabled at build time.
(WebCore::anyPointerEvaluate): Use screenHasTouchDevice() when touch events are enabled at build time.
* dom/GlobalEventHandlers.idl: Make touch event attributes enabled at runtime.
* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::touchEventsEnabled const): Return whether touch events are enabled.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setTouchEventsEnabled): Force touch events to be enabled or disabled.
* platform/PlatformScreen.h:
(WebCore::screenHasTouchDevice): Just return true when touch events are enabled at build time for non-gtk ports.
(WebCore::screenIsTouchPrimaryInputDevice): Ditto.
* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::screenHasTouchDevice):
(WebCore::screenIsTouchPrimaryInputDevice):
(WebCore::isTouchDevice):
(WebCore::deviceAddedCallback):
(WebCore::deviceRemovedCallback):

LayoutTests:

Remove expectations for tests that are passing now.

* platform/gtk/TestExpectations:

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

12 months agoMove VelocityData to WebCore
simon.fraser@apple.com [Mon, 27 May 2019 01:12:00 +0000 (01:12 +0000)]
Move VelocityData to WebCore
https://bugs.webkit.org/show_bug.cgi?id=198261

Reviewed by Antti Koivisto.

Move VelocityData and HistoricalVelocityData to WebCore for future use in overflow scroll.
Source/WebCore:

VisibleContentRectUpdateInfo can now store a VelocityData (its timestamp is used as
the timetamp for the entire update).

No behavior change.

* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/FrameView.cpp:
(WebCore::FrameView::setScrollVelocity):
* page/FrameView.h:
* platform/graphics/TiledBacking.h:
(WebCore::VelocityData::VelocityData): Deleted.
(WebCore::VelocityData::velocityOrScaleIsChanging const): Deleted.
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::adjustTileCoverageRect const):
* platform/graphics/ca/TileController.h:

Source/WebKit:

VisibleContentRectUpdateInfo can now store a VelocityData (its timestamp is used as
the timetamp for the entire update).

* Shared/VisibleContentRectUpdateInfo.cpp:
(WebKit::VisibleContentRectUpdateInfo::encode const):
(WebKit::VisibleContentRectUpdateInfo::decode):
(WebKit::operator<<):
* Shared/VisibleContentRectUpdateInfo.h:
(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::scrollVelocity const):
(WebKit::VisibleContentRectUpdateInfo::enclosedInScrollableAncestorView const):
(WebKit::VisibleContentRectUpdateInfo::timestamp const):
(WebKit::operator==):
(WebKit::VisibleContentRectUpdateInfo::horizontalVelocity const): Deleted.
(WebKit::VisibleContentRectUpdateInfo::verticalVelocity const): Deleted.
(WebKit::VisibleContentRectUpdateInfo::scaleChangeRate const): Deleted.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<VelocityData>::encode):
(IPC::ArgumentCoder<VelocityData>::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
(WebKit::HistoricalVelocityData::VelocityData::VelocityData): Deleted.
(WebKit::HistoricalVelocityData::HistoricalVelocityData): Deleted.
(WebKit::HistoricalVelocityData::velocityForNewData): Deleted.
(WebKit::HistoricalVelocityData::clear): Deleted.
(WebKit::HistoricalVelocityData::append): Deleted.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::viewportConfigurationChanged):
(WebKit::adjustVelocityDataForBoundedScale):
(WebKit::WebPage::updateVisibleContentRects):

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

12 months agoAdd a GraphicsLayer::Type for ScrolledContents
simon.fraser@apple.com [Mon, 27 May 2019 00:10:44 +0000 (00:10 +0000)]
Add a GraphicsLayer::Type for ScrolledContents
https://bugs.webkit.org/show_bug.cgi?id=198257

Reviewed by Zalan Bujtas.

This ScrolledContents layer type will be used to choose different tiling behaviors
in a future patch.

* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::supportsLayerType):
* platform/graphics/GraphicsLayer.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayer::supportsLayerType):
(WebCore::GraphicsLayerCA::initialize):
(WebCore::GraphicsLayerCA::adjustCoverageRect const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateScrollingLayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::ensureRootLayer):

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

12 months agoResource Load Statistics: Downgrade document.referrer to the referrer's eTLD+1 if...
wilander@apple.com [Sun, 26 May 2019 22:39:09 +0000 (22:39 +0000)]
Resource Load Statistics: Downgrade document.referrer to the referrer's eTLD+1 if the page was navigated to with a prevalent resource referrer containing link decoration
https://bugs.webkit.org/show_bug.cgi?id=198227
<rdar://problem/51117258>

Reviewed by Alex Christensen.

Source/WebCore:

Test: http/tests/resourceLoadStatistics/downgraded-referrer-for-navigation-with-link-query-from-prevalent-resource.html

* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::referrer const):
    Now checks if the referrer has been overridden.
(WebCore::Document::wasLoadedWithDataTransferFromPrevalentResource):
(WebCore::Document::downgradeReferrerToRegistrableDomain):
* dom/Document.h:
* page/CrossSiteNavigationDataTransfer.h: Added.
    New option set for the growing number of navigational data transfers we care about.
* platform/network/NetworkStorageSession.cpp:
(WebCore::NetworkStorageSession::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
(WebCore::NetworkStorageSession::committedCrossSiteLoadWithLinkDecoration): Deleted.
    New name since we no longer only look for link decoration but also other means of navigational data transfer.
* platform/network/NetworkStorageSession.h:

Source/WebKit:

This patch adds a call back to the UI process if the network process finds the navigational
data transfer was done by a prevalent resource and we need to adjust something for the page.
Currently, that adjustment is to downgrade document.referrer.

The patch also removes an unused completion handler.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::didCommitCrossSiteLoadWithDataTransfer):
(WebKit::NetworkProcess::committedCrossSiteLoadWithLinkDecoration): Deleted.
    New name since we no longer only look for link decoration but also other means of navigational data transfer.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didCommitCrossSiteLoadWithDataTransfer):
(WebKit::NetworkProcessProxy::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
(WebKit::NetworkProcessProxy::committedCrossSiteLoadWithLinkDecoration): Deleted.
    New name since we no longer only look for link decoration but also other means of navigational data transfer.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::checkIfNavigationContainsDataTransfer):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
(WebKit::isNonUniqueNavigationWithLinkDecoration): Deleted.
    New name since we no longer only look for link decoration but also other means of navigational data transfer.
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::didCommitCrossSiteLoadWithDataTransfer):
(WebKit::WebProcessPool::committedCrossSiteLoadWithLinkDecoration): Deleted.
    New name since we no longer only look for link decoration but also other means of navigational data transfer.
* UIProcess/WebProcessPool.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::wasLoadedWithDataTransferFromPrevalentResource):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

LayoutTests:

* http/tests/resourceLoadStatistics/downgraded-referrer-for-navigation-with-link-query-from-prevalent-resource-expected.txt: Added.
* http/tests/resourceLoadStatistics/downgraded-referrer-for-navigation-with-link-query-from-prevalent-resource.html: Added.

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

12 months ago[LFC][Verification] Add areEssentiallyEqual for LayoutRect
zalan@apple.com [Sun, 26 May 2019 14:04:13 +0000 (14:04 +0000)]
[LFC][Verification] Add areEssentiallyEqual for LayoutRect
https://bugs.webkit.org/show_bug.cgi?id=198250
<rdar://problem/51140119>

Reviewed by Antti Koivisto.

WebKit's inline layout is a mix of int/float/LayoutUnit types, while LFC mostly uses LayoutUnit.
When we compute the used size of a block container (based on the inline tree), the final value might go through a few conversions.

* layout/Verification.cpp:
(WebCore::Layout::areEssentiallyEqual):
(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):

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

12 months ago[iOS] Dropped text, attachments, and images should animate into place
wenson_hsieh@apple.com [Sun, 26 May 2019 11:31:49 +0000 (11:31 +0000)]
[iOS] Dropped text, attachments, and images should animate into place
https://bugs.webkit.org/show_bug.cgi?id=198243
<rdar://problem/35205373>

Reviewed by Tim Horton.

Source/WebCore:

Add some hooks to notify the chrome client when an HTMLImageElement's image is finished loading. See WebKit
changelog for more detail.

Test: DragAndDropTests.DropPreviewForImageInEditableArea

* loader/EmptyClients.h:
* page/ChromeClient.h:
* page/Page.cpp:
(WebCore::Page::didFinishLoadingImageForElement):
* page/Page.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::notifyFinished):

Source/WebKit:

Adds support for targeted drop animations on iOS in modern WebKit by adopting UIKit SPI introduced in
<rdar://problem/31075005> to allow updating the drop preview mid-flight. To get the animation right, we refactor
and augment existing logic for taking snapshots after performing a drop in an editable content.

Currently, upon dropping in editable content, we first snapshot the web view and temporarily cover the real web
view with this snapshot. When the TextIndicator data arrives that contains (1) a snapshot of the visible part of
the web view ignoring the selection, and (2) a snapshot of just the selected contents after drop, we crossfade
from the web view snapshot to the snapshot in (1) using a hard-coded time delay (~500ms), and target the drop
preview to the drag caret rect. During this process, snapshot (2) is completely ignored.

This was effectively a halfway implemention of the desired effect of animating the dropped content into place
and crossfading to the final content; before UIKit implemented updateable drag previews, the full implementation
was not possible in modern WebKit (without using synchronous IPC).

Now that we're able to update the drag preview in the middle of the drop animation, we can now utilize snapshot
(2) above and clean up some parts of the drop animation in editable content. See below for more details.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _doAfterReceivingEditDragSnapshotForTesting:]):

Add a testing hook to perform the given block after any pending edit drag snapshot has been received. See
TestWebKitAPI changes for more detail.

* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:

Split up the existing DidConcludeEditDrag IPC message into two messages: WillReceiveEditDragSnapshot and
DidReceiveEditDragSnapshot. This allows us to defer cleaning up the drag session state during an edit drop,
until after the final edit drag snapshot has been received.

* UIProcess/ios/DragDropInteractionState.h:

Add some new methods to help manage the lifecycle of drop preview provider blocks.

* UIProcess/ios/DragDropInteractionState.mm:
(WebKit::createTargetedDragPreview):

Drive-by fix: make this return a RetainPtr.

(WebKit::DragDropInteractionState::prepareForDelayedDropPreview):

Stores a drop preview provider, given to us by UIKit.

(WebKit::DragDropInteractionState::deliverDelayedDropPreview):

Invokes the stored drop preview providers with given text indicator data. This is invoked after snapshots are
taken following an edit drag (this is additionally after all images in the inserted fragment have finished
loading).

(WebKit::DragDropInteractionState::clearAllDelayedItemPreviewProviders):

Invokes all stored drop preview providers with a nil preview. This is invoked in any case where drag session
cleanup occurs earlier than normal (e.g., if the web process crashes during drop), and ensures that the handlers
are always invoked when cleaning up the drag session.

(WebKit::DragDropInteractionState::previewForDragItem const):
(WebKit::DragDropInteractionState::dragAndDropSessionsDidEnd):

Call clearAllDelayedItemPreviewProviders.

* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::willReceiveEditDragSnapshot):
(WebKit::PageClientImpl::didReceiveEditDragSnapshot):
(WebKit::PageClientImpl::didConcludeEditDrag): Deleted.

More plumbing (see changes to DidConcludeEditDrag above).

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
(-[WKContentView cleanUpDragSourceSessionState]):
(-[WKContentView _willReceiveEditDragSnapshot]):
(-[WKContentView _didReceiveEditDragSnapshot:]):

Set _waitingForEditDragSnapshot to YES in the gap between when -_willReceiveEditDragSnapshot is invoked, and
when -_didReceiveEditDragSnapshot is invoked. If _waitingForEditDragSnapshot is YES, we bail out of
-cleanUpDragSourceSessionState, and instead clean up drag session state after the edit drag snapshot is
received.

(-[WKContentView _deliverDelayedDropPreviewIfPossible:]):
(-[WKContentView _didPerformDragOperation:]):
(-[WKContentView textEffectsWindow]):

Drive-by fix to remove a workaround for a deprecation warning.

(-[WKContentView dropInteraction:item:willAnimateDropWithAnimator:]):
(-[WKContentView dropInteraction:concludeDrop:]):

Implement this hook to ensure that the unselected content snapshot view and visible content snapshot view are
guaranteed to be removed from the view after a drop in editable content, even if the drag edit snapshot arrives
after the drop is concluded.

(-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]):
(-[WKContentView _dropInteraction:delayedPreviewProviderForDroppingItem:previewProvider:]):

Implement the new UIKit SPI here. UIKit hands us a preview provider here, which we can invoke at a later time
to update the drop preview. We do this in _didReceiveEditDragSnapshot.

(-[WKContentView _doAfterReceivingEditDragSnapshotForTesting:]):
(-[WKContentView _didConcludeEditDrag:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::willReceiveEditDragSnapshot):
(WebKit::WebPageProxy::didReceiveEditDragSnapshot):
(WebKit::WebPageProxy::didConcludeDrop):
(WebKit::WebPageProxy::didConcludeEditDrag): Deleted.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::didFinishLoadingImageForElement):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didFinishLoadingImageForElement):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::didConcludeDrop):

If an edit drag has been concluded, there's no need to hang on to pending dropped image elements anymore; clear
out the set here.

(WebKit::WebPage::didConcludeEditDrag):

After concluding an edit drag, we try to deliver two web content snapshots to the UI process, so that the UI
process can assemble a targeted drop preview for UIKit. One snapshot is of the visible content area, not
including any selected content. The other snapshot is of the selected content only. However, when dropping
images (or a text selection containing images), these images may not yet have been loaded. If that is the case,
these images will appear to be missing from these snapshots.

To ensure that we don't take this snapshot too early, defer it until all image elements in the dropped content
range have finished loading. We can tell that all dropped images have finished loading by using a new client
hook that is invoked when an image has finished loading.

(WebKit::WebPage::didFinishLoadingImageForElement):
(WebKit::WebPage::computeAndSendEditDragSnapshot):

Snapshot the selected content and send it to the UI process.

Source/WebKitLegacy/mac:

Add a new chrome client method. See other changelogs for more detail.

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::didFinishLoadingImageForElement):

Source/WebKitLegacy/win:

* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::didFinishLoadingImageForElement):
* WebCoreSupport/WebChromeClient.h:

Tools:

Adjusts the iOS dragging simulator, and adds a new API test. See below for more detail.

* TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
(TestWebKitAPI::isCompletelyWhite):
(TestWebKitAPI::TEST):

Add a test that drags and drops an image into a contenteditable element, and then observes the resulting
UITargetedDragPreviews upon drop.

* TestWebKitAPI/cocoa/DragAndDropSimulator.h:
* TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm:
(-[DragAndDropSimulator _resetSimulatedState]):
(-[DragAndDropSimulator runFrom:to:additionalItemRequestLocations:]):
(-[DragAndDropSimulator _concludeDropAndPerformOperationIfNecessary]):

Teach the iOS version of DragAndDropSimulator to invoke -dropInteraction:concludeDrop: on the drop interaction
delegate when the drop finishes. This additionally uses _doAfterReceivingEditDragSnapshotForTesting: to defer
the end of the simulated drag and drop until after drag previews have been received during an edit drag.

(-[DragAndDropSimulator dropPreviews]):
(-[DragAndDropSimulator delayedDropPreviews]):

Have the drag and drop simulator remember which previews were returned by the delegate on drop, as well as which
previews were provided asynchronously.

(-[DragAndDropSimulator _webView:dataInteractionOperationWasHandled:forSession:itemProviders:]):
* TestWebKitAPI/ios/UIKitSPI.h:

Stage the new private drop interacton delegate method.

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

12 months agoMobileMiniBrowser: Add iPad support, and allow insecure loads
simon.fraser@apple.com [Sat, 25 May 2019 23:14:57 +0000 (23:14 +0000)]
MobileMiniBrowser: Add iPad support, and allow insecure loads
https://bugs.webkit.org/show_bug.cgi?id=198249

Reviewed by Tim Horton.

Add iPad support to MobileMiniBrowser, and allow insecure loads.

* MobileMiniBrowser/MobileMiniBrowser.xcodeproj/project.pbxproj:
* MobileMiniBrowser/MobileMiniBrowser/Info.plist:

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

12 months ago[LFC][IFC] Introduce DisplayRun to display tree
zalan@apple.com [Sat, 25 May 2019 20:14:09 +0000 (20:14 +0000)]
[LFC][IFC] Introduce DisplayRun to display tree
https://bugs.webkit.org/show_bug.cgi?id=197198

Reviewed by Antti Koivisto.

Add a simple inline layout implementation. Now we've got DisplayBoxes for layout boxes and
DisplayRuns for inline runs.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::contentHeightForFormattingContextRoot):
* layout/Verification.cpp:
(WebCore::Layout::areEssentiallyEqual):
(WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
(WebCore::Layout::checkForMatchingNonTextRuns):
(WebCore::Layout::checkForMatchingTextRuns):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
(WebCore::Layout::resolveForRelativePositionIfNeeded): Deleted.
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::marginBox const):
(WebCore::Display::Box::nonCollapsedMarginBox const):
(WebCore::Display::Box::borderBox const):
(WebCore::Display::Box::paddingBox const):
(WebCore::Display::Box::contentBox const):
(WebCore::Display::Box::Rect::Rect): Deleted.
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::rectWithMargin const):
(WebCore::Display::Box::horizontalMargin const):
(WebCore::Display::Box::Rect::intersects const): Deleted.
(WebCore::Display::Box::Rect::invalidateTop): Deleted.
(WebCore::Display::Box::Rect::invalidateLeft): Deleted.
(WebCore::Display::Box::Rect::invalidateWidth): Deleted.
(WebCore::Display::Box::Rect::invalidateHeight): Deleted.
(WebCore::Display::Box::Rect::hasValidPosition const): Deleted.
(WebCore::Display::Box::Rect::hasValidSize const): Deleted.
(WebCore::Display::Box::Rect::hasValidGeometry const): Deleted.
(WebCore::Display::Box::Rect::invalidatePosition): Deleted.
(WebCore::Display::Box::Rect::setHasValidPosition): Deleted.
(WebCore::Display::Box::Rect::setHasValidSize): Deleted.
(WebCore::Display::Box::Rect::top const): Deleted.
(WebCore::Display::Box::Rect::left const): Deleted.
(WebCore::Display::Box::Rect::bottom const): Deleted.
(WebCore::Display::Box::Rect::right const): Deleted.
(WebCore::Display::Box::Rect::topLeft const): Deleted.
(WebCore::Display::Box::Rect::bottomRight const): Deleted.
(WebCore::Display::Box::Rect::size const): Deleted.
(WebCore::Display::Box::Rect::width const): Deleted.
(WebCore::Display::Box::Rect::height const): Deleted.
(WebCore::Display::Box::Rect::setTopLeft): Deleted.
(WebCore::Display::Box::Rect::setTop): Deleted.
(WebCore::Display::Box::Rect::setLeft): Deleted.
(WebCore::Display::Box::Rect::setWidth): Deleted.
(WebCore::Display::Box::Rect::setHeight): Deleted.
(WebCore::Display::Box::Rect::setSize): Deleted.
(WebCore::Display::Box::Rect::shiftLeftTo): Deleted.
(WebCore::Display::Box::Rect::shiftRightTo): Deleted.
(WebCore::Display::Box::Rect::shiftTopTo): Deleted.
(WebCore::Display::Box::Rect::shiftBottomTo): Deleted.
(WebCore::Display::Box::Rect::moveHorizontally): Deleted.
(WebCore::Display::Box::Rect::moveVertically): Deleted.
(WebCore::Display::Box::Rect::expand): Deleted.
(WebCore::Display::Box::Rect::clone const): Deleted.
(WebCore::Display::Box::Rect::operator LayoutRect const): Deleted.
* layout/displaytree/DisplayRect.h: Added.
(WebCore::Display::Rect::expandHorizontally):
(WebCore::Display::Rect::expandVertically):
(WebCore::Display::Rect::intersects const):
(WebCore::Display::Rect::invalidateTop):
(WebCore::Display::Rect::invalidateLeft):
(WebCore::Display::Rect::invalidateWidth):
(WebCore::Display::Rect::invalidateHeight):
(WebCore::Display::Rect::hasValidPosition const):
(WebCore::Display::Rect::hasValidSize const):
(WebCore::Display::Rect::hasValidGeometry const):
(WebCore::Display::Rect::Rect):
(WebCore::Display::Rect::invalidatePosition):
(WebCore::Display::Rect::setHasValidPosition):
(WebCore::Display::Rect::setHasValidSize):
(WebCore::Display::Rect::top const):
(WebCore::Display::Rect::left const):
(WebCore::Display::Rect::bottom const):
(WebCore::Display::Rect::right const):
(WebCore::Display::Rect::topLeft const):
(WebCore::Display::Rect::bottomRight const):
(WebCore::Display::Rect::size const):
(WebCore::Display::Rect::width const):
(WebCore::Display::Rect::height const):
(WebCore::Display::Rect::setTopLeft):
(WebCore::Display::Rect::setTop):
(WebCore::Display::Rect::setLeft):
(WebCore::Display::Rect::setWidth):
(WebCore::Display::Rect::setHeight):
(WebCore::Display::Rect::setSize):
(WebCore::Display::Rect::shiftLeftTo):
(WebCore::Display::Rect::shiftRightTo):
(WebCore::Display::Rect::shiftTopTo):
(WebCore::Display::Rect::shiftBottomTo):
(WebCore::Display::Rect::moveHorizontally):
(WebCore::Display::Rect::moveVertically):
(WebCore::Display::Rect::expand):
(WebCore::Display::Rect::clone const):
(WebCore::Display::Rect::operator LayoutRect const):
* layout/displaytree/DisplayRun.h: Renamed from Source/WebCore/layout/inlineformatting/InlineRun.h.
(WebCore::Display::Run::TextContext::start const):
(WebCore::Display::Run::TextContext::end const):
(WebCore::Display::Run::TextContext::length const):
(WebCore::Display::Run::TextContext::expand):
(WebCore::Display::Run::logicalTopLeft const):
(WebCore::Display::Run::logicalLeft const):
(WebCore::Display::Run::logicalRight const):
(WebCore::Display::Run::logicalTop const):
(WebCore::Display::Run::logicalBottom const):
(WebCore::Display::Run::logicalWidth const):
(WebCore::Display::Run::logicalHeight const):
(WebCore::Display::Run::setLogicalWidth):
(WebCore::Display::Run::setLogicalTop):
(WebCore::Display::Run::setLogicalLeft):
(WebCore::Display::Run::setLogicalRight):
(WebCore::Display::Run::moveVertically):
(WebCore::Display::Run::moveHorizontally):
(WebCore::Display::Run::expandVertically):
(WebCore::Display::Run::expandHorizontally):
(WebCore::Display::Run::setTextContext):
(WebCore::Display::Run::textContext):
(WebCore::Display::Run::textContext const):
(WebCore::Display::Run::Run):
(WebCore::Display::Run::TextContext::TextContext):
* layout/floats/FloatAvoider.cpp:
(WebCore::Layout::FloatAvoider::rectInContainingBlock const):
* layout/floats/FloatAvoider.h:
(WebCore::Layout::FloatAvoider::rect const):
* layout/floats/FloatBox.cpp:
(WebCore::Layout::FloatBox::rect const):
* layout/floats/FloatBox.h:
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatPair::intersects const):
* layout/floats/FloatingState.h:
(WebCore::Layout::FloatingState::FloatItem::rectWithMargin const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
(WebCore::Layout::InlineFormattingContext::initializeMarginBorderAndPaddingForGenericInlineBox const):
(WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFloatBox const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForInlineBlock const):
(WebCore::Layout::InlineFormattingContext::computeHorizontalMargin const):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::collectInlineContent const):
(WebCore::Layout::InlineFormattingContext::computeMargin const): Deleted.
(WebCore::Layout::addDetachingRules): Deleted.
(WebCore::Layout::createAndAppendInlineItem): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::LineLayout::layoutState const):
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::halfLeadingMetrics):
(WebCore::Layout::Line::availableWidth const):
(WebCore::Layout::Line::contentLogicalRight const):
(WebCore::Layout::Line::contentLogicalWidth const):
(WebCore::Layout::Line::logicalTop const):
(WebCore::Layout::Line::logicalLeft const):
(WebCore::Layout::Line::logicalRight const):
(WebCore::Layout::Line::logicalBottom const):
(WebCore::Layout::Line::logicalWidth const):
(WebCore::Layout::Line::logicalHeight const):
(WebCore::Layout::Line::LineItem::LineItem):
(WebCore::Layout::Line::Line):
(WebCore::Layout::Line::reset):
(WebCore::Layout::Line::close):
(WebCore::Layout::Line::removeTrailingTrimmableContent):
(WebCore::Layout::Line::moveLogicalLeft):
(WebCore::Layout::Line::moveLogicalRight):
(WebCore::Layout::isTrimmableContent):
(WebCore::Layout::Line::trailingTrimmableWidth const):
(WebCore::Layout::Line::hasContent const):
(WebCore::Layout::Line::appendNonBreakableSpace):
(WebCore::Layout::Line::appendInlineContainerStart):
(WebCore::Layout::Line::appendInlineContainerEnd):
(WebCore::Layout::Line::appendTextContent):
(WebCore::Layout::Line::appendNonTextContent):
(WebCore::Layout::Line::appendHardLineBreak):
(WebCore::Layout::UncommittedContent::isEmpty const):
(WebCore::Layout::UncommittedContent::width const):
(WebCore::Layout::UncommittedContent::add):
(WebCore::Layout::UncommittedContent::reset):
(WebCore::Layout::InlineFormattingContext::LineLayout::LineLayout):
(WebCore::Layout::InlineFormattingContext::LineLayout::initializeLine const):
(WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
(WebCore::Layout::InlineFormattingContext::LineLayout::closeLine const):
(WebCore::Layout::InlineFormattingContext::LineLayout::handleFloat const):
(WebCore::Layout::InlineFormattingContext::LineLayout::commitInlineItemToLine const):
(WebCore::Layout::horizontalAdjustmentForAlignment):
(WebCore::Layout::InlineFormattingContext::LineLayout::alignRuns const):
(WebCore::Layout::Line::isClosed const): Deleted.
(WebCore::Layout::Line::isFirstLine const): Deleted.
(WebCore::Layout::Line::runs): Deleted.
(WebCore::Layout::Line::contentLogicalLeft const): Deleted.
(WebCore::Layout::Line::lastRunType const): Deleted.
(WebCore::Layout::Line::init): Deleted.
(WebCore::Layout::Line::adjustLogicalLeft): Deleted.
(WebCore::Layout::Line::adjustLogicalRight): Deleted.
(WebCore::Layout::Line::appendContent): Deleted.
(WebCore::Layout::InlineFormattingContext::LineLayout::initializeNewLine const): Deleted.
(WebCore::Layout::InlineFormattingContext::LineLayout::splitInlineRunIfNeeded const): Deleted.
(WebCore::Layout::InlineFormattingContext::LineLayout::createFinalRuns const): Deleted.
(WebCore::Layout::InlineFormattingContext::LineLayout::postProcessInlineRuns const): Deleted.
(WebCore::Layout::InlineFormattingContext::LineLayout::appendContentToLine const): Deleted.
(WebCore::Layout::InlineFormattingContext::LineLayout::computeFloatPosition const): Deleted.
(WebCore::Layout::InlineFormattingContext::LineLayout::placeInFlowPositionedChildren const): Deleted.
(WebCore::Layout::adjustedLineLogicalLeft): Deleted.
(WebCore::Layout::InlineFormattingContext::LineLayout::justifyRuns): Deleted.
(WebCore::Layout::InlineFormattingContext::LineLayout::computeExpansionOpportunities const): Deleted.
(WebCore::Layout::InlineFormattingContext::LineLayout::runWidth const): Deleted.
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::inlineItems):
(WebCore::Layout::InlineFormattingState::lineBoxes):
(WebCore::Layout::InlineFormattingState::addInlineItem):
(WebCore::Layout::InlineFormattingState::addInlineRun):
(WebCore::Layout::InlineFormattingState::addLineBox):
(WebCore::Layout::InlineFormattingState::inlineContent): Deleted.
(WebCore::Layout::InlineFormattingState::lastInlineItem const): Deleted.
(WebCore::Layout::InlineFormattingState::appendInlineRun): Deleted.
* layout/inlineformatting/InlineItem.h:
(WebCore::Layout::InlineItem::type const):
(WebCore::Layout::InlineItem::isText const):
(WebCore::Layout::InlineItem::isBox const):
(WebCore::Layout::InlineItem::isHardLineBreak const):
(WebCore::Layout::InlineItem::isFloat const):
(WebCore::Layout::InlineItem::isLineBreak const):
(WebCore::Layout::InlineItem::isContainerStart const):
(WebCore::Layout::InlineItem::isContainerEnd const):
(WebCore::Layout::InlineItem::InlineItem):
(WebCore::Layout::InlineItem::setWidth):
(WebCore::Layout::InlineItem::width const):
(WebCore::Layout::InlineItem::addDetachingRule): Deleted.
(WebCore::Layout::InlineItem::detachingRules const): Deleted.
(WebCore::Layout::InlineItem::nonBreakableStart const): Deleted.
(WebCore::Layout::InlineItem::nonBreakableEnd const): Deleted.
(WebCore::Layout::InlineItem::addNonBreakableStart): Deleted.
(WebCore::Layout::InlineItem::addNonBreakableEnd): Deleted.
(WebCore::Layout::InlineItem::textContent const): Deleted.
* layout/inlineformatting/InlineLineBox.h: Copied from Source/WebCore/layout/floats/FloatBox.h.
(WebCore::Layout::LineBox::logicalTopLeft const):
(WebCore::Layout::LineBox::logicalLeft const):
(WebCore::Layout::LineBox::logicalRight const):
(WebCore::Layout::LineBox::logicalTop const):
(WebCore::Layout::LineBox::logicalBottom const):
(WebCore::Layout::LineBox::logicalWidth const):
(WebCore::Layout::LineBox::logicalHeight const):
(WebCore::Layout::LineBox::LineBox):
* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::LineBreaker::LineBreaker):
(WebCore::Layout::LineBreaker::breakingContext):
(WebCore::Layout::LineBreaker::wordBreakingBehavior const):
(WebCore::Layout::LineBreaker::runWidth const):
(WebCore::Layout::LineBreaker::isAtBreakingOpportunity):
(WebCore::Layout::LineBreaker::textWidth const):
(WebCore::Layout::InlineLineBreaker::InlineLineBreaker): Deleted.
(WebCore::Layout::InlineLineBreaker::nextRun): Deleted.
(WebCore::Layout::InlineLineBreaker::isAtContentEnd const): Deleted.
(WebCore::Layout::InlineLineBreaker::lineBreakingBehavior): Deleted.
(WebCore::Layout::InlineLineBreaker::runWidth const): Deleted.
(WebCore::Layout::InlineLineBreaker::textWidth const): Deleted.
(WebCore::Layout::InlineLineBreaker::splitRun): Deleted.
(WebCore::Layout::InlineLineBreaker::adjustSplitPositionWithHyphenation const): Deleted.
* layout/inlineformatting/InlineLineBreaker.h:
* layout/inlineformatting/InlineRunProvider.cpp: Removed.
* layout/inlineformatting/InlineRunProvider.h: Removed.
* layout/inlineformatting/InlineTextItem.cpp: Added.
(WebCore::Layout::isWhitespaceCharacter):
(WebCore::Layout::isSoftLineBreak):
(WebCore::Layout::moveToNextNonWhitespacePosition):
(WebCore::Layout::moveToNextBreakablePosition):
(WebCore::Layout::InlineTextItem::createAndAppendTextItems):
(WebCore::Layout::InlineTextItem::InlineTextItem):
* layout/inlineformatting/InlineTextItem.h: Copied from Source/WebCore/layout/inlineformatting/text/TextUtil.h.
(WebCore::Layout::InlineTextItem::start const):
(WebCore::Layout::InlineTextItem::end const):
(WebCore::Layout::InlineTextItem::length const):
(WebCore::Layout::InlineTextItem::isWhitespace const):
(WebCore::Layout::InlineTextItem::isCollapsed const):
* layout/inlineformatting/text/TextUtil.cpp:
(WebCore::Layout::TextUtil::hyphenPositionBefore):
(WebCore::Layout::TextUtil::width):
(WebCore::Layout::TextUtil::fixedPitchWidth):
* layout/inlineformatting/text/TextUtil.h:
* layout/layouttree/LayoutBox.h:
* layout/layouttree/LayoutReplaced.cpp:
(WebCore::Layout::Replaced::intrinsicRatio const):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::accumulatedOffsetForInFlowPositionedContinuation):
(WebCore::Layout::TreeBuilder::createSubTree):
(WebCore::Layout::outputInlineRuns):
(WebCore::Layout::outputLayoutBox):

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

12 months ago[iOS] Respect -[NSItemProvider preferredPresentationSize] when dropping images
wenson_hsieh@apple.com [Sat, 25 May 2019 18:59:22 +0000 (18:59 +0000)]
[iOS] Respect -[NSItemProvider preferredPresentationSize] when dropping images
https://bugs.webkit.org/show_bug.cgi?id=198242

Reviewed by Beth Dakin.

Source/WebCore:

Teach the web content reader to respect the -preferredPresentationSize when creating attachment-backed image
elements. See below for more details.

Test: WKAttachmentTestsIOS.InsertDroppedImageWithPreferredPresentationSize

* editing/WebContentReader.h:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::attachmentForFilePath):
(WebCore::attachmentForData):

When creating attachment-backed image elements, additionally set width and height attributes from the preferred
presentation size, if specified.

(WebCore::WebContentReader::readFilePath):

Add a version of readFilePath that takes a single file path, and an optional preferred presentation size.

(WebCore::WebContentReader::readFilePaths):

Reimplement readFilePaths in terms of readFilePath.

(WebCore::WebContentReader::readDataBuffer):

Add more plumbing for preferredPresentationSize.

* platform/Pasteboard.h:
(WebCore::PasteboardWebContentReader::readFilePath):
(WebCore::PasteboardWebContentReader::readDataBuffer):
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::readRespectingUTIFidelities):

Forward PasteboardItemInfo's preferredPresentationSize to the web content reader.

Tools:

Add a new test that simulates dropping an image with a preferred presentation size into an editable element
with attachment elements enabled.

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

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

12 months agoOpt naver.com into simulated mouse events quirk on iOS
graouts@webkit.org [Sat, 25 May 2019 18:50:16 +0000 (18:50 +0000)]
Opt naver.com into simulated mouse events quirk on iOS
https://bugs.webkit.org/show_bug.cgi?id=198248
<rdar://problem/50598281>

Reviewed by Brent Fulgham.

* page/Quirks.cpp:
(WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):

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

12 months agomedia/video-remote-control-playpause.html is timing out after r245712
youenn@apple.com [Sat, 25 May 2019 16:41:55 +0000 (16:41 +0000)]
media/video-remote-control-playpause.html is timing out after r245712
https://bugs.webkit.org/show_bug.cgi?id=198238

Reviewed by Eric Carlson.

Source/WebCore:

Fix regression introduced in r245712.
Covered by test no longer timing out.

* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):

LayoutTests:

* platform/mac/TestExpectations:
Removed old flaky expectation that is no longer valid according dashboard.

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

12 months ago[Async overflow scrolling] Absolute positioned element inside async overflow scroll...
simon.fraser@apple.com [Sat, 25 May 2019 15:01:14 +0000 (15:01 +0000)]
[Async overflow scrolling] Absolute positioned element inside async overflow scroll didn't get composited sometimes
https://bugs.webkit.org/show_bug.cgi?id=198237

Reviewed by Antti Koivisto.

Source/WebCore:

The logic in requiresCompositingForIndirectReason() that decides if we need to do
compositing for a layer that needs to move independently of its enclosing scroller
was wrong.

Instead of asking question about the enclosing compositing layer, it needs to ask
whether it has different positioning behavior from the layer that it would
otherwise paint into, which is its paint-order parent.

"paintsIntoProvidedBacking" already does a containing-block check against the
scroller, so we know we don't have to do the check in that case.

Test: scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller.html

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::enclosingCompositedScrollingLayer):
(WebCore::isScrolledByOverflowScrollLayer):
(WebCore::isNonScrolledLayerInsideScrolledCompositedAncestor):
(WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
* rendering/RenderLayerCompositor.h:

LayoutTests:

* platform/ios-wk2/scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller.html: Added.

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

12 months ago[macOS] Fix programmatic scroll in RTL overflow with async scrolling enabled
simon.fraser@apple.com [Sat, 25 May 2019 15:01:09 +0000 (15:01 +0000)]
[macOS] Fix programmatic scroll in RTL overflow with async scrolling enabled
https://bugs.webkit.org/show_bug.cgi?id=198226

Reviewed by Antti Koivisto.

Source/WebCore:

On macOS we need to use a scroll offset to set the layer position, not
a scroll position.

Test: scrollingcoordinator/mac/rtl-programmatic-overflow-scroll.html

* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):

Source/WebCore/../../LayoutTests:

* scrollingcoordinator/mac/rtl-programmatic-overflow-scroll-expected.html: Added.
* scrollingcoordinator/mac/rtl-programmatic-overflow-scroll.html: Added.

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

12 months ago[l10n] [pt_BR] Updated Brazilian Portuguese translation
mcatanzaro@igalia.com [Sat, 25 May 2019 14:33:43 +0000 (14:33 +0000)]
[l10n] [pt_BR] Updated Brazilian Portuguese translation
https://bugs.webkit.org/show_bug.cgi?id=198245

Patch by Rafael Fontenelle <rafaelff@gnome.org> on 2019-05-25
Rubber-stamped by Michael Catanzaro.

* pt_BR.po:

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

12 months agoJITOperations getByVal should mark negative array indices as out-of-bounds
tzagallo@apple.com [Sat, 25 May 2019 09:25:25 +0000 (09:25 +0000)]
JITOperations getByVal should mark negative array indices as out-of-bounds
https://bugs.webkit.org/show_bug.cgi?id=198229

Reviewed by Saam Barati.

JSTests:

* microbenchmarks/get-by-val-negative-array-index.js: Added.
(foo):

Source/JavaScriptCore:

get_by_val with an array or string as base value and a negative index causes DFG to OSR exit,
but baseline doesn't mark it as out-of-bounds, since it only considers positive indices. This
leads to discarding DFG code, recompiling it and exiting at the same bytecode.

This is observed in the prepack-wtb subtest of JetStream2. In popContext#CdOhFJ, the last item
of the array popped and the new last value is accessed using `array[array.length - 1]`, which
is -1 when the array is empty. It shows a ~0.5% progression in JetStream2, but it's within the
noise.

* jit/JITOperations.cpp:
(JSC::getByVal):

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

12 months agoMake computed width of non-replaced inline return computed style.
jh718.park@samsung.com [Sat, 25 May 2019 01:42:17 +0000 (01:42 +0000)]
Make computed width of non-replaced inline return computed style.
https://bugs.webkit.org/show_bug.cgi?id=197814

Reviewed by Antti Koivisto.

Currently, Computed width of non-replaced inline incorrectly returns "auto"
instead of the computed value.
This patch changes the behavior according to
https://drafts.csswg.org/cssom/#resolved-value as below.

'If the property applies to the element or pseudo-element
and the resolved value of the display property is not none or contents,
then the resolved value is the used value.
Otherwise the resolved value is the computed value.'

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-object-element/object-attributes-expected.txt:

Source/WebCore:

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):

LayoutTests:

* fast/css/getComputedStyle/getComputedStyle-resolved-values-expected.txt:
* fast/css/getComputedStyle/getComputedStyle-with-pseudo-element-expected.txt:
* fast/css/getComputedStyle/getComputedStyle-with-pseudo-element.html:
* legacy-animation-engine/fast/css/getComputedStyle/getComputedStyle-with-pseudo-element-expected.txt:
* legacy-animation-engine/fast/css/getComputedStyle/getComputedStyle-with-pseudo-element.html:

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

12 months agoREGRESSION (r245715?) [WK2] Layout Test http/wpt/cache-storage/cache-storage-networkp...
youenn@apple.com [Sat, 25 May 2019 01:39:19 +0000 (01:39 +0000)]
REGRESSION (r245715?) [WK2] Layout Test http/wpt/cache-storage/cache-storage-networkprocess-crash.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=198222
<rdar://problem/51114899>

Reviewed by Alex Christensen.

In case a connection gets closed, handle all of its async reply completion handlers.
This ensures they handlers are called in case the connection does not get destroyed until a much later stage.

* Platform/IPC/Connection.cpp:
(IPC::Connection::~Connection):
(IPC::Connection::connectionDidClose):
(IPC::addAsyncReplyHandler):
(IPC::clearAsyncReplyHandlers):
(IPC::CompletionHandler<void):

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

12 months ago[WASM-References] Support Anyref in globals
justin_michaud@apple.com [Sat, 25 May 2019 00:51:21 +0000 (00:51 +0000)]
[WASM-References] Support Anyref in globals
https://bugs.webkit.org/show_bug.cgi?id=198102

Reviewed by Saam Barati.

JSTests:

Add test for anyrefs in globals, as well as adding a new RefNull initExpr for Builder.

* wasm/Builder.js:
(export.default.Builder.prototype._registerSectionBuilders.const.section.in.WASM.description.section.switch.section.case.string_appeared_here.this.section):
* wasm/Builder_WebAssemblyBinary.js:
(const.putInitExpr):
* wasm/references/anyref_globals.js: Added.
(GetGlobal.0.End.End.WebAssembly):
(5.doGCSet):
(doGCTest):
(doGCSet.doGCTest.let.count.0.doBarrierSet):

Source/JavaScriptCore:

Support anyref for globals, imports and exports. This adds code in B3 and Air to emit a write barrier
on the JSWebAssemblyWrapper whenever an anyref global is set. This also fixes a small bug in emitCCall
for air where it adds code to the wrong block.

* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::emitCCall):
(JSC::Wasm::AirIRGenerator::moveOpForValueType):
(JSC::Wasm::AirIRGenerator::setGlobal):
(JSC::Wasm::AirIRGenerator::emitWriteBarrierForJSWrapper):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::setGlobal):
(JSC::Wasm::B3IRGenerator::emitWriteBarrierForJSWrapper):
* wasm/WasmInstance.cpp:
(JSC::Wasm::Instance::Instance):
(JSC::Wasm::Instance::setGlobal):
* wasm/WasmInstance.h:
(JSC::Wasm::Instance::loadI32Global const):
(JSC::Wasm::Instance::loadI64Global const):
(JSC::Wasm::Instance::setGlobal):
(JSC::Wasm::Instance::shouldMarkGlobal):
(JSC::Wasm::Instance::numGlobals const):
* wasm/WasmSectionParser.cpp:
(JSC::Wasm::SectionParser::parseInitExpr):
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::visitChildren):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):

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

12 months agoVersioning.
alancoon@apple.com [Sat, 25 May 2019 00:40:02 +0000 (00:40 +0000)]
Versioning.

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

12 months ago[WHLSL] Allow vertex attributes to have arbitrary names in the shader
mmaxfield@apple.com [Fri, 24 May 2019 23:38:18 +0000 (23:38 +0000)]
[WHLSL] Allow vertex attributes to have arbitrary names in the shader
https://bugs.webkit.org/show_bug.cgi?id=198235

Reviewed by Dean Jackson and Justin Fan.

Source/WebCore:

Metal doesn't allow arbitrary vertex attribute IDs. If you try to create a vertex attribute > 16,
the Metal validation layer will assert. So, we need to have a mapping from whatever the WebGPU
API says the vertex attribute IDs should be to the internally-used vertex attribute IDs.

Test: webgpu/whlsl-arbitrary-vertex-attribute-locations.html

* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::VertexEntryPointScaffolding):
* Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h:
* Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp:
(WebCore::WHLSL::matchVertexAttributes):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::convertRenderPipelineDescriptor):
(WebCore::trySetInputStateForPipelineDescriptor):

LayoutTests:

* webgpu/whlsl-arbitrary-vertex-attribute-locations-expected.html: Added.
* webgpu/whlsl-arbitrary-vertex-attribute-locations.html: Added.

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

12 months agoRemove unused member in WebsiteDataRecord
pvollan@apple.com [Fri, 24 May 2019 22:48:26 +0000 (22:48 +0000)]
Remove unused member in WebsiteDataRecord
https://bugs.webkit.org/show_bug.cgi?id=198231

Reviewed by Brent Fulgham.

The data member 'originsWithCredentials' in WebsiteDataRecord is no longer needed since origins
with credentials are now stored in the 'origins' member.

* UIProcess/WebsiteData/WebsiteDataRecord.cpp:
(WebKit::WebsiteDataRecord::addOriginWithCredential): Deleted.
* UIProcess/WebsiteData/WebsiteDataRecord.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataAndApply):

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

12 months agoCrash under WebCore::TimerBase::~TimerBase after a download is canceled
david_quesada@apple.com [Fri, 24 May 2019 22:13:02 +0000 (22:13 +0000)]
Crash under WebCore::TimerBase::~TimerBase after a download is canceled
https://bugs.webkit.org/show_bug.cgi?id=197927
rdar://problem/50822728

Reviewed by Ryosuke Niwa.

* NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
(WebKit::Download::platformCancelNetworkLoad):
    CFNetwork makes no guarantees about what thread is used to call the completion block
    passed to -[NSURLSessionDownloadTask cancelByProducingResumeData], and in some cases,
    it can be called on a background queue. This eventually causes the Download to be
    deallocated on the background queue, which triggers a release assertion failure in
    ~TimerBase. When CFNetwork finishes canceling the download, we should move to the
    main thread before calling didCancel().

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

12 months agoRefactor how showLetterpressedGlyphsWithAdvances gets the graphics context.
timothy_horton@apple.com [Fri, 24 May 2019 21:41:32 +0000 (21:41 +0000)]
Refactor how showLetterpressedGlyphsWithAdvances gets the graphics context.
https://bugs.webkit.org/show_bug.cgi?id=198225

Reviewed by Dean Jackson.

* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::showLetterpressedGlyphsWithAdvances):
(WebCore::FontCascade::drawGlyphs):

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

12 months agoPlumb dark appearance down to GraphicsContext.
timothy_horton@apple.com [Fri, 24 May 2019 21:41:00 +0000 (21:41 +0000)]
Plumb dark appearance down to GraphicsContext.
https://bugs.webkit.org/show_bug.cgi?id=198224
rdar://problem/51068494

Reviewed by Dean Jackson.

No test yet, as it is not testable until this gets used.

* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContextStateChange::changesFromState const):
(WebCore::GraphicsContextStateChange::accumulate):
(WebCore::GraphicsContextStateChange::apply const):
(WebCore::GraphicsContextStateChange::dump const):
(WebCore::GraphicsContext::setUseDarkAppearance):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::useDarkAppearance const):
* rendering/TextPaintStyle.cpp:
(WebCore::TextPaintStyle::operator== const):
(WebCore::computeTextPaintStyle):
(WebCore::updateGraphicsContext):
* rendering/TextPaintStyle.h:

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

12 months agoRebase compositing/rtl/rtl-overflow-scrolling.html
simon.fraser@apple.com [Fri, 24 May 2019 19:49:57 +0000 (19:49 +0000)]
Rebase compositing/rtl/rtl-overflow-scrolling.html
https://bugs.webkit.org/show_bug.cgi?id=198220
<rdar://problem/51114177>

Unreviewed test gardening.

New result is a progression (scrollX, which is an offset, should not be negative).

* platform/ios-wk2/compositing/rtl/rtl-overflow-scrolling-expected.txt:

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

12 months agoWeb Inspector: Overlay: don't show setting for showing rulers/guides during element...
drousso@apple.com [Fri, 24 May 2019 19:01:48 +0000 (19:01 +0000)]
Web Inspector: Overlay: don't show setting for showing rulers/guides during element selection if it's not supported
https://bugs.webkit.org/show_bug.cgi?id=198221

Reviewed by Joseph Pecoraro.

* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createGeneralSettingsView):

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

12 months agoUpdate messages_unittest.py after r245715
youenn@apple.com [Fri, 24 May 2019 18:55:28 +0000 (18:55 +0000)]
Update messages_unittest.py after r245715
https://bugs.webkit.org/show_bug.cgi?id=198214

Reviewed by Alexey Proskuryakov.

Update expected results for messages.py output.i
Small refactoring to messages.py: instead of calling the completionHandler in case of decoding error with AsyncReply errors,
call cancelReply directly as it does the same thing.

* Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
(Messages::WebPage::TestAsyncMessage::callReply):
(Messages::WebPage::TestAsyncMessage::cancelReply):
(Messages::WebPage::TestAsyncMessageWithMultipleArguments::callReply):
(Messages::WebPage::TestAsyncMessageWithMultipleArguments::cancelReply):
* Scripts/webkit/messages.py:

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

12 months agoMake sure completion handler is always called in SWServer::startSuspension
youenn@apple.com [Fri, 24 May 2019 18:26:45 +0000 (18:26 +0000)]
Make sure completion handler is always called in SWServer::startSuspension
https://bugs.webkit.org/show_bug.cgi?id=198215

Reviewed by Alex Christensen.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::startSuspension):
Make sure completion handler is called in case of no registration store.

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

12 months agoscrollingcoordinator/scrolling-tree/fixed-inside-frame.html is no longer flaky
sroberts@apple.com [Fri, 24 May 2019 17:47:28 +0000 (17:47 +0000)]
scrollingcoordinator/scrolling-tree/fixed-inside-frame.html is no longer flaky
https://bugs.webkit.org/show_bug.cgi?id=194253

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations: Removing failed expectations

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

12 months agoAsssertion failure in dispatchSubtreeModifiedEvent due to TextFieldInputType updating...
rniwa@webkit.org [Fri, 24 May 2019 16:33:57 +0000 (16:33 +0000)]
Asssertion failure in dispatchSubtreeModifiedEvent due to TextFieldInputType updating UA shadow tree inside Element::removedFromAncestor
https://bugs.webkit.org/show_bug.cgi?id=198216

Reviewed by Brent Fulgham.

Source/WebCore:

The bug was caused by ListAttributeTargetObserver::idTargetChanged() updating the shadow tree of an input element
within Element::removedFromAncestor via TextFieldInputType::createDataListDropdownIndicator(). Fixed it by
supressing the assertions with ScriptDisallowedScope::EventAllowedScope since it's always safe to update
UA shadow trees of input elements as it's not exposed to author scripts.

Avoiding the creation of dropdown indicator in this particular scenario is a lot more involved and it's not
particularly correct because there could be another datalist element which matches the ID specified in list
content attribute after the removal of the old datalist element.

Test: fast/forms/datalist/datalist-removal-assertion.html

* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::createDataListDropdownIndicator):
(WebCore::TextFieldInputType::createContainer):
* html/shadow/DataListButtonElement.cpp:
(WebCore::DataListButtonElement::DataListButtonElement):

LayoutTests:

Added a regression test.

* fast/forms/datalist/datalist-removal-assertion-expected.txt: Added.
* fast/forms/datalist/datalist-removal-assertion.html: Added.

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