blob: 045beb2b5c206bf01f46b87c5f3d4a2bb333f150 [file] [log] [blame]
2020-05-22 Zalan Bujtas <zalan@apple.com>
Nullptr deref in WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation when parent and beforeChild are siblings
https://bugs.webkit.org/show_bug.cgi?id=212116
<rdar://problem/62993844>
Reviewed by Simon Fraser.
This patch fixes the case when a nested fragmented context has a spanner and we try to form a continuation while this nested fragmented context is being destroyed.
1. The continuation is triggered by a style change that turns a previously out-of-flow block container into an inflow box
(and the parent inline level container can't have the box as a direct child anymore).
2. An unrelated style change nukes the nested fragmented context. We need to "re-assign" the spanner to the parent fragment.
These 2 changes are split into 2 phases; first we take care of the tree mutation triggered by the continuation (updateRendererStyle), while
we do the fragmented context cleanup (updateAfterDescendants) in a separate step.
This 2 phase setup confuses the "where to put this spanner" logic.
This patch addresses the issue by keeping the spanner inside the about-to-be-destroyed fragmented context while forming the continuation (phase #1) and let the second phase (updateAfterDescendants)
deal with the spanner moving.
Test: fast/multicol/nested-multicol-with-spanner-and-continuation.html
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::isValidColumnSpanner):
2020-05-22 Chris Dumez <cdumez@apple.com>
Revoking an object URL immediately after triggering navigation causes navigation to fail
https://bugs.webkit.org/show_bug.cgi?id=212279
<rdar://problem/63553090>
Reviewed by Geoffrey Garen.
When doing a policy check for a Blob URL, we clone the blob and create a new temporary Blob URL
that stays alive for the duration of the policy check. We made sure to update the ResourceRequest
URL with the new Blob URL, however, we were failing to update the DocumentLoader's request.
As a result, if the client responded with Policy USE, the DocumentLoader would still attempt to
navigate to the old Blob URL.
Test: fast/loader/revoke-blob-url-after-navigation.html
* loader/PolicyChecker.cpp:
(WebCore::FrameLoader::PolicyChecker::extendBlobURLLifetimeIfNecessary const):
(WebCore::FrameLoader::PolicyChecker::checkNavigationPolicy):
(WebCore::FrameLoader::PolicyChecker::checkNewWindowPolicy):
* loader/PolicyChecker.h:
2020-05-22 Simon Fraser <simon.fraser@apple.com>
Make sure we clean up CFTimerRefs when destroying scrolling tree nodes
https://bugs.webkit.org/show_bug.cgi?id=212278
<rdar://problem/63548212>
Reviewed by Tim Horton.
When destroying scrolling tree nodes, make sure we explicitly stop the RunLoop::Timers,
and do this for all nodes when clearing the m_nodeMap, not just for orphaned nodes as
was done in r262042.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
(WebCore::ScrollingTree::updateTreeFromStateNodeRecursive):
(WebCore::ScrollingTree::removeAllNodes):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeNode.h:
(WebCore::ScrollingTreeNode::willBeDestroyed):
(WebCore::ScrollingTreeNode::wasRemovedFromTree): Deleted.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::willBeDestroyed):
(WebCore::ScrollingTreeFrameScrollingNodeMac::wasRemovedFromTree): Deleted.
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::willBeDestroyed):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::wasRemovedFromTree): Deleted.
2020-05-22 Andres Gonzalez <andresg_22@apple.com>
Updates to the isolated tree must happen before posting notifications to clients.
https://bugs.webkit.org/show_bug.cgi?id=212266
Reviewed by Chris Fleizach.
Multiple tests.
In AXObjectCache::notificationPostTimerFired we were updating the
isolated tree after the notifications were posted to the platform
clients. This caused that in some cases when the client requested info
as the result of those notifications, the isolated tree was out-of-date.
In this patch updateIsolatedTree is called before notifying platform clients.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::notificationPostTimerFired):
(WebCore::AXObjectCache::postNotification):
(WebCore::AXObjectCache::postTextStateChangeNotification):
(WebCore::AXObjectCache::updateIsolatedTree):
2020-05-22 Sam Weinig <weinig@apple.com>
Extended Color Cleanup: Make alpha premultiplication code more consistent and clear regarding what works with extended colors
https://bugs.webkit.org/show_bug.cgi?id=212265
Reviewed by Simon Fraser.
- Adds premultiplied(const FloatComponents&) to do premutiplication directly on FloatComponents
rather than doing it on the ints and losing precision.
- Makes non-FloatComponent alpha premultiplication all take place only for SimpleColors as that
is what callers need. The existing premulitplication for ExtendedColors in blend() was incorrect
as it never did a conversion to sRGB.
- Adds new toSRGBASimpleColorLossy() (to complement toSRGBAComponentsLossy()). Will make it easy
to find all the conversions in the future.
- Broke non-premultiplying blend() out of blend() (removing parameter) and made a new blendWithoutPremultiply()
function for it (no callers needed to make this decision dynamically).
* css/CSSGradientValue.cpp:
(WebCore::CSSGradientValue::computeStops):
Use blendWithoutPremultiply() explicitly.
* platform/graphics/Color.h:
* platform/graphics/Color.cpp:
(WebCore::makePremultipliedRGBA): Renamed from premultipliedARGBFromColor and now only operates on SimpleColors.
(WebCore::makeUnPremultipliedRGBA): Renamed from colorFromPremultipliedARGB and now only operates on SimpleColors.
(WebCore::colorFromPremultipliedARGB): Deleted.
(WebCore::premultipliedARGBFromColor): Deleted.
(WebCore::Color::toSRGBASimpleColorLossy const):
Added. Useful for finding all non-colorspace preserving users of the color channels.
(WebCore::blend):
(WebCore::blendWithoutPremultiply):
Split these out from each other. Made blend() use toSRGBASimpleColorLossy() and do all
operations on SimpleColors directly. The old code that preported to work with extended
colors was nonsense as it didn't actually take the colorspaces into account, just grabbed
the channels regardless of space.
* platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp:
(WebCore::ImageBufferCairoImageSurfaceBackend::platformTransformColorSpace):
Adopt update premulitiplication names and stay in SimpleColor for entire conversion.
* platform/graphics/cairo/NativeImageCairo.cpp:
(WebCore::nativeImageSinglePixelSolidColor):
Adopt update premulitiplication names.
* platform/graphics/ColorUtilities.cpp:
(WebCore::premultiplied):
* platform/graphics/ColorUtilities.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawBorder):
(WebCore::prepareFilterProgram):
(WebCore::TextureMapperGL::drawSolidColor):
Add and adopt premultiplied(const FloatComponents&).
2020-05-22 Andy Estes <aestes@apple.com>
[Apple Pay] Add new ApplePayInstallmentConfiguration members
https://bugs.webkit.org/show_bug.cgi?id=212160
<rdar://problem/60703650>
Reviewed by Alex Christensen.
Test: http/tests/ssl/applepay/ApplePayInstallmentItems.https.html
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj: Added IDLs, headers, and derived sources for
ApplePayInstallment{Item,ItemType,RetailChannel}.
* Modules/applepay/ApplePayInstallmentConfiguration.idl:
* Modules/applepay/ApplePayInstallmentConfigurationWebCore.h: Added items,
applicationMetadata, and retailChannel members. Added missing conditionals to
merchantIdentifier and referrerIdentifier.
* Modules/applepay/ApplePayInstallmentItem.h:
* Modules/applepay/ApplePayInstallmentItem.idl:
* Modules/applepay/ApplePayInstallmentItemType.h:
* Modules/applepay/ApplePayInstallmentItemType.idl:
* Modules/applepay/ApplePayInstallmentRetailChannel.h:
* Modules/applepay/ApplePayInstallmentRetailChannel.idl: Added.
* Modules/applepay/ApplePayRequestBase.cpp:
(WebCore::convertAndValidate): Changed to call PaymentInstallmentConfiguration::create,
returning an exception if present.
* Modules/applepay/PaymentInstallmentConfiguration.mm:
(WebCore::fromDecimalNumber): Allowed for a large maximum number of fractional digits to
support formatting high-precision currency and APRs (note that this formatter is only used
for test support).
(WebCore::applePayItemType):
(WebCore::platformItemType): Added to convert between PKInstallmentItemType and
ApplePayInstallmentItemType.
(WebCore::applePayRetailChannel):
(WebCore::platformRetailChannel): Added to convert between PKInstallmentRetailChannel and
ApplePayInstallmentRetailChannel.
(WebCore::makeNSArrayElement):
(WebCore::makeVectorElement): Added to convert between NSArray<PKPaymentInstallmentItem *>
and Vector<ApplePayInstallmentItem>.
(WebCore::createPlatformConfiguration): Added a parameter for passing in applicationMetadata
as an NSDictionary. Set properties on PKPaymentInstallmentConfiguration for new
ApplePayInstallmentConfiguration members.
(WebCore::PaymentInstallmentConfiguration::create): Added; converts the applicationMetadata
JSON string (if present) to an NSDictionary, returning a TypeError if the JSON string does
not deserialize to an NSDictionary (as PassKit requires).
(WebCore::PaymentInstallmentConfiguration::PaymentInstallmentConfiguration): Added a
parameter for passing in applicationMetadata as an NSDictionary. Made private.
(WebCore::PaymentInstallmentConfiguration::applePayInstallmentConfiguration const): Set
members on ApplePayInstallmentConfiguration for new PKPaymentInstallmentConfiguration
properties.
* Modules/applepay/PaymentInstallmentConfigurationWebCore.h:
2020-05-22 Alex Christensen <achristensen@webkit.org>
Add SPI to unblock third party cookies from WKWebViews with ResourceLoadStatistics turned on
https://bugs.webkit.org/show_bug.cgi?id=212058
<rdar://problem/60595539>
Reviewed by John Wilander.
* WebCore.xcodeproj/project.pbxproj:
* loader/CookieJar.cpp:
(WebCore::shouldRelaxThirdPartyCookieBlocking):
(WebCore::CookieJar::cookies const):
(WebCore::CookieJar::setCookies):
(WebCore::CookieJar::cookieRequestHeaderFieldValue const):
(WebCore::CookieJar::getRawCookies const):
* page/Page.cpp:
(WebCore::m_shouldRelaxThirdPartyCookieBlocking):
* page/Page.h:
(WebCore::Page::shouldRelaxThirdPartyCookieBlocking const):
* page/PageConfiguration.h:
* platform/network/CacheValidation.cpp:
(WebCore::cookieRequestHeaderFieldValue):
* platform/network/NetworkStorageSession.cpp:
(WebCore::NetworkStorageSession::shouldBlockCookies const):
(WebCore::NetworkStorageSession::maxAgeCacheCap):
* platform/network/NetworkStorageSession.h:
* platform/network/ShouldRelaxThirdPartyCookieBlocking.h: Added.
* platform/network/cf/NetworkStorageSessionCFNetWin.cpp:
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
(WebCore::NetworkStorageSession::cookiesForDOM const):
(WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
(WebCore::NetworkStorageSession::getRawCookies const):
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::cookiesForURL const):
(WebCore::NetworkStorageSession::cookiesForSession const):
(WebCore::NetworkStorageSession::cookiesForDOM const):
(WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
(WebCore::NetworkStorageSession::getRawCookies const):
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
(WebCore::NetworkStorageSession::cookiesForDOM const):
(WebCore::NetworkStorageSession::getRawCookies const):
(WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::createCurlRequest):
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
(WebCore::NetworkStorageSession::getRawCookies const):
(WebCore::cookiesForSession):
(WebCore::NetworkStorageSession::cookiesForDOM const):
(WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
2020-05-22 Oriol Brufau <obrufau@igalia.com>
Don't put out-of-flow boxes in anonymous flex/grid items
https://bugs.webkit.org/show_bug.cgi?id=205386
Reviewed by Manuel Rego Casasnovas.
A single anonymous flex/grid item should just contain a contiguous
sequence of text runs.
This patch is based on https://crrev.com/533825 from Chromium.
Tests: imported/w3c/web-platform-tests/css/css-flexbox/anonymous-flex-item-004.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/anonymous-grid-item-001.html
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation):
2020-05-22 Tim Horton <timothy_horton@apple.com>
iOS: Pressing tab in the Mail subject field moves focus to the body, but pressing shift tab doesn't move it back
https://bugs.webkit.org/show_bug.cgi?id=212243
<rdar://problem/59127764>
Reviewed by Wenson Hsieh.
New API Tests: WebKit.ShiftTabTakesFocusFromEditableWebView and WebKit.TabDoesNotTakeFocusFromEditableWebView
* page/FocusController.cpp:
(WebCore::FocusController::relinquishFocusToChrome):
(WebCore::FocusController::advanceFocusInDocumentOrder):
* page/FocusController.h:
Factor out the code that decides whether the Chrome might accept focus,
and transfers focus out to the Chrome, for use in EventHandler.
* page/EventHandler.cpp:
(WebCore::EventHandler::defaultTabEventHandler):
In the case where we are shift-tabbing out of an editable web view,
allow focus to pass to the Chrome. Previously, we would not allow this,
because tabKeyCyclesThroughElements is false in editable web views.
However, focus exiting the web view entirely needn't be covered by
"cycles through elements" behavior.
We can't do this for plain "tab", because that needs to be allowed to
insert a tab character instead.
2020-05-22 Tyler Wilcock <twilco.o@protonmail.com>
Cannot style ::selection for a flex container
https://bugs.webkit.org/show_bug.cgi?id=209822
Reviewed by Antti Koivisto.
When needing to query for pseudostyles, RenderText used to unconditionally check the parent's pseudostyles. The parent of
RenderText objects is often an anonymous box, depending on the presence of siblings, `display` type, etc. This is problematic
as pseudostyles are associated with an element of the DOM, meaning RenderText elements would often fail to find any pseudostyle
thanks to their anonymous parent.
This patch changes RenderText to traverse its tree of ancestry upwards until it finds a non-anonymous ancestor and gets those pseudostyles,
rather than unconditionally trying to get pseudostyles from its direct parent.
Blink does something similar when retrieving pseudostyles:
https://github.com/chromium/chromium/blob/793cb59c18334f8b506863192bf630776da0f4d2/third_party/blink/renderer/core/paint/selection_painting_utils.cc#L54
Tests: editing/selection/selection-display-block-sibling.html
editing/selection/selection-display-flex.html
* rendering/RenderObject.cpp:
(WebCore::RenderObject::firstNonAnonymousAncestor const):
* rendering/RenderObject.h:
* rendering/RenderText.h:
(WebCore::RenderText::getCachedPseudoStyle const): getCachedPseudoStyle from first non-anonymous ancestor, rather than only checking the direct parent.
(WebCore::RenderText::selectionBackgroundColor const): Retrieve selectionBackgroundColor from first non-anonymous ancestor rather than only checking the direct parent.
(WebCore::RenderText::selectionForegroundColor const): Retrieve selectionForegroundColor from first non-anonymous ancestor rather than only checking the direct parent.
(WebCore::RenderText::selectionEmphasisMarkColor const): Retrieve selectionEmphasisMarkColor from first non-anonymous ancestor rather than only checking the direct parent.
(WebCore::RenderText::selectionPseudoStyle const): Retrieve selectionPseudoStyle from first non-anonymous ancestor rather than only checking the direct parent.
2020-05-21 Wenson Hsieh <wenson_hsieh@apple.com>
DataTransfer.files contains multiple files when pasting a single image with multiple representations
https://bugs.webkit.org/show_bug.cgi?id=212245
<rdar://problem/60240436>
Reviewed by Tim Horton.
When pasting or dropping a single image that is backed by multiple representations in NSPasteboard (or
UIPasteboard), we currently report more than one `File` to the page via `DataTransfer.files`. This is because
`Pasteboard::read(PasteboardFileReader&)`, which is responsible for converting the contents of the pasteboard
into a list of files, currently iterates over every pasteboard type and adds each of them as a file. This is
wrong when an item has multiple type representations.
To differentiate the case where a single item has multiple representations from the case where it has multiple
pasteboard items, we use `allPasteboardItemInfo()` instead to grab a per-item list of types from the pasteboard
on Cocoa platforms, and only create at most 1 file per item using the highest fidelity type that contains data.
Test: PasteImage.PasteImageWithMultipleRepresentations
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::Pasteboard::read):
2020-05-21 Simon Fraser <simon.fraser@apple.com>
Fix rare scrolling thread crash firing the m_delayedRenderingUpdateDetectionTimer timer
https://bugs.webkit.org/show_bug.cgi?id=212250
Reviewed by Tim Horton.
It seems that we can fire the m_delayedRenderingUpdateDetectionTimer timer after the
ScrollingTree has been destroyed (possibly because it's destroyed on another thread
and CFRunLoopTimerRef isn't threadsafe), so explicitly clear the timer in invalidate()
while holding m_treeMutex.
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::invalidate):
2020-05-21 Sam Weinig <weinig@apple.com>
Extended Color Cleanup: Move Color coder definitions to Color to allow for future encaspulation improvements
https://bugs.webkit.org/show_bug.cgi?id=212247
Reviewed by Simon Fraser.
Move IPC encoder/decoder definitions from WebKit down into Color itself to move closer
to making Color::rgb() private.
* platform/graphics/Color.h:
(WebCore::Color::encode const):
(WebCore::Color::decode):
2020-05-21 Simon Fraser <simon.fraser@apple.com>
Scrolling thread scrolls on sync-scrolling scrollers don't get to the main thread
https://bugs.webkit.org/show_bug.cgi?id=212225
Fix builds that use Nicosia after r262041.
* page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp:
(WebCore::ScrollingTreeFrameScrollingNodeNicosia::currentScrollPositionChanged):
* page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h:
2020-05-21 Simon Fraser <simon.fraser@apple.com>
Fix some thread safety issues with ScrollController timers
https://bugs.webkit.org/show_bug.cgi?id=212238
Reviewed by Wenson Hsieh.
There were some problems with the timers fired by ScrollController, used for rubber-banding
and scroll snap.
First, they could fire on the main thread when we intended them to fire on the scrolling thread.
This happened because in r260716 I made the scrolling tree commit on the main thread, so we'd
construct the ScrollingTreeScrollingNodeDelegateMac and its ScrollController there and its
timers would grab the main thread runloop. Fix by creating the timers on demand.
Secondly, the timer callbacks called into scrolling tree code, but without taking
the scrolling tree lock,
and without any guarantee that the node would stay alive for the duration of the callback.
Fix by having the ScrollControllerClient create the timers, allowing the client to have
a callback wrapper that locks, and to ensure object lifetime (or make a weak ref). Now
that scrolling tree nodes could be extended by a pending timer, we need to explicitly
clear the timers when nodes are removed from the tree.
Finally, rename some confusingly named ScrollControllerClient functions.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::treeMutex):
* page/scrolling/ScrollingTreeNode.h:
(WebCore::ScrollingTreeNode::wasBeRemovedFromTree):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::wasBeRemovedFromTree):
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::wasBeRemovedFromTree):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::nodeWillBeDestroyed):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::createTimer):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::didStopRubberbandSnapAnimation):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::willStartScrollSnapAnimation):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::didStopScrollSnapAnimation):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::stopSnapRubberbandTimer): Deleted.
(WebCore::ScrollingTreeScrollingNodeDelegateMac::startScrollSnapTimer): Deleted.
(WebCore::ScrollingTreeScrollingNodeDelegateMac::stopScrollSnapTimer): Deleted.
* platform/ScrollAnimator.cpp:
(WebCore::ScrollAnimator::createTimer):
* platform/ScrollAnimator.h:
* platform/cocoa/ScrollController.h:
(WebCore::ScrollControllerTimer::ScrollControllerTimer):
(WebCore::ScrollControllerClient::willStartRubberBandSnapAnimation):
(WebCore::ScrollControllerClient::didStopRubberbandSnapAnimation):
(WebCore::ScrollControllerClient::willStartScrollSnapAnimation):
(WebCore::ScrollControllerClient::didStopScrollSnapAnimation):
(WebCore::ScrollControllerClient::startSnapRubberbandTimer): Deleted.
(WebCore::ScrollControllerClient::stopSnapRubberbandTimer): Deleted.
(WebCore::ScrollControllerClient::startScrollSnapTimer): Deleted.
(WebCore::ScrollControllerClient::stopScrollSnapTimer): Deleted.
* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::ScrollController):
(WebCore::ScrollController::stopAllTimers):
(WebCore::ScrollController::handleWheelEvent):
(WebCore::ScrollController::snapRubberBandTimerFired):
(WebCore::ScrollController::isRubberBandInProgress const):
(WebCore::ScrollController::isScrollSnapInProgress const):
(WebCore::ScrollController::startSnapRubberbandTimer):
(WebCore::ScrollController::stopSnapRubberbandTimer):
(WebCore::ScrollController::snapRubberBand):
(WebCore::ScrollController::scheduleStatelessScrollSnap):
(WebCore::ScrollController::statelessSnapTransitionTimerFired):
(WebCore::ScrollController::startScrollSnapTimer):
(WebCore::ScrollController::stopScrollSnapTimer):
* platform/mac/ScrollAnimatorMac.h:
2020-05-21 Simon Fraser <simon.fraser@apple.com>
Scrolling thread scrolls on sync-scrolling scrollers don't get to the main thread
https://bugs.webkit.org/show_bug.cgi?id=212225
Reviewed by Tim Horton.
Some scrolls on nodes with synchronousScrollingReasons failed to set the m_scrolledSinceLastCommit bit,
because ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged() bypassed a call to the superclass.
Fix by passing ScrollingLayerPositionAction so that it can just call super.
This will be tested by existing tests after some upcoming scroll snap changes.
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
2020-05-21 Peng Liu <peng.liu6@apple.com>
Fix issues of the Picture-in-Picture API under stress tests
https://bugs.webkit.org/show_bug.cgi?id=212191
Reviewed by Eric Carlson.
The current implementation of the Picture-in-Picture API is not robust under stress tests.
Changing the video presentation mode of a video element between inline and picture-in-picture
continuously may corrupt the internal states of the video element.
This patch refactors the approach to tracking the progress of video presentation mode changes
and make sure no new requestPictureInPicture() or exitPictureInPicture() will trigger
a presentation mode change unless the previous operations are completed.
This patch also removes the code for testing purposes in the HTMLVideoElement class.
Covered by existing tests.
* html/HTMLMediaElement.h:
* html/HTMLVideoElement.cpp:
(WebCore::toPresentationMode):
(WebCore::HTMLVideoElement::setFullscreenMode):
(WebCore::HTMLVideoElement::fullscreenModeChanged):
(WebCore::HTMLVideoElement::didEnterFullscreen):
(WebCore::HTMLVideoElement::didExitFullscreen):
(WebCore::HTMLVideoElement::setPictureInPictureObserver):
(WebCore::HTMLVideoElement::setVideoFullscreenFrame):
(WebCore::HTMLVideoElement::didBecomeFullscreenElement): Deleted.
(WebCore::HTMLVideoElement::setPictureInPictureAPITestEnabled): Deleted.
* html/HTMLVideoElement.h:
* testing/Internals.cpp:
(WebCore::Internals::setPictureInPictureAPITestEnabled): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
Remove setPictureInPictureAPITestEnabled().
2020-05-21 Sam Weinig <weinig@apple.com>
Extended Color Cleanup: Remove trivial uses of Color::rgb()
https://bugs.webkit.org/show_bug.cgi?id=212231
Reviewed by Darin Adler
Replaces a few unnecessary uses of Color::rgb():
- Uses of an idiom where code round-tripped a Color via Color(myColor.rgb()). This is
not compatible with extended colors and seems to be unnecessary.
- Uses of colorWithOverrideAlpha(). This function requires a SimpleColor, so required
using color.rgb(). We can't transition to Color::colorWithAlpha due to a slightly
different rounding of the alpha, so a new function Color::colorWithAlphaUsingAlternativeRounding
was added to which implements the alternative rounding. A later change can reconcile
the two versions.
- Creation of D2D1::ColorF. D2D1::ColorF has a constructor that takes a four floats that
is used instead.
- Comparing two colors using rgb() for each to avoid comparing the semantic bit. equalIgnoringSemanticColor
exists for just this use.
* editing/cocoa/HTMLConverter.mm:
(HTMLConverterCaches::colorPropertyValueForNode):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::addHTMLColorToStyle):
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::setStrokeStyle):
(WebCore::CanvasRenderingContext2DBase::setFillStyle):
(WebCore::CanvasRenderingContext2DBase::setShadow):
* html/canvas/CanvasStyle.cpp:
(WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::updateCueFromCueData):
* platform/graphics/Color.cpp:
(WebCore::Color::colorWithAlphaMultipliedByUsingAlternativeRounding const):
(WebCore::Color::colorWithAlpha const):
(WebCore::Color::colorWithAlphaUsingAlternativeRounding const):
(WebCore::colorWithOverrideAlpha): Deleted.
* platform/graphics/Color.h:
(WebCore::colorWithOverrideAlpha): Deleted.
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::prepareCairoContextSource):
* platform/graphics/filters/FEFlood.cpp:
(WebCore::FEFlood::platformApplySoftware):
* platform/graphics/win/ColorDirect2D.cpp:
(WebCore::Color::operator D2D1_COLOR_F const):
(WebCore::Color::operator D2D1_VECTOR_4F const):
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::colorWithGlobalAlpha const):
* platform/mac/ThemeMac.mm:
(WebCore::drawCellFocusRingWithFrameAtTime):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformFocusRingColor const):
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):
* svg/SVGStopElement.cpp:
(WebCore::SVGStopElement::stopColorIncludingOpacity const):
2020-05-21 Oriol Brufau <obrufau@igalia.com>
[css-grid] Don't create renderers for whitespace nodes
https://bugs.webkit.org/show_bug.cgi?id=212220
Reviewed by Manuel Rego Casasnovas.
Even with 'white-space: pre' we shouldn't create RenderTexts
for whitespace-only nodes in grid layout, according to
https://drafts.csswg.org/css-grid/#grid-items
This patch is based on https://codereview.chromium.org/16888008
Tests: fast/text/simple-line-layout-with-zero-sized-font.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/whitespace-in-grid-item-001.html
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::textRendererIsNeeded):
2020-05-21 Simon Fraser <simon.fraser@apple.com>
Fix rare crash in TileGrid::platformCALayerShowRepaintCounter()
https://bugs.webkit.org/show_bug.cgi?id=212182
<rdar://problem/55618414>
Reviewed by Darin Adler.
Crash data suggest that owner() can be null in platformCALayerShowRepaintCounter(),
so null-check in these functions.
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::platformCALayerDeviceScaleFactor const):
(WebCore::TileGrid::platformCALayerShowDebugBorders const):
(WebCore::TileGrid::platformCALayerShowRepaintCounter const):
(WebCore::TileGrid::isUsingDisplayListDrawing const):
2020-05-21 Youenn Fablet <youenn@apple.com>
Incorrect location.origin in blob workers
https://bugs.webkit.org/show_bug.cgi?id=211876
<rdar://problem/63284717>
Reviewed by Sihui Liu.
Instead of computing the origin from the location URL in worker, get it directly from the WorkerGlobalScope origin.
This ensures we unwrap properly blob URLs.
Test: http/tests/security/contentSecurityPolicy/worker-blob-location.html
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::location const):
* workers/WorkerLocation.cpp:
(WebCore::WorkerLocation::origin const):
* workers/WorkerLocation.h:
(WebCore::WorkerLocation::create):
(WebCore::WorkerLocation::url const):
(WebCore::WorkerLocation::WorkerLocation):
2020-05-21 John Wilander <wilander@apple.com>
Storage Access API: Allow configurable storage access scope
https://bugs.webkit.org/show_bug.cgi?id=212114
<rdar://problem/63423063>
Reviewed by Alex Christensen.
The scope of storage access as per-frame or per-page was discussed in the
standards process here: https://github.com/privacycg/storage-access/issues/3
The decision was to have per-page storage access by default. Recent feedback
from Google and conversation with Mozilla suggest that we might want to
support the caller choosing the scope.
This patch adds support for different scope configurations while keeping the
existing default as per-frame. A later patch will switch the default and add
test cases for per-page scope.
A new struct is added WebCore::RequestStorageAccessResult which carries full
information about the storage access request result.
A new enum is added WebCore::StorageAccessScope to encode per-frame and
per-page access.
No new tests. No changed functionality. Tests already exist.
* dom/DocumentStorageAccess.cpp:
(WebCore::DocumentStorageAccess::requestStorageAccess):
* dom/DocumentStorageAccess.h:
(WebCore::RequestStorageAccessResult::encode const):
(WebCore::RequestStorageAccessResult::decode):
* page/ChromeClient.h:
(WebCore::ChromeClient::requestStorageAccess):
2020-05-21 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com>
[PlayStation] Add minimal WKView API to enable TestWebKitAPI
https://bugs.webkit.org/show_bug.cgi?id=211868
Reviewed by Alex Christensen.
Enable TestWebKitAPI
* PlatformPlayStation.cmake:
Add WebKitRequirements library to WebCore_CopySharedLibs.
2020-05-21 Chris Dumez <cdumez@apple.com>
ASSERTION FAILED: m_wrapper on fast/events/scoped/editing-commands.html
https://bugs.webkit.org/show_bug.cgi?id=209862
<rdar://problem/61164607>
Reviewed by Darin Adler.
Make sure ScopedEventQueue keeps its event targets alive using a GCReachableRef<Node>
so that it keeps alive both the target and its JS wrapper.
No new tests, covered by existing test.
* dom/ScopedEventQueue.cpp:
(WebCore::ScopedEventQueue::enqueueEvent):
(WebCore::ScopedEventQueue::dispatchEvent const):
(WebCore::ScopedEventQueue::dispatchAllEvents):
* dom/ScopedEventQueue.h:
2020-05-21 Sihui Liu <sihui_liu@apple.com>
SQLite database fails to close in SQLiteIDBBackingStore::databaseNameFromFile
https://bugs.webkit.org/show_bug.cgi?id=212090
Reviewed by Darin Adler.
We should finish SQLite statement before closing database.
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromFile):
2020-05-21 Doug Kelly <dougk@apple.com>
Dispatch pending events only for current page
https://bugs.webkit.org/show_bug.cgi?id=211975
<rdar://problem/58942759>
Reviewed by Chris Dumez.
Document::implicitClose() should not dispatch events globally. The EventSender class operates as a singleton pattern
for each event queue, so to add some means to restrict which documents are handling events, we can send the current
page pointer and only dispatch the event if the event is for the same page. Other events are simply re-enqueued
to be triggered at a later time.
* dom/Document.cpp:
(WebCore::Document::implicitClose):
* dom/EventSender.h:
(WebCore::EventSender::timerFired):
(WebCore::EventSender<T>::dispatchPendingEvents):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::dispatchPendingLoadEvents):
* html/HTMLLinkElement.h:
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::dispatchPendingLoadEvents):
* html/HTMLStyleElement.h:
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::dispatchPendingBeforeLoadEvents):
(WebCore::ImageLoader::dispatchPendingLoadEvents):
(WebCore::ImageLoader::dispatchPendingErrorEvents):
* loader/ImageLoader.h:
(WebCore::ImageLoader::document):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::append):
2020-05-21 Simon Fraser <simon.fraser@apple.com>
[macOS] Scrolling synchronization part 2: Have the scrolling thread detect when the main thread is slow to respond to start a rendering update
https://bugs.webkit.org/show_bug.cgi?id=212175
Reviewed by Tim Horton.
The scrolling thread now detects when a main thread rendering update is taking too long, going into
desynchronized mode when that happens.
However, there's another state that needs to be handled, which is the main thread being busy and
taking too long to start the rendering update. The scrolling thread gets a "displayDidRefresh" ping
and expects that the main thread will get the same ping, and use it to start the rendering update,
but a busy main thread won't respond to this ping promptly.
Detect this with a short-duration (1ms) timer that fires on the scrolling thread; if the timer fires
we go into desynchronized mode until the next update. The timer is canceled if the scrolling thread
receives the willStartRenderingUpdate().
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::waitForRenderingUpdateCompletionOrTimeout):
(WebCore::ThreadedScrollingTree::scheduleDelayedRenderingUpdateDetectionTimer):
(WebCore::ThreadedScrollingTree::delayedRenderingUpdateDetectionTimerFired):
(WebCore::ThreadedScrollingTree::displayDidRefreshOnScrollingThread):
* page/scrolling/ThreadedScrollingTree.h:
2020-05-21 Sergio Villar Senin <svillar@igalia.com>
[css-grid] [css-flex] Width of table as grid/flex item is infinite when the sum of columns' width exceed 100%
https://bugs.webkit.org/show_bug.cgi?id=191365
Reviewed by Manuel Rego Casasnovas.
Automatic table layout algorithm generates infinite width tables
(tableMaxWidth to be more exact) when the sum of the columns percentages
exceed the 100% value and there is at least one non-percentage based
column with positive width as in those cases it's impossible to fulfill
the table constrains. That should not be done in the case of the table
being a flex or a grid item because they both define new formatting
contexts.
Based on Blink's crrev.com/1095220 by <mstensho@chromium.org>
* rendering/AutoTableLayout.cpp:
(WebCore::shouldScaleColumnsForParent): return false when the table is
either a grid or a flex item.
2020-05-21 Zalan Bujtas <zalan@apple.com>
[ macOS debug ] REGRESSION: fast/layoutformattingcontext/table-basic-row-baseline-with-nested-table.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=212139
<rdar://problem/63447683>
Reviewed by Antti Koivisto.
Uninitialized row baseline value caused unexpected cell height in nested tables.
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::setUsedGeometryForRows):
* layout/tableformatting/TableGrid.h:
2020-05-21 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Collapse in-between cell borders
https://bugs.webkit.org/show_bug.cgi?id=212183
Reviewed by Antti Koivisto.
This patch expands border collapsing to in-between cell borders.
Test: fast/layoutformattingcontext/table-simple-border-collapse3.html
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutCell):
* layout/tableformatting/TableFormattingContext.h:
* layout/tableformatting/TableFormattingContextGeometry.cpp:
(WebCore::Layout::TableFormattingContext::Geometry::computedCellBorder const):
(WebCore::Layout::TableFormattingContext::Geometry::intrinsicWidthConstraintsForCell):
2020-05-21 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][GTK][WPE] Expose and honor the media content types requiring hardware support setting
https://bugs.webkit.org/show_bug.cgi?id=211950
Reviewed by Adrian Perez de Castro.
Provide the needed information about media content types requiring hardware support
when asking the MediaPlayer about what types are supported. This was already being done
from HTMLMediaElement for player selection, but not in MediaSource nor in
MediaSource::addSourceBuffer() when the webpage used the MSE API to check type support.
In order to ask for the mediaContentTypesRequiringHardwareSupport setting we need a
reference to the current Document in all the places where we need to check type support.
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::addSourceBuffer): Provide hardware content types extra info.
(WebCore::MediaSource::isTypeSupported): Get hardware content types extra info from
ScriptExecutionContext and provide it to a new refactored private version of
isTypeSupported() which can also be reused from addSourceBuffer().
* Modules/mediasource/MediaSource.h: Changed isTypeSupported() prototype to take
ScriptExecutionContext and added a new overloaded version of the method.
* Modules/mediasource/MediaSource.idl: isTypeSupported() now provides a reference to
ScriptExecutionContext. It's the only way to access the required document settings from a
static method.
* platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::isContentTypeSupported const): Factor ContentType
discrimination logic common to MediaPlayerPrivateGStreamer and
MediaPlayerPrivateGStreamerMSE.
* platform/graphics/gstreamer/GStreamerRegistryScanner.h: Added new method.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::supportsType): Provide hardware content types extra
info when asking for type support.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsType): Ditto.
2020-05-20 Simon Fraser <simon.fraser@apple.com>
[macOS] Scrolling synchronization part 1: Have the scrolling thread wait half a frame for the main thread to complete the rendering update
https://bugs.webkit.org/show_bug.cgi?id=212168
Reviewed by Tim Horton.
Currently the scrolling thread is a free-running thread that moves layers around in response
to wheel events, and asynchronously posts data about scrolled layers back to the main thread.
That results in an almost guaranteed lack of synchronization between the displayed layer
positions, and the web-exposed values for scroll position (element.scrollTop, window.pageYOffset etc).
This is a frequent source of stuttering or jumpy web content when scrolling.
The first step to fixing this is to synchronize the scrolling thread layer positions
and the main thread state for the case where the main thread is responsive enough to
render once per frame. This is achieved as follow:
- When the main thread is starting a rendering update, Page::updateRendering() informs
the scrolling tree via ScrollingCoordinatorMac::willStartRenderingUpdate(). This
atomically waits for the scrolling thread to take the m_treeMutex (via a BinarySemaphore)
and starts waiting on the m_stateCondition Condition. Now the main thread pulls the
state of the scrolling tree via synchronizeStateFromScrollingTree() and uses it for
the rendering update.
- If the rendering update finishes within half a frame (8ms), then m_stateCondition
is released, and the scrolling thread assumes that the main thread is going to
commit layers rapidly enough to preserve 60fps scrolling.
- If the rendering update takes too long, m_stateCondition times out, and the scrolling
thread applies layer positions, triggering a CA commit on that thread.
We no longer apply layer positions directly when handling wheel events.
synchronizeStateFromScrollingTree() has to only pull state from nodes that have moved on the scrolling thread,
so track that via ScrollingTreeScrollingNode::scrolledSinceLastCommit() and adjust the visitor function to
make it available during scrolling tree traversal.
* page/Page.cpp:
(WebCore::Page::updateRendering):
(WebCore::Page::finalizeRenderingUpdate):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::synchronizeStateFromScrollingTree):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::willStartRenderingUpdate):
(WebCore::ScrollingCoordinator::didCompleteRenderingUpdate):
(WebCore::ScrollingCoordinator::synchronizeStateFromScrollingTree): Deleted.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
(WebCore::ScrollingTree::traverseScrollingTreeRecursive):
(WebCore::ScrollingTree::commitTreeState):
(WebCore::ScrollingTree::updateTreeFromStateNodeRecursive):
(WebCore::ScrollingTree::applyLayerPositionsInternal):
(WebCore::ScrollingTree::nominalFramesPerSecond):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeNode.h:
(WebCore::ScrollingTreeNode::didCompleteCommitForNode):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::didCompleteCommitForNode):
(WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::willStartRenderingUpdate):
(WebCore::ThreadedScrollingTree::maxAllowableRenderingUpdateDurationForSynchronization):
(WebCore::ThreadedScrollingTree::waitForRenderingUpdateCompletionOrTimeout):
(WebCore::ThreadedScrollingTree::didCompleteRenderingUpdate):
(WebCore::ThreadedScrollingTree::displayDidRefreshOnScrollingThread):
* page/scrolling/ThreadedScrollingTree.h:
(WebCore::ThreadedScrollingTree::treeMutex):
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::willStartRenderingUpdate):
(WebCore::ScrollingCoordinatorMac::didCompleteRenderingUpdate):
2020-05-20 Chris Fleizach <cfleizach@apple.com>
REGRESSION (iOS 13.4.1): SpeechSynthesisUtterance.onend event won't fire on cancel().
https://bugs.webkit.org/show_bug.cgi?id=211776
<rdar://problem/63130249>
Reviewed by Per Arne Vollan.
With the move to having speech synthesis happen in the client, the cancel case hits a snag.
We cancel the speech job and clear out the current utterance. By the time the cancel callback comes back,
the current utterance is gone and nothing happens.
The fix is to process the speechError event immediately and not wait on the speech synthesizer -- which seems sane,
since we're just cancelling a speech job.
* Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::cancel):
2020-05-20 Darin Adler <darin@apple.com>
Dictation context should be an object identifier, not a type-punned pointer
https://bugs.webkit.org/show_bug.cgi?id=212174
Reviewed by Anders Carlsson.
* Headers.cmake: Added DictationContext.h.
* Sources.txt: Removed DictationAlternative.cpp.
* WebCore.xcodeproj/project.pbxproj: Added DictationContext.h, removed DictationAlternative.cpp.
* dom/DocumentMarker.h: Use DictationContext instead of uint64_t.
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::timerFired): Ditto.
* editing/AlternativeTextController.h: Ditto.
* editing/DictationAlternative.h: Use DictationContext instead of uint64_t, but also
use CharacterRange rather than two "unsigned" values. Also convert into a simple
struct without constructors; don't really need those.
* editing/DictationAlternative.cpp: Removed.
* editing/DictationCommand.cpp:
(WebCore::DictationCommand::collectDictationAlternativesInRange): Updated for
changes to DictationAlternative.
* editing/DictationContext.h: Added.
* editing/Editor.h: Forward declare DictationAlternative rather than including
its header.
* editing/cocoa/AlternativeTextContextController.h: Use a pair of maps to bind NSTextAlternatives
objects to object identifiers. Remove unnecessary explicit constructor and destructor. Also removed
unnecessary use of WTF_MAKE_FAST_ALLOCATED, since this is only used as a data member of another
class. Removed unused invalidContext constant.
* editing/cocoa/AlternativeTextContextController.mm: Removed the unneeded includes.
This file treats NSTextAlternatives as an opaque Objective-C type and so doesn't need
any details of that class.
(WebCore::AlternativeTextContextController::addAlternatives): Changed to return a
DictationContext and use two maps, using HashMap::ensure to avoid double hashing.
(WebCore::AlternativeTextContextController::alternativesForContext): Added a null check.
(WebCore::AlternativeTextContextController::removeAlternativesForContext): Ditto. Also
updated to remove from both maps.
(WebCore::AlternativeTextContextController::clear): Clear both maps.
* editing/cocoa/AlternativeTextUIController.h: Since this header is used only from Objective-C,
removed use of OBJC_CLASS. Put showAlternatives inside a macOS-specific block. Use DictationContext
instead of uint64_t.
* editing/cocoa/AlternativeTextUIController.mm:
(WebCore::AlternativeTextUIController::addAlternatives): Use DictationContext instead of uint64_t.
(WebCore::AlternativeTextUIController::alternativesForContext): Ditto.
(WebCore::AlternativeTextUIController::showAlternatives): Ditto.
(WebCore::AlternativeTextUIController::handleAcceptedAlternative): Ditto.
(WebCore::AlternativeTextUIController::removeAlternatives): Ditto.
* page/AlternativeTextClient.h: Use DictationContext instead of uint64_t.
2020-05-20 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Preferred width computation should take border collapsing into account
https://bugs.webkit.org/show_bug.cgi?id=212141
Reviewed by Antti Koivisto.
Test: fast/layoutformattingcontext/table-simple-border-collapse2.html
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns):
* layout/tableformatting/TableFormattingContext.h:
(WebCore::Layout::TableFormattingContext::Geometry::Geometry):
* layout/tableformatting/TableFormattingContextGeometry.cpp:
(WebCore::Layout::TableFormattingContext::Geometry::intrinsicWidthConstraintsForCell):
2020-05-20 Zalan Bujtas <zalan@apple.com>
Repaint issues when the login field collapses on music.apple.com
https://bugs.webkit.org/show_bug.cgi?id=212101
<rdar://problem/62874369>
Reviewed by Simon Fraser.
RenderWidgets (e.g iframe) are painted on integral pixel boundaries. When we issue the repaints on such renderers, we need to
make sure that the repaint rectangles are also snapped to integral pixel values.
Currently trunk only covers the case when the renderer itself is positioned on a subpixel position (e.g when the containing block's content box has a non-integral position value).
This patch ensures that we repaint the RenderWidgets properly when a non-direct ancestor puts the renderer on a subpixel position.
Test: fast/repaint/iframe-on-subpixel-position.html
* page/FrameView.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeVisibleRectInContainer const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::setContentsNeedDisplay):
(WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
* rendering/RenderObject.h:
* testing/Internals.cpp:
(WebCore::Internals::enableSubframeRepaintTracking): add subframe repaint tracking
(WebCore::Internals::disableSubframeRepaintTracking):
* testing/Internals.h:
* testing/Internals.idl:
2020-05-20 Oriol Brufau <obrufau@igalia.com>
Computed min-width/height for auto depends on box
https://bugs.webkit.org/show_bug.cgi?id=209651
Reviewed by Manuel Rego Casasnovas.
Resolved value of min-width and min-height for auto min sizing of flex
and grid items may be 'auto'. We based this on the computed style of the
shadow including parent. Instead we should rely on whether the element
will actually be a rendered flex/grid item.
The difference matters e.g. when the parent has 'display: contents' and
thus is not a flex nor grid container, but the element can still be a
flex or grid item, depending on the grand-parent.
This patch is based on https://crrev.com/540901 from Chromium.
Tests: imported/w3c/web-platform-tests/css/css-flexbox/getcomputedstyle/flexbox_computedstyle_min-auto-size.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-min-auto-size-001.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::isFlexOrGridItem):
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
2020-05-20 Alex Christensen <achristensen@webkit.org>
Remove implicit URL->String conversion operators
https://bugs.webkit.org/show_bug.cgi?id=211033
Reviewed by Darin Adler.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::stringValueForMSAA const):
* html/DOMURL.cpp:
(WebCore::DOMURL::create):
* html/HTMLPlugInElement.cpp:
(WebCore::pluginReplacementForType):
* html/URLUtils.h:
(WebCore::URLUtils<T>::protocol const):
(WebCore::URLUtils<T>::setUsername):
(WebCore::URLUtils<T>::setPassword):
* page/Location.cpp:
(WebCore::Location::setProtocol):
(WebCore::Location::setHost):
(WebCore::Location::setHostname):
(WebCore::Location::setPort):
(WebCore::Location::setPathname):
(WebCore::Location::setSearch):
(WebCore::Location::setHash):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::load):
2020-05-20 Sam Weinig <weinig@apple.com>
Replace Color::getHSL() with sRGBToHSL to ensure it at least gives somewhat sensible results for ExtendedColors and reduce code duplication
https://bugs.webkit.org/show_bug.cgi?id=212143
Reviewed by Simon Fraser.
- Updated API tests to test sRGBToHSL() rather than Color::getHSL() and extended the tests
to include lightness tests and round tripping tests.
- Update editing/pasteboard/paste-dark-mode-color-filtered.html with extended color test cases.
Replaces Color::getHSL() with sRGBToHSL(color.toSRGBAComponentsLossy()) and adds
an optimized variant, lightness(...) that just extracts the lightness component for
callers that only needed that.
It is now required to explicitly use color.toSRGBAComponentsLossy() to indicate that
for non-SRGB colors, this will be a lossy transformation and give us an easy way to
find all these sites in the future, if we want to make a better conversion for other
color spaces.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::fragmentNeedsColorTransformed):
Switch to using lightness(). This was previously broken for extended colors but now works (though
in a lossy way through sRGB). Update editing/pasteboard/paste-dark-mode-color-filtered.html with extended colors.
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::detectContentInRange):
Switch to using sRGBToHSL(color.toSRGBAComponentsLossy()).
* page/FrameView.cpp:
(WebCore::FrameView::recalculateScrollbarOverlayStyle):
Switch to using lightness().
* platform/graphics/Color.cpp:
(WebCore::Color::getHSL const): Deleted.
* platform/graphics/Color.h:
Remove Color::getHSL().
* platform/graphics/ColorUtilities.cpp:
(WebCore::lightness):
Added optimized subset of sRGBToHSL which just computes the lightness component for callers
that only need that.
(WebCore::sRGBToHSL):
Simplify/cleanup code a little using initialize-list based std::max/std::min and structured bindings.
* platform/graphics/ColorUtilities.h:
Export functions to allow testing them directly.
2020-05-20 Megan Gardner <megan_gardner@apple.com>
Hide password echo when screen is being captured.
https://bugs.webkit.org/show_bug.cgi?id=212060
<rdar://problem/47653578>
Reviewed by Wenson Hsieh.
When the screen is being captured, turn off the password echo.
* editing/InsertIntoTextNodeCommand.cpp:
(WebCore::InsertIntoTextNodeCommand::doApply):
* page/EditorClient.h:
(WebCore::EditorClient::isScreenCaptured const):
2020-05-20 ChangSeok Oh <changseok@webkit.org>
[GTK] Implement connected and disconnected events of GAMEPAD API with libmanette
https://bugs.webkit.org/show_bug.cgi?id=133854
Reviewed by Carlos Garcia Campos.
This patch brings initial GAMEPAD API support to the gtk port. We use libmanette,
a simple GObject game controller library to handle gamepad connection and input.
This change aims to implement two GAMEPAD API events: 'gamepadconnected' and 'gamepaddisconnected'
on top of libmanette. Rest of API will be implemented by following patches.
No new tests since existing tests can cover this change.
* PlatformGTK.cmake: Add header & library paths for libmanette.
* SourcesGTK.txt:
* platform/gamepad/manette/GUniquePtrManette.h: Added to define a smart pointer for ManetteMonitor.
* platform/gamepad/manette/ManetteGamepad.cpp: Added. A wrapper class for ManetteDevice.
A ManetteGamepad instance is created per a physically connected gamepad. Currently,
it is empty but input handling login will be placed in this class.
(WebCore::ManetteGamepad::ManetteGamepad):
* platform/gamepad/manette/ManetteGamepad.h: Added.
* platform/gamepad/manette/ManetteGamepadProvider.cpp: Added. A manager class
for ManetteGamepad instances. This class represents ManetteMonitor that
handles connection and disconnection of gamepads. Many parts of this class implementation
is brought from HIDGamepad.cpp
(WebCore::ManetteGamepadProvider::singleton):
(WebCore::onDeviceConnected):
(WebCore::onDeviceDisconnected):
(WebCore::ManetteGamepadProvider::ManetteGamepadProvider):
(WebCore::ManetteGamepadProvider::startMonitoringGamepads):
(WebCore::ManetteGamepadProvider::stopMonitoringGamepads):
(WebCore::ManetteGamepadProvider::deviceConnected):
(WebCore::ManetteGamepadProvider::deviceDisconnected):
(WebCore::ManetteGamepadProvider::indexForNewlyConnectedDevice):
(WebCore::ManetteGamepadProvider::connectionDelayTimerFired):
(WebCore::ManetteGamepadProvider::removeGamepadForDevice):
* platform/gamepad/manette/ManetteGamepadProvider.h: Added.
2020-05-20 Antoine Quint <graouts@apple.com>
Potential crash in PointerCaptureController::cancelPointer()
https://bugs.webkit.org/show_bug.cgi?id=208347
<rdar://problem/59866247>
Reviewed by David Kilzer and Daniel Bates.
* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::cancelPointer):
2020-05-20 Oriol Brufau <obrufau@igalia.com>
[css-grid] Fix auto repeat with multiple tracks and gutters
https://bugs.webkit.org/show_bug.cgi?id=182922
Reviewed by Manuel Rego Casasnovas.
The code that computes the number of auto repeat tracks wrongly assumes
that the second argument of the repeat() notation is a single track
function. That was true in the beginning, however specs were later on
modified to allow a <track-list>. We support a <track-list> as a second
argument since long ago but the code that computes the number of
auto-repeat tracks was never updated.
This patch modifies two places that relate to the gaps between the
auto-repeat tracks, which ensures the proper total length.
This is a port of https://crrev.com/620278 from Chromium.
Tests: fast/css-grid-layout/grid-auto-repeat-huge-grid.html
imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-multiple-values-001.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeAutoRepeatTracksCount const):
2020-05-20 Simon Fraser <simon.fraser@apple.com>
Plumb the display's nominal refresh rate down to ScrollingTree for use in scroll synchronization
https://bugs.webkit.org/show_bug.cgi?id=212159
Reviewed by Tim Horton.
Plumb an Optional<unsigned> down windowScreenDidChange, which contains the nominal
display refresh rate (as frames per second) if available. On macOS, we get this
from CVDisplayLinkGetNominalOutputVideoRefreshPeriod().
To read it, WebProcessPool::nominalFramesPerSecondForDisplay() makes a DisplayLink
that doesn't get any observers, but that DisplayLink will very likely get used
as soon as we schedule a rendering update.
* page/Chrome.cpp:
(WebCore::Chrome::windowScreenDidChange):
* page/Chrome.h:
* page/Page.cpp:
(WebCore::Page::scrollingCoordinator):
(WebCore::Page::windowScreenDidChange):
* page/Page.h:
(WebCore::Page::displayNominalFramesPerSecond const):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::windowScreenDidChange):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::windowScreenDidChange):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::windowScreenDidChange):
* page/scrolling/ScrollingTree.h:
* platform/HostWindow.h:
2020-05-20 Chris Dumez <cdumez@apple.com>
Disable support for BeforeLoadEvent
https://bugs.webkit.org/show_bug.cgi?id=212140
<rdar://problem/62847577>
Reviewed by Antti Koivisto.
Disable support for BeforeLoadEvent. Other browsers do not support it and
Chrome dropped it shortly after the fork:
- https://bugs.chromium.org/p/chromium/issues/detail?id=333318
This is a synchronous event and therefore very dangerous.
Test: fast/frames/didBecomeCurrentDocumentInFrame-crash.html
* bindings/js/WebCoreBuiltinNames.h:
* dom/BeforeLoadEvent.idl:
* dom/Node.cpp:
(WebCore::Node::dispatchBeforeLoadEvent):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setLegacyBeforeLoadEventEnabled):
(WebCore::RuntimeEnabledFeatures::legacyBeforeLoadEventEnabled const):
2020-05-20 Zalan Bujtas <zalan@apple.com>
RenderObject::VisibleRectContext members should not be prefixed with m_
https://bugs.webkit.org/show_bug.cgi?id=212154
Reviewed by Simon Fraser.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::applyCachedClipAndScrollPosition const):
(WebCore::RenderBox::computeVisibleRectInContainer const):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::computeVisibleRectInContainer const):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::computeVisibleRectInContainer const):
* rendering/RenderObject.h:
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computeVisibleRectInContainer const):
* rendering/RenderView.cpp:
(WebCore::RenderView::computeVisibleRectInContainer const):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::computeFloatVisibleRectInContainer const):
2020-05-20 Myles C. Maxfield <mmaxfield@apple.com>
[iPadOS] -webkit-text-size-adjust:percentage doesn't work
https://bugs.webkit.org/show_bug.cgi?id=212122
<rdar://problem/54560875>
Reviewed by Wenson Hsieh.
We've gotten many bug reports that -webkit-text-size-adjust:X% no longer works in
WebKit on iPads. We don't want to just start honoring the value, because our
testing indicates that, with desktop-class browsing on iPad, more sites work better
when we don't honor percentages. However, if Safari is using the mobile content mode,
or if a native app has local content, it should be possible to get the old behavior
of honoring percentages.
This patch adds a new Setting, idempotentModeAutosizingOnlyHonorsPercentages, which
is hooked up to the desktop-class browsing feature. When
WebPageProxy::effectiveContentModeAfterAdjustingPolicies() determines that the
WebContentMode::Mobile mode should be used, it sets the new setting, which
causes idempotent text autosizing mode to have the same behavior that WKWebViews
on iPadOS used to have: -w-t-s-a:auto and -w-t-s-a:none have no effect, but
-w-t-s-a:X% is honored. This affects both Safari and WKWebView apps.
If a native app wants the old behavior, they can set
WKWebpagePreferences.preferredContentMode = WKContentModeMobile to force the old
iPad behavior. It's expected that apps with legacy content would be doing this
anyway.
Tests: fast/text-autosizing/ios/idempotentmode/idempotent-percentage.html
TestWebKitAPI.PreferredContentMode.IdempotentModeAutosizingOnlyHonorsPercentages
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::applyPoliciesToSettings):
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setIdempotentModeAutosizingOnlyHonorsPercentages):
(WebCore::DocumentLoader::idempotentModeAutosizingOnlyHonorsPercentages const):
* page/Settings.yaml:
* style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjustmentForTextAutosizing):
* style/StyleBuilderCustom.h:
(WebCore::Style::computeBaseSpecifiedFontSize):
* style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::updateFontForTextSizeAdjust):
2020-05-20 ChangSeok Oh <changseok@webkit.org>
Move the TextStream logging definition in VisibleSelection.cpp to the outside of the TREE_DEBUGGING guard
https://bugs.webkit.org/show_bug.cgi?id=212127
Reviewed by Simon Fraser.
A linking failure occurs after r261819 where ENABLE_TREE_DEBUGGING is disabled.
The TextStream logging defining is placed inside the guard while its declaration is not since r218976.
Build fix, no functionality changed.
* editing/VisibleSelection.cpp:
(WebCore::operator<<):
2020-05-20 Andres Gonzalez <andresg_22@apple.com>
Fix for accessibility-node-memory-management.html in isolated tree mode.
https://bugs.webkit.org/show_bug.cgi?id=212142
Reviewed by Chris Fleizach.
LayoutTests/accessibility/accessibility-node-memory-management.html.
- Fix in applyPendingChanges that was not removing removed nodes from
the nodes map. This was causing that some detached AXIsolatedObjects
were being returned.
- Also handle the case where pending changes can come from a detached
AXObject with invalid ID and no platform wrapper.
- updateChildren better handles the case when the notification target
is not in the isolated tree by walking up the object hierarchy until it
finds an associated object that does have a corresponding isolated object.
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::treeForPageID):
(WebCore::AXIsolatedTree::updateChildren):
(WebCore::AXIsolatedTree::applyPendingChanges):
2020-05-20 Antoine Quint <graouts@apple.com>
[Web Animations] Animation engine should not wake up every tick for steps timing functions
https://bugs.webkit.org/show_bug.cgi?id=212103
<rdar://problem/62737868>
Unreviewed. Clean up some stray FIXMEs mistakenly commited in the previous commit.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSTransitionsForElementAndProperty):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
2020-05-20 Antoine Quint <graouts@apple.com>
[Web Animations] Animation engine should not wake up every tick for steps timing functions
https://bugs.webkit.org/show_bug.cgi?id=212103
<rdar://problem/62737868>
Reviewed by Simon Fraser.
Tests: webanimations/scheduling-of-animation-with-steps-timing-function-on-effect.html
webanimations/scheduling-of-animation-with-steps-timing-function-on-keyframe.html
webanimations/scheduling-of-css-animation-with-explicit-steps-timing-function-on-some-keyframes.html
webanimations/scheduling-of-css-animation-with-implicit-steps-timing-function.html
When an animation uses a steps() timing function, it will appear to animate discretely between values such
that there is only n visual changes, where n is the number of steps provided. This gives us an opportunity
to be more efficient when scheduling animations using steps() timing functions.
In WebAnimation::timeToNextTick() we now ask the associated effect for the amount of progress until the next
step. For an effect-wide steps() timing function, we can use the provided iteration progress. For animations
with a linear effect-wide timing function (the default), we have to map the provided iteration progress to
a keyframe interval, provided that interval uses a steps() timing function.
The new {Animation|Keyframe}Effect::progressUntilNextStep() method returns WTF::nullopt for any other case.
In order to test this, we add a new internals.timeToNextAnimationTick(animation) method which we use in the
two new tests.
* animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::progressUntilNextStep const):
* animation/AnimationEffect.h:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::setBlendingKeyframes):
(WebCore::KeyframeEffect::computeSomeKeyframesUseStepsTimingFunction):
(WebCore::KeyframeEffect::timingFunctionForKeyframeAtIndex const): Avoid any out-of-bounds use of the underlying data
structures by returning nullptr for cases where we don't have an explicit keyframe. We also make the function const
such that it may be called from progressUntilNextStep(), it always was const but wasn't marked as such.
(WebCore::KeyframeEffect::progressUntilNextStep const):
* animation/KeyframeEffect.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::timeToNextTick const):
* animation/WebAnimation.h:
* animation/WebAnimation.idl:
* testing/Internals.cpp:
(WebCore::Internals::timeToNextAnimationTick const):
* testing/Internals.h:
* testing/Internals.idl:
2020-05-20 Noam Rosenthal <noam@webkit.org>
Fix table sizing when 'max-width' is used
https://bugs.webkit.org/show_bug.cgi?id=115156
Reviewed by Zalan Bujtas.
Based on previous patch by László Langó <lango@inf.u-szeged.hu>
Test: fast/table/html-table-width-max-width-constrained.html
A table should always be wide enough to contain its content (preferred logical width).
This constraint should be stronger than the table style's specified min-width/width.
The behavior matches the spec, and behavior on Firefox/Chrome.
* rendering/RenderTable.cpp:
(WebCore::RenderTable::updateLogicalWidth):
Max-width should only affect the table's max preferred width.
(WebCore::RenderTable::computePreferredLogicalWidths):
Change the order of constraints so that content constraint is stronger than style width/max-width constraint.
2020-05-20 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r261554): [GTK] Version 2.29.1 crashes using drag-n-drop API
https://bugs.webkit.org/show_bug.cgi?id=212136
Reviewed by Adrian Perez de Castro.
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::read): Use m_selectionData if present.
2020-05-20 Philippe Normand <pnormand@igalia.com>
[GStreamer] <img> tag needs to support video formats
https://bugs.webkit.org/show_bug.cgi?id=180370
Reviewed by Xabier Rodriguez-Calvar.
GStreamer implementation of the ImageDecoder. It currently doesn't support zero-copy
rendering though due to the the NativeImagePtr requirement.
* platform/GStreamer.cmake:
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::isSupportedImageVideoOrSVGMIMEType):
* platform/graphics/ImageDecoder.cpp:
(WebCore::ImageDecoder::create):
(WebCore::ImageDecoder::supportsMediaType):
* platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: Added.
(WebCore::toSample):
(WebCore::ImageDecoderGStreamer::create):
(WebCore::ImageDecoderGStreamer::ImageDecoderGStreamer):
(WebCore::ImageDecoderGStreamer::supportsContainerType):
(WebCore::ImageDecoderGStreamer::canDecodeType):
(WebCore::ImageDecoderGStreamer::encodedDataStatus const):
(WebCore::ImageDecoderGStreamer::size const):
(WebCore::ImageDecoderGStreamer::repetitionCount const):
(WebCore::ImageDecoderGStreamer::uti const):
(WebCore::ImageDecoderGStreamer::frameOrientationAtIndex const):
(WebCore::ImageDecoderGStreamer::frameDurationAtIndex const):
(WebCore::ImageDecoderGStreamer::frameHasAlphaAtIndex const):
(WebCore::ImageDecoderGStreamer::frameBytesAtIndex const):
(WebCore::ImageDecoderGStreamer::createFrameImageAtIndex):
(WebCore::ImageDecoderGStreamer::setData):
(WebCore::ImageDecoderGStreamer::clearFrameBufferCache):
(WebCore::ImageDecoderGStreamer::sampleAtIndex const):
(WebCore::ImageDecoderGStreamer::InnerDecoder::decodebinPadAddedCallback):
(WebCore::ImageDecoderGStreamer::InnerDecoder::connectDecoderPad):
(WebCore::ImageDecoderGStreamer::handleSample):
(WebCore::ImageDecoderGStreamer::InnerDecoder::handleMessage):
(WebCore::ImageDecoderGStreamer::InnerDecoder::preparePipeline):
(WebCore::ImageDecoderGStreamer::InnerDecoder::run):
(WebCore::ImageDecoderGStreamer::InnerDecoder::encodedDataStatus const):
(WebCore::ImageDecoderGStreamer::pushEncodedData):
* platform/graphics/gstreamer/ImageDecoderGStreamer.h: Added.
* platform/graphics/gstreamer/ImageGStreamer.h:
(WebCore::ImageGStreamer::createImage):
(WebCore::ImageGStreamer::image):
(WebCore::ImageGStreamer::setCropRect):
(WebCore::ImageGStreamer::rect):
(WebCore::ImageGStreamer::hasAlpha const):
* platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
(WebCore::ImageGStreamer::ImageGStreamer):
* platform/graphics/gstreamer/MediaSampleGStreamer.h:
2020-05-20 Andy Estes <aestes@apple.com>
[Mac] UI processes spin when creating the "Share" context menu item
https://bugs.webkit.org/show_bug.cgi?id=212137
<rdar://problem/54498394>
Reviewed by Wenson Hsieh.
Ran update-webkit-localizable-strings.
* en.lproj/Localizable.strings:
2020-05-20 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Internal table boxes should take collapsed border into account
https://bugs.webkit.org/show_bug.cgi?id=212135
Reviewed by Antti Koivisto.
Use the collapsed border value to compute the borders for sections, rows and cells.
The collapsed border is propagated to the table box and the adjacent cell boxes.
Test: fast/layoutformattingcontext/table-simple-border-collapse.html
* layout/LayoutUnits.h:
(WebCore::Layout::operator/):
* layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp:
(WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::setUsedGeometryForRows):
(WebCore::Layout::TableFormattingContext::setUsedGeometryForSections):
(WebCore::Layout::TableFormattingContext::layoutCell):
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::setCollapsedBorder):
(WebCore::Layout::TableGrid::collapsedBorder const):
2020-05-20 Youenn Fablet <youenn@apple.com>
[Mac] Use preferedPixelBufferFormat for AVVideoCaptureSource
https://bugs.webkit.org/show_bug.cgi?id=212071
Reviewed by Eric Carlson.
Manually tested.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::avVideoCapturePixelBufferFormat):
2020-05-20 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix GTK4 build with GTK 3.98.4
* platform/gtk/GtkUtilities.cpp:
(WebCore::convertWidgetPointToScreenPoint):
* platform/gtk/GtkVersioning.h:
(gtk_widget_destroy):
* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::screenDPI):
2020-05-12 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK4] Add support for drag and drop operations
https://bugs.webkit.org/show_bug.cgi?id=211779
Reviewed by Adrian Perez de Castro.
Move the code to create a GdkTexture from an Image from CursorGtk to ImageGtk and add Image::gdkTexture().
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:
(WebCore::Image::gdkTexture):
* platform/graphics/gtk/ImageGtk.cpp:
(WebCore::BitmapImage::gdkTexture):
* platform/gtk/CursorGtk.cpp:
(WebCore::createCustomCursor):
2020-05-20 Sam Weinig <weinig@apple.com>
Remove unused Color::getHSV function
https://bugs.webkit.org/show_bug.cgi?id=212119
Reviewed by Simon Fraser.
* platform/graphics/Color.cpp:
(WebCore::Color::getHSV const): Deleted.
* platform/graphics/Color.h:
Remove Color::getHSV(). It was unused outside of the API test for it.
2020-05-20 Youenn Fablet <youenn@apple.com>
Allow calling VideoSampleObserver::videoSampleAvailable from a background thread
https://bugs.webkit.org/show_bug.cgi?id=212024
Reviewed by Eric Carlson.
Allow RealtimeMediaSource::videoSampleAvailable to be called on a background thread, typically the capture thread.
Make WebRTC remote sources and mock capture sources do that.
RealtimeMediaSource is then updating its intrinsic size from the generation thread while updating its size in the main thread.
The size() getter can be called from both threads.
Existing consumers do the following:
- media player will hop to the main thread.
- media recorder will do processing from the background thread.
- WebRTC sender will do processing from the background thread, except when sending black frames where this will still be done on the main thread.
This is ok as we ensure either we send black frames on the main thread (and we do not observe the source) or we observe the source to send.
Follow-ups will migrate the real capture sources as well as migrating media player processing out of the main thread.
Covered by existing tests.
* platform/MediaSample.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoSampleAvailable):
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::videoSampleAvailable):
(WebCore::RealtimeMediaSource::setIntrinsicSize):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac):
(WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
(WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample): Deleted.
2020-05-20 Oriol Brufau <obrufau@igalia.com>
Fix computeMarginLogicalSizeForChild to check auto margins in the right axis
https://bugs.webkit.org/show_bug.cgi?id=212113
Reviewed by Manuel Rego Casasnovas.
GridLayoutFunctions::computeMarginLogicalSizeForChild checks for 'auto'
margins before retrieving the margin size, since these should be treated
as 0. However, for orthogonal grid items, it used to check the wrong axis.
So if an item had 'margin-top: auto' and 'margin-left: 5px', when asking
for the horizontal margin we could get 0px instead of 5px due to the
auto margin in the vertical axis.
Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-minimum-width-orthogonal-001.html
* rendering/GridLayoutFunctions.cpp:
(WebCore::GridLayoutFunctions::computeMarginLogicalSizeForChild):
(WebCore::GridLayoutFunctions::marginLogicalSizeForChild):
2020-05-19 Fujii Hironori <Hironori.Fujii@sony.com>
[WinCairo] ASSERT(m_eglDisplay == EGL_NO_DISPLAY) fails in ~PlatformDisplay()
https://bugs.webkit.org/show_bug.cgi?id=212065
Reviewed by Don Olmstead.
PlatformDisplay destoys m_eglDisplay by using std::atexit to
ensure they are destructed before EGL's atexit handler (Bug 157973).
However, calling eglTerminate in atexit handler causes a
crash on Windows (Bug 145832, Bug 170331).
Then, r214688 added shutDownEglDisplays() and explicitly call it
in shutDownWebKit() to destory m_eglDisplay in Windows WebKit1.
However, Windows WebKit2 may call _exit() in IPC::Connection's
WorkQueue thread. It doesn't seem a good idea that explicitly
destructing m_eglDisplay by calling shutDownEglDisplays().
Remove shutDownEglDisplays() and the assertion for Windows.
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::~PlatformDisplay): Conditioned out the
assertion for PLATFORM(WIN).
(WebCore::PlatformDisplay::initializeEGLDisplay): Restored the
original atexit handler of r201595.
(WebCore::PlatformDisplay::shutDownEglDisplays): Deleted.
* platform/graphics/PlatformDisplay.h:
2020-05-19 Darin Adler <darin@apple.com>
REGRESSION (r259930): Dictation marker at start of text is removed when added trailing whitespace is collapsed
https://bugs.webkit.org/show_bug.cgi?id=212093
Reviewed by Daniel Bates.
* dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::shiftMarkers): Use int to do the math before clamping to
unsigned. This protects against underflow.
2020-05-19 Sam Weinig <weinig@apple.com>
Remove almost always incorrect Color::getRGBA
https://bugs.webkit.org/show_bug.cgi?id=212059
Reviewed by Darin Adler and Simon Fraser.
Removes the awkward and almost always incorrect out parameter based Color::getRGBA. Most existing callsites
were updated to use Color::toSRGBAComponentsLossy() or other more ExtendedColor supporting functions (like
cachedCGColor()).
Also adds tuple-like adaptors for FloatComponents to allow it to be used
with structured bindings. For example:
auto [r, g, b, a] = myFloatComponents;
* platform/graphics/Color.h:
* platform/graphics/Color.cpp:
(WebCore::Color::light const):
(WebCore::Color::dark const):
(WebCore::Color::isDark const):
Adopt toSRGBAComponentsLossy() to make these not return totally incorrect values.
(WebCore::Color::colorSpaceAndComponents const):
Added. Returns a std::pair<ColorSpace, FloatComponents> for functions that need
to operate on the components in a ColorSpace aware way. Used by toSRGBAComponentsLossy
and leakCGColor() for now, but will be useful going forward as well.
(WebCore::Color::toSRGBAComponentsLossy const):
Re-implement using colorSpaceAndComponents() to simplify implementation.
(WebCore::Color::getRGBA const): Deleted.
* platform/graphics/ColorUtilities.cpp:
(WebCore::FloatComponents::FloatComponents): Deleted.
(WebCore::sRGBColorToLinearComponents): Deleted.
* platform/graphics/ColorUtilities.h:
(WebCore::FloatComponents::get const):
Remove uses of the Color class to simplify inlining (Color.h already needs to know about
FloatComponents).
- FloatComponents constructor replaced by Color::toSRGBAComponentsLossy().
- sRGBColorToLinearComponents replaced by calling rgbToLinearComponents(color.toSRGBAComponentsLossy()).
Also adds std::tuple adaptors for FloatComponents to allow using with stuctured bindings.
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::HistoricMemoryCategoryInfo::HistoricMemoryCategoryInfo):
Replace getRGBA with cachedCGColor.
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::setBackgroundColor):
Replace getRGBA with cachedCGColor.
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
(PlatformCALayerWinInternal::setBorderColor):
Replace getRGBA with cachedCGColor.
* platform/graphics/cairo/CairoUtilities.cpp:
(WebCore::setSourceRGBAFromColor):
Replace getRGBA with toSRGBAComponentsLossy.
* platform/graphics/cairo/GradientCairo.cpp:
(WebCore::addColorStopRGBA):
(WebCore::setCornerColorRGBA):
(WebCore::interpolateColorStop):
Replace getRGBA with toSRGBAComponentsLossy.
* platform/graphics/cg/ColorCG.cpp:
(WebCore::leakCGColor):
(WebCore::cachedCGColor):
Simplify implementation (and remove use of getRGBA) by using colorSpaceAndComponents().
* platform/graphics/cg/GradientCG.cpp:
(WebCore::Gradient::platformGradient):
Replace getRGBA with colorSpaceAndComponent().
* platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::drawLighting):
Replace FloatComponents constructor taking a Color (which used getRGBA) with toSRGBAComponentsLossy.
* platform/graphics/filters/FilterOperations.cpp:
(WebCore::FilterOperations::transformColor const):
(WebCore::FilterOperations::inverseTransformColor const):
Replace getRGBA with toSRGBAComponentsLossy.
* platform/graphics/gtk/ColorGtk.cpp:
(WebCore::Color::operator GdkRGBA const):
Replace getRGBA with toSRGBAComponentsLossy.
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawBorder):
(WebCore::TextureMapperGL::drawNumber):
(WebCore::prepareFilterProgram):
(WebCore::TextureMapperGL::drawSolidColor):
Replace getRGBA with toSRGBAComponentsLossy.
* platform/graphics/win/GradientDirect2D.cpp:
(WebCore::Gradient::generateGradient):
Replace getRGBA with toSRGBAComponentsLossy.
* platform/graphics/win/GraphicsContextCGWin.cpp:
(WebCore::GraphicsContext::drawDotsForDocumentMarker):
(WebCore::setCGStrokeColor): Deleted.
(WebCore::spellingPatternColor): Deleted.
(WebCore::grammarPatternColor): Deleted.
Replace use of getRGBA with direct use of SimpleColor instead.
* rendering/TextPaintStyle.cpp:
(WebCore::textColorIsLegibleAgainstBackgroundColor):
Replace implicit FloatComponents construction taking a Color (which used getRGBA) with explicit toSRGBAComponentsLossy.
2020-05-19 Eric Carlson <eric.carlson@apple.com>
Update some media logging
https://bugs.webkit.org/show_bug.cgi?id=212109
Reviewed by Jer Noble.
No new tests, no functional change.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::insertedIntoAncestor):
(WebCore::HTMLMediaElement::didFinishInsertingNode):
(WebCore::HTMLMediaElement::removedFromAncestor):
(WebCore::HTMLMediaElement::checkPlaybackTargetCompatablity):
(WebCore::HTMLMediaElement::canPlayType const):
(WebCore::HTMLMediaElement::waitForSourceChange):
(WebCore::HTMLMediaElement::noneSupported):
(WebCore::HTMLMediaElement::mediaLoadingFailed):
(WebCore::HTMLMediaElement::fastSeek):
(WebCore::HTMLMediaElement::seek):
(WebCore::HTMLMediaElement::seekInternal):
(WebCore::HTMLMediaElement::seekTask):
(WebCore::HTMLMediaElement::finishSeek):
(WebCore::HTMLMediaElement::currentMediaTime const):
(WebCore::HTMLMediaElement::setPreload):
(WebCore::HTMLMediaElement::playInternal):
(WebCore::HTMLMediaElement::pauseInternal):
(WebCore::HTMLMediaElement::setLoop):
(WebCore::HTMLMediaElement::setControls):
(WebCore::HTMLMediaElement::setVolume):
(WebCore::HTMLMediaElement::setMuted):
(WebCore::HTMLMediaElement::hardwareMutedStateDidChange):
(WebCore::HTMLMediaElement::configureTextTrackGroup):
(WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
(WebCore::HTMLMediaElement::mediaPlayerVolumeChanged):
(WebCore::HTMLMediaElement::mediaPlayerMuteChanged):
(WebCore::HTMLMediaElement::mediaPlayerDurationChanged):
(WebCore::HTMLMediaElement::mediaPlayerRateChanged):
(WebCore::HTMLMediaElement::mediaPlayerPlaybackStateChanged):
(WebCore::HTMLMediaElement::mediaPlayerResourceNotSupported):
(WebCore::HTMLMediaElement::mediaPlayerSizeChanged):
(WebCore::HTMLMediaElement::mediaPlayerRenderingModeChanged):
(WebCore::HTMLMediaElement::mediaPlayerEngineUpdated):
(WebCore::HTMLMediaElement::mediaPlayerFirstVideoFrameAvailable):
(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
(WebCore::HTMLMediaElement::updatePlayState):
(WebCore::HTMLMediaElement::stop):
(WebCore::HTMLMediaElement::suspend):
(WebCore::HTMLMediaElement::resume):
(WebCore::HTMLMediaElement::visibilityStateChanged):
(WebCore::HTMLMediaElement::addEventListener):
(WebCore::HTMLMediaElement::removeEventListener):
(WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
(WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget):
(WebCore::HTMLMediaElement::remoteHasAvailabilityCallbacksChanged):
(WebCore::HTMLMediaElement::enterFullscreen):
(WebCore::HTMLMediaElement::exitFullscreen):
(WebCore::HTMLMediaElement::didBecomeFullscreenElement):
(WebCore::HTMLMediaElement::setClosedCaptionsVisible):
(WebCore::HTMLMediaElement::mediaCanStart):
(WebCore::HTMLMediaElement::setShouldDelayLoadEvent):
(WebCore::HTMLMediaElement::suspendPlayback):
(WebCore::HTMLMediaElement::resumeAutoplaying):
(WebCore::HTMLMediaElement::mayResumePlayback):
(WebCore::HTMLMediaElement::didReceiveRemoteControlCommand):
(WebCore::HTMLMediaElement::setBufferingPolicy):
(WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::setState):
(WebCore::PlatformMediaSession::beginInterruption):
(WebCore::PlatformMediaSession::endInterruption):
(WebCore::PlatformMediaSession::clientWillBeginAutoplaying):
(WebCore::PlatformMediaSession::clientWillBeginPlayback):
(WebCore::PlatformMediaSession::processClientWillPausePlayback):
(WebCore::PlatformMediaSession::clientWillPausePlayback):
(WebCore::PlatformMediaSession::clientWillBeDOMSuspended):
(WebCore::PlatformMediaSession::pauseSession):
(WebCore::PlatformMediaSession::stopSession):
(WebCore::PlatformMediaSession::didReceiveRemoteControlCommand):
2020-05-19 Daniel Bates <dabates@apple.com>
Blue dotted underline with alternatives only shown for last word, gets lost for previous insertions
https://bugs.webkit.org/show_bug.cgi?id=212097
<rdar://problem/61913405>
Reviewed by Darin Adler.
Fix up two cases, <space> is a literal ' ' and | is the position of the caret:
1. Space inserted after marker, here's what it looks like BEFORE insertion (i.e. endOfFirstWord == startOfSelection):
hello|
This case is detected when the end of the next word (relative to caret) would be at the start of the
word that begins before or on the caret.
2. Space inserted before marker, here's what it looks like BEFORE insertion (i.e. startOfLastWord == endOfSelection):
|hello
This case is detected when the end of the previous word (relative to caret) would be at the end of the
word that ends after or on the caret.
Note ^^^ example uses a caret, but code is slightly more general and works when the current selection
is a range. Though I didn't explicitly test that because my bug is specific to having a caret selection.
* editing/Editor.cpp:
(WebCore::Editor::insertTextWithoutSendingTextEvent): Do not remove markers if selection starts at the
beginning of a new word. This is detected by looking at the character before the selection start to see
if it is a space or newline. This will be false when there is no preceding character (e.g. start of document),
but that's OK because it doesn't matter what we pass to updateMarkersForWordsAffectedByEditing() - there's
no markers to remove anyway, let alone text for markers to exist in. I don't use isStartOfWord() here
because that would incorrectly return false if the current selection is at the end of a paragraph. I could have
fixed that up by checking isEndOfParagraph() as well, but isStartOfWord() + isEndOfParagraph() is less
efficient than just looking at the previous character directly. So, I did that instead.
(WebCore::Editor::updateMarkersForWordsAffectedByEditing): Save off the original end of the first word and
start of the last word positions before mutating them. Update early return checks to use these saved values
instead of comparing against the start and end of the current selection, which weren't correct. Saved positioned
are aligned by word, but start and end of current selection may NOT be. So, comparison was asymmetric: lhs was
word aligned position, but rhs may not be.
* editing/Editor.h: While I am here, fix up a param name to match what it is called in the .cpp.
* testing/Internals.cpp:
(WebCore::Internals::hasDictationAlternativesMarker): Added
* testing/Internals.h:
* testing/Internals.idl:
Add new functionality for testing purposes.
2020-05-19 Oriol Brufau <obrufau@igalia.com>
Fix marginLogicalSizeForChild to check auto margins in the right axis
https://bugs.webkit.org/show_bug.cgi?id=212055
Reviewed by Manuel Rego Casasnovas.
GridLayoutFunctions::marginLogicalSizeForChild checks for 'auto' margins
before retrieving the margin size, since these should be treated as 0.
However, for orthogonal grid items, it used to check the wrong axis.
So if an item had 'margin-top: auto' and 'margin-left: 5px', when asking
for the horizontal margin we could get 0px instead of 5px due to the
auto margin in the vertical axis.
Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-minimum-height-orthogonal-001.html
* rendering/GridLayoutFunctions.cpp:
(WebCore::GridLayoutFunctions::marginLogicalSizeForChild):
2020-05-19 Jacob Uphoff <jacob_uphoff@apple.com>
Unreviewed, reverting r261856.
This caused internal assertion failures.
Reverted changeset:
"Allow calling VideoSampleObserver::videoSampleAvailable from
a background thread"
https://bugs.webkit.org/show_bug.cgi?id=212024
https://trac.webkit.org/changeset/261856
2020-05-19 David Kilzer <ddkilzer@apple.com>
IDBRequestData and IDBClient::TransactionOperation should initialize IndexedDB::IndexRecordType field
<https://webkit.org/b/212096>
<rdar://problem/63406376>
Reviewed by Geoffrey Garen.
IDBRequestData tested by IPC::Decoder::decode() and
IPC::Encoder::operator<<() running on WebKit2 API and layout
tests.
* Modules/indexeddb/IndexedDB.h:
(WTF::EnumTraits<WebCore::IndexedDB::IndexRecordType>): Add.
* Modules/indexeddb/client/TransactionOperation.h:
(WebCore::IDBClient::TransactionOperation::m_indexRecordType):
- Add default initializer.
* Modules/indexeddb/shared/IDBRequestData.h:
(WebCore::IDBRequestData::m_indexRecordType):
- Add default initializer.
(WebCore::IDBRequestData::encode const):
(WebCore::IDBRequestData::decode):
- Switch from encodeEnum() and decodeEnum() to modern
equivalents that check for valid enum values.
2020-05-19 Simon Fraser <simon.fraser@apple.com>
Push a PlatformDisplayID to scrolling trees, and allow the scrolling thread to get displayDidRefresh notifications
https://bugs.webkit.org/show_bug.cgi?id=211034
Reviewed by Sam Weinig.
As work towards scrolling thread synchronization with main thread (webkit.org/b210884), allow
ScrollingTree to get a displayDidRefresh() call on the scrolling thread. Each
tree is associated with a Page which is associated with a display, so the ScrollingTree
needs to have a PlatformDisplayID to know which notifications to respond to.
Eventually, displayDidRefresh() will be used to trigger layer updates on the scrolling
thread if the main thread is periodically unresponsive.
* page/Page.cpp:
(WebCore::Page::scrollingCoordinator):
(WebCore::Page::windowScreenDidChange):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::windowScreenDidChange):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::windowScreenDidChange):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::windowScreenDidChange):
(WebCore::ScrollingTree::displayID):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::displayDidRefresh):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::displayDidRefresh):
* page/scrolling/ThreadedScrollingTree.h:
2020-05-19 Simon Fraser <simon.fraser@apple.com>
[iOS] Programmaic scroll of "scrolling=no" iframe fails
https://bugs.webkit.org/show_bug.cgi?id=212063
<rdar://problem/57049514>
Reviewed by Antti Koivisto.
ScrollView::setScrollPosition() calls requestScrollPositionUpdate(), and if this returns
false it relies on the confusingly-named updateScrollbars() to actually do the scroll.
This code path is hit for "scrolling=no" frames, which are not scroll-coordinated.
ScrollView::updateScrollbars() fails to set the scroll position on iOS, where managesScrollbars()
returns false, so fix that.
Test: fast/scrolling/progammatic-scroll-scrolling-no-frame.html
* platform/ScrollView.cpp:
(WebCore::ScrollView::updateScrollbars):
2020-05-19 Andy Estes <aestes@apple.com>
[Apple Pay] Add testing and logging for ApplePaySetup
https://bugs.webkit.org/show_bug.cgi?id=211972
<rdar://problem/63291965>
Reviewed by Alex Christensen.
Test: http/tests/ssl/applepay/ApplePaySetup.https.html
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/applepay/ApplePaySetup.cpp:
(WebCore::ApplePaySetup::getSetupFeatures):
(WebCore::ApplePaySetup::begin):
(WebCore::ApplePaySetup::ApplePaySetup):
(WebCore::ApplePaySetup::stop):
* Modules/applepay/ApplePaySetup.idl:
* Modules/applepay/ApplePaySetupConfiguration.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
* Modules/applepay/ApplePaySetupConfiguration.idl: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
* Modules/applepay/ApplePaySetupFeature.idl:
* Modules/applepay/ApplePaySetupFeature.mm:
(WebCore::ApplePaySetupFeature::state const):
* Modules/applepay/ApplePaySetupFeatureState.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
* Modules/applepay/ApplePaySetupFeatureState.idl: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
* Modules/applepay/ApplePaySetupFeatureType.idl:
* Modules/applepay/ApplePaySetupFeatureWebCore.h:
* Modules/applepay/ApplePaySetupWebCore.h:
(WebCore::ApplePaySetup::create):
* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::setApplePayIsActiveIfAllowed const):
(WebCore::PaymentCoordinator::getSetupFeatures):
(WebCore::PaymentCoordinator::beginApplePaySetup):
(WebCore::PaymentCoordinator::endApplePaySetup):
* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentCoordinatorClient.h:
(WebCore::PaymentCoordinatorClient::getSetupFeatures):
(WebCore::PaymentCoordinatorClient::beginApplePaySetup):
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* testing/MockApplePaySetupFeature.cpp: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h.
(WebCore::MockApplePaySetupFeature::create):
(WebCore::MockApplePaySetupFeature::MockApplePaySetupFeature):
* testing/MockApplePaySetupFeature.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h.
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::addSetupFeature):
(WebCore::MockPaymentCoordinator::getSetupFeatures):
(WebCore::MockPaymentCoordinator::beginApplePaySetup):
* testing/MockPaymentCoordinator.h:
* testing/MockPaymentCoordinator.idl:
2020-05-19 Sergio Villar Senin <svillar@igalia.com>
[WebXR] Implement requestSession()
https://bugs.webkit.org/show_bug.cgi?id=211888
Reviewed by Youenn Fablet.
This patch adds a preliminar implementation of the requestSession()
API used to get a WebXRSession from the UA. It includes a fairly good
amount of checks to verify that the request can be satisfied given the
device's enabled features per session modes. The specs also describe how
to request persmission for some actions using the Permissions API which
WebKit does not currently implement. That should be done in a follow up
patch perhaps using a similar approach to other APIs as Geolocation for
example.
In order to get some of the requestSession() tests passing the session
finalization (shutdown) had to be implemented too.
Several tests where unskipped for WPE port as they're now passing.
* Modules/webxr/WebXRRenderState.cpp:
(WebCore::WebXRRenderState::create): Pass XRSessionMode as argument
instead of a WebXRSession.
* Modules/webxr/WebXRRenderState.h: Ditto.
* Modules/webxr/WebXRSession.cpp:
(WebCore::WebXRSession::create): Added.
(WebCore::WebXRSession::WebXRSession): Added.
(WebCore::WebXRSession::renderState const):
(WebCore::WebXRSession::inputSources const):
(WebCore::WebXRSession::shutdown): Shutdown process called on session end.
(WebCore::WebXRSession::end): Implemented session ending.
* Modules/webxr/WebXRSession.h: Added create() and private constructor. Fixed some naming.
* Modules/webxr/WebXRSystem.cpp:
(WebCore::WebXRSystem::DummyInlineDevice::DummyInlineDevice): Contructor for the
dummy inline device.
(WebCore::WebXRSystem::ensureImmersiveXRDeviceIsSelected): Use a counter instead of a boolean
to track testing devices as there might be more than 1.
(WebCore::WebXRSystem::obtainCurrentDevice): Implemented from specs text.
(WebCore::WebXRSystem::immersiveSessionRequestIsAllowedForGlobalObject const): Ditto.
(WebCore::WebXRSystem::inlineSessionRequestIsAllowedForGlobalObject const): Ditto.
(WebCore::WebXRSystem::resolveRequestedFeatures const): Ditto.
(WebCore::WebXRSystem::isXRPermissionGranted const): Ditto.
(WebCore::WebXRSystem::requestSession): Ditto.
(WebCore::WebXRSystem::registerSimulatedXRDeviceForTesting): Use a counter instead of a bool.
Also use a reference in the method argument.
(WebCore::WebXRSystem::unregisterSimulatedXRDeviceForTesting): Ditto.
(WebCore::WebXRSystem::sessionEnded): Added, used by sessions to notify the XRSystem.
* Modules/webxr/WebXRSystem.h:
* Modules/webxr/WebXRSystem.idl: Call requestSession with Document.
* dom/TaskSource.h: Added a WebXR task source.
* platform/xr/PlatformXR.h: Specs state that devices have a list of enabled features per session
mode so store them in a hashmap instead of in a Vector.
(PlatformXR::Device::supports const): Use the new Hashmap of session modes.
(PlatformXR::Device::setEnabledFeatures): Ditto.
(PlatformXR::Device::enabledFeatures const): Ditto.
(PlatformXR::Device::setSupportedModes): Deleted.
* platform/xr/openxr/PlatformXR.cpp:
(PlatformXR::Instance::Impl::collectSupportedSessionModes): Return session modes if any.
(PlatformXR::Instance::enumerateImmersiveXRDevices): Fill in features per session mode.
* testing/WebXRTest.cpp:
(WebCore::WebXRTest::simulateDeviceConnection): Fill in features per session mode.
(WebCore::WebXRTest::disconnectAllDevices): Pass a reference to unregister.
2020-05-19 Antti Koivisto <antti@apple.com>
Animation of font-size with rem values is incorrect
https://bugs.webkit.org/show_bug.cgi?id=194765
<rdar://problem/48171742>
Reviewed by Antoine Quint.
Test: animations/keyframe-rem-unit.html
'rem' computation fails on first style resolution because the document element style is not available.
* style/StyleResolver.cpp:
(WebCore::Style::Resolver::styleForKeyframe):
Provide the override value, needed because the style can't be found from DOM tree yet.
2020-05-19 Andy Estes <aestes@apple.com>
[Apple Pay] Add testing and logging for ApplePaySetup
https://bugs.webkit.org/show_bug.cgi?id=211972
<rdar://problem/63291965>
Reviewed by Alex Christensen.
Added support for ApplePaySetup to MockPaymentCoordinator and wrote a test.
Added release logging for ApplePaySetup and removed a noisy log message
from setApplePayIsActiveIfAllowed.
Test: http/tests/ssl/applepay/ApplePaySetup.https.html
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/applepay/ApplePaySetup.cpp:
(WebCore::ApplePaySetup::getSetupFeatures):
(WebCore::ApplePaySetup::begin):
(WebCore::ApplePaySetup::ApplePaySetup):
(WebCore::ApplePaySetup::stop):
* Modules/applepay/ApplePaySetup.idl:
* Modules/applepay/ApplePaySetupConfiguration.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
* Modules/applepay/ApplePaySetupConfiguration.idl: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
* Modules/applepay/ApplePaySetupFeature.idl:
* Modules/applepay/ApplePaySetupFeature.mm:
(WebCore::ApplePaySetupFeature::state const):
* Modules/applepay/ApplePaySetupFeatureState.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
* Modules/applepay/ApplePaySetupFeatureState.idl: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl.
* Modules/applepay/ApplePaySetupFeatureType.idl:
* Modules/applepay/ApplePaySetupFeatureWebCore.h:
* Modules/applepay/ApplePaySetupWebCore.h:
(WebCore::ApplePaySetup::create):
* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::setApplePayIsActiveIfAllowed const):
(WebCore::PaymentCoordinator::getSetupFeatures):
(WebCore::PaymentCoordinator::beginApplePaySetup):
(WebCore::PaymentCoordinator::endApplePaySetup):
* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentCoordinatorClient.h:
(WebCore::PaymentCoordinatorClient::getSetupFeatures):
(WebCore::PaymentCoordinatorClient::beginApplePaySetup):
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* testing/MockApplePaySetupFeature.cpp: Copied from Source/WebCore/Modules/applepay/ApplePaySetup.idl.
(WebCore::MockApplePaySetupFeature::create):
(WebCore::MockApplePaySetupFeature::MockApplePaySetupFeature):
* testing/MockApplePaySetupFeature.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h.
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::addSetupFeature):
(WebCore::MockPaymentCoordinator::getSetupFeatures):
(WebCore::MockPaymentCoordinator::beginApplePaySetup):
* testing/MockPaymentCoordinator.h:
* testing/MockPaymentCoordinator.idl:
2020-05-19 Youenn Fablet <youenn@apple.com>
Allow calling VideoSampleObserver::videoSampleAvailable from a background thread
https://bugs.webkit.org/show_bug.cgi?id=212024
Reviewed by Eric Carlson.
Allow RealtimeMediaSource::videoSampleAvailable to be called on a background thread, typically the capture thread.
Make WebRTC remote sources and mock capture sources do that.
RealtimeMediaSource is then updating its intrinsic size from the generation thread while updating its size in the main thread.
The size() getter can be called from both threads.
Existing consumers do the following:
- media player will hop to the main thread.
- media recorder will do processing from the background thread.
- WebRTC sender will do processing from the background thread, except when sending black frames where this will still be done on the main thread.
This is ok as we ensure either we send black frames on the main thread (and we do not observe the source) or we observe the source to send.
Follow-ups will migrate the real capture sources as well as migrating media player processing out of the main thread.
Covered by existing tests.
* platform/MediaSample.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoSampleAvailable):
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::videoSampleAvailable):
(WebCore::RealtimeMediaSource::setIntrinsicSize):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac):
(WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
(WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample): Deleted.
2020-05-19 Michael Catanzaro <mcatanzaro@gnome.org>
REGRESSION(r257463): [GTK] Build failure with -DENABLE_GLES2=ON
https://bugs.webkit.org/show_bug.cgi?id=212043
Reviewed by Philippe Normand.
Fix the typo "Platfom" -> "Platform"
* platform/graphics/gstreamer/PlatformDisplayGStreamer.cpp:
(createGstGLDisplay):
2020-05-18 Simon Fraser <simon.fraser@apple.com>
Move some of the more chatty Scrolling logging to a ScrollingTree channel
https://bugs.webkit.org/show_bug.cgi?id=212061
Reviewed by Tim Horton.
Move logging about the scrolling tree to a new channel.
* page/FrameView.cpp:
(WebCore::FrameView::scrollToFragmentInternal):
(WebCore::FrameView::scrollToAnchor):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::createNode):
(WebCore::AsyncScrollingCoordinator::insertNode):
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::createUnparentedNode):
(WebCore::ScrollingStateTree::insertNode):
(WebCore::ScrollingStateTree::unparentNode):
(WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
(WebCore::ScrollingStateTree::detachAndDestroySubtree):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::scrollTo):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
* page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm:
(WebCore::ScrollingTreeOverflowScrollProxyNode::applyLayerPositions):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::commitTreeStateIfNeeded):
* platform/Logging.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::attachScrollingNode):
2020-05-18 David Kilzer <ddkilzer@apple.com>
Replace TextIndicatorOptions with OptionSet<TextIndicatorOption>
<https://webkit.org/b/212051>
<rdar://problem/63368556>
Reviewed by Simon Fraser.
Use OptionSet<TextIndicatorOption> everywhere
TextIndicatorOptions was previously used, plus:
- Make TextIndicatorOption an enum class. Remove
"TextIndicatorOption" prefix so TextIndicatorOptionBar becomes
TextIndicatorOption::Bar.
- Remove TextIndicatorOptionDefault because OptionSet<>
initializes to zero.
- Replace static variables (including two globals in WebCore)
with constexpr variables.
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange):
(WebCore::TextIndicator::createWithSelectionInFrame):
(WebCore::snapshotOptionsForTextIndicatorOptions):
(WebCore::takeSnapshots):
(WebCore::hasAnyIllegibleColors):
(WebCore::initializeIndicator):
* page/TextIndicator.h:
* platform/ios/DragImageIOS.mm:
(WebCore::createDragImageForLink):
(WebCore::createDragImageForSelection):
(WebCore::createDragImageForRange):
* testing/Internals.h:
2020-05-18 Andy Estes <aestes@apple.com>
http/tests/ssl/applepay/ApplePayInstallmentConfiguration.https.html fails in public SDK builds
https://bugs.webkit.org/show_bug.cgi?id=212000
<rdar://problem/63323082>
Reviewed by Youenn Fablet.
* Configurations/FeatureDefines.xcconfig:
* bindings/js/WebCoreBuiltinNames.h:
2020-05-18 Myles C. Maxfield <mmaxfield@apple.com>
[WebGPU] Validation for GPUDevice.createTexture()
https://bugs.webkit.org/show_bug.cgi?id=211882
<rdar://problem/63215999>
Reviewed by Dean Jackson.
Add lots of validation for texture creation. The logic was gathered by
trial and error.
Before this patch, we didn't have any validation. This is a first pass, as
the validation logic isn't spelled out in the spec. Next, I will make a pull
request to the spec to match this patch.
This patch also updates three pieces of our IDL files to match the spec for
WebGPU: One to remove GPUTextureUsage.NONE which was replaced with just 0,
one to remove GPUTextureDescriptor.arrayLayerCount, which was deleted in
favor of using regular dimension fields, and one to add [EnforceRange] to
various values.
This patch also updates GPUDevice to have a GPUErrorScopes object, which is
required for good error messages.
Test: webgpu/texture-creation.html
* Modules/webgpu/GPUExtent3D.idl:
* Modules/webgpu/GPUTextureDescriptor.idl:
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::tryCreate):
(WebCore::WebGPUDevice::createTexture const):
* Modules/webgpu/WebGPUDevice.h:
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::maximumMipLevelCount):
(WebCore::GPUDevice::tryCreateTexture const):
* platform/graphics/gpu/GPUDevice.h:
(WebCore::GPUDevice::setErrorScopes):
* platform/graphics/gpu/GPUExtent3D.h:
* platform/graphics/gpu/GPUObjectBase.h:
(WebCore::GPUObjectBase::errorScopes const):
(WebCore::GPUObjectBase::errorScopes): Deleted.
* platform/graphics/gpu/GPUTexture.h:
* platform/graphics/gpu/GPUTextureDescriptor.h:
* platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
(WebCore::mtlTextureTypeForGPUTextureDescriptor):
(WebCore::mtlTextureUsageForGPUTextureUsageFlags):
(WebCore::tryCreateMtlTextureDescriptor):
(WebCore::GPUTexture::tryCreate):
2020-05-18 Oriol Brufau <obrufau@igalia.com>
[css-grid] Clear the override width for computing percent margins
https://bugs.webkit.org/show_bug.cgi?id=209461
Reviewed by Manuel Rego Casasnovas.
When calculating the min-content contribution of a grid item of an auto
sized grid track we must consider the grid item's margin. When the grid
item's area is indefinite, a percent margin is resolved to zero.
However, when performing a relayout, the percent margin may be solved
against the previously computed grid area, since the grid item has
already an OverrideContainingBlockLogicalWidth value.
In order to re-compute the percent margin properly, we need to clear
the previously override value. It's important to be careful of not
clearing the override value set during intrinsic size, since we need
it for the actual layout phase. Hence, we only reset the 'override'
value when we are executing a definite strategy.
Tests: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-minimum-contribution-with-percentages.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-dynamic-min-contribution-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-003.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-004.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-005.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-006.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-007.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-008.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-009.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-010.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-011.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-012.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-013.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-014.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-003.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-004.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-005.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-006.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-007.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-008.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-009.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-010.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-011.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-012.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-013.html
imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-014.html
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::hasRelativeMarginOrPaddingForChild):
(WebCore::hasRelativeOrIntrinsicSizeForChild):
(WebCore::shouldClearOverrideContainingBlockContentSizeForChild):
(WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::minLogicalSizeForChild const):
(WebCore::DefiniteSizeStrategy::minLogicalSizeForChild const):
(WebCore::DefiniteSizeStrategy::minContentForChild const):
* rendering/GridTrackSizingAlgorithm.h:
2020-05-18 David Kilzer <ddkilzer@apple.com>
Follow-up: Use default initializers in TextIndicatorData
<https://webkit.org/b/212039>
<rdar://problem/63355619>
* page/TextIndicator.h:
(WebCore::TextIndicatorData::contentImageScaleFactor):
- Simon Fraser says 1 is a better default than 0.
2020-05-18 Peng Liu <peng.liu6@apple.com>
Add a quirk to allow an embedded Twitter video to play with one tapping
https://bugs.webkit.org/show_bug.cgi?id=211932
Reviewed by Maciej Stachowiak.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted const):
Need to check the topDocument for the existence of user interactions.
(WebCore::MediaElementSession::updateMediaUsageIfChanged): Ditto.
* page/Quirks.cpp:
(WebCore::Quirks::needsPerDocumentAutoplayBehavior const):
Add the missing needsQuirks() checking.
(WebCore::Quirks::shouldAutoplayForArbitraryUserGesture const):
Add a the quirk for twitter.com.
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::sessionWillBeginPlayback):
Clarify the log message.
2020-05-18 Simon Fraser <simon.fraser@apple.com>
Content disappears on CSS parallax example
https://bugs.webkit.org/show_bug.cgi?id=212045
<rdar://problem/63194217>
Reviewed by Tim Horton.
In r261632 I fixed parallax scrolling by migrating the perspective transform onto
the scroll container layer, and making the scrolled contents layer a "preserve3D" layer.
However, scrolling is achieved by changing the boundsOrigin of the scrolled contents layer,
so the computation of the perspective matrix, which is a "child layer transform", has to
take this boundsOrigin into account, otherwise we compute bad coverage rects, and drop
backing store erroneously.
Test: compositing/tiling/perspective-on-scroller-tile-coverage.html
* platform/graphics/FloatPoint3D.h:
(WebCore::FloatPoint3D::FloatPoint3D):
(WebCore::FloatPoint3D::move):
(WebCore::operator +=):
(WebCore::operator -=):
(WebCore::operator+):
(WebCore::operator-):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
(WebCore::GraphicsLayerCA::layerTransform const):
(WebCore::GraphicsLayerCA::adjustCoverageRect const):
(WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
2020-05-18 David Kilzer <ddkilzer@apple.com>
Use default initializers in TextIndicatorData
<https://webkit.org/b/212039>
<rdar://problem/63355619>
Reviewed by Alex Christensen.
Tested by IPC::Decoder::decode() and IPC::Encoder::operator<<()
running on WebKit2 API and layout tests.
* page/TextIndicator.h:
(WebCore::TextIndicatorData):
- Add default initializers.
(WTF::EnumTraits<WebCore::TextIndicatorPresentationTransition>):
- Add EnumTraits so TextIndicatorPresentationTransition may be
used by IPC::Decoder::decode() and IPC::Encoder::operator<<().
2020-05-18 Simon Fraser <simon.fraser@apple.com>
Fix operator== and hash() for ExtendedColor
https://bugs.webkit.org/show_bug.cgi?id=211993
Post-landing followup. ExtendedColor operator== has to do exact comparison to be
consistent with hash().
* platform/graphics/ExtendedColor.h:
(WebCore::operator==):
2020-05-18 Wenson Hsieh <wenson_hsieh@apple.com>
Replace uses of +self with +class
https://bugs.webkit.org/show_bug.cgi?id=212041
Reviewed by Darin Adler.
No change in behavior.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayer::isWebLayer):
2020-05-18 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed restabilization of non-unified build.
* accessibility/AXObjectCache.cpp:
* html/HTMLAttachmentElement.h:
* inspector/agents/InspectorCSSAgent.cpp:
* layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp:
* layout/tableformatting/TableFormattingContextGeometry.cpp:
* layout/tableformatting/TableFormattingState.cpp:
* rendering/RenderTextFragment.h:
* rendering/style/KeyframeList.h:
2020-05-18 Pinki Gyanchandani <pgyanchandani@apple.com>
Null Ptr Deref @ WebCore::CSSValue::classType
https://bugs.webkit.org/show_bug.cgi?id=212036
Reviewed by Geoffrey Garen.
Calculated value for a primitive value type can be NULL for a CSS property. Added a null check before dereferencing it.
Test: editing/execCommand/null_calc_primitive_value_for_css_property.html
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const):
2020-05-18 Simon Fraser <simon.fraser@apple.com>
Implement conversion between P3 and sRGB color
https://bugs.webkit.org/show_bug.cgi?id=211998
Reviewed by Daniel Bates.
Color::toSRGBAComponentsLossy() was a lie because it didn't actually convert extended
colors into sRGB. Fix that by converting P3 and linaerRGB colors into sRGB, using the color
math from CSS Color 4.
Renamed the various "linear to sRGB" functions because they work for any RGB colors,
not just sRGB.
* platform/graphics/Color.cpp:
(WebCore::Color::toSRGBAComponentsLossy const):
* platform/graphics/Color.h:
* platform/graphics/ColorUtilities.cpp:
(WebCore::linearToRGBColorComponent):
(WebCore::RGBToLinearColorComponent):
(WebCore::sRGBColorToLinearComponents):
(WebCore::RGBToLinearComponents):
(WebCore::linearToRGBComponents):
(WebCore::XYZToLinearSRGB):
(WebCore::linearSRGBToXYZ):
(WebCore::XYZToLinearP3):
(WebCore::linearP3ToXYZ):
(WebCore::P3ToSRGB):
(WebCore::sRGBToP3):
(WebCore::ColorMatrix::transformedColorComponents const):
(WebCore::linearToSRGBColorComponent): Deleted.
(WebCore::sRGBToLinearColorComponent): Deleted.
(WebCore::sRGBToLinearComponents): Deleted.
(WebCore::linearToSRGBComponents): Deleted.
* platform/graphics/ColorUtilities.h:
2020-05-18 Wenson Hsieh <wenson_hsieh@apple.com>
Allow clipboard API access when pasting from a menu item or key binding
https://bugs.webkit.org/show_bug.cgi?id=211990
<rdar://problem/63308916>
Reviewed by Megan Gardner.
Allow the contents of the clipboard to be programmatically requested by the page while pasting from trusted UI
(i.e. the paste menu item, or when WebKit API is called by the app to trigger the paste). This allows the
'reading' part of the async clipboard API (`read` and `readText`) to be used when the user pastes in an editable
element, without having to fall back to showing the DOM paste access menu.
Note that this change should not have an effect on the pasteboard security model, since it only grants the page
programmatic access to the contents of the pasteboard in the case where access to the pasteboard has already
been granted by the user. Additionally, even in the event that the web process is compromised, even if the web
process can be tricked into believing it has been granted pasteboard access, the changes in r259151 will prevent
it from being able to request pasteboard data, unless the user (or the application, on behalf of the user) has
explicitly pasted via trusted API calls that are inaccessible from the web process.
Test: editing/async-clipboard/clipboard-read-while-pasting.html
* editing/Editor.cpp:
(WebCore::Editor::paste):
(WebCore::Editor::pasteAsPlainText):
(WebCore::Editor::pasteAsQuotation):
If `FromMenuOrKeyBinding::Yes` is passed in, set the `m_pastingFromMenuOrKeyBinding` flag to true during the
scope of the paste command.
* editing/Editor.h:
(WebCore::Editor::isPastingFromMenuOrKeyBinding const):
* editing/EditorCommand.cpp:
(WebCore::executePaste):
(WebCore::executePasteAndMatchStyle):
(WebCore::executePasteAsPlainText):
(WebCore::executePasteAsQuotation):
Pass in `FromMenuOrKeyBinding::Yes` when triggering the paste from a menu item or key binding.
* page/Frame.cpp:
(WebCore::Frame::requestDOMPasteAccess):
When pasting from menu or key binding, grant the page DOM paste access without requiring the DOM paste access
UI to be shown and confirmed.
2020-05-18 Per Arne Vollan <pvollan@apple.com>
[Win] Fix AppleWin build
https://bugs.webkit.org/show_bug.cgi?id=212030
Reviewed by Brent Fulgham.
The build fails because the number of bitfields in GreaterThanOrSameSizeAsStyleRareInheritedData does not match the
actual number of bitfields in StyleRareInheritedData.
* rendering/style/StyleRareInheritedData.cpp:
2020-05-18 Rob Buis <rbuis@igalia.com>
Remove certain headers when a redirect causes a request method change
https://bugs.webkit.org/show_bug.cgi?id=205119
Reviewed by Youenn Fablet.
Implement step 11 of HTTP-redirect fetch [1] to redirect to GET
method, remove body and strip certain headers for 301, 302 and 303 redirects.
Tests: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.any.html
imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.any.worker.html
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
* platform/network/HTTPHeaderNames.in:
* platform/network/ResourceRequestBase.cpp:
(WebCore::shouldUseGet):
(WebCore::ResourceRequestBase::redirectAsGETIfNeeded):
(WebCore::ResourceRequestBase::redirectedRequest const):
* platform/network/ResourceRequestBase.h:
2020-05-18 Antti Koivisto <antti@apple.com>
[Wheel event region] Invalidation for root style
https://bugs.webkit.org/show_bug.cgi?id=212029
Reviewed by Simon Fraser.
Test: fast/scrolling/mac/wheel-event-listener-region-root-invalidation.html
Invalidate the region when event listeners change on Document or Window.
* dom/Document.cpp:
(WebCore::Document::invalidateEventListenerRegions):
* dom/Document.h:
(isType):
* dom/Element.cpp:
(WebCore::Element::invalidateEventListenerRegions):
* dom/Element.h:
* dom/EventTarget.cpp:
(WebCore::EventTarget::addEventListener):
(WebCore::EventTarget::removeEventListener):
(WebCore::EventTarget::removeAllEventListeners):
(WebCore::EventTarget::invalidateEventListenerRegions):
* dom/EventTarget.h:
* style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjustEventListenerRegionTypesForRootStyle):
* style/StyleAdjuster.h:
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):
2020-05-18 Simon Fraser <simon.fraser@apple.com>
Find doesn't always scroll search results into view
https://bugs.webkit.org/show_bug.cgi?id=212007
<rdar://problem/36333321>
Reviewed by Wenson Hsieh.
HighlightData::collectBounds() could produce overly large bounds, causing the selection
to fail to scroll into view.
This happened when multiple block ancestors were added to 'renderers', with empty
rects. The process of mapping that empty rect to a quad via localToAbsoluteQuad()
could produce an empty quad at a fractional offset, then calling enclosingBoundingBox()
on the quad would create a 1x1 rectangle, which got unioned with selectionRect.
Fix by skipping entries with empty rects.
Add a Selection log channel and some logging that makes this trivial to see.
Test: editing/selection/selection-bounds-fractional-containing-blocks.html
* platform/Logging.h:
* rendering/HighlightData.cpp:
(WebCore::HighlightData::collectBounds const):
2020-05-18 Darin Adler <darin@apple.com>
Add iterator checking to ListHashSet
https://bugs.webkit.org/show_bug.cgi?id=211669
Reviewed by Anders Carlsson.
* page/ios/ContentChangeObserver.h: Added an include of Element.h, needed to call
makeWeakPtr in an inline function. This is due to a change in the way makeWeakPtr
now checks the type of the argument. It's possible we could refine it further to
relax this requirement, but it seems OK to include Element.h here.
2020-05-18 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Add support for computing the collapsed table border
https://bugs.webkit.org/show_bug.cgi?id=212003
Reviewed by Antti Koivisto.
UAs must compute an initial left and right border width for the table by examining
the first and last cells in the first row of the table.
The left border width of the table is half of the first cell's collapsed left border,
and the right border width of the table is half of the last cell's collapsed right border.
The top border width of the table is computed by examining all cells who collapse their top
borders with the top border of the table. The top border width of the table is equal to half of the
maximum collapsed top border. The bottom border width is computed by examining all cells whose bottom borders collapse
with the bottom of the table. The bottom border width is equal to half of the maximum collapsed bottom border.
https://www.w3.org/TR/CSS22/tables.html#collapsing-borders
This patch implements the table box part of the border collapsing. Inner table elements need to implement collapsing as well.
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::ensureTableFormattingState):
* layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp:
(WebCore::Layout::TableWrapperBlockFormattingContext::layoutTableBox):
(WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox):
(WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox):
* layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.h:
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::TableFormattingContext::ensureTableGrid):
* layout/tableformatting/TableFormattingContext.h:
* layout/tableformatting/TableFormattingState.cpp:
(WebCore::Layout::TableFormattingState::TableFormattingState):
* layout/tableformatting/TableFormattingState.h:
2020-05-18 Antoine Quint <graouts@apple.com>
Clean up media controls content for Apple platforms
https://bugs.webkit.org/show_bug.cgi?id=212011
<rdar://problem/63298588>
Reviewed by Dean Jackson.
We strip Copyright and other comments from the CSS and JS media controls files.
* WebCore.xcodeproj/project.pbxproj:
2020-05-18 Alicia Boya García <aboya@igalia.com>
[GStreamer][MediaSource] Remove orphaned tracks in updateTracks()
https://bugs.webkit.org/show_bug.cgi?id=211980
Reviewed by Xabier Rodriguez-Calvar.
This patch ensures tracks missing from a subsequent updateTracks()
calls are removed from the player.
This fixes regressions on the following tests caused on r261683.
imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-removetrack.https.html
imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-applyConstraints.https.html
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::hashSetFromHashMapKeys):
(WebCore::MediaPlayerPrivateGStreamer::updateTracks):
2020-05-18 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] "ASSERTION FAILED: !m_adoptionIsRequired" when double clicking on a word
https://bugs.webkit.org/show_bug.cgi?id=211957
Reviewed by Adrian Perez de Castro.
Make SelectionData non-refcounted. We can just move in most of the cases to avoid copies.
* platform/Pasteboard.h:
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::createForDragAndDrop):
(WebCore::Pasteboard::Pasteboard):
(WebCore::Pasteboard::selectionData const):
* platform/gtk/SelectionData.h:
2020-05-18 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Add WebKitContextMenuItemType for paste as plaintext
https://bugs.webkit.org/show_bug.cgi?id=177638
Reviewed by Michael Catanzaro.
Add paste as plain text context menu item for rich editable content.
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
(WebCore::ContextMenuController::populate):
(WebCore::ContextMenuController::checkOrEnableIfNeeded const):
* platform/ContextMenuItem.h:
* platform/LocalizedStrings.h:
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::contextMenuItemTagPasteAsPlainText):
2020-05-17 Simon Fraser <simon.fraser@apple.com>
Fix operator== and hash() for ExtendedColor
https://bugs.webkit.org/show_bug.cgi?id=211993
Reviewed by Sam Weinig.
Color::operator== and hash() were wrong for extended color. Fix operator==
to compare extended colors. Extended and non-extended colors have to always
conpare as non-equal to preserve computed style behavior, currently.
Fix hash() to hash the color components and colorspace for ExtendedColor.
Add some API tests for these code paths.
* platform/graphics/Color.cpp:
(WebCore::extendedColorsEqual):
* platform/graphics/Color.h:
(WebCore::operator==):
(WebCore::Color::hash const):
* platform/graphics/ColorUtilities.cpp:
(WebCore::areEssentiallyEqual):
* platform/graphics/ColorUtilities.h:
(WebCore::operator==):
(WebCore::operator!=):
* platform/graphics/ExtendedColor.cpp:
(WebCore::ExtendedColor::hash const):
* platform/graphics/ExtendedColor.h:
(WebCore::operator==):
(WebCore::operator!=):
2020-05-17 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Introduce TableWrapperBlockFormattingContext
https://bugs.webkit.org/show_bug.cgi?id=211996
Reviewed by Antti Koivisto.
Table wrapper box establishes a special BFC with only captions and the actual table box in it.
It mostly behaves like a normal BFC but the table box requires some special handing when it comes
to padding/border and width/height computation.
This patch moves the table box specific code from generic BFC to this new subclass.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingContext.h:
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::createFormattingContext):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
* layout/blockformatting/BlockFormattingContext.h:
(): Deleted.
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
* layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: Added.
(WebCore::Layout::TableWrapperBlockFormattingContext::TableWrapperBlockFormattingContext):
(WebCore::Layout::TableWrapperBlockFormattingContext::layoutInFlowContent):
(WebCore::Layout::TableWrapperBlockFormattingContext::layoutTableBox):
(WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox):
(WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox):
* layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.h: Added.
2020-05-17 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Move to new Pasteboard API
https://bugs.webkit.org/show_bug.cgi?id=177633
Reviewed by Adrian Perez de Castro.
Add support for custom data and remove the support for unknown data types that is currently unused.
* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::writeSelectionToPasteboard): Set the contentOrigin.
* editing/gtk/WebContentReaderGtk.cpp:
(WebCore::shouldReplaceSubresourceURL): Helper to decide whether to replace the subresource URL.
(WebCore::WebContentMarkupReader::readHTML): Create a fragment for HTML sanitizing it if needed.
* platform/Pasteboard.h:
* platform/PasteboardCustomData.h:
(WebCore::PasteboardCustomData::gtkType): Mime type name for GTK custom pasteboard data.
* platform/SharedBuffer.h:
* platform/glib/SharedBufferGlib.cpp:
(WebCore::SharedBuffer::createGBytes const): Create a GBytes wrapping the SharedBuffer data.
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::writeString):
(WebCore::Pasteboard::write):
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::hasData):
(WebCore::Pasteboard::typesSafeForBindings):
(WebCore::Pasteboard::typesForLegacyUnsafeBindings):
(WebCore::Pasteboard::readOrigin):
(WebCore::Pasteboard::readString):
(WebCore::Pasteboard::readStringInCustomData):
(WebCore::Pasteboard::fileContentState):
(WebCore::Pasteboard::writeCustomData):
* platform/gtk/SelectionData.cpp:
(WebCore::SelectionData::clearAllExceptFilenames):
* platform/gtk/SelectionData.h:
(WebCore::SelectionData::setCustomData):
(WebCore::SelectionData::customData const):
(WebCore::SelectionData::hasCustomData const):
(WebCore::SelectionData::clearCustomData):
2020-05-16 Simon Fraser <simon.fraser@apple.com>
Some color-related cleanup
https://bugs.webkit.org/show_bug.cgi?id=211991
Reviewed by Sam Weinig.
Change FloatComponents and ColorComponents to use std::array<>.
Add Color::toSRGBAComponentsLossy() to make explicit potentially lossy conversions
between P3 and sRGB colors, and call it in places where we do that conversion.
Add const in a few places.
* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/Color.cpp:
(WebCore::Color::Color):
(WebCore::Color::toSRGBAComponentsLossy const):
(WebCore::Color::asExtended const):
* platform/graphics/Color.h:
* platform/graphics/ColorUtilities.cpp:
(WebCore::ColorMatrix::ColorMatrix):
* platform/graphics/ColorUtilities.h:
(WebCore::FloatComponents::FloatComponents):
(): Deleted.
* platform/graphics/ExtendedColor.cpp:
(WebCore::ExtendedColor::create):
(WebCore::ExtendedColor::cssText const):
* platform/graphics/ExtendedColor.h:
(WebCore::ExtendedColor::red const):
(WebCore::ExtendedColor::green const):
(WebCore::ExtendedColor::blue const):
(WebCore::ExtendedColor::alpha const):
(WebCore::ExtendedColor::channels const):
(WebCore::ExtendedColor::ExtendedColor):
* platform/graphics/cg/ColorCG.cpp:
(WebCore::leakCGColor):
* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::fillRegion const):
* platform/graphics/filters/FilterOperation.cpp:
(WebCore::InvertLightnessFilterOperation::transformColor const):
(WebCore::InvertLightnessFilterOperation::inverseTransformColor const):
* platform/graphics/gtk/ColorGtk.cpp:
(WebCore::Color::operator GdkRGBA const):
* platform/graphics/win/ColorDirect2D.cpp:
(WebCore::Color::operator D2D1_COLOR_F const):
(WebCore::Color::operator D2D1_VECTOR_4F const):
2020-05-16 Andy Estes <aestes@apple.com>
Fix the build after r261785.
* Modules/applepay/PaymentInstallmentConfiguration.mm:
(WebCore::fromDecimalNumber):
2020-05-16 David Kilzer <ddkilzer@apple.com>
Let Xcode have its way with WebCore project
* WebCore.xcodeproj/project.pbxproj:
- Resort TableLayout.cpp.
2020-05-16 Zalan Bujtas <zalan@apple.com>
Add missing is<RenderTableSection> check.
Unreviewed.
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
2020-05-16 Andy Estes <aestes@apple.com>
REGRESSION (r260717): installmentConfiguration member is no longer available on ApplePayPaymentRequest
https://bugs.webkit.org/show_bug.cgi?id=211911
<rdar://problem/63236367>
Reviewed by Tim Horton.
Prior to r260717, installmentConfiguration was a member of ApplePayRequestBase, making it
available on ApplePayRequest and ApplePayPaymentRequest. In r260717, it was mistakenly
moved to ApplePayRequest.
This change moves it back to ApplePayRequestBase, adds infrastructure for regression testing
ApplePayInstallmentConfiguration, and adds a regression test.
Test: http/tests/ssl/applepay/ApplePayInstallmentConfiguration.https.html
* Modules/applepay/ApplePayInstallmentConfiguration.idl:
* Modules/applepay/ApplePayRequestBase.cpp:
(WebCore::convertAndValidate):
(WebCore::finishConverting): Deleted.
* Modules/applepay/ApplePayRequestBase.idl:
* Modules/applepay/PaymentInstallmentConfiguration.mm:
(WebCore::fromDecimalNumber):
(WebCore::applePaySetupFeatureType):
(WebCore::PaymentInstallmentConfiguration::applePayInstallmentConfiguration const):
* Modules/applepay/PaymentInstallmentConfigurationWebCore.h:
* Modules/applepay/paymentrequest/ApplePayRequest.idl:
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::showPaymentUI):
* testing/MockPaymentCoordinator.h:
* testing/MockPaymentCoordinator.idl:
2020-05-16 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Ignore table padding when borders are collapsed
https://bugs.webkit.org/show_bug.cgi?id=211984
Reviewed by Antti Koivisto.
Table padding has no room left when the table border is collapsed with the inner table elements.
Test: fast/layoutformattingcontext/table-simple-border-collapse-with-padding.html
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isPaddingApplicable const):
2020-05-16 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Take vertical spacing into account when setting the height of a cell with rowspan
https://bugs.webkit.org/show_bug.cgi?id=211976
Reviewed by Antti Koivisto.
When a cell spans over multiple rows, the height of the cell includes the vertical spacing between those spanned rows as well.
Test: fast/layoutformattingcontext/table-simple-rowspan-with-spacing.html
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):
2020-05-15 Antti Koivisto <antti@apple.com>
Nullptr crash in MediaQueryMatcher::evaluateAll
https://bugs.webkit.org/show_bug.cgi?id=211963
<rdar://problem/62850977>
Reviewed by Brent Fulgham.
Test: fast/media/media-query-list-mutation.html
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::evaluateAll):
Copy the vector before iterating.
2020-05-15 Jack Lee <shihchieh_lee@apple.com>
Nullptr crash in WebCore::Node::treeScope() when processing nested list insertion commands.
https://bugs.webkit.org/show_bug.cgi?id=211964
<rdar://problem/63224871>
Reviewed by Geoffrey Garen.
Load event may fire in fixOrphanedListChild() and change the node tree. In doApplyForSingleParagraph check for
disconnected node returned by fixOrphanedListChild() and bail out.
Test: editing/inserting/nested-list-insertion-crash.html
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApplyForSingleParagraph):
2020-05-15 Alex Christensen <achristensen@webkit.org>
Use enum serialization instead of casting to/from uint32_t
https://bugs.webkit.org/show_bug.cgi?id=211885
<rdar://problem/60106629> and <rdar://problem/60107663>
Reviewed by Geoffrey Garen.
This doesn't change anything except make stricter checks at IPC boundaries.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::visiblePositionRangeForLine const):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityModifySelection:increase:]):
* editing/EditingBehavior.h:
* editing/Editor.cpp:
(WebCore::Editor::shouldSmartDelete):
(WebCore::Editor::deleteWithDirection):
(WebCore::Editor::misspelledWordAtCaretOrRange const):
(WebCore::Editor::guessesForMisspelledOrUngrammatical):
(WebCore::Editor::markMisspellingsAfterTypingToWord):
(WebCore::Editor::markAndReplaceFor):
(WebCore::Editor::handleAcceptedCandidate):
* editing/EditorCommand.cpp:
(WebCore::executeDeleteBackward):
(WebCore::executeDeleteBackwardByDecomposingPreviousCharacter):
(WebCore::executeDeleteForward):
(WebCore::executeDeleteToBeginningOfLine):
(WebCore::executeDeleteToBeginningOfParagraph):
(WebCore::executeDeleteToEndOfLine):
(WebCore::executeDeleteToEndOfParagraph):
(WebCore::executeDeleteWordBackward):
(WebCore::executeDeleteWordForward):
(WebCore::executeForwardDelete):
(WebCore::executeMoveBackward):
(WebCore::executeMoveBackwardAndModifySelection):
(WebCore::executeMoveDown):
(WebCore::executeMoveDownAndModifySelection):
(WebCore::executeMoveForward):
(WebCore::executeMoveForwardAndModifySelection):
(WebCore::executeMoveLeft):
(WebCore::executeMoveLeftAndModifySelection):
(WebCore::executeMoveRight):
(WebCore::executeMoveRightAndModifySelection):
(WebCore::executeMoveToBeginningOfDocument):
(WebCore::executeMoveToBeginningOfDocumentAndModifySelection):
(WebCore::executeMoveToBeginningOfLine):
(WebCore::executeMoveToBeginningOfLineAndModifySelection):
(WebCore::executeMoveToBeginningOfParagraph):
(WebCore::executeMoveToBeginningOfParagraphAndModifySelection):
(WebCore::executeMoveToBeginningOfSentence):
(WebCore::executeMoveToBeginningOfSentenceAndModifySelection):
(WebCore::executeMoveToEndOfDocument):
(WebCore::executeMoveToEndOfDocumentAndModifySelection):
(WebCore::executeMoveToEndOfSentence):
(WebCore::executeMoveToEndOfSentenceAndModifySelection):
(WebCore::executeMoveToEndOfLine):
(WebCore::executeMoveToEndOfLineAndModifySelection):
(WebCore::executeMoveToEndOfParagraph):
(WebCore::executeMoveToEndOfParagraphAndModifySelection):
(WebCore::executeMoveParagraphBackwardAndModifySelection):
(WebCore::executeMoveParagraphForwardAndModifySelection):
(WebCore::executeMoveUp):
(WebCore::executeMoveUpAndModifySelection):
(WebCore::executeMoveWordBackward):
(WebCore::executeMoveWordBackwardAndModifySelection):
(WebCore::executeMoveWordForward):
(WebCore::executeMoveWordForwardAndModifySelection):
(WebCore::executeMoveWordLeft):
(WebCore::executeMoveWordLeftAndModifySelection):
(WebCore::executeMoveWordRight):
(WebCore::executeMoveWordRightAndModifySelection):
(WebCore::executeMoveToLeftEndOfLine):
(WebCore::executeMoveToLeftEndOfLineAndModifySelection):
(WebCore::executeMoveToRightEndOfLine):
(WebCore::executeMoveToRightEndOfLineAndModifySelection):
(WebCore::executeSelectLine):
(WebCore::executeSelectParagraph):
(WebCore::executeSelectSentence):
(WebCore::executeSelectWord):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::FrameSelection):
(WebCore::FrameSelection::willBeModified):
(WebCore::FrameSelection::modifyExtendingRight):
(WebCore::FrameSelection::modifyExtendingForward):
(WebCore::FrameSelection::modifyMovingRight):
(WebCore::FrameSelection::modifyMovingForward):
(WebCore::FrameSelection::modifyExtendingLeft):
(WebCore::FrameSelection::modifyExtendingBackward):
(WebCore::FrameSelection::modifyMovingLeft):
(WebCore::FrameSelection::modifyMovingBackward):
(WebCore::isBoundary):
(WebCore::FrameSelection::textSelectionIntent):
(WebCore::textSelectionWithDirectionAndGranularity):
(WebCore::FrameSelection::modify):
(WebCore::FrameSelection::clear):
(WebCore::FrameSelection::willBeRemovedFromFrame):
(WebCore::FrameSelection::updateAppearance):
(WebCore::FrameSelection::wordSelectionContainingCaretSelection):
(WebCore::FrameSelection::rangeByAlteringCurrentSelection const):
* editing/FrameSelection.h:
* editing/TextGranularity.h:
(): Deleted.
* editing/TypingCommand.cpp:
(WebCore::editActionForTypingCommand):
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):
(WebCore::TypingCommand::insertTextRunWithoutNewlines):
(WebCore::TypingCommand::insertLineBreak):
(WebCore::TypingCommand::insertParagraphSeparator):
(WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
(WebCore::TypingCommand::deleteSelection):
* editing/TypingCommand.h:
* editing/VisibleSelection.cpp:
(WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity):
* editing/VisibleSelection.h:
* editing/VisibleUnits.cpp:
(WebCore::directionIsDownstream):
(WebCore::atBoundaryOfGranularity):
(WebCore::withinTextUnitOfGranularity):
(WebCore::nextWordBoundaryInDirection):
(WebCore::nextSentenceBoundaryInDirection):
(WebCore::nextParagraphBoundaryInDirection):
(WebCore::positionOfNextBoundaryOfGranularity):
(WebCore::enclosingTextUnitOfGranularity):
(WebCore::charactersAroundPosition):
(WebCore::wordRangeFromPosition):
(WebCore::closestWordBoundaryForPosition):
(WebCore::rangeExpandedByCharactersInDirectionAtWordBoundary):
(WebCore::wordBoundaryForPositionWithoutCrossingLine):
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::detectItemAroundHitTestResult):
* editing/cocoa/DictionaryLookup.mm:
* editing/mac/DictionaryLookupLegacy.mm:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
* loader/FrameLoaderClient.h:
(WebCore::FrameLoaderClient::webGLPolicyForURL const):
(WebCore::FrameLoaderClient::resolveWebGLPolicyForURL const):
(): Deleted.
* loader/FrameLoaderTypes.h:
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
* page/DOMSelection.cpp:
(WebCore::DOMSelection::modify):
* page/DragController.cpp:
(WebCore::DragController::concludeEditDrag):
* page/EventHandler.cpp:
(WebCore::EventHandler::updateSelectionForMouseDownDispatchingSelectStart):
(WebCore::EventHandler::selectClosestWordFromHitTestResult):
(WebCore::EventHandler::selectClosestContextualWordFromMouseEvent):
(WebCore::EventHandler::selectClosestContextualWordOrLinkFromMouseEvent):
(WebCore::EventHandler::handleMousePressEventTripleClick):
(WebCore::EventHandler::handleMousePressEventSingleClick):
(WebCore::EventHandler::updateSelectionForMouseDrag):
(WebCore::setInitialKeyboardSelection):
(WebCore::handleKeyboardSelectionMovement):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::isOverTextInsideFormControlElement const):
2020-05-15 Simon Fraser <simon.fraser@apple.com>
Rename the mapLocalToContainer() container argument, since it's not just used for repaint
https://bugs.webkit.org/show_bug.cgi?id=211974
Reviewed by Zalan Bujtas.
mapLocalToContainer() is a generic geometry mapping function, and not just used for repaint,
so rename the "repaintContainer" argument to "ancestorContainer".
Also fix some weirdly named variables in RenderMultiColumnFlow.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::mapLocalToContainer const):
* rendering/RenderBox.h:
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::mapLocalToContainer const):
* rendering/RenderFragmentedFlow.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::mapLocalToContainer const):
(WebCore::RenderInline::pushMappingToContainer const):
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::addFragmentToThread):
(WebCore::RenderMultiColumnFlow::mapFromFlowToFragment const):
(WebCore::RenderMultiColumnFlow::physicalTranslationOffsetFromFlowToFragment const):
(WebCore::RenderMultiColumnFlow::physicalTranslationFromFlowToFragment const):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::mapLocalToContainer const):
(WebCore::RenderObject::localToContainerQuad const):
(WebCore::RenderObject::localToContainerPoint const):
* rendering/RenderObject.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::mapLocalToContainer const):
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::mapLocalToContainer const):
* rendering/svg/RenderSVGForeignObject.h:
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::mapLocalToContainer const):
* rendering/svg/RenderSVGInline.h:
* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::mapLocalToContainer const):
* rendering/svg/RenderSVGModelObject.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::mapLocalToContainer const):
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::mapLocalToContainer const):
* rendering/svg/RenderSVGText.h:
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::mapLocalToContainer):
* rendering/svg/SVGRenderSupport.h:
2020-05-15 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r249091): Can't click on a video in the second column of a paginated web view
https://bugs.webkit.org/show_bug.cgi?id=211973
<rdar://problem/61418775>
Reviewed by Zalan Bujtas.
In r249091 I made clip layer computation use offsetFromAncestor() by default, but this turns
out to give different behavior from mapping via renderers in columns.
The bug was that accumulateOffsetTowardsAncestor() would map through the
RenderMultiColumnFlow columns if the ancestorLayer was the one that was using columns,
but mapping via renderers only maps through columns if converting to some ancestor of
the columnated renderer.
I did not investigate why this only affects video.
Test: fast/multicol/clipped-video-in-second-column.html
* rendering/RenderLayer.cpp:
(WebCore::accumulateOffsetTowardsAncestor):
(WebCore::RenderLayer::calculateClipRects const):
2020-05-15 Kenneth Russell <kbr@chromium.org>
OES_texture_float internal format conversion must depend on WEBGL_color_buffer_float
https://bugs.webkit.org/show_bug.cgi?id=211971
Reviewed by Dean Jackson.
Only adjust the internal formats of textures created for the WebGL
1.0 OES_texture_float extension if the WEBGL_color_buffer_float
extension has been enabled.
Covered by the WebGL 1.0 OES_texture_float conformance tests when
run on iOS with another forthcoming fix to ANGLE which will enable
the OES_texture_float extension on that platform.
* platform/graphics/angle/ExtensionsGLANGLE.cpp:
(WebCore::ExtensionsGLANGLE::ensureEnabled):
(WebCore::ExtensionsGLANGLE::adjustWebGL1TextureInternalFormat):
* platform/graphics/angle/ExtensionsGLANGLE.h:
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLOpenGL::texImage2DDirect):
2020-05-15 Oriol Brufau <obrufau@igalia.com>
[css-grid] Treat percentages as auto for the minimum contribution
https://bugs.webkit.org/show_bug.cgi?id=195967
Reviewed by Manuel Rego Casasnovas.
The minimum contribution of a grid item is the outer size resulting from
the minimum size if the computed preferred size behaves as auto, or the
min-content contribution otherwise.
If the preferred size is a percentage, it should be resolved with
respect to the grid area, which depends on the minimum contribution
of the item. Thus the percentage is cyclic and behaves as auto.
Before this change, WebKit only checked whether the preferred size is
auto, not whether it behaves as auto. In fact this was according to
an older version of the spec, but it was changed in
https://github.com/w3c/csswg-drafts/issues/2367
Test: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-minimum-contribution-with-percentages.html
Some cases in the test still fail due to bug 209461.
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
2020-05-15 Antoine Quint <graouts@apple.com>
[Web Animations] Animation with a single keyframe is not accelerated
https://bugs.webkit.org/show_bug.cgi?id=188730
<rdar://problem/43481113>
Reviewed by Dean Jackson.
Test: webanimations/accelerated-animation-single-keyframe.html
Prior to attempting to run an accelerated effect, ensure that the KeyframeList passed to
RenderLayerModelObject::startAnimation() does not have implicit keyframes since eventually
GraphicsLayerCA::animationCanBeAccelerated() would be called and would reject a single-keyframe
animation. To do this, we use the same code used in Style::Resolver::keyframeStylesForAnimation()
which we refactor in the new KeyframeList::fillImplicitKeyframes() method.
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::copyPropertiesFromSource):
(WebCore::KeyframeEffect::applyPendingAcceleratedActions):
* rendering/style/KeyframeList.cpp:
(WebCore::KeyframeList::hasImplicitKeyframes const):
(WebCore::KeyframeList::copyKeyframes):
(WebCore::zeroPercentKeyframe):
(WebCore::hundredPercentKeyframe):
(WebCore::KeyframeList::fillImplicitKeyframes):
* rendering/style/KeyframeList.h:
* style/StyleResolver.cpp:
(WebCore::Style::Resolver::keyframeStylesForAnimation):
2020-05-15 Said Abou-Hallawa <sabouhallawa@apple.com>
The initial value of "transform-box" should be "view-box"
https://bugs.webkit.org/show_bug.cgi?id=211927
Reviewed by Simon Fraser.
Specs: https://drafts.csswg.org/css-transforms/#transform-box.
Test: svg/transforms/svg-transform-box-initial.html
* css/CSSProperties.json:
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::initialTransformBox):
2020-05-15 Andres Gonzalez <andresg_22@apple.com>
Fix for crash in accessibility/mac/replace-text-with-range-on-webarea-element.html in isolated tree mode.
https://bugs.webkit.org/show_bug.cgi?id=211954
Reviewed by Chris Fleizach.
Fixes crash in isolated tree mode in accessibility/mac/replace-text-with-range-on-webarea-element.html.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::postTextStateChangeNotification): Check for null object before dereferencing.
(WebCore::AXObjectCache::rootWebArea): Reverted to returning an AXObject since it is not needed to return AXCoreObject.
* accessibility/AXObjectCache.h:
2020-05-15 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Move column and row balancing logic to a dedicated class
https://bugs.webkit.org/show_bug.cgi?id=211937
Reviewed by Antti Koivisto.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutInFlowContent):
(WebCore::Layout::TableFormattingContext::setUsedGeometryForRows):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraSpace):
(WebCore::Layout::ColumnSpan::hasSpan): Deleted.
(WebCore::Layout::ColumnSpan::isSpanned): Deleted.
(WebCore::Layout::ColumnSpan::spanCount): Deleted.
(WebCore::Layout::ColumnSpan::startSpan): Deleted.
(WebCore::Layout::ColumnSpan::endSpan): Deleted.
(WebCore::Layout::ColumnSpan::index): Deleted.
(WebCore::Layout::ColumnSpan::size): Deleted.
(WebCore::Layout::ColumnSpan::spacing): Deleted.
(WebCore::Layout::RowSpan::hasSpan): Deleted.
(WebCore::Layout::RowSpan::isSpanned): Deleted.
(WebCore::Layout::RowSpan::spanCount): Deleted.
(WebCore::Layout::RowSpan::startSpan): Deleted.
(WebCore::Layout::RowSpan::endSpan): Deleted.
(WebCore::Layout::RowSpan::index): Deleted.
(WebCore::Layout::RowSpan::size): Deleted.
(WebCore::Layout::RowSpan::spacing): Deleted.
(WebCore::Layout::GridSpace::isEmpty const): Deleted.
(): Deleted.
(WebCore::Layout::max): Deleted.
(WebCore::Layout::operator-): Deleted.
(WebCore::Layout::operator+=): Deleted.
(WebCore::Layout::operator-=): Deleted.
(WebCore::Layout::operator/): Deleted.
(WebCore::Layout::distributeAvailableSpace): Deleted.
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace): Deleted.
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace): Deleted.
* layout/tableformatting/TableFormattingContext.h:
* layout/tableformatting/TableFormattingState.h:
(WebCore::Layout::TableFormattingState::tableGrid const):
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::widthConstraints const):
(WebCore::Layout::TableGrid::Rows::list const):
(WebCore::Layout::TableGrid::widthConstraints): Deleted.
(WebCore::Layout::TableGrid::Rows::rowList const): Deleted.
2020-05-15 Alicia Boya García <aboya@igalia.com>
[GStreamer][MediaStream] Fix missing video size
https://bugs.webkit.org/show_bug.cgi?id=211938
Reviewed by Philippe Normand.
r261683 redefined m_currentVideoStreamId. Under the new design, tracks
have several states:
- "wanted": a track has been selected from JavaScript, or chosen by
default.
- "requested": a track that is expected to be chosen by the next
STREAMS_SELECTED message.
- "current": a track that has been selected after the STREAMS_SELECTED
message has been handled.
naturalSize() used to check m_currentVideoStreamId to look for the
video size, but this is called relatively early before the track
becomes "current" under the new design.
Since the size tags can't be queried at any time, it makes sense to
use m_wantedVideoStreamId instead.
This fixes the following tests which were previously regressed:
fast/mediastream/get-user-media-constraints.html
fast/mediastream/getUserMedia-video-rescaling.html
fast/mediastream/mediastreamtrack-video-clone.html
imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-firstframe.https.html
fast/mediastream/media-stream-renders-first-frame.html
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::naturalSize const):
2020-05-15 Antti Koivisto <antti@apple.com>
[Wheel event region] Invalidation when changing listeners on elements
https://bugs.webkit.org/show_bug.cgi?id=211895
Reviewed by Simon Fraser.
Doesn't handle root (window/document) invalidation yet.
Test: fast/scrolling/mac/wheel-event-listener-region-element-invalidation.html
* dom/EventTarget.cpp:
(WebCore::EventTarget::addEventListener):
(WebCore::EventTarget::removeEventListener):
(WebCore::EventTarget::removeAllEventListeners):
Invalidate element style on wheel event changes.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::invalidateEventRegion):
Build on non-iOS platforms.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::maintainsEventRegion const):
Factor into function so it can be shared with RenderLayer::invalidateEventRegion.
(WebCore::RenderLayerBacking::updateEventRegion):
* rendering/RenderLayerBacking.h:
2020-05-15 Antoine Quint <graouts@apple.com>
Cursor should not update on a 20ms timer
https://bugs.webkit.org/show_bug.cgi?id=211884
<rdar://problem/63220368>
Reviewed by Simon Fraser.
Test: fast/events/mouse-cursor-udpate-during-raf.html
Update cursors after rAF callbacks have been serviced and layout has been updated.
* page/Page.cpp:
(WebCore::Page::updateRendering):
(WebCore::Page::doAfterUpdateRendering):
2020-05-15 Andres Gonzalez <andresg_22@apple.com>
Update the isolated tree only if isolated tree mode is enabled.
https://bugs.webkit.org/show_bug.cgi?id=211936
Reviewed by Chris Fleizach.
Check for isIsolatedTreeEnabled before updating the isolated tree.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::updateIsolatedTree):
2020-05-15 Adrian Perez de Castro <aperez@igalia.com>
[GTK3] Bring back usage of GtkMenu for context menus
https://bugs.webkit.org/show_bug.cgi?id=211557
Reviewed by Carlos Garcia Campos.
No new tests needed.
* platform/gtk/GtkVersioning.h: Remove GtkPopover functions used only for context menus.
2020-05-14 Said Abou-Hallawa <sabouhallawa@apple.com>
Unreviewed. Fix build warning after r261113
Remove unused variable.
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::preferredScriptedAnimationInterval const):
2020-05-14 Andres Gonzalez <andresg_22@apple.com>
Expose isColumnHeaderCell and isRowHeaderCell through AXCoreObject.
https://bugs.webkit.org/show_bug.cgi?id=211919
Reviewed by Chris Fleizach.
Multiple tests including accessibility/crash-table-recursive-layout.html.
- Expose isColumn/RowHeaderCell through AXCoreObject in order to make the
return value of AccessibilityTable::cellForColumnAndRow an AXCoreObject.
- Implemented these methods for AXIsolatedObject.
- isolatedCopy the accessibilityDescription property.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h:
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::cellForColumnAndRow): Removed incorrect
assert since children are AXCoreObjects and not necessarily AccessibilityTableCells.
* accessibility/AccessibilityTable.h:
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::isTableCellInSameRowGroup):
(WebCore::AccessibilityTableCell::isTableCellInSameColGroup):
(WebCore::AccessibilityTableCell::columnHeaders):
(WebCore::AccessibilityTableCell::rowHeaders):
* accessibility/AccessibilityTableCell.h:
* accessibility/AccessibilityTableColumn.cpp:
(WebCore::AccessibilityTableColumn::addChildren):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityElementForRow:andColumn:]):
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
* accessibility/isolatedtree/AXIsolatedObject.h:
2020-05-14 Timothy Hatcher <timothy@apple.com>
Add baseURL version of _WKUserStyleSheet forWKWebView.
https://bugs.webkit.org/show_bug.cgi?id=211926
rdar://problem/62074675
Reviewed by Devin Rousso.
Consolidate the paths taken for adding a UserStyleSheet. The m_injectedStyleSheetToSource
was missing for page specific style sheets since it was another loop.
* dom/ExtensionStyleSheets.cpp:
(WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const):
(WebCore::ExtensionStyleSheets::injectPageSpecificUserStyleSheet):
(WebCore::ExtensionStyleSheets::removePageSpecificUserStyleSheet):
(WebCore::ExtensionStyleSheets::detachFromDocument):
* dom/ExtensionStyleSheets.h:
2020-05-14 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthn] Relaxing signature length requirements for U2fRegister
https://bugs.webkit.org/show_bug.cgi?id=209645
<rdar://problem/63204591>
Reviewed by Brent Fulgham.
It turns out the length range specified from the spec, i.e., [71, 73] is wrong.
https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-raw-message-formats-v1.2-ps-20170411.html#registration-response-message-success
It should actually be [70, 72]. However, as a middleware to relay the messages, user agents
are not necessary to check the length. Therefore, the check is relaxed to make the code more robust.
Covered by existing tests.
* Modules/webauthn/fido/U2fResponseConverter.cpp:
(fido::WebCore::createFidoAttestationStatementFromU2fRegisterResponse):
2020-05-14 Timothy Hatcher <timothy@apple.com>
Add sourceURL to _evaluateJavaScript: so the scripts appear in Web Inspector.
https://bugs.webkit.org/show_bug.cgi?id=211904
rdar://problem/62074376
Reviewed by Devin Rousso.
Added sourceURL to RunJavaScriptParameters. Use it instead of the frame's document URL.
* bindings/js/RunJavaScriptParameters.h:
(WebCore::RunJavaScriptParameters::RunJavaScriptParameters):
(WebCore::RunJavaScriptParameters::encode const):
(WebCore::RunJavaScriptParameters::decode):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeScriptInWorldIgnoringException):
(WebCore::ScriptController::executeScriptInWorld):
(WebCore::ScriptController::callInWorld):
(WebCore::ScriptController::executeUserAgentScriptInWorld):
2020-05-14 Eric Carlson <eric.carlson@apple.com>
[Cocoa] Don't clear NowPlaying state unless it was set
https://bugs.webkit.org/show_bug.cgi?id=211899
<rdar://problem/62249870>
Reviewed by Jer Noble.
Test: media/now-playing-status-without-media.html
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::haveEverRegisteredAsNowPlayingApplication const): Method
added for testing.
* platform/audio/cocoa/MediaSessionManagerCocoa.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::updateNowPlayingInfo): Don't clear NowPlaying state unless
it was setup in the first place.
* testing/Internals.cpp:
(WebCore::Internals::nowPlayingState const): Add new property.
* testing/Internals.h:
* testing/Internals.idl:
2020-05-14 Andres Gonzalez <andresg_22@apple.com>
AXCoreObject font comparison methods should take another AXCoreObject instead of a RenderObject.
https://bugs.webkit.org/show_bug.cgi?id=211909
Reviewed by Chris Fleizach.
Covered by existing tests.
- In order for font comparison methods to be implementted for both
AXObjects and AXIsolatedObjects, they should take another AXCoreObject
to compare against, instead of a RenderObject.
- The AXIsolatedObject implementation of these methods is forwarded to
the associated AXObject and dispatched to the main thread.
- Implemented AXIsolatedObject::accessibilityDescription, hasUnderline and isUnvisited.
* accessibility/AccessibilityObject.cpp:
(WebCore::Accessibility::isAccessibilityObjectSearchMatchAtIndex):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h:
(WebCore::AXCoreObject::isNativeListBox const):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::hasSameFont const):
(WebCore::AccessibilityRenderObject::hasSameFontColor const):
(WebCore::AccessibilityRenderObject::hasSameStyle const):
* accessibility/AccessibilityRenderObject.h:
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
(WebCore::AXIsolatedObject::hasSameFont const):
(WebCore::AXIsolatedObject::hasSameFontColor const):
(WebCore::AXIsolatedObject::hasSameStyle const):
(WebCore::AXIsolatedObject::isNativeListBox const): Deleted, implemented in base class.
(WebCore::AXIsolatedObject::isUnvisited const): Deleted, inlined in header.
(WebCore::AXIsolatedObject::hasUnderline const): Deleted, inlined in header.
(WebCore::AXIsolatedObject::accessibilityDescription const): Deleted, inlined in header.
* accessibility/isolatedtree/AXIsolatedObject.h:
2020-05-14 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: front-end shouldn't change the order of User Style Sheet rules
https://bugs.webkit.org/show_bug.cgi?id=210893
<rdar://problem/61937118>
Reviewed by Devin Rousso.
Previously, some style sheets were falsly detected as Inspector::Protocol::CSS::StyleSheetOrigin::User
causing incorrect order of style rules in Web Inspector.
Test: inspector/css/getMatchedStylesForNode.html
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::detectOrigin):
2020-05-14 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] Update the placeholder icon image for attachment elements with progress="0"
https://bugs.webkit.org/show_bug.cgi?id=211898
<rdar://problem/63203900>
Reviewed by Timothy Hatcher.
Refactor logic for creating an attachment placeholder image into a separate helper method, with a
WebKitAdditions implementation when HAVE(SYSTEM_ATTACHMENT_PLACEHOLDER_ICON) is defined.
* rendering/RenderThemeMac.mm:
(WebCore::createAttachmentPlaceholderImage):
(WebCore::paintAttachmentIconPlaceholder):
2020-05-14 Chris Dumez <cdumez@apple.com>
Regression(r254856) Family Health iOS app is broken due to lack for WebSQL support
https://bugs.webkit.org/show_bug.cgi?id=211896
<rdar://problem/63025045>
Reviewed by Maciej Stachowiak.
Add RuntimeApplicationChecks function to identify Family Health app on iOS.
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isFamilyHealthApp):
2020-05-14 Andres Gonzalez <andresg_22@apple.com>
AXIsolatedTree::updateChildren needs to apply pending changes before updating the given node.
https://bugs.webkit.org/show_bug.cgi?id=211790
Reviewed by Chris Fleizach.
Covered by multiple tests.
AXIsolatedTree::updateChildren may be fired for an isolated object that
is still in the pending changes list, and thus nodeForID would fail,
causing the isolated tree to not be updated. This patch calls
applyPendingChanges before updating the given node's children.
Additional logging was added including the logging of the AXObjectCache
object hierarchy.
* accessibility/AXLogger.cpp:
(WebCore::AXLogger::log):
(WebCore::operator<<):
* accessibility/AXLogger.h:
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::postNotification):
(WebCore::AXObjectCache::performDeferredCacheUpdate):
(WebCore::AXObjectCache::updateIsolatedTree):
* accessibility/AXObjectCache.h:
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::updateNode):
(WebCore::AXIsolatedTree::updateSubtree):
(WebCore::AXIsolatedTree::updateChildren):
(WebCore::AXIsolatedTree::focusedNode):
(WebCore::AXIsolatedTree::removeNode):
(WebCore::AXIsolatedTree::removeSubtree):
(WebCore::AXIsolatedTree::applyPendingChanges):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2020-05-14 Andres Gonzalez <andresg_22@apple.com>
Fix for crash in LayoutTest in isolated tree mode.
https://bugs.webkit.org/show_bug.cgi?id=211894
Reviewed by Chris Fleizach.
Several LayoutTests.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]): Check backing object for nullity before dereferencing.
2020-05-14 Andres Gonzalez <andresg_22@apple.com>
AXIsolatedObject::isOnScreen needs to be dispatched to the main thread.
https://bugs.webkit.org/show_bug.cgi?id=211893
Reviewed by Chris Fleizach.
Covered by existing tests.
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::children): Split assert into two lines for readability.
(WebCore::AXIsolatedObject::isOnScreen const): Forward to associated AXObject and dispatch to the main thread.
2020-05-14 Andres Gonzalez <andresg_22@apple.com>
Implementation of AXIsolatedObject::hasPlainText.
https://bugs.webkit.org/show_bug.cgi?id=211892
Reviewed by Chris Fleizach.
Covered by existing tests.
Adding hasPlainText to the cached properties map.
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
(WebCore::AXIsolatedObject::hasPlainText const): Deleted, inlined in header.
* accessibility/isolatedtree/AXIsolatedObject.h:
2020-05-14 Sergio Villar Senin <svillar@igalia.com>
Unreviewed build fix.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createContextWebGL): downcast m_context to
WebGLRenderingContextBase before calling isXRCompatible(). It's created
as a WebGLRenderingContextBase but stored in a CanvasRenderingContext.
2020-05-14 Andres Gonzalez <andresg_22@apple.com>
Replacing and inserting text need to be dispatched to the main thread.
https://bugs.webkit.org/show_bug.cgi?id=211863
Reviewed by Chris Fleizach.
Covered by existing tests.
In isolated tree mode WebAccessibilityObjectWrapper accessibilityReplaceRange
and InsertText may be called on the secondary thread. Thus the AXIsolatedObject
implementation of this functionality needs to forward these calls to the
associated AXObject on the main thread.
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::replaceTextInRange):
(WebCore::AXIsolatedObject::insertText):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityReplaceRange:withText:]):
(-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
2020-05-14 Antoine Quint <graouts@apple.com>
Cursor should not update on a 20ms timer
https://bugs.webkit.org/show_bug.cgi?id=211884
<rdar://problem/63220368>
Reviewed by Antti Koivisto.
Update the cursor during page rendering rather than using a 20ms timer.
* page/EventHandler.cpp:
(WebCore::EventHandler::EventHandler):
(WebCore::EventHandler::clear):
(WebCore::EventHandler::updateCursorIfNeeded):
(WebCore::EventHandler::handleMouseMoveEvent):
(WebCore::EventHandler::scheduleCursorUpdate):
(WebCore::EventHandler::cursorUpdateTimerFired): Deleted.
* page/EventHandler.h:
* page/Page.cpp:
(WebCore::Page::updateRendering):
2020-05-14 Philippe Normand <pnormand@igalia.com>
[GStreamer] webrtc/disable-encryption.html is a crashing flaky
https://bugs.webkit.org/show_bug.cgi?id=211166
Reviewed by Xabier Rodriguez-Calvar.
Make sure the audio and video mediastream source elements are correctly removed and disposed
from their parent bin when resetting the track sources. Before this change there was a
possibility of disposing the elements while they were still in PLAYING state.
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(WebCore::_WebKitMediaStreamSrc::SourceData::reset):
(WebCore::webkitMediaStreamSrcDispose):
(WebCore::webkitMediaStreamSrcRemoveTrackByType):
2020-05-14 Adrian Perez de Castro <aperez@igalia.com>
Non-unified build fixed, mid May 2020 edition
https://bugs.webkit.org/show_bug.cgi?id=211859
Unreviewed build.
No new tests needed.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp: Add missing IDBBindingUtilities.h and
IDBSerializationContext.h includes.
* accessibility/AccessibilityRenderObject.cpp: Add missing EventHandler.h include.
* css/parser/CSSParserToken.cpp: Add missing RuntimeEnabledFeatures.h include.
* editing/gtk/WebContentReaderGtk.cpp: Add missing Blob.h include.
* html/canvas/OESTextureHalfFloat.cpp: Add missing ExtensionsGL.h include.
* page/ShareDataReader.h: Add missing ExceptionOr.h include.
* rendering/ContentfulPaintChecker.cpp: Add missing RenderView.h include.
* rendering/style/StyleRareInheritedData.h: Add missing RenderStyleConstants.h and
wtf/OptionSet.h includes.
* rendering/style/StyleRareNonInheritedData.h: Add missing TouchAction.h and wtf/OptionSet.h
includes.
* style/StyleAdjuster.h: Add missing RenderStyleConstants.h include and forward declaration
for WebCore::EventTarget.
2020-05-14 Alicia Boya García <aboya@igalia.com>
[GStreamer] Playbin3 track switch rework
https://bugs.webkit.org/show_bug.cgi?id=211623
Reviewed by Philippe Normand.
This patch reworks how track selection and reporting of selected
tracks is done in the player.
The following found limitations and assumptions in current GStreamer
have informed this patch:
a) Although the API for playbin3 is designed to be able to accept any
number of tracks of any kind, this is not supported in practice.
b) The first track of each type is always selected. Even in playbin3
mode, looking for GST_STREAM_FLAG_SELECT is not a reliable method, as
in most cases the demuxer does not set it at all. [qtdemux never sets
it at all, and matroskademux only sets it in certain cases.]
c) Sending GST_EVENT_SELECT_STREAMS is only safe at certain moments.
It's not safe before pre-roll, after EOS or during the handling of
another SELECT_STREAMS.
d) Selecting text tracks with playbin APIs is not relevant. All text
tracks are already being picked by WebKitTextCombiner, unaffected by
playbin track selection.
e) Tracks requested in a GST_EVENT_SELECT_STREAMS are eventually
selected. On the other hand, looking at
GST_MESSAGE_STREAMS_SELECTED's content is not reliable, as this has
been seen to miss tracks depending on thread luck.
This patch takes the points above into account to rework how track
selection is handled in MediaPlayerPrivateGStreamer and fix the
following issues:
1) In playbin3 mode, no track was marked as selected initially,
because of reliance on GST_STREAM_FLAG_SELECT.
2) In playbin2 mode, sometimes tracks would not be initially marked as
selected. This occurred because of reliance on the "selected" property
in inputselector sinkpads, whose initialization is racy -- it can
occur after the track has been added and picked up by WebKit.
3) In playbin3 mode, the limitations explained before has been honored
to make track selection stable, delaying SELECT_STREAMS events until
they are safe to send.
This patch doesn't introduce significative behavior changes, rather
aiming for improving the stabilitity of the player. Existing tests
should provide enough coverage.
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
(WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
(WebCore::AudioTrackPrivateGStreamer::setEnabled):
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
(WebCore::MediaPlayerPrivateGStreamer::updateEnabledVideoTrack):
(WebCore::MediaPlayerPrivateGStreamer::updateEnabledAudioTrack):
(WebCore::MediaPlayerPrivateGStreamer::playbin3SendSelectStreamsIfAppropriate):
(WebCore::MediaPlayerPrivateGStreamer::updateTracks):
(WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::didEnd):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer):
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
(WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
(WebCore::VideoTrackPrivateGStreamer::setSelected):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
2020-05-14 Philippe Normand <pnormand@igalia.com>
[GStreamer] Can't replay blob videos in web.whatsapp.com
https://bugs.webkit.org/show_bug.cgi?id=192540
Reviewed by Xabier Rodriguez-Calvar.
This is a variant of bug 211627 but I could reproduce it only for videos. Unfortunately I
wasn't able to write a reliable test for this.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::updateBufferingStatus): Prevent the fill timer from
running forever after buffering completed.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcMakeRequest): Don't buffer blobs, this doesn't seem useful as they're already
in memory anyway.
2020-05-06 Sergio Villar Senin <svillar@igalia.com>
[WebXR] Implement WebGLRenderingContextBase::makeXRCompatible()
https://bugs.webkit.org/show_bug.cgi?id=211506
Reviewed by Youenn Fablet.
The WebXR spec defines a way to mark a WebGLRenderingContext as
compatible with WebXR. This can be made at creation time (by setting the
xrCompatible) attribute or by calling makeXRCompatible().
There are several web-platform-tests testing/using this feature, however we
cannot enable them right now as we need some other features to be implemented
first.
* Modules/webxr/NavigatorWebXR.cpp:
(WebCore::NavigatorWebXR::xr): Do not pass ScriptExecutionContext and use
the Navigator's instead.
* Modules/webxr/NavigatorWebXR.h: Ditto.
* Modules/webxr/NavigatorWebXR.idl: Ditto.
* Modules/webxr/WebXRSystem.h: expose ensureImmersiveXRDeviceIsSelected() and
hasActiveImmersiveXRDevice() to be used from canvas and the rendering context.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createContextWebGL): call
ensureImmersiveXRDeviceIsSelected() if xrCompatible is set.
* html/canvas/WebGLContextAttributes.idl: Added xrCompatible.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
Initialize m_isXRCompatible.
(WebCore::WebGLRenderingContextBase::makeXRCompatible): Implemented.
* html/canvas/WebGLRenderingContextBase.h: Defined makeXRCompatible().
* html/canvas/WebGLRenderingContextBase.idl: Added makeXRCompatible().
* platform/graphics/GraphicsContextGLAttributes.h: Added xrCompatible.
* testing/Internals.cpp:
(WebCore::Internals::xrTest): Simplified the usage of NavigatorWebXR.
2020-05-13 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Add support for cases when the balancing is not based on the initial width
https://bugs.webkit.org/show_bug.cgi?id=211878
Reviewed by Antti Koivisto.
This patch adds support for the cases when the table stretches all the way to the maximum content size,
and we still choose the minimum width as the initial width and the maximum width as the base for balancing the extra space.
Consider the following 2 tables:
<table>
<tr><td style="width: 20px"></td><td>some long long long content</td></tr>
<tr><td style="width: 20px"></td><td>22px width content</td></tr>
</table>
<table>
<tr><td style="width: 20px"></td><td>some long long long content</td></tr>
<tr><td style="width: 20px"></td><td id=fixed_width style="width: 22px;">22px width content</td></tr>
</table>
These tables have the same maximum widths and they both stretch to that size.
However the second table will end up with a wider first and narrower second column because of the
width property on the [fixed_width] cell.
While the first table applies the maximum width for each columns, the second table uses the minimum width as the
initial width and balances the extra space using the maximum width (as the distribution ratio).
This produces a very different layout where the first table has no line wrapping, while
the second table wraps the "some long long long content" text (even though the used max widths are the same for each cells).
Test: fast/layoutformattingcontext/table-fixed-width-with-max-distribution.html
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::ColumnSpan::spacing):
(WebCore::Layout::RowSpan::spacing):
(WebCore::Layout::distributeAvailableSpace):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):
2020-05-13 Zalan Bujtas <zalan@apple.com>
Do not clear selection/repaint when the renderer gets moved during tree normalization.
https://bugs.webkit.org/show_bug.cgi?id=211865
<rdar://problem/62849044>
Reviewed by Antti Koivisto.
While detachFromRenderElement should really be about "this renderer is being detached from its parent", some code in here assumes
the renderer is not only going to be detached but also going to be destroyed. Ideally such code should live in RenderObject::willBeDestroyed(),
but no tree walk is possible in there anymore.
The reason for the crash is that when we split the inline for continuation, we construct new anonymous containers and move subtrees over
to these new renderers. However at this point these new parent containers are not yet attached to the tree
so any tree-walking cleanup code will fail (in detachFromRenderElement).
Test: fast/repaint/do-no-repaint-on-internal-move.html
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::detachFromRenderElement):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::splitInlines):
2020-05-13 Devin Rousso <drousso@apple.com>
Web Inspector: show EventTarget listeners as an internal property
https://bugs.webkit.org/show_bug.cgi?id=211766
Reviewed by Timothy Hatcher.
Test: inspector/runtime/getProperties-internalProperties.html
Add a `listeners` internal property for `EventTarget` objects with the value
```
listeners: {
<event>: [
{
callback: <function>
capture: <boolean>
passive: <boolean>
once: <boolean>
}
...
]
...
}
```
so long as at least one `JSEventListener` has been added prior to that point.
* inspector/WebInjectedScriptHost.cpp:
(WebCore::objectForEventTargetListeners): Added.
(WebCore::WebInjectedScriptHost::getInternalProperties):
Drive-by: only add the `name` internal property if the `Worker` actually has a name.
2020-05-13 Devin Rousso <drousso@apple.com>
Web Inspector: rename CSS.StyleSheetOrigin.Regular to CSS.StyleSheetOrigin.Author to match the spec
https://bugs.webkit.org/show_bug.cgi?id=211827
Reviewed by Timothy Hatcher.
Tests: inspector/css/add-rule.html
inspector/css/getMatchedStylesForNode.html
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::asInspectorStyleSheet):
(WebCore::InspectorCSSAgent::detectOrigin):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::buildObjectForRule):
2020-05-13 Yusuke Suzuki <ysuzuki@apple.com>
JSDOMWindowBase m_windowCloseWatchpoints must be Ref<>
https://bugs.webkit.org/show_bug.cgi?id=211844
Reviewed by Mark Lam.
JSDOMWindowBase::m_windowCloseWatchpoints is WatchpointSet, not Ref<WatchpointSet>. And it is passed to JSC IC layer via PropertySlot::setWatchpoint(...).
And ProxyableAccessCase can hold it as `RefPtr<WatchpointSet> m_additionalSet;`, this is wrong.
This patch hides WatchpointSet constructor behind `protected` to disallow non Ref<> WatchpointSet construction. We made it `protected` since InferredValueWatchpointSet
inherits WatchpointSet and uses this constructor.
Possibly, this does not matter: ProxyableAccessCase keeps Structure, which points to JSDOMWindowBase. So, it would not happen that ProxyableAccessCase has a wrong pointer
to WatchpointSet since JSDOMWindowBase is kept alive anyway. But avoid using RefCounted objects without RefCount allocation is better since this can cause bugs easily.
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::JSDOMWindowBase):
(WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow):
* bindings/js/JSDOMWindowBase.h:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlot):
2020-05-13 Jack Lee <shihchieh_lee@apple.com>
Nullptr crash in InsertParagraphSeparatorCommand::doApply when the canonical position is uneditable
https://bugs.webkit.org/show_bug.cgi?id=211864
<rdar://problem/62982161>
Reviewed by Geoffrey Garen.
The position returned by positionAvoidingSpecialElementBoundary() is uneditable so we need to
check for uneditable insertion position and bail out before calling insertNodeAt to avoid assertion.
Test: editing/inserting/insert-img-uneditable-canonical-position-crash.html
* editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::doApply):
2020-05-13 Jack Lee <shihchieh_lee@apple.com>
Nullptr crash in DeleteSelectionCommand::doApply() when merge node is disconnected.
https://bugs.webkit.org/show_bug.cgi?id=211793
<rdar://problem/62993645>
Reviewed by Geoffrey Garen.
Check for disconnected merge destination and endingSelection() after mergeParagraph is
Called and bail out to avoid using corrupted positions for node insertion.
Test: editing/inserting/insert-text-merge-node-removed-crash.html
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::mergeParagraphs):
2020-05-13 Said Abou-Hallawa <sabouhallawa@apple.com>
Re-enable 'OutsideViewport' rAF throttling
https://bugs.webkit.org/show_bug.cgi?id=211482
Reviewed by Darin Adler.
Test: fast/animation/request-animation-frame-throttling-outside-viewport.html
Make preferredFrameInterval return AggressiveThrottlingAnimationInterval
if the OutsideViewport throttling reason exists.
Add an internal setting for enabling 'OutsideViewport' rAF throttling. It
is on by default but it is off by default for DRT and WTR. An Internals
API is added to enable it for specific tests which want to test its
functionality.
* page/FrameView.cpp:
(WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
* page/Page.cpp:
(WebCore::Page::setOutsideViewportThrottlingEnabledForTesting):
* page/Page.h:
(WebCore::Page::canUpdateThrottlingReason const):
* platform/graphics/AnimationFrameRate.h:
(WebCore::preferredFrameInterval):
(WebCore::operator<<):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::setOutsideViewportThrottlingEnabled):
* testing/Internals.h:
* testing/Internals.idl:
2020-05-13 Andres Gonzalez <andresg_22@apple.com>
Remove unnecessary assert in {WebAccessibilityObjectWrapper attachmentView].
https://bugs.webkit.org/show_bug.cgi?id=211857
Reviewed by Chris Fleizach.
This assert is unnecessary since the backing object that is relevant is
the one on the main thread. This was causing crashes in LayoutTest in
isolated tree mode.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper attachmentView]):
2020-05-13 Jer Noble <jer.noble@apple.com>
Replace isNullFunctionPointer with real weak-linking support
https://bugs.webkit.org/show_bug.cgi?id=211751
Reviewed by Sam Weinig.
Use the new WTF_WEAK_LINK_FORCE_IMPORT macro.
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProvider::webRTCAvailable):
2020-05-13 Andres Gonzalez <andresg_22@apple.com>
Implementation of AXIsolatedObject::hasBoldFont and hasItalicFont.
https://bugs.webkit.org/show_bug.cgi?id=211858
Reviewed by Chris Fleizach.
Added hasBoldFont and hasItalicFont to the cached properties map.
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData): Added properties to cache.
(WebCore::AXIsolatedObject::hasBoldFont const): Deleted. Inlined in header.
(WebCore::AXIsolatedObject::hasItalicFont const): Deleted. Inlined in header.
* accessibility/isolatedtree/AXIsolatedObject.h:
2020-05-13 Tim Horton <timothy_horton@apple.com>
Add SPI for reverting to touch events for iPad trackpad interactions
https://bugs.webkit.org/show_bug.cgi?id=211824
<rdar://problem/61363084>
Reviewed by Megan Gardner.
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::mouseEventPolicy const):
(WebCore::DocumentLoader::setMouseEventPolicy):
2020-05-13 Kenneth Russell <kbr@chromium.org>
Bad flicker on three.js example
https://bugs.webkit.org/show_bug.cgi?id=183151
Reviewed by Dean Jackson.
With preserveDrawingBuffer:true and antialias:false, allocate an
intermediate texture and FBO, and blit from it to the destination
texture in prepareTexture(). Use wipeAlphaChannelFromPixels on iOS
as well as macOS.
In addition to fixing the test case from the bug, this also fixes
the webgl/2.0.0/conformance2/textures/webgl_canvas/ layout tests,
which will be re-enabled in a subsequent patch. It also passes the
more stringent webgl_canvas conformance tests in
https://github.com/KhronosGroup/WebGL/pull/3071 .
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLOpenGL::readPixelsAndConvertToBGRAIfNecessary):
(WebCore::GraphicsContextGLOpenGL::reshapeFBOs):
(WebCore::GraphicsContextGLOpenGL::resolveMultisamplingIfNecessary):
(WebCore::GraphicsContextGLOpenGL::readPixels):
(WebCore::GraphicsContextGLOpenGL::validateDepthStencil):
(WebCore::GraphicsContextGLOpenGL::prepareTexture):
(WebCore::GraphicsContextGLOpenGL::reshape):
* platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
(WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
(WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL):
* platform/graphics/opengl/GraphicsContextGLOpenGL.h:
2020-05-13 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] "Copy" context menu action for attachment element does not work in Mail
https://bugs.webkit.org/show_bug.cgi?id=211817
<rdar://problem/58043110>
Reviewed by Tim Horton.
Minor refactoring to help support writing attachment data to the pasteboard when using context menu actions to
copy an attachment element on iOS. See below for more details, as well as the WebKit ChangeLog entry.
Test: WKAttachmentTestsIOS.CopyAttachmentUsingElementAction
* editing/Editor.cpp:
(WebCore::Editor::platformContentTypeForBlobType const):
(WebCore::Editor::promisedAttachmentInfo):
Move promisedAttachmentInfo out of DragController and into Editor, so that it is accessible outside of drag
and drop code.
* editing/Editor.h:
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::platformContentTypeForBlobType const):
Move this private helper function out of DragController as well, and into Editor.
* page/DragClient.h:
* page/DragController.cpp:
(WebCore::DragController::startDrag):
Refactor this to use Editor::promisedAttachmentInfo().
(WebCore::DragController::platformContentTypeForBlobType const): Deleted.
(WebCore::DragController::promisedAttachmentInfo): Deleted.
* page/DragController.h:
* page/mac/DragControllerMac.mm:
(WebCore::DragController::platformContentTypeForBlobType const): Deleted.
2020-05-13 Antoine Quint <graouts@apple.com>
[Web Animations] Calling reverse() on an accelerated animation has no effect
https://bugs.webkit.org/show_bug.cgi?id=204717
<rdar://problem/62503582>
Reviewed by Dean Jackson.
Test: webanimations/accelerated-animation-playback-rate.html
We completely ignored the playbackRate set on a WebAnimation object when considering whether we could run an accelerated animation.
To address this we do several things.
First, we now add a playbackRate() on Animation objects such that we can make GraphicsLayerCA aware of the originating WebAnimation's
playback rate and use this data to opt out of running CA animations for animations with a playbackRate other than 1 in
GraphicsLayerCA::animationCanBeAccelerated(). We'll be looking to add support for variable playback rates for CA animations in
https://bugs.webkit.org/show_bug.cgi?id=211839.
Then, we make sure to completely replace an accelerated animation whenever one of the properties affected timing would change. Up until
now we would onyl do this for a change in the effective currentTime, but this needs to also happen when the current time doesn't change
but the animation may have changed playback rate or any of its timing properties that could change the duration of the animation. So we
remove the "Seek" command and instead use an "UpdateTiming" command that will remove the existing animation and add a new one.
This allows us to remove any notion of seeking in GraphicsLayer since now we'll just create a new animation when its timing attributes
changed.
This revealed an issue where if we called animationFinished() and startAnimation() on a RenderLayerModelObject in succession, theanimation
removal would not occur on the GraphicsLayerCA because we disregarded any pending accelerated action for an animation we knew would be
replaced. We now ensure we honor the removal in GraphicsLayerCA::appendToUncommittedAnimations().
* animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::updateTiming):
* animation/AnimationEffect.h:
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::addPendingAcceleratedAction):
(WebCore::KeyframeEffect::animationDidChangeTimingProperties):
(WebCore::KeyframeEffect::applyPendingAcceleratedActions):
(WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const):
(WebCore::KeyframeEffect::animationDidSeek): Deleted.
* animation/KeyframeEffect.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::effectTimingDidChange):
(WebCore::WebAnimation::setCurrentTime):
(WebCore::WebAnimation::setPlaybackRate):
(WebCore::WebAnimation::updatePlaybackRate):
(WebCore::WebAnimation::reverse):
* animation/WebAnimation.h:
* platform/animation/Animation.h:
(WebCore::Animation::playbackRate const):
(WebCore::Animation::setPlaybackRate):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::pauseAnimation):
(WebCore::GraphicsLayer::seekAnimation): Deleted.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::animationCanBeAccelerated const):
(WebCore::GraphicsLayerCA::updateAnimations):
(WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
(WebCore::GraphicsLayerCA::seekAnimation): Deleted.
(WebCore::GraphicsLayerCA::seekCAAnimationOnLayer): Deleted.
* platform/graphics/ca/GraphicsLayerCA.h:
* rendering/RenderElement.h:
(WebCore::RenderElement::animationPaused):
(WebCore::RenderElement::animationSeeked): Deleted.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::animationSeeked): Deleted.
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::animationSeeked): Deleted.
* rendering/RenderLayerModelObject.h:
2020-05-13 Antti Koivisto <antti@apple.com>
[Wheel event region] Debug overlay
https://bugs.webkit.org/show_bug.cgi?id=211850
Reviewed by Simon Fraser.
This is tied to the existing Wheel event handler overlay debug flag.
* platform/graphics/Color.cpp:
(WebCore::makeRGB): Deleted.
(WebCore::makeRGBA): Deleted.
* platform/graphics/Color.h:
(WebCore::makeRGB):
(WebCore::makeRGBA):
Make constexpr.
* rendering/EventRegion.cpp:
(WebCore::EventRegion::eventListenerRegionForType const):
* rendering/EventRegion.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::patternForDescription):
Factor into a function.
(WebCore::patternForTouchAction):
(WebCore::patternForEventListenerRegionType):
(WebCore::RenderLayerBacking::paintDebugOverlays):
(WebCore::RenderLayerBacking::paintContents):
2020-05-13 Antoine Quint <graouts@apple.com>
[Web Animations] Fix refactoring issue with animation suspension following r261336
https://bugs.webkit.org/show_bug.cgi?id=211842
<rdar://problem/63118326>
Reviewed by Dean Jackson.
We moved up the suspension code up from DocumentTimeline to DocumentTimelinesController in r261336
and forgot to move the code that set the initial suspension state from the DocumentTimeline constructor
to the DocumentTimelinesController constructor. This is problematic because the suspension state is
only recorded on DocumentTimelinesController itself.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::DocumentTimeline):
* animation/DocumentTimelinesController.cpp:
(WebCore::DocumentTimelinesController::DocumentTimelinesController):
(WebCore::DocumentTimelinesController::addTimeline):
2020-05-13 Simon Fraser <simon.fraser@apple.com>
composited scrolling interferes with the propagation of perspective
https://bugs.webkit.org/show_bug.cgi?id=156435
<rdar://problem/25642222>
Reviewed by Antti Koivisto.
When we made RenderLayerBacking-internal layers for composited scrolling (m_scrollContainerLayer,
m_scrolledContentsLayer) we'd lose the effects of the sublayer transform, which was applied
to the primary layer, causing perspective on the scroller to not propagate to transformed descendants.
Fix by moving the sublayer transform to the scroll container layer (adjusting the perspective
matrix as appropriate), and making the scrolled contents layer a "preserve3D" layer so
that it doesn't flatten.
This fixes both macOS and iOS.
Test: compositing/transforms/perspective-with-scrolling.html
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateChildrenTransformAndAnchorPoint):
2020-05-13 Youenn Fablet <youenn@apple.com>
Allow WebAudioBufferList to dynamically change its number of frames
https://bugs.webkit.org/show_bug.cgi?id=211720
Reviewed by Eric Carlson.
We sometimes create WebAudioBufferList on the stack which triggers allocation of several vectors.
Instead of doing that for every audio sample chunk, we should allocate the WebAudioBufferList and resize it as necessary.
For that purpose, we introduce WebAudioBufferList::updateWithNumberOfFrames and use it in two places:
- When creating an audio track into WebAudio.
- When receiving audio chunks from another process.
Covered by existing tests.
* Modules/webaudio/MediaStreamAudioSource.cpp:
(WebCore::MediaStreamAudioSource::~MediaStreamAudioSource):
* Modules/webaudio/MediaStreamAudioSource.h:
* Modules/webaudio/MediaStreamAudioSourceCocoa.cpp:
(WebCore::streamDescription):
(WebCore::MediaStreamAudioSource::consumeAudio):
* platform/audio/cocoa/WebAudioBufferList.cpp:
(WebCore::WebAudioBufferList::WebAudioBufferList):
(WebCore::WebAudioBufferList::updateWithNumberOfFrames):
(WebCore::WebAudioBufferList::channelCount const):
* platform/audio/cocoa/WebAudioBufferList.h:
* platform/mediastream/mac/MockAudioSharedUnit.mm:
(WebCore::MockAudioSharedUnit::reconfigure):
Drive-by fix, we do not need to give the size in bytes but the size in samples.
2020-05-13 Andres Gonzalez <andresg_22@apple.com>
Check for accessibilityEnabled() before posting notifications asynchronously.
https://bugs.webkit.org/show_bug.cgi?id=211848
Reviewed by Chris Fleizach.
Covered by multiple tests. Fixes crashes in LayoutTests in isolated tree mode.
During LayoutTests, accessibility may be disabled between the time the
notifications are queued and the timer fires. Thus it is necessary to
check for accessibilityEnabled() before posting the notifications
asynchronously. Not doing so was causing crashes in isolated mode.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::notificationPostTimerFired):
2020-05-13 Simon Fraser <simon.fraser@apple.com>
The perspective matrix is affected by overflow:hidden on a box with borders
https://bugs.webkit.org/show_bug.cgi?id=211828
Reviewed by Zalan Bujtas.
For a box with non-uniform borders, the layer created for overflow:hidden is not
centered in its parent layer. However, we push the childrenTransform onto this
clipping layer, so that transform needs to be adjusted to account for the geometry
of the clipping layer.
Test: compositing/transforms/perspective-with-clipping.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::perspectiveTransform const):
* rendering/RenderLayerBacking.cpp:
(WebCore::scrollContainerLayerBox):
(WebCore::clippingLayerBox):
(WebCore::overflowControlsHostLayerBox):
(WebCore::RenderLayerBacking::updateChildrenTransformAndAnchorPoint):
2020-05-13 Tomoki Imai <Tomoki.Imai@sony.com>
Selected element on Web Inspector is not highlighted with CPU Rendering.
https://bugs.webkit.org/show_bug.cgi?id=195933
Reviewed by Devin Rousso.
Expose InspectorOverlay::shouldShowOverlay via InspectorController.
It's used to determine whether WebPage needs a transparency layer to draw highlight.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::shouldShowOverlay const):
* inspector/InspectorController.h:
* inspector/InspectorOverlay.h:
2020-05-13 Zan Dobersek <zdobersek@igalia.com>
REGRESSION(r261023): [GTK][WPE] Several WebGL tests are failing
https://bugs.webkit.org/show_bug.cgi?id=211338
Reviewed by Dean Jackson.
For non-ANGLE-backed WebGL, we are still required to query the internal
format of the target texture for the texture sub-image commands. Falling
back to that behavior on !USE(ANGLE) removes regressions in a bunch of
WebGL tests.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::texImageSourceHelper):
(WebCore::WebGLRenderingContextBase::texImageArrayBufferViewHelper):
2020-05-13 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix GTK debug build after r261554
Remove writeToClipboard that receives a const SelectionData& that is no longer used. Make
readBufferFromClipboard pure virtual and remove the GTK leftovers from PlatformPasteboard.
* platform/PasteboardStrategy.h:
* platform/PlatformPasteboard.h:
2020-05-13 Antti Koivisto <antti@apple.com>
[Wheel event region] Add support for getting wheel event region from ScrollingTree
https://bugs.webkit.org/show_bug.cgi?id=211785
Reviewed by Simon Fraser.
Add ScrollingTree::eventListenerRegionTypesForPoint. It is not used yet.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::eventListenerRegionTypesForPoint const):
* page/scrolling/ScrollingTree.h:
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(collectDescendantLayersAtPoint):
(ScrollingTreeMac::eventListenerRegionTypesForPoint const):
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayerCocoa::eventRegionContainsPoint const): Deleted.
* rendering/EventRegion.cpp:
(WebCore::EventRegion::eventListenerRegionTypesForPoint const):
* rendering/EventRegion.h:
2020-05-12 Alex Christensen <achristensen@webkit.org>
Give some NetworkLoadMetrics to WebCoreNSURLSession's delegate
https://bugs.webkit.org/show_bug.cgi?id=211759
<rdar://problem/62909440>
Reviewed by Jer Noble.
This required packaging the fetchStart time with the rest of the time deltas,
passing a const NetworkLoadMetrics& down to the media loader, and packaging the data up
in an ObjC object that pretends to be NSURLSessionTaskMetrics, just like WebCoreNSURLSession
pretends to be an NSURLSession.
I manually verified the NSDates are correct. This is not straightforward to automate tests for
because of the inherant dynamic nature of timing data, and because our other WebCoreNSURLSession
tests use WebKitLegacy, and that approach won't work here because we are only hooking up data from
NSURLSession, which is only used in modern WebKit.
* Modules/beacon/NavigatorBeacon.cpp:
(WebCore::NavigatorBeacon::notifyFinished):
* Modules/beacon/NavigatorBeacon.h:
* bindings/js/CachedModuleScriptLoader.cpp:
(WebCore::CachedModuleScriptLoader::notifyFinished):
* bindings/js/CachedModuleScriptLoader.h:
* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::notifyFinished):
* dom/LoadableClassicScript.h:
* html/HTMLImageLoader.cpp:
(WebCore::HTMLImageLoader::notifyFinished):
* html/HTMLImageLoader.h:
* html/ImageDocument.cpp:
(WebCore::ImageDocument::finishedParsing):
* loader/ApplicationManifestLoader.cpp:
(WebCore::ApplicationManifestLoader::notifyFinished):
* loader/ApplicationManifestLoader.h:
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::notifyFinished):
* loader/CrossOriginPreflightChecker.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::notifyFinished):
* loader/DocumentLoader.h:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::notifyFinished):
* loader/DocumentThreadableLoader.h:
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::notifyFinished):
* loader/ImageLoader.h:
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::notifyFinished):
* loader/LinkLoader.h:
* loader/LinkPreloadResourceClients.h:
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::notifyFinished):
* loader/MediaResourceLoader.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveResponse):
(WebCore::SubresourceLoader::didFinishLoading):
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::notifyFinished):
* loader/TextTrackLoader.h:
* loader/appcache/ApplicationCacheResourceLoader.cpp:
(WebCore::ApplicationCacheResourceLoader::responseReceived):
(WebCore::ApplicationCacheResourceLoader::notifyFinished):
* loader/appcache/ApplicationCacheResourceLoader.h:
* loader/cache/CachedApplicationManifest.cpp:
(WebCore::CachedApplicationManifest::finishLoading):
* loader/cache/CachedApplicationManifest.h:
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::finishLoading):
(WebCore::CachedCSSStyleSheet::checkNotify):
* loader/cache/CachedCSSStyleSheet.h:
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::finishLoading):
(WebCore::CachedFont::checkNotify):
* loader/cache/CachedFont.h:
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::finishLoading):
* loader/cache/CachedImage.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::updateBuffer):
(WebCore::CachedRawResource::finishLoading):
* loader/cache/CachedRawResource.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):
(WebCore::CachedResource::checkNotify):
(WebCore::CachedResource::finishLoading):
(WebCore::CachedResource::error):
(WebCore::CachedResource::cancelLoad):
(WebCore::CachedResource::didAddClient):
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceClient.h:
(WebCore::CachedResourceClient::notifyFinished):
* loader/cache/CachedSVGDocument.cpp:
(WebCore::CachedSVGDocument::finishLoading):
* loader/cache/CachedSVGDocument.h:
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::finishLoading):
* loader/cache/CachedScript.h:
* loader/cache/CachedTextTrack.cpp:
(WebCore::CachedTextTrack::finishLoading):
* loader/cache/CachedTextTrack.h:
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::finishLoading):
(WebCore::CachedXSLStyleSheet::checkNotify):
* loader/cache/CachedXSLStyleSheet.h:
* loader/cache/KeepaliveRequestTracker.cpp:
(WebCore::KeepaliveRequestTracker::notifyFinished):
* loader/cache/KeepaliveRequestTracker.h:
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::notifyFinished):
* loader/icon/IconLoader.h:
* platform/graphics/PlatformMediaResourceLoader.h:
(WebCore::PlatformMediaResourceClient::loadFinished):
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::CachedResourceMediaLoader::notifyFinished):
* platform/network/NetworkLoadMetrics.h:
(WebCore::NetworkLoadMetrics::isolatedCopy const):
(WebCore::NetworkLoadMetrics::operator== const):
(WebCore::NetworkLoadMetrics::encode const):
(WebCore::NetworkLoadMetrics::decode):
(WTF::Persistence::Coder<Optional<WebCore::NetworkLoadPriority>>::encode): Deleted.
(WTF::Persistence::Coder<Optional<WebCore::NetworkLoadPriority>>::decode): Deleted.
* platform/network/cocoa/NetworkLoadMetrics.mm:
(WebCore::copyTimingData):
* platform/network/cocoa/WebCoreNSURLSession.mm:
(networkLoadMetricsDate):
(-[WebCoreNSURLSessionTaskTransactionMetrics _initWithMetrics:]):
(-[WebCoreNSURLSessionTaskTransactionMetrics fetchStartDate]):
(-[WebCoreNSURLSessionTaskTransactionMetrics domainLookupStartDate]):
(-[WebCoreNSURLSessionTaskTransactionMetrics domainLookupEndDate]):
(-[WebCoreNSURLSessionTaskTransactionMetrics connectStartDate]):
(-[WebCoreNSURLSessionTaskTransactionMetrics secureConnectionStartDate]):
(-[WebCoreNSURLSessionTaskTransactionMetrics connectEndDate]):
(-[WebCoreNSURLSessionTaskTransactionMetrics requestStartDate]):
(-[WebCoreNSURLSessionTaskTransactionMetrics responseStartDate]):
(-[WebCoreNSURLSessionTaskTransactionMetrics responseEndDate]):
(-[WebCoreNSURLSessionTaskMetrics _initWithMetrics:]):
(-[WebCoreNSURLSessionTaskMetrics transactionMetrics]):
(WebCore::WebCoreNSURLSessionDataTaskClient::loadFinished):
(-[WebCoreNSURLSessionDataTask _finish]):
(-[WebCoreNSURLSessionDataTask _resource:loadFinishedWithError:metrics:]):
(-[WebCoreNSURLSessionDataTask resource:accessControlCheckFailedWithError:]):
(-[WebCoreNSURLSessionDataTask resource:loadFailedWithError:]):
(-[WebCoreNSURLSessionDataTask resourceFinished:metrics:]):
(-[WebCoreNSURLSessionDataTask _resource:loadFinishedWithError:]): Deleted.
(-[WebCoreNSURLSessionDataTask resourceFinished:]): Deleted.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::notifyFinished):
* rendering/RenderElement.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::notifyFinished):
* rendering/RenderImage.h:
* rendering/RenderLayerFilters.cpp:
(WebCore::RenderLayerFilters::notifyFinished):
* rendering/RenderLayerFilters.h:
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::notifyFinished):
* svg/SVGFEImageElement.h:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::notifyFinished):
* svg/SVGUseElement.h:
2020-05-12 Said Abou-Hallawa <sabouhallawa@apple.com>
[CG] Change the UTI of the "WebP" image to be "org.webmproject.webp"
https://bugs.webkit.org/show_bug.cgi?id=211794
<rdar://problem/63031187>
Reviewed by Darin Adler.
See https://developers.google.com/speed/webp/docs/riff_container.
* platform/graphics/cg/UTIRegistry.cpp:
(WebCore::defaultSupportedImageTypes):
Fix review comments from bug 208038.
2020-05-12 Simon Fraser <simon.fraser@apple.com>
Move perspective-setting code into its own function
https://bugs.webkit.org/show_bug.cgi?id=211812
Reviewed by Zalan Bujtas.
Move the code that updates anchor point and children transform (for perspective)
into its own function.
No behavior change.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateChildrenTransformAndAnchorPoint):
(WebCore::computeOffsetFromAncestorGraphicsLayer):
(WebCore::RenderLayerBacking::updateGeometry):
* rendering/RenderLayerBacking.h:
2020-05-12 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthn] Don't assume extensions always exist
https://bugs.webkit.org/show_bug.cgi?id=211760
<rdar://problem/61217642>
Reviewed by Brent Fulgham.
* Modules/webauthn/fido/U2fCommandConstructor.cpp:
(fido::processGoogleLegacyAppIdSupportExtension):
2020-05-12 Jer Noble <jer.noble@apple.com>
[iOS] REGRESSION: (r261342) Play/pause button doesn't work upon first entering fullscreen mode
https://bugs.webkit.org/show_bug.cgi?id=211797
<rdar://problem/63118008>
Reviewed by Eric Carlson.
In r261342 we added code to handle "canplay" and "waiting" events without ever actually
adding event listeners for them. So when we enter fullscreen before the "canplay" event, we
never re-evaluate whether we're playing or not.
Drive-by fix: Also noticed that stalls will cause the play/pause toggle to switch from the
"pause icon" to the "play icon", which is incorrect; we're still "playing" event when we're
stalled. So when we are in the stalled state, set the "playbackRate" property to some very
small, but non-zero value. This will cause the playback slider to stop progressing, but
won't also cause the play/pause button to swap states.
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::updateForEventName):
(WebCore::PlaybackSessionModelMediaElement::observedEventNames):
2020-05-12 Chris Dumez <cdumez@apple.com>
[WK2] Neuter WKFrameIsFrameSet() / WKPageGetFrameSetLargestFrame() C API
https://bugs.webkit.org/show_bug.cgi?id=211808
Reviewed by Darin Adler.
Neuter WKFrameIsFrameSet() / WKPageGetFrameSetLargestFrame() C API. This is only SPI and is only used for slightly
different printing behavior in Safari. Framesets are no longer supported in HTML5 and are now super rare. Support
for this C API adds quite a bit of code complexity and crashes such as <rdar://problem/60322282>, it just does not
seem worth it anymore.
* dom/Document.cpp:
(WebCore::Document::resume):
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::insertedIntoAncestor):
(WebCore::HTMLFrameSetElement::removedFromAncestor):
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoaderClient.h:
2020-05-12 Simon Fraser <simon.fraser@apple.com>
Clean up some transformOrigin and perspectiveOrigin code
https://bugs.webkit.org/show_bug.cgi?id=211807
Reviewed by Zalan Bujtas.
Add LengthPoint and LengthSize-based "value for length" functions so we can do
point and size math as we do for LayoutPoint/FloatPoint etc.
Use them in code that computes transform and perspective origins.
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::computeTransformedExtentViaTransformList const):
* css/LengthFunctions.cpp:
(WebCore::sizeForLengthSize):
(WebCore::pointForLengthPoint):
(WebCore::floatPointForLengthPoint):
* css/LengthFunctions.h:
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::computeTransformedExtentViaTransformList const):
* platform/Length.h:
* platform/LengthPoint.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::perspectiveTransform const):
(WebCore::RenderLayer::perspectiveOrigin const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::computeTransformOriginForPainting const):
* rendering/style/BasicShapes.cpp:
(WebCore::BasicShapeInset::path):
(WebCore::floatSizeForLengthSize): Deleted.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::applyTransform const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::transformOriginXY const): Explicitly "xy" because it excludes the z component.
(WebCore::RenderStyle::perspectiveOrigin const):
* rendering/style/StyleRareNonInheritedData.h:
(WebCore::StyleRareNonInheritedData::perspectiveOrigin const):
* rendering/style/StyleTransformData.h:
(WebCore::StyleTransformData::originXY const):
2020-05-12 Michael Catanzaro <mcatanzaro@gnome.org>
-Wattribute warning in BreakLines.cpp
https://bugs.webkit.org/show_bug.cgi?id=211784
Reviewed by Darin Adler.
Remove export attribute. These only work in header files.
* rendering/BreakLines.cpp:
2020-05-12 Eric Carlson <eric.carlson@apple.com>
Poster set after playback begins should be ignored
https://bugs.webkit.org/show_bug.cgi?id=211464
<rdar://problem/62605114>
Reviewed by Darin Adler.
Test: media/video-poster-set-after-playback.html
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::parseAttribute): Ignore `poster` changes after first video frame
is available.
(WebCore::HTMLVideoElement::updateDisplayState): Set mode to Video if the first video
frame is available.
* testing/Internals.cpp:
(WebCore::Internals::elementShouldDisplayPosterImage const):
* testing/Internals.h:
* testing/Internals.idl:
2020-05-12 Simon Fraser <simon.fraser@apple.com>
Perpective origin should be relative to the reference box
https://bugs.webkit.org/show_bug.cgi?id=211769
Reviewed by Zalan Bujtas.
Use the reference box <https://drafts.csswg.org/css-transforms-1/#reference-box> when
computing perspective-origin <https://drafts.csswg.org/css-transforms-2/#perspective-origin-property>,
adding a referenceBox() helper on RenderBox.
The code to compute the perspective transform is wrong; for now, fudge it by passing in the border box,
but this code needs to account for GraphicsLayer geometry and transform-origin in future (webkit.org/b/211787).
Test: compositing/transforms/perspective-transform-box.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::nodeAtPoint):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::referenceBox const):
* rendering/RenderBox.h:
* rendering/RenderLayer.cpp:
(WebCore::computeReferenceRectFromBox):
(WebCore::computeReferenceBox):
(WebCore::RenderLayer::updateTransform):
(WebCore::RenderLayer::currentTransform const):
(WebCore::RenderLayer::perspectiveTransform const):
(WebCore::RenderLayer::computeClipPath const):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
2020-05-12 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed PlayStation / clang-cl build fix following r261533.
Apparently r261572 only caught half of the cases.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::estimateSize):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::generateIndexKeyMapForValue):
2020-05-12 Myles C. Maxfield <mmaxfield@apple.com>
Text is clipped when rendered with fonts which have a negative line gap metric
https://bugs.webkit.org/show_bug.cgi?id=211683
<rdar://problem/62192986>
Reviewed by Zalan Bujtas.
... As seen on nytimes.com.
Some fonts have negative line gap metrics. Chrome and Firefox both clamp it to 0, so the
line-height isn't decreased. However, we were honoring the negative line gap, thereby decreasing
line-height.
There are some typographical reasons to want a negative line gap, which is why this clamping
behavior shouldn't be done in the platform text library. In the interest of matching other
browsers, we should perform this clamping ourselves in WebKit.
Test: fast/text/negative-line-gap.html
* platform/graphics/Font.cpp:
(WebCore::Font::platformGlyphInit):
2020-05-12 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed PlayStation / clang-cl build fix following r261533.
clang for Windows (< v10.0.0) cannot destructure a const class.
See also r254471, r249524, etc.
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
2020-05-12 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed PlayStation build fix following r261494.
* PlatformPlayStation.cmake:
2020-05-12 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Rework drag and drop handling in preparation for GTK4
https://bugs.webkit.org/show_bug.cgi?id=211723
Reviewed by Adrian Perez de Castro.
Remove PasteboardHelper that is no longer used and add conversion functions to GtkUtilities.
* PlatformGTK.cmake:
* SourcesGTK.txt:
* platform/gtk/GtkUtilities.cpp:
(WebCore::gdkDragActionToDragOperation):
(WebCore::dragOperationToGdkDragActions):
(WebCore::dragOperationToSingleGdkDragAction):
* platform/gtk/GtkUtilities.h:
* platform/gtk/PasteboardHelper.cpp: Removed.
* platform/gtk/PasteboardHelper.h: Removed.
2020-05-12 Jacob Uphoff <jacob_uphoff@apple.com>
Unreviewed, reverting r261557.
This commit caused testing to exit early due to too many
crashes on macOS Catalina Asan
Reverted changeset:
"Allow WebAudioBufferList to dynamically change its number of
frames"
https://bugs.webkit.org/show_bug.cgi?id=211720
https://trac.webkit.org/changeset/261557
2020-05-12 Simon Fraser <simon.fraser@apple.com>
Speculative fix for crash in ScrollingTree::handleWheelEvent()
https://bugs.webkit.org/show_bug.cgi?id=211763
<rdar://problem/62926117>
Reviewed by Andy Estes.
Crash data shows a null-deref crash in ScrollingTree::handleWheelEvent() which
is most likely because m_rootNode is null. Protect against this.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
2020-05-12 Youenn Fablet <youenn@apple.com>
Allow WebAudioBufferList to dynamically change its number of frames
https://bugs.webkit.org/show_bug.cgi?id=211720
Reviewed by Eric Carlson.
We sometimes create WebAudioBufferList on the stack which triggers allocation of several vectors.
Instead of doing that for every audio sample chunk, we should allocate the WebAudioBufferList and resize it as necessary.
For that purpose, we introduce WebAudioBufferList::updateWithNumberOfFrames and use it in two places:
- When creating an audio track into WebAudio.
- When receiving audio chunks from another process.
Covered by existing tests.
* Modules/webaudio/MediaStreamAudioSource.cpp:
(WebCore::MediaStreamAudioSource::~MediaStreamAudioSource):
* Modules/webaudio/MediaStreamAudioSource.h:
* Modules/webaudio/MediaStreamAudioSourceCocoa.cpp:
(WebCore::streamDescription):
(WebCore::MediaStreamAudioSource::consumeAudio):
* platform/audio/cocoa/WebAudioBufferList.cpp:
(WebCore::WebAudioBufferList::WebAudioBufferList):
(WebCore::WebAudioBufferList::updateWithNumberOfFrames):
(WebCore::WebAudioBufferList::channelCount const):
* platform/audio/cocoa/WebAudioBufferList.h:
2020-05-12 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Rework clipboard handling in preparation for GTK4
https://bugs.webkit.org/show_bug.cgi?id=211511
Reviewed by Adrian Perez de Castro.
Remove PlatformPasteboard implementation that has been replaced by Clipboard class in the WebKit
layer. When Pasteboard class is created for copy and paste operations, it no longer has a SelectionData member,
it just uses the new methods in the pasteboard strategy to communicate with the clipboard. WebContentReader has
now an implementation for GTK and it's used when reading from the clipboard, the same way it's done in other ports.
* SourcesGTK.txt:
* editing/WebContentReader.h:
* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::pasteWithPasteboard): Use webContentFromPasteboard().
(WebCore::Editor::webContentFromPasteboard): Use WebContentReader.
* editing/gtk/WebContentReaderGtk.cpp: Added.
(WebCore::WebContentReader::readFilePath):
(WebCore::WebContentReader::readFilePaths):
(WebCore::WebContentReader::readHTML):
(WebCore::WebContentReader::readPlainText):
(WebCore::WebContentReader::readImage):
(WebCore::WebContentReader::readURL):
(WebCore::WebContentMarkupReader::readHTML):
* platform/Pasteboard.h:
(WebCore::PasteboardWebContentReader::readDataBuffer):
* platform/PasteboardStrategy.h:
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::Pasteboard):
(WebCore::Pasteboard::selectionData const):
(WebCore::Pasteboard::writeString):
(WebCore::Pasteboard::writePlainText):
(WebCore::Pasteboard::write):
(WebCore::Pasteboard::clear):
(WebCore::Pasteboard::canSmartReplace):
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::hasData):
(WebCore::Pasteboard::typesForLegacyUnsafeBindings):
(WebCore::Pasteboard::readString):
(WebCore::Pasteboard::fileContentState):
* platform/gtk/PasteboardHelper.cpp:
* platform/gtk/PasteboardHelper.h:
* platform/gtk/PlatformPasteboardGtk.cpp: Removed.
* platform/gtk/SelectionData.cpp:
(WebCore::SelectionData::setURL): Do not override the text and markup if it has already been set.
2020-05-12 Youenn Fablet <youenn@apple.com>
Introduce a RealtimeMediaSource video sample observer
https://bugs.webkit.org/show_bug.cgi?id=211718
Reviewed by Eric Carlson.
We introduce an observer dedicated to video samples similarly to AudioSampleObserver for audio.
This will allow to move video frame processing out of the main thread progressively.
For now, we remove video sample observing from the track private and observers should now register directly to the realtime media source.
We update the various users, including MediaRecorder and the media player.
In both cases, they will only observe the video track to be played/recorded, which is both more efficient and simpler.
We introduced RealtimeMediaSource::Observer::hasStartedProducingData callback for MediaStreamTrackPrivate so
that the processing to do when the first samples are available can be done on the main thread.
MediaStreamTrackPrivate no longer filters out samples if it is not enabled.
As such, each consumer is now responsible to observe/unobserve the source when its track gets enabled/disabled similarly as for audio,
or do nothing if track is not enabled.
Similarly, RealtimeOutgoingVideoSourceCocoa will now only observe video samples when the track is enabled and not muted.
Covered by existing tests.
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::sampleBufferUpdated): Deleted.
* Modules/mediarecorder/MediaRecorder.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
We can renove the track check since we only observe the active video track.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoSampleAvailable):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated): Deleted.
* platform/mediarecorder/MediaRecorderPrivate.h:
(WebCore::MediaRecorderPrivate::setVideoSource):
(WebCore::MediaRecorderPrivate::~MediaRecorderPrivate):
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
(WebCore::MediaRecorderPrivateAVFImpl::create):
(WebCore::MediaRecorderPrivateAVFImpl::~MediaRecorderPrivateAVFImpl):
(WebCore::MediaRecorderPrivateAVFImpl::videoSampleAvailable):
(WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
(WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated): Deleted.
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
* platform/mediarecorder/MediaRecorderPrivateMock.cpp:
(WebCore::MediaRecorderPrivateMock::MediaRecorderPrivateMock):
(WebCore::MediaRecorderPrivateMock::~MediaRecorderPrivateMock):
(WebCore::MediaRecorderPrivateMock::stopRecording):
(WebCore::MediaRecorderPrivateMock::videoSampleAvailable):
(WebCore::MediaRecorderPrivateMock::sampleBufferUpdated): Deleted.
* platform/mediarecorder/MediaRecorderPrivateMock.h:
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::hasStartedProducingData):
(WebCore::MediaStreamTrackPrivate::updateReadyState):
(WebCore::MediaStreamTrackPrivate::videoSampleAvailable): Deleted.
(WebCore::MediaStreamTrackPrivate::hasStartedProducingAudioData): Deleted.
* platform/mediastream/MediaStreamTrackPrivate.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::addVideoSampleObserver):
(WebCore::RealtimeMediaSource::removeVideoSampleObserver):
(WebCore::RealtimeMediaSource::updateHasStartedProducingData):
(WebCore::RealtimeMediaSource::videoSampleAvailable):
(WebCore::RealtimeMediaSource::audioSamplesAvailable):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::unobserveSource):
(WebCore::RealtimeOutgoingVideoSource::updateBlackFramesSending):
* platform/mediastream/RealtimeOutgoingVideoSource.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::~RealtimeVideoSource):
(WebCore::RealtimeVideoSource::startProducingData):
(WebCore::RealtimeVideoSource::stopProducingData):
(WebCore::RealtimeVideoSource::videoSampleAvailable):
* platform/mediastream/RealtimeVideoSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
(WebCore::RealtimeOutgoingVideoSourceCocoa::videoSampleAvailable):
(WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated): Deleted.
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
* platform/mock/MockRealtimeVideoSource.cpp:
* testing/Internals.cpp:
(WebCore::Internals::~Internals):
(WebCore::Internals::stopObservingRealtimeMediaSource):
(WebCore::Internals::observeMediaStreamTrack):
* testing/Internals.h:
2020-05-12 Philippe Normand <pnormand@igalia.com>
[GStreamer] Audio messages in web.whatsapp.com only play once.
https://bugs.webkit.org/show_bug.cgi?id=211627
Reviewed by Xabier Rodriguez-Calvar.
Test: media/video-src-blob-replay.html
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::updateDownloadBufferingFlag): Make sure on-disk
buffering is disabled for blob URIs, because it messes up the pipeline for replays, and it's
useless for that use-case anyway.
2020-05-12 Said Abou-Hallawa <sabouhallawa@apple.com>
Need to advertise support for WebP in the Accept header
https://bugs.webkit.org/show_bug.cgi?id=211735
Reviewed by Darin Adler.
On Mac and iOS, the system has to support WebP: HAVE(WEBP).
On other platforms, WebKit has to be able to decode WebP images: USE(WEBP).
* css/CSSCalculationValue.cpp:
(WebCore::createCSS):
Fix unrealted coding style issue.
* loader/cache/CachedResourceRequest.cpp:
(WebCore::acceptHeaderValueForImageResource):
(WebCore::acceptHeaderValueFromType):
2020-05-11 Darin Adler <darin@apple.com>
Fix problems caught by replacing WTF::Optional with std::optional
https://bugs.webkit.org/show_bug.cgi?id=211703
Reviewed by Chris Dumez.
* editing/EditorCommand.cpp:
(WebCore::executeSelectToMark): Remove erroneous code that converts
a live range to a SimpleRange and then back again.
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::willSendRequest): Pass a pointer to
a ResourceRequest.
(WebCore::InspectorNetworkAgent::didLoadResourceFromMemoryCache): Ditto.
(WebCore::InspectorNetworkAgent::buildInitiatorObject): Take a const*
to a ResourceRequest instead of an Optional<const ResourceRequest&>
because std::optional does not work with reference types.
* inspector/agents/InspectorNetworkAgent.h: Update for the change above.
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::Iterator::operator++): Fix code that was accidentally
comparing two optionals, after already checking them for null. Instead
we should compare their values.
* platform/PlatformScreen.cpp:
(WebCore::screenData): Return a const* instead of an Optional<const&>
because std::optonal does not work with reference types.
* platform/PlatformScreen.h: Updated for the above. Also removed both
the unneeded include of Optional.h (could have included Forward.h) and
of HashMap.h and put the Mac-specific type IORegistryGPUID inside a
PLATFORM(MAC) #if statement.
* platform/ScreenProperties.h: Moved the HashMap.h include here, since
this is the header that uses it. Changed the EncodedColorSpaceDataType
enum to an enum class and gave it much shorter names.
(WebCore::ScreenData::encode const): Updated for the enum class change.
Also fixed a mistake where the code would use operator<< instead of
encodeEnum for the color space type of Null. This would lead to some
kind of decoding error, rather than a null cgColorSpace.
(WebCore::ScreenData::decode): Ditto.
* platform/ios/PlatformScreenIOS.mm:
(WebCore::screenIsMonochrome): Updated since screenData returns a pointer.
(WebCore::screenHasInvertedColors): Ditto.
(WebCore::screenSupportsExtendedColor): Ditto.
(WebCore::screenSize): Ditto.
(WebCore::availableScreenSize): Ditto.
* platform/mac/PlatformScreenMac.mm: Moved declaration of
CGDisplayUsesForceToGray to CoreGraphicsSPI.h. Removed unused declaration
of CGDisplayUsesInvertedPolarity.
(WebCore::primaryOpenGLDisplayMask): Updated since screendData returns a pointer.
(WebCore::displayMaskForDisplay): Ditto.
(WebCore::gpuIDForDisplay): Ditto.
(WebCore::screenProperties): Ditto. Also renamed from getScreenProperties to
adhere to WebKit coding style.
(WebCore::screenIsMonochrome): Ditto.
(WebCore::screenHasInvertedColors): Ditto.
(WebCore::screenDepth): Ditto.
(WebCore::screenDepthPerComponent): Ditto.
(WebCore::screenRectForDisplay): Ditto.
(WebCore::screenRect): Ditto.
(WebCore::screenAvailableRect): Ditto.
(WebCore::screenColorSpace): Ditto.
(WebCore::screenSupportsExtendedColor): Ditto.
(WebCore::screenSupportsHighDynamicRange): Ditto.
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::queueTaskToFireInstallEvent):
Removed capture of unused jobDataIdentifier.
2020-05-11 James Darpinian <jdarpinian@chromium.org>
WebGLLayer clobbers TEXTURE_2D binding on iOS
https://bugs.webkit.org/show_bug.cgi?id=211758
Reviewed by Dean Jackson.
WebGLLayer was accidentally clobbering the TEXTURE_2D binding on iOS because IOSurfaces
are bound to TEXTURE_2D instead of TEXTURE_RECTANGLE. This fixes a bunch of iOS-specific
WebGL conformance failures including:
texture-bindings-unaffected-on-resize.html
default-texture.html
tex-image-and-sub-image-2d-with-canvas-rgb565.html and friends
* platform/graphics/GraphicsContextGL.h:
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer display]):
(-[WebGLLayer bindFramebufferToNextAvailableSurface]):
2020-05-11 Simon Fraser <simon.fraser@apple.com>
[ macOS ] scrollingcoordinator/mac/latching/scrolling-select-should-not-latch-mainframe.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=211747
Reviewed by Tim Horton.
Add an option to monitorWheelEvents to reset latching.
* page/Page.cpp:
(WebCore::Page::startMonitoringWheelEvents):
* page/Page.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::monitorWheelEvents):
* testing/js/WebCoreTestSupport.h:
2020-05-11 Andres Gonzalez <andresg_22@apple.com>
Fixes for crashes in isolated tree mode.
https://bugs.webkit.org/show_bug.cgi?id=211740
Reviewed by Chris Fleizach.
Fixes for several LayoutTests in isolated tree mode.
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(-[WebAccessibilityObjectWrapperBase attachIsolatedObject:]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper characterOffsetForTextMarker:]):
(-[WebAccessibilityObjectWrapper textMarkerForVisiblePosition:]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
(-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
(-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
2020-05-11 Simon Fraser <simon.fraser@apple.com>
Scrollbars flicker in RTL scrollable regions
https://bugs.webkit.org/show_bug.cgi?id=211757
Reviewed by Tim Horton.
Scrollbars deal in scroll offsets (zero-based), not scroll positions (scroll-origin based) so
the scrolling thread needs to update scrollbar painters using offsets.
Not testable because this is a transient state that gets fixed by the main thread.
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::updateScrollbarPainters):
2020-05-11 Ben Nham <nham@apple.com>
Improve accuracy of IndexedDB estimated write size computation
https://bugs.webkit.org/show_bug.cgi?id=211360
Reviewed by Brady Eidson.
We currently estimate the size of a put in IndexedDB for quota check purposes with something
like:
estimatedWriteSize = (1 + numIndices) * (keySize + valueSize)
However, this can lead to large overestimates of write sizes. This is because secondary
indices only store a mapping of secondary index key => primary key; they do not store the
entire value. In the example site attached to 202137 (another DB quota-related bug), the
the heuristic estimates that one of the put operations would use more than 800 MB when it
actually uses 220 MB. This inaccuracy leads to spurious disk quota permission modals being
presented in Safari.
This patch improves the write size computation by generating the secondary index keys before
estimating the write size. The performance should be about the same since we save the
generated index keys for later usage when we actually add the record to the DB.
* Headers.cmake:
* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::MemoryIDBBackingStore):
(WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::serializationContext):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::addRecord):
(WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
* Modules/indexeddb/server/MemoryObjectStore.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::serializationContext):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::estimateSize):
(WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
* Modules/indexeddb/shared/IndexKey.h:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::generateIndexKeyMapForValue):
* bindings/js/IDBBindingUtilities.h:
2020-05-11 Kate Cheney <katherine_cheney@apple.com>
Fail navigations to non app-bound domains after use of app-bound APIs
https://bugs.webkit.org/show_bug.cgi?id=211647
<rdar://problem/62978159>
Reviewed by Brent Fulgham.
Simplified in-app browser privacy protections check into one, better
named function.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeScriptInWorld):
* loader/FrameLoaderClient.h:
* page/Frame.cpp:
(WebCore::Frame::injectUserScriptImmediately):
* page/Page.cpp:
(WebCore::Page::injectUserStyleSheet):
* page/WebKitNamespace.cpp:
(WebCore::WebKitNamespace::messageHandlers):
* style/StyleScopeRuleSets.cpp:
(WebCore::Style::ScopeRuleSets::initializeUserStyle):
Rearranged ordering so the message to WebPageProxy only gets sent to
indicate app-bound behavior if user style sheets actually exist.
2020-05-11 Peng Liu <peng.liu6@apple.com>
Enable the mock video presentation mode in related layout tests and fix test failures
https://bugs.webkit.org/show_bug.cgi?id=211645
Reviewed by Eric Carlson.
Revert the unnecessary change in r261493 to fix the build failures when
the Picture-in-Picture API is disabled.
* html/HTMLVideoElement.cpp:
* html/HTMLVideoElement.h:
2020-05-11 Wenson Hsieh <wenson_hsieh@apple.com>
Remove some unnecessary indirection when getting Document’s Editor
https://bugs.webkit.org/show_bug.cgi?id=211744
Reviewed by Geoffrey Garen.
After r261018, there's no longer a need to reach into Document's Frame to get the Editor instance, since
Document itself owns the Editor (and Frame's implementation of editor() just calls back into the document
anyways). No change in behavior.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(AXAttributeStringSetSpelling):
* dom/Document.cpp:
(WebCore::Document::setFocusedElement):
(WebCore::Document::registerAttachmentIdentifier):
(WebCore::Document::didInsertAttachmentElement):
(WebCore::Document::didRemoveAttachmentElement):
* testing/Internals.cpp:
(WebCore::Internals::markerCountForNode):
(WebCore::Internals::setMarkedTextMatchesAreHighlighted):
(WebCore::Internals::lastSpellCheckRequestSequence):
(WebCore::Internals::lastSpellCheckProcessedSequence):
(WebCore::Internals::hasSpellingMarker):
(WebCore::Internals::hasAutocorrectedMarker):
(WebCore::Internals::setContinuousSpellCheckingEnabled):
(WebCore::Internals::setAutomaticQuoteSubstitutionEnabled):
(WebCore::Internals::setAutomaticLinkDetectionEnabled):
(WebCore::Internals::setAutomaticDashSubstitutionEnabled):
(WebCore::Internals::setAutomaticTextReplacementEnabled):
(WebCore::Internals::setAutomaticSpellingCorrectionEnabled):
(WebCore::Internals::handleAcceptedCandidate):
(WebCore::Internals::isOverwriteModeEnabled):
(WebCore::Internals::toggleOverwriteModeEnabled):
(WebCore::Internals::rangeOfString):
(WebCore::Internals::countMatchesForText):
(WebCore::Internals::hasGrammarMarker):
2020-05-11 Devin Rousso <drousso@apple.com>
Web Inspector: show JavaScript Worker name as an internal property
https://bugs.webkit.org/show_bug.cgi?id=211708
Reviewed by Timothy Hatcher.
Test: inspector/worker/worker-create-and-terminate.html
* inspector/WebInjectedScriptHost.cpp:
(WebCore::WebInjectedScriptHost::getInternalProperties):
* workers/Worker.h:
(WebCore::Worker::name const): Added.
2020-05-11 Simon Fraser <simon.fraser@apple.com>
Have ScrollingThread use a RunLoop rather than rolling its own
https://bugs.webkit.org/show_bug.cgi?id=211730
Reviewed by Darin Adler.
ScrollingThread rolled its own runloop/function dispatch by dropping to CF for macOS.
Fix to use RunLoop which provides the same functionality.
There was also a race creating the ScrollingThread for the first time, since both
the main thread, and EventDispatcher can call ScrollingThread::dispatch() early on,
so fix with a std::once block.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/scrolling/ScrollingThread.cpp:
(WebCore::ScrollingThread::singleton):
(WebCore::ScrollingThread::dispatch):
(WebCore::ScrollingThread::createThreadIfNeeded):
(WebCore::ScrollingThread::initializeRunLoop):
(WebCore::ScrollingThread::dispatchFunctionsFromScrollingThread): Deleted.
(WebCore::ScrollingThread::wakeUpRunLoop): Deleted.
(WebCore::ScrollingThread::threadRunLoopSourceCallback): Deleted.
* page/scrolling/ScrollingThread.h:
(WebCore::ScrollingThread::runLoop):
* page/scrolling/mac/ScrollingThreadMac.mm: Removed.
2020-05-11 Peng Liu <peng.liu6@apple.com>
Enable the mock video presentation mode in related layout tests and fix test failures
https://bugs.webkit.org/show_bug.cgi?id=211645
Reviewed by Darin Adler.
Clean up the internal states of video element regarding video presentation mode
to simplify the task to write reliable layout tests for video fullscreen and
Picture-in-Picture.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::enterFullscreen):
Update the states after we are sure the video element will enter fullscreen.
(WebCore::HTMLMediaElement::exitFullscreen):
Remove the unnecessary "fullscreenModeChanged(VideoFullscreenModeNone)".
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::waitingToEnterFullscreen):
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::webkitDisplayingFullscreen):
The function webkitDisplayingFullscreen() will return true after the process
to enter fullscreen is completed.
* html/HTMLVideoElement.h:
Expose didBecomeFullscreenElement() when VIDEO_PRESENTATION_MODE is enabled.
2020-05-11 Antoine Quint <graouts@apple.com>
[Web Animations] Document.getAnimations() should only consider document connection and not timeline association
https://bugs.webkit.org/show_bug.cgi?id=211697
Reviewed by Dean Jackson.
The Document.getAnimations() function should return any animation running for an element that is a child of the
target Document. We now consider all current animations, regardless of which timeline they might be associated
with. This lets us pass the final two WPT Document.getAnimations() tests.
* dom/Document.cpp:
(WebCore::Document::matchingAnimations):
2020-05-11 Andres Gonzalez <andresg_22@apple.com>
Add implementation for AXIsolatedObject::elementPath, hasHighlighting, isBlockquote, isKeyboardFocusable.
https://bugs.webkit.org/show_bug.cgi?id=211732
Reviewed by Chris Fleizach.
Covered by several tests.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isBlockquote const): Moved to base class.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h:
(WebCore::AXCoreObject::isBlockquote const):
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData): Cache the above mentioned properties.
(WebCore::AXIsolatedObject::pathAttributeValue const):
(WebCore::AXIsolatedObject::isBlockquote const): Moved to base class.
(WebCore::AXIsolatedObject::isKeyboardFocusable const): Implemented inline in header.
(WebCore::AXIsolatedObject::hasHighlighting const): Implemented inline in header.
(WebCore::AXIsolatedObject::elementPath const): Implemented inline in header.
* accessibility/isolatedtree/AXIsolatedObject.h:
2020-05-11 Alex Christensen <achristensen@webkit.org>
Fix assertion after r261414
https://bugs.webkit.org/show_bug.cgi?id=211731
This fixes a debug assertion that fired 100% of the time when running the test introduced in r261414
I also respond to Darin's and Youenn's post-commit feedback.
* page/SecurityPolicy.cpp:
(WebCore::SecurityPolicy::generateReferrerHeader):
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setHTTPReferrer):
2020-05-11 Andres Gonzalez <andresg_22@apple.com>
Check the validity of the underlying Document before updating the isolated tree.
https://bugs.webkit.org/show_bug.cgi?id=211728
Reviewed by Chris Fleizach.
Solves crashes in isolated tree mode for several LayoutTests.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::focusedUIElementForPage): Update the focused
document styles before returning the isolated tree focused object.
(WebCore::AXObjectCache::notificationPostTimerFired): Ignored
notification if underlying Document doesn't have a living render tree.
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::updateChildren): Don't update isolated object
if associated AXObject doesn't have a Document or the Document doesn't have a live render tree.
2020-05-11 Andres Gonzalez <andresg_22@apple.com>
Add mechanism to turn on accessibility isolated tree mode from WebKitTestRunner.
https://bugs.webkit.org/show_bug.cgi?id=211725
Reviewed by Chris Fleizach.
If the client is WebKitTestRunner, enable isolated tree mode.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::isIsolatedTreeEnabled):
2020-05-11 Per Arne Vollan <pvollan@apple.com>
Unreviewed, reverting r261296.
Rolling r260769 back in, since this was not causing a
regression.
Reverted changeset:
"Unreviewed, reverting r260769."
https://bugs.webkit.org/show_bug.cgi?id=211578
https://trac.webkit.org/changeset/261296
2020-05-11 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Introduce GridSpace
https://bugs.webkit.org/show_bug.cgi?id=211712
Reviewed by Antti Koivisto.
Normally we use the initial width/height (minimum width/height) value to compute the
distribution ratio for the extra space (e.g minimum widths are [ 1 ] [ 2 ] extra space: 6; final widths [ 1 + 2 ] [ 2 + 4 ]).
However is some rare case, while we use the minimum widths as the initial widths, the distribution ratio
is computed using the maximum widths.
This patch introduces GridSpace to be able to differentiate initial and distribution widths/heights (no functional change yet).
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::GridSpace::isEmpty const):
(WebCore::Layout::max):
(WebCore::Layout::operator-):
(WebCore::Layout::operator+=):
(WebCore::Layout::operator-=):
(WebCore::Layout::operator/):
(WebCore::Layout::distributeAvailableSpace):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):
2020-05-10 Antoine Quint <graouts@apple.com>
[Web Animations] Refactor animation comparison by composite order in a single utility function
https://bugs.webkit.org/show_bug.cgi?id=211695
Reviewed by Darin Adler.
We used to split sorting of animations by composite order across several functions and files. Specifically,
DocumentTimeline::getAnimations() would first collect animations by class (CSS Transitions, then CSS
Animations, then JS-originated animations), and then sort each class, calling into the static function
compareDeclarativeAnimationOwningElementPositionsInDocumentTreeOrder() in some cases and into the
WebAnimationUtilities compareAnimationsByCompositeOrder() function in other.
Since we need to be able to sort animations by composite order in other situations, for instance when sorting
events when updating animations and sending events (which we will do in a future patch), we refactor all
of the comparison logic into compareAnimationsByCompositeOrder(), removing the need to provide an AnimationList,
which is specific to the case where we know we are comparing CSSAnimation objects targeting a shared element.
This effectively empties DocumentTimeline::getAnimations() so we remove this function and filter relevant
animations in Document::matchingAnimations() and call compareAnimationsByCompositeOrder() before returning
the compiled animations.
No new tests since there is no change of behavior.
* animation/DocumentTimeline.cpp:
(WebCore::compareDeclarativeAnimationOwningElementPositionsInDocumentTreeOrder): Deleted.
(WebCore::DocumentTimeline::getAnimations const): Deleted.
* animation/DocumentTimeline.h:
* animation/KeyframeEffectStack.cpp:
(WebCore::KeyframeEffectStack::ensureEffectsAreSorted):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::commitStyles):
* animation/WebAnimationUtilities.cpp:
(WebCore::compareDeclarativeAnimationOwningElementPositionsInDocumentTreeOrder):
(WebCore::compareCSSTransitions):
(WebCore::compareCSSAnimations):
(WebCore::compareAnimationsByCompositeOrder):
* animation/WebAnimationUtilities.h:
* dom/Document.cpp:
(WebCore::Document::matchingAnimations):
2020-05-11 Charlie Turner <cturner@igalia.com>
[WPE] Layout test media/encrypted-media/mock-MediaKeySystemAccess.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=181225
Reviewed by Darin Adler.
WebCore::CDM::createInstance assumes its private instance always
produces a valid pointer. This is not the case in the testing
mocks. Guard against it.
Test: media/encrypted-media/mock-MediaKeySystemAccess.html
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::createInstance): Guard against null pointers in
mock scenarios.
2020-05-10 Rob Buis <rbuis@igalia.com>
Fix base64.any.html test
https://bugs.webkit.org/show_bug.cgi?id=211671
Reviewed by Darin Adler.
Fix base64.any.html test by extending DataURLDecoder with a
forgiving-base64 decode mode [1], as used by the Fetch
data: URL processor algorithm [2].
Behavior matches Chrome and Firefox.
[1] https://infra.spec.whatwg.org/#forgiving-base64-decode
[2] https://fetch.spec.whatwg.org/#data-url-processor
Test: imported/w3c/web-platform-tests/fetch/data-urls/base64.any.html
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::loadDataURL):
* platform/network/DataURLDecoder.cpp:
(WebCore::DataURLDecoder::decodeBase64):
(WebCore::DataURLDecoder::decode):
* platform/network/DataURLDecoder.h:
2020-05-10 Darin Adler <darin@apple.com>
Add copy constructor and assignment operator to Ref<>
https://bugs.webkit.org/show_bug.cgi?id=211705
Reviewed by Sam Weinig.
* dom/BoundaryPoint.h: As a test of the change to Ref, remove the explicit
copy and move constructors and assignment operators, relying on the defaults
instead, which are now exactly what we want.
2020-05-10 Michael Catanzaro <mcatanzaro@gnome.org>
Update user agent quirk for bankofamerica.com
https://bugs.webkit.org/show_bug.cgi?id=211700
Reviewed by Carlos Garcia Campos.
The Mac platform quirk isn't working anymore. The Chrome quirk works.
* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresChromeBrowser):
(WebCore::urlRequiresMacintoshPlatform):
2020-05-10 Darin Adler <darin@apple.com>
Remove now-unneeded HAVE(CORE_VIDEO)
https://bugs.webkit.org/show_bug.cgi?id=211677
Reviewed by Dan Bernstein.
* page/cocoa/MemoryReleaseCocoa.mm:
* platform/cocoa/CoreVideoSoftLink.cpp: Remove HAVE(CORE_VIDEO).
* platform/cocoa/CoreVideoSoftLink.h: Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage): Ditto.
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::getRGBAImageData const): Ditto.
* platform/graphics/cv/PixelBufferConformerCV.cpp: Ditto.
* platform/graphics/cv/PixelBufferConformerCV.h: Ditto.
* platform/graphics/cv/TextureCacheCV.h: Ditto.
* platform/graphics/cv/TextureCacheCV.mm: Ditto.
* platform/graphics/cv/VideoTextureCopierCV.cpp: Ditto.
* platform/graphics/cv/VideoTextureCopierCV.h: Ditto.
2020-05-09 Darin Adler <darin@apple.com>
Tighten up logic in DocumentTimelinesController::updateAnimationsAndSendEvents
https://bugs.webkit.org/show_bug.cgi?id=211668
Reviewed by Antoine Quint.
* animation/DocumentTimelinesController.cpp:
(WebCore::DocumentTimelinesController::updateAnimationsAndSendEvents):
Use Ref instead of RefPtr. Use Ref even in timelinesToUpdate; no harm in doing
a little bit of extra ref'ing. Use copyToVector when iterating relevantAnimations
since it could be a problem if the current animation was removed from the
ListHashSet while we are iterating it and there is no obvious reason that can't
happen. Use makeRef instead of makeRefPtr. Take advantage of the behavior of
the Optional operator<, which already treats nullopt as less than any non-nullopt
value, and remove unnecessary checks that weere doing the same thing explicitly.
This fixes a mistake where we were returning true when both are nullopt, which
could harm the stability of the sort, in theory. Add a null check of the timeline
when iterating completedTransitions, since there is no obvious guarantee they
could not have been removed as a side effect earlier.
2020-05-10 Darin Adler <darin@apple.com>
Use makeReversedRange and get rid of one-off ReverseView
https://bugs.webkit.org/show_bug.cgi?id=211675
Reviewed by Sam Weinig.
* editing/markup.cpp:
(WebCore::ReverseView): Deleted.
(WebCore::StyledMarkupAccumulator::takeResults): Use makeReversedRange.
2020-05-10 Tim Horton <timothy_horton@apple.com>
Clicking a tel:// link on iPad with a trackpad presents different UI than tapping on it
https://bugs.webkit.org/show_bug.cgi?id=211686
<rdar://problem/57941589>
Reviewed by Wenson Hsieh.
* dom/MouseRelatedEvent.h:
* editing/cocoa/DataDetection.h:
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::canPresentDataDetectorsUIForElement):
(WebCore::DataDetection::shouldCancelDefaultAction): Deleted.
Rename shouldCancelDefaultAction to canPresentDataDetectorsUIForElement.
This bit indicates whether a given element should invoke DD UI instead of
doing its default action, so either name is OK, but it feels better to
have it in the affirmative direction.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
Determine if tapping on an anchor should invoke DataDetectors UI instead
of performing the default action, and short-circuit if that is possible.
* loader/EmptyClients.h:
* page/ChromeClient.h:
2020-05-09 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] Search field on mayoclinic.org/forms/us-resident-appointment clips the submit button
https://bugs.webkit.org/show_bug.cgi?id=211673
<rdar://problem/62572501>
Reviewed by Tim Horton.
Allow search fields to be style-able, but only if the CSS `border` value is non-default.
Note that there was a previous attempt to achieve something similar in r157443 by adding search fields to the
base class implementation of `RenderTheme::isControlStyled`; however, this patch wasn't actually accompanied by
support for rendering native search fields with a non-default background, which meant that customizing just the
background of a search field would cause the entire search field to opt out of the native search field
appearance (a pill with rounded corners on macOS).
However, in the case where the border is customized on macOS, it is incorrect to use the default search field
appearance, since the search field cell just consists of a border; as such, there should be little compatibility
risk of a web page unexpectedly getting the fallback (non-native) appearance for a search field, due to having
custom border styles.
This also makes the behavior of search fields match that of text fields, textareas, and list boxes (multi-option
selects) on macOS, in terms of what is needed in order to bail out of native appearance rendering.
Rebaselined existing tests: fast/css/text-input-with-webkit-border-radius.html
fast/forms/search-styled.html
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::isControlStyled const): Add SearchFieldPart.
2020-05-09 Jer Noble <jer.noble@apple.com>
REGRESSION(r258493): CRASH running fast/mediastream/RTCPeerConnection tests
https://bugs.webkit.org/show_bug.cgi?id=211666
<rdar://problem/63055644>
Reviewed by Eric Carlson.
MockMediaStreamTrack advertises that it's a webrtc::VideoTrackInterface, but doesn't inherit from
that interface, leading to a crash when its pointer is cast to webrtc::VideoTrackInterface and a
virtual method called on the resulting pointer. Since it's only used in one place, and since there's
an existing mock webrtc::VideoTrackInterface object in that same file, remove MockMediaStreamTrack
and replace the one place it's used with MockLibWebRTCVideoTrack.
* testing/MockLibWebRTCPeerConnection.h:
(WebCore::MockMediaStreamTrack::state const): Deleted.
2020-05-09 David Kilzer <ddkilzer@apple.com>
XML external entity resources should only be loaded from XML MIME types
<https://webkit.org/b/211488>
<rdar://problem/62869515>
Reviewed by Darin Adler.
Tests: dom/xhtml/level3/core/entitygetinputencoding03.xhtml
dom/xhtml/level3/core/entitygetinputencoding04.xhtml
dom/xhtml/level3/core/entitygetxmlencoding02.xhtml
dom/xhtml/level3/core/entitygetxmlencoding03.xhtml
dom/xhtml/level3/core/entitygetxmlencoding04.xhtml
dom/xhtml/level3/core/entitygetxmlversion03.xhtml
dom/xhtml/level3/core/entitygetxmlversion04.xhtml
dom/xhtml/level3/core/nodegetbaseuri16.xhtml
dom/xhtml/level3/core/nodegetbaseuri19.xhtml
dom/xhtml/level3/core/nodegetbaseuri20.xhtml
fast/parser/external-entities-in-xslt.xml
fast/xsl/dtd-in-source-document.xml
fast/xsl/xslt-second-level-import.xml
http/tests/security/contentTypeOptions/nosniff-xml-external-entity.xhtml
http/tests/security/xss-DENIED-xsl-external-entity-redirect.xml
* html/HTMLBaseElement.cpp:
(WebCore::HTMLBaseElement::href const):
- Add comment about keeping code in sync with openFunc() in
XMLDocumentParserLibxml2.cpp.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::responseMIMEType const):
- Add comment about keeping code in sync with
externalEntityMimeTypeAllowed() in
XMLDocumentParserLibxml2.cpp.
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::externalEntityMimeTypeAllowed):
- Rename from externalEntityMimeTypeAllowedByNosniff().
- Change to only allow XML MIME types regardless of nosniff
option.
- Add fallback path to determine MIME type for file:/// URLs to
make layout tests work properly. Logic taken from
XMLHttpRequest::responseMIMEType(). Not sure if there was a
good place to share it.
(WebCore::openFunc):
- Fix relative URLs by providing the document's URL as a base.
Also provide an encoding if needed. Logic taken from
HTMLBaseElement::href(). (Not sure if there was a good place
to share it.) This was required to fix loading of external
entity resources in the dom/xhtml/level3/core tests, which
hadn't been loading these resources for a while. Ultimately
this didn't matter--except for new error messages being
printed in test results--because the tests fail due to missing
DOM features for XHTML documents).
- Change the fix for Bug 21963 into an empty URL check since
setting FetchOptions.mode to Mode::SameOrigin prevents a
redirect from loading a resource outside the document's
origin. The previous check worked, but the relaxed check in
externalEntityMimeTypeAllowed() caused the XML MIME type
warning to be output on redirects to non-same-origin URLs. I
didn't see a way to check for a cross-origin loading error.
- Add a console message for a cross-origin load failing.
- Update for function rename.
- Remove double negative from console message for an invalid
MIME type.
(WebCore::externalEntityMimeTypeAllowedByNosniff):
- Rename to externalEntityMimeTypeAllowed().
2020-05-09 David Kilzer <ddkilzer@apple.com>
Adapt LocalCurrentGraphicsContext for iOS
<https://webkit.org/b/211660>
Reviewed by Darin Adler.
* PlatformMac.cmake:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
- Update build files for:
- Rename of LocalCurrentGraphicsContext.mm to
LocalCurrentGraphicsContextMac.mm.
- Move of LocalCurrentGraphicsContext.h from platform/mac to
platform/cocoa.
- Addition of LocalCurrentGraphicsContextIOS.mm.
* platform/cocoa/LocalCurrentGraphicsContext.h: Renamed from Source/WebCore/platform/mac/LocalCurrentGraphicsContext.h.
- Make this work for iOS by using PLATFORM(COCOA) for the outer
guard and USE(APPKIT) for the Mac-specific bits.
- Use RetainPtr<> for NSGraphicsContext to clean up code in
LocalCurrentGraphicsContextMac.mm.
(WebCore::LocalCurrentGraphicsContext::cgContext):
- Inline from LocalCurrentGraphicsContextMac.mm.
* platform/ios/LocalCurrentGraphicsContextIOS.mm: Copied from Source/WebCore/platform/mac/LocalCurrentGraphicsContext.mm.
(WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext):
(WebCore::LocalCurrentGraphicsContext::~LocalCurrentGraphicsContext):
- Implement based on LocalCurrentGraphicsContextMac.mm. Use
UIGraphics{GetCurrent,Pop,Push}Context() functions added to
UIKitSoftLink.h.
* platform/mac/LocalCurrentGraphicsContextMac.mm: Renamed from Source/WebCore/platform/mac/LocalCurrentGraphicsContext.mm.
(WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext):
- Use m_savedGraphicsContext instead of graphicsContext in the
body of the constructor.
- Remove set-to-nil/retain of m_savedNSGraphicsContext since
that is handled by RetainPtr<> now.
(WebCore::LocalCurrentGraphicsContext::~LocalCurrentGraphicsContext):
- Remove release of m_savedNSGraphicsContext since that is
handled by RetainPtr<> now.
(WebCore::LocalCurrentGraphicsContext::cgContext): Delete.
- Inline into header to share implementation with iOS.
2020-05-09 Darin Adler <darin@apple.com>
Fix null-dereference in DocumentTimelinesController::updateAnimationsAndSendEvents
https://bugs.webkit.org/show_bug.cgi?id=211667
Reviewed by Antoine Quint.
* animation/DocumentTimelinesController.cpp:
(WebCore::DocumentTimelinesController::updateAnimationsAndSendEvents): Add null
check before removing animationsToRemove, which may already have been removed
since any arbitrary change could occur while animations are firing.
2020-05-09 Darin Adler <darin@apple.com>
Add missing null-check of page in ResourceLoader::loadDataURL
https://bugs.webkit.org/show_bug.cgi?id=211589
rdar://57213601
Reviewed by Anders Carlsson.
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::loadDataURL): Add null check before using page.
2020-05-08 Darin Adler <darin@apple.com>
Streamline MarkupAccumulator to improve efficiency a bit
https://bugs.webkit.org/show_bug.cgi?id=211656
Reviewed by Anders Carlsson.
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::appendCharactersReplacingEntities): Corrected early
exit so it returns any time the length is 0. For some reason the code before
wouldn't do the early return when offset is non-zero, which is unnecessary.
(WebCore::MarkupAccumulator::appendString): Deleted.
(WebCore::MarkupAccumulator::appendStringView): Deleted.
(WebCore::MarkupAccumulator::appendEndTag): Use variadic append to cut down
on memory allocations.
(WebCore::MarkupAccumulator::totalLength): Deleted.
(WebCore::MarkupAccumulator::concatenateMarkup): Deleted.
(WebCore::MarkupAccumulator::takeMarkup): Added.
(WebCore::MarkupAccumulator::appendQuotedURLAttributeValue): Use variadic
append to cut down on memory allocations. Also use char instead of UChar so
the string building code doesn't have to do an 8/16 bit check.
(WebCore::shouldAddNamespaceElement): Prepend a literal, don't bother to
make a String just to append to another String. Also made this a
non-member function.
(WebCore::shouldAddNamespaceAttribute): Made this a non-member function.
(WebCore::MarkupAccumulator::appendNamespace): Fix hash table usage
to use add instead of get followed by set to avoid double hashing.
Use variadic append to cut down on memory allocation.
(WebCore::MarkupAccumulator::appendText): Tweaked style to make this a
one-line function.
(WebCore::appendComment): Deleted.
(WebCore::appendXMLDeclaration): Made this a non-member function.
Use variadic append to cut down on memory allocation.
(WebCore::appendDocumentType): Made this a non-member function.
Use variadic append to cut down on memory allocation.
(WebCore::MarkupAccumulator::appendCDATASection): Deleted.
(WebCore::MarkupAccumulator::appendNonElementNode): Moved the bodies of
appendComment, appendProcessingInstruction, and appendCDATASection in
here since they can all be one-line variadic append calls.
* editing/MarkupAccumulator.h:
(WebCore::MarkupAccumulator::length const): Changed the return type
of length to be unsigned since that's what StringBuilder returns.
Made isAllASCII call StringBuilder::isAllASCII. Replaced appendString
and appendStringView with variadic append. Removed many functions
that no longer need to be member functions. Made appendAttributeValue
a static member function. Made appendNamespace private. Made
m_serializationSyntax const.
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::wrapWithStyleNode): Use append
instead of appenString.
(WebCore::StyledMarkupAccumulator::isAllASCII const): Added. Before
the code would only check the StringBuilder, but we also need to
check m_reversedPrecedingMarkup.
(WebCore::StyledMarkupAccumulator::takeResults): Use CheckedUint32
since StringBuilder's reserveCapacity function takes unsigned, not
size_t. The old code, using totalLength, would just pass a size_t
and let it get chopped off, which didn't do any harm, but it seems
strange to compute a 64-bit value just to chop off the lower 32
bits. An alternative is to compute the 32-bit value and just let
it overflow. Use a modern for loop by defining a ReverseView
template rather than writing a confusing backwards loop. Use the
new takeMarkup instead of concatenateMarkup.
(WebCore::StyledMarkupAccumulator::appendText): Tweak coding
style a little bit.
(WebCore::StyledMarkupAccumulator::appendStartTag): Ditto.
(WebCore::StyledMarkupAccumulator::appendNodeToPreserveMSOList):
Use variadic append to cut down on memory allocations.
(WebCore::propertyMissingOrEqualToNone): Tweak coding style a bit.
(WebCore::serializePreservingVisualAppearanceInternal): Use
append instead of appendString.
(WebCore::shouldPreserveMSOLists): Take a StringView instead of a
String to eliminate unnecessary memory allocation in call to substring.
(WebCore::sanitizedMarkupForFragmentInDocument): Use makeString
instead of StringBuilder to cut down on memory allocation.
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::resetDefaultButton): Fix spelling error
in the word "explicitly".
* mathml/MathMLOperatorDictionary.cpp:
(WebCore::MathMLOperatorDictionary::search): Ditto.
* page/PageSerializer.cpp:
(WebCore::PageSerializer::SerializerMarkupAccumulator::SerializerMarkupAccumulator):
Use variadic append instead of appendString to cut down on
memory allocations.
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paint): Fix spelling error in the word
"explicitly".
2020-05-09 Jack Lee <shihchieh_lee@apple.com>
Nullptr crash in LegacyWebArchive::createPropertyListRepresentation when copying selected range that contains surrogate characters
https://bugs.webkit.org/show_bug.cgi?id=211658
<rdar://problem/62844424>
Reviewed by Ryosuke Niwa.
Added check for null LegacyWebArchive in LegacyWebArchive::createFromSelection. Return nullptr when creation fails.
Test: webarchive/copy-surrogate-char-crash.html
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::createFromSelection):
2020-05-09 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com>
Fix wpt shadow-dom/slots-fallback-in-document.html
https://bugs.webkit.org/show_bug.cgi?id=211640
Reviewed by Ryosuke Niwa.
By specs, HTMLSlotElement.assignedNodes() should not count children of
a slot in a document tree for flattened assigned nodes.
https://html.spec.whatwg.org/multipage/scripting.html#dom-slot-assignednodes
https://dom.spec.whatwg.org/#find-flattened-slotables
As sideeffect, this patch also fix wpt
shadow-dom/slots-outside-shadow-dom-expected.html
Test: web-platform-tests/shadow-dom/slots-fallback-in-document.html
web-platform-tests/shadow-dom/slots-outside-shadow-dom.html
* html/HTMLSlotElement.cpp:
(WebCore::flattenAssignedNodes):
2020-05-08 Basuke Suzuki <basuke.suzuki@sony.com>
Fix build error on PlatStation port after r261132
https://bugs.webkit.org/show_bug.cgi?id=211659
Unreviewed build fix after r261132.
* page/scrolling/ScrollingTreeGestureState.cpp:
2020-05-08 David Kilzer <ddkilzer@apple.com>
Remove empty directories from from svn.webkit.org repository
<https://webkit.org/b/211644>
Reviewed by Darin Adler.
* Modules/webgpu/cocoa: Removed.
* page/scrolling/ios: Removed.
* platform/graphics/metal: Removed.
2020-05-08 Simon Fraser <simon.fraser@apple.com>
Async overflow scroll: sometimes a <select> becomes non-scrollable
https://bugs.webkit.org/show_bug.cgi?id=211433
<rdar://problem/62338474>
Reviewed by Dean Jackson.
Scrollable <select>s (RenderListBox) contribute to the non-fast scrollable region, so
wheel events inside them are propagated to the main thread. If the select is scrolled
to the end, the event will propagate to the enclosing scroller, then then FrameView::wheelEvent()
may send it back to the scrolling thread. If the scrolling thread is processing such an event
after the main thread, it should not perform any latching on the main thread.
Test: scrollingcoordinator/mac/latching/scrolling-select-should-not-latch-mainframe.html
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeLatchingController.cpp:
(WebCore::ScrollingTreeLatchingController::receivedWheelEvent):
(WebCore::ScrollingTreeLatchingController::latchedNodeForEvent const):
(WebCore::ScrollingTreeLatchingController::nodeDidHandleEvent):
(WebCore::ScrollingTreeLatchingController::clearLatchedNode):
* page/scrolling/ScrollingTreeLatchingController.h:
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::handleWheelEventAfterMainThread):
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::handleWheelEvent):
* platform/PlatformWheelEvent.cpp:
(WebCore::operator<<):
2020-05-08 Darin Adler <darin@apple.com>
Remove now-unneeded HAVE(AVFOUNDATION_LOADER_DELEGATE)
https://bugs.webkit.org/show_bug.cgi?id=211646
Reviewed by Eric Carlson.
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResourceLoader::requestResource): Remove check of
HAVE(AVFOUNDATION_LOADER_DELEGATE) in a place where it also checks PLATFORM(MAC).
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
Remove HAVE(AVFOUNDATION_LOADER_DELEGATE) in Cocoa-only code.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Ditto.
(WebCore::globalLoaderDelegateQueue): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::didStopLoadingRequest): Ditto.
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h: Ditto.
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm: Ditto.
2020-05-08 Tomoki Imai <Tomoki.Imai@sony.com>
TextureMapper should skip clipping a content layer if it's not needed
https://bugs.webkit.org/show_bug.cgi?id=210787
Reviewed by Don Olmstead.
This patch follows up r260174.
We don't need to clip a content layer if the clipping rect contains the content rect.
This patch doesn't change the behavior but saves stencil indices.
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelf):
2020-05-08 Myles C. Maxfield <mmaxfield@apple.com>
[iOS] Text-style fonts aren't locale-specific
https://bugs.webkit.org/show_bug.cgi?id=211438
<rdar://problem/51654163>
Reviewed by Sam Weinig.
Simply hook up the locale to the Core Text function.
It turns out that this patch actually has no behavior change,
because this locale is only used for font fallback, but WebKit
does its own font fallback and we already pass the locale into
CTFontCopyDefaultCascadeListForLanguages(). However, for
symmetry with CTFontCreateUIFontWithLanguage() it's a good idea
to just supply it anyway. Just in case.
Test: platform/ios/fast/text/lang-text-style.html
* platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::SystemFontDatabaseCoreText::createTextStyleFont):
2020-05-08 Kenneth Russell <kbr@chromium.org>
[WebGL2] Complete new texture upload entry points in WebGL2RenderingContext
https://bugs.webkit.org/show_bug.cgi?id=208875
Reviewed by Dean Jackson.
Implement the remaining texture upload entry points - mainly for
3D textures - in WebGL2RenderingContext. Add support for uploading
from the pixel unpack buffer.
Refactor the WebGL 2.0 binding points into WebGL2RenderingContext,
where they had previously been in the base class. Refactor
validation code to override the base class where necessary.
Refactor getParameter into WebGLRenderingContextBase and override
it in WebGL2RenderingContext, eliminating duplicate code and
fixing bugs.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::~WebGL2RenderingContext):
(WebCore::WebGL2RenderingContext::getInt64Parameter):
(WebCore::WebGL2RenderingContext::validateBufferTarget):
(WebCore::WebGL2RenderingContext::validateBufferTargetCompatibility):
(WebCore::WebGL2RenderingContext::validateBufferDataTarget):
(WebCore::WebGL2RenderingContext::validateAndCacheBufferBinding):
(WebCore::WebGL2RenderingContext::validateTexImageBinding):
(WebCore::WebGL2RenderingContext::validateTexture3DBinding):
(WebCore::WebGL2RenderingContext::copyBufferSubData):
(WebCore::WebGL2RenderingContext::bindFramebuffer):
(WebCore::WebGL2RenderingContext::deleteFramebuffer):
(WebCore::WebGL2RenderingContext::getTexParameter):
(WebCore::WebGL2RenderingContext::texStorage2D):
(WebCore::WebGL2RenderingContext::texStorage3D):
(WebCore::WebGL2RenderingContext::texImage2D):
(WebCore::WebGL2RenderingContext::texImage3D):
(WebCore::WebGL2RenderingContext::texSubImage2D):
(WebCore::WebGL2RenderingContext::texSubImage3D):
(WebCore::WebGL2RenderingContext::bindBufferBase):
(WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
(WebCore::WebGL2RenderingContext::validateFramebufferTarget):
(WebCore::WebGL2RenderingContext::getFramebufferBinding):
(WebCore::WebGL2RenderingContext::getReadFramebufferBinding):
(WebCore::WebGL2RenderingContext::restoreCurrentFramebuffer):
(WebCore::WebGL2RenderingContext::getParameter):
(WebCore::WebGL2RenderingContext::uncacheDeletedBuffer):
(WebCore::WebGL2RenderingContext::validateFramebufferFuncParameters): Deleted.
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGLBuffer.cpp:
(WebCore::WebGLBuffer::setTarget):
* html/canvas/WebGLBuffer.h:
* html/canvas/WebGLFramebuffer.cpp:
(WebCore::WebGLFramebuffer::setAttachmentForBoundFramebuffer):
(WebCore::WebGLFramebuffer::attach):
(WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer):
(WebCore::WebGLFramebuffer::isBound const):
* html/canvas/WebGLFramebuffer.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::validateFramebufferFuncParameters): Deleted.
(WebCore::WebGLRenderingContext::getParameter): Deleted.
* html/canvas/WebGLRenderingContext.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::initializeNewContext):
(WebCore::WebGLRenderingContextBase::~WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::validateBufferTarget):
(WebCore::WebGLRenderingContextBase::validateBufferDataTarget):
(WebCore::WebGLRenderingContextBase::validateAndCacheBufferBinding):
(WebCore::WebGLRenderingContextBase::bindBuffer):
(WebCore::WebGLRenderingContextBase::bindFramebuffer):
(WebCore::WebGLRenderingContextBase::bindTexture):
(WebCore::WebGLRenderingContextBase::checkFramebufferStatus):
(WebCore::WebGLRenderingContextBase::uncacheDeletedBuffer):
(WebCore::WebGLRenderingContextBase::deleteFramebuffer):
(WebCore::WebGLRenderingContextBase::deleteRenderbuffer):
(WebCore::WebGLRenderingContextBase::deleteTexture):
(WebCore::WebGLRenderingContextBase::framebufferRenderbuffer):
(WebCore::WebGLRenderingContextBase::framebufferTexture2D):
(WebCore::WebGLRenderingContextBase::getParameter):
(WebCore::WebGLRenderingContextBase::readPixels):
(WebCore::WebGLRenderingContextBase::copyTexImage2D):
(WebCore::WebGLRenderingContextBase::texParameter):
(WebCore::WebGLRenderingContextBase::getBoundReadFramebufferColorFormat):
(WebCore::WebGLRenderingContextBase::getBoundReadFramebufferWidth):
(WebCore::WebGLRenderingContextBase::getBoundReadFramebufferHeight):
(WebCore::WebGLRenderingContextBase::validateFramebufferTarget):
(WebCore::WebGLRenderingContextBase::getFramebufferBinding):
(WebCore::WebGLRenderingContextBase::getReadFramebufferBinding):
(WebCore::WebGLRenderingContextBase::validateFramebufferFuncParameters):
(WebCore::WebGLRenderingContextBase::validateBufferDataParameters):
(WebCore::WebGLRenderingContextBase::setFramebuffer):
(WebCore::WebGLRenderingContextBase::restoreCurrentFramebuffer):
(WebCore::WebGLRenderingContextBase::getInt64Parameter): Deleted.
* html/canvas/WebGLRenderingContextBase.h:
2020-05-08 Nikos Mouchtaris <nmouchtaris@apple.com>
Implement web-share v2 for files
https://bugs.webkit.org/show_bug.cgi?id=209265
Reviewed by Andy Estes.
Modified existing tests for new behavior.
Added support for handling of files in share/canShare,
and implemented asynchronous reading of data from blobs on
disk into memory.
* WebCore.xcodeproj/project.pbxproj:
* page/Navigator.cpp:
(WebCore::Navigator::canShare):
(WebCore::Navigator::share):
(WebCore::Navigator::finishedLoad):
* page/Navigator.h:
* page/ReadShareDataAsync.cpp: Added.
(WebCore::ReadShareDataAsync::readInternal):
(WebCore::ReadShareDataAsync::ReadShareDataAsync):
(WebCore::ReadShareDataAsync::~ReadShareDataAsync):
(WebCore::ReadShareDataAsync::start):
(WebCore::ReadShareDataAsync::didFinishLoading):
(WebCore::ReadShareDataAsync::didReceiveData):
(WebCore::ReadShareDataAsync::didStartLoading):
(WebCore::ReadShareDataAsync::didFail):
* page/ReadShareDataAsync.hpp: Added.
* page/ShareData.h:
2020-05-08 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, reverting r261341 and r261392.
Caused multiple regression test failures
Reverted changesets:
"Poster set after playback begins should be ignored"
https://bugs.webkit.org/show_bug.cgi?id=211464
https://trac.webkit.org/changeset/261341
"REGRESSION(r261341): imported/w3c/web-platform-
tests/html/semantics/embedded-content/the-video-
element/intrinsic_sizes.htm is failing"
https://bugs.webkit.org/show_bug.cgi?id=211612
https://trac.webkit.org/changeset/261392
2020-05-08 Alex Christensen <achristensen@webkit.org>
Limit HTTP referer to 4kb
https://bugs.webkit.org/show_bug.cgi?id=211603
<rdar://problem/56768823>
Reviewed by Chris Dumez.
Use the origin if it's longer, unless the origin is too long.
This matches the behavior of other browsers.
See https://bugzilla.mozilla.org/show_bug.cgi?id=1557346
Tested by API tests.
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setHTTPReferrer):
2020-05-08 Pinki Gyanchandani <pgyanchandani@apple.com>
SIGILL @ WebCore::Shape::createRasterShape -- DOS ASAN
https://bugs.webkit.org/show_bug.cgi?id=211539
Reviewed by Simon Fraser.
Corrected the comment.
No new test needed.
* rendering/shapes/Shape.cpp:
(WebCore::Shape::createRasterShape):
2020-05-08 Rob Buis <rbuis@igalia.com>
Fix urlsearchparams-delete.html
https://bugs.webkit.org/show_bug.cgi?id=211456
Reviewed by Daniel Bates.
Step 2 of URLSearchParams.delete algorithm [1] indicates
we should run the update steps, even if no name-value
pairs were removed.
Behavior matches Chrome and Firefox.
[1] https://url.spec.whatwg.org/#dom-urlsearchparams-delete
Test: web-platform-tests/url/urlsearchparams-delete.html
* html/URLSearchParams.cpp:
(WebCore::URLSearchParams::remove):
2020-05-08 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] caret appears in the middle of a search field when field is focused on agoda.com
https://bugs.webkit.org/show_bug.cgi?id=211591
<rdar://problem/60605873>
Reviewed by Antoine Quint.
See WebKit/ChangeLog for more details.
Test: editing/selection/ios/caret-rect-after-animating-focused-text-field.html
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::finishNotificationSteps):
Add plumbing to call out to the WebKit client layer after an animation finishes running.
* dom/Node.h:
* editing/VisibleSelection.h:
WEBCORE_EXPORT a couple of methods.
* page/ChromeClient.h:
(WebCore::ChromeClient::animationDidFinishForElement):
2020-05-08 Wenson Hsieh <wenson_hsieh@apple.com>
Preserve character set information when writing to the pasteboard when copying rich text
https://bugs.webkit.org/show_bug.cgi?id=211524
Reviewed by Darin Adler.
This patch is a followup to r261247, which introduced a workaround for Cocoa platforms to automatically add a
`meta charset` when writing HTML data to the platform pasteboard. When copying a rich text selection, we use a
different codepath when sanitizing DOM content - that is, `serializePreservingVisualAppearance`.
The previous change also introduced an enum, `AddMetaCharsetIfNeeded`, to limit applying this workaround to only
when we're writing HTML to the clipboard. However, it should be harmless to include this when reading sanitized
HTML as well, so we can also simplify this code by removing the `AddMetaCharsetIfNeeded` enum (and all of its
uses).
Test: CopyHTML.SanitizationPreservesCharacterSetInSelectedText
* Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp:
(WebCore::ClipboardItemBindingsDataSource::ClipboardItemTypeLoader::sanitizeDataIfNeeded):
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::setDataFromItemList):
* editing/MarkupAccumulator.h:
(WebCore::MarkupAccumulator::isAllASCII const):
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::sanitizeMarkupWithArchive):
(WebCore::WebContentReader::readHTML):
(WebCore::WebContentMarkupReader::readHTML):
* editing/markup.cpp:
(WebCore::sanitizeMarkup):
(WebCore::serializePreservingVisualAppearanceInternal):
Move the `meta charset` workaround from sanitizedMarkupForFragmentInDocument to
serializePreservingVisualAppearanceInternal, such that HTML data written to the pasteboard when copying rich
text can be used to load a web view, without losing the fact that the copied content was UTF-8 encoded.
(WebCore::sanitizedMarkupForFragmentInDocument):
* editing/markup.h:
2020-05-08 Andres Gonzalez <andresg_22@apple.com>
Fix for crashes in LayoutTests in isolated tree mode.
https://bugs.webkit.org/show_bug.cgi?id=211622
Reviewed by Chris Fleizach.
Several LayoutTests.
Return the root from the isolated tree when it is really ready.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::rootObject):
Some code cleanup.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::clickPoint):
2020-05-08 Simon Fraser <simon.fraser@apple.com>
Overflow scrollers in iframes don't get mouseMovedInContentArea()
https://bugs.webkit.org/show_bug.cgi?id=211347
<rdar://problem/62784560>
Reviewed by Tim Horton.
We never dispatched mouseMovedInContentArea() on ScrollableAreas in subframes, so overlay scrollbar
interactions there were broken. This is because the code ran from EventHandler::mouseMoved(), which
only runs for the main frame.
Instead, move the mouseMovedInContentArea() dispatch down into updateMouseEventTargetNode() which
is run for each subframe. notifyScrollableAreasOfMouseEvents() takes an event name so we only dispatch
for mouseMove events. There's some complexity here related to whether the old and new ScrollableArea
targets are nested; this code doesn't try to do the right thing with nesting, but does handle the mouse
moving between the scrollable main frame and an overflow region.
enclosingScrollableArea() is fixed to return the FrameView. enclosingScrollableLayer() is flawed, as noted
in the RenderLayer.h comment.
Tests: fast/scrolling/mac/scrollbars/overflow-in-iframe-overlay-scrollbar-hovered.html
fast/scrolling/mac/scrollbars/overflow-in-iframe-overlay-scrollbar-reveal.html
* page/EventHandler.cpp:
(WebCore::EventHandler::enclosingScrollableArea):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseMoveEvent):
(WebCore::EventHandler::pointerCaptureElementDidChange):
(WebCore::EventHandler::updateMouseEventTargetNode):
(WebCore::EventHandler::notifyScrollableAreasOfMouseEvents):
(WebCore::EventHandler::dispatchMouseEvent):
(WebCore::enclosingScrollableArea): Deleted.
(WebCore::EventHandler::notifyScrollableAreasOfMouseEnterExit): Deleted.
* page/EventHandler.h:
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::dispatchSyntheticMouseOut):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::debugDescription const):
* rendering/RenderLayer.h:
2020-05-08 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] The fixed logical width should be used as the max width for a cell
https://bugs.webkit.org/show_bug.cgi?id=211610
Reviewed by Antti Koivisto.
Test: fast/layoutformattingcontext/table-simple-with-fixed-widht-and-inline-content.html
* layout/tableformatting/TableFormattingContextGeometry.cpp:
(WebCore::Layout::TableFormattingContext::Geometry::intrinsicWidthConstraintsForCell):
2020-05-08 Youenn Fablet <youenn@apple.com>
Handle remote audio capture IPC messages in a background thread
https://bugs.webkit.org/show_bug.cgi?id=211583
Reviewed by Eric Carlson.
* platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp:
(WebCore::AudioMediaStreamTrackRendererCocoa::pushSamples):
Add assertion to check that we are not running on the main thread.
2020-05-08 Youenn Fablet <youenn@apple.com>
Video capture does not get unmuted in case of tab switch on iOS
https://bugs.webkit.org/show_bug.cgi?id=211509
Reviewed by Eric Carlson.
Remove setInterrupted and related code.
Instead, directly use setMuted(true/false) of the source of capture tracks.
To ensure we validate that the active source is tied to a track of the document,
we add RealtimeSource::isSameAs which handles the case of a RealtimeVideoSource wrapping an AVVideoCaptureSource.
There might be multiple video tracks with each one its RealtimeVideoSource using the same AVVideoCaptureSource.
We mute the AVVideoCaptureSource directly to make sure all linked tracks will get muted/unmuted at the same time.
Tests to be fixed.
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::MediaStreamTrack):
(WebCore::isSourceCapturingForDocument):
(WebCore::MediaStreamTrack::updateCaptureAccordingToMutedState):
* Modules/mediastream/MediaStreamTrack.h:
* dom/Document.cpp:
(WebCore::Document::visibilityStateChanged):
* platform/mediastream/RealtimeMediaSource.cpp:
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
* platform/mediastream/RealtimeMediaSourceCenter.h:
* platform/mediastream/RealtimeMediaSourceFactory.h:
* platform/mediastream/RealtimeVideoSource.h:
* platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
2020-05-07 Simon Fraser <simon.fraser@apple.com>
MayBegin wheel event in a <select> doesn't flash the scrollers
https://bugs.webkit.org/show_bug.cgi?id=211605
Reviewed by Antti Koivisto.
We need to special-case scrollable <select> elements, because they are ScrollableAreas
which are never asynchronously scrolled, so the ScrollingTree never dispatches the handleWheelEventPhase()
which is necessary to flash overlay scrollbars. Scrollable <select> elements are always in the
non-fast scrollable region.
Fix findEnclosingScrollableContainer() to return a ScrollableArea for the "maybegin" and "canceled" events
that have no delta.
Remove some "inline" and make some things references.
Tests: fast/scrolling/mac/scrollbars/select-overlay-scrollbar-hovered.html
fast/scrolling/mac/scrollbars/select-overlay-scrollbar-reveal.html
* page/EventHandler.cpp:
(WebCore::handleWheelEventPhaseInScrollableArea):
(WebCore::didScrollInScrollableArea):
(WebCore::handleWheelEventInAppropriateEnclosingBox):
(WebCore::shouldGesturesTriggerActive):
(WebCore::EventHandler::eventLoopHandleMouseUp):
(WebCore::EventHandler::eventLoopHandleMouseDragged):
* page/mac/EventHandlerMac.mm:
(WebCore::findEnclosingScrollableContainer):
(WebCore::EventHandler::determineWheelEventTarget):
* testing/Internals.cpp:
(WebCore::Internals::scrollableAreaForNode): Fix to find the ScrollableArea for RenderListBoxes.
2020-05-07 Chris Dumez <cdumez@apple.com>
Unreviewed, reverting r261252.
Reland r260684 now that a proper fix has landed in Reader
Reverted changeset:
"REGRESSION (r260684): Reader background is lost after
multitasking"
https://bugs.webkit.org/show_bug.cgi?id=211533
https://trac.webkit.org/changeset/261252
2020-05-07 Pinki Gyanchandani <pgyanchandani@apple.com>
SIGILL @ WebCore::Shape::createRasterShape -- DOS ASAN
https://bugs.webkit.org/show_bug.cgi?id=211539
Reviewed by Geoffrey Garen.
Removed the RELEASE_ASSERT because its possible for imageData to be null when imageRect size is huge value.
Test: fast/shapes/shape-outside-floats/shape-outside-imagedata-overflow.html
* rendering/shapes/Shape.cpp:
(WebCore::Shape::createRasterShape):
2020-05-07 Youenn Fablet <youenn@apple.com>
Remove AudioMediaStreamTrackRenderer::muted
https://bugs.webkit.org/show_bug.cgi?id=211289
Reviewed by Eric Carlson.
* platform/mediastream/AudioMediaStreamTrackRenderer.h:
muted is unnecessary since we are using start/stop instead.
2020-05-07 Eric Carlson <eric.carlson@apple.com>
[macOS] Playhead in Touch Bar continues when loading stalls
https://bugs.webkit.org/show_bug.cgi?id=211585
<rdar://problem/33893306>
Reviewed by Darin Adler.
* platform/cocoa/PlaybackSessionModelMediaElement.h:
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::updateForEventName): Listen for `waitingEvent`
and `canplay` events. Don't claim to be playing when stalled.
(WebCore::PlaybackSessionModelMediaElement::isStalled const): New.
2020-05-07 Eric Carlson <eric.carlson@apple.com>
Poster set after playback begins should be ignored
https://bugs.webkit.org/show_bug.cgi?id=211464
Reviewed by Jer Noble.
Redo the poster frame logic to use the `show poster flag` logic from the spec.
Test: media/video-poster-set-after-playback.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_showPoster.
(WebCore::HTMLMediaElement::prepareForLoad): m_displayMode was removed.
(WebCore::HTMLMediaElement::selectMediaResource): Call setShowPosterFlag.
(WebCore::HTMLMediaElement::loadResource): Remove calls to setDisplayMode and updateDisplayState,
they have been deleted.
(WebCore::HTMLMediaElement::waitForSourceChange): Call setShowPosterFlag. Update spec text.
(WebCore::HTMLMediaElement::noneSupported): Call setShowPosterFlag.
(WebCore::HTMLMediaElement::mediaLoadingFailed): Remove call to updateDisplayState.
(WebCore::HTMLMediaElement::setReadyState): Ditto.
(WebCore::HTMLMediaElement::seekWithTolerance): Call setShowPosterFlag.
(WebCore::HTMLMediaElement::seekTask): Check m_showPoster, not displayMode.
(WebCore::HTMLMediaElement::playInternal): Call setShowPosterFlag.
(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Don't check displayMode.
(WebCore::HTMLMediaElement::updatePlayState): No more setDisplayMode.
(WebCore::HTMLMediaElement::userCancelledLoad): Call setShowPosterFlag.
(WebCore::HTMLMediaElement::mediaPlayerFirstVideoFrameAvailable): Deleted.
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::showPosterFlag const):
(WebCore::HTMLMediaElement::setShowPosterFlag):
(WebCore::HTMLMediaElement::displayMode const): Deleted.
(WebCore::HTMLMediaElement::setDisplayMode): Deleted.
(WebCore::HTMLMediaElement::updateDisplayState): Deleted.
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::didAttachRenderers): No more updateDisplayState.
(WebCore::HTMLVideoElement::parseAttribute): Ditto. Call updateFromElement when poster is removed.
(WebCore::HTMLVideoElement::shouldDisplayPosterImage const): New.
(WebCore::HTMLVideoElement::mediaPlayerFirstVideoFrameAvailable): New, update player and
renderer if the poster isn't supposed to be visible.
(WebCore::HTMLVideoElement::setDisplayMode): Deleted.
(WebCore::HTMLVideoElement::updateDisplayState): Deleted.
* html/HTMLVideoElement.h:
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::failedToLoadPosterImage const): New.
* rendering/RenderVideo.h:
* testing/Internals.cpp:
(WebCore::Internals::elementShouldDisplayPosterImage const):
* testing/Internals.h:
* testing/Internals.idl:
2020-05-07 Jack Lee <shihchieh_lee@apple.com>
In Document::willBeRemovedFromFrame, clear FrameSelection before Editor so the selection is removed.
https://bugs.webkit.org/show_bug.cgi?id=211551
Reviewed by Geoffrey Garen.
Covered by existing tests.
* dom/Document.cpp:
(WebCore::Document::willBeRemovedFromFrame):
2020-05-07 Antoine Quint <graouts@apple.com>
[Web Animations] imported/w3c/web-platform-tests/web-animations/timing-model/timelines/update-and-send-events.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=211232
<rdar://problem/62650227>
Reviewed by Dean Jackson.
The flakiness came from this porting of the test:
animA.finished.then(() => { animB.cancel() });
animB.finished.then(() => { animA.cancel() });
Sometimes, animA and animB would finish in different frames even though they were designed to finish at the
same time. If this happened, animA.finished would resolve and trigger animB.cancel, which then rejected
animB.finished. This happened because animB was attached to a DocumentTimeline created by script which isn't
the main DocumenTimeline accessed via document.timeline. Some curious code would handle syncing of the
various timelines such that they would use a shared timebase. This was in DocumentTimeline::currentTime():
auto& mainDocumentTimeline = m_document->timeline();
if (&mainDocumentTimeline != this) {
if (auto mainDocumentTimelineCurrentTime = mainDocumentTimeline.currentTime())
return *mainDocumentTimelineCurrentTime - m_originTime;
return WTF::nullopt;
}
We now move the currentTime caching at the DocumentTimelinesController level which ensures all DocumentTimeline
objects attached to a given Document use the exact same currentTime(). This prompted some overdue refactoring
where also all the related animation suspension code is moved from DocumentTimeline up to DocumentTimelinesController.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::detachFromDocument):
(WebCore::DocumentTimeline::suspendAnimations):
(WebCore::DocumentTimeline::resumeAnimations):
(WebCore::DocumentTimeline::animationsAreSuspended const):
(WebCore::DocumentTimeline::currentTime):
(WebCore::DocumentTimeline::scheduleAnimationResolution):
(WebCore::DocumentTimeline::documentWillUpdateAnimationsAndSendEvents):
(WebCore::DocumentTimeline::animationsAreSuspended): Deleted.
(WebCore::DocumentTimeline::liveCurrentTime const): Deleted.
(WebCore::DocumentTimeline::cacheCurrentTime): Deleted.
(WebCore::DocumentTimeline::maybeClearCachedCurrentTime): Deleted.
* animation/DocumentTimeline.h:
* animation/DocumentTimelinesController.cpp:
(WebCore::DocumentTimelinesController::detachFromDocument):
(WebCore::DocumentTimelinesController::updateAnimationsAndSendEvents):
(WebCore::DocumentTimelinesController::suspendAnimations):
(WebCore::DocumentTimelinesController::resumeAnimations):
(WebCore::DocumentTimelinesController::animationsAreSuspended const):
(WebCore::DocumentTimelinesController::liveCurrentTime const):
(WebCore::DocumentTimelinesController::currentTime):
(WebCore::DocumentTimelinesController::cacheCurrentTime):
(WebCore::DocumentTimelinesController::maybeClearCachedCurrentTime):
* animation/DocumentTimelinesController.h:
* dom/Document.cpp:
(WebCore::Document::didBecomeCurrentDocumentInFrame):
(WebCore::Document::resume):
* dom/Document.h:
* page/Frame.cpp:
(WebCore::Frame::clearTimers):
(WebCore::Frame::resumeActiveDOMObjectsAndAnimations):
* page/Page.cpp:
(WebCore::Page::setIsVisibleInternal):
(WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
* testing/Internals.cpp:
(WebCore::Internals::animationsAreSuspended const):
(WebCore::Internals::suspendAnimations const):
(WebCore::Internals::resumeAnimations const):
2020-05-07 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r252161): Animation of box-shadow with border-radius set is flashy
https://bugs.webkit.org/show_bug.cgi?id=211530
<rdar://problem/62570229>
Reviewed by Zalan Bujtas.
Drawing inset box shadows with spread was broken, and in some cases generated invalid
rounded rects, causing inset shadows with border-radius to lose the radius.
First, with split inlines, the spread was not getting removed from the excluded edges.
Fix in the includeLogicalLeftEdge/includeLogicalRightEdge clauses, adding shiftXEdgeBy()/shiftYEdgeBy() helpers
to LayoutRect to simplify logic.
Second, when computing the rounded hole rect, we'd use the result of style.getRoundedInnerBorderFor()
but that doesn't take shadow spread into account, so we'd build a rounded rect with a rect that
accounted for spread, but radii computed without. That could result in unrenderable rounded rects.
Fix by calling style.getRoundedInnerBorderFor() a second time if we have spread; this will fix
up the radii for spread.
Tests: fast/box-shadow/inset-box-shadow-fractional-radius.html
fast/box-shadow/inset-shadow-split-inline.html
fast/box-shadow/inset-spread-box-shadow-split-inline.html
* platform/graphics/LayoutRect.h:
(WebCore::LayoutRect::shiftXEdgeBy):
(WebCore::LayoutRect::shiftYEdgeBy):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintBoxShadow):
2020-05-07 Don Olmstead <don.olmstead@sony.com>
Remove unused USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
https://bugs.webkit.org/show_bug.cgi?id=211582
Reviewed by Fujii Hironori.
After r261264 all ports implemented USE_REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR.
* page/ChromeClient.h:
(WebCore::ChromeClient::createDisplayRefreshMonitor const):
* page/Page.cpp:
(WebCore::Page::windowScreenDidChange):
* page/RenderingUpdateScheduler.cpp:
(WebCore::RenderingUpdateScheduler::RenderingUpdateScheduler):
(WebCore::RenderingUpdateScheduler::adjustRenderingUpdateFrequency):
(WebCore::RenderingUpdateScheduler::scheduleTimedRenderingUpdate):
(WebCore::RenderingUpdateScheduler::windowScreenDidChange):
* page/RenderingUpdateScheduler.h:
* platform/graphics/DisplayRefreshMonitor.cpp:
* platform/graphics/DisplayRefreshMonitor.h:
* platform/graphics/DisplayRefreshMonitorClient.cpp:
* platform/graphics/DisplayRefreshMonitorClient.h:
* platform/graphics/DisplayRefreshMonitorManager.cpp:
* platform/graphics/DisplayRefreshMonitorManager.h:
* platform/graphics/GraphicsLayerUpdater.cpp:
(WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater):
(WebCore::GraphicsLayerUpdater::scheduleUpdate):
(WebCore::GraphicsLayerUpdater::screenDidChange):
(WebCore::GraphicsLayerUpdater::displayRefreshFired):
(WebCore::GraphicsLayerUpdater::createDisplayRefreshMonitor const):
* platform/graphics/GraphicsLayerUpdater.h:
* platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp:
* platform/graphics/gtk/DisplayRefreshMonitorGtk.h:
* platform/graphics/ios/DisplayRefreshMonitorIOS.h:
* platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
* platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
* platform/graphics/mac/DisplayRefreshMonitorMac.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::createDisplayRefreshMonitor const):
* rendering/RenderLayerCompositor.h:
2020-05-07 Antoine Quint <graouts@apple.com>
Add watchOS media controls assets
https://bugs.webkit.org/show_bug.cgi?id=211508
Unreviewed. Cleaning up some stray logging.
* WebCore.xcodeproj/project.pbxproj:
2020-05-07 Darin Adler <darin@apple.com>
Add some missing null checks for DocumentLoader
https://bugs.webkit.org/show_bug.cgi?id=211544
rdar://62843516
Reviewed by Anders Carlsson.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::transitionToCommitted): Use some more RefPtr,
and check for null before calling DocumentLoader::responseMIMEType.
Also removed a comment that made no sense, and an assertion that was
there for no reason, left over from some point in history where it
made sense.
* loader/HistoryController.cpp:
(WebCore::FrameLoader::HistoryController::updateForRedirectWithLockedBackForwardList):
Add checks for null before calling urlForHistory and isClientRedirect.
2020-05-07 Darin Adler <darin@apple.com>
Remove USE(INSERTION_UNDO_GROUPING) checks in macOS platform code
https://bugs.webkit.org/show_bug.cgi?id=211525
Reviewed by Anders Carlsson.
* editing/mac/TextUndoInsertionMarkupMac.h: Remove
NSTextInputContext_Private.h usage. Moving to NSTextInputContextSPI.h
instead. Also remove #pragma once since this is an Objective-C-only
header, not for cross-platform use.
* editing/mac/TextUndoInsertionMarkupMac.mm: Above, plus move
NSUndoManager_Private.h to NSUndoManagerSPI.h.
2020-05-07 Sergio Villar Senin <svillar@igalia.com>
[Conditional=] not working for operations in WebGLRenderingContextBase.idl
https://bugs.webkit.org/show_bug.cgi?id=211528
Reviewed by Chris Dumez.
When an IDL interface under a given Condition defined an operation with
another Condition the generated source file should guard the operation
with both the Condition from the interface and the one from the
operation. This was working fine for sole interfaces but not for those
who were inheriting from a base one, i.e., it was not working for
supplemental interfaces.
Added a new minimalistic binding test showcasing the problem.
* bindings/scripts/CodeGenerator.pm:
(ProcessSupplementalDependencies): Add Conditionals from both interface and operation.
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::jsTestGlobalObjectTestOperationConditionalConstructorGetter): Updated result.
(WebCore::jsTestGlobalObjectTestOperationConditionalConstructor): Ditto.
(WebCore::setJSTestGlobalObjectTestOperationConditionalConstructorSetter): Ditto.
(WebCore::setJSTestGlobalObjectTestOperationConditionalConstructor): Ditto.
* bindings/scripts/test/JS/JSTestOperationBase.cpp: Added.
* bindings/scripts/test/JS/JSTestOperationBase.h: Added.
* bindings/scripts/test/JS/JSTestOperationConditional.cpp: Added.
* bindings/scripts/test/JS/JSTestOperationConditional.h: Added.
* bindings/scripts/test/TestOperationBase.idl: Added.
* bindings/scripts/test/TestOperationConditional.idl: Added.
2020-05-07 Antti Koivisto <antti@apple.com>
[Wheel event region] Include listeners on Window
https://bugs.webkit.org/show_bug.cgi?id=211577
Reviewed by Simon Fraser.
Test: fast/scrolling/mac/wheel-event-listener-region-window.html
* dom/EventTarget.h:
* dom/Node.h:
* style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::computeEventListenerRegionTypes):
Take EventTarget so this can be used with DOMWindow.
* style/StyleAdjuster.h:
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):
2020-05-07 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r261056): [ Mac WK1 ] inspector/console/console-api.html is flaky crashing
https://bugs.webkit.org/show_bug.cgi?id=211386
Reviewed by Darin Adler.
Address additional review feedback.
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::unregisterScrollbar):
2020-05-07 Zalan Bujtas <zalan@apple.com>
[LFC[TFC] Adjust the table wrapper box style
https://bugs.webkit.org/show_bug.cgi?id=211574
Reviewed by Antti Koivisto.
The computed values of properties 'position', 'float', 'margin-*', 'top', 'right', 'bottom', and 'left'
on the table element are used on the table wrapper box and not the table box; all other values of non-inheritable
properties are used on the table box and not the table wrapper box.
https://www.w3.org/TR/CSS22/tables.html#model
Test: fast/layoutformattingcontext/table-simple-with-border.html
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isBlockContainerBox const):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createLayoutBox):
(WebCore::Layout::TreeBuilder::buildTableStructure):
2020-05-07 Andres Gonzalez <andresg_22@apple.com>
Make debug build run in accessibility isolated tree mode = 1.
https://bugs.webkit.org/show_bug.cgi?id=211567
Reviewed by Chris Fleizach.
- Removed several unnecessary ASSERTs that prevent debug builds to run
in isolated tree mode = 1, i.e., isolated tree mode on main thread.
- AXIsolatedObject::children and updateBackingStore need to be executed
on both threads.
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::detachRemoteParts):
(WebCore::AXIsolatedObject::children): Need to update the children
regardless of the thread in which it is invoked. Pending, must add a
lock to prevent thread collision.
(WebCore::AXIsolatedObject::updateBackingStore): Need to update the
backing store regardless of the thread in whhich it is invoked.
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::generateSubtree):
(WebCore::AXIsolatedTree::setRootNodeID):
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm: Enable
isolated tree mode = 1.
(-[WebAccessibilityObjectWrapperBase detach]):
(-[WebAccessibilityObjectWrapperBase axBackingObject]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Use makeString
instead of String concatenation as pointed out by Darin Adler in bug 210914.
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
(-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]):
2020-05-07 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Set section [top, left] used position.
https://bugs.webkit.org/show_bug.cgi?id=211546
Reviewed by Antti Koivisto.
Test: fast/layoutformattingcontext/table-simple-with-padding.html
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutInFlowContent):
(WebCore::Layout::TableFormattingContext::setUsedGeometryForSections):
* layout/tableformatting/TableFormattingContext.h:
2020-05-07 Antti Koivisto <antti@apple.com>
[Wheel event region] Include listeners on Document
https://bugs.webkit.org/show_bug.cgi?id=211571
Reviewed by Simon Fraser.
Test: fast/scrolling/mac/wheel-event-listener-region-document.html
* style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::computeEventListenerRegionTypes):
(WebCore::Style::computeEventListenerRegionTypes): Deleted.
Make public and take Node instead of Element.
* style/StyleAdjuster.h:
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):
Gather event region bits from Document too.
2020-05-07 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r260769.
https://bugs.webkit.org/show_bug.cgi?id=211578
Introduced regressions related to sharing (Requested by
perarne on #webkit).
Reverted changeset:
"[Cocoa] After r258891, r255119 can be reverted"
https://bugs.webkit.org/show_bug.cgi?id=211083
https://trac.webkit.org/changeset/260769
2020-05-07 Darin Adler <darin@apple.com>
Fix assertions seen when trying to draw an absurdly large shadow
https://bugs.webkit.org/show_bug.cgi?id=211541
rdar://62843377
Reviewed by Geoffrey Garen.
* platform/graphics/IntSize.h:
(WebCore::IntSize::unclampedArea const): Return uint64_t instead of
size_t. Two 32-bit positive integers multiplied fit in a 64-bit integer,
but there's no guarantee they fit in a "pointer sized" integer.
* platform/graphics/ShadowBlur.cpp:
(WebCore::ShadowBlur::drawRectShadow): When comparing an IntSize area with
a FloatSize area, avoid checked overflow by using IntSize::unclampedArea,
which returns something we can compare with a float. Using IntSize::area
meant we'd intentionally crash the process if the area number doesn't fit
in a 32-bit int, which is not important or helpful.
(WebCore::ShadowBlur::drawRectShadowWithTiling): Make sure
ScratchBuffer::scheduleScratchBufferPurge is always called after
ScratchBuffer::getScratchBuffer, even it returns nullptr. An alternative
would have been to change the logic inside getScratchBuffer, but this
seems easier to get right, and no need to optimize the failure case.
(WebCore::ShadowBlur::drawInsetShadowWithTiling): Ditto.
2020-05-07 Youenn Fablet <youenn@apple.com>
Fix potential threading issue in AudioMediaStreamTrackRendererCocoa::render
https://bugs.webkit.org/show_bug.cgi?id=211560
Reviewed by Eric Carlson.
When the audio description is updated, the audio renderer is creating a new AudioSampleDataSource.
The refing of the source in the render method is not sufficient to protect agains the change.
For that purpose, we keep a separate reference to the source that is only used in the render method/render thread.
We add a boolean that tells the render method whether to update its source reference.
As long as the source reference is not updated, no new source will be created n the method processing the pushed samples.
* platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp:
(WebCore::AudioMediaStreamTrackRendererCocoa::pushSamples):
(WebCore::AudioMediaStreamTrackRendererCocoa::render):
* platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.h:
2020-05-07 Andres Gonzalez <andresg_22@apple.com>
Fix for crash in AXIsolatedObject::identifierAttribute.
https://bugs.webkit.org/show_bug.cgi?id=211565
Reviewed by Chris Fleizach.
Covered by existing tests.
When adding the identifierAttribute property to the AXIsolatedObject's
properties map, must make an isolatedCopy of it in order to retrieve it
on the secondary thread.
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
2020-05-07 Antti Koivisto <antti@apple.com>
Add basic support for generating accurate wheel event listener region
https://bugs.webkit.org/show_bug.cgi?id=211512
Reviewed by Simon Fraser.
Add fake properties for wheel event listeners to RenderStyle and use them to
generate regions in EventRegion. There is a separate region for non-passive
wheel event listeners (that will require synchronous handling).
The generated regions are not used for anything in this patch.
Style is not yet invalided on event listener additions and removals.
Test: fast/scrolling/mac/wheel-event-listener-region-basic.html
* dom/Node.h:
* rendering/EventRegion.cpp:
(WebCore::EventRegion::unite):
(WebCore::EventRegion::uniteEventListeners):
(WebCore::EventRegion::dump const):
* rendering/EventRegion.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateEventRegion):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::eventListenerRegionTypes const):
(WebCore::RenderStyle::setEventListenerRegionTypes):
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
* rendering/style/StyleRareInheritedData.h:
* style/StyleAdjuster.cpp:
(WebCore::Style::computeEventListenerRegionTypes):
(WebCore::Style::Adjuster::adjust const):
2020-05-07 Youenn Fablet <youenn@apple.com>
Sending WebRTC network packets should not go through the main thread
https://bugs.webkit.org/show_bug.cgi?id=211291
Reviewed by Eric Carlson.
Covered by existing tests.
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::filterSDP const):
Fix a case where the SDP would be badly formatted if we do not have yet a MDNS name for the corresponding IP address.
Small refactoring to use early returns.
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::getStaticFactoryAndThreads):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
Add the ability for WebKit LibWebRTCProvider to do some processing on creation of the RTC threads.
2020-05-06 Sergio Villar Senin <svillar@igalia.com>
[WebXR] Implement simulateUserActivation()
https://bugs.webkit.org/show_bug.cgi?id=211516
Reviewed by Youenn Fablet.
simulateUserActivation() is the method used by the WebXR Test API to
mock a user activation and thus let WebXR API think that the user is
behind the request that is going to be made in the function passed as
argument.
No new tests added as the imported WebXR web-platform-tests already make
use of this API.
* testing/WebXRTest.cpp:
(WebCore::WebXRTest::simulateUserActivation): Implemented.
* testing/WebXRTest.h: Added Document parameter.
* testing/WebXRTest.idl: Call with Document.
* testing/XRSimulateUserActivationFunction.h: Removed function params.
* testing/XRSimulateUserActivationFunction.idl: Ditto.
2020-05-06 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com> and Fujii Hironori <Hironori.Fujii@sony.com>
[Win] Implement DisplayRefreshMonitor by using RunLoop::Timer
https://bugs.webkit.org/show_bug.cgi?id=211431
Reviewed by Don Olmstead.
* PlatformWin.cmake:
* platform/graphics/DisplayRefreshMonitor.cpp:
(WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor):
* platform/graphics/win/DisplayRefreshMonitorWin.cpp: Added.
(WebCore::DisplayRefreshMonitorWin::create):
(WebCore::DisplayRefreshMonitorWin::DisplayRefreshMonitorWin):
(WebCore::DisplayRefreshMonitorWin::requestRefreshCallback):
(WebCore::DisplayRefreshMonitorWin::displayLinkFired):
* platform/graphics/win/DisplayRefreshMonitorWin.h: Added.
2020-05-06 Zalan Bujtas <zalan@apple.com>
[ContentObservation] Shutterstock search bar is not activated on the first tap
https://bugs.webkit.org/show_bug.cgi?id=211529
<rdar://problem/58843932>
Reviewed by Simon Fraser.
* page/Quirks.cpp:
(WebCore::Quirks::shouldIgnoreContentObservationForSyntheticClick const):
* page/Quirks.h:
2020-05-06 Jack Lee <shihchieh_lee@apple.com>
Nullptr crash in indentOutdentCommand::formatRange with asynchronous commands: indent and insert list.
https://bugs.webkit.org/show_bug.cgi?id=211466
<rdar://problem/62845430>
Reviewed by Geoffrey Garen.
Check for null outerBlock returned by splitTreeToNode and bail out.
Test: fast/editing/indent-then-insertUL-crash.html
* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::indentIntoBlockquote):
2020-05-06 Darin Adler <darin@apple.com>
Make a helper for the pattern of ICU functions that may need to be called twice to populate a buffer
https://bugs.webkit.org/show_bug.cgi?id=211499
Reviewed by Ross Kirsling.
* editing/TextIterator.cpp:
(WebCore::normalizeCharacters): Use callBufferProducingFunction.
2020-05-06 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r261056): [ Mac WK1 ] inspector/console/console-api.html is flaky crashing
https://bugs.webkit.org/show_bug.cgi?id=211386
Reviewed by Tim Horton.
This bug was caused by the failure to clear the delegate on an NSScrollerImp when, for testing,
we flip between the native scrollbar theme, and the mock scrollbar theme.
The crux of the fix is to have ScrollAnimatorMac's scrollerImpForScrollbar() call a
static function on ScrollbarThemeMac to get the painters, rather than going through
the possibly-null ScrollbarThemeMac instance.
A belt-and-braces fix in ScrollbarThemeMac::unregisterScrollbar() always clears the delegate
on the NSScrollerImp when unregistering a scrollbar.
Finally, modernize code in various places.
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::scrollerImpForScrollbar):
(WebCore::ScrollAnimatorMac::updateScrollerStyle):
* platform/mac/ScrollbarThemeMac.h:
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::scrollbarMap):
(+[WebScrollbarPrefsObserver appearancePrefsChanged:]):
(WebCore::ScrollbarThemeMac::registerScrollbar):
(WebCore::ScrollbarThemeMac::unregisterScrollbar):
(WebCore::ScrollbarThemeMac::setNewPainterForScrollbar):
(WebCore::ScrollbarThemeMac::painterForScrollbar):
(WebCore::ScrollbarThemeMac::hasThumb):
(WebCore::ScrollbarThemeMac::minimumThumbLength):
(WebCore::ScrollbarThemeMac::updateEnabledState):
(WebCore::ScrollbarThemeMac::paint):
2020-05-06 Jack Lee <shihchieh_lee@apple.com>
Nullptr crash in InsertListCommand::doApply with user-select:none elements
https://bugs.webkit.org/show_bug.cgi?id=211534
<rdar://problem/62898521>
Reviewed by Geoffrey Garen.
Check for empty position in InsertListCommand::doApply when searching for the start of
last paragraph in the selected range. Skip listifying individual paragraphs in the range.
Test: editing/inserting/insert-list-user-select-none-crash.html
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApply):
2020-05-06 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, reverting r261239.
Caused fast/events/wheel-event-outside-body.html to assert on
macOS WK1
Reverted changeset:
"Add basic support for generating accurate wheel event
listener region"
https://bugs.webkit.org/show_bug.cgi?id=211512
https://trac.webkit.org/changeset/261239
2020-05-06 Chris Dumez <cdumez@apple.com>
REGRESSION (r260684): Reader background is lost after multitasking
https://bugs.webkit.org/show_bug.cgi?id=211533
<rdar://problem/62941837>
Unreviewed, revert r260684 due to regression.
* dom/EventTarget.cpp:
(WebCore::EventTarget::fireEventListeners):
* page/FrameView.cpp:
(WebCore::FrameView::sendResizeEventIfNeeded):
* page/Page.h:
(WebCore::Page::shouldFireResizeEvents const):
(WebCore::Page::setShouldFireResizeEvents):
2020-05-06 Chris Fleizach <cfleizach@apple.com>
AX: Implement accessibility of HTML 5.1 Drag & Drop
https://bugs.webkit.org/show_bug.cgi?id=211415
<rdar://problem/22695531>
Reviewed by Joanmarie Diggs.
Support HTML5 drag and drop. Support dropzone attribute.
Add new notifications for VoiceOver to consume.
It appears that most of the dragging tests are skipped because of eventSender issues.
I think this test could do a little more if those issues were resolved. Specifically, not all
the notifications are seen that are expected.
Test: accessibility/mac/draggable.html
* accessibility/AXObjectCache.h:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::supportsARIAAttributes const):
(WebCore::AccessibilityObject::isAXHidden const):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::supportsDropping const):
(WebCore::AccessibilityRenderObject::supportsDragging const):
(WebCore::AccessibilityRenderObject::isGrabbed):
(WebCore::AccessibilityRenderObject::determineDropEffects):
(WebCore::AccessibilityRenderObject::supportsARIADropping const): Deleted.
(WebCore::AccessibilityRenderObject::supportsARIADragging const): Deleted.
(WebCore::AccessibilityRenderObject::isARIAGrabbed): Deleted.
(WebCore::AccessibilityRenderObject::determineARIADropEffects): Deleted.
* accessibility/AccessibilityRenderObject.h:
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
* accessibility/isolatedtree/AXIsolatedObject.h:
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::postPlatformNotification):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* html/HTMLAttributeNames.in:
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchDragEvent):
(WebCore::EventHandler::draggingElement const):
* page/EventHandler.h:
2020-05-06 Wenson Hsieh <wenson_hsieh@apple.com>
Cut and paste from Google Doc to Notes in several (non-Latin) languages doesn't work
https://bugs.webkit.org/show_bug.cgi?id=211498
<rdar://problem/56675345>
Reviewed by Darin Adler.
When copying text in Google Docs, the page uses `DataTransfer.setData` to write text/html data to the system
pasteboard. This markup string includes a meta tag with `charset="utf-8"`, indicating that the HTML string that
was copied should be interpreted as UTF-8 data.
However, before we write this data to the system pasteboard, we first sanitize it by loading it in a separate
page, and then build the final sanitized markup string to write by iterating over only visible content in the
main document of this page. Importantly, this last step skips over the meta element containing the charset.
Later, when pasting in Notes or TextEdit, both apps use `-[NSAttributedString initWithData:...:]` to convert the
HTML data on the pasteboard into an NSAttributedString. This takes the NSPasteboard's HTML data (a blob of
`NSData`) and synchronously loads it in a new legacy WebKit view by calling `-[WebFrame
loadData:MIMEType:textEncodingName:baseURL:]`, passing in `nil` as the text encoding name. Since WebKit is only
given a blob of data and no particular encoding, we fall back to default Latin-1 encoding, which produces
gibberish for CJK text.
To fix this, we automatically insert a `<meta charset="utf-8">` tag when writing HTML to the pasteboard, if the
sanitized markup contains non-ASCII characters.
Test: CopyHTML.SanitizationPreservesCharacterSet
* Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp:
(WebCore::ClipboardItemBindingsDataSource::ClipboardItemTypeLoader::sanitizeDataIfNeeded):
Pass in AddMetaCharsetIfNeeded::Yes.
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::setDataFromItemList):
Pass in AddMetaCharsetIfNeeded::Yes here too.
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::sanitizeMarkupWithArchive):
(WebCore::WebContentReader::readHTML):
(WebCore::WebContentMarkupReader::readHTML):
* editing/markup.cpp:
(WebCore::sanitizeMarkup):
Add a new enum so that we only add the extra meta tag when sanitizing content that is being written to the
system pasteboard through one of the clipboard DOM APIs.
(WebCore::sanitizedMarkupForFragmentInDocument):
* editing/markup.h:
2020-05-06 Tim Horton <timothy_horton@apple.com>
REGRESSION (r260753): Frequent crashes under TextIndicator's estimatedTextColorsForRange
https://bugs.webkit.org/show_bug.cgi?id=211523
<rdar://problem/62860203>
Reviewed by Darin Adler.
* page/TextIndicator.cpp:
(WebCore::estimatedTextColorsForRange):
TextIterator's node() getter can return null. r260753 accidentally refactored away the null check.
2020-05-06 John Wilander <wilander@apple.com>
Exempt app-bound domains from ITP's website data deletion and third-party cookie blocking between themselves
https://bugs.webkit.org/show_bug.cgi?id=210674
<rdar://problem/61950767>
Reviewed by Chris Dumez.
This change adds functionality to NetworkStorageSession to allow it to exempt
app-bound domains from third-party cookie blocking.
Tests: http/tests/resourceLoadStatistics/exemptDomains/app-bound-domains-exempt-from-cookie-blocking-between-each-other.html
http/tests/resourceLoadStatistics/exemptDomains/app-bound-domains-exempt-from-website-data-deletion-database.html
http/tests/resourceLoadStatistics/exemptDomains/app-bound-domains-exempt-from-website-data-deletion.html
* platform/network/NetworkStorageSession.cpp:
(WebCore::NetworkStorageSession::shouldBlockCookies const):
(WebCore::NetworkStorageSession::shouldExemptDomainPairFromThirdPartyCookieBlocking const):
(WebCore::NetworkStorageSession::setAppBoundDomains):
(WebCore::NetworkStorageSession::resetAppBoundDomains):
* platform/network/NetworkStorageSession.h:
2020-05-06 Antti Koivisto <antti@apple.com>
Add basic support for generating accurate wheel event listener region
https://bugs.webkit.org/show_bug.cgi?id=211512
Reviewed by Simon Fraser.
Add fake properties for wheel event listeners to RenderStyle and use them to
generate regions in EventRegion. There is a separate region for non-passive
wheel event listeners (that will require synchronous handling).
The generated regions are not used for anything in this patch.
Style is not yet invalided on event listener additions and removals.
Test: fast/scrolling/mac/wheel-event-listener-region-basic.html
* dom/Node.h:
* rendering/EventRegion.cpp:
(WebCore::EventRegion::unite):
(WebCore::EventRegion::uniteEventListeners):
(WebCore::EventRegion::dump const):
* rendering/EventRegion.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateEventRegion):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::eventListenerRegionTypes const):
(WebCore::RenderStyle::setEventListenerRegionTypes):
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
* rendering/style/StyleRareInheritedData.h:
* style/StyleAdjuster.cpp:
(WebCore::Style::computeEventListenerRegionTypes):
(WebCore::Style::Adjuster::adjust const):
2020-05-06 Darin Adler <darin@apple.com>
Remove now-unneeded USE(GRAMMAR_CHECKING)
https://bugs.webkit.org/show_bug.cgi?id=211452
Reviewed by Anders Carlsson.
* editing/Editor.cpp:
(WebCore::Editor::advanceToNextMisspelling): Remove USE(GRAMMAR_CHECKING).
(WebCore::Editor::isSelectionUngrammatical): Ditto.
(WebCore::Editor::markMisspellingsOrBadGrammar): Ditto.
(WebCore::Editor::markBadGrammar): Ditto.
* editing/TextCheckingHelper.cpp:
(WebCore::TextCheckingHelper::markAllBadGrammar): Ditto.
(WebCore::checkTextOfParagraph): Ditto. Also correct misspelling of the
word "misspelling".
* editing/TextCheckingHelper.h: Ditto.
2020-05-06 Devin Rousso <drousso@apple.com>
ASSERT_WITH_MESSAGE(m_isOwnedByMainThread == isMainThread()) when web inspecting
https://bugs.webkit.org/show_bug.cgi?id=203638
<rdar://problem/56761893>
Reviewed by Brian Burg.
Mark the `InspectorEnvironment::executionStopwatch` abstract function as `const` and have it
return a `Stopwatch&` instead of a `RefPtr<Stopwatch>&` as callers assume that it exists.
By not using a `RefPtr`, an additional `copyRef` can be avoided.
* inspector/InspectorController.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::executionStopwatch const): Added.
(WebCore::InspectorController::executionStopwatch): Deleted.
* inspector/WorkerInspectorController.h:
(WebCore::WorkerInspectorController::executionStopwatch const): Added.
(WebCore::WorkerInspectorController::executionStopwatch): Deleted.
* inspector/agents/InspectorAnimationAgent.cpp:
(WebCore::InspectorAnimationAgent::startTracking):
(WebCore::InspectorAnimationAgent::stopTracking):
(WebCore::InspectorAnimationAgent::willApplyKeyframeEffect):
(WebCore::InspectorAnimationAgent::stopTrackingDeclarativeAnimation):
* inspector/agents/InspectorCPUProfilerAgent.cpp:
(WebCore::InspectorCPUProfilerAgent::startTracking):
(WebCore::InspectorCPUProfilerAgent::stopTracking):
(WebCore::InspectorCPUProfilerAgent::collectSample):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::mediaMetricsTimerFired):
* inspector/agents/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::startTracking):
(WebCore::InspectorMemoryAgent::stopTracking):
(WebCore::InspectorMemoryAgent::didHandleMemoryPressure):
(WebCore::InspectorMemoryAgent::collectSample):
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForTiming):
(WebCore::InspectorNetworkAgent::timestamp):
(WebCore::InspectorNetworkAgent::didFinishLoading):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::enable):
(WebCore::InspectorPageAgent::timestamp):
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::timestamp):
2020-05-06 Darin Adler <darin@apple.com>
Eliminate checks of USE(DICTATION_ALTERNATIVES) in Cocoa-specific code
https://bugs.webkit.org/show_bug.cgi?id=211460
Reviewed by Anders Carlsson.
* editing/cocoa/AlternativeTextContextController.h: Remove USE(DICTATION_ALTERNATIVES).
Also remove unnecessary use of RetainPtr and add a FIXME. Also remove #pragma once
since this header is only imported from Objective-C++ sources.
* editing/cocoa/AlternativeTextContextController.mm: Ditto.
* editing/cocoa/AlternativeTextUIController.h: Ditto.
* editing/cocoa/AlternativeTextUIController.mm: Ditto.
* editing/mac/TextAlternativeWithRange.h: Ditto.
* editing/mac/TextAlternativeWithRange.mm: Ditto.
2020-05-06 Simon Fraser <simon.fraser@apple.com>
Factor EventHandler code that sends mouseEnteredContentArea/mouseExitedContentArea into its own function
https://bugs.webkit.org/show_bug.cgi?id=211494
Reviewed by Antti Koivisto.
mouseEnteredContentArea/mouseEnteredContentArea are used only to notify overlay scrollbars
of state changes. Factor the code that calls these functions into a separate EventHandler
function, and refactor it for clarity, now we know that both lastElementUnderMouse and elementUnderMouse
must belong to this EventHandler's Frame's Document.
* page/EventHandler.cpp:
(WebCore::EventHandler::updateMouseEventTargetNode):
(WebCore::EventHandler::notifyScrollableAreasOfMouseEnterExit):
* page/EventHandler.h:
2020-05-06 Zalan Bujtas <zalan@apple.com>
[LFC] BlockFormattingContext::computeHeightAndMargin should special case the table box
https://bugs.webkit.org/show_bug.cgi?id=211493
Reviewed by Antti Koivisto.
By the time we get to BlockFormattingContext::computeHeightAndMargin(), the used valued for the table height is already been computed.
(Table box height is mostly content driven, and both the computed height and the min/max pair are taken into account
while we are laying out the table content).
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2020-05-06 Antoine Quint <graouts@apple.com>
Add watchOS media controls assets
https://bugs.webkit.org/show_bug.cgi?id=211508
<rdar://problem/62926565>
Reviewed by Eric Carlson.
* Modules/modern-media-controls/images/watchOS/ActivityIndicatorSpriteCompact@2x.png: Added.
* Modules/modern-media-controls/images/watchOS/InvalidCompact.pdf: Added.
* Modules/modern-media-controls/images/watchOS/PlayCompact.pdf: Added.
* WebCore.xcodeproj/project.pbxproj:
2020-05-06 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] FormattingContext::ConstraintsForInFlowContent should include the computed value of height
https://bugs.webkit.org/show_bug.cgi?id=211487
Reviewed by Antti Koivisto.
When the formatting context root has fixed height, the computed value should be passed in to the formatting context layout
as the available vertical space.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::constraintsForInFlowContent):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):
2020-04-29 Sergio Villar Senin <svillar@igalia.com>
[WebXR] Implement isSessionSupported()
https://bugs.webkit.org/show_bug.cgi?id=211187
Reviewed by Dean Jackson.
The isSessionSupported() method queries if a given mode may be supported
by the UA and device capabilities. Apart from the needed machinery in
the webxr Module we're adding an OpenXR implementation of the
enumerateImmersiveXRDevices() method required by isSessionSupported().
The method is not completely implemented as it lacks a few action at its
very end, like firing events. They'll be implemented in follow up
patches as they require additional changes.
Some OpenXR runtimes as Monado always enumerate at least one device even
if none is connected. This dummy device might interfere with tests
execution (as there will be more devices than expected) so we're adding
a testMode to WebXRSystem which does not query platform for existing
devices.
Added expected results and unskipped some WPT that are now passing.
* Modules/webxr/WebXRSystem.cpp:
(WebCore::WebXRSystem::ensureImmersiveXRDeviceIsSelected): Asks platform
code for the list of attached XR devices and properly set the active
immersive device if any.
(WebCore::WebXRSystem::isSessionSupported): Partially implemented.
(WebCore::WebXRSystem::registerSimulatedXRDeviceForTesting): Set the
passed in mock device as either the current active immersive or inline
device.
(WebCore::WebXRSystem::unregisterSimulatedXRDeviceForTesting): Removes
the passed in mock device from the list of immersive devices.
* Modules/webxr/WebXRSystem.h:
* html/FeaturePolicy.cpp:
(WebCore::policyTypeName): Handle XRSpatialTracking.
(WebCore::FeaturePolicy::parse): Parse "xr-spatial-tracking".
(WebCore::FeaturePolicy::allows const): Handle XRSpatialTracking.
* html/FeaturePolicy.h: Added XRSpatialTracking.
* platform/xr/PlatformXR.h:
(PlatformXR::Instance::immersiveXRDevices const): Keep a list of immersive devices.
* platform/xr/openxr/PlatformXR.cpp:
(PlatformXR::Instance::Impl::collectSupportedSessionModes): Gather supported session
modes for a given device from OpenXR.
(PlatformXR::Instance::enumerateImmersiveXRDevices): Collect devices from OpenXR. We
are currently asking for HMD devices.
2020-05-06 Antoine Quint <graouts@apple.com>
[Web Animations] Coordinate "update animations and send events" procedure across multiple timelines
https://bugs.webkit.org/show_bug.cgi?id=202109
Unreviewed.
Remove an unused function.
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::allAnimations const): Deleted.
2020-05-05 Antoine Quint <graouts@apple.com>
Fix animation ordering to make imported/w3c/web-platform-tests/css/css-animations/Element-getAnimations.tentative.html pass
https://bugs.webkit.org/show_bug.cgi?id=211468
<rdar://problem/62732578>
Reviewed by David Kilzer.
The "Animation composite order" section of the CSS Animations Level 2 specification (https://drafts.csswg.org/css-animations-2/#animation-composite-order)
defines the relative composite order of animations. We bake this into compareAnimationsByCompositeOrder(), but this function would not yield consistent
results if it is called in a non-stable sort, because if both CSSAnimation objects passed to this function have the same backing Animation object, they
would not return the same value if passed in a different order. The Web Animations spec always ensures that procedures that sort using the composite
order are called as part of a stable sort. So we change all call sites to use std::stable_sort and add an assertion in case we have two CSSAnimation
objects with the same backing Animation objects to catch cases like this in the future.
Finally, since we already know only relevant animations can find their way into the output of Document::getAnimations(), we also ensure we iterate over
m_animations (which holds only relevant animations) rather than m_allAnimations (which may not).
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::getAnimations const):
* animation/KeyframeEffectStack.cpp:
(WebCore::KeyframeEffectStack::ensureEffectsAreSorted):
* animation/WebAnimationUtilities.cpp:
(WebCore::compareAnimationsByCompositeOrder):
2020-05-05 Simon Fraser <simon.fraser@apple.com>
EventHandler::dispatchMouseEvent() cleanup
https://bugs.webkit.org/show_bug.cgi?id=211491
Reviewed by Zalan Bujtas.
Replace the last bool argument with FireMouseOverOut, and remove the "cancelable" argument that was unused.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::handleMouseDoubleClickEvent):
(WebCore::EventHandler::handleMouseMoveEvent):
(WebCore::EventHandler::handleMouseReleaseEvent):
(WebCore::EventHandler::handleMouseForceEvent):
(WebCore::EventHandler::dispatchMouseEvent):
(WebCore::EventHandler::sendContextMenuEvent):
* page/EventHandler.h:
2020-05-05 Rob Buis <rbuis@igalia.com>
Fix setting host on URL when no port is specified
https://bugs.webkit.org/show_bug.cgi?id=211453
Reviewed by Darin Adler.
Behavior matches Firefox and Chrome.
Test: web-platform-tests/url/url-setters.html
* html/URLDecomposition.cpp:
(WebCore::URLDecomposition::setHost):
2020-05-05 Simon Fraser <simon.fraser@apple.com>
Minor EventHandler and test cleanup
https://bugs.webkit.org/show_bug.cgi?id=211475
Reviewed by Zalan Bujtas.
Now that we assert that m_elementUnderMouse and m_lastElementUnderMouse are either null
or in this EventHandler's document, we can remove the document comparisons (but this code
is probably wrong as well).
Fix enclosingScrollableArea(), which would return any RenderLayer, but should only
return scrollable ones, and should only return scrollable RenderListBoxes.
* page/EventHandler.cpp:
(WebCore::enclosingScrollableArea):
(WebCore::EventHandler::updateMouseEventTargetNode):
2020-05-05 David Kilzer <ddkilzer@apple.com>
Fix deprecated NSGraphicsContext methods using 'graphicsPort'
<https://webkit.org/b/211481>
Reviewed by Darin Adler.
- Replace uses of -graphicsPort with -CGContext.
- Replace uses of -graphicsContextWithGraphicsPort:flipped: with
-graphicsContextWithCGContext:flipped:.
- Remove ALLOW_DEPRECATED_DECLARATIONS_{BEGIN,END} if possible.
* platform/cocoa/DragImageCocoa.mm:
(WebCore::createDragImageForLink):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayer::drawLayerContents):
* platform/mac/ThemeMac.mm:
(WebCore::drawCellFocusRingWithFrameAtTime):
* platform/mac/WidgetMac.mm:
(WebCore::Widget::paint):
2020-05-05 Pinki Gyanchandani <pgyanchandani@apple.com>
Crash in match_constness<WebCore::CSSValue, WebCore::CSSPrimitiveValue>::type& WTF::downcast<WebCore::CSSPrimitiveValue, WebCore::CSSValue> -- ASAN
https://bugs.webkit.org/show_bug.cgi?id=211479
Reviewed by Geoffrey Garen.
Added check to downcast CSSValue to CSSPrimitiveValue, only if valid CSSPrimitveValue is associated with the property.
New test would be added to Internal repository.
* css/StyleProperties.cpp:
(WebCore::StyleProperties::pageBreakPropertyValue const):
2020-05-05 Peng Liu <peng.liu6@apple.com>
Update WebKitTestRunner to support running multiple video fullscreen and Picture-in-Picture tests simultaneously
https://bugs.webkit.org/show_bug.cgi?id=203723
Reviewed by Jer Noble.
Test: media/video-presentation-mode.html
Add a flag MockVideoPresentationModeEnabled to "internals" for video fullscreen
and picture-in-picture tests.
* page/ChromeClient.h:
(WebCore::ChromeClient::setMockVideoPresentationModeEnabled):
* testing/Internals.cpp:
(WebCore::Internals::setMockVideoPresentationModeEnabled):
* testing/Internals.h:
* testing/Internals.idl:
2020-05-05 Darin Adler <darin@apple.com>
Remove HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT)
https://bugs.webkit.org/show_bug.cgi?id=211461
Reviewed by Eric Carlson.
* PlatformMac.cmake: Removed InbandTextTrackPrivateLegacyAVFObjC.mm.
* SourcesCocoa.txt: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto, also the header.
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.h: Removed.
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm: Removed.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
Removed HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT). Also moved data member
initialization to the class definition, made more things private and final,
made outputObscuredDueToInsufficientExternalProtectionChanged unconditional,
changed friend class MediaPlayerFactoryAVFoundationObjC into member class
MediaPlayerPrivateAVFoundationObjC::Factory, removed unused removeSession function,
and tweaked conditionals.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
Removed import of InbandTextTrackPrivateLegacyAVFObjC.h. Moved data member
initialization to the class definition. Moved include of BinarySemaphore here.
2020-05-05 Simon Fraser <simon.fraser@apple.com>
Assert that EventHandler only tracks event target nodes in its own document
https://bugs.webkit.org/show_bug.cgi?id=211462
Reviewed by Zalan Bujtas.
EventHandler is per-Frame, so should not track Nodes from different documents. However, it did so
by mistake if an event handler moved a node between documents.
* page/EventHandler.cpp:
(WebCore::EventHandler::updateMouseEventTargetNode):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::targetNode const):
2020-05-05 Antti Koivisto <antti@apple.com>
Factor RenderLayerBacking::updateEventRegion skip conditions into a lambda
https://bugs.webkit.org/show_bug.cgi?id=211450
Reviewed by Simon Fraser.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateEventRegion):
2020-05-05 Chris Dumez <cdumez@apple.com>
Drop code path using the legacy CFNetwork cookie change notification SPI
https://bugs.webkit.org/show_bug.cgi?id=211411
<rdar://problem/62869148>
Reviewed by John Wilander.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::registerCookieChangeListenersIfNecessary):
(WebCore::NetworkStorageSession::unregisterCookieChangeListenersIfNecessary):
(WebCore::NetworkStorageSession::supportsCookieChangeListenerAPI const):
2020-05-05 Timothy Horton <timothy_horton@apple.com>
"Essential Skeleton" does not respond to mouse events, only touch events
https://bugs.webkit.org/show_bug.cgi?id=211439
<rdar://problem/62694519>
Reviewed by Wenson Hsieh.
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isEssentialSkeleton):
2020-05-05 Megan Gardner <megan_gardner@apple.com>
Style is not applied when changed on the first line of a new mail message.
https://bugs.webkit.org/show_bug.cgi?id=211200
<rdar://problem/62087514>
Reviewed by Darin Adler.
After r257487 when we resign first responder, we immediatly
update activity state. This means that if we resign first responder, and then
become first responder, we are clearing the selection if the caret is at the beginning
of the document, due to a check in setSelectionFromNone. This check was originally added
in 2006 because it happened to fix <rdar://problem/4483145>. Removing this check and
merging the iOS and Mac logic.
Test: editing/execCommand/ios/first-line-text-attribute-change-presist-through-resigning-first-responder.html
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelectionFromNone):
2020-05-05 Rob Buis <rbuis@igalia.com>
A URL cannot have a username/password/port if its host is null
https://bugs.webkit.org/show_bug.cgi?id=211358
Reviewed by Darin Adler.
A URL cannot have a username/password/port if its host is null [1], so
adjust URL.cpp accordingly.
Behavior matches Chrome and Firefox.
[1] https://url.spec.whatwg.org/#cannot-have-a-username-password-port
* html/URLDecomposition.cpp:
(WebCore::URLDecomposition::setUsername):
(WebCore::URLDecomposition::setPassword):
(WebCore::URLDecomposition::setPort):
2020-05-05 Youenn Fablet <youenn@apple.com>
MediaPlayerPrivateMediaStreamAVFObjC should unobserve the tracks from its audio and video track sets
https://bugs.webkit.org/show_bug.cgi?id=211444
<rdar://problem/62886221>
Reviewed by Eric Carlson.
Test: fast/mediastream/MediaStream-removeTrack-while-playing.html
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC):
We keep maps of audio and video tracks we are observing.
Use these two maps to properly unobserve all tracks at destruction time.
While this is not strictly needed since we are using weak pointers, this helps keeping the code healthy.
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::forEachObserver):
Add a debug ASSERT so that we ensure add/remove observers is done properly.
2020-05-05 Chris Dumez <cdumez@apple.com>
Unreviewed, reverting r261130.
Caused crashes on some of our bots
Reverted changeset:
"Drop code path using the legacy CFNetwork cookie change
notification SPI"
https://bugs.webkit.org/show_bug.cgi?id=211411
https://trac.webkit.org/changeset/261130
2020-05-05 Darin Adler <darin@apple.com>
Remove now-unneeded USE(COREMEDIA) and USE(VIDEOTOOLBOX)
https://bugs.webkit.org/show_bug.cgi?id=211437
Reviewed by Eric Carlson.
* platform/cocoa/VideoToolboxSoftLink.cpp: Remove USE(VIDEOTOOLBOX).
* platform/cocoa/VideoToolboxSoftLink.h: Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage): Ditto.
* platform/graphics/cocoa/WebCoreDecompressionSession.h: Ditto. Also remove
#pragma once since this header is only used with #import, not #include.
* platform/graphics/cocoa/WebCoreDecompressionSession.mm: Ditto.
* platform/graphics/cv/ImageRotationSessionVT.h: Ditto.
* platform/graphics/cv/ImageRotationSessionVT.mm: Ditto.
* platform/graphics/cv/ImageTransferSessionVT.h: Ditto.
* platform/graphics/cv/ImageTransferSessionVT.mm: Ditto.
* platform/graphics/cv/PixelBufferConformerCV.cpp:
(WebCore::PixelBufferConformerCV::PixelBufferConformerCV): Ditto.
(WebCore::PixelBufferConformerCV::convert): Ditto.
(WebCore::PixelBufferConformerCV::createImageFromPixelBuffer): Ditto.
* platform/graphics/cv/PixelBufferConformerCV.h: Ditto.
2020-05-05 Youenn Fablet <youenn@apple.com>
Remove LegacySchemeRegistry::canServiceWorkersHandleURLScheme
https://bugs.webkit.org/show_bug.cgi?id=211170
Reviewed by Alex Christensen.
Since we no longer use custom service worker schemes in API tests,
we no longer need custom schemes in web process, given they are not supported in network process anyway.
Remove related code.
* Modules/cache/DOMWindowCaches.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(NeedsRuntimeCheck):
(GenerateRuntimeEnableConditionalString):
* bindings/scripts/IDLAttributes.json:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::hasServiceWorkerScheme const): Deleted.
* dom/ScriptExecutionContext.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::matchRegistration):
(WebCore::DocumentLoader::commitData):
* page/NavigatorServiceWorker.idl:
* platform/LegacySchemeRegistry.cpp:
(WebCore::serviceWorkerSchemes): Deleted.
(WebCore::LegacySchemeRegistry::registerURLSchemeServiceWorkersCanHandle): Deleted.
(WebCore::LegacySchemeRegistry::canServiceWorkersHandleURLScheme): Deleted.
(WebCore::LegacySchemeRegistry::isServiceWorkerContainerCustomScheme): Deleted.
* platform/LegacySchemeRegistry.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
2020-05-05 Darin Adler <darin@apple.com>
Remove now-unneeded HAVE(DISALLOWABLE_USER_INSTALLED_FONTS)
https://bugs.webkit.org/show_bug.cgi?id=211428
Reviewed by Anders Carlsson.
* platform/graphics/Font.h: Removed isUserInstalledFont, only used for
an assertion that I took the liberty of removing.
* platform/graphics/FontCascadeFonts.cpp:
(WebCore::FontCascadeFonts::glyphDataForSystemFallback): Removed an
assertion since it was the only reason to introduce the concept of a
user-installed font to the cross-platform code. The assertion is a bit
of a self-check that doesn't seem critical.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::singleton): Deleted.
(WebCore::FontDatabase::singletonAllowingUserInstalledFonts): Remove
HAVE(DISALLOWABLE_USER_INSTALLED_FONTS).
(WebCore::FontDatabase::singletonDisallowingUserInstalledFonts): Ditto.
(WebCore::isUserInstalledFont): Ditto.
(WebCore::addAttributesForInstalledFonts): Ditto.
(WebCore::isFontMatchingUserInstalledFontFallback): Ditto.
(WebCore::addAttributesForWebFonts): Ditto.
(WebCore::installedFontMandatoryAttributes): Ditto.
* platform/graphics/mac/SimpleFontDataCoreText.cpp:
(WebCore::Font::isUserInstalledFont const): Deleted.
2020-05-05 Alicia Boya García <aboya@igalia.com>
[GStreamer] Video loops when ran in rr record --chaos
https://bugs.webkit.org/show_bug.cgi?id=211182
Reviewed by Philippe Normand.
While trying to investigate a different bug, I ran the browser with
`rr record --chaos`, which makes it run very slowly and shuffles
thread scheduling to try to make existing race conditions more likely
to show up, also inevitably making the software run very slow.
Doing so I found something strange: the video kept looping even though
it didn't have the `loop` attribute set.
After some debugging I found that MediaPlayer decides if the video has
ended in part by checking `currentMediaTime()` is greater or equal to
the video duration, which was not guaranteed to be the case in
MediaPlayerPrivateGStreamer.
As a consequence of this patch, one new LayoutTest has passed.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
2020-05-05 Zalan Bujtas <zalan@apple.com>
[LFC] Rename computedContentHeight/Width to computedHeight/Width
https://bugs.webkit.org/show_bug.cgi?id=211432
Reviewed by Darin Adler.
These functions used to return the computed content box height/width but with box-sizing
support the name is not correct anymore.
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedHeight const):
(WebCore::Layout::FormattingContext::Geometry::computedWidth const):
(WebCore::Layout::FormattingContext::Geometry::computedMinHeight const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases const):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin const):
(WebCore::Layout::FormattingContext::Geometry::computedContentHeight const): Deleted.
(WebCore::Layout::FormattingContext::Geometry::computedContentWidth const): Deleted.
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):
* layout/tableformatting/TableFormattingContextGeometry.cpp:
(WebCore::Layout::TableFormattingContext::Geometry::cellHeigh const):
(WebCore::Layout::TableFormattingContext::Geometry::computedColumnWidth const):
2020-05-05 Antoine Quint <graouts@apple.com>
Unreviewed, reverting r260989.
Mistakenly identified cause of MotionMark 1.1 performance regression
Reverted changeset:
"REGRESSION: MotionMark 1.1 regressed due to r260016"
https://bugs.webkit.org/show_bug.cgi?id=211280
https://trac.webkit.org/changeset/260989
2020-05-05 Alexey Shvayka <shvaikalesh@gmail.com>
Object.prototype.toString is not spec-perfect
https://bugs.webkit.org/show_bug.cgi?id=199138
Reviewed by Darin Adler and Keith Miller.
This patch defines @@toStringTag symbols for all WebIDL prototypes, including
interfaces that are not exposed, as required by the spec [1].
With updated JSObject::toStringName() and @@toStringTag symbols added in r260992,
className() and toStringName() methods of JSDOMConstructorBase can be safely removed.
[1]: https://heycam.github.io/webidl/#dfn-class-string
Tests: imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/class-string-interface.any.js
imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/class-string-iterator-prototype-object.any.js
* bindings/js/JSDOMConstructorBase.cpp:
(WebCore::JSDOMConstructorBase::className): Deleted.
(WebCore::JSDOMConstructorBase::toStringName): Deleted.
* bindings/js/JSDOMConstructorBase.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GeneratePrototypeDeclaration):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::JSTestGlobalObjectPrototype::finishCreation):
2020-05-04 Darin Adler <darin@apple.com>
[Mac] Remove __MAC_OS_X_VERSION_MIN_REQUIRED checks for versions older than 10.14
https://bugs.webkit.org/show_bug.cgi?id=211420
Reviewed by Alex Christensen.
* editing/cocoa/DataDetection.mm:
(WebCore::detectItem): Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400.
* editing/cocoa/HTMLConverter.mm:
(_WebMessageDocumentClass): Ditto.
* platform/graphics/cg/GraphicsContextCG.cpp: Ditto.
* platform/mac/WebCoreFullScreenPlaceholderView.mm:
(-[WebCoreFullScreenPlaceholderView initWithFrame:]): Ditto.
* platform/network/cocoa/CookieCocoa.mm:
(WebCore::nsSameSitePolicy): Ditto.
(WebCore::Cookie::operator NSHTTPCookie * _Nullable const): Ditto.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::cookiesForURL): Ditto.
(WebCore::NetworkStorageSession::setHTTPCookiesForURL const): Ditto.
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdateResourceRequest): Ditto.
(WebCore::siteForCookies): Ditto.
(WebCore::ResourceRequest::doUpdatePlatformRequest): Ditto.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintTextField): Ditto.
* testing/Internals.h: Ditto.
2020-05-04 Darin Adler <darin@apple.com>
Remove now-unneeded HAVE(NETWORK_EXTENSION)
https://bugs.webkit.org/show_bug.cgi?id=211424
Reviewed by Alex Christensen.
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::types): Remove check of HAVE(NETWORK_EXTENSION),
not needed because ENABLE(CONTENT_FILTER) is only done on Cocoa platforms,
and HAVE(NETWORK_EXTENSION) is true for all of those.
* platform/cocoa/NetworkExtensionContentFilter.mm: Ditto.
2020-05-04 Darin Adler <darin@apple.com>
Remove now-unneeded HAVE(SEC_TRUST_EVALUATE_WITH_ERROR)
https://bugs.webkit.org/show_bug.cgi?id=211429
Reviewed by Alex Christensen.
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo const):
Remove HAVE(SEC_TRUST_EVALUATE_WITH_ERROR).
2020-05-04 Simon Fraser <simon.fraser@apple.com>
Code cleanup in EventHandler
https://bugs.webkit.org/show_bug.cgi?id=211413
Reviewed by Tim Horton.
Use a better name for "hoveredNode" which is a HitTestResult.
Convert Frame* to Frame&.
Have a couple of helper functions return RefPtr<Frame>.
* page/AutoscrollController.cpp:
(WebCore::AutoscrollController::stopAutoscrollTimer):
* page/EventHandler.cpp:
(WebCore::EventHandler::subframeForHitTestResult):
(WebCore::EventHandler::subframeForTargetNode):
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::handleMouseDoubleClickEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::passMouseMovedEventToScrollbars):
(WebCore::EventHandler::handleMouseMoveEvent):
(WebCore::EventHandler::handleMouseReleaseEvent):
(WebCore::EventHandler::passMousePressEventToScrollbar):
(WebCore::EventHandler::passMousePressEventToSubframe):
(WebCore::EventHandler::passMouseReleaseEventToSubframe):
(WebCore::EventHandler::passWidgetMouseDownEventToWidget):
(WebCore::EventHandler::passMouseMoveEventToSubframe):
* page/EventHandler.h:
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::passSubframeEventToSubframe):
(WebCore::EventHandler::passMousePressEventToSubframe):
(WebCore::EventHandler::passMouseMoveEventToSubframe):
(WebCore::EventHandler::passMouseReleaseEventToSubframe):
(WebCore::EventHandler::tryToBeginDragAtPoint):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::passSubframeEventToSubframe):
(WebCore::EventHandler::passMousePressEventToSubframe):
(WebCore::EventHandler::passMouseMoveEventToSubframe):
(WebCore::EventHandler::passMouseReleaseEventToSubframe):
* page/win/EventHandlerWin.cpp:
(WebCore::EventHandler::passMouseMoveEventToSubframe):
2020-05-04 Ben Nham <nham@apple.com>
IndexedDB WAL file keeps growing while app is in use
https://bugs.webkit.org/show_bug.cgi?id=202137
Reviewed by Brady Eidson.
It's easy to get into a situation where the WAL file associated with a SQLite-backed
IndexedDB grows indefinitely while a site is in use for two reasons:
1. We don't promptly reset cached prepared statements in SQLiteIDBBackingStore. Many
statements are left hanging in the SQLITE_ROW state without being reset or fully stepped to
the SQLITE_DONE state. These hanging statements keep their associated transactions open and
prevent the WAL checkpointer from progressing past those active transactions.
To fix this, I added SQLiteStatementAutoResetScope. This is a scope guard that
SQLiteIDBBackingStore uses to ensure that cached statements are reset in a timely manner.
While going through the reset code I also noticed we aren't clearing bindings after
resetting statements. We should be doing this because sqlite3_reset does not clear bindings
(and their associated copies of blobs/strings); sqlite3_clear_bindings does that.
2. The default WAL hook for auto-checkpointing in upstream SQLite uses the
SQLITE_CHECKPOINT_PASSIVE mode, which doesn't truncate the WAL until the next write
transaction occurs. (It actually doesn't truncate at all when compiled with default
settings, but macOS's SQLite sets SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT, which causes the
truncation to occur on the next write.)
We want the WAL to be truncated more promptly, because otherwise the quota check that
happens on each mutation won't be as accurate. To do this, I installed a WAL hook that
truncates the WAL with SQLITE_CHECKPOINT_TRUNCATE after the default threshold of 1000 WAL
pages. I didn't enable this for all SQLiteDatabases because this checkpoint call can block
on the busy handler. This isn't a problem for IDB since we don't use busy handlers in IDB.
* Headers.cmake:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatementForGetAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
(WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatement):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/sql/SQLiteDatabase.cpp:
(WebCore::walAutomaticTruncationHook):
(WebCore::SQLiteDatabase::enableAutomaticWALTruncation):
* platform/sql/SQLiteDatabase.h:
* platform/sql/SQLiteStatement.cpp:
(WebCore::SQLiteStatement::reset):
* platform/sql/SQLiteStatementAutoResetScope.cpp: Added.
(WebCore::SQLiteStatementAutoResetScope::SQLiteStatementAutoResetScope):
(WebCore::SQLiteStatementAutoResetScope::operator=):
(WebCore::SQLiteStatementAutoResetScope::~SQLiteStatementAutoResetScope):
* platform/sql/SQLiteStatementAutoResetScope.h: Added.
(WebCore::SQLiteStatementAutoResetScope::operator bool const):
(WebCore::SQLiteStatementAutoResetScope::operator! const):
(WebCore::SQLiteStatementAutoResetScope::get):
(WebCore::SQLiteStatementAutoResetScope::operator->):
2020-05-04 Wenson Hsieh <wenson_hsieh@apple.com>
Tapping to focus editable elements should start caret selection at word boundary
https://bugs.webkit.org/show_bug.cgi?id=211409
<rdar://problem/62869098>
Reviewed by Megan Gardner.
Match platform behavior when focusing editable text content by beginning the caret selection at word
granularity (i.e. the start or end of a word), rather than character granularity. This will match behavior of
other editable widgets on iOS (such as UITextField and UITextView), as well as our current behavior when tapping
to change the selection when the text interaction is editable (i.e. when the caret is already visible when
tapping).
Rebaselined existing layout tests.
* editing/VisibleUnits.cpp:
(WebCore::wordBoundaryForPositionWithoutCrossingLine):
Move logic previously in `WebPage::selectWithGesture` down into `VisibleUnits.h`, as a new standalone helper
function. Given a `VisiblePosition`, this new helper will return the given position if it is either already at
word boundary or line boundary; if it is within the boundary of a word, it will instead return the start or end
of the word.
* editing/VisibleUnits.h:
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEventSingleClick):
When setting the selection due to a synthetic single click, automatically adjust the caret position to be at
word boundary instead of using the hit-tested position directly.
2020-05-04 Darin Adler <darin@apple.com>
Make __IPHONE_OS_VERSION_MIN_REQUIRED checks against old versions explicit about watchOS and tvOS
https://bugs.webkit.org/show_bug.cgi?id=211402
Reviewed by Alexey Proskuryakov.
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::attributesForAttributedStringConversion): Move from __IPHONE_OS_VERSION_MIN_REQUIRED
to !PLATFORM(WATCHOS) && !PLATFORM(APPLETV). Move NSExcludedElementsDocumentAttribute to
AttributedStringSPI.h.
* page/SettingsDefaultValues.h: Rewrite conic gradient conditional to call out
tvOS as an exception rather than doing that indirectly through __IPHONE_OS_VERSION_MIN_REQUIRED.
* platform/graphics/cg/GradientCG.cpp:
(WebCore::Gradient::paint): Ditto.
* platform/graphics/cocoa/FontCacheCoreText.cpp: Rewrite
HAS_CORE_TEXT_WIDTH_ATTRIBUTE to use !PLATFORM(WATCHOS) && !PLATFORM(APPLETV).
(WebCore::variationCapabilitiesForFontDescriptor): Ditto.
(WebCore::FontCache::lastResortFallbackFont): Ditto.
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::matchSystemFontUse): Use HAVE(SYSTEM_FONT_STYLE_TITLE_0) and
HAVE(SYSTEM_FONT_STYLE_TITLE_4) instead of __IPHONE_OS_VERSION_MIN_REQUIRED.
This consolidates the watchOS/tvOS issue into the PlatformHave.h file, and
does not change behavior at this time.
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::cascadeToLastResortAttributesDictionary): Changed this to not use
a global since it's only called as part of initializing another global, and
to return a RetainPtr.
(WebCore::cascadeToLastResortAndVariationsFontDescriptor): Removed
WORKAROUND_CORETEXT_VARIATIONS_WITH_FALLBACK_LIST_BUG after researching to
be sure it's fixed on recent watchOS and tvOS. Also changed this to return
a raw pointer instead of RetainPtr since it returns a single global object.
Also removed the CTFontRef argument.
(WebCore::FontPlatformData::ctFont const): Updated for the changes above.
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::surfaceID const): Move from __IPHONE_OS_VERSION_MIN_REQUIRED
to !PLATFORM(WATCHOS) && !PLATFORM(APPLETV).
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::platformFontWithFamilySpecialCase): Ditto.
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::createFontCustomPlatformData): Ditto.
2020-05-04 Darin Adler <darin@apple.com>
Remove HAVE(IOSURFACE) checks in Cocoa-platform-specific code
https://bugs.webkit.org/show_bug.cgi?id=211389
Reviewed by Alexey Proskuryakov.
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::platformReleaseMemory): Remove HAVE(IOSURFACE) since it's always true
on Cocoa platforms.
* platform/graphics/RemoteVideoSample.cpp:
(WebCore::RemoteVideoSample::surface const): Ditto.
* platform/graphics/RemoteVideoSample.h: Ditto.
* platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
(WebCore::GraphicsContextGLOpenGL::allocateIOSurfaceBackingStore): Ditto.
(WebCore::GraphicsContextGLOpenGL::updateFramebufferTextureBackingStoreFromLayer): Ditto.
* platform/graphics/cocoa/IOSurface.mm: Ditto.
* platform/graphics/cocoa/IOSurfacePoolCocoa.mm: Ditto.
* platform/graphics/cocoa/WebGLLayer.h: Ditto.
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer display]): Ditto.
* platform/graphics/cv/ImageTransferSessionVT.h: Ditto.
* platform/graphics/cv/ImageTransferSessionVT.mm: Ditto.
* platform/graphics/cv/VideoTextureCopierCV.cpp:
(WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction): Ditto.
(WebCore::VideoTextureCopierCV::copyImageToPlatformTexture): Ditto.
* platform/graphics/cv/VideoTextureCopierCV.h: Ditto.
* rendering/RenderThemeIOS.h: Ditto.
2020-05-04 Simon Fraser <simon.fraser@apple.com>
Overflow scrollbars don't grow when hovered
https://bugs.webkit.org/show_bug.cgi?id=210692
<rdar://problem/61977273>
Reviewed by Tim Horton.
Overlay scrollar interaction has a few behaviors that are mediated by ScrollAnimatorMac. These
are a trackpad two-finger tap, which sends a "MayBegin" wheel event (which can be followed by
a "Cancelled" on fingers up, if they didn't move), and hovering the scrollbar when visible, which
causes it to expand (unhovering causes it to fade out).
To track these gestures on the scrolling thread, give ScrollingTree a ScrollingTreeGestureState.
Flashing the scrollbars on "MayBegin" is driven by didBeginScrollGesture()/didEndScrollGesture().
This relies on sending these for the correct scrollable area, and matching the begin/cancel,
so use the normal scrolling tree event handling code path for "MayBegin", and always send
"Cancelled" on the node that received "MayBegin. Do the same for "Began" and "Ended".
Scrollbars expanding on hover is controlled by these functions on ScrollAnimatorMac:
void mouseEnteredContentArea();
void mouseExitedContentArea();
void mouseMovedInContentArea();
void mouseEnteredScrollbar(Scrollbar*) const;
void mouseExitedScrollbar(Scrollbar*) const;
This mostly (webkit.org/b/211347) works now that the mayBegin/Canceled state is updated correctly,
and is tested by a new test.
Tests: fast/scrolling/mac/scrollbars/overflow-overlay-scrollbar-hovered.html
fast/scrolling/mac/scrollbars/overflow-overlay-scrollbar-reveal.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::ScrollingTree):
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeGestureState.cpp: Added.
(WebCore::ScrollingTreeGestureState::ScrollingTreeGestureState):
(WebCore::ScrollingTreeGestureState::receivedWheelEvent):
(WebCore::ScrollingTreeGestureState::handleGestureCancel):
(WebCore::ScrollingTreeGestureState::nodeDidHandleEvent):
(WebCore::ScrollingTreeGestureState::clearAllNodes):
* page/scrolling/ScrollingTreeGestureState.h: Copied from Source/WebCore/page/scrolling/ScrollingTreeLatchingController.h.
* page/scrolling/ScrollingTreeLatchingController.cpp:
(WebCore::ScrollingTreeLatchingController::nodeDidHandleEvent):
* page/scrolling/ScrollingTreeLatchingController.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::canHandleWheelEvent const):
(WebCore::ScrollingTreeScrollingNode::canScrollWithWheelEvent const): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
* platform/Logging.cpp:
(WebCore::initializeLogChannelsIfNecessary):
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::isGestureStart const):
(WebCore::PlatformWheelEvent::isGestureCancel const):
* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::handleWheelEvent):
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::scrollbarState):
2020-05-04 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r261102.
https://bugs.webkit.org/show_bug.cgi?id=211418
Revert some debug logging (Requested by smfr on #webkit).
Reverted changeset:
"REGRESSION: [ Mac WK1 ] inspector/console/console-api.html is
flaky crashing"
https://bugs.webkit.org/show_bug.cgi?id=211386
https://trac.webkit.org/changeset/261102
2020-05-04 Chris Dumez <cdumez@apple.com>
Drop code path using the legacy CFNetwork cookie change notification SPI
https://bugs.webkit.org/show_bug.cgi?id=211411
Reviewed by John Wilander.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::registerCookieChangeListenersIfNecessary):
(WebCore::NetworkStorageSession::unregisterCookieChangeListenersIfNecessary):
2020-05-04 Jack Lee <shihchieh_lee@apple.com>
Nullptr crash in CompositeEditCommand::moveParagraphs when changing style on elements that are
user-select:none and dir:rtl.
https://bugs.webkit.org/show_bug.cgi?id=211206
<rdar://problem/61830589>
Reviewed by Geoffrey Garen.
In function moveParagraphs check if the destination is an empty position and
bail out before moving the paragraphs.
Test: fast/editing/justify-user-select-none-dir-rtl-crash.html
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphs):
2020-05-04 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthn] Implement +[_WKWebAuthenticationPanel clearAllLocalAuthenticatorCredentials]
https://bugs.webkit.org/show_bug.cgi?id=211369
<rdar://problem/60246635>
Reviewed by Brent Fulgham.
Covered by manual tests given auto tests could clear developers' actual credentials.
* Modules/webauthn/WebAuthenticationConstants.h:
2020-05-04 Said Abou-Hallawa <sabouhallawa@apple.com>
Throttling requestAnimationFrame should be controlled by RenderingUpdateScheduler
https://bugs.webkit.org/show_bug.cgi?id=204713
Reviewed by Simon Fraser.
rAF and Page rendering were managed by two different timers. Throttling
rAF was implemented by changing its timer. After r242624, RenderingUpdate
steps have been managed by RenderingUpdateScheduler. This means rAF is
now serviced by the preferredFramesPerSecond which is 60 fps regardless
it's throttled or not. Moreover the rAF throttling timer was mistakenly
kept and it has been running under the old assumption which is: rAF is
serviced by a timer only. This means rAF will be serviced by its timer
and by the RenderingUpdate steps at the same time when it is supposed to
throttle. This will make it fire more than 60 fps in cases which it is
supposed to run less than 60 fps.
The solution is to have two throttling types:
1) Page throttling (or full throttling): This slows down all the steps
of RenderingUpdate for the main document and all the sub-documents.
Page throttling reasons are:
-- VisuallyIdle: Aggressive throttling.
-- LowPowerMode: Half speed throttling.
2) Document throttling (or partial throttling): This only slows down the
rAF of a certain document. Document throttling reasons are:
-- OutsideViewport: Aggressive throttling.
-- NonInteractedCrossOriginFrame: Half speed throttling.
RenderingUpdate steps will still be managed by RenderingUpdateScheduler
which can be throttled. The assumption is none of these steps will need
to run faster than the Page preferredFramesPerSecond. If rAF wants to
run slower than the Page because of a Document throttling reason, no rAF
callbacks will be serviced before its preferredFrameInterval has elapsed.
In this patch, "Half speed throttling" is only implemented for the Page
and the Document throttling. The "Aggressive throttling" will be done in
following patches. Page rendering was never throttled before. We need to
make sure this is not going to affect PLT. Some tests need to be changed
and new tests need to be written. All of the throttling tests checks the
state of the code but none of them checks the real user's experience.
* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::animationInterval const):
(WebCore::DocumentTimeline::updateThrottlingState): Deleted.
* animation/DocumentTimeline.h:
There is no need to have DocumentTimeline throttling. It is already
throttled when the page RenderingUpdate is throttled.
* dom/Document.cpp:
(WebCore::Document::requestAnimationFrame):
(WebCore::Document::updateLastHandledUserGestureTimestamp):
LowPowerMode throttling is now handled by the Page. So remove its handling
from the Document.
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::ScriptedAnimationController):
(WebCore::ScriptedAnimationController::page const):
(WebCore::ScriptedAnimationController::interval const):
(WebCore::ScriptedAnimationController::preferredScriptedAnimationInterval const):
(WebCore::ScriptedAnimationController::throttlingReasons const):
(WebCore::ScriptedAnimationController::isThrottledRelativeToPage const):
(WebCore::ScriptedAnimationController::shouldRescheduleRequestAnimationFrame const):
(WebCore::ScriptedAnimationController::registerCallback):
(WebCore::ScriptedAnimationController::cancelCallback):
(WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
(WebCore::ScriptedAnimationController::scheduleAnimation):
(WebCore::throttlingReasonToString): Deleted.
(WebCore::throttlingReasonsToString): Deleted.
(WebCore::ScriptedAnimationController::addThrottlingReason): Deleted.
(WebCore::ScriptedAnimationController::removeThrottlingReason): Deleted.
(WebCore::ScriptedAnimationController::isThrottled const): Deleted.
(WebCore::ScriptedAnimationController::animationTimerFired): Deleted.
* dom/ScriptedAnimationController.h:
(WebCore::ScriptedAnimationController::addThrottlingReason):
(WebCore::ScriptedAnimationController::removeThrottlingReason):
Get rid of the rAF throttling timer. Service the rAF callback only when
the period from the current time stamp till the last service time stamp
is greater than the preferred rAF interval.
* page/FrameView.cpp:
(WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
ThrottlingReason is now defined outside ScriptedAnimationController.
* page/Page.cpp:
(WebCore::m_loadsFromNetwork):
(WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
(WebCore::Page::preferredRenderingUpdateInterval const):
Calculate the preferred RenderingUpdate interval from the throttling
reasons.
(WebCore::Page::setIsVisuallyIdleInternal):
(WebCore::Page::handleLowModePowerChange):
Call adjustRenderingUpdateFrequency() when isLowPowerModeEnabled or
IsVisuallyIdle is toggled.
(WebCore::Page::isLowPowerModeEnabled const): Deleted.
(WebCore::updateScriptedAnimationsThrottlingReason): Deleted.
* page/Page.h:
(WebCore::Page::isLowPowerModeEnabled const):
(WebCore::Page::throttlingReasons const):
(WebCore::Page::canUpdateThrottlingReason const):
* page/RenderingUpdateScheduler.cpp:
(WebCore::RenderingUpdateScheduler::setPreferredFramesPerSecond):
(WebCore::RenderingUpdateScheduler::scheduleAnimation):
(WebCore::RenderingUpdateScheduler::adjustRenderingUpdateFrequency):
Change the preferredFramesPerSecond of the DisplayRefreshMonitor if the
throttling is not aggressive e.g. 10_s. Otherwise use the timer.
(WebCore::RenderingUpdateScheduler::scheduleTimedRenderingUpdate):
Call adjustFramesPerSecond() when DisplayRefreshMonitor is created.
(WebCore::RenderingUpdateScheduler::startTimer):
* page/RenderingUpdateScheduler.h:
* platform/graphics/AnimationFrameRate.h: Added.
(WebCore::preferredFrameInterval):
(WebCore::preferredFramesPerSecond):
(WebCore::operator<<):
Push names of ThrottlingReasons to a TextStream.
* platform/graphics/DisplayRefreshMonitor.h:
(WebCore::DisplayRefreshMonitor::setPreferredFramesPerSecond):
* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::monitorForClient):
Rename createMonitorForClient() to monitorForClient() since it may return
a cached DisplayRefreshMonitor.
(WebCore::DisplayRefreshMonitorManager::setPreferredFramesPerSecond):
(WebCore::DisplayRefreshMonitorManager::scheduleAnimation):
(WebCore::DisplayRefreshMonitorManager::windowScreenDidChange):
No need to call registerClient(). This function was just ensuring the
DisplayRefreshMonitor is created. scheduleAnimation() does the same thing.
(WebCore::DisplayRefreshMonitorManager::createMonitorForClient): Deleted.
(WebCore::DisplayRefreshMonitorManager::registerClient): Deleted.
* platform/graphics/DisplayRefreshMonitorManager.h:
(WebCore::DisplayRefreshMonitorManager::DisplayRefreshMonitorManager): Deleted.
* platform/graphics/GraphicsLayerUpdater.cpp:
(WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater):
* platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
(-[WebDisplayLinkHandler setPreferredFramesPerSecond:]):
Set the preferredFramesPerSecond of the CADisplayLink.
* testing/Internals.cpp:
(WebCore::Internals::requestAnimationFrameThrottlingReasons const):
(WebCore::Internals::isRequestAnimationFrameThrottled const): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
Replace isRequestAnimationFrameThrottled() which returns a boolean by
requestAnimationFrameThrottlingReasons() which returns a string. The
string represents the throttling reasons.
2020-05-04 Darin Adler <darin@apple.com>
Remove unneeded USE(MEDIAREMOTE)
https://bugs.webkit.org/show_bug.cgi?id=211385
Reviewed by Eric Carlson.
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::updateNowPlayingInfo): Remove USE(MEDIAREMOTE).
* platform/mac/MediaRemoteSoftLink.cpp: Ditto.
* platform/mac/MediaRemoteSoftLink.h: Ditto.
* platform/mac/RemoteCommandListenerMac.mm:
(WebCore::RemoteCommandListenerMac::updateSupportedCommands): Ditto.
(WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac): Ditto.
(WebCore::RemoteCommandListenerMac::~RemoteCommandListenerMac): Ditto.
2020-05-04 Devin Rousso <drousso@apple.com>
Web Inspector: Worker: should use the name of the worker if it exists
https://bugs.webkit.org/show_bug.cgi?id=211244
Reviewed by Brian Burg.
Test: inspector/worker/runtime-basic.html
Pass the `name` from the `WorkerOptions` given to the `Worker` when it's constructed to Web
Inspector so it can be used in the frontend UI.
Drive-by: replace lots of pointers with references.
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
* workers/WorkerInspectorProxy.h:
(WebCore::WorkerInspectorProxy::name const): Added.
* workers/WorkerInspectorProxy.cpp:
(WebCore::WorkerInspectorProxy::workerStarted):
(WebCore::WorkerInspectorProxy::workerTerminated):
(WebCore::WorkerInspectorProxy::connectToWorkerInspectorController):
(WebCore::WorkerInspectorProxy::sendMessageFromWorkerToFrontend):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::workerStarted):
(WebCore::InspectorInstrumentation::workerTerminated):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::workerStartedImpl):
(WebCore::InspectorInstrumentation::workerTerminatedImpl):
* inspector/agents/InspectorWorkerAgent.h:
* inspector/agents/InspectorWorkerAgent.cpp:
(WebCore::InspectorWorkerAgent::sendMessageFromWorkerToFrontend):
(WebCore::InspectorWorkerAgent::workerStarted):
(WebCore::InspectorWorkerAgent::workerTerminated):
(WebCore::InspectorWorkerAgent::connectToAllWorkerInspectorProxiesForPage):
(WebCore::InspectorWorkerAgent::connectToWorkerInspectorProxy):
(WebCore::InspectorWorkerAgent::disconnectFromWorkerInspectorProxy):
2020-05-04 Devin Rousso <drousso@apple.com>
Web Inspector: provide a way for inspector to turn on/off ITP debug mode and AdClickAttribution debug mode
https://bugs.webkit.org/show_bug.cgi?id=209763
Reviewed by Brian Burg.
Tests: inspector/page/overrideSetting-AdClickAttributionDebugModeEnabled.html
inspector/page/overrideSetting-ITPDebugModeEnabled.html
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::overrideSetting):
* inspector/InspectorClient.h:
(WebCore::InspectorClient::setDeveloperPreferenceOverride): Added.
(WebCore::InspectorClient::setMockCaptureDevicesEnabledOverride): Deleted.
2020-05-04 Simon Fraser <simon.fraser@apple.com>
REGRESSION: [ Mac WK1 ] inspector/console/console-api.html is flaky crashing
https://bugs.webkit.org/show_bug.cgi?id=211386
Reviewed by David Kilzer.
Add some temporary logging code to get data from Mojave bots related to this
NSScrollerImp crash.
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::dumpPaintersWithDelegates):
(WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
(WebCore::ScrollAnimatorMac::~ScrollAnimatorMac):
(WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
(WebCore::ScrollAnimatorMac::willRemoveVerticalScrollbar):
(WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
(WebCore::ScrollAnimatorMac::willRemoveHorizontalScrollbar):
2020-05-04 Doug Kelly <dougk@apple.com>
Add additional null checks to MediaPlayerPrivateMediaSourceAVFObjC
https://bugs.webkit.org/show_bug.cgi?id=211134
<rdar://problem/62056577>
Reviewed by Daniel Bates.
Add additional null checks for a set m_mediaSourcePrivate to MediaPlayerPrivateMediaSourceAVFObjC. Most uses in this
class are already guarded, but a few were not, which could lead to a null pointer crash if encountered.
No new tests; no functional changes.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
2020-05-04 Darin Adler <darin@apple.com>
Remove now-unneeded HAVE(MEDIA_PLAYER)
https://bugs.webkit.org/show_bug.cgi?id=211378
Reviewed by Alex Christensen.
* platform/RemoteCommandListener.cpp: Remove uneeded check for HAVE(MEDIA_PLAYER)
in code that already checks for Cocoa platforms explicitly.
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring): Removed
check of HAVE(MEDIA_PLAYER) in a Cocoa-only source file.
* platform/ios/RemoteCommandListenerIOS.h: Ditto. Also removed #pragma once and
some other unnecessary things because this is only included in the .mm file below.
* platform/ios/RemoteCommandListenerIOS.mm: Ditto.
2020-05-04 Guillem Vinals <gvinals@apple.com>
WebGPU: Textures should be able to have OUTPUT_ATTACHMENT | SAMPLED usage flags
https://bugs.webkit.org/show_bug.cgi?id=211345
<rdar://problem/62264423>
Reviewed by Myles C. Maxfield.
Added support for off-screen render targets.
Test: webgpu/textures-textureviews.html
* platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
(WebCore::mtlTextureUsageForGPUTextureUsageFlags):
2020-05-04 Guillem Vinals <gvinals@apple.com>
WebGPU: copyTextureToTexture() has an implementation bug (src copy view info is used also as dst)
https://bugs.webkit.org/show_bug.cgi?id=211303
Reviewed by Daniel Bates.
The source copy information is also used as the destination copy information.
Test: webgpu/blit-commands-texture-to-texture.html
* platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
(WebCore::GPUCommandBuffer::copyTextureToTexture):
2020-05-04 Antoine Quint <graouts@apple.com>
Media controls tracks menu shows "Auto" selected instead of track selected via the JS API
https://bugs.webkit.org/show_bug.cgi?id=211230
<rdar://problem/62648409>
Reviewed by Eric Carlson.
Test: media/modern-media-controls/tracks-support/tracks-support-text-track-selected-via-media-api.html
We're fixing two issues with the captions menu on macOS here.
First, if a text track was marked as "showing" with the JS API, we would not show it as selected in the UI
because MediaControlsHost would report that the captionDisplayMode was "automatic" and we'd take this as
sufficient data to say that the "Automatic (Recommended)" item should be shown as selected. We now only
do this if we also don't have any text tracks set as "showing".
The second issue was when trying to select "Automatic (Recommended)" when a text track had been marked as
"showing" with the JS API. Calling `setSelectedTextTrack()` on MediaControlsHost in this case was not sufficient
because HTMLMediaElement::setSelectedTextTrack is a no-op if the automatic text track is provided but captionDisplayMode
is still set to "automatic". To address this, we first disable all text tracks before calling `setSelectedTextTrack()`.
* Modules/modern-media-controls/media/tracks-support.js:
(TracksSupport.prototype.tracksPanelIsTrackInSectionSelected):
(TracksSupport.prototype.tracksPanelSelectionDidChange):
2020-05-04 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Override the table computed height when content needs more space
https://bugs.webkit.org/show_bug.cgi?id=211367
Reviewed by Antti Koivisto.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2020-05-04 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Use distributeAvailableSpace for row sizing
https://bugs.webkit.org/show_bug.cgi?id=211366
Reviewed by Antti Koivisto.
Switch over to the generic space distribution for table row sizing.
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::RowSpan::hasSpan):
(WebCore::Layout::RowSpan::isSpanned):
(WebCore::Layout::RowSpan::spanCount):
(WebCore::Layout::RowSpan::startSpan):
(WebCore::Layout::RowSpan::endSpan):
(WebCore::Layout::RowSpan::index):
(WebCore::Layout::RowSpan::size):
(WebCore::Layout::RowSpan::spacing):
(WebCore::Layout::distributeAvailableSpace):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):
2020-05-04 Youenn Fablet <youenn@apple.com>
Camera video samples have a bad orientation if upside down
https://bugs.webkit.org/show_bug.cgi?id=211373
Reviewed by Eric Carlson.
Manually tested on iPad and iPhones.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::computeSampleRotation):
-90 should be the same as 270 not -270.
2020-05-04 Yusuke Suzuki <ysuzuki@apple.com>
[gtk] isMainThread() assert when running minibrowser in debug builds.
https://bugs.webkit.org/show_bug.cgi?id=211355
Reviewed by Mark Lam.
Using NeverDestroyed<const AtomString> is discouraged if it is in the non main thread. This can be quite easily wrong:
if the running thread is one of WorkerPool, then this is wrong since AtomStringTable will be destroyed every time underlying
Thread is shutdown. If this is invoked by AutomaticThread, this is also wrong due to the same reason etc. This is why
we introduced MainThreadNeverDestroyed and use it for const AtomString. This restriction found the bug that we are using
`NeverDestroyed<const AtomString>` in non main thread. We should not do that.
This patch fixes the issue by introducing TextureMapperShaderProgram::Variable instead of using AtomString. Then this code
no longer has thread affinity.
* platform/graphics/texmap/TextureMapperShaderProgram.cpp:
(WebCore::TextureMapperShaderProgram::getLocation): Deleted.
* platform/graphics/texmap/TextureMapperShaderProgram.h:
2020-05-04 Emilio Cobos Álvarez <emilio@crisal.io>
Put lh / rlh units behind a flag until bug 211351 is sorted out.
https://bugs.webkit.org/show_bug.cgi?id=211356
Reviewed by Antti Koivisto.
* css/parser/CSSParserToken.cpp: Use the new runtime flag to disable parsing the units.
(WebCore::cssPrimitiveValueUnitFromTrie):
* page/RuntimeEnabledFeatures.h: Define the new runtime flag.
(WebCore::RuntimeEnabledFeatures::setLineHeightUnitsEnabled):
(WebCore::RuntimeEnabledFeatures::lineHeightUnitsEnabled const):
2020-05-03 David Kilzer <ddkilzer@apple.com>
Use LocalCurrentGraphicsContext in WebKit::convertPlatformImageToBitmap()
<https://webkit.org/b/211274>
Reviewed by Darin Adler.
* platform/mac/LocalCurrentGraphicsContext.h:
(WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext):
(WebCore::LocalCurrentGraphicsContext::~LocalCurrentGraphicsContext):
- Export methods for use in WebKit.
2020-05-03 David Kilzer <ddkilzer@apple.com>
Fix static analyzer false positive in -[WebUndefined undefined]
<https://webkit.org/b/211353>
Reviewed by Darin Adler.
* bridge/objc/WebScriptObject.mm:
(+[WebUndefined allocWithZone:]):
(-[WebUndefined initWithCoder:]):
(-[WebUndefined retain]):
(-[WebUndefined autorelease]):
- Update method signatures.
(+[WebUndefined undefined]):
- Fix clang static analyzer false positive by using idiomatic
-alloc, -init calls to create object. These methods call
-allocWithZone:, so this still uses the singleton pattern.
2020-05-03 Daniel Bates <dabates@apple.com>
Sometimes cannot find <textarea> in list of editable elements
https://bugs.webkit.org/show_bug.cgi?id=211348
<rdar://problem/62231067>
Reviewed by Simon Fraser.
When building the editable region add the bounds of the text control to the region instead
of the bounds of its inner text element even though it is the latter that is actually editable.
Using the bounds of the text control is more in line with a user's expectation for the editable
portion of a text control: the entire control. So, do that.
Tests: editing/editable-region/hit-test-textarea-empty-space.html
editing/editable-region/search-field-basic.html
editing/editable-region/text-field-basic.html
editing/editable-region/textarea-basic.html
* rendering/EventRegion.cpp:
(WebCore::EventRegionContext::unite):
(WebCore::EventRegion::unite):
Add a new bool as to whether to override the user-modify check and just assume that the region
is for something editable. This is needed because the form control (e.g. the <input> or <textarea>
aka the shadow host element) isn't actually editable itself. Its inner text element is editable.
RenderBlock::paintObject() will pass true for this override when event region painting such a
control and the control's inner text element is editable so that the controls bounds are added to
the editable region.
* rendering/EventRegion.h: Add a bool, defaulting to false to keep the current behavior. While
I am here remove some unneeded WEBCORE_EXPORT attributions.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject): Pass a value for the override argument. It will be true
if this block is actually a text control and its inner text element is editable. Otherwise, it
will be false. There is also no longer a need to descend into the children of a text control
because I only care to record the bounds of the control itself as editable, not its inner text
element.
2020-05-03 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Turns horizontal space distribution into a generic space distribution
https://bugs.webkit.org/show_bug.cgi?id=211352
Reviewed by Antti Koivisto.
Horizontal(column) and vertical(row) space distributions use essentially the same logic to distribute
the extra space among the columns/rows.
This patch turns the horizontal space distribution function into a generic space distribution code so
that we can use it for row sizing as well.
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::ColumnSpan::hasSpan):
(WebCore::Layout::ColumnSpan::isSpanned):
(WebCore::Layout::ColumnSpan::spanCount):
(WebCore::Layout::ColumnSpan::startSpan):
(WebCore::Layout::ColumnSpan::endSpan):
(WebCore::Layout::ColumnSpan::index):
(WebCore::Layout::ColumnSpan::size):
(WebCore::Layout::ColumnSpan::spacing):
(WebCore::Layout::distributeAvailableSpace):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::slot const):
2020-05-03 Youenn Fablet <youenn@apple.com>
AudioMediaStreamTrackRendererCocoa should create/start/stop its remote unit on the main thread
https://bugs.webkit.org/show_bug.cgi?id=211287
Reviewed by Eric Carlson.
Creating/starting/stopping audio units in different threads is error prone.
Now that we have an observer model where we have observers for when to play in the main thread and
based on that, we decide to receive audio samples in a background thread, we can simplify the logic of AudioMediaStreamTrackRendererCocoa.
We do this by creating/starting the unit in AudioMediaStreamTrackRendererCocoa::start.
At that point, AudioMediaStreamTrackRendererCocoa is not expected to receive any sample.
Just after starting, AudioTrackPrivateMediaStream will receive audio samples and forward them to AudioMediaStreamTrackRendererCocoa.
AudioMediaStreamTrackRendererCocoa will then create in a background thread the AudioSampleDataSource that is responsible to adapt the received audio samples to the unit.
Manually tested.
* platform/audio/mac/AudioSampleDataSource.h:
(WebCore::AudioSampleDataSource::inputDescription const):
* platform/audio/mac/CAAudioStreamDescription.h:
* platform/mediastream/AudioTrackPrivateMediaStream.cpp:
(WebCore::AudioTrackPrivateMediaStream::startRenderer):
Ensure to start the unit and then start gettting audio samples.
* platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp:
(WebCore::AudioMediaStreamTrackRendererCocoa::start):
(WebCore::AudioMediaStreamTrackRendererCocoa::stop):
(WebCore::AudioMediaStreamTrackRendererCocoa::clear):
(WebCore::AudioMediaStreamTrackRendererCocoa::pushSamples):
(WebCore::AudioMediaStreamTrackRendererCocoa::render):
* platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.h:
2020-05-03 Rob Buis <rbuis@igalia.com>
atob() should not accept a vertical tab
https://bugs.webkit.org/show_bug.cgi?id=184529
Reviewed by Darin Adler.
The forgiving-base64 decode algorithm [1] uses [2] to strip
out ASCII whitespace which does not include vertical tabs, so
change the atob() implementation to not strip out vertical
tabs and thus to fail decode on vertical tabs.
[1] https://infra.spec.whatwg.org/#forgiving-base64-decode
[2] https://infra.spec.whatwg.org/#ascii-whitespace
Behavior matches Firefox and Chrome.
* page/Base64Utilities.cpp:
(WebCore::Base64Utilities::atob):
* platform/network/DataURLDecoder.cpp:
(WebCore::DataURLDecoder::decodeBase64):
2020-05-02 Simon Fraser <simon.fraser@apple.com>
Add a log channel for OverlayScrollbars
https://bugs.webkit.org/show_bug.cgi?id=211329
Reviewed by Zalan Bujtas.
Overlay scrollbar behavior is opaque. This log channel will add clarity.
* platform/Logging.h:
* platform/mac/ScrollAnimatorMac.mm:
(operator<<):
(-[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]):
(-[WebScrollbarPartAnimation startAnimation]):
(-[WebScrollbarPartAnimation setCurrentProgress:setCurrentProgress:]):
(WebCore::ScrollAnimatorMac::mouseEnteredContentArea):
(WebCore::ScrollAnimatorMac::mouseExitedContentArea):
(WebCore::ScrollAnimatorMac::mouseMovedInContentArea):
(WebCore::ScrollAnimatorMac::didBeginScrollGesture const):
(WebCore::ScrollAnimatorMac::didEndScrollGesture const):
(WebCore::ScrollAnimatorMac::mayBeginScrollGesture const):
(WebCore::ScrollAnimatorMac::handleWheelEventPhase):
2020-05-02 Simon Fraser <simon.fraser@apple.com>
Make it possible to test overlay scrollbar interactions
https://bugs.webkit.org/show_bug.cgi?id=211342
Reviewed by Daniel Bates.
Add internals.horizontalScrollbarState() and internals.verticalScrollbarState() and hook them
up via ScrollableArea to ScrollAnimatorMac. They dump state based on the NSScrollerImp state.
Make internals.setUsesOverlayScrollbars(true) actually trigger real overlay scrollbars by notifying
the ScrollbarTheme about the scrollbar style change.
Tests: fast/scrolling/mac/scrollbars/overlay-scrollbar-hovered.html
fast/scrolling/mac/scrollbars/overlay-scrollbar-reveal.html
fast/scrolling/mac/scrollbars/overlay-scrollbar-state.html
fast/scrolling/mac/scrollbars/scrollbar-state.html
* platform/ScrollAnimator.h:
(WebCore::ScrollAnimator::ScrollAnimator::horizontalScrollbarStateForTesting const):
(WebCore::ScrollAnimator::ScrollAnimator::verticalScrollbarStateForTesting const):
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::horizontalScrollbarStateForTesting const):
(WebCore::ScrollableArea::verticalScrollbarStateForTesting const):
* platform/ScrollableArea.h:
* platform/mac/NSScrollerImpDetails.h:
* platform/mac/ScrollAnimatorMac.h:
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::scrollbarState):
(WebCore::ScrollAnimatorMac::horizontalScrollbarStateForTesting const):
(WebCore::ScrollAnimatorMac::verticalScrollbarStateForTesting const):
* testing/Internals.cpp:
(WebCore:: const):
(WebCore::Internals::scrollbarOverlayStyle const):
(WebCore::Internals::scrollbarUsingDarkAppearance const):
(WebCore::Internals::horizontalScrollbarState const):
(WebCore::Internals::verticalScrollbarState const):
(WebCore::Internals::setUsesOverlayScrollbars):
* testing/Internals.h:
* testing/Internals.idl:
2020-05-02 Daniel Bates <dabates@apple.com>
Page::editableElementsInRect() should return root editable elements
https://bugs.webkit.org/show_bug.cgi?id=211343
<rdar://problem/60015801>
Reviewed by Simon Fraser.
Return the root editable element for each non-text form control editable element
inside the search rect as it may not have been hit itself. This can happen if the
search rect is small enough to intersect only child elements of the root editable
elements.
* page/Page.cpp:
(WebCore::Page::editableElementsInRect const):
(WebCore::isEditableTextInputElement): Deleted.
2020-05-02 Simon Fraser <simon.fraser@apple.com>
scrollableAreaForScrollingNodeID() gives the wrong answer for the FrameView
https://bugs.webkit.org/show_bug.cgi?id=211310
Reviewed by Zalan Bujtas.
Given the FrameView's scrollingNodeID, RenderLayerCompositor::scrollableAreaForScrollingNodeID()
would return the RenderView's layer when it should return the FrameView itself.
Fixing this allows removal of a special-case in setActiveScrollSnapIndices().
No behavior change.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::setActiveScrollSnapIndices):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::scrollableAreaForScrollingNodeID const):
2020-05-02 Simon Fraser <simon.fraser@apple.com>
handleWheelEventPhase() should include the relevant ScrollingNodeID
https://bugs.webkit.org/show_bug.cgi?id=211315
Reviewed by Tim Horton.
handleWheelEventPhase() is used to send information about wheel event phases
to the main thread, which make their way to ScrollAnimatorMac::handleWheelEventPhase()
and are used to update the state of overlay scrollbars. In order to talk to the
correct set of scrollbars with overflow:scroll, we need to send along the ScrollingNodeID
and map that to the appropriate ScrollableArea.
Will be tested by future overlay scrollbar tests.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::handleWheelEventPhase):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::handleWheelEventPhase): Deleted.
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::handleWheelEventPhase):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::handleWheelEventPhase):
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent):
* platform/mac/ScrollAnimatorMac.mm:
2020-05-02 Devin Rousso <drousso@apple.com>
[CSS Easing 1] implement `jump-*` step positions
https://bugs.webkit.org/show_bug.cgi?id=211271
Reviewed by Dean Jackson.
Add support for `jump-start`, `jump-end`, `jump-none`, and `jump-both` step positions inside
the `steps()` CSS timing function <https://drafts.csswg.org/css-easing-1/#step-position>.
Adjust existing serialization logic to match the spec <https://drafts.csswg.org/css-easing-1/#serialization>:
- omit `end` (and `jump-end`)
- the value `step-start` should result in `steps(1, start)` instead of `step-start`
- the value `step-end` should result in `steps(1)` instead of `step-end`
Tests: animations/computed-style.html
fast/css/animation-steps-calculated-value.html
transitions/transitions-parsing.html
web-platform-tests/css/css-animations/parsing/animation-timing-function-computed.html
web-platform-tests/css/css-animations/parsing/animation-timing-function-valid.html
web-platform-tests/css/css-easing/step-timing-functions-output.html
web-platform-tests/css/css-easing/step-timing-functions-syntax.html
web-platform-tests/css/css-transitions/parsing/transition-timing-function-computed.html
web-platform-tests/css/css-transitions/parsing/transition-timing-function-valid.html
web-platform-tests/web-animations/timing-model/time-transformations/transformed-progress.html
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeSteps):
(WebCore::consumeAnimationTimingFunction):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::createTimingFunctionValue):
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapAnimationTimingFunction):
* css/CSSTimingFunctionValue.h:
(WebCore::CSSStepsTimingFunctionValue::create):
(WebCore::CSSStepsTimingFunctionValue::stepPosition const): Added.
(WebCore::CSSStepsTimingFunctionValue::CSSStepsTimingFunctionValue):
(WebCore::CSSStepsTimingFunctionValue::stepAtStart const): Deleted.
* css/CSSTimingFunctionValue.cpp:
(WebCore::CSSStepsTimingFunctionValue::customCSSText const):
(WebCore::CSSStepsTimingFunctionValue::equals const):
* platform/animation/TimingFunction.h:
(WebCore::StepsTimingFunction::create):
(WebCore::StepsTimingFunction::StepsTimingFunction):
(WebCore::StepsTimingFunction::stepPosition): Added.
(WebCore::StepsTimingFunction::setStepPosition): Added.
(WebCore::StepsTimingFunction::clone):
(WebCore::StepsTimingFunction::stepAtStart): Deleted.
(WebCore::StepsTimingFunction::setStepAtStart): Deleted.
* platform/animation/TimingFunction.cpp:
(WebCore::operator<<):
(WebCore::TimingFunction::transformTime):
(WebCore::TimingFunction::createFromCSSValue):
(WebCore::TimingFunction::cssText const):
2020-05-01 Tim Horton <timothy_horton@apple.com>
Books sometimes ends up with blank pages, especially after adjusting font size
https://bugs.webkit.org/show_bug.cgi?id=211265
<rdar://problem/59898144>
Reviewed by Darin Adler.
* page/FrameView.cpp:
(WebCore::FrameView::setViewExposedRect):
Rename "hasRectChanged" because it only tests if the optional-state of the
rect has changed, not the actual value.
2020-05-01 Wenson Hsieh <wenson_hsieh@apple.com>
Text manipulation should observe the value attribute of some input elements
https://bugs.webkit.org/show_bug.cgi?id=211307
<rdar://problem/61568528>
Reviewed by Darin Adler.
Teach TextManipulationController to detect the `value` attribute in input elements of type "button" and
"submit". To do this, we plumb the element through to `isAttributeForTextManipulation` and check `isTextButton()`
if "value" attribute is being considered.
Test: TextManipulation.StartTextManipulationExtractsValuesFromButtonInputs
* editing/TextManipulationController.cpp:
(WebCore::isAttributeForTextManipulation):
(WebCore::TextManipulationController::observeParagraphs):
2020-05-01 Chris Dumez <cdumez@apple.com>
Regression(r259036) Unable to post comments on Jira
https://bugs.webkit.org/show_bug.cgi?id=211122
<rdar://problem/62561879>
Unreviewed, revert r259036 as the new behavior does not match other browsers
and broke some Jira instances.
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::populateFrameLoadRequest):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::addExtraFieldsToRequest):
(WebCore::FrameLoader::addHTTPOriginIfNeeded):
(WebCore::FrameLoader::loadResourceSynchronously):
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/FrameLoader.h:
* loader/NavigationScheduler.cpp:
* loader/PingLoader.cpp:
(WebCore::PingLoader::sendPing):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::updateReferrerAndOriginHeaders):
* platform/network/ResourceRequestBase.cpp:
(WebCore::doesRequestNeedHTTPOriginHeader): Deleted.
* platform/network/ResourceRequestBase.h:
2020-05-01 Jack Lee <shihchieh_lee@apple.com>
Unreviewed, amend change log entry for r260831.
* ChangeLog:
2020-05-01 Chris Dumez <cdumez@apple.com>
Unreviewed, another build fix after r260962.
* page/Page.h:
2020-05-01 Daniel Bates <dabates@apple.com>
Avoid unnecessary copying in AnimationTimeline and other clean ups
https://bugs.webkit.org/show_bug.cgi?id=211309
Reviewed by Simon Fraser.
Return animations by const lvalue ref to avoid copying the Vectors.
Default the constructor and destructor implementations. Remove an
unnessary argument name from animationsForElement() and re-arrange
decls to make class definition more idiomatic.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::AnimationTimeline): Deleted.
(WebCore::AnimationTimeline::~AnimationTimeline): Deleted.
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::relevantAnimations const):
(WebCore::AnimationTimeline::allAnimations const):
2020-05-01 Daniel Bates <dabates@apple.com>
Change HitTestResult::NodeSet from set of RefPtrs to set of Refs
https://bugs.webkit.org/show_bug.cgi?id=211306
Reviewed by Simon Fraser.
HitTestResult::listBasedTestResult() never returns a set with nullptrs in it.
So, change the set declaration from ListHashSet<RefPtr<Node>> to ListHashSet<Ref<Node>>.
This way people are not tempted to unnecessarily null check the nodes in the set.
As I made this change to TreeScope::elementsFromPoint() I noticed that retargetToScope(),
which is called by it, returned a Node&. So, I changed it to return a Ref<Node>. That
required me to fix up caretRangeFromPoint(), which lead me to fix up nodeFromPoint() as well.
* dom/Document.cpp:
(WebCore::Document::caretRangeFromPoint):
* dom/EventPath.cpp:
(WebCore::RelatedNodeRetargeter::checkConsistency):
* dom/TreeScope.cpp:
(WebCore::TreeScope::retargetToScope const):
(WebCore::TreeScope::nodeFromPoint):
(WebCore::TreeScope::elementFromPoint):
(WebCore::TreeScope::elementsFromPoint):
* dom/TreeScope.h:
* page/Page.cpp:
(WebCore::Page::editableElementsInRect const):
* rendering/HitTestResult.cpp:
(WebCore::appendToNodeSet):
(WebCore::HitTestResult::HitTestResult):
(WebCore::HitTestResult::operator=):
(WebCore::HitTestResult::addNodeToListBasedTestResultCommon):
(WebCore::HitTestResult::append):
* rendering/HitTestResult.h:
* testing/Internals.cpp:
(WebCore::Internals::nodesFromRect const):
2020-05-01 Chris Dumez <cdumez@apple.com>
Unreviewed build fix after r260962.
* page/Page.cpp:
(WebCore::Page::setCORSDisablingPatterns):
* page/Page.h:
(WebCore::Page::setCORSDisablingPatterns): Deleted.
2020-05-01 Kenneth Russell <kbr@chromium.org>
[WebGL2] Refactor texImage2D and texSubImage2D taking ImageBitmap, ImageData, Image, ArrayBufferView
https://bugs.webkit.org/show_bug.cgi?id=210766
Reviewed by Dean Jackson.
Refactor the texture upload paths taking DOM sources and
ArrayBuffers so that texImage/texSubImage and 2D/3D textures are
handled with the same entry point. Hook up WebGL 2.0 pixel unpack
parameters for selecting sub-rectangles during texture uploads.
Refactor context initialization to support WebGL 2.0-specific code
paths.
Remove duplicate code validating the type of the ArrayBufferView
passed to readPixels that was added in the patch for Bug 209515,
and validation code subsumed by ANGLE.
With this patch, dozens more texture-related WebGL 2.0 conformance
tests are passing completely, including all of those under the
directories:
webgl/2.0.0/conformance2/textures/
canvas_sub_rectangle/
image_data/
The svg_image/ tests in this directory demonstrate browser
inconsistencies in SVG handling, and are temporarily skipped.
These will be investigated in Bug 211220.
Other conformance tests progress or change results, which is
expected until WebGL2RenderingContext is fully implemented.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::create):
(WebCore::WebGL2RenderingContext::WebGL2RenderingContext):
(WebCore::WebGL2RenderingContext::initializeNewContext):
(WebCore::WebGL2RenderingContext::resetUnpackParameters):
(WebCore::WebGL2RenderingContext::restoreUnpackParameters):
(WebCore::WebGL2RenderingContext::initializeShaderExtensions):
(WebCore::WebGL2RenderingContext::getTextureSourceSubRectangle):
(WebCore::WebGL2RenderingContext::pixelStorei):
(WebCore::WebGL2RenderingContext::texStorage2D):
(WebCore::WebGL2RenderingContext::texImage2D):
(WebCore::WebGL2RenderingContext::texImage3D):
(WebCore::WebGL2RenderingContext::texSubImage2D):
(WebCore::WebGL2RenderingContext::texSubImage3D):
(WebCore::WebGL2RenderingContext::initializeTransformFeedbackBufferCache): Deleted.
(WebCore::WebGL2RenderingContext::initializeSamplerCache): Deleted.
(WebCore::WebGL2RenderingContext::sliceTypedArrayBufferView): Deleted.
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::create):
(WebCore::WebGLRenderingContext::WebGLRenderingContext):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::ScopedUnpackParametersResetRestore::ScopedUnpackParametersResetRestore):
(WebCore::ScopedUnpackParametersResetRestore::~ScopedUnpackParametersResetRestore):
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::initializeNewContext):
(WebCore::WebGLRenderingContextBase::resetUnpackParameters):
(WebCore::WebGLRenderingContextBase::restoreUnpackParameters):
(WebCore::WebGLRenderingContextBase::compressedTexImage2D):
(WebCore::WebGLRenderingContextBase::compressedTexSubImage2D):
(WebCore::WebGLRenderingContextBase::validateSettableTexInternalFormat):
(WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
(WebCore::WebGLRenderingContextBase::generateMipmap):
(WebCore::WebGLRenderingContextBase::getTexParameter):
(WebCore::WebGLRenderingContextBase::readPixels):
(WebCore::WebGLRenderingContextBase::sentinelEmptyRect):
(WebCore::WebGLRenderingContextBase::safeGetImageSize):
(WebCore::WebGLRenderingContextBase::getImageDataSize):
(WebCore::WebGLRenderingContextBase::getTexImageSourceSize):
(WebCore::WebGLRenderingContextBase::texImageSourceHelper):
(WebCore::WebGLRenderingContextBase::texImageArrayBufferViewHelper):
(WebCore::WebGLRenderingContextBase::texImageImpl):
(WebCore::WebGLRenderingContextBase::texImage2DBase):
(WebCore::WebGLRenderingContextBase::texSubImage2DBase):
(WebCore::WebGLRenderingContextBase::getTexImageFunctionName):
(WebCore::WebGLRenderingContextBase::validateTexFunc):
(WebCore::WebGLRenderingContextBase::texImage2D):
(WebCore::WebGLRenderingContextBase::texSubImage2D):
(WebCore::WebGLRenderingContextBase::validateArrayBufferType):
(WebCore::WebGLRenderingContextBase::validateTexFuncData):
(WebCore::WebGLRenderingContextBase::validateTexFuncParameters):
(WebCore::WebGLRenderingContextBase::addExtensionSupportedFormatsAndTypes):
(WebCore::WebGLRenderingContextBase::addExtensionSupportedFormatsAndTypesWebGL2):
(WebCore::WebGLRenderingContextBase::validateTexImageSourceFormatAndType):
(WebCore::WebGLRenderingContextBase::copyTexImage2D):
(WebCore::WebGLRenderingContextBase::drawImageIntoBuffer):
(WebCore::WebGLRenderingContextBase::texParameter):
(WebCore::WebGLRenderingContextBase::getUnpackPixelStoreParams const):
(WebCore::WebGLRenderingContextBase::validateTextureBinding):
(WebCore::WebGLRenderingContextBase::validateTexImageBinding):
(WebCore::WebGLRenderingContextBase::validateTexture2DBinding):
(WebCore::WebGLRenderingContextBase::validateSize):
(WebCore::WebGLRenderingContextBase::validateImageBitmap):
(WebCore::WebGLRenderingContextBase::maybeRestoreContext):
(WebCore::WebGLRenderingContextBase::texImageSource2D): Deleted.
(WebCore::WebGLRenderingContextBase::texImage2DImpl): Deleted.
(WebCore::WebGLRenderingContextBase::texSubImage2DImpl): Deleted.
* html/canvas/WebGLRenderingContextBase.h:
(WebCore::WebGLRenderingContextBase::getTextureSourceSize):
(WebCore::WebGLRenderingContextBase::validateTexImageSubRectangle):
* platform/graphics/IntRect.cpp:
(WebCore::IntRect::isValid const):
* platform/graphics/IntRect.h:
2020-05-01 Jack Lee <shihchieh_lee@apple.com>
Nullptr crash in CompositeEditCommand::cloneParagraphUnderNewElement when indent
and align a paragraph.
https://bugs.webkit.org/show_bug.cgi?id=211273
<rdar://problem/61885958>
Reviewed by Geoffrey Garen.
A load event can fire when we clone and append a paragraph. Check if the elements
are removed in the event and bail out.
Test: fast/editing/indent-then-justifyFull-crash.html
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::cloneParagraphUnderNewElement):
2020-05-01 Jack Lee <shihchieh_lee@apple.com>
Nullptr crash in EditCommand::EditCommand via CompositeEditCommand::removeNode
https://bugs.webkit.org/show_bug.cgi?id=207600
<rdar://problem/56969450>
Reviewed by Geoffrey Garen.
Second part of the fix. Remove m_frame in FrameSelection so it will not be
inadvertently used and cause this crash.
No new tests, covered by existing test.
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::rootViewRectForRange const):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::FrameSelection):
(WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
(WebCore::FrameSelection::modify):
(WebCore::FrameSelection::selectFrameElementInParentIfFullySelected):
(WebCore::FrameSelection::setFocusedElementIfNeeded):
(WebCore::FrameSelection::shouldDeleteSelection const):
(WebCore::FrameSelection::shouldDeleteSelection):
(WebCore::FrameSelection::revealSelection):
(WebCore::FrameSelection:: shouldChangeSelection):
(WebCore::FrameSelection::shouldChangeSelection const):
* editing/FrameSelection.h:
* editing/atk/FrameSelectionAtk.cpp:
(WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
* editing/mac/FrameSelectionMac.mm:
(WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
2020-05-01 Darin Adler <darin@apple.com>
REGRESSION (r260739): Crash when pasting into Mail
https://bugs.webkit.org/show_bug.cgi?id=211311
Reviewed by Wenson Hsieh.
Speculative fix. Would be much better to create a test case demonstrating it's correct.
* editing/cocoa/HTMLConverter.mm:
(WebCore::editingAttributedString): Use container node when TextIterator::node
returns null.
2020-05-01 Don Olmstead <don.olmstead@sony.com>
[GTK] Add additional exports to support hidden visibility
https://bugs.webkit.org/show_bug.cgi?id=211246
Reviewed by Michael Catanzaro.
* platform/ContentType.h:
* platform/graphics/cairo/RefPtrCairo.h:
* platform/gtk/GtkUtilities.h:
* platform/network/soup/CertificateInfo.h:
* platform/network/soup/SoupNetworkSession.h:
2020-05-01 Yusuke Suzuki <ysuzuki@apple.com>
Introduce MainThreadNeverDestroyed / MainThreadLazyNeverDestroyed
https://bugs.webkit.org/show_bug.cgi?id=211264
Reviewed by Mark Lam.
No behavior change. Adding assertions additionally.
* Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp:
(WebCore::stringForPlaybackTargetAvailability):
* Modules/encryptedmedia/InitDataRegistry.cpp:
(WebCore::InitDataRegistry::cencName):
(WebCore::InitDataRegistry::keyidsName):
(WebCore::InitDataRegistry::webmName):
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::automaticKeyword):
(WebCore::MediaControlsHost::forcedOnlyKeyword):
(WebCore::alwaysOnKeyword):
(WebCore::manualKeyword):
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::kind const):
(WebCore::MediaStreamTrack::contentHint const):
* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::blobKeyword):
(WebCore::arraybufferKeyword):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::liveRegionRelevant const):
* dom/ConstantPropertyMap.cpp:
(WebCore::ConstantPropertyMap::nameForProperty const):
* dom/Document.cpp:
(WebCore::Document::validateCustomElementName):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::isValidCSSContentType):
* dom/MutationRecord.cpp:
* dom/make_names.pl:
(printNamesHeaderFile):
(printNamesCppFile):
* html/Autocapitalize.cpp:
(WebCore::stringForAutocapitalizeType):
* html/Autofill.cpp:
(WebCore::isContactToken):
(WebCore::AutofillData::createFromHTMLFormControlElement):
* html/BaseCheckableInputType.cpp:
(WebCore::BaseCheckableInputType::fallbackValue const):
* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree):
* html/ColorInputType.cpp:
(WebCore::ColorInputType::createShadowSubtree):
* html/FileInputType.cpp:
(WebCore::UploadButtonElement::UploadButtonElement):
* html/FormController.cpp:
(WebCore::FormKeyGenerator::formKey):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAttribute):
(WebCore::HTMLAnchorElement::isSystemPreviewLink const):
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::formControlType const):
* html/HTMLDetailsElement.cpp:
(WebCore::summarySlotName):
* html/HTMLElement.cpp:
(WebCore::toValidDirValue):
(WebCore::trueName):
(WebCore::falseName):
(WebCore::plaintextOnlyName):
(WebCore::HTMLElement::setAutocorrect):
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::formControlType const):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::autocomplete const):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::loadingForBindings const):
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::formControlType const):
* html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::formControlType const):
* html/HTMLOutputElement.cpp:
(WebCore::HTMLOutputElement::formControlType const):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay const):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::formControlType const):
* html/HTMLTableCellElement.cpp:
(WebCore::HTMLTableCellElement::scope const):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::formControlType const):
* html/HTMLTextFormControlElement.cpp:
(WebCore::directionString):
(WebCore::HTMLTextFormControlElement::updateInnerTextElementEditability):
* html/InputMode.cpp:
(WebCore::InputModeNames::none):
(WebCore::InputModeNames::text):
(WebCore::InputModeNames::tel):
(WebCore::InputModeNames::url):
(WebCore::InputModeNames::email):
(WebCore::InputModeNames::numeric):
(WebCore::InputModeNames::decimal):
(WebCore::InputModeNames::search):
* html/InputTypeNames.cpp:
(WebCore::InputTypeNames::button):
(WebCore::InputTypeNames::checkbox):
(WebCore::InputTypeNames::color):
(WebCore::InputTypeNames::date):
(WebCore::InputTypeNames::datetime):
(WebCore::InputTypeNames::datetimelocal):
(WebCore::InputTypeNames::email):
(WebCore::InputTypeNames::file):
(WebCore::InputTypeNames::hidden):
(WebCore::InputTypeNames::image):
(WebCore::InputTypeNames::month):
(WebCore::InputTypeNames::number):
(WebCore::InputTypeNames::password):
(WebCore::InputTypeNames::radio):
(WebCore::InputTypeNames::range):
(WebCore::InputTypeNames::reset):
(WebCore::InputTypeNames::search):
(WebCore::InputTypeNames::submit):
(WebCore::InputTypeNames::telephone):
(WebCore::InputTypeNames::text):
(WebCore::InputTypeNames::time):
(WebCore::InputTypeNames::url):
(WebCore::InputTypeNames::week):
* html/MediaController.cpp:
(WebCore::playbackStateWaiting):
(WebCore::playbackStatePlaying):
(WebCore::playbackStateEnded):
* html/RangeInputType.cpp:
(WebCore::RangeInputType::createShadowSubtree):
* html/SearchInputType.cpp:
(WebCore::updateResultButtonPseudoType):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::createShadowSubtree):
(WebCore::TextFieldInputType::createDataListDropdownIndicator):
(WebCore::TextFieldInputType::createContainer):
(WebCore::TextFieldInputType::createAutoFillButton):
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::buildBubbleTree):
* html/shadow/DetailsMarkerControl.cpp:
(WebCore::DetailsMarkerControl::DetailsMarkerControl):
* html/shadow/MediaControlTextTrackContainerElement.cpp:
(WebCore::MediaControlTextTrackContainerElement::MediaControlTextTrackContainerElement):
* html/shadow/ProgressShadowElement.cpp:
(WebCore::ProgressInnerElement::create):
(WebCore::ProgressBarElement::create):
(WebCore::ProgressValueElement::create):
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::resolveCustomStyle):
(WebCore::SliderContainerElement::resolveCustomStyle):
* html/shadow/SpinButtonElement.cpp:
(WebCore::SpinButtonElement::SpinButtonElement):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement):
(WebCore::SearchFieldCancelButtonElement::SearchFieldCancelButtonElement):
* html/shadow/YouTubeEmbedShadowElement.cpp:
(WebCore::YouTubeEmbedShadowElement::YouTubeEmbedShadowElement):
* html/shadow/mac/ImageControlsButtonElementMac.cpp:
(WebCore::ImageControlsButtonElementMac::tryCreate):
* html/shadow/mac/ImageControlsRootElementMac.cpp:
(WebCore::ImageControlsRootElement::tryCreate):
* html/track/AudioTrack.cpp:
(WebCore::AudioTrack::alternativeKeyword):
(WebCore::AudioTrack::descriptionKeyword):
(WebCore::AudioTrack::mainKeyword):
(WebCore::AudioTrack::mainDescKeyword):
(WebCore::AudioTrack::translationKeyword):
(WebCore::AudioTrack::commentaryKeyword):
* html/track/TextTrack.cpp:
(WebCore::TextTrack::subtitlesKeyword):
(WebCore::captionsKeyword):
(WebCore::descriptionsKeyword):
(WebCore::chaptersKeyword):
(WebCore::metadataKeyword):
(WebCore::forcedKeyword):
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::cueShadowPseudoId):
(WebCore::TextTrackCue::cueBoxShadowPseudoId):
(WebCore::TextTrackCue::cueBackdropShadowPseudoId):
(WebCore::TextTrackCue::rebuildDisplayTree):
* html/track/VTTRegion.cpp:
(WebCore::upKeyword):
(WebCore::VTTRegion::textTrackCueContainerScrollingClass):
(WebCore::VTTRegion::textTrackCueContainerShadowPseudoId):
(WebCore::VTTRegion::textTrackRegionShadowPseudoId):
* html/track/VideoTrack.cpp:
(WebCore::VideoTrack::alternativeKeyword):
(WebCore::VideoTrack::captionsKeyword):
(WebCore::VideoTrack::mainKeyword):
(WebCore::VideoTrack::signKeyword):
(WebCore::VideoTrack::subtitlesKeyword):
(WebCore::VideoTrack::commentaryKeyword):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::initiatorName const):
* page/EventHandler.cpp:
(WebCore::focusDirectionForKey):
* page/Quirks.cpp:
(WebCore::Quirks::shouldBypassBackForwardCache const):
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::updateKeyframeAnimations):
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::eventNameAll):
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(WebCore::VideoFullscreenModelVideoElement::eventNameAll):
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::alternateFamilyName):
* platform/graphics/MediaPlayer.cpp:
(WebCore::applicationOctetStream):
(WebCore::textPlain):
* platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
(WebCore::CDMPrivateFairPlayStreaming::sinfName):
(WebCore::CDMPrivateFairPlayStreaming::skdName):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::metadataType):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::similarFont):
(WebCore::FontCache::platformAlternateFamilyName):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::SystemFontDatabaseCoreText::systemFontParameters):
* platform/graphics/filters/SourceAlpha.cpp:
(WebCore::SourceAlpha::effectName):
* platform/graphics/filters/SourceGraphic.cpp:
(WebCore::SourceGraphic::effectName):
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::FontCache::getCustomFallbackFont):
* platform/graphics/texmap/TextureMapperShaderProgram.h:
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::lastResortFallbackFont):
(WebCore::FontCache::platformAlternateFamilyName):
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::extractHTTPStatusText):
* rendering/ComplexLineLayout.cpp:
(WebCore::ComplexLineLayout::checkLinesForTextOverflow):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::hyphenString const):
(WebCore::RenderStyle::textEmphasisMarkString const):
* style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjustForSiteSpecificQuirks const):
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::rotateMode const):
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::setCalcMode):
(WebCore::SVGAnimationElement::setAttributeType):
(WebCore::SVGAnimationElement::isAdditive const):
(WebCore::SVGAnimationElement::isAccumulated const):
(WebCore::inheritsFromProperty):
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::type const):
(WebCore::SVGStyleElement::media const):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::parseClockValue):
(WebCore::SVGSMILElement::restart const):
(WebCore::SVGSMILElement::fill const):
(WebCore::SVGSMILElement::repeatCount const):
* svg/properties/SVGAnimationAdditiveValueFunctionImpl.cpp:
(WebCore::SVGAnimationColorFunction::colorFromString):
* svg/properties/SVGPropertyAnimator.h:
(WebCore::SVGPropertyAnimator::adjustForInheritance const):
2020-05-01 Chris Dumez <cdumez@apple.com>
REGRESSION (r260243): [ Mac WK1 ] fast/media/mq-inverted-colors-live-update-for-listener.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=211154
<rdar://problem/62555128>
Reviewed by Darin Adler.
Make MediaQueryList an ActiveDOMObject and make sure its JS wrapper stays alive as long as
it may fire change events and there is at least 1 change event listener.
No new tests, already covered by existing tests.
* css/MediaQueryList.cpp:
(WebCore::MediaQueryList::MediaQueryList):
(WebCore::MediaQueryList::create):
(WebCore::MediaQueryList::~MediaQueryList):
(WebCore::MediaQueryList::detachFromMatcher):
(WebCore::MediaQueryList::evaluate):
(WebCore::MediaQueryList::setMatches):
(WebCore::MediaQueryList::matches):
(WebCore::MediaQueryList::eventListenersDidChange):
(WebCore::MediaQueryList::activeDOMObjectName const):
(WebCore::MediaQueryList::virtualHasPendingActivity const):
* css/MediaQueryList.h:
* css/MediaQueryList.idl:
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::documentDestroyed):
2020-05-01 Don Olmstead <don.olmstead@sony.com>
Use export macros on all platforms
https://bugs.webkit.org/show_bug.cgi?id=211293
Reviewed by Michael Catanzaro.
* platform/PlatformExportMacros.h:
2020-05-01 Eric Carlson <eric.carlson@apple.com>
[MSE] Audio session category is sometimes not set correctly after changing video source
https://bugs.webkit.org/show_bug.cgi?id=211252
<rdar://problem/61894737>
Reviewed by Jer Noble.
Test: media/media-source/media-source-change-source.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerActiveSourceBuffersChanged): Call checkForAudioAndVideo.
(WebCore::HTMLMediaElement::audioTrackEnabledChanged): Ditto.
(WebCore::HTMLMediaElement::videoTrackSelectedChanged): Ditto.
(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Ditto.
(WebCore::HTMLMediaElement::updatePlayState): Ditto.
(WebCore::HTMLMediaElement::checkForAudioAndVideo): New, update m_hasEverHadAudio and m_hasEverHadVideo
and call m_mediaSession->canProduceAudioChanged.
(WebCore::HTMLMediaElement::mediaType const): Put `hasVideo()` in a local variable since it
is used more than once.
* html/HTMLMediaElement.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::updateSessionState): Iterate over the list of media
sessions once, not five times.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer): Call m_player->characteristicChanged()
rather than m_player->renderingModeChanged().
2020-05-01 Peng Liu <peng.liu6@apple.com>
A PiP window doesn’t actually dismiss after the browser navigates to a different page within the same domain
https://bugs.webkit.org/show_bug.cgi?id=211257
Reviewed by Jer Noble.
When we suspend a video element (this will happen when the browser is navigating to another page
within the same domain), we need to request the corresponding video to exit fullscreen/PiP.
The operation should be done immediately because the video element won't response to events
after it is suspended.
In r259095, we hold the start of exiting video fullscreen/PiP in HTMLMediaElement::exitFullscreen()
until the "webkitendfullscreen" event is dispatched/handled. This behavior does not work if
the video element is going to be suspended because the exiting fullscreen operation will be held
until the video element is resumed. Therefore, we need to handle that case separately by exiting
video fullscreen/PiP immediately.
API test: PictureInPicture.ExitPiPOnSuspendVideoElement
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::exitFullscreen):
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::exitFullscreen):
2020-05-01 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Introduce struct RowHeight in TableFormattingContext::computeAndDistributeExtraVerticalSpace
https://bugs.webkit.org/show_bug.cgi?id=211275
Reviewed by Antti Koivisto.
This is in preparation for available space distribution across row spans.
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):
2020-05-01 Antti Koivisto <antti@apple.com>
Specific dom node order of Shadow DOM (re)projection causes crash
https://bugs.webkit.org/show_bug.cgi?id=211159
<rdar://problem/62626920>
Reviewed by Zalan Bujtas.
ComposedTreeIterator may traverse to nodes outside its root element if it is constructed
with a starting node that has no next sibling inside a slot.
This leads to miscomputing RenderTreePosition::nextSibling() and eventual nullptr crash in
RenderTreeBuilder when adding a renderer (due to beforeChild renderer being outside the parent renderer).
Test case by Elliott Marquez.
Test: fast/shadow-dom/composed-tree-iterator-escape.html
* dom/ComposedTreeIterator.cpp:
(WebCore::ComposedTreeIterator::Context::Context):
When findind the end iterator for a tree context we need to look for a sibling in ancestors if
the current node has no siblings.
2020-05-01 Alexey Shvayka <shvaikalesh@gmail.com>
[WebIDL] Interface prototype objects should define @@toStringTag
https://bugs.webkit.org/show_bug.cgi?id=211020
Reviewed by Darin Adler.
WebIDL spec was recently updated [1] to define @@toStringTag on interface prototype objects.
This change aligns WebIDL with ECMA-262 built-ins and Blink's behavior. Gecko have also
expressed implementation commitment.
This patch implements the spec change, making `X.prototype.toString()` return "[object X]"
instead of "[object XPrototype]", where X is WebIDL interface. This behavior is proven to
be web compatible (shipping in Chrome since Q2 2016) and matches class strings of iterator
prototype objects [2] introduced in r253855.
[1]: https://github.com/heycam/webidl/pull/357
[2]: https://heycam.github.io/webidl/#es-iterator-prototype-object
Tests: fast/dom/prototype-chain.html
fast/dom/wrapper-classes.html
fast/workers/DedicatedWorkerGlobalScope-prototype-chain.html
imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/class-string-interface.any.js
imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/class-string-named-properties-object.window.js
* bindings/js/JSDOMIterator.h:
(WebCore::IteratorTraits>::finishCreation):
* bindings/js/JSDOMWindowProperties.cpp:
(WebCore::JSDOMWindowProperties::finishCreation):
* bindings/js/JSDOMWindowProperties.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GeneratePrototypeDeclaration):
(GenerateConstructorHelperMethods):
* bindings/scripts/test/*: Updated.
2020-05-01 Saam Barati <sbarati@apple.com>
We can't cast toLength result to unsigned
https://bugs.webkit.org/show_bug.cgi?id=211205
<rdar://problem/62625562>
Reviewed by Yusuke Suzuki.
* bridge/NP_jsobject.cpp:
2020-05-01 Antoine Quint <graouts@apple.com>
REGRESSION: MotionMark 1.1 regressed due to r260016
https://bugs.webkit.org/show_bug.cgi?id=211280
<rdar://problem/61898830>
Unreviewed.
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::drawImage):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawImage):
2020-05-01 Philippe Normand <pnormand@igalia.com>
[GStreamer] Move video frame holder to its own file
https://bugs.webkit.org/show_bug.cgi?id=211239
Reviewed by Alex Christensen.
This class implementation is big enough for a new compilation unit, IMHO.
* platform/GStreamer.cmake:
* platform/graphics/gstreamer/GStreamerVideoFrameHolder.cpp: Added.
(WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
(WebCore::GstVideoFrameHolder::~GstVideoFrameHolder):
(WebCore::GstVideoFrameHolder::handoffVideoDmaBuf):
(WebCore::GstVideoFrameHolder::waitForCPUSync):
(WebCore::GstVideoFrameHolder::updateTexture):
(WebCore::GstVideoFrameHolder::platformLayerBuffer):
* platform/graphics/gstreamer/GStreamerVideoFrameHolder.h: Added.
(WebCore::GstVideoFrameHolder::size const):
(WebCore::GstVideoFrameHolder::hasAlphaChannel const):
(WebCore::GstVideoFrameHolder::flags const):
(WebCore::GstVideoFrameHolder::textureID const):
(WebCore::GstVideoFrameHolder::hasMappedTextures const):
(WebCore::GstVideoFrameHolder::videoFrame const):
(WebCore::GstVideoFrameHolder::hasDMABuf const):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::GstVideoFrameHolder::GstVideoFrameHolder): Deleted.
(WebCore::GstVideoFrameHolder::~GstVideoFrameHolder): Deleted.
(WebCore::GstVideoFrameHolder::handoffVideoDmaBuf): Deleted.
(WebCore::GstVideoFrameHolder::waitForCPUSync): Deleted.
(WebCore::GstVideoFrameHolder::size const): Deleted.
(WebCore::GstVideoFrameHolder::hasAlphaChannel const): Deleted.
(WebCore::GstVideoFrameHolder::flags const): Deleted.
(WebCore::GstVideoFrameHolder::textureID const): Deleted.
(WebCore::GstVideoFrameHolder::hasMappedTextures const): Deleted.
(WebCore::GstVideoFrameHolder::videoFrame const): Deleted.
(WebCore::GstVideoFrameHolder::updateTexture): Deleted.
(WebCore::GstVideoFrameHolder::platformLayerBuffer): Deleted.
(WebCore::GstVideoFrameHolder::hasDMABuf const): Deleted.
2020-05-01 Adrian Perez de Castro <aperez@igalia.com>
[GTK4] Disable arrow on context menu popover
https://bugs.webkit.org/show_bug.cgi?id=211241
Reviewed by Carlos Garcia Campos.
No new tests needed.
* platform/gtk/GtkVersioning.h:
(gdk_display_get_monitor_at_window): Add no-op stub for GTK3.
2020-04-30 Rob Buis <rbuis@igalia.com>
Inline reportBlockedPortFailed and reportAuthenticationChallengeBlocked
https://bugs.webkit.org/show_bug.cgi?id=211250
Reviewed by Alex Christensen.
These two static methods have only one caller each, so we can just
inline them at the call site since there is nothing tying them to FrameLoader.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::reportBlockedPortFailed): Deleted.
(WebCore::FrameLoader::reportAuthenticationChallengeBlocked): Deleted.
* loader/FrameLoader.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didBlockAuthenticationChallenge):
2020-04-30 Ross Kirsling <ross.kirsling@sony.com>
TriState should be an enum class and use "Indeterminate" instead of "Mixed"
https://bugs.webkit.org/show_bug.cgi?id=211268
Reviewed by Mark Lam.
* dom/Document.cpp:
(WebCore::Document::queryCommandIndeterm):
(WebCore::Document::queryCommandState):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::triStateOfStyle const):
(WebCore::EditingStyle::hasStyle):
* editing/Editor.cpp:
(WebCore::Editor::selectionUnorderedListState const):
(WebCore::Editor::selectionOrderedListState const):
* editing/EditorCommand.cpp:
(WebCore::isStylePresent):
(WebCore::stateStyle):
(WebCore::stateTextWritingDirection):
(WebCore::stateNone):
(WebCore::stateStyleWithCSS):
(WebCore::Editor::Command::state const):
(WebCore::Editor::Command::value const):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::checkOrEnableIfNeeded const):
2020-04-30 Simon Fraser <simon.fraser@apple.com>
Clean up some EventHandler coordinate-related naming and fix ScrollableArea::lastKnownMousePosition() conversions
https://bugs.webkit.org/show_bug.cgi?id=211259
Reviewed by Zalan Bujtas.
On EventHandler, rename m_lastKnownMousePosition, m_mouseDownPos and m_mouseDown for clarity.
Rename ScrollableArea::lastKnownMousePosition() to be lastKnownMousePositionInView().
Previously, lastKnownMousePosition() would fetch it from EventHandler, which simply stashed
event.position() (which is in a coordinate system that differs between WK1 and Wk2) which
was not relative to the EventHandler's frame. This cause mouseLocationInScrollerForScrollerImp:
to give wrong answers.
Instead, lastKnownMousePositionInView() now specifically returns coordinates relative to the Frame.
This behavior change will be tested in future overlay scrollbar tests.
Document::showPlaybackTargetPicker() was using FrameView::lastKnownMousePosition(), so to avoid
changing its (probably broken) behavior, have it call frame()->eventHandler().lastKnownMousePosition().
* dom/Document.cpp:
(WebCore::Document::showPlaybackTargetPicker):
* page/EventHandler.cpp:
(WebCore::EventHandler::clear):
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::handleMouseDraggedEvent):
(WebCore::EventHandler::updateDragSourceActionsAllowed const):
(WebCore::EventHandler::dispatchDragStartEventOnSourceElement):
(WebCore::EventHandler::handleDrag):
(WebCore::EventHandler::mouseMovementExceedsThreshold const):
* page/EventHandler.h:
* page/FrameView.cpp:
(WebCore::FrameView::lastKnownMousePositionInView const):
(WebCore::FrameView::lastKnownMousePosition const): Deleted.
* page/FrameView.h:
* platform/PlatformMouseEvent.h:
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::lastKnownMousePositionInView const):
(WebCore::ScrollableArea::lastKnownMousePosition const): Deleted.
* platform/mac/ScrollAnimatorMac.mm:
(-[WebScrollerImpPairDelegate mouseLocationInContentAreaForScrollerImpPair:]):
(-[WebScrollerImpPairDelegate scrollerImpPair:convertContentPoint:toScrollerImp:]):
(-[WebScrollerImpDelegate mouseLocationInScrollerForScrollerImp:]):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::lastKnownMousePositionInView const):
(WebCore::RenderLayer::lastKnownMousePosition const): Deleted.
* rendering/RenderLayer.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::lastKnownMousePositionInView const):
(WebCore::RenderListBox::lastKnownMousePosition const): Deleted.
* rendering/RenderListBox.h:
2020-04-30 Yusuke Suzuki <ysuzuki@apple.com>
Some HTML element critical paths include AtomString materialization
https://bugs.webkit.org/show_bug.cgi?id=211223
Reviewed by Saam Barati.
While measuring Speedometer2, I've noticed that every time we create some type of input element, we call AtomString multiple times while it is not necessary.
It turned out that this is because some places are using `AtomString("...", AtomString::ConstructFromLiteral)` instead of
`static NeverDestroyed<const AtomString> ...("...", AtomString::ConstructFromLiteral)`. Since HTML is in the main thread, we can just use `static NeverDestroyed<>`.
This patch fixes `AtomString()` calls by changing them to `NeverDestroyed<const AtomString>` if it is under WebCore/html directory.
And in this patch, we omit FTPDirectoryDocument, MediaDocument, and PluginDocument's fixes for now since their AtomString content has a bit different nature (some
pseudo CSS value ("-webkit-xxx") v.s. some particular CSS property value ("100%").
* html/ColorInputType.cpp:
(WebCore::ColorInputType::createShadowSubtree):
* html/FileInputType.cpp:
(WebCore::UploadButtonElement::UploadButtonElement):
* html/HTMLElement.cpp:
(WebCore::trueName):
(WebCore::falseName):
(WebCore::plaintextOnlyName):
(WebCore::HTMLElement::setContentEditable):
(WebCore::HTMLElement::setDraggable):
(WebCore::HTMLElement::setSpellcheck):
(WebCore::HTMLElement::setAutocorrect):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::updateInnerTextElementEditability):
* html/RangeInputType.cpp:
(WebCore::RangeInputType::createShadowSubtree):
* html/SearchInputType.cpp:
(WebCore::updateResultButtonPseudoType):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::createShadowSubtree):
(WebCore::TextFieldInputType::createDataListDropdownIndicator):
(WebCore::TextFieldInputType::createContainer):
(WebCore::TextFieldInputType::createAutoFillButton):
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::buildBubbleTree):
* html/shadow/DetailsMarkerControl.cpp:
(WebCore::DetailsMarkerControl::DetailsMarkerControl):
* html/shadow/MediaControlTextTrackContainerElement.cpp:
(WebCore::MediaControlTextTrackContainerElement::MediaControlTextTrackContainerElement):
* html/shadow/ProgressShadowElement.cpp:
(WebCore::ProgressInnerElement::create):
(WebCore::ProgressBarElement::create):
(WebCore::ProgressValueElement::create):
* html/shadow/ProgressShadowElement.h:
(WebCore::ProgressInnerElement::create): Deleted.
(WebCore::ProgressBarElement::create): Deleted.
(WebCore::ProgressValueElement::create): Deleted.
* html/shadow/SpinButtonElement.cpp:
(WebCore::SpinButtonElement::SpinButtonElement):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement):
(WebCore::SearchFieldCancelButtonElement::SearchFieldCancelButtonElement):
* html/shadow/YouTubeEmbedShadowElement.cpp:
(WebCore::YouTubeEmbedShadowElement::YouTubeEmbedShadowElement):
* html/shadow/mac/ImageControlsButtonElementMac.cpp:
(WebCore::ImageControlsButtonElementMac::tryCreate):
* html/shadow/mac/ImageControlsRootElementMac.cpp:
(WebCore::ImageControlsRootElement::tryCreate):
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::rebuildDisplayTree):
2020-04-30 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthn] Optimize LocalAuthenticator
https://bugs.webkit.org/show_bug.cgi?id=183534
<rdar://problem/43357408>
Reviewed by Brent Fulgham.
Covered by new API tests.
* en.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::getAssertionTouchIDPromptTitle):
(WebCore::genericTouchIDPromptTitle):
* platform/LocalizedStrings.h:
Improving the LocalAuthentication dialog titles for iOS.
2020-04-30 Kate Cheney <katherine_cheney@apple.com>
clearApplicationBundleIdentifierTestingOverride() should set the bundle identifier to a null string, not an empty string
https://bugs.webkit.org/show_bug.cgi?id=211255
<rdar://problem/62651110>
Reviewed by John Wilander.
No new tests, behavior confirmed by existing tests.
Clearing the bundle identifier during tests should reset the override
value to be a null string so that the following calls to applicationBundleIdentifier()
use the [NSBundle mainBundle] bundleIdentifier] call.
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::clearApplicationBundleIdentifierTestingOverride):
2020-04-30 Devin Rousso <drousso@apple.com>
WebKit.WebContent process crashes when web developer tools are opened in Safari
https://bugs.webkit.org/show_bug.cgi?id=210794
<rdar://problem/62214651>
Reviewed by Brian Burg.
Test: inspector/worker/dom-debugger-event-after-terminate-crash.html
* inspector/agents/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
Don't `ASSERT(injectedScript.hasNoValue())` as it's possible for the event to be fired after
`Worker.prototype.terminate`, in which case `InjectedScriptManager::injectedScriptFor` will
now return an `InjectedScript` that would fail that `ASSERT`.
2020-04-30 Alex Christensen <achristensen@webkit.org>
Add SPI to change a WKWebView's CORS disabling pattern after initialization
https://bugs.webkit.org/show_bug.cgi?id=211211
<rdar://problem/61837474>
Reviewed by Chris Dumez.
* page/Page.h:
(WebCore::Page::setCORSDisablingPatterns):
2020-04-30 Chris Dumez <cdumez@apple.com>
WebCore::systemHasBattery() is unnecessarily expensive on iOS
https://bugs.webkit.org/show_bug.cgi?id=211240
<rdar://problem/62619971>
Reviewed by Geoffrey Garen.
Update WebCore::systemHasBattery() to return true unconditionally on
PLATFORM(IOS) and PLATFORM(WATCHOS) since iOS devices always have a
battery. Also return false unconditionally for PLATFORM(APPLETV).
* platform/cocoa/SystemBattery.mm:
(WebCore::systemHasBattery):
2020-04-30 Andres Gonzalez <andresg_22@apple.com>
Fix for crash in AXLogger.
https://bugs.webkit.org/show_bug.cgi?id=211236
Reviewed by Chris Fleizach.
Covered by existing tests.
Notifications may have a null AXCoreObject target, so must check for
nullity before streaming the object.
* accessibility/AXLogger.cpp:
(WebCore::AXLogger::log):
2020-04-30 Charlie Turner <cturner@igalia.com>
[clang 11] fix build errors due to -WWc++11-narrowing
https://bugs.webkit.org/show_bug.cgi?id=211193
Reviewed by Adrian Perez de Castro.
Fixes the following errors,
Source/WebCore/html/MediaElementSession.cpp:1059:9: error: type 'WebCore::RenderMedia *' cannot be narrowed to 'bool' in initializer list [-Wc++11-narrowing]
m_element.renderer(),
^~~~~~~~~~~~~~~~~~~~
Source/WebCore/style/StyleResolver.cpp:106:55: error: type 'const char [4]' cannot be narrowed to 'bool' in initializer list [-Wc++11-narrowing]
m_mediaQueryEvaluator = MediaQueryEvaluator { "all" };
^~~~~
Source/WebCore/style/StyleResolver.cpp:106:55: note: insert an explicit cast to silence this issue
m_mediaQueryEvaluator = MediaQueryEvaluator { "all" };
^~~~~
static_cast<bool>( )
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::hasRenderer const):
MediaElementSession was implicitly casting a pointer to a bool,
which is not allowed with modern Clang checks. Add a helper method
to encapsulate the now required static_cast<bool>.
* html/MediaElementSession.cpp: Use the new helper method to see
if the HTMLMediaElement has an associated renderer.
(WebCore::MediaElementSession::updateMediaUsageIfChanged):
* style/StyleResolver.cpp: This was calling MediaQueryEvaluator {
"all" }; and seemingly expecting to cast a const char[] to a bool,
or maybe String? It's confusing because of the MediaQueryEvaluator
API. If it was implicitly converting to bool then that could be
unintentional. Such casts are not allowed either now. The
MediaQueryEvaluator's default constructor says it returns true for
"all", which appears to be the original intent of this call, so I
replaced it with that.
(WebCore::Style::Resolver::Resolver):
2020-04-30 Simon Fraser <simon.fraser@apple.com>
border-radius fails to clip iframe contents
https://bugs.webkit.org/show_bug.cgi?id=211199
<rdar://problem/61945671>
Reviewed by Zalan Bujtas.
iframes need to use the same composited clipping strategy that we use for other
replaced elements with composited contents, like video and WebGL. To achieve this,
change GraphicsLayer to allow child GraphicsLayers to be parented in the contents
clipping layer, just like content layers are. (We don't want to do this unconditionally,
because it will change behavior for video with controls.)
Add GraphicsLayer::contentsRectClipsDescendants(), and used it to run code that
creates the contents clipping (and optional shape) layers even when no contents
layer is present. Fix up the sublayer list building to parent layers from
children in the contents clipping layer.
Tests: compositing/iframes/border-radius-composited-frame.html
compositing/iframes/border-uneven-radius-composited-frame.html
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::GraphicsLayer):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::contentsRectClipsDescendants const):
(WebCore::GraphicsLayer::setContentsRectClipsDescendants):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setContentsRectClipsDescendants):
(WebCore::GraphicsLayerCA::updateSublayerList):
(WebCore::GraphicsLayerCA::updateContentsRects):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::isCompositedSubframeRenderer):
* rendering/RenderLayerCompositor.h:
2020-04-30 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Adjust the available vertical space with the row span for cell layout
https://bugs.webkit.org/show_bug.cgi?id=211218
Reviewed by Antti Koivisto.
The vertical available space for a cell should include all row heights it spans.
(can't include test, current table layout logic is incompatible with LFC -and FF/Chrome.)
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):
2020-04-30 Philippe Normand <pnormand@igalia.com>
[SOUP] http/tests/media/video-accept-encoding.html fails
https://bugs.webkit.org/show_bug.cgi?id=211228
Reviewed by Carlos Garcia Campos.
The resource requests received by the network process always had
the accept-encoding setting enabled due to lack of IPC
(de)serialization for this boolean.
The patch also enables soup release logging, set WEBKIT_DEBUG=Network=debug.
* platform/network/soup/ResourceRequest.h:
(WebCore::ResourceRequest::encodeWithPlatformData const):
(WebCore::ResourceRequest::decodeWithPlatformData):
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::soupLogPrinter):
(WebCore::SoupNetworkSession::setupLogger):
2020-04-30 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK4][X11] Add support for rendering web view contents
https://bugs.webkit.org/show_bug.cgi?id=211189
Reviewed by Adrian Perez de Castro.
Add PlatformDisplayX11::visual() to get the X visual used for rendering.
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::visual const):
* platform/graphics/x11/PlatformDisplayX11.h:
2020-04-30 Andres Gonzalez <andresg_22@apple.com>
Add logging of AXIsolatedTree and AXNotifications.
https://bugs.webkit.org/show_bug.cgi?id=211214
Reviewed by Chris Fleizach.
- Added operator<< implementations for AXIsolatedTree and AX notifications.
- Added corresponding AXLogger::log overloads for the above types.
- To set the root node and the focused node we are now always using
setRootNodeID and setFocusedNodeID respectively. Therefore, before
returning the root or the focused nodes, it is necessary to applyPendingChanges.
* accessibility/AXLogger.cpp:
(WebCore::AXLogger::add): Used for recursive logging of the hierarchy.
(WebCore::AXLogger::log):
(WebCore::operator<<):
* accessibility/AXLogger.h:
* accessibility/AXObjectCache.cpp:
Added logging of the isolated tree when it's generated and before and after updates.
(WebCore::AXObjectCache::isolatedTreeFocusedObject):
(WebCore::AXObjectCache::generateIsolatedTree):
(WebCore::AXObjectCache::updateIsolatedTree):
* accessibility/AXObjectCache.h:
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::focusedUIElement const):
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::createTreeForPageID):
(WebCore::AXIsolatedTree::removeTreeForPageID):
(WebCore::AXIsolatedTree::nodeForID const):
(WebCore::AXIsolatedTree::generateSubtree):
(WebCore::AXIsolatedTree::focusedNode):
(WebCore::AXIsolatedTree::rootNode):
(WebCore::AXIsolatedTree::setRootNodeID):
(WebCore::AXIsolatedTree::setFocusedNodeID):
(WebCore::AXIsolatedTree::applyPendingChanges):
(WebCore::AXIsolatedTree::focusedUIElement): Renamed focusedNode for naming consistency.
(WebCore::AXIsolatedTree::setRootNode): Deleted. Using setRootNodeID instead,
(WebCore::AXIsolatedTree::setFocusedNode): Deleted. Use setFocusedNodeID instead.
* accessibility/isolatedtree/AXIsolatedTree.h:
(WebCore::AXIsolatedTree::treeID const):
(WebCore::AXIsolatedTree::treeIdentifier const): renamed treeID for naming consistency.
2020-04-30 Philippe Normand <pnormand@igalia.com>
Unreviewed, GStreamer build warning fix after r260755.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcMakeRequest): There is no need to capture src in the
closure, its protector is used instead.
2020-04-30 Philippe Normand <pnormand@igalia.com>
[GStreamer] fast/mediastream/get-user-media-device-id.html failing
https://bugs.webkit.org/show_bug.cgi?id=190576
Reviewed by Xabier Rodriguez-Calvar.
The test was failing due to deviceId invalid constraint, which led
me to rewrite the GStreamer Mock sources, removing various hacks
and appsrc usage, which is not needed because we rely on
audioSamplesAvailable and videoSamplesAvailable notifications.
This patch also fixes the audio mock, which was generating silence
until now.
* platform/GStreamer.cmake:
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(WebCore::WebKitMediaStreamTrackObserver::WebKitMediaStreamTrackObserver):
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp: Removed.
* platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp: Removed.
* platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h: Removed.
* platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.cpp: Added.
(WebCore::MockRealtimeAudioSource::create):
(WebCore::MockRealtimeAudioSourceGStreamer::createForMockAudioCapturer):
(WebCore::MockRealtimeAudioSourceGStreamer::MockRealtimeAudioSourceGStreamer):
(WebCore::MockRealtimeAudioSourceGStreamer::render):
(WebCore::MockRealtimeAudioSourceGStreamer::addHum):
(WebCore::MockRealtimeAudioSourceGStreamer::reconfigure):
* platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.h: Copied from Source/WebCore/platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h.
* platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.cpp: Added.
(WebCore::MockRealtimeVideoSource::create):
(WebCore::MockRealtimeVideoSourceGStreamer::createForMockDisplayCapturer):
(WebCore::MockRealtimeVideoSourceGStreamer::MockRealtimeVideoSourceGStreamer):
(WebCore::MockRealtimeVideoSourceGStreamer::updateSampleBuffer):
* platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.h: Renamed from Source/WebCore/platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h.
* platform/mock/MockRealtimeVideoSource.h:
2020-04-29 Simon Fraser <simon.fraser@apple.com>
Use initializers in PlatformMouseEvent and WebEvent
https://bugs.webkit.org/show_bug.cgi?id=211217
Reviewed by Tim Horton.
Use initializers im PlatformMouseEvent.
* platform/PlatformMouseEvent.h:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
2020-04-29 Jer Noble <jer.noble@apple.com>
Remove the debug ASSERT in ImageDecoderAVFObjC::storeSampleBuffer()
https://bugs.webkit.org/show_bug.cgi?id=211191
<rdar://problem/62542285>
Reviewed by Said Abou-Hallawa.
r259594 added an iterator check and a RELEASE_LOG_ERROR for that check, making this ASSERT superfluous.
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
2020-04-29 Simon Fraser <simon.fraser@apple.com>
Simplify contents clipping layer geometry
https://bugs.webkit.org/show_bug.cgi?id=211162
Reviewed by Zalan Bujtas.
GraphicsLayerCA uses a contents clipping layer, with an optional shape layer, to support
clipping replaced elements with composited contents, like video and WebGL canvas.
A future patch will use this code path for composited subframes. To achieve this,
we need to host the layers of child GraphicsLayers under m_contentsClippingLayer, but
without the GraphicsLayer client having to do geometry math. We can do this by setting
the bounds origin of m_contentsClippingLayer to adjust for its position relative
to the GraphicsLayer origin.
This patch does that, adjusting the position of the contents layer accordingly.
The shape mask layer also needs adjusting; its position has to be at the layer's
bounds origin, and the shape itself needs to have a zero origin.
Tested by existing tests.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateSublayerList):
(WebCore::GraphicsLayerCA::updateClippingStrategy):
(WebCore::GraphicsLayerCA::updateContentsRects):
2020-04-29 Kenneth Russell <kbr@chromium.org>
REGRESSION (r256784?): Shadertoy demo no longer works in Safari
https://bugs.webkit.org/show_bug.cgi?id=210994
Reviewed by Dean Jackson.
Certain Shadertoy examples stopped working with the ANGLE backend
for WebGL because rendering to floating-point render targets was
no longer being enabled implicitly along with the
OES_texture_float extension.
Add support for the WebGL 1.0 extensions
EXT_color_buffer_half_float and WEBGL_color_buffer_float, and the
WebGL 2.0 extension EXT_color_buffer_float. Enable these
implicitly for WebGL 1.0 in the OES_texture_float and
OES_texture_half_float extensions, restoring the previous
functionality.
Translate 32-bit floating point texture formats appropriately for
the ANGLE backend. Fix some failures in previously-skipped
conformance tests. The new code passes the more stringent
top-of-tree WebGL 1.0.4 and 2.0.1 conformance tests related to
floating-point texture renderability, which are not yet in the
WebKit repository.
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMConvertWebGL.cpp:
(WebCore::convertToJSValue):
* html/canvas/EXTColorBufferFloat.cpp: Copied from Source/WebCore/html/canvas/OESTextureHalfFloat.cpp.
(WebCore::EXTColorBufferFloat::EXTColorBufferFloat):
(WebCore::EXTColorBufferFloat::getName const):
(WebCore::EXTColorBufferFloat::supported):
* html/canvas/EXTColorBufferFloat.h: Copied from Source/WebCore/html/canvas/OESTextureFloat.h.
* html/canvas/EXTColorBufferFloat.idl: Added.
* html/canvas/EXTColorBufferHalfFloat.cpp: Copied from Source/WebCore/html/canvas/OESTextureFloat.cpp.
(WebCore::EXTColorBufferHalfFloat::EXTColorBufferHalfFloat):
(WebCore::EXTColorBufferHalfFloat::getName const):
(WebCore::EXTColorBufferHalfFloat::supported):
* html/canvas/EXTColorBufferHalfFloat.h: Copied from Source/WebCore/html/canvas/OESTextureFloat.h.
* html/canvas/EXTColorBufferHalfFloat.idl: Added.
* html/canvas/OESTextureFloat.cpp:
(WebCore::OESTextureFloat::OESTextureFloat):
(WebCore::OESTextureFloat::supported):
* html/canvas/OESTextureFloat.h:
* html/canvas/OESTextureHalfFloat.cpp:
(WebCore::OESTextureHalfFloat::OESTextureHalfFloat):
(WebCore::OESTextureHalfFloat::supported):
* html/canvas/OESTextureHalfFloat.h:
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getExtension):
(WebCore::WebGL2RenderingContext::getSupportedExtensions):
(WebCore::WebGL2RenderingContext::getParameter):
* html/canvas/WebGLColorBufferFloat.cpp: Copied from Source/WebCore/html/canvas/OESTextureFloat.cpp.
(WebCore::WebGLColorBufferFloat::WebGLColorBufferFloat):
(WebCore::WebGLColorBufferFloat::getName const):
(WebCore::WebGLColorBufferFloat::supported):
* html/canvas/WebGLColorBufferFloat.h: Copied from Source/WebCore/html/canvas/OESTextureFloat.h.
* html/canvas/WebGLColorBufferFloat.idl: Added.
* html/canvas/WebGLExtension.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getExtension):
(WebCore::WebGLRenderingContext::getSupportedExtensions):
(WebCore::WebGLRenderingContext::getParameter):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::extensionIsEnabled):
(WebCore::WebGLRenderingContextBase::copyTexImage2D):
* html/canvas/WebGLRenderingContextBase.h:
* platform/graphics/angle/ExtensionsGLANGLE.cpp:
(WebCore::ExtensionsGLANGLE::adjustWebGL1TextureInternalFormat):
(WebCore::ExtensionsGLANGLE::texImage2DRobustANGLE):
* platform/graphics/angle/ExtensionsGLANGLE.h:
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLOpenGL::texImage2DDirect):
2020-04-29 Zalan Bujtas <zalan@apple.com>
Header is blank on https://nader.org
https://bugs.webkit.org/show_bug.cgi?id=205747
<rdar://problem/58305910>
Reviewed by Simon Fraser.
Do not use stale containing block width value while computing preferred width.
Test: fast/text/text-indent-inside-float.html
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
2020-04-29 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Take row span into account when checking for missing cells
https://bugs.webkit.org/show_bug.cgi?id=211184
Reviewed by Antti Koivisto.
The tree builder looks for missing cells in the table grid and fills in the gaps with empty cells.
This patch takes row spanning into account and make sure we don't end up adding an extra, redundant cell.
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::buildTableStructure):
2020-04-29 Youenn Fablet <youenn@apple.com>
Update SWServer.cpp originURL after https://trac.webkit.org/changeset/260707
https://bugs.webkit.org/show_bug.cgi?id=211169
Reviewed by Alex Christensen.
* workers/service/server/SWServer.cpp:
(WebCore::originURL):
No need to dereference port since URL::setPort takes an Optional.
2020-04-29 Zalan Bujtas <zalan@apple.com>
[LFC] FormattingContext::constraintsForInFlow/OutOfFlowContent should take const ContainerBox&
https://bugs.webkit.org/show_bug.cgi?id=211161
Reviewed by Antti Koivisto.
Leaf boxes should not need to compute constraints (as by definition they don't have in/out-of-flow descendants).
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::constraintsForOutOfFlowContent):
(WebCore::Layout::FormattingContext::Geometry::constraintsForInFlowContent):
* layout/FormattingContextQuirks.cpp:
(WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
* layout/blockformatting/PrecomputedBlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedPositiveNegativeValues const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutCell):
2020-04-29 Joonghun Park <jh718.park@samsung.com>
Unreviewed. Remove no longer used variable and the build warning below.
warning: unused variable ‘view’ [-Wunused-variable]
No new tests, no new behaviour changes.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
2020-04-29 Alicia Boya García <aboya@igalia.com>
PlatformMediaResourceLoader should be destroyed on the main thread
https://bugs.webkit.org/show_bug.cgi?id=211155
Reviewed by Xabier Rodriguez-Calvar.
PlatformMediaResourceLoader is only safe to use from the main thread.
A tricky detail is this includes its destruction. The same is true for
PlatformMediaResource.
Both classes are ThreadSafeRefCounted<> classes and therefore
WTF::DestructionThread::Main can be used to ensure destruction is run
in the correct thread with no need for additional client code.
* platform/graphics/PlatformMediaResourceLoader.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(WebKitWebSrcPrivate::StreamingMembers::~StreamingMembers):
2020-04-29 Rob Buis <rbuis@igalia.com>
Make PolicyChecker an inner class of FrameLoader
https://bugs.webkit.org/show_bug.cgi?id=211138
Reviewed by Alex Christensen.
PolicyChecker HistoryController an inner class of FrameLoader, this allows us to move some methods
only used by PolicyChecker out of the FrameLoader public API. Because it is not possible to forward declare
an enum class in an inner class, move ShouldContinue out of the PolicyChecker class and rename it
to ShouldContinuePolicyCheck.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadPostRequest):
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
* loader/FrameLoader.h:
* loader/FrameLoaderTypes.h:
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::responseReceived):
* loader/PolicyChecker.cpp:
* loader/PolicyChecker.h:
* platform/graphics/PlatformMediaResourceLoader.h:
(WebCore::PlatformMediaResourceClient::responseReceived):
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::PlatformResourceMediaLoader::responseReceived):
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(CachedResourceStreamingClient::responseReceived):
* platform/network/cocoa/WebCoreNSURLSession.mm:
(WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
(-[WebCoreNSURLSessionDataTask resource:receivedResponse:completionHandler:]):
2020-04-29 Adrian Perez de Castro <aperez@igalia.com>
[GTK] Misplaced right click menu on web page due to deprecated gtk_menu_popup()
https://bugs.webkit.org/show_bug.cgi?id=170553
Reviewed by Carlos Garcia Campos.
* platform/gtk/GtkVersioning.h: Add replacements for GtkPopover functions which are no longet available in GTK4.
(gtk_popover_menu_new): Added.
(gtk_popover_bind_model): Added.
(gtk_popover_set_relative_to): Added.
2020-04-29 Philippe Normand <pnormand@igalia.com>
[GStreamer] Switch to audiointerleave
https://bugs.webkit.org/show_bug.cgi?id=211124
Reviewed by Xabier Rodriguez-Calvar.
The audiointerleave element is a drop-in replacement of
interleave. It should behave a bit better in live.
No new tests, existing webaudio tests cover this change.
* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webKitWebAudioSrcConstructed):
(webKitWebAudioSrcChangeState):
2020-04-23 Sergio Villar Senin <svillar@igalia.com>
[WebXR][WPE] Implement XRTest::simulateDeviceConnection()
https://bugs.webkit.org/show_bug.cgi?id=210912
Reviewed by Dean Jackson.
This API gives tests the ability to spin up a simulated XR device which
is an XR device which from the point of view of the WebXR API behaves
like a normal XR device. These simulated XR devices can be controlled by
the associated FakeXRDevice object.
No new tests as this is machinery required to execute tests when
implementing the WebXR API.
* Modules/webxr/WebXRSystem.cpp:
(WebCore::WebXRSystem::WebXRSystem): Initialize the default inline device.
(WebCore::WebXRSystem::registerSimulatedXRDeviceForTesting): Add a newly
created simulated XR device to the list of available devices. Update
also the active immersive device and current inline device.
(WebCore::WebXRSystem::unregisterSimulatedXRDeviceForTesting): Remove
all simulated devices from the list of immersive XR devices.
* Modules/webxr/WebXRSystem.h: New DummyInlineDevice which represents
the default inline device which must not provide pose information.
* Modules/webxr/WebXRView.cpp:
(WebCore::WebXRView::WebXRView): Removed some methods that should be
really part of a fake XRView instance.
(WebCore::WebXRView::setProjectionMatrix): Add implementation.
(WebCore::WebXRView::eye const): Deleted.
(WebCore::WebXRView::projectionMatrix const): Deleted.
(WebCore::WebXRView::transform const): Deleted.
* Modules/webxr/WebXRView.h:
(WebCore::WebXRView::eye const): Implemented.
(WebCore::WebXRView::projectionMatrix const): Ditto.
(WebCore::WebXRView::transform const): Ditto.
(WebCore::WebXRView::setEye): Ditto.
(WebCore::WebXRView::setTransform): Ditto.
* Modules/webxr/XRReferenceSpaceType.h: Moved the definitions to PlatformXR.
* platform/xr/PlatformXR.cpp:
(PlatformXR::Instance::nextDeviceId): New method which returns uniquely
defined ids for XR devices.
(PlatformXR::Device::Device):
* platform/xr/PlatformXR.h:
(PlatformXR::Device::id const): New method.
(PlatformXR::Device::supports const): Ditto.
(PlatformXR::Device::setSupportedModes): Ditto.
(PlatformXR::Device::setEnabledFeatures): Ditto.
(PlatformXR::Device::operator== const): Ditto.
* testing/FakeXRViewInit.h: fieldOfView is optional.
* testing/WebFakeXRDevice.cpp:
(WebCore::FakeXRView::setFieldOfView): Implemented.
(WebCore::WebFakeXRDevice::setViews): Ditto.
(WebCore::WebFakeXRDevice::setViewerOrigin): Ditto.
(WebCore::WebFakeXRDevice::clearViewerOrigin): Ditto.
(WebCore::WebFakeXRDevice::setFloorOrigin): Ditoo.
(WebCore::WebFakeXRDevice::clearFloorOrigin): Ditto.
(WebCore::WebFakeXRDevice::parseRigidTransform): Added.
(WebCore::WebFakeXRDevice::parseView): Ditto.
* testing/WebFakeXRDevice.h: Defined FakeXRView class which wraps a
XRView adding some associated data as the field of view and viewport.
Also defined the SimulatedXRDevice which is an PlatformXR::Device with
some additional data useful for testing purpouses.
* testing/WebXRTest.cpp:
(WebCore::WebXRTest::simulateDeviceConnection): Create a new
FakeXRDevice with an associated simulated XR device with the data
provided by a FakeXRDeviceInit.
(WebCore::WebXRTest::disconnectAllDevices): Remove all simulated devices
from the list of immersive devices.
* testing/WebXRTest.h: Call simulateDeviceConnection with ScriptExecutionContext.
* testing/WebXRTest.idl: Ditto.
2020-04-29 Saam Barati <sbarati@apple.com>
U_STRING_NOT_TERMINATED_WARNING ICU must be handled when using the output buffer as a C string
https://bugs.webkit.org/show_bug.cgi?id=211142
<rdar://problem/62530860>
Reviewed by Darin Adler.
* editing/TextIterator.cpp:
(WebCore::normalizeCharacters):
* platform/text/LocaleICU.cpp:
(WebCore::LocaleICU::decimalSymbol):
(WebCore::LocaleICU::decimalTextAttribute):
(WebCore::getDateFormatPattern):
(WebCore::LocaleICU::createLabelVector):
(WebCore::getFormatForSkeleton):
* platform/text/LocaleToScriptMappingICU.cpp:
(WebCore::localeToScriptCodeForFontSelection):
* platform/text/TextCodecICU.cpp:
(WebCore::TextCodecICU::decode):
(WebCore::TextCodecICU::encode):
2020-04-29 Noam Rosenthal <noam@webkit.org>
Add StringView::isAllSpecialCharacters()
https://bugs.webkit.org/show_bug.cgi?id=211150
Reviewed by Darin Adler.
Uses new StringView::isAllSpecialCharacters() instead of creating a StringImpl.
No new tests.
* rendering/TextPainter.cpp:
(WebCore::TextPainter::paintTextOrEmphasisMarks):
2020-04-28 Said Abou-Hallawa <sabouhallawa@apple.com>
Rendering update steps should use Seconds for the timestamps
https://bugs.webkit.org/show_bug.cgi?id=210990
Unreviewed.
serviceRequestAnimationFrameCallbacks() should return rounded milliseconds.
This rounding was removed in r260736. So put it back.
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
2020-04-28 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK4] Add support for key events
https://bugs.webkit.org/show_bug.cgi?id=211128
Reviewed by Adrian Perez de Castro.
* platform/gtk/GtkVersioning.h:
(gdk_event_get_keyval):
(gdk_event_get_keycode):
2020-04-28 Wenson Hsieh <wenson_hsieh@apple.com>
[Text manipulation] Add a userInfo dictionary to _WKTextManipulationToken
https://bugs.webkit.org/show_bug.cgi?id=211151
<rdar://problem/62329534>
Reviewed by Darin Adler.
Add an extensible mechanism for the text manipulation controller to send additional
metadata for each text manipulation token through to the WebKit client, for debugging
purposes.
Test: TextManipulation.StartTextManipulationExtractsUserInfo
* editing/TextManipulationController.cpp:
(WebCore::tokenInfo):
(WebCore::TextManipulationController::observeParagraphs):
* editing/TextManipulationController.h:
Add TextManipulationTokenInfo, and add an optional TextManipulationTokenInfo member to
TextManipulationToken. For now, just send over the document URL, element tag name, and
the value of the role attribute.
(WebCore::TextManipulationController::ManipulationTokenInfo::encode const):
(WebCore::TextManipulationController::ManipulationTokenInfo::decode):
(WebCore::TextManipulationController::ManipulationToken::encode const):
(WebCore::TextManipulationController::ManipulationToken::decode):
2020-04-28 Simon Fraser <simon.fraser@apple.com>
Update the xcfilelists.
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
2020-04-28 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r260808): Backdrops on music.apple.com are offset
https://bugs.webkit.org/show_bug.cgi?id=211153
<rdar://problem/62543158>
Reviewed by Zalan Bujtas.
The border-radius code path failed to offset the rounded rect by contentOffsetInCompositingLayer().
Test: compositing/filters/backdrop-filter-rect-border-radius.html
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
2020-04-28 Daniel Bates <dabates@apple.com>
Modernize EndPointsAdjustmentMode enumeration and fix misspelled enumerator
https://bugs.webkit.org/show_bug.cgi?id=211141
Reviewed by Eric Carlson.
Fix the misspelled enumerator DoNotAdjsutEndpoints. While I am here, make
EndPointsAdjustmentMode an enum class sized as a bool and simplify the naming
of its enumerators now that they have to be qualified. I also re-ordered them
so that DoNotAdjust is the first enumerator (it will have value 0). This doesn't
really matter, but I like it because it makes it so that this enumeration behaves
more like an equivalent boolean should casts be involved.
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelectionByMouseIfDifferent):
* editing/FrameSelection.h:
* page/EventHandler.cpp:
(WebCore::EventHandler::updateSelectionForMouseDrag):
2020-04-28 Daniel Bates <dabates@apple.com>
[WebKitLegacy] Implement -hidePlaceholder and -showPlaceholderIfNecessary in terms of setCanShowPlaceholder()
https://bugs.webkit.org/show_bug.cgi?id=211139
Reviewed by Simon Fraser.
Remove hidePlaceholder() and showPlaceholderIfNecessary() as they are no longer needed.
Callers should use setCanShowPlaceholder() instead.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::hidePlaceholder): Deleted.
(WebCore::HTMLTextFormControlElement::showPlaceholderIfNecessary): Deleted.
* html/HTMLTextFormControlElement.h:
2020-04-28 ChangSeok Oh <changseok@webkit.org>
[GTK] Fix build failures for ANGLE_WEBGL after r259589
https://bugs.webkit.org/show_bug.cgi?id=211116
Reviewed by Alex Christensen.
The compiler is unhappy with coverting GCGLint64 (long long int) to GLInt64 (long int).
Passing GCGLuint62 as GLuint64 is a similar issue.
No new tests since no new functionalities.
* platform/graphics/angle/ExtensionsGLANGLE.cpp:
(WebCore::ExtensionsGLANGLE::getInteger64vRobustANGLE):
(WebCore::ExtensionsGLANGLE::getInteger64i_vRobustANGLE):
(WebCore::ExtensionsGLANGLE::getBufferParameteri64vRobustANGLE):
(WebCore::ExtensionsGLANGLE::getQueryObjecti64vRobustANGLE):
(WebCore::ExtensionsGLANGLE::getQueryObjectui64vRobustANGLE):
* platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp:
(Nicosia::GC3DLayer::swapBuffersIfNeeded): Unaccelerated -> RenderingMode::Unaccelerated
2020-04-28 Noam Rosenthal <noam@webkit.org>
Implement FCP (first contentful paint)
https://bugs.webkit.org/show_bug.cgi?id=208499
Reviewed by Simon Fraser.
Added the necessary interface, extensions to the performance interface and observer, new runtime flag.
Detecting contentfulness after layout and before actual paint, by running a "dummy" paint, similar to
invalidateControlTints() / invalidateImagesWithAsyncDecodes(). Save the result to the GraphicsContext and then to the document.
This would run for every paint until we detect a contentful one.
Note that it paints the entire frame contents, as FCP is not viewport-dependent.
Also, paint timing is currently disabled for LFC (layout formatting context), and will be dealt with later.
Tests: http/tests/performance/paint-timing/performance-paint-timing-fcp-after-visually-non-empty-for-num-chars.html
http/tests/performance/paint-timing/performance-paint-timing-fcp-after-visually-non-empty-for-style.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-background-size.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-bg-image-set.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-bg-image-two-steps.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-canvas-context.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-gradient.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-3d-rotate-descendant.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-3d-rotate.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-scale-transition.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-scale.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-text.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-opacity-descendant.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-opacity.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds-translate.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-display.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-image.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-opacity.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-text.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-visibility.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-svg.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-text-input.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-typographic-pseudo.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-video-frame.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-video-poster.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-whitespace.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-with-rtl.html
performance-api/paint-timing/paint-timing-apis.html
performance-api/paint-timing/paint-timing-frames.html
performance-api/paint-timing/paint-timing-with-worker.html
performance-api/paint-timing/performance-observer-first-contentful-paint.html
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSPerformanceEntryCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/WebCoreBuiltinNames.h:
Add PerformancePaintTiming interface. https://w3c.github.io/paint-timing/#sec-PerformancePaintTiming
* dom/Document.cpp:
* dom/Document.h:
(WebCore::Document::supportsPaintTiming const):
We only report paint timing for document that can access the top level security origin, to avoid leakage of information to sandboxed iframes.
(WebCore::Document::enqueuePaintTimingEntryIfNeeded):
Enqueue a paint timing entry, according to https://w3c.github.io/paint-timing/#sec-reporting-paint-timing
* page/FrameView.cpp:
(WebCore::FrameView::paintContents):
Disable FCP fake-paint in LFC mode.
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
* page/Performance.cpp:
(WebCore::Performance::getEntries const):
(WebCore::Performance::getEntriesByType const):
(WebCore::Performance::getEntriesByName const):
(WebCore::Performance::reportFirstContentfulPaint):
* page/Performance.h:
Support first-contentful-paint reporting.
* page/PerformanceEntry.cpp:
(WebCore::PerformanceEntry::parseEntryTypeString):
* page/PerformanceEntry.h:
(WebCore::PerformanceEntry::isPaint const):
* page/PerformanceObserver.cpp:
(WebCore::PerformanceObserver::supportedEntryTypes):
* page/PerformanceObserver.h:
* page/PerformanceObserver.idl:
* page/PerformancePaintTiming.h: Added.
(isType):
* page/PerformancePaintTiming.idl: Added.
Add paint performance entry type.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setPaintTimingEnabled):
(WebCore::RuntimeEnabledFeatures::paintTimingEnabled const):
New runtime flag for paint timing.
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::detectingContentfulPaint const):
(WebCore::GraphicsContext::setContentfulPaintDetected):
(WebCore::GraphicsContext::contenfulPaintDetected const):
Add a flag in GraphicsContext where different render operations can report if they're contentful.
* rendering/ContentfulPaintChecker.cpp: Added.
(WebCore::ContentfulPaintChecker::qualifiesForContentfulPaint):
* rendering/ContentfulPaintChecker.h: Added.
Run a "dummy" paint of the FrameView, to detect contentful elements.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderHTMLCanvas.cpp:
(WebCore::RenderHTMLCanvas::paintReplaced):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintReplaced):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::paintReplaced):
* rendering/TextPainter.cpp:
(WebCore::TextPainter::paintTextOrEmphasisMarks):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::paintReplaced):
Report contentfulness when we reach anything that qualifies as contentful,
based on https://w3c.github.io/paint-timing/#contentful.
2020-04-28 Simon Fraser <simon.fraser@apple.com>
MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin log with no error
https://bugs.webkit.org/show_bug.cgi?id=211145
Reviewed by Jer Noble.
Don't log when MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin() returns 0.
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::setNowPlayingInfo):
2020-04-28 Ross Kirsling <ross.kirsling@sony.com>
[JSC] Align upon the name isCallable instead of isFunction
https://bugs.webkit.org/show_bug.cgi?id=211140
Reviewed by Darin Adler.
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::getCustomElementCallback):
* bindings/js/JSDOMConvertCallbacks.h:
(WebCore::Converter<IDLCallbackFunction<T>>::convert):
* bindings/js/JSDOMConvertScheduledAction.h:
(WebCore::Converter<IDLScheduledAction>::convert):
* bindings/js/JSDOMPromise.cpp:
(WebCore::DOMPromise::whenPromiseIsSettled):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::queueMicrotask):
* bindings/js/JSWorkerGlobalScopeCustom.cpp:
(WebCore::JSWorkerGlobalScope::queueMicrotask):
* bindings/js/ReadableStream.cpp:
(WebCore::ReadableStream::pipeTo):
(WebCore::ReadableStream::tee):
* bindings/js/ReadableStreamDefaultController.cpp:
(WebCore::ReadableStreamDefaultController::invoke):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::callInWorld):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateOverloadDispatcher):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
* testing/Internals.cpp:
(WebCore::Internals::parserMetaData):
(WebCore::Internals::cloneArrayBuffer):
* worklets/PaintWorkletGlobalScope.cpp:
(WebCore::PaintWorkletGlobalScope::registerPaint):
2020-04-28 Simon Fraser <simon.fraser@apple.com>
Rewrite GraphicsLayerCA::updateSublayerList()
https://bugs.webkit.org/show_bug.cgi?id=211137
Reviewed by Zalan Bujtas.
This function was hard to understand, with aliasing of a layer list to handle
the various configurations. Future patches will add a bit more complexity here.
Rewrite using lambdas, which makes it easier to follow.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateSublayerList):
2020-04-28 Christopher Reid <chris.reid@sony.com>
[Win] Bundle Inspector Resources in Release builds
https://bugs.webkit.org/show_bug.cgi?id=210942
Reviewed by Fujii Hironori.
* CMakeLists.txt:
2020-04-28 Rob Buis <rbuis@igalia.com>
Remove downloadAttribute from DocumentLoader
https://bugs.webkit.org/show_bug.cgi?id=210493
Reviewed by Darin Adler.
Remove downloadAttribute from DocumentLoader since this
can be obtained from the NavigationAction.
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::downloadAttribute const):
(WebCore::DocumentLoader::setDownloadAttribute): Deleted.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadWithNavigationAction):
(WebCore::FrameLoader::loadPostRequest):
* loader/FrameLoader.h:
2020-04-28 Jack Lee <shihchieh_lee@apple.com>
Nullptr crash in EditCommand::EditCommand via CompositeEditCommand::removeNode
https://bugs.webkit.org/show_bug.cgi?id=207600
<rdar://problem/56969450>
Reviewed by Geoffrey Garen.
Move FrameSelection and Editor objects from Frame to Document so when a document is detached
in nested command executions, the next EditCommand would not fail in constructor.
Test: editing/inserting/insert-list-then-edit-command-crash.html
* dom/Document.cpp:
(WebCore::m_selection):
(WebCore::Document::willBeRemovedFromFrame):
(WebCore::m_undoManager): Deleted.
(WebCore::Document::prepareForDestruction): Deleted.
* dom/Document.h:
(WebCore::Document::editor):
(WebCore::Document::editor const):
(WebCore::Document::selection):
(WebCore::Document::selection const):
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::AlternativeTextController):
(WebCore::AlternativeTextController::stopPendingCorrection):
(WebCore::AlternativeTextController::isSpellingMarkerAllowed const):
(WebCore::AlternativeTextController::applyAutocorrectionBeforeTypingIfAppropriate):
(WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
(WebCore::AlternativeTextController::timerFired):
(WebCore::AlternativeTextController::handleAlternativeTextUIResult):
(WebCore::AlternativeTextController::rootViewRectForRange const):
(WebCore::AlternativeTextController::respondToChangedSelection):
(WebCore::AlternativeTextController::respondToAppliedEditing):
(WebCore::AlternativeTextController::respondToUnappliedEditing):
(WebCore::AlternativeTextController::editorClient):
(WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
(WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult):
(WebCore::AlternativeTextController::respondToMarkerAtEndOfWord):
(WebCore::AlternativeTextController::alternativeTextClient):
(WebCore::AlternativeTextController::applyAlternativeTextToRange):
(WebCore::AlternativeTextController::insertDictatedText):
(WebCore::AlternativeTextController::applyDictationAlternative):
* editing/AlternativeTextController.h:
(WebCore::AlternativeTextController::UNLESS_ENABLED):
* editing/CompositeEditCommand.cpp:
(WebCore::EditCommandComposition::unapply):
(WebCore::EditCommandComposition::reapply):
(WebCore::CompositeEditCommand::willApplyCommand):
(WebCore::CompositeEditCommand::didApplyCommand):
(WebCore::CompositeEditCommand::targetRanges const):
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::saveTypingStyleState):
(WebCore::DeleteSelectionCommand::mergeParagraphs):
(WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
(WebCore::DeleteSelectionCommand::doApply):
* editing/EditCommand.cpp:
(WebCore::EditCommand::EditCommand):
(WebCore::EditCommand::isEditingTextAreaOrTextInput const):
(WebCore::EditCommand::postTextStateChangeNotification):
(WebCore::EditCommand::frame): Deleted.
(WebCore::EditCommand::frame const): Deleted.
* editing/EditCommand.h:
* editing/Editing.cpp:
(WebCore::createDefaultParagraphElement):
* editing/EditingStyle.cpp:
(WebCore::StyleChange::StyleChange):
* editing/Editor.cpp:
(WebCore::ClearTextCommand::CreateAndApply):
(WebCore::TemporarySelectionChange::TemporarySelectionChange):
(WebCore::TemporarySelectionChange::~TemporarySelectionChange):
(WebCore::TemporarySelectionChange::setSelection):
(WebCore::Editor::selectionForCommand):
(WebCore::Editor::behavior const):
(WebCore::Editor::client const):
(WebCore::Editor::canEdit const):
(WebCore::Editor::canEditRichly const):
(WebCore::Editor::canDHTMLCut):
(WebCore::Editor::canDHTMLCopy):
(WebCore::Editor::canCopy const):
(WebCore::Editor::canPaste const):
(WebCore::Editor::canDelete const):
(WebCore::Editor::shouldSmartDelete):
(WebCore::Editor::deleteWithDirection):
(WebCore::Editor::deleteSelectionWithSmartDelete):
(WebCore::Editor::clearText):
(WebCore::Editor::replaceSelectionWithFragment):
(WebCore::Editor::selectedRange):
(WebCore::Editor::tryDHTMLCopy):
(WebCore::Editor::tryDHTMLCut):
(WebCore::Editor::shouldInsertText const):
(WebCore::Editor::hasBidiSelection const):
(WebCore::Editor::selectionUnorderedListState const):
(WebCore::Editor::selectionOrderedListState const):
(WebCore::Editor::increaseSelectionListLevel):
(WebCore::Editor::increaseSelectionListLevelOrdered):
(WebCore::Editor::increaseSelectionListLevelUnordered):
(WebCore::Editor::decreaseSelectionListLevel):
(WebCore::Editor::findEventTargetFromSelection const):
(WebCore::Editor::applyStyle):
(WebCore::Editor::applyParagraphStyle):
(WebCore::Editor::applyStyleToSelection):
(WebCore::Editor::applyParagraphStyleToSelection):
(WebCore::Editor::selectionStartHasStyle const):
(WebCore::Editor::selectionHasStyle const):
(WebCore::Editor::selectionStartCSSPropertyValue):
(WebCore::Editor::appliedEditing):
(WebCore::Editor::Editor):
(WebCore::Editor::clear):
(WebCore::Editor::insertText):
(WebCore::Editor::insertTextForConfirmedComposition):
(WebCore::Editor::insertTextWithoutSendingTextEvent):
(WebCore::Editor::insertLineBreak):
(WebCore::Editor::insertParagraphSeparator):
(WebCore::Editor::performCutOrCopy):
(WebCore::Editor::paste):
(WebCore::Editor::pasteAsQuotation):
(WebCore::Editor::renderLayerDidScroll):
(WebCore::Editor::setBaseWritingDirection):
(WebCore::Editor::baseWritingDirectionForSelectionStart const):
(WebCore::Editor::selectComposition):
(WebCore::SetCompositionScope::SetCompositionScope):
(WebCore::SetCompositionScope::~SetCompositionScope):
(WebCore::Editor::setComposition):
(WebCore::Editor::ignoreSpelling):
(WebCore::Editor::learnSpelling):
(WebCore::Editor::advanceToNextMisspelling):
(WebCore::Editor::misspelledWordAtCaretOrRange const):
(WebCore::Editor::isSelectionUngrammatical):
(WebCore::Editor::guessesForMisspelledWord const):
(WebCore::Editor::guessesForMisspelledOrUngrammatical):
(WebCore::Editor::markMisspellingsAfterTypingToWord):
(WebCore::Editor::isSpellCheckingEnabledInFocusedNode const):
(WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
(WebCore::Editor::markAndReplaceFor):
(WebCore::Editor::updateMarkersForWordsAffectedByEditing):
(WebCore::Editor::rangeForPoint):
(WebCore::Editor::revealSelectionAfterEditingOperation):
(WebCore::Editor::setIgnoreSelectionChanges):
(WebCore::Editor::getCompositionSelection const):
(WebCore::Editor::transpose):
(WebCore::Editor::changeSelectionAfterCommand):
(WebCore::Editor::selectedText const):
(WebCore::Editor::selectedTextForDataTransfer const):
(WebCore::Editor::insertTextPlaceholder):
(WebCore::Editor::removeTextPlaceholder):
(WebCore::Editor::shouldChangeSelection const):
(WebCore::Editor::computeAndSetTypingStyle):
(WebCore::Editor::findString):
(WebCore::Editor::countMatchesForText):
(WebCore::Editor::respondToChangedSelection):
(WebCore::Editor::shouldDetectTelephoneNumbers const):
(WebCore::Editor::scanSelectionForTelephoneNumbers):
(WebCore::Editor::editorUIUpdateTimerFired):
(WebCore::Editor::selectionStartHasMarkerFor const):
(WebCore::Editor::stringForCandidateRequest const):
(WebCore::Editor::contextRangeForCandidateRequest const):
(WebCore::Editor::fontAttributesAtSelectionStart const):
(WebCore::Editor::notifyClientOfAttachmentUpdates):
(WebCore::Editor::handleAcceptedCandidate):
(WebCore::Editor::unifiedTextCheckerEnabled const):
(WebCore::Editor::toggleOverwriteModeEnabled):
(WebCore::Editor::fontForSelection const):
(WebCore::Editor::canCopyExcludingStandaloneImages const):
(WebCore::Editor::document const): Deleted.
* editing/Editor.h:
(WebCore::TemporarySelectionChange::TemporarySelectionChange):
(WebCore::IgnoreSelectionChangeForScope::IgnoreSelectionChangeForScope):
(WebCore::Editor::document const):
* editing/EditorCommand.cpp:
(WebCore::executeSwapWithMark):
(WebCore::Editor::command):
(WebCore::Editor::Command::Command):
(WebCore::Editor::Command::execute const):
* editing/FrameSelection.cpp:
(WebCore::shouldAlwaysUseDirectionalSelection):
(WebCore::FrameSelection::FrameSelection):
(WebCore::FrameSelection::rootEditableElementOrDocumentElement const):
(WebCore::FrameSelection::setSelectionByMouseIfDifferent):
(WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
(WebCore::FrameSelection::setSelection):
(WebCore::updateSelectionByUpdatingLayoutOrStyle):
(WebCore::FrameSelection::setNeedsSelectionUpdate):
(WebCore::FrameSelection::updateAndRevealSelection):
(WebCore::FrameSelection::updateDataDetectorsForSelection):
(WebCore::FrameSelection::positionForPlatform const):
(WebCore::FrameSelection::nextWordPositionForPlatform):
(WebCore::FrameSelection::modifyMovingRight):
(WebCore::FrameSelection::modifyMovingLeft):
(WebCore::FrameSelection::modify):
(WebCore::FrameSelection::willBeRemovedFromFrame):
(WebCore::FrameSelection::absoluteCaretBounds):
(WebCore::FrameSelection::recomputeCaretRect):
(WebCore::FrameSelection::contains const):
(WebCore::FrameSelection::selectAll):
(WebCore::FrameSelection::focusedOrActiveStateChanged):
(WebCore::FrameSelection::isFocusedAndActive const):
(WebCore::shouldStopBlinkingDueToTypingCommand):
(WebCore::FrameSelection::updateAppearance):
(WebCore::FrameSelection::setCaretVisibility):
(WebCore::FrameSelection::setFocusedElementIfNeeded):
(WebCore::FrameSelection::shouldDeleteSelection const):
(WebCore::FrameSelection::selectionBounds const):
(WebCore::FrameSelection::getClippedVisibleTextRectangles const):
(WebCore::FrameSelection::currentForm const):
(WebCore::FrameSelection::revealSelection):
(WebCore::FrameSelection::setSelectionFromNone):
(WebCore::FrameSelection::shouldChangeSelection const):
(WebCore::FrameSelection::setShouldShowBlockCursor):
(WebCore::FrameSelection::appearanceUpdateTimerFired):
(WebCore::FrameSelection::updateAppearanceAfterLayoutOrStyleChange):
(WebCore::FrameSelection::selectRangeOnElement):
(WebCore::FrameSelection::setCaretBlinks):
(WebCore::FrameSelection::prepareForDestruction): Deleted.
* editing/FrameSelection.h:
* editing/InsertIntoTextNodeCommand.cpp:
(WebCore::InsertIntoTextNodeCommand::doApply):
* editing/InsertLineBreakCommand.cpp:
(WebCore::InsertLineBreakCommand::doApply):
* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::doApply):
* editing/ReplaceRangeWithTextCommand.cpp:
(WebCore::ReplaceRangeWithTextCommand::doApply):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::doApply):
* editing/SetSelectionCommand.cpp:
(WebCore::SetSelectionCommand::doApply):
(WebCore::SetSelectionCommand::doUnapply):
* editing/SpellChecker.cpp:
(WebCore::SpellChecker::SpellChecker):
(WebCore::SpellChecker::client const):
(WebCore::SpellChecker::isAsynchronousEnabled const):
(WebCore::SpellChecker::invokeRequest):
(WebCore::SpellChecker::didCheck):
(WebCore::SpellChecker::didCheckSucceed):
* editing/SpellChecker.h:
* editing/SpellingCorrectionCommand.cpp:
(WebCore::SpellingCorrectionCommand::doApply):
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::deleteSelection):
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):
(WebCore::TypingCommand::updateSelectionIfDifferentFromCurrentSelection):
(WebCore::TypingCommand::insertText):
(WebCore::TypingCommand::insertLineBreak):
(WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
(WebCore::TypingCommand::insertParagraphSeparator):
(WebCore::TypingCommand::lastTypingCommandIfStillOpenForTyping):
(WebCore::TypingCommand::closeTyping):
(WebCore::TypingCommand::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping):
(WebCore::TypingCommand::markMisspellingsAfterTyping):
(WebCore::TypingCommand::willAddTypingToOpenCommand):
(WebCore::TypingCommand::typingAddedToOpenCommand):
(WebCore::TypingCommand::insertTextAndNotifyAccessibility):
(WebCore::TypingCommand::insertTextRunWithoutNewlines):
(WebCore::TypingCommand::insertLineBreakAndNotifyAccessibility):
(WebCore::TypingCommand::insertParagraphSeparatorAndNotifyAccessibility):
(WebCore::TypingCommand::insertParagraphSeparatorInQuotedContentAndNotifyAccessibility):
* editing/TypingCommand.h:
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::selectionInHTMLFormat):
(WebCore::selectionAsAttributedString):
(WebCore::Editor::writeSelectionToPasteboard):
(WebCore::Editor::writeSelection):
(WebCore::Editor::selectionInWebArchiveFormat):
(WebCore::Editor::replaceSelectionWithAttributedString):
(WebCore::Editor::webContentFromPasteboard):
(WebCore::Editor::takeFindStringFromSelection):
* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::pasteWithPasteboard):
(WebCore::Editor::writeSelectionToPasteboard):
(WebCore::Editor::webContentFromPasteboard):
* editing/ios/EditorIOS.mm:
(WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
(WebCore::Editor::removeUnchangeableStyles):
(WebCore::Editor::pasteWithPasteboard):
(WebCore::Editor::insertDictationPhrases):
(WebCore::Editor::setDictationPhrasesAsChildOfElement):
(WebCore::Editor::setTextAsChildOfElement):
(WebCore::Editor::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping):
* editing/libwpe/EditorLibWPE.cpp:
(WebCore::Editor::writeSelectionToPasteboard):
(WebCore::Editor::pasteWithPasteboard):
* editing/mac/EditorMac.mm:
(WebCore::Editor::readSelectionFromPasteboard):
(WebCore::Editor::replaceNodeFromPasteboard):
(WebCore::Editor::selectionWillChange):
* editing/win/EditorWin.cpp:
(WebCore::Editor::pasteWithPasteboard):
(WebCore::Editor::webContentFromPasteboard):
* history/CachedFrame.cpp:
(WebCore::CachedFrame::destroy):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::willTransitionToCommitted):
(WebCore::FrameLoader::closeURL):
(WebCore::FrameLoader::didOpenURL):
(WebCore::FrameLoader::clear):
* page/Frame.cpp:
(WebCore::Frame::Frame):
(WebCore::Frame::setView):
(WebCore::Frame::setDocument):
(WebCore::Frame::requestDOMPasteAccess):
(WebCore::Frame::setPageAndTextZoomFactors):
* page/Frame.h:
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange):
2020-04-28 Antti Koivisto <antti@apple.com>
msn.com: Header flickers when scrolling articles
https://bugs.webkit.org/show_bug.cgi?id=211126
<rdar://problem/56439177>
Reviewed by Simon Fraser.
Test: compositing/fixed-with-clip-stability.html
In case of fixed positioned elements the decision to create backing depends on clip rect.
However RenderLayer::localClipRect() tests for backing in call to clippingRootForPainting(). This creates
instability since clipping depends on backing decision, and backing decision depends on clipping.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::localClipRect const):
Specifically the result of clipExceedsBounds test here is affected by computed offsetFromRoot:
"clipRect.contains(cssClipRect)" test fails for zero sized clips with different offsets.
Compute clipExceedsBounds by looking at the clip sizes only and ignoring the position (which should match).
2020-04-28 Zalan Bujtas <zalan@apple.com>
[LFC] Introduce FormattingContext::ConstraintsForOutOfFlowContent
https://bugs.webkit.org/show_bug.cgi?id=211125
Reviewed by Antti Koivisto.
Horizontal and vertical out-of-flow constraints are always computed and used in pairs.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
(WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::constraintsForOutOfFlowContent):
(WebCore::Layout::FormattingContext::Geometry::horizontalConstraintsForOutOfFlow): Deleted.
(WebCore::Layout::FormattingContext::Geometry::verticalConstraintsForOutOfFlow): Deleted.
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
* layout/LayoutUnits.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
2020-04-28 Zalan Bujtas <zalan@apple.com>
[LFC] Introduce FormattingContext::ConstraintsForInFlowContent
https://bugs.webkit.org/show_bug.cgi?id=211113
Reviewed by Antti Koivisto.
This makes the layoutInFlowContent() related code look simpler.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
* layout/FormattingContext.h:
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
(WebCore::Layout::InlineFormattingContext::lineLayout):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::layout):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutInFlowContent):
(WebCore::Layout::TableFormattingContext::layoutCell):
* layout/tableformatting/TableFormattingContext.h:
2020-04-28 Philippe Normand <pnormand@igalia.com>
media/track/track-load-error-readyState.html passes only when accompanied by some other tests
https://bugs.webkit.org/show_bug.cgi?id=210976
Reviewed by Xabier Rodriguez-Calvar.
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState): Reset caption
display mode, which might have been overriden by a previous test.
2020-04-28 Adrian Perez de Castro <aperez@igalia.com>
Non-unified build fixes late April 2020 edition
https://bugs.webkit.org/show_bug.cgi?id=211099
Unreviewed build fix.
No new tests needed.
* Modules/cache/DOMCacheStorage.cpp: Sprinkle DOMCacheEngine:: namespace prefixes as needed.
(WebCore::DOMCacheStorage::findCacheOrCreate):
(WebCore::DOMCacheStorage::retrieveCaches):
(WebCore::DOMCacheStorage::doOpen):
(WebCore::DOMCacheStorage::doRemove):
* bindings/js/JSExecStateInstrumentation.h: Ditto for JSC:: namespace prefixes.
(WebCore::JSExecState::instrumentFunction):
* dom/ScriptedAnimationController.h: Add missing ReducedResolutionSeconds.h header.
* editing/TextCheckingHelper.h: Add missing forward declaration for Position.
* html/URLSearchParams.h: Add missing ExceptionOr.h header.
2020-04-28 Charlie Turner <cturner@igalia.com>
[EME][CDMProxy] Default initialize m_numDecryptorsWaitingForKey member
https://bugs.webkit.org/show_bug.cgi?id=210970
Reviewed by Xabier Rodriguez-Calvar.
This was causing non-deterministic reads of the
m_numDecryptorsWaitingForKey member. Sometimes a waiting for key
event would fail to fire and cause test failures. I thought
std::atomic<int> would default initialize to zero, but after
spec-diving I realise now I was wrong about that.
Test: encrypted-media/clearkey-mp4-waiting-for-a-key.https.html
* platform/encryptedmedia/CDMProxy.h:
2020-04-28 Youenn Fablet <youenn@apple.com>
RTCPeerConnection should not remove its created remote MediaStream objects until getting close
https://bugs.webkit.org/show_bug.cgi?id=211070
Reviewed by Alex Christensen.
Remove no longer needed code.
This aligns with the spec and Firefox implementation.
Test: webrtc/direction-change.html
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::transceiverBackendFromSender):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2020-04-28 Youenn Fablet <youenn@apple.com>
Ensure remote track event gets unmuted after the track event is fired
https://bugs.webkit.org/show_bug.cgi?id=211071
Reviewed by Alex Christensen.
This code was made obsolete by the setMuted(false) call done just after firing the track event.
Given the setMuted(false) in addPendingTrackEvent was done asynchronously and was triggering firing the muted event asynchronously,
this change should not be observable from JS.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::addPendingTrackEvent):
2020-04-28 Rob Buis <rbuis@igalia.com>
Make HistoryController an inner class of FrameLoader
https://bugs.webkit.org/show_bug.cgi?id=211090
Reviewed by Darin Adler.
Make HistoryController an inner class of FrameLoader, this allows
us to move some methods only used by HistoryController out of the
FrameLoader public API.
* loader/FrameLoader.h:
* loader/HistoryController.cpp:
* loader/HistoryController.h:
2020-04-27 Simon Fraser <simon.fraser@apple.com>
Do correct clipping of composited replaced elements with border-radius
https://bugs.webkit.org/show_bug.cgi?id=211114
Reviewed by Zalan Bujtas.
For replaced elements with composited content (video, WebGL), RenderLayerBacking
incorrectly used the rounded inner border rect to clip the contents. This doesn't match
painted replaced elements, which clip to the inside of the padding box.
Fix by implementing RenderReplaced::roundedContentBoxRect() and calling it from compositing
code. Also add a helper to get the rounded border box rect, and call it in various places.
Test: compositing/clipping/border-radius-on-webgl.html
* rendering/RenderBox.cpp:
(WebCore::RenderBox::roundedBorderBoxRect const):
* rendering/RenderBox.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::updateContentsRects):
(WebCore::RenderLayerBacking::resetContentsRect):
(WebCore::RenderLayerBacking::updateChildClippingStrategy):
(WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage):
(WebCore::RenderLayerBacking::updateImageContents):
(WebCore::backgroundRectForBox):
* rendering/RenderLayerBacking.h:
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::roundedContentBoxRect const):
* rendering/RenderReplaced.h:
2020-04-27 Said Abou-Hallawa <sabouhallawa@apple.com>
Timestamps should be the same for all rendering update steps
https://bugs.webkit.org/show_bug.cgi?id=207153
Reviewed by Simon Fraser.
The HTML 5 event loop sepcs states that timestamps should be the same for
all rendering update steps.
Specs link (step 9):
https://html.spec.whatwg.org/multipage/webappapis.html#event-loop-processing-model
This patch also fixes some issues in IntersectionObserver.
Test: intersection-observer/intersection-observer-callback-timestamp.html
* dom/Document.cpp:
(WebCore::Document::updateIntersectionObservations):
(WebCore::Document::notifyIntersectionObserversTimerFired): Deleted.
* dom/Document.h:
-- Handle the case when two floats are areEssentiallyEqual().
-- Execute the IntersectionObserver immediately and do not wait until the
next CFRunLoop event since this does not implement the specs.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::freezeNowTimestamp):
(WebCore::DOMWindow::unfreezeNowTimestamp):
(WebCore::DOMWindow::frozenNowTimestamp const):
* page/DOMWindow.h:
Provide a frozen now() timestamp in seconds to be used internally only.
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::nowTimestamp const):
Use the frozenNowTimestamp().
* page/Page.cpp:
(WebCore::Page::updateRendering):
Freeze the timestamps while serving the rendering update steps.
2020-04-27 Dean Jackson <dino@apple.com>
getShaderPrecisionFormat returns the wrong values
https://bugs.webkit.org/show_bug.cgi?id=211013
<rdar://problem/62378056>
Reviewed by Darin Adler.
Gregg pointed out that our code hardcodes values for
getShaderPrecisionFormat. The fix is simply to call into
the underlying GL function.
Covered by the existing test: webgl/1.0.3/conformance/misc/shader-precision-format.html
However, that just tests minimum values. Devices have different
actual results.
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLOpenGL::getShaderPrecisionFormat):
2020-04-27 Simon Fraser <simon.fraser@apple.com>
Rename scrollableAreaForScrollLayerID to scrollableAreaForScrollingNodeID
https://bugs.webkit.org/show_bug.cgi?id=211091
Reviewed by Myles C. Maxfield.
The argument to scrollableAreaForScrollLayerID() is a ScrollingNodeID, not a layerID.
* page/FrameView.cpp:
(WebCore::FrameView::scrollableAreaForScrollingNodeID const):
(WebCore::FrameView::scrollableAreaForScrollLayerID const): Deleted.
* page/FrameView.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::setActiveScrollSnapIndices):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::scrollableAreaForScrollingNodeID const):
(WebCore::RenderLayerCompositor::scrollableAreaForScrollLayerID const): Deleted.
* rendering/RenderLayerCompositor.h:
2020-04-27 Ryan Haddad <ryanhaddad@apple.com>
[Cocoa] stop using out arguments for document attributes when converting to attributed strings
https://bugs.webkit.org/show_bug.cgi?id=211048
Unreviewed partial revert of r260739 to remove unexpected logging that broke Catalina-Release-WK2-Perf tests.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::policyProperties):
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::siteForCookies):
2020-04-27 Wenson Hsieh <wenson_hsieh@apple.com>
Text manipulation should not aggregate text from different navigation anchor elements
https://bugs.webkit.org/show_bug.cgi?id=211081
<rdar://problem/59553658>
Reviewed by Megan Gardner.
Tweak the item boundary heuristic in `TextManipulationController::observeParagraphs` to separate text in
links and list items under navigation elements (either nav elements, or elements with the "navigation"
accessibility role) into separate paragraphs.
Also, extend the item boundary rule for button elements to apply to elements with the "button"
accessibility role as well.
Test: TextManipulation.StartTextManipulationTreatsInlineBlockLinksAndButtonsAsParagraphs
TextManipulation.StartTextManipulationTreatsLinksInNavigationElementsAsParagraphs
* editing/TextManipulationController.cpp:
(WebCore::TextManipulationController::observeParagraphs):
2020-04-27 Antoine Quint <graouts@apple.com>
Clean up some useless includes of CSSAnimationController.h
https://bugs.webkit.org/show_bug.cgi?id=211066
Reviewed by Antti Koivisto.
These files don't actually use any of the CSSAnimationController APIs.
* page/ios/FrameIOS.mm:
* rendering/RenderObject.cpp:
2020-04-27 Antoine Quint <graouts@apple.com>
Rename CSSAnimationController accessors from animation() to legacyAnimation()
https://bugs.webkit.org/show_bug.cgi?id=211082
Reviewed by Simon Fraser.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::computeRenderStyleForProperty):
* dom/Document.cpp:
(WebCore::Document::resolveStyle):
(WebCore::Document::didBecomeCurrentDocumentInFrame):
(WebCore::Document::prepareForDestruction):
(WebCore::Document::implicitClose):
(WebCore::Document::resume):
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::clearHostElement):
* history/CachedFrame.cpp:
(WebCore::CachedFrame::destroy):
* page/Frame.cpp:
(WebCore::Frame::clearTimers):
(WebCore::Frame::resumeActiveDOMObjectsAndAnimations):
* page/Frame.h:
* page/FrameView.cpp:
(WebCore::FrameView::didDestroyRenderTree):
(WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
* page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::layout):
* page/Page.cpp:
(WebCore::Page::handleLowModePowerChange):
(WebCore::Page::setIsVisibleInternal):
(WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::updateThrottlingState):
(WebCore::CSSAnimationControllerPrivate::suspendAnimations):
(WebCore::CSSAnimationControllerPrivate::resumeAnimations):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::currentTransform const):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::notifyAnimationStarted):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
(WebCore::RenderLayerCompositor::isRunningTransformAnimation const):
* rendering/RenderObject.h:
(WebCore::RenderObject::legacyAnimation const):
(WebCore::RenderObject::animation const): Deleted.
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
* testing/Internals.cpp:
(WebCore::Internals::numberOfActiveAnimations const):
(WebCore::Internals::animationsAreSuspended const):
(WebCore::Internals::animationsInterval const):
(WebCore::Internals::suspendAnimations const):
(WebCore::Internals::resumeAnimations const):
(WebCore::Internals::pauseAnimationAtTimeOnElement):
(WebCore::Internals::pauseAnimationAtTimeOnPseudoElement):
(WebCore::Internals::pauseTransitionAtTimeOnElement):
(WebCore::Internals::pauseTransitionAtTimeOnPseudoElement):
2020-04-27 Per Arne Vollan <pvollan@apple.com>
[Cocoa] After r258891, r255119 can be reverted
https://bugs.webkit.org/show_bug.cgi?id=211083
<rdar://problem/60714318>
Unreviewed revert of r255119.
Copying a MIME type map from the UI process to the WebContent process on startup is not needed anymore,
since r258891 will map the Launch Services database in the WebContent process.
* platform/MIMETypeRegistry.cpp:
(WebCore::commonMimeTypesMap):
(WebCore::typesForCommonExtension):
(WebCore::overriddenMimeTypesMap): Deleted.
* platform/MIMETypeRegistry.h:
* testing/Internals.cpp:
(WebCore::Internals::mediaMIMETypeForExtension): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2020-04-27 Darin Adler <darin@apple.com>
Improve performance of commonInclusiveAncestor for deeply nested nodes
https://bugs.webkit.org/show_bug.cgi?id=211078
Reviewed by Antti Koivisto.
* dom/Node.cpp:
(WebCore::depth): Added.
(WebCore::commonInclusiveAncestor): Replaced implementation that walks the
parent chain of the second node repeatedly with one that walks the parent
chain of each node twice.
2020-04-27 Daniel Bates <dabates@apple.com>
Caret may be placed in the wrong spot for text input context that is a form control
https://bugs.webkit.org/show_bug.cgi?id=210939
<rdar://problem/61943089>
Reviewed by Darin Adler.
Add a helper function that returns the closest editable position inside an element
for a given point (if any).
* editing/Editing.cpp:
(WebCore::closestEditablePositionInElementForAbsolutePoint): Added.
* editing/Editing.h:
2020-04-27 Alicia Boya García <aboya@igalia.com>
[GStreamer] Rework WebKitWebSrc threading
https://bugs.webkit.org/show_bug.cgi?id=210284
Reviewed by Xabier Rodriguez-Calvar.
WebKitWebSrc as it is in master has a number of race conditions
leading to occasional starvation (due to cancelling the wrong request)
or data corruption (due to pushing data from a cancelled request).
The threading situation wasn't easy to follow, as it wasn't clear
access to what members should be protected by what mutex, in what
circumstances. Also, some parts of the design were also introducing
addicional complexity, such as the first request being sent from the
main thread whereas the rest were being sent from the streaming thread
or basesrc async start.
In response, this patch reworks all the locking in WebKitWebSrc to use
WTF::DataMutex. This ensures all accesses to its (now explicit)
protected members are locked. The two mutexes and condition variables
have been simplified into one, as there was no obvious need or benefit
for two of each in this case.
Requests have been numbered, which allows to safely and atomically
ignore results from cancelled requests, avoiding data corruption
races, and makes following them in debug logs much easier.
The conditions for making and cancelling requests have been simplified
to a simpler and safer model: There is at most only one active request
at anytime, flushes cancel the request, and the first create() call
always makes the new request (both at startup and after a flush).
Debug asserts and notes about the flow of operations during basesrc
seeks have been provided.
As this effort needed a review of the entire WebKitWebSrc, cleanups,
corrections and documentation comments have been provided where
appropriate.
This patch introduces no visible behavior changes, just stability
improvements.
* platform/graphics/gstreamer/GRefPtrGStreamer.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(WebKitWebSrcPrivate::~WebKitWebSrcPrivate):
(webkit_web_src_class_init):
(webkitWebSrcReset):
(webKitWebSrcConstructed):
(webKitWebSrcSetProperty):
(webKitWebSrcGetProperty):
(webKitWebSrcSetContext):
(webKitWebSrcSendEvent):
(restartLoaderIfNeeded):
(stopLoaderIfNeeded):
(webKitWebSrcCreate):
(webKitWebSrcStart):
(webKitWebSrcMakeRequest):
(webKitWebSrcStop):
(webKitWebSrcGetSize):
(webKitWebSrcIsSeekable):
(webKitWebSrcDoSeek):
(webKitWebSrcQuery):
(webKitWebSrcUnLock):
(webKitWebSrcUnLockStop):
(webKitWebSrcSetUri):
(webKitWebSrcSetMediaPlayer):
(webKitSrcPassedCORSAccessCheck):
(CachedResourceStreamingClient::CachedResourceStreamingClient):
(CachedResourceStreamingClient::checkUpdateBlocksize):
(CachedResourceStreamingClient::responseReceived):
(CachedResourceStreamingClient::dataReceived):
(CachedResourceStreamingClient::accessControlCheckFailed):
(CachedResourceStreamingClient::loadFailed):
(CachedResourceStreamingClient::loadFinished):
(webKitSrcWouldTaintOrigin):
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
2020-04-26 Darin Adler <darin@apple.com>
Replace more uses of live ranges with SimpleRange
https://bugs.webkit.org/show_bug.cgi?id=211058
Reviewed by Antti Koivisto.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::textUnderElement const): Use SimpleRange.
* dom/BoundaryPoint.h: Moved makeBoundaryPointAfterNodeContents here so it
can be used more places.
* dom/Node.cpp:
(WebCore::commonInclusiveAncestor): Moved the commonAncestorContainer function
here from Range, decided to use the "inclusive ancestor" naming from the
DOM specification, and used RefPtr for the result since it's part of our modern
safer design to always use smart pointers for return values.
* dom/Node.h: Added commonInclusiveAncestor.
* dom/Position.cpp:
(WebCore::commonShadowIncludingAncestor): Call commonInclusiveAncestor.
* dom/Range.cpp:
(WebCore::Range::commonAncestorContainer): Deleted.
(WebCore::Range::isPointInRange): Call commonInclusiveAncestor.
(WebCore::Range::comparePoint const): Ditto.
(WebCore::Range::compareBoundaryPoints): Ditto.
(WebCore::Range::collectSelectionRectsWithoutUnionInteriorLines const): Ditto.
* dom/Range.h:
(WebCore::Range::commonAncestorContainer const): Call commonInclusiveAncestor.
* dom/SimpleRange.cpp:
(WebCore::makeBoundaryPointAfterNodeContents): Moved to BoundaryPoint.h.
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::respondToUnappliedSpellCorrection): Use
SimpleRange instead of live range.
(WebCore::AlternativeTextController::respondToUnappliedEditing): Ditto.
(WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand): Ditto.
(WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult): Ditto.
* editing/ChangeListTypeCommand.cpp:
(WebCore::listConversionTypeForSelection): use commonInclusiveAncestor.
* editing/Editing.cpp:
(WebCore::isNodeVisiblyContainedWithin): Take a SimpleRange argument.
* editing/Editing.h: Updated for the above.
* editing/Editor.cpp:
(WebCore::Editor::addRangeToKillRing): Take a SimpleRange argument.
(WebCore::Editor::shouldDetectTelephoneNumbers const): Made this const and
tweaked coding style a bit.
(WebCore::scanForTelephoneNumbers): Moved this, made it a non-member function,
renamed from scanRangeForTelephoneNumbers, use SimpleRange.
(WebCore::extendSelection): Added. Factored out some logic from the function below.
(WebCore::Editor::scanSelectionForTelephoneNumbers): Use SimpleRange. Removed
some unnecessary code that subtracts 1 and then adds 1 again.
* editing/Editor.h: Updated for the above.
* editing/TextManipulationController.cpp:
(WebCore::TextManipulationController::replace): Use commonInclusiveAncestor.
* editing/VisibleSelection.cpp:
(WebCore::makeSearchRange): Return a SimpleRange.
(WebCore::VisibleSelection::appendTrailingWhitespace): Use SimpleRange.
* editing/WebContentReader.h: Use SimpleRange instead of a live range.
* editing/cocoa/DataDetection.h: Use a struct, DetectedItem, for the return value
from the detection functions. Also changed DataDetectorTypes to an enum class so
it can be forward-declared instead of having to include this header.
* editing/cocoa/DataDetection.mm:
(WebCore::detectItem): Renamed from detectItemAtPositionWithRange. Return the
DetectedItem struct, with a SimpleRange rather than an out argument live range.
(WebCore::DataDetection::detectItemAroundHitTestResult): Ditto.
(WebCore::contains): Added a helper function for testing bits in the
DataDetectorType enum. Later we can make this better using OptionSet.
(WebCore::constructURLStringForResult): Refactored a bit, updated for the new
DataDetectorTypes enum class, and to use CFEqual instead of CFStringCompare.
(WebCore::DataDetection::detectContentInRange): Ditto.
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::webContentFromPasteboard): Use SimpleRange.
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentReader::readPlainText): Updated since context is SimpleRange.
* editing/gtk/EditorGtk.cpp:
(WebCore::createFragmentFromPasteboardData): Use SimpleRange.
(WebCore::Editor::webContentFromPasteboard): Use SimpleRange.
* editing/win/EditorWin.cpp:
(WebCore::Editor::webContentFromPasteboard): Use SimpleRange.
* editing/mac/EditorMac.mm:
(WebCore::Editor::replaceNodeFromPasteboard): Use SimpleRange.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkLoadCompleteForThisFrame): Use SimpleRange.
* page/EventHandler.cpp:
(WebCore::targetNodeForClickEvent): Use commonInclusiveAncestor. Also updated
to return a RefPtr.
(WebCore::EventHandler::handleMouseReleaseEvent): Updated for the above.
* page/Settings.yaml: Changed the default for DataDetectorTypes to be the empty
string rather than a named constant.
* page/SettingsBase.h: Forward-declare DataDetectorTypes instead of including
the DataDetection.h header.
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange): Take a SimpleRange.
(WebCore::TextIndicator::createWithSelectionInFrame): Ditto.
(WebCore::hasNonInlineOrReplacedElements): Ditto.
(WebCore::selectionRects): Ditto. Also renamed from getSelectionRectsForRange.
(WebCore::styleContainsComplexBackground): Tweaked implementation.
(WebCore::estimatedTextColorsForRange): Take a SimpleRange.
(WebCore::absoluteBoundingRectForRange): Ditto.
(WebCore::estimatedBackgroundColorForRange): Ditto.
(WebCore::containsOnlyWhiteSpaceText): Ditto.
(WebCore::initializeIndicator): Ditto.
* page/TextIndicator.h: Updated for the above.
* page/mac/ServicesOverlayController.h: Use SimpleRange instead of a live
range for highlights.
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::createForSelection): Take SimpleRange.
(WebCore::ServicesOverlayController::Highlight::createForTelephoneNumber): Ditto.
(WebCore::ServicesOverlayController::Highlight::Highlight): Ditto.
(WebCore::ServicesOverlayController::buildPhoneNumberHighlights): Ditto.
(WebCore::ServicesOverlayController::buildSelectionHighlight): Ditto.
(WebCore::ServicesOverlayController::telephoneNumberRangesForFocusedFrame): Ditto.
(WebCore::ServicesOverlayController::highlightsAreEquivalent): Ditto.
(WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight): Ditto.
(WebCore::ServicesOverlayController::handleClick): Ditto.
* platform/ios/DragImageIOS.mm:
(WebCore::createDragImageForLink): Use SimpleRange.
(WebCore::createDragImageForSelection): Tweaked a bit.
2020-04-27 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK4] Make it possible to build with GTK4 without errors
https://bugs.webkit.org/show_bug.cgi?id=210967
Reviewed by Adrian Perez de Castro.
* platform/PlatformPasteboard.h:
* platform/graphics/DisplayRefreshMonitor.cpp:
(WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor):
* platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp:
* platform/graphics/gtk/DisplayRefreshMonitorGtk.h:
* platform/graphics/gtk/GdkCairoUtilities.cpp:
(WebCore::getDefaultCairoFontOptions):
* platform/gtk/CursorGtk.cpp:
(WebCore::createCustomCursor):
* platform/gtk/DragImageGtk.cpp:
(WebCore::dissolveDragImageToFraction):
* platform/gtk/GRefPtrGtk.cpp:
* platform/gtk/GRefPtrGtk.h:
* platform/gtk/GUniquePtrGtk.h:
* platform/gtk/GtkVersioning.h:
(gdk_event_copy):
(gtk_widget_size_allocate):
(gtk_widget_queue_resize_no_redraw):
(gdk_event_get_state):
(gdk_event_get_coords):
(gdk_event_get_root_coords):
(gdk_event_is_scroll_stop_event):
(gdk_event_get_scroll_direction):
(gdk_event_get_scroll_deltas):
(gdk_event_get_button):
* platform/gtk/PasteboardHelper.cpp:
* platform/gtk/PasteboardHelper.h:
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::PlatformKeyboardEvent::modifiersContainCapsLock):
* platform/gtk/PlatformPasteboardGtk.cpp:
(WebCore::PlatformPasteboard::PlatformPasteboard):
(WebCore::PlatformPasteboard::writeToClipboard):
(WebCore::PlatformPasteboard::readFromClipboard):
* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::getCurrentScreenMonitor):
2020-04-27 Rob Buis <rbuis@igalia.com>
Make loadURLIntoChildFrame private and non-exported
https://bugs.webkit.org/show_bug.cgi?id=211051
Reviewed by Darin Adler.
Make loadURLIntoChildFrame private and non-exported to reduce the amount of public API functions
that start loads. In order to do this loadURLIntoChildFrame is being called from SubframeLoader
and SubframeLoader is made an inner class of FrameLoader. Because this simplifies createFrame (and
makes createFrame behave strictly like its name) url and referrer do not have to be passed.
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parametersForPlugin):
* loader/EmptyClients.cpp:
(WebCore::EmptyFrameLoaderClient::createFrame):
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* loader/SubframeLoader.cpp:
(WebCore::FrameLoader::SubframeLoader::SubframeLoader):
(WebCore::FrameLoader::SubframeLoader::clear):
(WebCore::FrameLoader::SubframeLoader::requestFrame):
(WebCore::FrameLoader::SubframeLoader::resourceWillUsePlugin):
(WebCore::FrameLoader::SubframeLoader::pluginIsLoadable):
(WebCore::FrameLoader::SubframeLoader::requestPlugin):
(WebCore::FrameLoader::SubframeLoader::requestObject):
(WebCore::FrameLoader::SubframeLoader::createJavaAppletWidget):
(WebCore::FrameLoader::SubframeLoader::loadOrRedirectSubframe):
(WebCore::FrameLoader::SubframeLoader::loadSubframe):
(WebCore::FrameLoader::SubframeLoader::shouldUsePlugin):
(WebCore::FrameLoader::SubframeLoader::loadPlugin):
(WebCore::FrameLoader::SubframeLoader::completeURL const):
(WebCore::FrameLoader::SubframeLoader::shouldConvertInvalidURLsToBlank const):
(WebCore::SubframeLoader::SubframeLoader): Deleted.
(WebCore::SubframeLoader::clear): Deleted.
(WebCore::SubframeLoader::requestFrame): Deleted.
(WebCore::SubframeLoader::resourceWillUsePlugin): Deleted.
(WebCore::SubframeLoader::pluginIsLoadable): Deleted.
(WebCore::SubframeLoader::requestPlugin): Deleted.
(WebCore::SubframeLoader::requestObject): Deleted.
(WebCore::SubframeLoader::createJavaAppletWidget): Deleted.
(WebCore::SubframeLoader::loadOrRedirectSubframe): Deleted.
(WebCore::SubframeLoader::loadSubframe): Deleted.
(WebCore::SubframeLoader::shouldUsePlugin): Deleted.
(WebCore::SubframeLoader::loadPlugin): Deleted.
(WebCore::SubframeLoader::completeURL const): Deleted.
(WebCore::SubframeLoader::shouldConvertInvalidURLsToBlank const): Deleted.
* loader/SubframeLoader.h:
(WebCore::SubframeLoader::containsPlugins const): Deleted.
2020-04-27 Alberto Garcia <berto@igalia.com>
[GTK] [2.28.0] The Yelp build crashes if DISPLAY is not set
https://bugs.webkit.org/show_bug.cgi?id=209431
Reviewed by Carlos Garcia Campos.
Don't create a PlatformDisplayLibWPE as a fallback when using
Wayland or X11.
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::createPlatformDisplay):
2020-04-27 Claudio Saavedra <csaavedra@igalia.com>
Unreviewed compile-warning fix.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
2020-04-27 Diego Pino Garcia <dpino@igalia.com>
Unreviewed, GTK LTS build fix after r260744
https://bugs.webkit.org/show_bug.cgi?id=211069
* bindings/js/JSDOMBuiltinConstructor.h:
(WebCore::JSDOMBuiltinConstructor<JSClass>::getConstructData):
2020-04-27 Claudio Saavedra <csaavedra@igalia.com>
[GTK4] GdkRGBA has float members instead of double
Unreviewed warning fix.
* platform/graphics/gtk/ColorGtk.cpp:
(WebCore::Color::operator GdkRGBA const):
2020-04-27 Ross Kirsling <ross.kirsling@sony.com>
[JSC] CallData/ConstructData should include CallType/ConstructType
https://bugs.webkit.org/show_bug.cgi?id=211059
Reviewed by Darin Adler.
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::installReplacement):
* bindings/js/JSCallbackData.cpp:
(WebCore::JSCallbackData::invokeCallback):
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::constructCustomElementSynchronously):
(WebCore::JSCustomElementInterface::upgradeElement):
(WebCore::JSCustomElementInterface::invokeCallback):
* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
* bindings/js/JSDOMBuiltinConstructor.h:
(WebCore::JSDOMBuiltinConstructor<JSClass>::getConstructData):
* bindings/js/JSDOMBuiltinConstructorBase.cpp:
(WebCore::JSDOMBuiltinConstructorBase::callFunctionWithCurrentArguments):
* bindings/js/JSDOMConstructor.h:
(WebCore::JSDOMConstructor<JSClass>::getConstructData):
* bindings/js/JSDOMConstructorBase.cpp:
(WebCore::JSDOMConstructorBase::getCallData):
* bindings/js/JSDOMConstructorBase.h:
* bindings/js/JSDOMConstructorNotConstructable.h:
* bindings/js/JSDOMIterator.h:
(WebCore::iteratorForEach):
* bindings/js/JSDOMMapLike.cpp:
(WebCore::clearBackingMap):
(WebCore::setToBackingMap):
(WebCore::forwardFunctionCallToBackingMap):
(WebCore::forwardForEachCallToBackingMap):
* bindings/js/JSDOMNamedConstructor.h:
(WebCore::JSDOMNamedConstructor<JSClass>::getConstructData):
* bindings/js/JSDOMPromise.cpp:
(WebCore::DOMPromise::whenPromiseIsSettled):
* bindings/js/JSDOMPromiseDeferred.cpp:
(WebCore::createRejectedPromiseWithTypeError):
* bindings/js/JSDOMSetLike.cpp:
(WebCore::clearBackingSet):
(WebCore::addToBackingSet):
(WebCore::forwardFunctionCallToBackingSet):
(WebCore::forwardForEachCallToBackingSet):
* bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::handleEvent):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSExecState.cpp:
(WebCore::functionCallHandlerFromAnyThread):
* bindings/js/JSExecState.h:
(WebCore::JSExecState::call):
(WebCore::JSExecState::profiledCall):
* bindings/js/JSExecStateInstrumentation.h:
(WebCore::JSExecState::instrumentFunction):
(WebCore::JSExecState::instrumentFunctionInternal): Deleted.
(WebCore::JSExecState::instrumentFunctionCall): Deleted.
(WebCore::JSExecState::instrumentFunctionConstruct): Deleted.
* bindings/js/JSNavigatorCustom.cpp:
(WebCore::JSNavigator::getUserMedia):
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::callPlugin):
(WebCore::pluginElementCustomGetCallData):
* bindings/js/JSPluginElementFunctions.h:
* bindings/js/ReadableStream.cpp:
(WebCore::ReadableStream::create):
(WebCore::ReadableStreamInternal::callFunction):
(WebCore::ReadableStream::lock):
* bindings/js/ReadableStreamDefaultController.cpp:
(WebCore::readableStreamCallFunction):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::executeFunctionInContext):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::callInWorld):
(WebCore::ScriptController::executeAsynchronousUserAgentScriptInWorld):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GeneratePluginCall):
(GenerateLegacyCallerDefinitions):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObj::getCallData):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
(WebCore::JSTestPluginInterface::getCallData):
* bindings/scripts/test/JS/JSTestPluginInterface.h:
* bridge/NP_jsobject.cpp:
* bridge/objc/WebScriptObject.mm:
(-[WebScriptObject callWebScriptMethod:withArguments:]):
* bridge/objc/objc_runtime.h:
* bridge/objc/objc_runtime.mm:
(JSC::Bindings::ObjcFallbackObjectImp::getCallData):
* bridge/runtime_object.cpp:
(JSC::Bindings::RuntimeObject::getCallData):
(JSC::Bindings::RuntimeObject::getConstructData):
* bridge/runtime_object.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateCaptionContainer):
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
(WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
(WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
* testing/Internals.cpp:
(WebCore::Internals::cloneArrayBuffer):
2020-04-27 Diego Pino Garcia <dpino@igalia.com>
Unreviewed, reverting r260672.
[GTK] WebInspector tests are timing out after r260672
Reverted changeset:
"[Win] Bundle Inspector Resources in Release builds"
https://bugs.webkit.org/show_bug.cgi?id=210942
https://trac.webkit.org/changeset/260672
2020-04-27 Kenneth Russell <kbr@chromium.org>
Build failure in WebGL2RenderingContext after r260588
https://bugs.webkit.org/show_bug.cgi?id=211057
Reviewed by Darin Adler.
Fix non-ANGLE build failure in WebGL2RenderingContext after
r260588.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::texStorage2D):
2020-04-26 Darin Adler <darin@apple.com>
[Cocoa] stop using out arguments for document attributes when converting to attributed strings
https://bugs.webkit.org/show_bug.cgi?id=211048
Reviewed by Sam Weinig.
* DerivedSources-input.xcfilelist: Building modified this file automatically. Uploading
the new version.
* WebCore.xcodeproj/project.pbxproj: Added AttributedString.h.
* editing/cocoa/AttributedString.h: Added. Moved this from WebKit, but removed a lot of
inessentials.
* editing/cocoa/DictionaryLookup.mm: Removed unneeded include.
* editing/cocoa/EditorCocoa.mm:
(WebCore::selectionAsAttributedString): Updated for change to the return value of the
attributedString function, and use init instead of initWithString:@"".
* editing/cocoa/HTMLConverter.h: Changed to an Objective-C-only header, omitting things
like #pramga once. Return the AttributedString struct from the functions instead of
using an out argument for document attributes.
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::convert): Return an AttributedString and drop the out argument.
(WebCore::attributedString): Ditto.
(WebCore::editingAttributedString): Ditto. Also refactor a little bit.
* editing/ios/EditorIOS.mm: Removed unneeded include.
* editing/mac/DictionaryLookupLegacy.mm: Removed unneeded include.
* editing/mac/EditorMac.mm:
(WebCore::Editor::dataSelectionForPasteboard): Updated since attributedString
now returns a structure.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::policyProperties): Use init instead of initWithString:@"".
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::siteForCookies): Use init instead of initWithString:@"".
2020-04-26 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com>
[PlayStation] Enable TestWTF and TestWebCore
https://bugs.webkit.org/show_bug.cgi?id=208849
Reviewed by Don Olmstead.
* PlatformPlayStation.cmake:
Add WebCore_CopySharedLibs to install dependencies.
2020-04-26 Said Abou-Hallawa <sabouhallawa@apple.com>
Rendering update steps should use Seconds for the timestamps
https://bugs.webkit.org/show_bug.cgi?id=210990
Reviewed by Daniel Bates.
Make DOMWindow::nowTimestamp() return ReducedResolutionSeconds and change
the callers accordingly. ReducedResolutionSeconds is a new type but it's
just an alias of the type Seconds. It indicates that the returned value
is a web-safe seconds.
* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::suspendAnimations):
(WebCore::DocumentTimeline::liveCurrentTime const):
(WebCore::DocumentTimeline::cacheCurrentTime):
(WebCore::DocumentTimeline::documentWillUpdateAnimationsAndSendEvents):
* animation/DocumentTimeline.h:
* animation/DocumentTimelinesController.cpp:
(WebCore::DocumentTimelinesController::updateAnimationsAndSendEvents):
* animation/DocumentTimelinesController.h:
* dom/Document.cpp:
(WebCore::Document::serviceRequestAnimationFrameCallbacks):
(WebCore::Document::updateIntersectionObservations):
* dom/Document.h:
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
(WebCore::ScriptedAnimationController::scheduleAnimation):
* dom/ScriptedAnimationController.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::getVideoPlaybackQuality):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::nowTimestamp const):
* page/DOMWindow.h:
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::nowTimestamp const):
(WebCore::IntersectionObserver::createTimestamp const): Deleted.
* page/IntersectionObserver.h:
* page/Page.cpp:
(WebCore::Page::updateRendering):
* page/Performance.cpp:
(WebCore::Performance::now const):
(WebCore::Performance::nowInReducedResolutionSeconds const):
* page/Performance.h:
* page/ReducedResolutionSeconds.h: Added.
2020-04-26 Alexey Shvayka <shvaikalesh@gmail.com>
InternalFunction::createSubclassStructure should use newTarget's globalObject
https://bugs.webkit.org/show_bug.cgi?id=202599
Reviewed by Yusuke Suzuki.
Accounts for InternalFunction::createSubclassStructure() signature change and
utilizes getFunctionRealm() helper to handle cross-realm JSBoundFunction and
ProxyObject instances as NewTarget value.
Tests: web-platform-tests/WebIDL/ecmascript-binding/constructors.html
web-platform-tests/custom-elements/htmlconstructor/newtarget.html
* bindings/js/JSDOMWrapperCache.h:
(WebCore::setSubclassStructureIfNeeded):
* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::constructJSHTMLElement):
2020-04-26 Yusuke Suzuki <ysuzuki@apple.com>
Use `static Lock` instead of `static NeverDestroyed<Lock>`
https://bugs.webkit.org/show_bug.cgi?id=211036
Reviewed by Darin Adler.
* platform/GenericTaskQueue.cpp:
(WebCore::TaskDispatcher<Timer>::sharedLock):
2020-04-26 Peng Liu <peng.liu6@apple.com>
Remove unused class PlaybackSessionInterface
https://bugs.webkit.org/show_bug.cgi?id=211031
Reviewed by Daniel Bates.
No new tests, no functional changes.
* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/PlaybackSessionInterface.h: Removed.
* platform/cocoa/PlaybackSessionModelMediaElement.h:
* platform/ios/PlaybackSessionInterfaceAVKit.h:
* platform/mac/PlaybackSessionInterfaceMac.h:
2020-04-26 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Compute and distribute extra vertical space for rows
https://bugs.webkit.org/show_bug.cgi?id=211046
Reviewed by Antti Koivisto.
When the table computed height is bigger than the sum of the row heigts, we need to distribute the extra vertical
space among the non-fixed height rows. The distribution is based on the preferred height of those non-fixed rows.
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):
2020-04-11 Darin Adler <darin@apple.com>
Stop using live ranges in functions that return range of the selection
https://bugs.webkit.org/show_bug.cgi?id=210396
Reviewed by Sam Weinig.
- Added makeRangeSelectingNode, to create a range that selects a node
and all its descendants.
- Improved intersectingNodes so it can now easily be used in a while loop
style as well as the range-for loop style. Also made it more robust
against tree changes while iterating; it will now always stop at the
end of the document.
- Changed functions that work with selection to get a SimpleRange, and
then either do all the work without a live range, or call createLiveRange
right where it's needed, making it clearer when we can delete that
call later as we cut down live ranges even more.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::selectionRange const): Return a SimpleRange
instead of a live range.
(WebCore::AccessibilityObject::findTextRanges const): Use createLiveRange
on the result of selectionRange since this still mostly uses live ranges.
* accessibility/AccessibilityObject.h: Updated for the above.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::documentBasedSelectedTextRange const):
Updated to create a live range only in the one place we need to call a
Range class member function.
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper textMarkerRangeForSelection]):
Use createLiveRange here.
* dom/SimpleRange.cpp:
(WebCore::makeRangeSelectingNode): Added. For use when we need to make
a range that selects a node, not just the node's contents.
(WebCore::firstIntersectingNode): Renamed from IntersectingNodeRange::first
since this is now used in the iterator class, not the range class. Also
letting it be a non-member function so we can tweak it without touching
the haeder file.
(WebCore::nodePastLastIntersectingNode): Ditto.
(WebCore::IntersectingNodeIterator::IntersectingNodeIterator): Changed
this constructor to take a SimpleRange. To add the advanceSkippingChildren
feature, had to build the termination condition into the iterator rather
than basing it on the value of the sentinel.
(WebCore::IntersectingNodeIterator::advance): Added. Contains the logic
from the ++ operator, so it can be called in a more straightforward way
when this is being used with a while loop rather than a range-for loop.
(WebCore::IntersectingNodeIterator::advanceSkippingChildren): Added.
* dom/SimpleRange.h: Updated for the changes to IntersectingNodeIterator
and IntersectingNodeRange.
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::timerFired): Use createLiveRange.
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::targetRanges const): Use WTFMove in
a place where the old code was copying instead.
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss):
Use intersectingNodes to make the function's logic easier to understand.
* editing/Editing.cpp:
(WebCore::visibleImageElementsInRangeWithNonLoadedImages): Changed
the argument type to SimpleRange.
* editing/Editing.h: Updated for the change above.
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::styleAtSelectionStart): Use createLiveRange.
* editing/Editor.cpp:
(WebCore::Editor::selectedRange): Use createLiveRange.
(WebCore::Editor::applyStyleToSelection): Ditto.
(WebCore::Editor::applyParagraphStyleToSelection): Ditto.
(WebCore::Editor::insertTextWithoutSendingTextEvent): Ditto.
(WebCore::Editor::insertLineBreak): Ditto.
(WebCore::Editor::insertParagraphSeparator): Ditto.
(WebCore::Editor::ignoreSpelling): Remove use of live range.
(WebCore::Editor::learnSpelling): Ditto.
(WebCore::Editor::misspelledWordAtCaretOrRange const): Ditto.
(WebCore::Editor::isSelectionUngrammatical): Ditto.
(WebCore::Editor::guessesForMisspelledOrUngrammatical): Ditto.
(WebCore::Editor::markMisspellingsAfterTypingToWord): Use createLiveRange.
(WebCore::Editor::markMisspellingsOrBadGrammar): Ditto.
(WebCore::Editor::markMisspellingsAndBadGrammar): Ditto.
(WebCore::Editor::rangeForPoint): Ditto.
(WebCore::Editor::insertTextPlaceholder): Ditto.
(WebCore::Editor::shouldChangeSelection const): Ditto.
(WebCore::Editor::findString): Ditto.
(WebCore::Editor::rangeOfString): Ditto.
(WebCore::Editor::scanSelectionForTelephoneNumbers): Ditto.
(WebCore::Editor::editorUIUpdateTimerFired): Remove use of live range.
(WebCore::candidateRangeForSelection): Deleted.
(WebCore::Editor::stringForCandidateRequest const): Use createLiveRange
and merged in the logic from candidateRangeForSelection.
(WebCore::Editor::fontForSelection const): Remove use of live range.
* editing/EditorCommand.cpp:
(WebCore::expandSelectionToGranularity): Use createLiveRange.
(WebCore::executeDeleteToMark): Ditto.
(WebCore::executeSelectToMark): Ditto.
(WebCore::valueFormatBlock): Ditto.
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::respondToNodeModification): Use createLiveRange.
(WebCore::FrameSelection::shouldDeleteSelection const): Ditto.
(WebCore::FrameSelection::getClippedVisibleTextRectangles const): Do the work
without a live range.
(WebCore::FrameSelection::expandSelectionToElementContainingCaretSelection): Ditto.
(WebCore::FrameSelection::elementRangeContainingCaretSelection const): Changed
to return a SimpleRange rather than a live range. Also removed redundant checks
and renamed locals to streamline the function.
(WebCore::FrameSelection::wordRangeContainingCaretSelection): Return a
SimpleRange instead of a live range.
(WebCore::FrameSelection::rangeByMovingCurrentSelection const): Ditto.
(WebCore::FrameSelection::rangeByExtendingCurrentSelection const): Ditto.
(WebCore::FrameSelection::rangeByAlteringCurrentSelection const): Ditto.
* editing/FrameSelection.h: Removed the toNormalizedRange function, since the
VisibleSelection class has a comment claiming most callers should not call it.
Updated forthe other changes above.
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApply): Use createLiveRange.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplacementFragment::ReplacementFragment): Ditto.
* editing/TextCheckingHelper.cpp:
(WebCore::TextCheckingHelper::TextCheckingHelper): Remove use of live range,
changing the type of m_range to SimpleRange.
(WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): Reduce use
of live range.
(WebCore::TextCheckingHelper::findFirstGrammarDetail const): Use createLiveRange.
(WebCore::TextCheckingHelper::findFirstBadGrammar const): Ditto.
(WebCore::TextCheckingHelper::isUngrammatical const): Remove use of live range.
(WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const):
Use createLiveRange.
(WebCore::TextCheckingHelper::unifiedTextCheckerEnabled const): Updated for
different interface to get the document for a SimpleRange.
* editing/TextCheckingHelper.h: Change constructor to take a SimpleRange.
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::deleteKeyPressed): Use createLiveRange.
(WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
* editing/VisibleSelection.cpp:
(WebCore::VisibleSelection::firstRange const): Return a SimpleRange.
(WebCore::VisibleSelection::toNormalizedRange const): Ditto.
* editing/VisibleSelection.h: Updated for the above.
* editing/cocoa/DictionaryLookup.mm: Removed an uneeded check of the
selection range against null. Code already guards against null endpoints.
* editing/cocoa/EditorCocoa.mm:
(WebCore::selectionAsAttributedString): Added. Uses the attributedString
function with it's new argument and return value types. There's no longer
a special function for the selection in the HTMLConverter header, so we
put it here instead.
(WebCore::Editor::writeSelectionToPasteboard): Updated to use the function
above and to deal with RetainPtr.
(WebCore::Editor::writeSelection): Ditto.
* editing/cocoa/HTMLConverter.h: Removed attributedStringFromSelection and
attributedStringBetweenStartAndEnd. Renamed attributedStringFromRange to
just attributedString and renamed editingAttributedStringFromRange to
just editingAttributedString. Also renamed IncludeImagesInAttributedString
to just IncludeImages.
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::HTMLConverter): Use a SimpleRange rther than two Position
arguments to the constructor.
(HTMLConverter::convert): Use RetainPtr for the return value and the
optional out argument.
(WebCore::attributedStringFromSelection): Deleted.
(WebCore::attributedStringBetweenStartAndEnd): Deleted.
(WebCore::attributedString): Renamed the version that takes a range and
made it take a SimpleRange, not a live range.
(WebCore::editingAttributedString): Ditto.
* editing/mac/EditorMac.mm:
(WebCore::Editor::dataSelectionForPasteboard): Updated for changes to
attributedString.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::handleBeforeTextInsertedEvent const):
Changed to not use live ranges any more.
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
Use createLiveRange.
* page/DOMSelection.cpp:
(WebCore::DOMSelection::getRangeAt): Use createLiveRange.
(WebCore::DOMSelection::addRange): Use Ditto.
(WebCore::DOMSelection::deleteFromDocument): Ditto.
* page/DragController.cpp:
(WebCore::setSelectionToDragCaret): Removed in/out argument that was
used to update a range that was never looked at afterward.
(WebCore::DragController::concludeEditDrag): Use createLiveRange.
(WebCore::DragController::draggableElement const): Ditto.
(WebCore::DragController::startDrag): Ditto.
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchMouseEvent): Use createLiveRange.
(WebCore::EventHandler::sendContextMenuEventForKey): Ditto.
(WebCore::EventHandler::didStartDrag): Remove use of live range.
* page/Page.cpp:
(WebCore::Page::findStringMatchingRanges): Use createLiveRange.
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange): Ditto.
(WebCore::TextIndicator::createWithSelectionInFrame): Ditto.
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::buildSelectionHighlight):
Use createLiveRange.
(WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight):
Use createLiveRange.
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::selectedText const): Remove use of
live range.
2020-04-26 Darin Adler <darin@apple.com>
Remove unnecessary inlining and templates for URL decomposition DOM functions
https://bugs.webkit.org/show_bug.cgi?id=211025
Reviewed by Alex Christensen.
* Headers.cmake: Renamed URLUtils.h to URLDecomposition.h.
* Modules/cache/DOMCacheStorage.cpp: Updated include and using namespace.
* Sources.txt: Added URLDecomposition.cpp.
* WebCore.xcodeproj/project.pbxproj: Added URLDecomposition.cpp and
renamed URLUtils.h to URLDecomposition.h.
* html/DOMURL.h: Removed the WEBCORE_EXPORT on this class. Added final.
Derive from URLDecomposition instead of URLUtils. Changed return type of
href to const&. Moved toJSON here from URLUtils. Added overrides of the
fullURL and setFullURL functions for URLDecomposition.
* html/DOMURL.idl: Removed ImplementationLacksVTable.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::HTMLAnchorElement): Moved initialization of
boolean data members to the class definition.
* html/HTMLAnchorElement.h: Derive from URLDecomposition instead of
URLUtils. Added overrides of the fullURL and setFullURL functions for
URLDecomposition. Initialize data members here in the class definition.
* html/HTMLMediaElement.cpp: Removed unnecessary include of DOMURL.h.
* html/URLDecomposition.cpp: Added. Contains most of the code from
the URLUtils class template, which no longer needs to be in a header.
* html/URLDecomposition.h: Renamed URLUtils.h to this. It's now an
abstract base class rather than a class template using the curiously
recurring template pattern.
* html/URLSearchParams.h: Forward-declare DOMURL rather than including
the DOMURL.h header.
* html/URLUtils.h: Removed. Renamed to URLDecompostion.h.
* page/DOMWindow.cpp: Removed unneeded include of DOMURL.h.
* testing/Internals.cpp: Added include of DOMURL.h.
2020-04-26 Cathie Chen <cathiechen@igalia.com>
fast/scrolling/scroll-behavior-invalidate-if-disabled.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=210917
Reviewed by Darin Adler.
The flaky failure is caused by reusing the CSSPropertyInfo value cached propertyInfoCache
after experimental flags changed. Add propertyInfoFromJavaScriptCSSPropertyName
to perform disabled checking after parsing. If the property is disabled, it will return
an invalid CSSPropertyInfo instead.
* css/CSSStyleDeclaration.cpp:
(WebCore::CSSStyleDeclaration::getCSSPropertyIDFromJavaScriptPropertyName):
(WebCore::CSSStyleDeclaration::namedItem):
(WebCore::CSSStyleDeclaration::setNamedItem):
2020-04-25 Ross Kirsling <ross.kirsling@sony.com>
[JSC] isCallable is redundant with isFunction
https://bugs.webkit.org/show_bug.cgi?id=211037
Reviewed by Yusuke Suzuki.
* bindings/js/JSDOMConvertScheduledAction.h:
(WebCore::Converter<IDLScheduledAction>::convert):
* worklets/PaintWorkletGlobalScope.cpp:
(WebCore::PaintWorkletGlobalScope::registerPaint):
Don't use getCallData if you don't need CallData.
2020-04-25 Alex Christensen <achristensen@webkit.org>
Build fix.
https://bugs.webkit.org/show_bug.cgi?id=210521
* Modules/applepay/ApplePaySetupFeature.mm:
2020-04-25 Alex Christensen <achristensen@webkit.org>
Move ApplePay code from WebKitAdditions to WebCore and WebKit
https://bugs.webkit.org/show_bug.cgi?id=210521
I accidentally committed an older version of the patch.
This is the diff between the two to fix the internal build.
2020-04-25 Alex Christensen <achristensen@webkit.org>
Move ApplePay code from WebKitAdditions to WebCore and WebKit
https://bugs.webkit.org/show_bug.cgi?id=210521
Reviewed by Andy Estes.
Only 4 minor modifications were necessary, as follows:
1. PaymentSetupFeatures's RetainPtr<NSArray<PKPaymentSetupFeature *>> was changed to RetainPtr<NSArray> to work with C++.
2. WebPaymentCoordinatorProxyAdditions messages were moved to WebPaymentCoordinatorProxy, removing the need for
the extra message receiver, the Optional<WebPaymentCoordinatorProxyAdditions>, and the finishConstruction.
3. WebMediaSessionManager.cpp's macros that collided with other macros were renamed. This was necessary because of different source unification.
4. PaymentSetupFeatures.h was renamed to ApplePayPaymentSetupFeatures.h to be able to build with PaymentSetupFeatures.h in the SDK.
The rest is just copy and paste.
There isn't a good way to land this without breaking the build without removing the files from WebKitAdditions at the same time,
so I'll do the two at the same time late at night to not cause disruption.
* DerivedSources.make:
* Modules/applepay/ApplePayInstallmentConfiguration.h: Added.
* Modules/applepay/ApplePayInstallmentConfiguration.idl: Added.
* Modules/applepay/ApplePayPayment.h:
* Modules/applepay/ApplePayPayment.idl:
* Modules/applepay/ApplePayPaymentMethod.h:
* Modules/applepay/ApplePayPaymentMethod.idl:
* Modules/applepay/ApplePayPaymentMethodUpdate.h:
* Modules/applepay/ApplePayPaymentMethodUpdate.idl:
* Modules/applepay/ApplePayRequestBase.cpp:
(WebCore::finishConverting):
(WebCore::requiresSupportedNetworks):
* Modules/applepay/ApplePayRequestBase.h:
* Modules/applepay/ApplePaySession.cpp:
(WebCore::finishConverting):
* Modules/applepay/ApplePaySessionPaymentRequest.h:
(WebCore::ApplePaySessionPaymentRequest::installmentConfiguration const):
(WebCore::ApplePaySessionPaymentRequest::setInstallmentConfiguration):
* Modules/applepay/ApplePaySetup.cpp: Added.
(WebCore::shouldDiscloseFeatures):
(WebCore::ApplePaySetup::getSetupFeatures):
(WebCore::ApplePaySetup::begin):
(WebCore::ApplePaySetup::ApplePaySetup):
(WebCore::ApplePaySetup::stop):
(WebCore::ApplePaySetup::suspend):
* Modules/applepay/ApplePaySetup.h: Added.
(WebCore::ApplePaySetup::create):
* Modules/applepay/ApplePaySetup.idl: Added.
* Modules/applepay/ApplePaySetupFeature.h: Added.
(WebCore::ApplePaySetupFeature::create):
(WebCore::ApplePaySetupFeature::platformFeature const):
* Modules/applepay/ApplePaySetupFeature.idl: Added.
* Modules/applepay/ApplePaySetupFeature.mm: Added.
(WebCore::ApplePaySetupFeature::type const):
(WebCore::ApplePaySetupFeature::state const):
(WebCore::ApplePaySetupFeature::supportsInstallments const):
(WebCore::ApplePaySetupFeature::ApplePaySetupFeature):
* Modules/applepay/ApplePaySetupFeatureType.h: Added.
* Modules/applepay/ApplePaySetupFeatureType.idl: Added.
* Modules/applepay/PaymentCoordinatorClient.h:
(WebCore::PaymentCoordinatorClient::getSetupFeatures):
(WebCore::PaymentCoordinatorClient::beginApplePaySetup):
(WebCore::PaymentCoordinatorClient::endApplePaySetup):
* Modules/applepay/PaymentInstallmentConfiguration.h: Added.
* Modules/applepay/PaymentInstallmentConfiguration.mm: Added.
(WebCore::toDecimalNumber):
(WebCore::platformFeatureType):
(WebCore::createPlatformConfiguration):
(WebCore::PaymentInstallmentConfiguration::PaymentInstallmentConfiguration):
(WebCore::PaymentInstallmentConfiguration::platformConfiguration const):
* Modules/applepay/PaymentMethodUpdate.h:
* Modules/applepay/cocoa/PaymentCocoa.mm:
(WebCore::finishConverting):
* Modules/applepay/cocoa/PaymentMethodCocoa.mm:
(WebCore::finishConverting):
* Modules/applepay/cocoa/PaymentMethodUpdateCocoa.mm:
(WebCore::PaymentMethodUpdate::setInstallmentGroupIdentifier):
* Modules/applepay/cocoa/PaymentSessionErrorCocoa.mm:
(WebCore::additionalError):
* Modules/applepay/paymentrequest/ApplePayRequest.idl:
* Modules/mediasession/WebMediaSessionManager.cpp:
(WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerEnabled):
(WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerState):
(WebCore::WebMediaSessionManager::mockMediaPlaybackTargetPickerDismissPopup):
(WebCore::WebMediaSessionManager::addPlaybackTargetPickerClient):
(WebCore::WebMediaSessionManager::removePlaybackTargetPickerClient):
(WebCore::WebMediaSessionManager::removeAllPlaybackTargetPickerClients):
(WebCore::WebMediaSessionManager::showPlaybackTargetPicker):
(WebCore::WebMediaSessionManager::clientStateDidChange):
(WebCore::WebMediaSessionManager::setPlaybackTarget):
(WebCore::WebMediaSessionManager::externalOutputDeviceAvailableDidChange):
(WebCore::WebMediaSessionManager::playbackTargetPickerWasDismissed):
(WebCore::WebMediaSessionManager::configurePlaybackTargetClients):
(WebCore::WebMediaSessionManager::configurePlaybackTargetMonitoring):
(WebCore::WebMediaSessionManager::configureWatchdogTimer):
(WebCore::WebMediaSessionManager::watchdogTimerFired):
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/WebCoreAdditions.mm:
2020-04-25 Simon Fraser <simon.fraser@apple.com>
Commit the scrolling tree from the main thread
https://bugs.webkit.org/show_bug.cgi?id=211026
<rdar://problem/62374855>
Reviewed by Darin Adler.
ScrollingCoordinatorMac::commitTreeStateIfNeeded() passed the new state tree to
the scrolling thread which then did the commit (which updates the scrolling tree
from the state tree). However, applyLayerPositions() immediately waited for that
commit to complete, blocking the main thread anyway.
We might as well just commit the scrolling tree on the main thread. ScrollingTree::commitTreeState()
locks m_treeMutex, so this is still safe. Lock contention with the scrolling or event dispatcher
threads should be rare; those threads are both mostly responsive.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::scrollingTreeAsText const):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::waitForScrollingTreeCommit): Deleted.
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::commitTreeState): Deleted.
(WebCore::ThreadedScrollingTree::incrementPendingCommitCount): Deleted.
(WebCore::ThreadedScrollingTree::decrementPendingCommitCount): Deleted.
(WebCore::ThreadedScrollingTree::waitForPendingCommits): Deleted.
(WebCore::ThreadedScrollingTree::waitForScrollingTreeCommit): Deleted.
(WebCore::ThreadedScrollingTree::applyLayerPositions): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::commitTreeStateIfNeeded):
* page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
(WebCore::ScrollingCoordinatorNicosia::commitTreeState):
2020-04-25 Yusuke Suzuki <ysuzuki@apple.com>
Use static initialized Lock instead of LazyNeverDestroyed<Lock>
https://bugs.webkit.org/show_bug.cgi?id=211010
Reviewed by Mark Lam.
WTF::Lock can be static-initialized, so no need to use LazyNeverDestroyed<Lock>.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::instancesMutex):
* Modules/webgpu/WebGPUPipeline.cpp:
(WebCore::WebGPUPipeline::instancesMutex):
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::instancesMutex):
* html/canvas/WebGLProgram.cpp:
(WebCore::WebGLProgram::instancesMutex):
2020-04-25 Darin Adler <darin@apple.com>
[Cocoa] Deal with another round of Xcode upgrade checks
https://bugs.webkit.org/show_bug.cgi?id=211027
Reviewed by Alexey Proskuryakov.
* WebCore.xcodeproj/project.pbxproj: Bump the upgrade check version.
2020-04-25 Alex Christensen <achristensen@webkit.org>
Prepare to remove automatic URL->String conversion operators
https://bugs.webkit.org/show_bug.cgi?id=211007
Reviewed by Darin Adler.
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::requestFromInfo):
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::urlString const):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::fetch):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::create):
* accessibility/AccessibilityImageMapLink.cpp:
(WebCore::AccessibilityImageMapLink::stringValueForMSAA const):
* bindings/IDLTypes.h:
(WebCore::IDLString::isNullValue):
* bindings/js/CachedScriptSourceProvider.h:
(WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
* bindings/js/JSDOMConvertStrings.h:
(WebCore::JSConverter<IDLDOMString>::convert):
(WebCore::Converter<IDLUSVString>::convert):
(WebCore::JSConverter<IDLUSVString>::convert):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateInWorld):
(WebCore::ScriptController::evaluateModule):
(WebCore::ScriptController::callInWorld):
(WebCore::ScriptController::executeIfJavaScriptURL):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneSerializer::write):
* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::updateCursorElement):
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::customCSSText const):
(WebCore::CSSImageValue::createDeprecatedCSSOMWrapper const):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontFaceSrcURI):
* dom/Document.cpp:
(WebCore::Document::processHttpEquiv):
* dom/ExtensionStyleSheets.cpp:
(WebCore::createExtensionsStyleSheet):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::createSheet):
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::requestModuleScript):
(WebCore::ScriptElement::executeClassicScript):
* dom/StyledElement.cpp:
(WebCore::StyledElement::styleAttributeChanged):
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::sanitizeMarkupWithArchive):
(WebCore::WebContentReader::readWebArchive):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::formAction const):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::canLoadURL const):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::shouldLoadLink):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::selectNextSourceChild):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::canLoadURL const):
* html/parser/XSSAuditor.cpp:
(WebCore::XSSAuditor::filterToken):
* inspector/InspectorAuditResourcesObject.cpp:
(WebCore::InspectorAuditResourcesObject::getResources):
* inspector/InspectorStyleSheet.cpp:
(WebCore::buildArrayForGroupings):
* inspector/NetworkResourcesData.cpp:
(WebCore::NetworkResourcesData::responseReceived):
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForCachedResource):
(WebCore::InspectorNetworkAgent::willSendRequest):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::getCookies):
(WebCore::InspectorPageAgent::searchInResources):
(WebCore::InspectorPageAgent::buildObjectForFrameTree):
* inspector/agents/InspectorWorkerAgent.cpp:
(WebCore::InspectorWorkerAgent::connectToWorkerInspectorProxy):
* inspector/agents/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::didFailLoading):
* inspector/agents/worker/ServiceWorkerAgent.cpp:
(WebCore::ServiceWorkerAgent::getInitializationInfo):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::subresources const):
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::clientRedirectDestinationForHistory const):
(WebCore::DocumentLoader::serverRedirectDestinationForHistory const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::submitForm):
(WebCore::FrameLoader::receivedFirstData):
(WebCore::FrameLoader::loadInSameDocument):
(WebCore::FrameLoader::loadedResourceFromMemoryCache):
(WebCore::createWindow):
* loader/HistoryController.cpp:
(WebCore::HistoryController::currentItemShouldBeReplaced const):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement):
(WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::preloadIfNeeded):
(WebCore::LinkLoader::prefetchIfNeeded):
* loader/MixedContentChecker.cpp:
(WebCore::MixedContentChecker::checkFormForMixedContent const):
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::shouldScheduleNavigation const):
(WebCore::NavigationScheduler::scheduleLocationChange):
* loader/PingLoader.cpp:
(WebCore::PingLoader::loadImage):
(WebCore::PingLoader::sendPing):
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::requestObject):
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::load):
* loader/appcache/ApplicationCache.cpp:
(WebCore::ApplicationCache::addResource):
(WebCore::ApplicationCache::resourceForRequest):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::selectCache):
(WebCore::ApplicationCacheGroup::finishedLoadingMainResource):
(WebCore::ApplicationCacheGroup::didFinishLoadingEntry):
(WebCore::ApplicationCacheGroup::didFailLoadingEntry):
(WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::shouldLoadResourceFromApplicationCache):
(WebCore::ApplicationCacheHost::getApplicationCacheFallbackResource):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::loadCacheGroup):
(WebCore::ApplicationCacheStorage::findOrCreateCacheGroup):
(WebCore::ApplicationCacheStorage::findInMemoryCacheGroup const):
(WebCore::ApplicationCacheStorage::cacheGroupForURL):
(WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
(WebCore::ApplicationCacheStorage::cacheGroupDestroyed):
(WebCore::ApplicationCacheStorage::cacheGroupMadeObsolete):
(WebCore::ApplicationCacheStorage::store):
(WebCore::ApplicationCacheStorage::deleteCacheForOrigin):
* loader/archive/ArchiveResourceCollection.cpp:
(WebCore::ArchiveResourceCollection::addAllResources):
(WebCore::ArchiveResourceCollection::addResource):
(WebCore::ArchiveResourceCollection::archiveResourceForURL):
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::didAddClient):
(WebCore::CachedCSSStyleSheet::checkNotify):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::cachedResource const):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::determineRevalidationPolicy const):
(WebCore::CachedResourceLoader::notifyFinished):
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::didAddClient):
(WebCore::CachedXSLStyleSheet::checkNotify):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::checkOrEnableIfNeeded const):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::setLocation):
(WebCore::DOMWindow::createWindow):
(WebCore::DOMWindow::open):
* page/Location.cpp:
(WebCore::Location::reload):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::retrieveResourcesForProperties):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::shouldIgnoreHost):
* page/SecurityPolicy.cpp:
(WebCore::SecurityPolicy::shouldInheritSecurityOriginFromOwner):
(WebCore::SecurityPolicy::isBaseURLSchemeAllowed):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation const):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
(WebCore::MediaPlayerPrivateAVFoundation::assetURL const):
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::writeBlobToFilePath):
* platform/network/mac/ResourceErrorMac.mm:
(WebCore::ResourceError::platformLazyInit):
* storage/StorageEventDispatcher.cpp:
(WebCore::StorageEventDispatcher::dispatchSessionStorageEvents):
(WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
* svg/SVGImageLoader.cpp:
(WebCore::SVGImageLoader::sourceURI const):
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::scope const):
* workers/service/ServiceWorkerRegistrationKey.cpp:
(WebCore::ServiceWorkerRegistrationKey::hash const):
(WebCore::ServiceWorkerRegistrationKey::isMatching const):
* workers/service/context/ServiceWorkerDebuggable.cpp:
(WebCore::ServiceWorkerDebuggable::ServiceWorkerDebuggable):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::startScriptFetch):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::send):
2020-04-25 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Add vertical-align: baseline support
https://bugs.webkit.org/show_bug.cgi?id=211024
Reviewed by Antti Koivisto.
Adjust the padding with the baseline offset when the cell is baseline aligned (as opposed to the initial value of 'middle').
Test: fast/layoutformattingcontext/table-basic-row-vertical-align-baseline.html
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::Cell::setBaselineOffset):
(WebCore::Layout::TableGrid::Cell::baselineOffset const):
2020-04-25 Darin Adler <darin@apple.com>
Move URL to use StringView when returning substrings of the URL
https://bugs.webkit.org/show_bug.cgi?id=210431
Reviewed by Anders Carlsson.
* Modules/cache/DOMCacheEngine.cpp:
(WebCore::DOMCacheEngine::matchURLs): Removed unneeded calls to hasQuery.
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::initializeWith): Use hasCredentials.
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::redirect): Use hasCredentials.
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::isValidURLBasedPaymentMethodIdentifier): Use hasCredentials.
* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::createYouTubeURL): Take StringView.
(WebCore::queryKeysAndValues): Take StringView.
(WebCore::processAndCreateYouTubeURL): Use auto since URL pieces are
now returned as StringView.
(WebCore::YouTubePluginReplacement::youTubeURLFromAbsoluteURL):
Use StringView and makeString rather than StringBuilder.
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::resourceName): Use queryWithLeadingQuestionMark.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::internalLinkElement const):
Use StringView.
* dom/Document.cpp:
(WebCore::Document::setURL): Use setHostAndPort.
* dom/Element.cpp:
(WebCore::Element::findAnchorElementForLink): Update since
fragmentIdentifier returns StringView.
* dom/TreeScope.cpp: Added a comment.
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::replaceRichContentWithAttachments): Update since
lastPathComponent returns a StringView. Also got rid of some strange
use of AtomString that was not necessary and used WTFMove more.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::writeImageToPasteboard): Update since
lastPathComponent returns a StringView.
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::attachmentTitleForDisplay const):
Use makeString instead of StringBuilder, and StringView instead of
String for name and extension values.
* html/HTMLPlugInElement.cpp:
(WebCore::pluginReplacementForType): Update since lastPathComponent
returns a StringView.
* html/MediaFragmentURIParser.cpp:
(WebCore::MediaFragmentURIParser::parseFragments): Update since
fragmentIdentifier returns a StringView.
* html/URLUtils.h: Changed many functions to take a StringView, changed
various other functions to call toString, since the underlying URL
function now returns a StringView. Updated names since "pass" is now
"password".
(WebCore::countASCIIDigits): Added. Replaces unusual function
named parsePortFromStringPosition because we can use StringView now
and so don't need such an unusual function.
* loader/AdClickAttribution.cpp:
(WebCore::AdClickAttribution::parseConversionRequest): Use hasCredentials.
Also removed unnecessary use of ASCIILiteral that hurts performance
a tiny bit.
(WebCore::AdClickAttribution::urlForTesting const): Use makeString
instead of StringBuilder.
* loader/CrossOriginAccessControl.cpp:
(WebCore::validateCrossOriginRedirectionURL): Use hasCredentials.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest): Use hasCredentials.
* loader/FormSubmission.cpp:
(WebCore::appendMailtoPostFormDataToURL): Update since query returns
StringView.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadInSameDocument): Use equalRespectingNullity on
fragment identifiers to preserve behavior, since at this time
StringView == StringView does not respect nullity, but String == String does.
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::createFileURL): Use fileURLWithFileSystemPath.
* loader/appcache/ManifestParser.cpp:
(WebCore::manifestPath): Return a StringView.
(WebCore::parseManifest): Use StringView.
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::calculateItemInCollection const): Update since
fragmentIdentifer returns a StringView.
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::splitFragmentIdentifierFromRequestURL): Ditto.
* page/FrameView.cpp:
(WebCore::FrameView::scrollToFragment): Ditto.
(WebCore::FrameView::scrollToFragmentInternal): Updated log message.
* page/History.cpp:
(WebCore::History::stateObjectAdded): Updated for URL::password name change
and to use the new stringWithoutQueryOrFragmentIdentifier rather than the
old equalIgnoringQueryAndFragment.
* page/Location.cpp:
(WebCore::Location::href const): Use removeCredentials.
(WebCore::Location::port const): Streamlined.
(WebCore::Location::pathname const): Use an ASCIILiteral.
(WebCore::Location::search const): Use queryWithLeadingQuestionMark.
(WebCore::Location::hash const): Use fragmentIdentifierWithLeadingNumberSign.
(WebCore::Location::setPort): Use parseUInt16.
* page/UserContentURLPattern.cpp: Coding style tweaks.
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary):
Use contains instead of reverseFind to check for a period in the filename.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::load): Updated since lastPathComponent is a StringView.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::convertToInternalProtocol): Updated to use makeString since
setProtocol takes a StringView.
* platform/network/ResourceHandleInternal.h: Renamed m_pass to m_password
and call password instead of pass.
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::removeCredentials): Use removeCredentials.
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createCFURLConnection): Updated for m_password
name change.
(WebCore::ResourceHandle::willSendRequest): Updated for m_password and
password name changes.
(WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication): Ditto.
* platform/network/curl/CurlProxySettings.cpp:
(WebCore::CurlProxySettings::setUserPass): Updated for setPassword name change.
(WebCore::createProxyUrl): Use hasCredentials, updated for password name change.
* platform/network/curl/CurlProxySettings.h:
(WebCore::CurlProxySettings::password const): Updated for password name change.
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Updated for
m_password name change.
(WebCore::ResourceHandle::getCredential): Ditto.
(WebCore::ResourceHandle::willSendRequest): Updated for m_password and
password name changes.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::createNSURLConnection): Updated for m_password
and setPassword name changes.
(WebCore::ResourceHandle::willSendRequest): Ditto.
(WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication): Ditto.
* platform/network/soup/ResourceRequestSoup.cpp:
(WebCore::ResourceRequest::createSoupURI const): Updated for password name change.
* platform/network/soup/URLSoup.cpp:
(WebCore::soupURIToURL): Updated for setPassword name change.
* platform/win/PasteboardWin.cpp:
(WebCore::writeURL): Updated since lastPathComponent returns a StringView.
(WebCore::filesystemPathFromUrlOrTitle): Ditto.
(WebCore::Pasteboard::write): Ditto.
* style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::createFilterOperations): Updated since
fragmentIdentifier returns a StringView.
* workers/WorkerLocation.cpp:
(WebCore::WorkerLocation::port const): Streamlined.
(WebCore::WorkerLocation::pathname const): Use an ASCIILiteral.
(WebCore::WorkerLocation::search const): Use queryWithLeadingQuestionMark.
(WebCore::WorkerLocation::hash const): Use fragmentIdentifierWithLeadingNumberSign.
* workers/service/ServiceWorkerRegistrationKey.cpp:
(WebCore::ServiceWorkerRegistrationKey::ServiceWorkerRegistrationKey):
Updated for hasFragmentIdentifier name change.
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::topOriginURL): Simplified code to set port.
* workers/service/server/SWServer.cpp:
(WebCore::originURL): Ditto.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::open): Updated for setPassword name change.
2020-04-25 Chris Fleizach <cfleizach@apple.com>
AX: Improve tracking of Element* pointers in AXObjectCache with WeakHashSet
https://bugs.webkit.org/show_bug.cgi?id=210879
Reviewed by Daniel Bates.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::handleFocusedUIElementChanged):
(WebCore::filterListForRemoval):
(WebCore::AXObjectCache::performDeferredCacheUpdate):
* accessibility/AXObjectCache.h:
2020-04-25 Antoine Quint <graouts@apple.com>
[Web Animations] KeyframeEffect should ensure its target remains alive
https://bugs.webkit.org/show_bug.cgi?id=211019
Reviewed by Daniel Bates.
Test: webanimations/keyframe-effect-target-kept-alive.html
Make KeyframeEffect::m_target a RefPtr so that assigning an element to effect.target guarantees that element
is kept alive even if there are no other references to that element.
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::KeyframeEffect):
(WebCore::KeyframeEffect::setTarget):
* animation/KeyframeEffect.h:
2020-04-25 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Cleanup TableFormattingContext::layoutInFlowContent
https://bugs.webkit.org/show_bug.cgi?id=211023
Reviewed by Sam Weinig.
Move some code to dedicated functions.
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutInFlowContent):
(WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):
(WebCore::Layout::TableFormattingContext::setUsedGeometryForRows):
(WebCore::Layout::TableFormattingContext::setUsedGeometryForSections):
(WebCore::Layout::TableFormattingContext::layoutCell):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):
(WebCore::Layout::TableFormattingContext::initializeDisplayBoxToBlank const): Deleted.
(WebCore::Layout::TableFormattingContext::setComputedGeometryForRows): Deleted.
(WebCore::Layout::TableFormattingContext::setComputedGeometryForSections): Deleted.
* layout/tableformatting/TableFormattingContext.h:
* layout/tableformatting/TableFormattingContextGeometry.cpp:
(WebCore::Layout::TableFormattingContext::Geometry::cellHeigh const):
(WebCore::Layout::TableFormattingContext::Geometry::computedColumnWidth const):
(WebCore::Layout::TableFormattingContext::Geometry::tableCellHeightAndMargin const): Deleted.
2020-04-25 Joonghun Park <jh718.park@samsung.com>
Unreviewed. Remove the build warning below since r260247.
warning: unused parameter ‘foo’ [-Wunused-parameter]
No new tests, no new behaviors.
* testing/Internals.cpp:
(WebCore::Internals::hasSandboxIOKitOpenAccessToClass):
2020-04-24 Chris Dumez <cdumez@apple.com>
[iOS] Unable to sign up on twitter.com
https://bugs.webkit.org/show_bug.cgi?id=211003
<rdar://problem/58804852>
Reviewed by Darin Adler.
This is similar to the bug we had on nytimes.com and that was fixed in
r258767. However, instead of a 'resize' event, it is a 'change' event
on a MediaQueryList that is getting twitter.com in a bad state.
The issue is that when we home out of Safari, SpringBoard takes does
a snapshot sequence at various sizes / orientations and this causes
many JS events to get fired (e.g. 'resize', 'orientationchange',
'change', ...), which can get some sites in a bad state. To address
the issue, we now prevent firing of ALL JS events during the
SpringBoard snapshot, instead of merely preventing the 'resize' ones.
* dom/EventTarget.cpp:
(WebCore::EventTarget::fireEventListeners):
* page/FrameView.cpp:
(WebCore::FrameView::sendResizeEventIfNeeded):
* page/Page.h:
(WebCore::Page::shouldFireEvents const):
(WebCore::Page::setShouldFireEvents):
(WebCore::Page::shouldFireResizeEvents const): Deleted.
(WebCore::Page::setShouldFireResizeEvents): Deleted.
2020-04-24 Saam Barati <sbarati@apple.com>
Return BigInt32 whenever we can
https://bugs.webkit.org/show_bug.cgi?id=210922
Reviewed by Yusuke Suzuki.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readBigInt):
2020-04-24 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] allThreads registration is racy with allThreads unregistration
https://bugs.webkit.org/show_bug.cgi?id=210995
<rdar://problem/61609690>
Reviewed by Keith Miller.
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::ResourceUsageThread::platformCollectCPUData):
2020-04-24 Wenson Hsieh <wenson_hsieh@apple.com>
Make some more adjustments to TextManipulationController's paragraph boundary heuristic
https://bugs.webkit.org/show_bug.cgi?id=210993
<rdar://problem/61571299>
Reviewed by Tim Horton.
Adjust the heuristic added in r260583 to account for a few more common scenarios where we currently consider
text as a part of the same paragraph. This can lead to many issues during text manipulation where text is moved
between these elements, when it should not be.
The new scenarios include block and inline-block links, as well as button elements.
Test: TextManipulation.StartTextManipulationTreatsInlineBlockLinksAndButtonsAsParagraphs
* editing/TextManipulationController.cpp:
(WebCore::TextManipulationController::observeParagraphs):
Additionally rename "paragraph boundary element" to "item boundary element", to avoid colliding with the
existing notion of paragraph boundaries in editing code.
2020-04-24 Christopher Reid <chris.reid@sony.com>
[Win] Bundle Inspector Resources in Release builds
https://bugs.webkit.org/show_bug.cgi?id=210942
Reviewed by Fujii Hironori.
* CMakeLists.txt:
2020-04-24 Antoine Quint <graouts@apple.com>
[Web Animations] Ensure calling Web Animations APIs override future CSS Animations style properties
https://bugs.webkit.org/show_bug.cgi?id=210988
Reviewed by Dean Jackson.
The CSS Animations Level 2 spec specifies how the Web Animations APIs and the CSS Animations style
properties should interact in https://drafts.csswg.org/css-animations-2/#animations. This patch
implements the specified behavior and this is reflected by progress on the relevant WPT tests.
The gist of this change is that once a Web Animations API is called on an animation created using
CSS Animations, any changes made to related CSS Animations style properties on the target element
will be ignored so that the overrides applied via the Web Animations API remain in effect.
For instance, calling pause() or play() in a way that changes the playback state of the CSS Animation
will mean that future changes to the CSS animation-play-state property are ignored.
To do this we make more IDL properties and methods use dedicated methods to distinguish between the
bindings entry-point and internal usage of the same methods to integrate the behavior only when the
API itself is being used.
* animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::getBindingsTiming const): Ensure we flush styles when animation.effect.getTiming()
is called.
(WebCore::AnimationEffect::getBindingsComputedTiming const): Ensure we flush styles when
animation.effect.getComputedTiming() is called.
(WebCore::AnimationEffect::bindingsUpdateTiming): Notify the associated CSSAnimation object, if any, when
animation.effect.updateTiming() is called such that the CSSAnimation may apply the relevant overrides.
* animation/AnimationEffect.h:
* animation/AnimationEffect.idl:
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::syncPropertiesWithBackingAnimation): Only apply new values of CSS Animations style
properties if there are no overrides for them resulting from calling related Web Animations APIs.
(WebCore::CSSAnimation::bindingsPlay): Mark animation-play-state as overridden if play() is called.
(WebCore::CSSAnimation::bindingsPause): Mark animation-play-state as overridden if pause() is called.
(WebCore::CSSAnimation::setBindingsEffect): Mark all animation style properties, except for animation-name
and animation-play-state as overridden if animation.effect is set.
(WebCore::CSSAnimation::setBindingsStartTime): Mark animation-play-state as overridden if animation.startTime
is set.
(WebCore::CSSAnimation::bindingsReverse): Mark animation-play-state as overridden if reverse() is called.
(WebCore::CSSAnimation::effectTimingWasUpdatedUsingBindings): Mark each CSS property associated with a key
found on the timing object passed to animation.effect.updateTiming() as overridden.
(WebCore::CSSAnimation::effectKeyframesWereSetUsingBindings): Mark animation-timing-function as overridden
if animation.effect.setKeyframes() is called.
* animation/CSSAnimation.h:
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::bindingsStartTime const):
(WebCore::DeclarativeAnimation::setBindingsStartTime):
(WebCore::DeclarativeAnimation::startTime const): Deleted.
(WebCore::DeclarativeAnimation::setStartTime): Deleted.
* animation/DeclarativeAnimation.h:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::getBindingsKeyframes): Ensure we flush styles when animation.effect.getKeyframes()
is called.
(WebCore::KeyframeEffect::getKeyframes): Only use the CSS-originated animation path if we don't have JS-originated
keyframes.
(WebCore::KeyframeEffect::setBindingsKeyframes): Notify the associated CSSAnimation object, if any, when
animation.effect.setKeyframes() is called such that the CSSAnimation may apply the relevant overrides.
(WebCore::KeyframeEffect::processKeyframes): Correctly return early if part of the processing yields an exception.
* animation/KeyframeEffect.h:
* animation/KeyframeEffect.idl:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setBindingsEffect):
(WebCore::WebAnimation::setBindingsStartTime):
(WebCore::WebAnimation::bindingsReverse):
* animation/WebAnimation.h:
(WebCore::WebAnimation::bindingsEffect const):
(WebCore::WebAnimation::bindingsStartTime const):
* animation/WebAnimation.idl:
2020-04-24 Chris Dumez <cdumez@apple.com>
ASSERTION FAILED: m_wrapper under HTMLMediaElement::setIsPlayingToWirelessTarget
https://bugs.webkit.org/show_bug.cgi?id=210983
<rdar://problem/61611994>
Reviewed by Eric Carlson.
The issue was that we were trying to fire a JS event as a result of ActiveDOMObject::stop()
getting called, which is not allowed. To address the issue, we avoid firing the event if
the context is already stopped.
No new tests, already covered by:
media/modern-media-controls/placard-support/placard-support-airplay-fullscreen.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setIsPlayingToWirelessTarget):
2020-04-24 Tim Horton <timothy_horton@apple.com>
iPad: "Pocket City" interaction does not work with trackpad
https://bugs.webkit.org/show_bug.cgi?id=210985
<rdar://problem/62273077>
Reviewed by Wenson Hsieh.
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isPocketCity):
2020-04-24 Tomoki Imai <Tomoki.Imai@sony.com>
[OpenSSL] Implement WebCrypto APIs for HMAC
https://bugs.webkit.org/show_bug.cgi?id=210902
Reviewed by Don Olmstead.
Support WebCrypto HMAC sign/verify with OpenSSL.
The design and some functions are inherited from the other ports.
* crypto/openssl/CryptoAlgorithmHMACOpenSSL.cpp:
(WebCore::HMACAlgorithm): Added. Helper function to map CryptoAlgorithmIdentifier to OpenSSL EVP_MD type.
(WebCore::calculateSignature): Added. Helper function to calculate the signature for sign/verify.
(WebCore::CryptoAlgorithmHMAC::platformSign): Implemented, mostly same as the other ports.
(WebCore::CryptoAlgorithmHMAC::platformVerify): Implemented, mostly same as the other ports.
* crypto/openssl/CryptoAlgorithmRegistryOpenSSL.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): Added CryptoAlgorithmHMAC support.
* crypto/openssl/OpenSSLCryptoUniquePtr.h: Added specialized unique_ptrs for EVP_MD_CTX and EVP_PKEY.
(WebCore::OpenSSLCryptoPtrDeleter<EVP_MD_CTX>::operator() const):
(WebCore::OpenSSLCryptoPtrDeleter<EVP_PKEY>::operator() const):
2020-04-24 Brian Burg <bburg@apple.com>
Web Automation: timeout underneath Automation.evaluateJavaScriptFunction in Selenium test frame_switching_tests.py::testShouldNotBeAbleToDoAnythingTheFrameIsDeletedFromUnderUs[Safari]
https://bugs.webkit.org/show_bug.cgi?id=210162
<rdar://problem/60561009>
Reviewed by Devin Rousso.
* page/DOMWindow.h: Expose DOMWindow::{register, unregister}Observer.
2020-04-24 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Take first in-flow table-row baseline into account when computing cell baseline
https://bugs.webkit.org/show_bug.cgi?id=210972
Reviewed by Antti Koivisto.
Check if the cell has a nested table and use its first row as the baseline for the cell (unless there's an IFC before).
Test: fast/layoutformattingcontext/table-basic-row-baseline-with-nested-table.html
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutCell):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):
* layout/tableformatting/TableFormattingContext.h:
* layout/tableformatting/TableFormattingContextGeometry.cpp:
(WebCore::Layout::TableFormattingContext::Geometry::usedBaselineForCell):
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::Row::setBaselineOffset):
(WebCore::Layout::TableGrid::Row::baselineOffset const):
2020-04-24 Antti Koivisto <antti@apple.com>
Nullptr crash in objc_msgSend under WebCore::genericFamily
https://bugs.webkit.org/show_bug.cgi?id=210911
<rdar://problem/61510208>
Reviewed by Geoffrey Garen.
Speculative fix.
* platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::genericFamily):
Test that CTFontDescriptorCopyAttribute is really returning CFStringRef.
Also explicitly return String from lambda to clarify lifetimes.
2020-04-24 Simon Fraser <simon.fraser@apple.com>
Move some post-renderingUpdate code into WebCore
https://bugs.webkit.org/show_bug.cgi?id=210952
Reviewed by Antti Koivisto.
Factor some code called by the various DrawingArea subclasses into Page::finalizeRenderingUpdate(),
with some flags to control behavior that differs between drawing areas.
ScrollingCoordinator::commitTreeStateIfNeeded() is a no-op for RemoteScrollingCoordinator so
it's fine to always call it.
* page/Page.cpp:
(WebCore::Page::passiveTouchEventListenerRectsForTesting):
(WebCore::Page::finalizeRenderingUpdate):
* page/Page.h:
2020-04-24 Adrian Perez de Castro <aperez@igalia.com>
Add missing HTMLNames:: namespace prefix to usage of liTag object
Unreviewed build fix.
No new tests needed.
* editing/TextManipulationController.cpp:
(WebCore::TextManipulationController::observeParagraphs):
2020-04-23 Rob Buis <rbuis@igalia.com>
Make CachedResourceLoader more conforming to Fetch specification
https://bugs.webkit.org/show_bug.cgi?id=210925
Reviewed by Alex Christensen.
Make CachedResourceLoader more conforming to Fetch specification
by fixing links, re-ordering steps to match main fetch [1] and do
early exit code paths earlier.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestImage): adjust to parameter change.
(WebCore::CachedResourceLoader::canRequest): replace CachedResourceRequest param with ResourceLoaderOptions.
(WebCore::CachedResourceLoader::prepareFetch): fix comment.
(WebCore::CachedResourceLoader::requestResource): re-order.
* loader/cache/CachedResourceLoader.h:
2020-04-23 Simon Fraser <simon.fraser@apple.com>
Move the storage of DisplayID from Chrome to Page
https://bugs.webkit.org/show_bug.cgi?id=210943
Reviewed by Tim Horton.
The less Chrome knows about Frames and Documents the better. At some point Page is going
to talk to ScrollingCoordinator in this callback too.
* page/Chrome.cpp:
(WebCore::Chrome::displayID const):
(WebCore::Chrome::windowScreenDidChange):
* page/Chrome.h:
* page/Page.cpp:
(WebCore::Page::windowScreenDidChange):
* page/Page.h:
(WebCore::Page::displayID const):
2020-04-23 Simon Fraser <simon.fraser@apple.com>
EventHandler::selectCursor() has broken resize over coordinate conversion code
https://bugs.webkit.org/show_bug.cgi?id=210778
Reviewed by Zalan Bujtas.
EventHandler::selectCursor() appeared to make a local hit-test point from window
to content coordinates, which made no sense, but this happened to work because
RenderLayer::hitTestLayer() set the HitTestResult localPoint to a global point
if you hit the resizer.
Clean up this mess by having all resizer-related geometry queries be in local coordinates.
As a bonus, actually set the cursor to a resize cursor when over the resizer.
Test: fast/events/cursors/mouse-cursor-over-resizer.html
* page/EventHandler.cpp:
(WebCore::EventHandler::selectCursor):
(WebCore::EventHandler::handleMousePressEvent):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::resize):
(WebCore::RenderLayer::offsetFromResizeCorner const):
(WebCore::RenderLayer::isPointInResizeControl const):
(WebCore::RenderLayer::hitTestLayer):
(WebCore::RenderLayer::hitTestResizerInFragments const):
* rendering/RenderLayer.h:
2020-04-23 Wenson Hsieh <wenson_hsieh@apple.com>
Text manipulation does not account for text in fully clipped containers
https://bugs.webkit.org/show_bug.cgi?id=210940
<rdar://problem/61137648>
Reviewed by Tim Horton.
Allow text manipulation to find both text in `visibility: hidden;` containers, as well as text in fully clipped
overflow containers. In both cases, renderers exist for these nodes, but TextIterator ignores them by default.
If these containers become visible in the future, we don't want to skip out on performing text manipulation on
them.
An alternative would be to detect when any element that has not undergone text manipulation has become visible
(i.e. no longer clipped by an ancestor), but this is likely more complicated (and possibly less performant) than
just eagerly extracting text from hidden containers, once they gain renderers.
TextManipulation.StartTextManipulationIncludesFullyClippedText
* editing/TextManipulationController.cpp:
(WebCore::ParagraphContentIterator::ParagraphContentIterator):
(WebCore::TextManipulationController::didCreateRendererForElement):
(WebCore::TextManipulationController::scheduleObservationUpdate):
(WebCore::TextManipulationController::scheduleObservartionUpdate): Deleted.
While I'm here, also rename scheduleObservartionUpdate to scheduleObservationUpdate.
* editing/TextManipulationController.h:
2020-04-23 Alex Christensen <achristensen@webkit.org>
Allow credentials for same-origin css mask images
https://bugs.webkit.org/show_bug.cgi?id=210895
<rdar://problem/60093888>
Reviewed by Brent Fulgham.
Test: http/tests/security/css-mask-image-credentials.html
r230006 went a step too far in restricting what is allowed with css mask images.
Basic authentication credentials should be allowed with such requests as they are in Chrome and Firefox.
This can be seen by doing run-webkit-httpd then opening http://127.0.0.1:8000/security/css-mask-image-credentials.html
In Chrome and Firefox you'll see it forward to a page that has a blue square.
In Safari before this change you'll see a yellow square and a basic authentication prompt.
In Safari after this change you'll see the same blue square you see in Chrome and Firefox.
* style/StylePendingResources.cpp:
(WebCore::Style::loadPendingImage):
2020-04-23 Alex Christensen <achristensen@webkit.org>
Jesus Calling app needs more WebSQL
https://bugs.webkit.org/show_bug.cgi?id=210889
<rdar://problem/61795507>
Reviewed by Chris Dumez.
Manually verified this fixes the issue in the radar.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowInstanceFunctionOpenDatabaseBody):
2020-04-23 Rob Buis <rbuis@igalia.com>
Move applyUserAgentIfNeeded calls to a more central place
https://bugs.webkit.org/show_bug.cgi?id=209587
Reviewed by Darin Adler.
Make main resource loads stop calling applyUserAgentIfNeeded
and instead do it in the CachedResourceLoader.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::addExtraFieldsToRequest):
(WebCore::FrameLoader::loadResourceSynchronously):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::createRequest):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
(WebCore::CachedResourceLoader::requestResource):
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::updateReferrerAndOriginHeaders):
(WebCore::CachedResourceRequest::updateUserAgentHeader):
(WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders): Deleted.
* loader/cache/CachedResourceRequest.h:
2020-04-23 Kenneth Russell <kbr@chromium.org>
[WebGL2] Update texture packing code for software uploads from DOM
https://bugs.webkit.org/show_bug.cgi?id=209515
Reviewed by Dean Jackson.
Update the bottommost DOM-to-texture packing code in
GraphicsContextGLOpenGL and FormatConverter to full WebGL 2.0
capability. Reorganize some code to make side-by-side comparisons
easier with other WebGL 2.0 implementations.
Added NEEDS_PORT comments to areas in the calling code which need
particular attention in subsequent patches. Roughly two more
patches will be needed on top of this one in order to fully pass
the associated conformance tests.
Fix a bug in the non-ANGLE ENABLE(WEBGL2) code path which
accidentally disabled WebGL entirely in this configuration.
Covered by the WebGL 2.0 conformance tests.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
(WebCore::WebGLRenderingContextBase::readPixels):
(WebCore::WebGLRenderingContextBase::texImageSource2D):
(WebCore::WebGLRenderingContextBase::texImage2DImpl):
(WebCore::WebGLRenderingContextBase::texImage2D):
(WebCore::WebGLRenderingContextBase::texSubImage2DImpl):
(WebCore::WebGLRenderingContextBase::texSubImage2D):
(WebCore::WebGLRenderingContextBase::validateTexFuncData):
(WebCore::WebGLRenderingContextBase::getPackPixelStoreParams const):
(WebCore::WebGLRenderingContextBase::getUnpackPixelStoreParams const):
* html/canvas/WebGLRenderingContextBase.h:
* platform/graphics/FormatConverter.cpp:
(WebCore::convertFloatToHalfFloat):
(WebCore::float>):
(WebCore::uint8_t>):
(WebCore::uint16_t>):
(WebCore::int8_t>):
(WebCore::int16_t>):
(WebCore::uint32_t>):
(WebCore::int32_t>):
(WebCore::FormatConverter::convert):
* platform/graphics/FormatConverter.h:
(WebCore::FormatConverter::FormatConverter):
* platform/graphics/GraphicsContextGL.h:
(WebCore::GraphicsContextGL::hasAlpha):
(WebCore::GraphicsContextGL::hasColor):
* platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:
(WebCore::GraphicsContextGLOpenGL::texImage2DResourceSafe):
(WebCore::GraphicsContextGLOpenGL::computeFormatAndTypeParameters):
(WebCore::GraphicsContextGLOpenGL::computeImageSizeInBytes):
(WebCore::GraphicsContextGLOpenGL::PixelStoreParams::PixelStoreParams):
(WebCore::GraphicsContextGLOpenGL::packImageData):
(WebCore::GraphicsContextGLOpenGL::extractImageData):
(WebCore::GraphicsContextGLOpenGL::extractTextureData):
(WebCore::TexelBytesForFormat):
(WebCore::GraphicsContextGLOpenGL::packPixels):
* platform/graphics/opengl/GraphicsContextGLOpenGL.h:
2020-04-23 Wenson Hsieh <wenson_hsieh@apple.com>
Add a heuristic for text manipulation to treat some list items as paragraph boundaries
https://bugs.webkit.org/show_bug.cgi?id=210915
<rdar://problem/61907080>
Reviewed by Megan Gardner.
Adds a mechanism to allow text manipulation to emit an item containing the current list of text manipulation
tokens early, in the case where the paragraph content iterator crosses the boundary of an element that encloses
a paragraph. Currently, the only enclosing paragraph element will be list items that have `display: block;`,
which we can take as a hint that the text in these list items should be vended as separate items, rather than as
tokens in a single item.
This may be extended in the future to other situations by adjusting logic in `isEnclosingParagraphElement`.
Test: TextManipulation.StartTextManipulationBreaksParagraphInBetweenListItems
* editing/TextManipulationController.cpp:
(WebCore::TextManipulationController::observeParagraphs):
2020-04-23 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Add support for basic baseline align inside a table row
https://bugs.webkit.org/show_bug.cgi?id=210918
Reviewed by Antti Koivisto.
Test: fast/layoutformattingcontext/table-basic-row-baseline-align.html
The minimum height of a row is defined as the height of an hypothetical linebox containing
the cells originating in the row. In this hypothetical linebox, we use baseline alignment to
align the cells vertically.
Use these vertically aligned cells to compute the final row height.
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::verticalMarginBorderAndPadding const):
(WebCore::Display::Box::setVerticalPadding):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutInFlowContent):
(WebCore::Layout::TableFormattingContext::layoutCell):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):
* layout/tableformatting/TableFormattingContext.h:
2020-04-23 Sihui Liu <sihui_liu@apple.com>
TextManipulationController should set range of paragraph using token's positions
https://bugs.webkit.org/show_bug.cgi?id=210866
<rdar://problem/60646283>
Reviewed by Wenson Hsieh.
Set the range of paragraph using positions of first token and last token in the paragraph because:
1. Accurate range makes token matching in TextManipulationController::replace() easier, as TextIterator could
visit different positions with different ranges or different conditions. For example, in our previous
implementation, start of a paragraph can be set as the first visible position of document, while position of
first token is after that. Then in replace(), TextManipulationController may extract a word before the position
of first token and return error. See added test TextManipulation.CompleteTextManipulationCorrectParagraphRange.
2. TextManipulationController can handle fewer content and this is less error-prone. For example, svg elements
before/after the paragraph text will not be identified as tokens [] in a paragraph now. See updated API tests
for example.
New test: TextManipulation.CompleteTextManipulationCorrectParagraphRange
* editing/TextManipulationController.cpp:
(WebCore::ParagraphContentIterator::moveCurrentNodeForward): m_currentNodeForFindingInvisibleContent should not
be advanced if it is already at the end.
(WebCore::containsOnlyHTMLSpaces):
(WebCore::TextManipulationController::observeParagraphs):Set the paragraph start as the position of the first
token and end as the position of last token. If the paragraph is split with <br>, the end will be extended to
position of <br> so that we can add this node back later; otherwise, <br> can be removed after original
text of paragraph is removed in TextManipulationController::replace(). Also, stop identifying spaces as tokens
because non-text Node can emit spaces.
(WebCore::TextManipulationController::replace): Only identify tokens from content with meaningful text.
2020-04-23 Chris Dumez <cdumez@apple.com>
[ Mac wk2 ] imported/w3c/web-platform-tests/notifications/event-onclose.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=209483
<rdar://problem/60830377>
Reviewed by Geoff Garen.
Align garbage collection of Notification JS wrapper with the specification:
- https://notifications.spec.whatwg.org/#garbage-collection [1]
In particular, the following changes were made:
1. Instead of using the legacy setPendingActivity() / unsetPendingActivity(), override
ActiveDOMObject::virtualHasPendingActivity() to implement the behavior documented
in the specification.
2. Keep the wrapper alive as long as the notification is showing and as long as there
are relevant event listeners, as per [1]. Previously, we failed to check for event
listeners, which was suboptimal.
3. Update the constructor to queue a task on the event loop in order to show the
notification asynchronously, instead of relying on a SuspendableTimer for this
purpose. Previously, the JS wrapper could get collected between construction and
the notification getting shown, which was leading to the test flakiness.
No new tests, unskipped existing test.
* Modules/notifications/Notification.cpp:
(WebCore::Notification::Notification):
(WebCore::Notification::show):
(WebCore::Notification::finalize):
(WebCore::Notification::dispatchShowEvent):
(WebCore::Notification::dispatchClickEvent):
(WebCore::Notification::dispatchCloseEvent):
(WebCore::Notification::dispatchErrorEvent):
(WebCore::Notification::eventListenersDidChange):
(WebCore::Notification::virtualHasPendingActivity const):
* Modules/notifications/Notification.h:
2020-04-23 Andres Gonzalez <andresg_22@apple.com>
Correction for patch 397001.
https://bugs.webkit.org/show_bug.cgi?id=210914
Reviewed by Chris Fleizach.
- No need to check for isEmpty when retrieving the primary screen size,
as pointed out by Darin Adler in bug 210760, patch 397001.
- Added some helpful AXLOGing.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper primaryScreenHeight]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
(-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]):
2020-04-23 Don Olmstead <don.olmstead@sony.com>
[CMake] Add WebKit::WebCoreTestSupport target
https://bugs.webkit.org/show_bug.cgi?id=210867
Unreviewed build fix.
Make the dependencies explicit.
* CMakeLists.txt:
2020-04-22 Simon Fraser <simon.fraser@apple.com>
In the scrolling tree, separate wheel event handling from layer updating
https://bugs.webkit.org/show_bug.cgi?id=210899
Reviewed by Antti Koivisto.
Working towards webkit.org/b/210884, it needs to be possible to have the scrolling
tree handle a wheelEvent and update its internal state about scroll positions, but not
immediately map those scroll positions onto CALayers.
To achieve this, have ScrollingTreeScrollingNode::currentScrollPositionChanged()
not call applyLayerPositions(), or notifyRelatedNodesAfterScrollPositionChange() which
just applies layer positions on related nodes.
Instead, at the end of wheel event handling, do a full scrolling tree traversal and update
all the layer positions there.
Delegated scrolling (iOS) still needs notifyRelatedNodesAfterScrollPositionChange() so it
can't be removed.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
(WebCore::ScrollingTree::applyLayerPositions):
(WebCore::ScrollingTree::applyLayerPositionsInternal):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged):
2020-04-23 Charlie Turner <cturner@igalia.com>
[EME][CDMProxy] Sort key status array lexicographically by key IDs
https://bugs.webkit.org/show_bug.cgi?id=210659
Reviewed by Xabier Rodriguez-Calvar.
This is required by section 6.1 of
https://www.w3.org/TR/encrypted-media/.
Test: encrypted-media/clearkey-keystatuses.https.html
* platform/encryptedmedia/CDMProxy.cpp:
(WebCore::KeyStore::add): We could use a set here and keep it
sorted by design, but this is more complexity than needed. The
store has for practical purposes an upper limit of 2
items. Sorting such a vector lowers to either a noop or a swap. So
the simple approach here wins over using some kind of self-sorting
set structure. I also considered only sorting on-demand, since it
only has to appear sorted from the perspective of JS, we could
sort the array in convertToJSKeyStatusVector. However, that is
semantically a const method, so sorting here felt too surprising.
* platform/encryptedmedia/CDMProxy.h:
(WebCore::Key::operator<): Add a lexicographic comparator to
Key.
2020-04-23 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] excessive wakeups/polling due to gdk_frame_clock_begin_updating
https://bugs.webkit.org/show_bug.cgi?id=210561
Reviewed by Žan Doberšek.
The problem is that we are destroying the display refresh monitor from the frame clock update callback, and GTK
schedules another update from the callback itself in some cases, which ends up happening forever. We were
assuming that destroying the window of immediately destroy the frame clock as well, but the paint source idle
keeps a reference of the frame clock. At the end of the source idle callback the source is scheduled again,
taking a new reference. We need to call gdk_frame_clock_end_updating() to ensure the idle is not scheduled
again.
* platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp:
(WebCore::DisplayRefreshMonitorGtk::~DisplayRefreshMonitorGtk): Disconnect the update signal and call
gdk_frame_clock_end_updating().
(WebCore::DisplayRefreshMonitorGtk::requestRefreshCallback): Toplevel window should always have a frame clock,
so remove the early return and add an assert instead.
2020-04-23 Youenn Fablet <youenn@apple.com>
getDisplayMedia is not respecting aspect ratio with max constraints
https://bugs.webkit.org/show_bug.cgi?id=210858
Reviewed by Eric Carlson.
Add computation of exact frame size to respect aspect ratio in DisplayCaptureSourceCocoa::updateFrameSize.
Refactor code to have one source class DisplayCaptureSourceCocoa and specific capturer for screen and window.
This simplifies code and allows reusing DisplayCaptureSourceCocoa with a mock capturer.
Update mock code to use DisplayCaptureSourceCocoa.
Tests: fast/mediastream/getDisplayMedia-max-constraints.html
fast/mediastream/getDisplayMedia-max-constraints1.html
fast/mediastream/getDisplayMedia-max-constraints2.html
fast/mediastream/getDisplayMedia-max-constraints3.html
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
(WebCore::DisplayCaptureManagerCocoa::updateDisplayCaptureDevices):
(WebCore::DisplayCaptureManagerCocoa::updateWindowCaptureDevices):
(WebCore::DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID):
(WebCore::DisplayCaptureManagerCocoa::windowCaptureDeviceWithPersistentID):
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::create):
(WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa):
(WebCore::DisplayCaptureSourceCocoa::~DisplayCaptureSourceCocoa):
(WebCore::DisplayCaptureSourceCocoa::capabilities):
(WebCore::DisplayCaptureSourceCocoa::settings):
(WebCore::DisplayCaptureSourceCocoa::startProducingData):
(WebCore::DisplayCaptureSourceCocoa::stopProducingData):
(WebCore::DisplayCaptureSourceCocoa::updateFrameSize):
(WebCore::DisplayCaptureSourceCocoa::emitFrame):
(WebCore::DisplayCaptureSourceCocoa::Capturer::setLogger):
(WebCore::DisplayCaptureSourceCocoa::Capturer::logChannel const):
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::createForMockDisplayCapturer):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
* platform/mediastream/mac/ScreenDisplayCapturerMac.h: Added.
* platform/mediastream/mac/ScreenDisplayCapturerMac.mm: Added.
(WebCore::ScreenDisplayCapturerMac::create):
(WebCore::ScreenDisplayCapturerMac::ScreenDisplayCapturerMac):
(WebCore::ScreenDisplayCapturerMac::~ScreenDisplayCapturerMac):
(WebCore::ScreenDisplayCapturerMac::createDisplayStream):
(WebCore::ScreenDisplayCapturerMac::start):
(WebCore::ScreenDisplayCapturerMac::stop):
(WebCore::ScreenDisplayCapturerMac::generateFrame):
(WebCore::ScreenDisplayCapturerMac::startDisplayStream):
(WebCore::ScreenDisplayCapturerMac::commitConfiguration):
(WebCore::ScreenDisplayCapturerMac::displayWasReconfigured):
(WebCore::ScreenDisplayCapturerMac::displayReconfigurationCallBack):
(WebCore::ScreenDisplayCapturerMac::newFrame):
(WebCore::ScreenDisplayCapturerMac::screenCaptureDeviceWithPersistentID):
(WebCore::ScreenDisplayCapturerMac::screenCaptureDevices):
* platform/mediastream/mac/WindowDisplayCapturerMac.h: Added.
* platform/mediastream/mac/WindowDisplayCapturerMac.mm: ddedAdded.
(WebCore::WindowDisplayCapturerMac::create):
(WebCore::WindowDisplayCapturerMac::WindowDisplayCapturerMac):
(WebCore::WindowDisplayCapturerMac::windowImage):
(WebCore::WindowDisplayCapturerMac::generateFrame):
(WebCore::WindowDisplayCapturerMac::windowCaptureDeviceWithPersistentID):
(WebCore::WindowDisplayCapturerMac::windowCaptureDevices):
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockDisplayCapturer::MockDisplayCapturer):
(WebCore::MockDisplayCapturer::start):
(WebCore::MockDisplayCapturer::generateFrame):
* platform/mock/MockRealtimeVideoSource.h:
(isType):
2020-04-22 Simon Fraser <simon.fraser@apple.com>
Make it possible to eagerly apply scrolling tree state from the main thread
https://bugs.webkit.org/show_bug.cgi?id=210883
Reviewed by Tim Horton.
Work towards fixing webkit.org/b/210884: at the beginning of Page::updateRendering(),
we are going to need to pull the current state of the scrolling tree back to the
main thread, so that JS-exposed scroll offsets match scrolling tree state.
To this end, expose a scrolling tree traversal function from ScrollingTree, which
takes the lock and then calls a visitor function for each node. For scrolling nodes,
the visitor gets the scroll position and optional layout viewport origin. These
match the data passed back currently via AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll().
The new code is not called yet.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::synchronizeStateFromScrollingTree):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::synchronizeStateFromScrollingTree):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::traverseScrollingTree):
(WebCore::ScrollingTree::traverseScrollingTreeRecursive):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged): applyLayerPositions() calls these two
functions, so just call it instead.
2020-04-22 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r260535.
https://bugs.webkit.org/show_bug.cgi?id=210897
Causes crashes in WK1 (Requested by smfr on #webkit).
Reverted changeset:
"[ Mac wk2 ] imported/w3c/web-platform-tests/notifications
/event-onclose.html is flaky failing."
https://bugs.webkit.org/show_bug.cgi?id=209483
https://trac.webkit.org/changeset/260535
2020-04-22 Darin Adler <darin@apple.com>
[Cocoa] Build with UChar as char16_t even in builds that use Apple's internal SDK
https://bugs.webkit.org/show_bug.cgi?id=210845
Reviewed by Anders Carlsson.
* Configurations/WebCore.xcconfig: Move ICU-configuring macros to Platform.h.
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect): Get rid of an obsolete cast to unsigned to work
around uint16_t not being treated as a number by makeString.
* rendering/svg/SVGTextLayoutEngineBaseline.cpp:
(WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle const):
Remove deprecated U_EA_COUNT.
2020-04-22 Andres Gonzalez <andresg_22@apple.com>
Add logging to core accessibility.
https://bugs.webkit.org/show_bug.cgi?id=210564
<rdar://problem/61863477>
Reviewed by Simon Fraser and Chris Fleizach.
- Use LOG and LOG_WITH_STREAM macros instead of WTF::Logger directly.
- Added logging of AXCoreObjects.
* accessibility/AXLogger.cpp:
(WebCore::AXLogger::AXLogger):
(WebCore::AXLogger::~AXLogger):
(WebCore::AXLogger::log):
(WebCore::operator<<):
* accessibility/AXLogger.h:
* accessibility/AccessibilityObjectInterface.h:
2020-04-22 Daniel Bates <dabates@apple.com>
Support toggling debug overlay for touch action region and editable element region independent from non-fast scrollable region
https://bugs.webkit.org/show_bug.cgi?id=210774
Reviewed by Dean Jackson.
Break out the touch action region and editable element region debug overlays into their own
flags that can be passed to Settings::setVisibleDebugOverlayRegions() to toggle these overlays,
respectively. Currently both of these overlays piggyback on whether the engine will paint the
non-fast scrollable region.
* page/SettingsBase.h: Add two more enumerators.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::invalidateEventRegion const): Update the code to be more precise now that
we can target the update paint overlay hack to when we are painting touch-action or editable
element regions.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintDebugOverlays): Condition the painting of touch action region
on one enumerator and the painting of editable element region on another.
(WebCore::RenderLayerBacking::paintContents): Update the code to be more precise.
2020-04-22 Chris Dumez <cdumez@apple.com>
[ Mac wk2 ] imported/w3c/web-platform-tests/notifications/event-onclose.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=209483
<rdar://problem/60830377>
Reviewed by Geoffrey Garen.
Align garbage collection of Notification JS wrapper with the specification:
- https://notifications.spec.whatwg.org/#garbage-collection [1]
In particular, the following changes were made:
1. Instead of using the legacy setPendingActivity() / unsetPendingActivity(), override
ActiveDOMObject::virtualHasPendingActivity() to implement the behavior documented
in the specification.
2. Keep the wrapper alive as long as the notification is showing and as long as there
are relevant event listeners, as per [1]. Previously, we failed to check for event
listeners, which was suboptimal.
3. Update the constructor to queue a task on the event loop in order to show the
notification asynchronously, instead of relying on a SuspendableTimer for this
purpose. Previously, the JS wrapper could get collected between construction and
the notification getting shown, which was leading to the test flakiness.
No new tests, unskipped existing test.
* Modules/notifications/Notification.cpp:
(WebCore::Notification::Notification):
(WebCore::Notification::show):
(WebCore::Notification::finalize):
(WebCore::Notification::dispatchShowEvent):
(WebCore::Notification::dispatchClickEvent):
(WebCore::Notification::dispatchCloseEvent):
(WebCore::Notification::dispatchErrorEvent):
(WebCore::Notification::eventListenersDidChange):
(WebCore::Notification::virtualHasPendingActivity const):
* Modules/notifications/Notification.h:
2020-04-22 Don Olmstead <don.olmstead@sony.com>
[CMake] Add WebKit::WebCoreTestSupport target
https://bugs.webkit.org/show_bug.cgi?id=210867
Reviewed by Michael Catanzaro.
Add the WebKit::WebCoreTestSupport target. Modify WebCoreTestSupport to only
have a dependency on WebCore if WebCore is built as a shared library.
* CMakeLists.txt:
2020-04-22 Eric Carlson <eric.carlson@apple.com>
fast/events/event-handler-detached-document-dispatchEvent.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=210859
<rdar://problem/62072269>
Reviewed by Jer Noble.
A media session may not have a Page when it is created, so register with the MediaUsageManager
in inActiveDocumentChanged if necessary.
No new tests, fixes an existing test.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::MediaElementSession):
(WebCore::MediaElementSession::~MediaElementSession):
(WebCore::MediaElementSession::addedMediaUsageManagerSessionIfNecessary):
(WebCore::MediaElementSession::inActiveDocumentChanged):
(WebCore::MediaElementSession::updateMediaUsageIfChanged):
* html/MediaElementSession.h:
2020-04-22 Antti Koivisto <antti@apple.com>
REGRESSION (r249160): Deleting newline after pasting text ending in a newline results in a discontinuity
https://bugs.webkit.org/show_bug.cgi?id=210677
<rdar://problem/61954169>
Reviewed by Zalan Bujtas.
Test: fast/text/delete-line-break-in-pre.html
* rendering/RenderTextLineBoxes.cpp:
(WebCore::RenderTextLineBoxes::dirtyRange):
r249160 changed InlineTextBox end offset to be consistently first-past-end.
The code here that updates lineBreakPos needs to take this into account too.
2020-04-22 Antoine Quint <graouts@apple.com>
[Web Animations] Coordinate "update animations and send events" procedure across multiple timelines
https://bugs.webkit.org/show_bug.cgi?id=202109
<rdar://problem/59470821>
Reviewed by Dean Jackson.
So far, although we did manage multiple animation timelines per document, we mostly operated
under the assumption that there really was a single timeline. In this patch we make the
"update animations and send events" procedure, which is central to the lifecycle of animations,
work with multiple timelines such that a single microtask checkpoint is performed even with multiple
timelines, whereas we would perform one per timeline before. To do this, we move much of the logic
DocumentTimeline::updateAnimationsAndSendEvents() to DocumentTimelinesController where each step is
run across each timeline, rather than running all steps for each timeline one after the other,
respecting the single microtask checkpoint in the middle of the process.
To minimize code churn at this stage, we still keep a fair bit of logic in DocumentTimeline and,
while we remove updateAnimationsAndSendEvents(), internalUpdateAnimationsAndSendEvents() and
updateCurrentTime(), we expose three methods that allow to run the pre-flight sequence in
documentWillUpdateAnimationsAndSendEvents(), collect pending events in
prepareForPendingAnimationEventsDispatch() and run the post-flight sequence
in documentDidUpdateAnimationsAndSendEvents().
None of the logic changes, this is just moving code around. In the future, more patches will move
code from DocumentTimeline up to DocumentTimelinesController such that events are enqueued there,
and animation scheduling as well. But this already lets us pass a new test that used to flakily
reject promises in the WPT test web-animations/timing-model/timelines/update-and-send-events.html.
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::relevantAnimations const):
(WebCore::AnimationTimeline::allAnimations const):
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::documentWillUpdateAnimationsAndSendEvents):
(WebCore::DocumentTimeline::documentDidUpdateAnimationsAndSendEvents):
(WebCore::DocumentTimeline::prepareForPendingAnimationEventsDispatch):
(WebCore::DocumentTimeline::updateCurrentTime): Deleted.
(WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Deleted.
(WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents): Deleted.
* animation/DocumentTimeline.h:
* animation/DocumentTimelinesController.cpp:
(WebCore::DocumentTimelinesController::DocumentTimelinesController):
(WebCore::DocumentTimelinesController::updateAnimationsAndSendEvents):
* animation/DocumentTimelinesController.h:
* animation/WebAnimationTypes.h:
* dom/Document.cpp:
(WebCore::Document::ensureTimelinesController):
2020-04-22 Eric Carlson <eric.carlson@apple.com>
[iOS] Add a quirk to keep gizmodo videos visible when playing in fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=210857
<rdar://problem/58875327>
Reviewed by Jer Noble.
* page/Quirks.cpp:
(WebCore::Quirks::needsFullscreenDisplayNoneQuirk const):
* page/Quirks.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): Drive-by fix: always
set the layer name to make debugging in release builds easier.
* platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm:
(WebCore::VideoLayerManagerObjC::setVideoLayer): Ditto.
* style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjustForSiteSpecificQuirks const): Change `display:none` into
`display:block` on div with class "instream-native-video--mobile" when child video
element with id "vjs_video_3_html5_api" is in fullscreen.
2020-04-22 Chris Dumez <cdumez@apple.com>
Unreviewed, commit updated xcfilelist files.
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
2020-04-22 Chris Dumez <cdumez@apple.com>
Unreviewed, reverting r259116.
Broke login flow on some apple-internal sites
(rdar://problem/61905262)
Reverted changeset:
"Move applyUserAgentIfNeeded calls to a more central place"
https://bugs.webkit.org/show_bug.cgi?id=209587
https://trac.webkit.org/changeset/259116
2020-04-22 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Introduce TableFormattingContext::computeAndDistributeExtraVerticalSpace
https://bugs.webkit.org/show_bug.cgi?id=210830
Reviewed by Antti Koivisto.
Add a dedicated function to compute preferred heights for the table rows.
This is in preparation for the 2 pass layout required to finalize row height.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeBorderAndPadding):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedPadding const):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutInFlowContent):
(WebCore::Layout::TableFormattingContext::layoutCell):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):
(WebCore::Layout::TableFormattingContext::setComputedGeometryForRows):
(WebCore::Layout::TableFormattingContext::setComputedGeometryForSections):
(WebCore::Layout::TableFormattingContext::positionTableCells): Deleted.
* layout/tableformatting/TableFormattingContext.h:
2020-04-22 Claudio Saavedra <csaavedra@igalia.com>
[GTK4] Several fixes to GdkEvent APIs for GTK4
https://bugs.webkit.org/show_bug.cgi?id=210856
Reviewed by Carlos Garcia Campos.
No tests needed.
Several fixes to GdkEvent API changes for GTK4. This is far from
complete but it allows the GTK4 build to move forward. When
possible, add GTK3-API replacements to GtkVersioning.h to avoid
#ifdef blocks, where the API changes are too complex, just #ifdef.
* platform/gtk/GtkUtilities.cpp:
(WebCore::wallTimeForEvent):
* platform/gtk/GtkVersioning.h:
(gdk_event_get_state):
(gdk_event_get_coords):
(gdk_event_get_root_coords):
(gdk_event_is_scroll_stop_event):
(gdk_event_get_scroll_direction):
(gdk_event_get_scroll_deltas):
(gdk_event_get_button):
(gdk_keymap_get_for_display): Deleted as it was wrong and
it's not needed.
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::PlatformKeyboardEvent::currentCapsLockState):
(WebCore::PlatformKeyboardEvent::getCurrentModifierState):
(WebCore::PlatformKeyboardEvent::modifiersContainCapsLock):
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
2020-04-22 Youenn Fablet <youenn@apple.com>
Simplify SWServerWorker::whenActivated logic
https://bugs.webkit.org/show_bug.cgi?id=210795
Reviewed by Alex Christensen.
Improve logging and ensure whenActivated can be called whatever the worker state is.
No change of behavior.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::didFinishInstall):
(WebCore::SWServer::fireInstallEvent):
(WebCore::SWServer::fireActivateEvent):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::whenActivated):
2020-04-22 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE] Youtube 'live stream'/H264 URLs fail to play, VP8/9 URLs play OK
https://bugs.webkit.org/show_bug.cgi?id=209119
Reviewed by Xabier Rodriguez-Calvar.
The fix consists of removing the initial avoiding of seeking and just
issuing the proper segment instead of seeking (seeks in GStreamer can't
be done before prerolling anyway). Appsrc doesn't make easy to emit our
own custom segment, so what I did was to use a segment fixer probe to
modify the original [0, infinity] segment issued by appsrc and use
a [startTime, stopTime] with proper values depending on the seek target
and rate.
Covered by existing tests.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::checkShouldDelaySeek): Don't hold seeks on startup, when changing from READY to PAUSED.
(WebCore::MediaPlayerPrivateGStreamerMSE::doSeek): Refactored seek delay condition. Also, don't do a regular
gst_element_seek() for initial seeks, just proceed with a special case in that situation.
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
(initialSeekSegmentFixerProbe): Probe that fixes the segment.
(webKitMediaSrcPrepareInitialSeek): Behave much like a regular seek, but also compute the right GstSegment, install
the segment fixer probe and setReadyForMoreSamples() on the SourceBufferPrivates.
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.h:
2020-04-21 Sergio Villar Senin <svillar@igalia.com>
[WebXR] Test IDLs and stubs
https://bugs.webkit.org/show_bug.cgi?id=209859
Reviewed by Dean Jackson and Youenn Fablet.
WebXR testing is hard as it might involve interaction with actual
devices. That's why the WebXR testing
API (https://immersive-web.github.io/webxr-test-api/) was
proposed. In fact, all the current WebXR tests from
web-platform-tests are using that testing API. This new testing
API supplements navigator.xr and is accessed through
navigator.xr.test.
In order not to expose the API to the web we're adding the XRTest
interface to Internals instead. The mapping from internals.xrTest to
navigator.xr.test happens in the WPT code.
We're adding the required IDLs and very basic (mostly empty)
implementations for testing methods. We're adding testing
infrastructure, adding tests make no sense for this change.
* CMakeLists.txt: Added new files.
* DerivedSources.make: Ditto.
* Modules/webxr/NavigatorWebXR.h: Export API to be used in testing code.
* Modules/webxr/WebXRSystem.h: Export ::from and ::xr methods.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* bindings/js/WebCoreBuiltinNames.h: Added some new macros.
* testing/FakeXRBoundsPoint.h: Added.
* testing/FakeXRBoundsPoint.idl: Added.
* testing/FakeXRButtonStateInit.h: Added.
* testing/FakeXRButtonStateInit.idl: Added.
* testing/FakeXRInputSourceInit.h: Added.
* testing/FakeXRInputSourceInit.idl: Added.
* testing/FakeXRRigidTransformInit.h: Added.
* testing/FakeXRRigidTransformInit.idl: Added.
* testing/FakeXRViewInit.h: Added.
* testing/FakeXRViewInit.idl: Added.
* testing/Internals.cpp:
(WebCore::Internals::xrTest): Added WebXRTest to Internals.
* testing/Internals.h: Added xrTest() accessor.
* testing/Internals.idl: Added xrTest attribute.
* testing/WebFakeXRDevice.cpp: Added.
(WebCore::WebFakeXRDevice::setViews):
(WebCore::WebFakeXRDevice::disconnect):
(WebCore::WebFakeXRDevice::setViewerOrigin):
(WebCore::WebFakeXRDevice::clearViewerOrigin):
(WebCore::WebFakeXRDevice::simulateVisibilityChange):
(WebCore::WebFakeXRDevice::setBoundsGeometry):
(WebCore::WebFakeXRDevice::setFloorOrigin):
(WebCore::WebFakeXRDevice::clearFloorOrigin):
(WebCore::WebFakeXRDevice::simulateResetPose):
(WebCore::WebFakeXRDevice::simulateInputSourceConnection):
* testing/WebFakeXRDevice.h: Added.
* testing/WebFakeXRDevice.idl: Added.
* testing/WebFakeXRInputController.cpp: Added.
(WebCore::WebFakeXRInputController::setHandedness):
(WebCore::WebFakeXRInputController::setTargetRayMode):
(WebCore::WebFakeXRInputController::setProfiles):
(WebCore::WebFakeXRInputController::setGripOrigin):
(WebCore::WebFakeXRInputController::clearGripOrigin):
(WebCore::WebFakeXRInputController::setPointerOrigin):
(WebCore::WebFakeXRInputController::disconnect):
(WebCore::WebFakeXRInputController::reconnect):
(WebCore::WebFakeXRInputController::startSelection):
(WebCore::WebFakeXRInputController::endSelection):
(WebCore::WebFakeXRInputController::simulateSelect):
(WebCore::WebFakeXRInputController::setSupportedButtons):
(WebCore::WebFakeXRInputController::updateButtonState):
* testing/WebFakeXRInputController.h: Added.
* testing/WebFakeXRInputController.idl: Added.
* testing/WebXRTest.cpp: Added.
(WebCore::WebXRTest::simulateDeviceConnection const):
(WebCore::WebXRTest::simulateUserActivation):
(WebCore::WebXRTest::disconnectAllDevices):
* testing/WebXRTest.h: Added.
(WebCore::WebXRTest::create):
* testing/WebXRTest.idl: Added.
* testing/XRSimulateUserActivationFunction.h: Added.
* testing/XRSimulateUserActivationFunction.idl: Ditto.
2020-04-21 Antoine Quint <graouts@apple.com>
[Web Animations] Add a supporting object for Document to manage timelines
https://bugs.webkit.org/show_bug.cgi?id=210817
Reviewed by Dean Jackson.
Add a new DocumentTimelinesController object owned by Document to manage DocumentTimelines created for it. This simple piece of refactoring is the first
step towards a coordinated "update animations and send events" procedure where all timelines are updated at once with a single microtask checkpoint instead
of each timeline running one.
No change in behavior, so no new tests.
* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::DocumentTimeline):
(WebCore::DocumentTimeline::~DocumentTimeline):
(WebCore::DocumentTimeline::controller const):
(WebCore::DocumentTimeline::detachFromDocument):
* animation/DocumentTimeline.h:
* animation/DocumentTimelinesController.cpp: Added.
(WebCore::DocumentTimelinesController::DocumentTimelinesController):
(WebCore::DocumentTimelinesController::~DocumentTimelinesController):
(WebCore::DocumentTimelinesController::addTimeline):
(WebCore::DocumentTimelinesController::removeTimeline):
(WebCore::DocumentTimelinesController::detachFromDocument):
(WebCore::DocumentTimelinesController::updateAnimationsAndSendEvents):
* animation/DocumentTimelinesController.h: Added.
* dom/Document.cpp:
(WebCore::Document::commonTeardown):
(WebCore::Document::ensureTimelinesController):
(WebCore::Document::updateAnimationsAndSendEvents): Deleted.
(WebCore::Document::addTimeline): Deleted.
(WebCore::Document::removeTimeline): Deleted.
* dom/Document.h:
(WebCore::Document::timelinesController const):
* page/Page.cpp:
(WebCore::Page::updateRendering):
2020-04-21 Cathie Chen <cathiechen@igalia.com>
REGRESSION (r254790): No longer get smooth scrolling on music.apple.com
https://bugs.webkit.org/show_bug.cgi?id=210634
Reviewed by Darin Adler.
The page uses the access of "scrollBehavior" in CSSStyleDeclaration as the support of scroll-behavior.
If supported, it will use scroll-behavior. Otherwise, it will perform a JS smooth scroll.
Currently, "scrollBehavior" is still available when CSSOMViewSmoothScrolling is off, only the value
"smooth" is invalidated.
In order to fix this, CSSStyleDeclaration will take account of CSSOMViewSmoothScrolling in Settings.
This patch also tries to provide an interface which let flags in Settings can enable/disable a property.
However, it is not complete, for there are some scenarios that Settings isn't accessible. By adding
"settings-flag" to CSSProperties.json, it would be effective to control the property access in CSSStyleDeclaration.
Tests: fast/scrolling/scroll-behavior-invalidate-if-disabled.html
fast/scrolling/scroll-behavior-validate-if-enabled.html
* css/CSSProperties.json:
* css/CSSStyleDeclaration.cpp:
(WebCore::CSSStyleDeclaration::getCSSPropertyIDFromJavaScriptPropertyName):
(WebCore::CSSStyleDeclaration::namedItem):
(WebCore::CSSStyleDeclaration::setNamedItem):
(WebCore::CSSStyleDeclaration::supportedPropertyNames const):
* css/makeprop.pl:
(addProperty):
* css/parser/CSSPropertyParser.cpp:
(WebCore::cssPropertyID):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::collectProperties const):
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getSupportedCSSProperties):
2020-04-21 Yusuke Suzuki <ysuzuki@apple.com>
Canonicalize JSBigInt generated by structured-cloning by calling rightTrim
https://bugs.webkit.org/show_bug.cgi?id=210816
Reviewed by Keith Miller and Darin Adler.
Let's assume that the serialized data is slightly different. JSBigInt's internal representation has various invariants. For example, if JSBigInt is zero, it should have zero length,
and its sign should be false. But there are various ways of representing zero JSBigInt in serialization format. For example, we can set sign = true, length = 0. Current code strongly
assumes that dumped data meets this JSBigInt's internal invariant. This is not good: for example, if we add a new invariant into JSBigInt, already serialized data would not meet this
invariant.
In this patch, we call `JSBigInt::rightTrim(VM&)` when finishing JSBigInt deserialization. This means that we canonicalize JSBigInt when finishing creation, and this makes this serialization
format free from JSBigInt's internal invariants. This makes JSBigInt serialization/deserialization robust. And we also add lengthInUint64 == 0 path not to call rightTrim when it is zero.
This makes deserialization robust for zero-length & signed corrupted JSBigInt zero.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpBigInt32Data):
(WebCore::CloneDeserializer::readBigInt):
2020-04-21 Peng Liu <peng.liu6@apple.com>
platform/mac/media/audio-session-category-audio-autoplay.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=210826
Reviewed by Jer Noble.
For WebKitLegacy, AudioSession::setCategory() needs to set the category when
m_routingArbitrationClient is nullptr. This patch also fixes an error regarding
setupArbitrationOngoing.
* platform/audio/mac/AudioSessionMac.mm:
(WebCore::AudioSession::setCategory):
2020-04-21 Peng Liu <peng.liu6@apple.com>
Fix MACCATALYST build failures
https://bugs.webkit.org/show_bug.cgi?id=210815
Reviewed by Tim Horton.
No new tests, no functional change.
* Configurations/FeatureDefines.xcconfig:
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
2020-04-19 Darin Adler <darin@apple.com>
[Cocoa] Use createNSArray in many more places that build NSArray objects from C++ collections
https://bugs.webkit.org/show_bug.cgi?id=210702
Reviewed by Alex Christensen.
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityFlowToElements]): Use createNSArray.
(-[WebAccessibilityObjectWrapper textRectsFromMarkers:withText:]): Ditto.
(-[WebAccessibilityObjectWrapper rectsForSelectionRects:]): Deleted. Merged into
the method above.
* accessibility/mac/WebAccessibilityObjectWrapperBase.h: Take const references
instead of references when passing Path and FloatRect.
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(convertMathPairsToNSArray): Use createNSArray. Also use arrays on the stack
to create NSDictionary rather than using NSMutableDictionary.
(addChildToArray): Deleted.
(convertToNSArray): Uses createNSArray. Rolled addChildToArray in.
(-[WebAccessibilityObjectWrapperBase convertPathToScreenSpace:]): Take const
reference instead of reference.
(-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]): Ditto.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
Use createNSArray.
* editing/cocoa/FontAttributesCocoa.mm:
(WebCore::FontAttributes::createDictionary const): Ditto.
* page/ios/FrameIOS.mm:
(WebCore::Frame::interpretationsForCurrentRoot const): Ditto.
* platform/cocoa/SearchPopupMenuCocoa.mm:
(WebCore::saveRecentSearches): Ditto.
* platform/cocoa/SharedBufferCocoa.mm:
(WebCore::SharedBuffer::createNSDataArray const): Ditto.
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense): Ditto.
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::update): Ditto.
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::update): Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
* platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
(WebCore::PlatformCAAnimationCocoa::setValues): Ditto.
(WebCore::PlatformCAAnimationCocoa::setKeyTimes): Ditto.
(WebCore::PlatformCAAnimationCocoa::setTimingFunctions): Ditto.
* platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
(WebCore::PlatformCAFilters::setFiltersOnLayer): Moved almost the whole
function into a call to createNSArray. Removed the default case from
the switch so we get a warning if we miss any filter operation types.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayerCocoa::setSublayers): Use createNSArray.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write): Ditto.
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::mediaSelectionOptions): Ditto.
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::PlatformPasteboard::write): Ditto.
* platform/mac/WebPlaybackControlsManager.mm:
(mediaSelectionOptions): Ditto.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::setCookies): Ditto.
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdatePlatformRequest): Ditto.
* platform/network/cocoa/WebCoreNSURLSession.h:
Use the Objective-C type WebCoreNSURLSessionDataTask in the _dataTasks
set rather than using CFTypeRef.
* platform/network/cocoa/WebCoreNSURLSession.mm:
(-[WebCoreNSURLSession dealloc]): Remove now-unneeded typecast.
(-[WebCoreNSURLSession taskCompleted:]): Ditto.
(-[WebCoreNSURLSession finishTasksAndInvalidate]): Use a more idiomatic
form of capturing strongSelf in a lambda.
(-[WebCoreNSURLSession invalidateAndCancel]): Updated the type on a
local variable and removed now-unneeded typecast.
(-[WebCoreNSURLSession getTasksWithCompletionHandler:]): Use RetainPtr
to cut down on autorelease. Use createNSArray, taking advantage of the
fact that it works on HashSet. Removed now-unneeded typecast.
(-[WebCoreNSURLSession getAllTasksWithCompletionHandler:]): Ditto.
(-[WebCoreNSURLSession dataTaskWithRequest:]): Remove now-unneeded typecast.
(-[WebCoreNSURLSession dataTaskWithURL:]): Ditto.
2020-04-21 Alexey Shvayka <shvaikalesh@gmail.com>
The visibilitychange event should bubble
https://bugs.webkit.org/show_bug.cgi?id=210829
Reviewed by Darin Adler.
This change makes `visibilitychange` event bubble as per spec [1], aligning WebKit
with Blink and Gecko. Also fixes broken spec link to `visibilityState` attribute.
[1] https://w3c.github.io/page-visibility/#dfn-now-visible-algorithm (step 2)
Test: fast/events/page-visibility-transition-test.html
* dom/Document.cpp:
(WebCore::Document::visibilityStateChanged):
(WebCore::Document::visibilityState const):
2020-04-21 Simon Fraser <simon.fraser@apple.com>
Composited layers are misplaced inside RTL overflow scroller with visible scrollbar
https://bugs.webkit.org/show_bug.cgi?id=210820
Reviewed by Zalan Bujtas.
RenderLayerBacking::computeParentGraphicsLayerRect() used renderBox.paddingBoxRectIncludingScrollbar()
to position layers inside composited overflow scroll, but this is wrong if the RTL left-side
scrollbar takes space.
Fix by making some static functions that we can call from the various places that ask
about box geometry, and using them.
Test: compositing/scrolling/async-overflow-scrolling/position-inside-rtl-overflow.html
* rendering/RenderBox.cpp:
(WebCore::RenderBox::overflowClipRect const):
(WebCore::RenderBox::clipRect const):
(WebCore::RenderBox::overflowClipRect): Deleted.
(WebCore::RenderBox::clipRect): Deleted.
* rendering/RenderBox.h:
(WebCore::RenderBox::overflowClipRectForChildLayers const):
(WebCore::RenderBox::overflowClipRectForChildLayers): Deleted.
* rendering/RenderLayerBacking.cpp:
(WebCore::scrollContainerLayerBox):
(WebCore::clippingLayerBox):
(WebCore::overflowControlsHostLayerBox):
(WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::clipBox): Deleted.
* rendering/RenderTable.cpp:
(WebCore::RenderTable::overflowClipRect const):
(WebCore::RenderTable::overflowClipRect): Deleted.
* rendering/RenderTable.h:
2020-04-21 Simon Fraser <simon.fraser@apple.com>
[Async overflow scroll] Overflow that's hidden on one axis is scrollable on that axis
https://bugs.webkit.org/show_bug.cgi?id=210771
<rdar://problem/62080331>
Reviewed by Tim Horton.
eventCanScrollContents() should check the presence of enabled scrollbars, like
ScrollAnimator::handleWheelEvent() does.
Test: fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis.html
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::eventCanScrollContents const):
2020-04-21 Daniel Bates <dabates@apple.com>
[iOS] -_didFinishTextInteractionInTextInputContext should only zoom to reveal focused element if it changed
https://bugs.webkit.org/show_bug.cgi?id=210697
<rdar://problem/60997530>
Reviewed by Wenson Hsieh.
For now, add a comment about the return value of setFocusedElement: it returns
whether focus was blocked. If focused wasn't blocked then it will return true
even if the element wasn't actually focused. For example, it will return true
for non-focusable elements: <input disabled>.
I was tempted to fix setFocusedElement() to return true when it actually focused
the element or if the element was already focused, but I decided to defer this
until I audit the callers and run some tests.
* dom/Document.h:
2020-04-21 Andres Gonzalez <andresg_22@apple.com>
Fix for remoteParentObject and platformWidget not being stored properly in the AXIsolatedObject attributes variant.
https://bugs.webkit.org/show_bug.cgi?id=210809
Reviewed by Chris Fleizach.
Adding these properties to the AXIsolatedObject attributes variant as
WeakPtr<void*> fails. So they are now cached as member variables.
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
(WebCore::AXIsolatedObject::platformWidget const):
* accessibility/isolatedtree/AXIsolatedObject.h:
(WebCore::AXIsolatedObject::propertyValue const): Deleted.
* accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm:
(WebCore::AXIsolatedObject::initializePlatformProperties):
(WebCore::AXIsolatedObject::remoteParentObject const):
2020-04-20 Simon Fraser <simon.fraser@apple.com>
Horizontal overflow overlay scrollbar is misplaced in RTL
https://bugs.webkit.org/show_bug.cgi?id=210673
<rdar://problem/61950751>
Reviewed by Antti Koivisto.
Code for positioning RenderLayer overflow controls (scrollbars and scroll corner)
was scattered across lots of different functions, making it hard to follow,
and prone to bugs.
Fix by making one source of truth, overflowControlsRects(), which computes
rects for the two scrollbars, the "scroll corner" (the square in the corner which
shows, only for non-overlay scrollbars, when both scrollbars or the resize control
is visible), and the resize control which shows when style specifies the "resize" property.
Call this function in all the places that need to know about overflow control
geometry. RenderLayer::hitTestResizerInFragments() is a little tricky because it wants
the resize control relative to the fragment rect; achieve this by computing the position
of the resizer rect relative to the border box, then shifting it into position relative
to the fragment bounds (which include border).
Test: compositing/overflow/rtl-scrollbar-layer-positioning.html
* page/EventHandler.cpp:
(WebCore::EventHandler::selectCursor):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollCornerRect const):
(WebCore::RenderLayer::overflowControlsRects const):
(WebCore::RenderLayer::scrollbarOffset const):
(WebCore::RenderLayer::invalidateScrollbarRect):
(WebCore::RenderLayer::positionOverflowControls):
(WebCore::RenderLayer::overflowControlsIntersectRect const):
(WebCore::RenderLayer::paintResizer):
(WebCore::RenderLayer::isPointInResizeControl const):
(WebCore::RenderLayer::hitTestOverflowControls):
(WebCore::RenderLayer::hitTestResizerInFragments const):
(WebCore::cornerStart): Deleted.
(WebCore::cornerRect): Deleted.
(WebCore::resizerCornerRect): Deleted.
(WebCore::RenderLayer::scrollCornerAndResizerRect const): Deleted.
(WebCore::RenderLayer::rectForHorizontalScrollbar const): Deleted.
(WebCore::RenderLayer::rectForVerticalScrollbar const): Deleted.
(WebCore::RenderLayer::verticalScrollbarStart const): Deleted.
(WebCore::RenderLayer::horizontalScrollbarStart const): Deleted.
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::requiresScrollCornerLayer const):
(WebCore::RenderLayerBacking::positionOverflowControlsLayers):
(WebCore::RenderLayerBacking::paintContents):
2020-04-21 Sergio Villar Senin <svillar@igalia.com>
Unreviewed, reverting r260432.
Broke WPE build
Reverted changeset:
"[WebXR] Test IDLs and stubs"
https://bugs.webkit.org/show_bug.cgi?id=209859
https://trac.webkit.org/changeset/260432
2020-04-21 Chris Dumez <cdumez@apple.com>
REGRESSION (r256808): “A problem repeatedly occurred” when attempting to load https://bungalow.com/listings/bay-area
https://bugs.webkit.org/show_bug.cgi?id=210801
<rdar://problem/61658940>
Reviewed by Antti Koivisto.
Even though the page uses the 'async' attribute on the mapbox-gl.js script, deferring the execution of this
script gets the page into a bad state, causing it to use a lot of CPU & memory until the process crashes.
Since we don't have any other evidence of breakage from r256808 yet and since r256808 was a massive PLT
progression, I am opting to add a quirk to disable the async script optimization on bungalow.com for now.
* dom/Document.cpp:
(WebCore::Document::shouldDeferAsynchronousScriptsUntilParsingFinishes const):
* page/Quirks.cpp:
(WebCore::Quirks::shouldBypassAsyncScriptDeferring const):
* page/Quirks.h:
* platform/RegistrableDomain.h:
(WebCore::RegistrableDomain::operator== const):
2020-04-16 Sergio Villar Senin <svillar@igalia.com>
[WebXR] Test IDLs and stubs
https://bugs.webkit.org/show_bug.cgi?id=209859
Reviewed by Dean Jackson and Youenn Fablet.
WebXR testing is hard as it might involve interaction with actual
devices. That's why the WebXR testing
API (https://immersive-web.github.io/webxr-test-api/) was
proposed. In fact, all the current WebXR tests from
web-platform-tests are using that testing API. This new testing
API supplements navigator.xr and is accessed through
navigator.xr.test.
In order not to expose the API to the web we're adding the XRTest
interface to Internals instead. The mapping from internals.xrTest to
navigator.xr.test happens in the WPT code.
We're adding the required IDLs and very basic (mostly empty)
implementations for testing methods. We're adding testing
infrastructure, adding tests make no sense for this change.
* CMakeLists.txt: Added new files.
* DerivedSources.make: Ditto.
* Modules/webxr/NavigatorWebXR.h: Export API to be used in testing code.
* Modules/webxr/WebXRSystem.h: Export ::from and ::xr methods.
* Sources.txt: Added new files.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* bindings/js/WebCoreBuiltinNames.h: Added some new macros.
* testing/FakeXRBoundsPoint.h: Added.
* testing/FakeXRBoundsPoint.idl: Added.
* testing/FakeXRButtonStateInit.h: Added.
* testing/FakeXRButtonStateInit.idl: Added.
* testing/FakeXRInputSourceInit.h: Added.
* testing/FakeXRInputSourceInit.idl: Added.
* testing/FakeXRRigidTransformInit.h: Added.
* testing/FakeXRRigidTransformInit.idl: Added.
* testing/FakeXRViewInit.h: Added.
* testing/FakeXRViewInit.idl: Added.
* testing/Internals.cpp:
(WebCore::Internals::xrTest): Added WebXRTest to Internals.
* testing/Internals.h: Added xrTest() accessor.
* testing/Internals.idl: Added xrTest attribute.
* testing/WebFakeXRDevice.cpp: Added.
(WebCore::WebFakeXRDevice::setViews):
(WebCore::WebFakeXRDevice::disconnect):
(WebCore::WebFakeXRDevice::setViewerOrigin):
(WebCore::WebFakeXRDevice::clearViewerOrigin):
(WebCore::WebFakeXRDevice::simulateVisibilityChange):
(WebCore::WebFakeXRDevice::setBoundsGeometry):
(WebCore::WebFakeXRDevice::setFloorOrigin):
(WebCore::WebFakeXRDevice::clearFloorOrigin):
(WebCore::WebFakeXRDevice::simulateResetPose):
(WebCore::WebFakeXRDevice::simulateInputSourceConnection):
* testing/WebFakeXRDevice.h: Added.
* testing/WebFakeXRDevice.idl: Added.
* testing/WebFakeXRInputController.cpp: Added.
(WebCore::WebFakeXRInputController::setHandedness):
(WebCore::WebFakeXRInputController::setTargetRayMode):
(WebCore::WebFakeXRInputController::setProfiles):
(WebCore::WebFakeXRInputController::setGripOrigin):
(WebCore::WebFakeXRInputController::clearGripOrigin):
(WebCore::WebFakeXRInputController::setPointerOrigin):
(WebCore::WebFakeXRInputController::disconnect):
(WebCore::WebFakeXRInputController::reconnect):
(WebCore::WebFakeXRInputController::startSelection):
(WebCore::WebFakeXRInputController::endSelection):
(WebCore::WebFakeXRInputController::simulateSelect):
(WebCore::WebFakeXRInputController::setSupportedButtons):
(WebCore::WebFakeXRInputController::updateButtonState):
* testing/WebFakeXRInputController.h: Added.
* testing/WebFakeXRInputController.idl: Added.
* testing/WebXRTest.cpp: Added.
(WebCore::WebXRTest::simulateDeviceConnection const):
(WebCore::WebXRTest::simulateUserActivation):
(WebCore::WebXRTest::disconnectAllDevices):
* testing/WebXRTest.h: Added.
(WebCore::WebXRTest::create):
* testing/WebXRTest.idl: Added.
* testing/XRSimulateUserActivationFunction.h: Added.
* testing/XRSimulateUserActivationFunction.idl: Ditto.
2020-04-21 Claudio Saavedra <csaavedra@igalia.com>
[GTK4] Adapt to GtkIconTheme API changes
https://bugs.webkit.org/show_bug.cgi?id=210745
Reviewed by Adrian Perez de Castro.
No new tests needed.
GtkIconTheme changes in GTK and since we're no longer following
the theme we can drop the missing image from the icon theme, so remove
now unnecessary code.
* platform/graphics/gtk/ImageGtk.cpp:
(WebCore::Image::loadPlatformResource): Directly load image from compiled
GResource.
(WebCore::loadResourceSharedBuffer): Deleted.
(WebCore::loadMissingImageIconFromTheme): Deleted.
2020-04-21 Rob Buis <rbuis@igalia.com>
Exit early in FrameLoader::loadURL when redirecting to another frame
https://bugs.webkit.org/show_bug.cgi?id=210751
Reviewed by Geoffrey Garen.
Exit early in FrameLoader::loadURL when redirecting to another frame, previously we were preparing
request needlessly, doing it twice in case of frame redirecting. Also move some variables to
where they are actually used.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
* loader/FrameLoader.h:
2020-04-21 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Remove PlatformMouseEventGtk
https://bugs.webkit.org/show_bug.cgi?id=210743
Reviewed by Adrian Perez de Castro.
It's unused, we no longer create PlatformMouseEvent from a GdkEvent since WebKit2.
* SourcesGTK.txt:
* platform/PlatformMouseEvent.h:
* platform/gtk/PlatformMouseEventGtk.cpp: Removed.
2020-04-21 Claudio Saavedra <csaavedra@igalia.com>
[GTK4] Fix platform GDK includes
https://bugs.webkit.org/show_bug.cgi?id=210746
Reviewed by Carlos Garcia Campos.
* platform/graphics/PlatformDisplay.cpp: Wayland, X11, etc.
platform includes changed path, so update accordingly.
2020-04-21 Adrian Perez de Castro <aperez@igalia.com>
Non-unified build fixes late February 2020 edition
https://bugs.webkit.org/show_bug.cgi?id=210767
Unreviewed build fix.
No new tests needed.
* css/MediaQueryListEvent.cpp: Add missing wtf/IsoMallocInlines.h header.
* css/MediaQueryMatcher.cpp: Add missing MediaQueryListEvent.h header.
* platform/graphics/FloatQuad.cpp: Add missing wtf/text/TextStream.h header.
2020-04-20 Ross Kirsling <ross.kirsling@sony.com>
Classes marked final should not use protected access specifier
https://bugs.webkit.org/show_bug.cgi?id=210775
Reviewed by Daniel Bates.
* Modules/applepay/ApplePayPaymentMethodSelectedEvent.h:
* Modules/applepay/ApplePayValidateMerchantEvent.h:
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h:
* Modules/webaudio/BiquadDSPKernel.h:
* Modules/webaudio/WaveShaperDSPKernel.h:
* Modules/websockets/WebSocketChannel.h:
* Modules/websockets/WorkerThreadableWebSocketChannel.h:
* Modules/webxr/WebXRSession.h:
* Modules/webxr/WebXRSystem.h:
* accessibility/AccessibilityARIAGridCell.h:
* accessibility/AccessibleSetValueEvent.h:
* animation/CSSAnimation.h:
* bindings/js/ReadableStream.h:
* bridge/objc/objc_runtime.h:
* bridge/runtime_array.h:
* css/CSSImageSetValue.h:
* html/HTMLKeygenElement.cpp:
* html/canvas/WebGLBuffer.h:
* html/canvas/WebGLFramebuffer.h:
* html/canvas/WebGLProgram.h:
* html/canvas/WebGLQuery.h:
* html/canvas/WebGLRenderbuffer.h:
* html/canvas/WebGLSampler.h:
* html/canvas/WebGLSync.h:
* html/canvas/WebGLTransformFeedback.h:
* html/canvas/WebGLUniformLocation.h:
* html/shadow/TextControlInnerElements.h:
* inspector/InspectorStyleSheet.h:
* inspector/WebInjectedScriptManager.h:
* loader/cache/CachedCSSStyleSheet.h:
* page/Frame.h:
* page/FrameView.h:
* page/PageConsoleClient.h:
* page/animation/KeyframeAnimation.h:
* page/scrolling/nicosia/ScrollingTreeOverflowScrollProxyNode.h:
* platform/audio/AudioBus.h:
* platform/cocoa/PlaybackSessionModelMediaElement.h:
* platform/graphics/BitmapImage.h:
* platform/graphics/CrossfadeGeneratedImage.h:
* platform/graphics/NamedImageGeneratedImage.h:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
* platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h:
* platform/graphics/ca/win/PlatformCAAnimationWin.h:
* platform/graphics/cg/ImageDecoderCG.h:
* platform/graphics/iso/ISOOriginalFormatBox.h:
* platform/graphics/iso/ISOProtectionSchemeInfoBox.h:
* platform/graphics/iso/ISOSchemeInformationBox.h:
* platform/graphics/iso/ISOSchemeTypeBox.h:
* platform/graphics/iso/ISOTrackEncryptionBox.h:
* platform/graphics/iso/ISOVTTCue.cpp:
* platform/graphics/iso/ISOVTTCue.h:
* platform/graphics/win/ImageDecoderDirect2D.h:
* platform/mediastream/mac/AVCaptureDeviceManager.h:
* platform/mock/mediasource/MockBox.h:
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
* rendering/RenderFullScreen.h:
* rendering/RenderGrid.h:
* rendering/RenderMultiColumnSet.h:
* rendering/RenderRuby.h:
* rendering/RenderScrollbarPart.h:
* rendering/RenderScrollbarTheme.h:
* rendering/RenderTableCell.h:
* rendering/RenderTableSection.h:
* rendering/RenderThemeIOS.h:
* rendering/RenderView.h:
* rendering/svg/RenderSVGResourceClipper.h:
* svg/SVGTextPathElement.h:
* workers/WorkerConsoleClient.h:
* worklets/Worklet.h:
2020-04-20 Peng Liu <peng.liu6@apple.com>
Fix build failures when video fullscreen and picture-in-picture is disabled
https://bugs.webkit.org/show_bug.cgi?id=210777
Reviewed by Eric Carlson.
Wrap video fullscreen and picture-in-picture related code with "#if ENABLE(VIDEO_PRESENTATION_MODE)".
* Configurations/FeatureDefines.xcconfig:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity):
* platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h:
* platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm:
(WebCore::VideoLayerManagerObjC::setVideoLayer):
(WebCore::VideoLayerManagerObjC::requiresTextTrackRepresentation const):
(WebCore::VideoLayerManagerObjC::syncTextTrackBounds):
(WebCore::VideoLayerManagerObjC::setTextTrackRepresentation):
2020-04-20 Nikos Mouchtaris <nmouchtaris@apple.com>
WK2 Quicklook for attachments
https://bugs.webkit.org/show_bug.cgi?id=208891
Reviewed by Darin Adler.
Added to HTMLAttachmentElement to have member image representing
QuickLook thumbnail. Added code to render this image on both iOS and Mac.
No new tests. Test will be added after additions to test infrastructure.
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::updateThumbnailRepresentation):
Allow setting of thumbnail member.
* html/HTMLAttachmentElement.h:
* rendering/RenderThemeIOS.mm:
Added rendering of image member of attachment element.
(WebCore::RenderAttachmentInfo::RenderAttachmentInfo):
(WebCore::paintAttachmentIcon):
(WebCore::RenderThemeIOS::paintAttachment):
* rendering/RenderThemeMac.mm:
(WebCore::paintAttachmentIcon):
2020-04-20 Yusuke Suzuki <ysuzuki@apple.com>
Add more structure-cloning tests for BigInt
https://bugs.webkit.org/show_bug.cgi?id=210765
Reviewed by Mark Lam.
This patch adds safe-guard for future JSC primitive extension for structure-cloning.
We throw DataCloneError if we see unknown primitive value, which can happen if JSC
extends primitive value.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpImmediate):
(WebCore::CloneSerializer::dumpIfTerminal):
2020-04-20 Simon Fraser <simon.fraser@apple.com>
Scrolling with background-attachment: fixed needs to trigger repaints
https://bugs.webkit.org/show_bug.cgi?id=193893
<rdar://problem/47587017>
Reviewed by Dean Jackson.
When scrolling an overflow scroll which has "background-atttachment:fixed" in the content,
the node will have non-empty synchronous scrolling reasons. In this case we need to
send the scroll to the main thread, and trigger a repaint on scroll.
If handling the wheel event on the scrolling thread determines that the scroll must be sent
to the main thread, EventDispatcher::wheelEvent() does so in the callback function.
To trigger the repaint, RenderLayer::scrollTo() asks the composited layers backing whether
the node has synchronous scrolling reasons; this is implemented by asking the scrolling
coordinator.
Test: scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-overflow-repaint.html
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::hasSynchronousScrollingReasons const):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::hasSynchronousScrollingReasons const):
* page/scrolling/ScrollingStateScrollingNode.h:
(WebCore::ScrollingStateScrollingNode::hasSynchronousScrollingReasons const):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent): Return SendToMainThread if this node
needs to do synchronous scrolling.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::needsRepaintOnCompositedScroll const):
(WebCore::RenderLayerBacking::setRequiresOwnBackingStore):
(WebCore::RenderLayerBacking::setContentsNeedDisplay):
* rendering/RenderLayerBacking.h:
2020-04-20 Fujii Hironori <Hironori.Fujii@sony.com>
MSVC: LayoutUnits.h(248): warning C4245: 'argument': conversion from 'const int' to 'size_t', signed/unsigned mismatch
https://bugs.webkit.org/show_bug.cgi?id=210592
Reviewed by Zalan Bujtas.
* layout/LayoutUnits.h:
(WTF::HashTraits<WebCore::Layout::SlotPosition>::emptyValue):
(WTF::HashTraits<WebCore::Layout::SlotPosition>::constructDeletedValue):
(WTF::HashTraits<WebCore::Layout::SlotPosition>::isDeletedValue):
Use std::numeric_limits<size_t>::max() for empty and deleted
values instead of WebCore::intMinForLayoutUnit.
2020-04-20 Wenson Hsieh <wenson_hsieh@apple.com>
Text manipulation sometimes fails to replace text in title elements
https://bugs.webkit.org/show_bug.cgi?id=210750
<rdar://problem/61066103>
Reviewed by Tim Horton and Darin Adler.
Internal clients using WebKit text manipulation APIs currently fail to replace text in title and option elements
in the case where text manipulation has been completed with more than one token. These are elements for which we
want to replace the entire text as a single token, even if the text manipulation client ends up breaking the
token into multiple chunks.
To handle this case, pull the `title || option` check out into a helper function, and consult it when completing
text manipulation in the case where the manipulation data lacks either start or end positions. If
`canPerformTextManipulationByReplacingEntireTextContent` is true and there are multiple replacement tokens,
allow ourselves to process the replacement by combining the replacement tokens into a space-separated string.
Test: TextManipulation.CompleteTextManipulationShouldReplaceTextContentWithMultipleTokens
* editing/TextManipulationController.cpp:
(WebCore::canPerformTextManipulationByReplacingEntireTextContent):
(WebCore::TextManipulationController::observeParagraphs):
(WebCore::TextManipulationController::replace):
2020-04-20 Andres Gonzalez <andresg_22@apple.com>
The rect for the primary screen should be retrieved on the main thread.
https://bugs.webkit.org/show_bug.cgi?id=210760
Reviewed by Chris Fleizach.
- Call to screenRectForPrimaryScreen is dispatched to main thread.
- This value is cached since it is very unlikely to change in normal
usage and this would avoid hitting the main thread repeatedly.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper primaryScreenHeight]):
2020-04-15 Sergio Villar Senin <svillar@igalia.com>
[WebXR] Update WebXRSession and WebXRSystem interfaces
https://bugs.webkit.org/show_bug.cgi?id=210553
Reviewed by Žan Doberšek.
Update WebXRSession and WebXRSystem to the latest changes in the specs.
* Modules/webxr/WebXRSession.idl: Added 3 new events.
* Modules/webxr/WebXRSystem.idl: Interface name is XR not XRSystem.
* bindings/js/WebCoreBuiltinNames.h: Renamed macro.
* dom/EventNames.h: Added 3 new events.
2020-04-20 Chris Dumez <cdumez@apple.com>
Sending beacons when Fetch KeepAlive feature is disabled crashes the WebProcess
https://bugs.webkit.org/show_bug.cgi?id=210753
<rdar://problem/61896221>
Reviewed by Geoffrey Garen.
Test: http/wpt/beacon/beacon-legacy-code-path.html
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setFetchAPIKeepAliveEnabled):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
Add internal settings to disable Fetch Keep Alive for layout testing.
2020-04-20 Youenn Fablet <youenn@apple.com>
MediaPlayerPrivateMediaStreamAVFObjC should start play a newly added audio track if it is playing
https://bugs.webkit.org/show_bug.cgi?id=210740
Reviewed by Eric Carlson.
Before the patch, MediaPlayerPrivateMediaStreamAVFObjC was not calling play on the audio renderer when the audio renderer
was added after the MediaPlayerPrivateMediaStreamAVFObjC was asked to play.
This patch makes it so that, on configuration of an audio track, it will be asked to play if its MediaPlayerPrivateMediaStreamAVFObjC is playing.
Add internals API to be able to write a test.
Test: fast/mediastream/play-newly-added-audio-track.html
* html/track/AudioTrack.h:
* html/track/AudioTrack.idl:
* platform/graphics/AudioTrackPrivate.h:
(WebCore::AudioTrackPrivate::isBackedByMediaStreamTrack const):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
* platform/mediastream/AudioTrackPrivateMediaStream.cpp:
(WebCore::AudioTrackPrivateMediaStream::play):
* platform/mediastream/AudioTrackPrivateMediaStream.h:
(isType):
* testing/Internals.cpp:
(WebCore::Internals::isMockRealtimeMediaSourceCenterEnabled):
(WebCore::Internals::shouldAudioTrackPlay):
* testing/Internals.h:
* testing/Internals.idl:
2020-04-20 Youenn Fablet <youenn@apple.com>
Use a WeakHashSet to store MediaStreamPrivate observers
https://bugs.webkit.org/show_bug.cgi?id=210494
Reviewed by Eric Carlson.
Remove observers from the MediaStream and migrate existing client (MediaRecorder) to MediaStreamPrivate::Observer.
Make use of WeakHashSet in MediaStreamPrivate to improve robustness of the code.
Any time the MediaStreamPrivate tracks are modified, observers will be notified.
MediaStream needs now to decide when to send an event when its MediaStreamPrivate notifies of new/deleted tracks,
Modernize a bit the code to use more references.
Covered by existing tests.
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::MediaRecorder):
(WebCore::MediaRecorder::~MediaRecorder):
(WebCore::MediaRecorder::handleTrackChange):
* Modules/mediarecorder/MediaRecorder.h:
* Modules/mediastream/MediaStream.cpp:
(WebCore::createTrackPrivateVector):
(WebCore::MediaStream::MediaStream):
(WebCore::MediaStream::~MediaStream):
(WebCore::MediaStream::addTrack):
(WebCore::MediaStream::removeTrack):
(WebCore::MediaStream::getTrackById):
(WebCore::MediaStream::didAddTrack):
(WebCore::MediaStream::didRemoveTrack):
(WebCore::MediaStream::addTrackFromPlatform):
(WebCore::MediaStream::internalAddTrack):
(WebCore::MediaStream::internalTakeTrack):
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::removeRemoteTrack):
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::MediaStreamPrivate):
(WebCore::MediaStreamPrivate::addObserver):
(WebCore::MediaStreamPrivate::removeObserver):
(WebCore::MediaStreamPrivate::forEachObserver):
(WebCore::MediaStreamPrivate::computeActiveState):
(WebCore::MediaStreamPrivate::updateActiveState):
(WebCore::MediaStreamPrivate::addTrack):
(WebCore::MediaStreamPrivate::removeTrack):
(WebCore::MediaStreamPrivate::trackEnded):
* platform/mediastream/MediaStreamPrivate.h:
* testing/Internals.cpp:
(WebCore::Internals::removeMediaStreamTrack):
2020-04-19 Simon Fraser <simon.fraser@apple.com>
Content disappears on CSS parallax example
https://bugs.webkit.org/show_bug.cgi?id=210732
<rdar://problem/61997636>
Reviewed by Darin Adler.
If scrolling affects the computation of coverage rect of a TiledBacking, we plumb
that expanded coverage back into TransformState which is maintained during GraphicsLayer flushing,
and it's used to compute coverage rect for descendants.
It's passed into TransformState::setLastPlanarSecondaryQuad(), which has to map it back into
the coordinate system of the last flattening ancestor. However, TransformState::mapQuad()
had a missing return and the quad mapping was wrong. The new code is now the same as
TransformState::mappedPoint() (you can see where the copy/paste error came from).
Test: compositing/tiling/coverage-adjustment-secondary-quad-mapping.html
* platform/graphics/transforms/TransformState.cpp:
(WebCore::TransformState::mapQuad const):
(WebCore::TransformState::flattenWithTransform):
2020-04-20 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Add support for border-collapse: collapse.
https://bugs.webkit.org/show_bug.cgi?id=210747
Reviewed by Antti Koivisto.
Test: fast/layoutformattingcontext/table-flex-width-border-collapse.html
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::ensureTableGrid):
2020-04-20 Wenson Hsieh <wenson_hsieh@apple.com>
Oversized caret and selection rects in text fields on ganji.com and netflix.com/login
https://bugs.webkit.org/show_bug.cgi?id=210622
<rdar://problem/45945636>
Reviewed by Darin Adler.
Currently, selection and caret rects in text fields on some web pages can be excessively tall. This patch makes
a small adjustment to allow the top of the caret or selection rect to snap to the top of the inline box instead
of being at the end of the previous line, in the case where there is no previous inline box.
In the case where we compute the caret rect for an empty renderer (i.e. no children), we make an additional
tweak so that the caret rect's height is based on the computed font height instead of line height, and then we
ensure that the caret is (logically) vertically centered.
See below for more details.
Test: editing/selection/selection-and-caret-do-not-extend-to-line-height.html
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
Specify ForHitTesting::Yes when asking for selectionTop().
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::localCaretRectForEmptyElement):
Use FontMetric's height when computing the height of the caret rect, and then center it vertically in the
renderer.
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::positionForPoint):
Specify ForHitTesting::Yes when asking for selectionTop(). See below for more information.
* rendering/RenderTextLineBoxes.cpp:
(WebCore::RenderTextLineBoxes::positionForPoint const):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::selectionTop const):
When computing selectionTop(), we currently fall back to using the top of the containing RenderBlockFlow
(`blockFlow().borderAndPaddingBefore()`) in the case where there is no previous root box. However, this can lead
to selection and caret rects being taller than expected; instead, we can use the max of the `selectionTop`
(that is, the top of the line box, adjusted for annotations) and the top of the RenderBlockFlow. This has the
effect of allowing the caret and selection to visually snap to the top of a run of text, provided there is not
already a line of text that precedes it. Taking the maximum of the two values ensures that we don't
unintentionally make the selection or caret rects even larger, if the line top is above the top of the block.
Note that we also avoid shrinking the selection and caret rects when hit-testing renderers for positions and
ranges. This allows users to still click and drag to select text in the extra line-height area above a piece of
text, even if the selection is only painted over the text (and not in the region containing the line-height).
This behavior was established in the fix for webkit.org/b/14911, and is covered by the layout test
`editing/selection/inline-closest-leaf-child.html`.
* rendering/RootInlineBox.h:
2020-04-20 Darin Adler <darin@apple.com>
Use #import instead of #include in Objective-C and don't use #pragma once
https://bugs.webkit.org/show_bug.cgi?id=210724
Reviewed by David Kilzer.
* page/cocoa/SettingsBaseCocoa.mm:
(WebCore::sansSerifTraditionalHanFontFamily): Deleted.
(WebCore::sansSerifSimplifiedHanFontFamily): Deleted.
(WebCore::SettingsBase::initializeDefaultFontFamilies): Just use font name
strings directly since there are no conditionals any more.
* Modules/applepay/PaymentRequestValidator.mm:
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
* accessibility/mac/AXObjectCacheMac.mm:
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.h:
* bridge/objc/WebScriptObjectPrivate.h:
* bridge/objc/objc_class.mm:
* bridge/testbindings.mm:
* crypto/mac/SerializedCryptoKeyWrapMac.mm:
* editing/cocoa/WebArchiveResourceFromNSAttributedString.h:
* editing/cocoa/WebArchiveResourceWebResourceHandler.h:
* editing/cocoa/WebContentReaderCocoa.mm:
* history/mac/HistoryItemMac.mm:
* loader/cocoa/DiskCacheMonitorCocoa.mm:
* loader/cocoa/SubresourceLoaderCocoa.mm:
* loader/mac/ResourceLoaderMac.mm:
* page/cocoa/MemoryReleaseCocoa.mm:
* page/cocoa/ResourceUsageOverlayCocoa.mm:
* page/cocoa/ResourceUsageThreadCocoa.mm:
* page/ios/WebEventRegion.h:
* page/mac/ChromeMac.mm:
* page/mac/EventHandlerMac.mm:
* page/mac/WheelEventDeltaFilterMac.mm:
* page/scrolling/cocoa/ScrollingStateNode.mm:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
* page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
* page/scrolling/mac/ScrollingStateScrollingNodeMac.mm:
* page/scrolling/mac/ScrollingThreadMac.mm:
* page/scrolling/mac/ScrollingTreeMac.mm:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
* platform/audio/mac/AudioSampleDataSource.mm:
* platform/cocoa/DataDetectorsCoreSoftLink.mm:
* platform/cocoa/PasteboardCocoa.mm:
* platform/cocoa/ScrollSnapAnimatorState.mm:
* platform/cocoa/SystemVersion.mm:
* platform/gamepad/cocoa/GameControllerGamepad.mm:
* platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
* platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
* platform/graphics/ca/cocoa/WebSystemBackdropLayer.h:
* platform/graphics/ca/cocoa/WebTiledBackingLayer.h:
* platform/graphics/ca/cocoa/WebVideoContainerLayer.h:
* platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
* platform/graphics/cocoa/IOSurfacePoolCocoa.mm:
* platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
* platform/graphics/cocoa/WebGLLayer.h:
* platform/graphics/cocoa/WebGLLayer.mm:
* platform/graphics/cocoa/WebGPULayer.h:
* platform/graphics/cocoa/WebGPULayer.mm:
* platform/graphics/cv/ImageRotationSessionVT.mm:
* platform/graphics/cv/ImageTransferSessionVT.mm:
* platform/graphics/cv/TextureCacheCV.mm:
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
* platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm:
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
* platform/graphics/mac/FloatPointMac.mm:
* platform/graphics/mac/FloatSizeMac.mm:
* platform/graphics/mac/IntPointMac.mm:
* platform/graphics/mac/IntSizeMac.mm:
* platform/graphics/mac/WebLayer.h:
* platform/graphics/mac/WebLayer.mm:
* platform/ios/LegacyTileCache.mm:
* platform/ios/LegacyTileGrid.mm:
* platform/ios/LegacyTileGridTile.mm:
* platform/ios/LegacyTileLayer.h:
* platform/ios/LegacyTileLayer.mm:
* platform/ios/LegacyTileLayerPool.mm:
* platform/ios/LocalCurrentTraitCollection.mm:
* platform/ios/LocalizedDeviceModel.mm:
* platform/ios/ScrollbarThemeIOS.mm:
* platform/ios/WebCoreMotionManager.h:
* platform/ios/WebItemProviderPasteboard.mm:
* platform/ios/WebVideoFullscreenControllerAVKit.h:
* platform/mac/LocalCurrentGraphicsContext.mm:
* platform/mac/LocalDefaultSystemAppearance.mm:
* platform/mac/LoggingMac.mm:
* platform/mac/PlatformEventFactoryMac.mm:
* platform/mac/RemoteCommandListenerMac.mm:
* platform/mac/ScrollAnimatorMac.mm:
* platform/mac/SerializedPlatformDataCueMac.mm:
* platform/mac/WebCoreFullScreenPlaceholderView.mm:
* platform/mac/WebCoreFullScreenWarningView.h:
* platform/mac/WebCoreFullScreenWarningView.mm:
* platform/mac/WebCoreFullScreenWindow.h:
* platform/mac/WebCoreObjCExtras.mm:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
* platform/mediasession/mac/MediaSessionInterruptionProviderMac.mm:
* platform/mediastream/ios/AVAudioSessionCaptureDevice.mm:
* platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.mm:
* platform/mediastream/mac/RealtimeVideoUtilities.mm:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
* platform/network/cocoa/CertificateInfoCocoa.mm:
* platform/network/cocoa/WebCoreNSURLSession.h:
* platform/network/mac/BlobDataFileReferenceMac.mm:
* platform/network/mac/CredentialStorageMac.mm:
* platform/network/mac/SynchronousLoaderClient.mm:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/text/cocoa/LocaleCocoa.mm:
* testing/ServiceWorkerInternals.mm:
* testing/cocoa/WebViewVisualIdentificationOverlay.h:
More #import, less #pragma once.
2020-04-20 Youenn Fablet <youenn@apple.com>
Safari doesn't apply frameRate limit when request stream from Camera
https://bugs.webkit.org/show_bug.cgi?id=210186
<rdar://problem/61452794>
Reviewed by Eric Carlson.
Add support to RealtimeVideoSource to decimate the video samples based on the observed frame rate of its capture source.
This allows supporting two tracks using the same capture device, one track being low frame rate and the other one high frame rate.
Clean-up refactoring to make RealtimeVideoSource directly inherit from RealtimeVideoCaptureSource.
Migrate size and format of frame adaptation from RealtimeVideoCaptureSource to RealtimeVideoSource.
Fix mock capture source to update its frame rate when asked by applyConstraints.
Tests: fast/mediastream/mediastreamtrack-video-frameRate-clone-decreasing.html
fast/mediastream/mediastreamtrack-video-frameRate-clone-increasing.html
fast/mediastream/mediastreamtrack-video-frameRate-decreasing.html
fast/mediastream/mediastreamtrack-video-frameRate-increasing.html
* platform/mediastream/RealtimeVideoCaptureSource.cpp:
(WebCore::RealtimeVideoCaptureSource::dispatchMediaSampleToObservers):
(WebCore::RealtimeVideoCaptureSource::clientUpdatedSizeAndFrameRate):
* platform/mediastream/RealtimeVideoCaptureSource.h:
(WebCore::RealtimeVideoCaptureSource::observedFrameRate const):
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::RealtimeVideoSource):
(WebCore::m_source):
(WebCore::RealtimeVideoSource::adaptVideoSample):
(WebCore::RealtimeVideoSource::videoSampleAvailable):
* platform/mediastream/RealtimeVideoSource.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::setFrameRateWithPreset):
* testing/Internals.cpp:
(WebCore::Internals::observeMediaStreamTrack):
2020-04-20 Antoine Quint <graouts@apple.com>
WebAnimations API doesn't properly apply keyframe easings to transforms
https://bugs.webkit.org/show_bug.cgi?id=210526
<rdar://problem/61800424>
Reviewed by Antti Koivisto.
GraphicsLayerCA has code that determines whether an animation can be accelerated looking at the timing function of its keyframes and excluding
animations that use a steps timing function as one of its values. However, we we would fail to set the timing function on the KeyframeValue for
each keyframe in the KeyframeList we create for a JS-originated animation. We now do this correctly.
Test: webanimations/transform-animation-with-steps-timing-function-not-accelerated.html
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::updateBlendingKeyframes):
2020-04-20 Yusuke Suzuki <ysuzuki@apple.com>
StructuredClone algorithm should be aware of BigInt
https://bugs.webkit.org/show_bug.cgi?id=210728
Reviewed by Mark Lam.
This patch adds structured-cloning for BigInt and BigIntObject.
The logic is adding BigIntTag & BigIntObjectTag. And then we put content of BigInt with length.
And deserialization reads them to reconstruct BigInt or BigIntObject.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpImmediate):
(WebCore::CloneSerializer::dumpBigIntData):
(WebCore::CloneSerializer::dumpBigInt32Data):
(WebCore::CloneSerializer::dumpHeapBigIntData):
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneDeserializer::readBigInt):
(WebCore::CloneDeserializer::readTerminal):
2020-04-20 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][WPE] Enable resource load statistics
https://bugs.webkit.org/show_bug.cgi?id=210184
Reviewed by Žan Doberšek.
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::setCookiesFromDOM const): Return early if cookies are blocked and update the
persistent cookies expiration if needed.
(WebCore::NetworkStorageSession::deleteCookiesForHostnames): Implement this when receiving
IncludeHttpOnlyCookies parameter.
(WebCore::NetworkStorageSession::hasCookies const): Implement this.
(WebCore::NetworkStorageSession::getRawCookies const): Honor shouldAskITP parameter.
(WebCore::cookiesForSession): Ditto.
(WebCore::NetworkStorageSession::cookiesForDOM const): Ditto.
(WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const): Ditto.
2020-04-19 Simon Fraser <simon.fraser@apple.com>
Use Optional<FloatQuad> in TransformState
https://bugs.webkit.org/show_bug.cgi?id=144226
Reviewed by Sam Weinig.
Use Optional<> instead of pointers in TransformState, make it loggable, make FloatQuad loggable.
* platform/graphics/FloatQuad.cpp:
(WebCore::operator<<):
* platform/graphics/FloatQuad.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::flushCompositingState):
(WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect const):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
* platform/graphics/transforms/TransformState.cpp:
(WebCore::TransformState::operator=):
(WebCore::TransformState::mappedSecondaryQuad const):
(WebCore::TransformState::setLastPlanarSecondaryQuad):
(WebCore::TransformState::flattenWithTransform):
(WebCore::operator<<):
* platform/graphics/transforms/TransformState.h:
(WebCore::TransformState::setSecondaryQuad):
(WebCore::TransformState::lastPlanarSecondaryQuad const):
(WebCore::TransformState::isMappingSecondaryQuad const):
(WebCore::TransformState::accumulatedTransform const):
2020-04-19 Rob Buis <rbuis@igalia.com>
Remove unneeded code from FrameLoader::loadURL
https://bugs.webkit.org/show_bug.cgi?id=210696
Reviewed by Darin Adler.
Remove unneeded code from FrameLoader::loadURL, since the only way the load type can be Reload
is if loadFrameRequest set it, and the only way loadFrameRequest can set it is if cachePolicy
is ReloadIgnoringCacheData, so no need to set it again in FrameLoader::loadURL.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
2020-04-19 Brady Eidson <beidson@apple.com>
Add WKScriptMessageHandler API that asynchronously responds with a promise.
rdar://problem/57243492 and https://bugs.webkit.org/show_bug.cgi?id=206398
Reviewed by Andy Estes.
Covered by new API tests.
Updated for moving an #include into implementation files:
* bindings/js/JSDOMPromiseDeferred.cpp:
* bindings/js/JSDOMPromiseDeferred.h:
* html/HTMLMediaElement.cpp:
* page/DOMWindow.cpp:
* workers/service/ServiceWorkerGlobalScope.cpp:
* page/UserMessageHandler.cpp:
(WebCore::UserMessageHandler::postMessage): Return a promise to be fulfilled by the API client.
* page/UserMessageHandler.h:
* page/UserMessageHandler.idl:
* page/UserMessageHandlerDescriptor.h:
2020-04-19 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Add column spanning support for flexible table width
https://bugs.webkit.org/show_bug.cgi?id=210713
Reviewed by Antti Koivisto.
Test: fast/layoutformattingcontext/table-flex-width-colspans.html
This patch slightly changes the extra space distribution logic by using either the minimum or
the maximum width as the base initial width for the columns.
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutInFlowContent):
(WebCore::Layout::TableFormattingContext::computeColumnWidths):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace): Deleted.
* layout/tableformatting/TableFormattingContext.h:
2020-04-19 Emilio Cobos Álvarez <emilio@crisal.io>
Don't use the inherited custom properties to store environment variables.
https://bugs.webkit.org/show_bug.cgi?id=210707
Reviewed by Antti Koivisto.
It leaks this implementation detail when enumerating the computed style.
Tests: imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml.xhtml
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-logical-enumeration.html
* css/CSSVariableReferenceValue.cpp:
(WebCore::resolveVariableReference):
(WebCore::resolveTokenRange):
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):
2020-04-19 Antti Koivisto <antti@apple.com>
[CSS selectors] :is() / :where() should not allow pseudo-elements at parse-time
https://bugs.webkit.org/show_bug.cgi?id=210701
Reviewed by Anders Carlsson.
https://drafts.csswg.org/selectors/#matches:
"Pseudo-elements cannot be represented by the matches-any pseudo-class; they are not valid within :is()."
Test: fast/selectors/pseudo-element-in-is-where.html
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo):
2020-04-19 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Take border spacing into account when distributing column spanners width.
https://bugs.webkit.org/show_bug.cgi?id=210712
Reviewed by Antti Koivisto.
While distributing the column spanner extra space among individual columns,
the spacing between these columns (set by border-spacing) should be taken into
account and subtract it from the width to distribute.
<table style="border-spacing: 50px"><tr><td colspan=2>long long text</td></tr><tr><td>lo</td><td>xt</td><tr></table>
[long long text]
[lo] [xt]
The individual columns don't require any extra space from the spanner.
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::IntrinsicWidthConstraints::operator+=):
(WebCore::Layout::FormattingContext::IntrinsicWidthConstraints::operator-=):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::horizontalSpacing const):
(WebCore::Layout::TableGrid::totalHorizontalSpacing const): Deleted.
2020-04-19 Emilio Cobos Álvarez <emilio@crisal.io>
Fix the logic to decide whether a property is enumerated in a computed style declaration.
https://bugs.webkit.org/show_bug.cgi?id=210695
Reviewed by Antti Koivisto.
Fix the logic to decide whether a property is enumerated in a computed
style declaration.
Logical properties don't need stylebuilder code, but still should be
generated. Using the specification->category for this seems a bit
hacky, but unclear if it's worse than adding a new flag.
Tests: fast/css/getComputedStyle/computed-style-enumeration.html
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-logical-enumeration.html
* css/makeprop.pl:
(skippedFromComputedStyle):
(isLogical):
(sortWithPrefixedPropertiesLast):
2020-04-18 Antti Koivisto <antti@apple.com>
[CSS selectors] Support :where() pseudo class
https://bugs.webkit.org/show_bug.cgi?id=210690
Reviewed by Sam Weinig.
"The Specificity-adjustment pseudo-class, :where(), is a functional pseudo-class with the same
syntax and functionality as :is(). Unlike :is(), neither the :where pseudo-class, nor any of
its arguments contribute to the specificity of the selector—its specificity is always zero.
This is useful for introducing filters in a selector while keeping the associated style
declarations easy to override."
https://drafts.csswg.org/selectors-4/#zero-matches
In terms of implementation this is just another alias for :is() with different (always 0) specificity.
Test: fast/selectors/where-specificity.html
* css/CSSSelector.cpp:
(WebCore::simpleSelectorSpecificityInternal):
Here is where it differs from PseudoClassIs.
(WebCore::CSSSelector::selectorText const):
* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne const):
* css/SelectorPseudoClassAndCompatibilityElementMap.in:
* css/parser/CSSSelectorParser.cpp:
(WebCore::isOnlyPseudoClassFunction):
(WebCore::CSSSelectorParser::consumePseudo):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
2020-04-18 Rob Buis <rbuis@igalia.com>
Reduce parameter list of the FrameLoadRequest constructor
https://bugs.webkit.org/show_bug.cgi?id=210668
Reviewed by Darin Adler.
Reduce parameter list of the FrameLoadRequest constructor by
instead using various setters. By choosing the most common
defaults the actual number of setters to call are minimized.
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::openInNewTab):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::navigate):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::handleProvisionalLoadFailureFromContentFilter):
* loader/FrameLoadRequest.cpp:
(WebCore::FrameLoadRequest::FrameLoadRequest):
* loader/FrameLoadRequest.h:
(WebCore::FrameLoadRequest::FrameLoadRequest):
(WebCore::FrameLoadRequest::disableShouldReplaceDocumentIfJavaScriptURL):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::changeLocation):
(WebCore::FrameLoader::loadURLIntoChildFrame):
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::scheduleLocationChange):
* page/ContextMenuController.cpp:
(WebCore::openNewWindow):
(WebCore::ContextMenuController::contextMenuItemSelected):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
* page/DragController.cpp:
(WebCore::DragController::performDragOperation):
2020-04-18 David Kilzer <ddkilzer@apple.com>
Attempt #3 to fix tvOS build
Unreviewed.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
- Use !PLATFORM(APPLETV) to comment out functions declared within
ENABLE(VIDEO_PRESENTATION_MODE) from r260307 and r260308.
2020-04-18 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Move DataRef.h from WebCore to WTF to utilize it in JSC
https://bugs.webkit.org/show_bug.cgi?id=210689
Reviewed by Anders Carlsson.
No behavior change, just moving header from WebCore to WTF.
* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* rendering/style/NinePieceImage.h:
* rendering/style/RenderStyle.h:
* rendering/style/SVGRenderStyle.h:
* rendering/style/StyleRareInheritedData.cpp:
* rendering/style/StyleRareInheritedData.h:
* rendering/style/StyleRareNonInheritedData.h:
2020-04-18 David Kilzer <ddkilzer@apple.com>
Attempt #2 to fix tvOS build
Unreviewed.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
- Add #if ENABLE(VIDEO_PRESENTATION_MODE)/#endif to protect
methods defined in MediaPlayerPrivate.h.
- The previous commit was (r260307) also to fix tvOS, not watchOS.
2020-04-18 David Kilzer <ddkilzer@apple.com>
Attempt to fix watchOS build
Unreviewed.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
- Add #if ENABLE(VIDEO_PRESENTATION_MODE)/#endif to protect
methods defined in MediaPlayerPrivate.h.
2020-04-17 Simon Fraser <simon.fraser@apple.com>
Group overflow controls layers into a single container layer
https://bugs.webkit.org/show_bug.cgi?id=210675
Reviewed by Zalan Bujtas.
Overflow control layers are going to change z-order in a future change. To make this
easier, group the overflow controls layer into their own container layer.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateDebugIndicators):
(WebCore::RenderLayerBacking::updateGeometry): Size the overflow controls layer using paddingBoxRectIncludingScrollbar().
(WebCore::RenderLayerBacking::updateInternalHierarchy): New parenting.
(WebCore::RenderLayerBacking::updateOverflowControlsLayers): Some refactoring with a nice lambda.
(WebCore::RenderLayerBacking::positionOverflowControlsLayers): Lovely lambda here. Nice.
* rendering/RenderLayerBacking.h:
2020-04-17 Kate Cheney <katherine_cheney@apple.com>
Enable service workers for app-bound domains
https://bugs.webkit.org/show_bug.cgi?id=210451
<rdar://problem/61479474>
Reviewed by Brent Fulgham.
SWServer now retrieves the app-bound domains from the UI Process and
only continues with the load if the proper entitlement is present
or the load is coming from an app-bound domain.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistrationFromStore):
(WebCore::SWServer::SWServer):
(WebCore::SWServer::validateRegistrationDomain):
(WebCore::SWServer::scheduleJob):
* workers/service/server/SWServer.h:
2020-04-17 Dean Jackson <dino@apple.com>
[WebGL] Confirm there are no errors when setting up framebuffers
https://bugs.webkit.org/show_bug.cgi?id=210632
<rdar://problem/61916680>
Reviewed by Simon Fraser.
We're seeing crashes on macOS inside GraphicsContextGL::reshape().
Specifically when we submit work at the end of the function via
glFlush.
At the moment the cause is a mystery, because we should bail out
before then if the multisample renderbuffer was not complete. In
the hope that it helps somewhat, add a call to glGetError to double
check that there isn't anything horribly wrong before we talk to
the GPU.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::WebGL2RenderingContext): If the underlying
GCGL context was marked as "LOST" during initialization, skip the rest of our
initialization.
* html/canvas/WebGLRenderingContext.cpp: Ditto.
(WebCore::WebGLRenderingContext::WebGLRenderingContext):
* html/canvas/WebGLRenderingContextBase.cpp: Ditto.
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
* platform/graphics/angle/GraphicsContextGLANGLE.cpp: Check for a GL error during
setup and, if there is one, skip directly into a LOST state.
(WebCore::GraphicsContextGLOpenGL::reshape):
* platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:
(WebCore::GraphicsContextGLOpenGL::reshape):
2020-04-17 Peng Liu <peng.liu6@apple.com>
Cleanup the macros for video fullscreen and picture-in-picture
https://bugs.webkit.org/show_bug.cgi?id=210638
Reviewed by Eric Carlson.
A follow-up patch to fix build failures of r260259.
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
2020-04-17 David Kilzer <ddkilzer@apple.com>
REGRESSION (r234105): [iOS] WKColorButton leaks a UIColor
<https://webkit.org/b/210658>
<rdar://problem/61938137>
Reviewed by Darin Adler.
* html/ColorInputType.cpp:
(WebCore::ColorInputType::isKeyboardFocusable const):
* page/Chrome.cpp:
(WebCore::Chrome::createColorChooser):
- Drive-by fix of unreachable code on PLATFORM(IOS_FAMILY).
2020-04-17 Don Olmstead <don.olmstead@sony.com>
[CMake] Add WebKit::WebCore target
https://bugs.webkit.org/show_bug.cgi?id=210445
Reviewed by Michael Catanzaro.
Add a WebKit::WebCore target. Remove the WebCoreHeaderInterface target since
the WebKit::WebCore target is functionaly the same.
* CMakeLists.txt:
2020-04-17 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, reverting r260245.
The tests added with this change are frequently failing on
macOS bots.
Reverted changeset:
"Safari doesn't apply frameRate limit when request stream from
Camera"
https://bugs.webkit.org/show_bug.cgi?id=210186
https://trac.webkit.org/changeset/260245
2020-04-17 Per Arne Vollan <pvollan@apple.com>
Unreviewed build fix.
* platform/cocoa/AGXCompilerService.cpp:
2020-04-17 Antoine Quint <graouts@apple.com>
Stop including style rules related to media controls in the UA style sheet when Modern Media Controls are enabled
https://bugs.webkit.org/show_bug.cgi?id=210606
Reviewed by Antti Koivisto and Daniel Bates.
There is no need to insert style rules related to media controls in the UA stylesheet when Modern Media Controls are enabled.
There is one rule from mediaControlsApple.css for the default sizing of <audio> that makes sense broadly for content on the Web
so we move that to html.css. We also set the background-color property for media documents in html.css.
* Modules/mediacontrols/mediaControlsApple.css:
(audio): Deleted.
(body:-webkit-full-page-media): Deleted.
* Modules/mediacontrols/mediaControlsiOS.css:
(body:-webkit-full-page-media): Deleted.
* Modules/modern-media-controls/controls/media-document.css:
(:host(.media-document)):
* css/html.css:
(body:-webkit-full-page-media):
(audio):
* css/mediaControls.css:
(body:-webkit-full-page-media): Deleted.
* style/UserAgentStyle.cpp:
(WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement):
2020-04-17 Peng Liu <peng.liu6@apple.com>
Cleanup the macros for video fullscreen and picture-in-picture
https://bugs.webkit.org/show_bug.cgi?id=210638
Reviewed by Eric Carlson.
Replace some "#if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))"
and all "#if (PLATFORM(IOS_FAMILY) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))"
with "#if ENABLE(VIDEO_PRESENTATION_MODE)".
No new tests, no functional change.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaEngineWasUpdated):
(WebCore::HTMLMediaElement::setVideoFullscreenStandby):
* html/HTMLMediaElement.h:
* html/HTMLVideoElement.cpp:
* html/HTMLVideoElement.h:
* platform/PictureInPictureSupport.h:
* platform/cocoa/VideoFullscreenChangeObserver.h:
* platform/cocoa/VideoFullscreenModel.h:
* platform/cocoa/VideoFullscreenModelVideoElement.h:
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
* platform/graphics/MediaPlayer.cpp:
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(WebCore::supportsPictureInPicture):
2020-04-17 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Resolve the minimum width for overlapping spanner columns
https://bugs.webkit.org/show_bug.cgi?id=210654
Reviewed by Antti Koivisto.
The extra horizontal space distribution is based on the columns' minimum widths.
In case of column spanners, first we need to distribute the spanner's minimum
width across the columns using the non-spanning minimum widths as the distribution ratio.
When there's no non-spanning minimum width for a column (all rows have column spanners for tbis particular column)
the minimum width gets distributed equally across the spanned columns. This distribution starts with the shortest columns spans
so that we can use these resolved column widths to compute the wider ones.
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
2020-04-17 Claudio Saavedra <csaavedra@igalia.com>
[GTK] Update for GdkKeymap API changes
https://bugs.webkit.org/show_bug.cgi?id=210642
Reviewed by Adrian Perez de Castro.
No new tests needed.
gdk_keymap_get_default() is deprecated in GTK+ 3.22, so use
gdk_keymap_get_for_display() instead. Since in GTK4 this method is
removed to gdk_display_get_keymap(), add a helper to
GtkVersioning.h to avoid cluttering with ifdefs all over the
place.
* platform/gtk/GtkVersioning.h:
(gdk_keymap_get_for_display):
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::PlatformKeyboardEvent::currentCapsLockState):
(WebCore::PlatformKeyboardEvent::modifiersContainCapsLock):
2020-04-17 Oriol Brufau <obrufau@igalia.com>
Revert "[css-grid] Exclude implicit grid tracks from the resolved value"
https://bugs.webkit.org/show_bug.cgi?id=210617
Reviewed by Manuel Rego Casasnovas.
Revert r254561 since it appears to be breaking site authoring tools
which were relying on the previous behaviour.
Tests: fast/css-grid-layout/grid-auto-columns-rows-get-set.html
fast/css-grid-layout/grid-columns-rows-get-set.html
fast/css-grid-layout/grid-template-shorthand-get-set.html
fast/css-grid-layout/mark-as-infinitely-growable.html
fast/css-grid-layout/named-grid-lines-computed-style-implicit-tracks.html
fast/css-grid-layout/negative-growth-share-as-infinity-crash.html
imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-support-flexible-lengths-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-support-grid-template-columns-rows-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-support-named-grid-lines-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-support-repeat-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-template-columns-rows-resolved-values-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-flexible-lengths-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-grid-template-columns-rows-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-named-grid-lines-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-repeat-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-template-columns-rows-resolved-values-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-layout-properties.html
imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-withcontent.html
imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-withcontent.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForGridTrackList):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::trackSizesForComputedStyle const):
2020-04-17 Per Arne Vollan <pvollan@apple.com>
[iOS] Deny iokit open access to graphics related classes
https://bugs.webkit.org/show_bug.cgi?id=210616
Reviewed by Darin Adler.
Deny iokit open access to graphics related classes in the WebContent process on iOS, but issue
extensions for these for some devices which still need access to them.
API test: WebKit.IOKitOpenSandboxAccessForDeviceWithAGXCompilerService
* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/AGXCompilerService.cpp: Added.
(WebCore::setDeviceHasAGXCompilerServiceForTesting):
(WebCore::deviceHasAGXCompilerService):
* platform/cocoa/AGXCompilerService.h: Added.
* testing/Internals.cpp:
(WebCore::Internals::hasSandboxIOKitOpenAccessToClass):
* testing/Internals.h:
* testing/Internals.idl:
* testing/Internals.mm:
(WebCore::Internals::hasSandboxIOKitOpenAccessToClass):
2020-04-17 Youenn Fablet <youenn@apple.com>
Safari doesn't apply frameRate limit when request stream from Camera
https://bugs.webkit.org/show_bug.cgi?id=210186
<rdar://problem/61452794>
Reviewed by Eric Carlson.
Add support to RealtimeVideoSource to decimate the video samples based on the observed frame rate of its capture source.
This allows supporting two tracks using the same capture device, one track being low frame rate and the other one high frame rate.
Clean-up refactoring to make RealtimeVideoSource directly inherit from RealtimeVideoCaptureSource.
Migrate size and format of frame adaptation from RealtimeVideoCaptureSource to RealtimeVideoSource.
Fix mock capture source to update its frame rate when asked by applyConstraints.
Tests: fast/mediastream/mediastreamtrack-video-frameRate-clone-decreasing.html
fast/mediastream/mediastreamtrack-video-frameRate-clone-increasing.html
fast/mediastream/mediastreamtrack-video-frameRate-decreasing.html
fast/mediastream/mediastreamtrack-video-frameRate-increasing.html
* platform/mediastream/RealtimeVideoCaptureSource.cpp:
(WebCore::RealtimeVideoCaptureSource::dispatchMediaSampleToObservers):
(WebCore::RealtimeVideoCaptureSource::clientUpdatedSizeAndFrameRate):
* platform/mediastream/RealtimeVideoCaptureSource.h:
(WebCore::RealtimeVideoCaptureSource::observedFrameRate const):
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::RealtimeVideoSource):
(WebCore::m_source):
(WebCore::RealtimeVideoSource::adaptVideoSample):
(WebCore::RealtimeVideoSource::videoSampleAvailable):
* platform/mediastream/RealtimeVideoSource.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::setFrameRateWithPreset):
* testing/Internals.cpp:
(WebCore::Internals::observeMediaStreamTrack):
2020-04-17 Alexey Shvayka <shvaikalesh@gmail.com>
MediaQueryList should extend EventTarget
https://bugs.webkit.org/show_bug.cgi?id=203288
Reviewed by Darin Adler.
Initially, CSSOM View Module specification [1] had a custom callback mechanism with addListener() and removeListener(),
and the callback was invoked with the associated MediaQueryList as argument.
Now the normal event mechanism [2] is used instead. For backwards compatibility, addListener() and removeListener()
methods are basically aliases for addEventListener() and removeEventListener(), respectively, and the "change" event
masquerades as a MediaQueryList.
This patch implements new event mechanism, aligning WebKit with Blink and SpiderMonkey, and also fixes
a few minor spec incompatibilities: mandatory listener argument, "handleEvent" support, and listeners call order.
[1]: https://www.w3.org/TR/2011/WD-cssom-view-20110804/#mediaquerylist
[2]: https://www.w3.org/TR/cssom-view-1/#mediaquerylist
Tests: fast/media/media-query-list-07.html
web-platform-tests/css/cssom-view/MediaQueryList-addListener-handleEvent.html
web-platform-tests/css/cssom-view/MediaQueryList-addListener-removeListener.html
web-platform-tests/css/cssom-view/MediaQueryList-extends-EventTarget.html
web-platform-tests/css/cssom-view/MediaQueryList-extends-EventTarget-interop.html
web-platform-tests/css/cssom-view/MediaQueryListEvent.html
web-platform-tests/css/cssom-view/idlharness.html
web-platform-tests/css/cssom-view/matchMedia.html
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* bindings/scripts/test/JS/*: Updated.
* css/MediaQueryList.cpp:
(WebCore::MediaQueryList::MediaQueryList):
(WebCore::MediaQueryList::create):
(WebCore::MediaQueryList::~MediaQueryList):
(WebCore::MediaQueryList::addListener):
(WebCore::MediaQueryList::removeListener):
* css/MediaQueryList.h:
* css/MediaQueryList.idl:
* css/MediaQueryListEvent.cpp: Added.
(WebCore::MediaQueryListEvent::MediaQueryListEvent):
* css/MediaQueryListEvent.h: Added.
* css/MediaQueryListEvent.idl: Added.
* css/MediaQueryListListener.h: Removed.
* css/MediaQueryListListener.idl: Removed.
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::documentDestroyed):
(WebCore::MediaQueryMatcher::addMediaQueryList):
(WebCore::MediaQueryMatcher::removeMediaQueryList):
(WebCore::MediaQueryMatcher::matchMedia):
(WebCore::MediaQueryMatcher::evaluateAll):
(WebCore::MediaQueryMatcher::addListener): Deleted.
(WebCore::MediaQueryMatcher::removeListener): Deleted.
* css/MediaQueryMatcher.h:
* dom/EventNames.in:
* dom/EventTarget.h:
(WebCore::EventTarget::removeEventListener):
* dom/EventTargetFactory.in:
2020-04-17 Adrian Perez de Castro <aperez@igalia.com>
Unreviewed build fix after r260123
No new tests needed.
* platform/gtk/CursorGtk.cpp:
(WebCore::createCustomCursor): Pass missing pixel buffer data pointer to gdk_memory_texture_new().
2020-04-17 Youenn Fablet <youenn@apple.com>
Make use of WeakHashSet for MediaStreamTrackPrivate and RealtimeMediaSource observers
https://bugs.webkit.org/show_bug.cgi?id=210492
Reviewed by Geoffrey Garen.
We are making use of WeakHashSet to improve the robustness of the code.
For that purpose we use the new WeakHashSet::forEach method.
No change of behavior.
* Modules/mediarecorder/MediaRecorder.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::forEachObserver const):
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::forEachObserver):
(WebCore::MediaStreamTrackPrivate::addObserver):
(WebCore::MediaStreamTrackPrivate::removeObserver):
(WebCore::MediaStreamTrackPrivate::forEachObserver const): Deleted.
* platform/mediastream/MediaStreamTrackPrivate.h:
(WebCore::MediaStreamTrackPrivate::hasObserver const): Deleted.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::addAudioSampleObserver):
(WebCore::RealtimeMediaSource::removeAudioSampleObserver):
(WebCore::RealtimeMediaSource::addObserver):
(WebCore::RealtimeMediaSource::removeObserver):
(WebCore::RealtimeMediaSource::forEachObserver):
(WebCore::RealtimeMediaSource::notifyMutedObservers):
(WebCore::RealtimeMediaSource::requestToEnd):
(WebCore::RealtimeMediaSource::forEachObserver const): Deleted.
(WebCore::RealtimeMediaSource::notifyMutedObservers const): Deleted.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeOutgoingVideoSource.h:
2020-04-17 Rob Buis <rbuis@igalia.com>
Move allowPlugins to FrameLoader
https://bugs.webkit.org/show_bug.cgi?id=205876
Reviewed by Darin Adler.
Move allowPlugins to FrameLoader to reduce
pointer dereferences and lessen dependency
on SubframeLoader. Also rename to
arePluginsEnabled since the method is asking
the Setting with the same name.
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::rendererIsEverNeeded):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::arePluginsEnabled):
* loader/FrameLoader.h:
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::createJavaAppletWidget):
(WebCore::SubframeLoader::allowPlugins): Deleted.
* loader/SubframeLoader.h:
* plugins/DOMMimeType.cpp:
(WebCore::DOMMimeType::enabledPlugin const):
2020-04-17 Tomoki Imai <Tomoki.Imai@sony.com>
Fix an integer overflow in WebCrypto AES-CTR Mac implementation, which may detect a false loop
https://bugs.webkit.org/show_bug.cgi?id=210540
(1 << counterLength) causes an integer overflow, and the undefined behavior.
The longest valid counterLength on 64 bit machine is 63,
and the literal 1 is considered as 32-bit signed integer.
Left shifting 1 beyond or to sign-bit is undefined behavior in C++ spec.
- https://en.cppreference.com/w/cpp/language/integer_literal
- https://en.cppreference.com/w/cpp/language/operator_arithmetic#Bitwise_shift_operators
This issue is originally found in https://bugs.webkit.org/show_bug.cgi?id=208186#c2
Reviewed by Jiewen Tan.
Test: crypto/subtle/aes-ctr-import-key-encrypt.html
* crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
(WebCore::transformAES_CTR):
2020-04-16 Simon Fraser <simon.fraser@apple.com>
Scrolling-tree hit-testing is off by top content inset
https://bugs.webkit.org/show_bug.cgi?id=210629
<rdar://problem/61848883>
Reviewed by Tim Horton.
r259936 added a point conversion from the superlayer of the root content layer,
to fix RTL, but this also pulled in top content inset, which we don't want.
Instead, do the RTL fix by factoring in scroll origin.
Test: fast/scrolling/mac/async-scroll-overflow-top-inset.html
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::scrollingNodeForPoint):
2020-04-16 Sergio Villar Senin <svillar@igalia.com>
Unreviewed build fix for non unified builds.
* html/OffscreenCanvas.cpp: Added missing include.
* html/canvas/CanvasRenderingContext2DBase.cpp: Ditto.
* layout/tableformatting/TableFormattingContextGeometry.cpp: Ditto.
* workers/WorkerAnimationController.cpp:
(WebCore::WorkerAnimationController::requestAnimationFrame): Added namespace.
* workers/WorkerAnimationController.h: Added missing include.
2020-04-16 Simon Fraser <simon.fraser@apple.com>
A slow-starting swipe always latches on the root node
https://bugs.webkit.org/show_bug.cgi?id=210618
Reviewed by Tim Horton.
If the first event in a wheel event gesture had zero delta, scrolling thread logic would
always latch on the root node and the rest of the gesture would scroll the document.
Fix by not latching for events with zero delta.
Test: scrollingcoordinator/mac/latching/zero-delta-began-should-not-latch.html
* page/scrolling/ScrollingTreeLatchingController.cpp:
(WebCore::ScrollingTreeLatchingController::nodeDidHandleEvent):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::canScrollWithWheelEvent const):
(WebCore::ScrollingTreeScrollingNode::eventCanScrollContents const):
(WebCore::ScrollingTreeScrollingNode::scrollLimitReached const): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.h:
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::shouldConsiderLatching const): FIXME comment. Ideally this would
check delta() that that's too scarey at the moment.
2020-04-16 Jer Noble <jer.noble@apple.com>
Unreviewed build-fix after r260182; guard call to fullscreenManager() for ports which do not
ENABLE(FULLSCREEN_API).
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::updateMediaUsageIfChanged):
2020-04-16 Claudio Saavedra <csaavedra@igalia.com>
[GTK] Deprecation-guards fixes
https://bugs.webkit.org/show_bug.cgi?id=210600
Reviewed by Adrian Perez de Castro.
No new tests needed.
* platform/gtk/RenderThemeGadget.cpp:
(WebCore::RenderThemeGadget::backgroundColor const): Add missing
deprecation guards for deprecated GtkStyleContext API.
* platform/gtk/ThemeGtk.cpp:
(WebCore::ThemeGtk::ensurePlatformColors const): Switch to WK
deprecation guards from glib ones.
2020-04-16 Jack Lee <shihchieh_lee@apple.com>
ASSERTION FAILED: candidate.isCandidate() in WebCore::canonicalizeCandidate
https://bugs.webkit.org/show_bug.cgi?id=130844
<rdar://59535009>
Reviewed by Geoffrey Garen.
Call Position::isCandidate() in PositionIterator::isCandidate so behavior of
candidate search become identical in both classes.
Test: editing/inserting/insert-in-br.html
* dom/PositionIterator.cpp:
(WebCore::PositionIterator::isCandidate const):
2020-04-16 Rob Buis <rbuis@igalia.com>
Remove outdated comment from FrameLoader
https://bugs.webkit.org/show_bug.cgi?id=210607
Reviewed by Darin Adler.
Remove comment from FrameLoader that is not valid/important anymore because
addExtraFieldsToRequest does not set the Origin header since r259036.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadDifferentDocumentItem):
2020-04-16 Chris Fleizach <cfleizach@apple.com>
AX: Need method for setting selected range from NSRange
https://bugs.webkit.org/show_bug.cgi?id=210593
Reviewed by Darin Adler.
Allow setSelection to work outside of text controls.
Test: accessibility/ios-simulator/non-textcontrol-set-selection.html
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilitySetSelectedTextRange:]):
2020-04-16 Jer Noble <jer.noble@apple.com>
[macOS] Update ScreenTime as playback state changes
https://bugs.webkit.org/show_bug.cgi?id=210518
<rdar://problem/61181092>
Reviewed by Eric Carlson.
Follow up to r260182; Pass a WeakPtr into our task queue in sessionWillEndPlayback rather than a bare pointer.
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::sessionWillEndPlayback):
2020-04-16 Said Abou-Hallawa <sabouhallawa@apple.com>
Captured ThreadedScrollingTree should check its m_scrollingCoordinator before calling its methods
https://bugs.webkit.org/show_bug.cgi?id=210570
Reviewed by Simon Fraser.
m_scrollingCoordinator may be nullified before asynchronously calling its
method scheduleUpdateScrollPositionAfterAsyncScroll(). Check if it is
not null before calling this method.
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
2020-04-16 Zalan Bujtas <zalan@apple.com>
Crash in IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded when min-size can not be resolved
https://bugs.webkit.org/show_bug.cgi?id=210584
<rdar://problem/56685237>
Reviewed by Manuel Rego Casasnovas.
Use the initial value of 0 when the min-height can't be resolved.
Test: fast/css-grid-layout/crash-when-min-height-cant-be-resolved.html
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded const):
2020-04-16 Adrian Perez de Castro <aperez@igalia.com>
Non-unified build fixes mid April 2020 edition
https://bugs.webkit.org/show_bug.cgi?id=210599
Unreviewed build fix.
No new tests needed.
* bindings/js/JSNavigatorCustom.cpp: Add missing JavaScriptCore/JSCJSValue.h header.
(WebCore::JSNavigator::getUserMedia): Prefix with the JSC:: namespace where needed.
* dom/ShadowRoot.cpp: Add missing WebAnimation.h header.
* dom/SimpleRange.cpp: Add missing NodeTraversal.h header.
* editing/RemoveNodePreservingChildrenCommand.cpp: Add missing Editing.h header.
* page/MemoryRelease.cpp: Add missing JavaScriptCore/VM.h header.
* page/PageConfiguration.cpp: Add missing UserContentURLPattern.h header.
* page/scrolling/ScrollingTree.h: Add missing EventTrackingRegions.h header.
* page/scrolling/ScrollingTreeLatchingController.cpp: Add missing Logging.h header.
* page/scrolling/ScrollingTreeLatchingController.h: Add missing ScrollTypes.h header,
and forward declaration for WebCore::PlatformWheelEvent.
* workers/service/server/SWServerJobQueue.cpp: Add missing Logging.h header.
2020-04-16 Simon Fraser <simon.fraser@apple.com>
[Async overflow scrolling] Slow-repaint overflow scroll have force their enclosing scrollers to be slow too
https://bugs.webkit.org/show_bug.cgi?id=210591
Reviewed by Antti Koivisto.
If an overflow:scroll has background-attachment:fixed in the contents, then both it and all its containing-block
scrolling ancestors have to be slow-scrolling too, because scrolling any of them affects the local geometry
of the fixed backgrounds which paint on scroll.
Implement this by having the scrolling tree do a post-commit pass over the nodes with sync scrolling reasons
(which we collect during the commit phase). For each slow-scrolling node, walk its ancestor chain (via
proxy nodes when necessary) and mark the scrolling node ancestors with the "DescendantScrollersHaveSynchronousScrolling"
reason.
For testing, expose internals.scrollingTreeAsText(), which needs a bit of synchronization via
waitForScrollingTreeCommit() since the commit happens on the scrolling thread.
Tests: scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-nested-non-cb-overflow.html
scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-nested-overflow.html
scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-nested-overflow2.html
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText const):
(WebCore::AsyncScrollingCoordinator::scrollingTreeAsText const):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::scrollingStateTreeAsText const):
(WebCore::ScrollingCoordinator::scrollingTreeAsText const):
(WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText):
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinatorTypes.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
(WebCore::ScrollingTree::updateTreeFromStateNodeRecursive):
(WebCore::ScrollingTree::propagateSynchronousScrollingReasons):
(WebCore::ScrollingTree::updateTreeFromStateNode): Deleted.
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::waitForScrollingTreeCommit):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::commitStateAfterChildren):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::waitForScrollingTreeCommit):
* page/scrolling/ThreadedScrollingTree.h:
* testing/Internals.cpp:
(WebCore::Internals::scrollingTreeAsText const):
* testing/Internals.h:
* testing/Internals.idl:
2020-04-16 Claudio Saavedra <csaavedra@igalia.com>
Clean a couple of unused-parameters warnings
https://bugs.webkit.org/show_bug.cgi?id=210596
Unreviewed.
No new tests needed.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const): Remove
a spurious UNUSED_PARAM() for an actually used parameter.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::updateSecurityDiscCharacters):
2020-04-16 Eric Carlson <eric.carlson@apple.com>
[macOS] Update ScreenTime as playback state changes
https://bugs.webkit.org/show_bug.cgi?id=210518
<rdar://problem/61181092>
Reviewed by Jer Noble.
Test: media/media-usage-state.html
Pass media element state to the UI process whenever it changes.
* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::mediaSessionUniqueIdentifier const):
* html/HTMLMediaElement.h:
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::MediaElementSession):
(WebCore::MediaElementSession::~MediaElementSession):
(WebCore::MediaElementSession::updateMediaUsageIfChanged):
* html/MediaElementSession.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::addMediaUsageManagerSession):
(WebCore::ChromeClient::updateMediaUsageManagerSessionState):
(WebCore::ChromeClient::removeMediaUsageManagerSession):
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::PlatformMediaSession):
* platform/audio/PlatformMediaSession.h:
(WebCore::PlatformMediaSession::updateMediaUsageIfChanged):
(WebCore::PlatformMediaSession::mediaSessionIdentifier const):
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary):
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::scheduleUpdateSessionStatus):
(WebCore::PlatformMediaSessionManager::sessionDidEndRemoteScrubbing):
(WebCore::PlatformMediaSessionManager::scheduleUpdateNowPlayingInfo): Deleted.
* platform/audio/cocoa/MediaSessionManagerCocoa.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::scheduleUpdateSessionStatus):
(WebCore::MediaSessionManagerCocoa::sessionWillBeginPlayback):
(WebCore::MediaSessionManagerCocoa::sessionDidEndRemoteScrubbing):
(WebCore::MediaSessionManagerCocoa::removeSession):
(WebCore::MediaSessionManagerCocoa::sessionWillEndPlayback):
(WebCore::MediaSessionManagerCocoa::clientCharacteristicsChanged):
(WebCore::MediaSessionManagerCocoa::sessionCanProduceAudioChanged):
(WebCore::MediaSessionManagerCocoa::scheduleUpdateNowPlayingInfo): Deleted.
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::resetRestrictions):
(WebCore::MediaSessionManageriOS::sessionWillBeginPlayback):
* platform/graphics/MediaUsageInfo.h: Added.
(WebCore::MediaUsageInfo::operator== const):
(WebCore::MediaUsageInfo::operator!= const):
(WebCore::MediaUsageInfo::encode const):
(WebCore::MediaUsageInfo::decode):
* testing/Internals.cpp:
(WebCore::Internals::setMediaElementRestrictions):
(WebCore::Internals::mediaUsageState const):
* testing/Internals.h:
* testing/Internals.idl:
2020-04-16 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Implement JSMapIterator/JSSetIterator with JSInternalFieldObjectImpl
https://bugs.webkit.org/show_bug.cgi?id=210023
Reviewed by Keith Miller.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize):
2020-04-16 Philippe Normand <pnormand@igalia.com>
Unreviewed, fix GStreamer build warnings.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::cdmInstanceDetached):
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::handleErrorConditionFromStreamingThread):
2020-04-16 Carlos Alberto Lopez Perez <clopez@igalia.com>
[GTK] MiniBrowser opens new windows too small causing failures on some WPT tests
https://bugs.webkit.org/show_bug.cgi?id=210206
Reviewed by Carlos Garcia Campos.
Some WPT tests (when executed with the WPT runner via WebDriver)
open new browser windows via JavaScript invoking Window.open()
and then run the test on this new window.
The size of the new window is not specified, and we were failing
to provide a default window size, so it was using the minimum of
100x100 which its just too small for some test that later call
document.elementFromPoint() on some coordinates
that are outside of that size.
To fix that provide the size of the default GTK window to WebCore
if the application sets one via gtk_window_set_default_size().
And if not, then use the size of the previous window.
Also change the way we position the new window to work better when
the system uses more than one monitor. Previously to get the default
coordinates of the new window we were using gdk_display_get_monitor()
with just the first monitor available.
This causes issues in the calculation of the available space when
using several monitors. Instead get the monitor in use by looking
at the current GDK root window.
Tests: TestWebKitAPI/WebKit2Gtk/TestUIClient:/webkit/WebKitWebView/open-window-default-size
and TestWebKitAPI/WebKit2Gtk/TestUIClient:/webkit/WebKitWebView/open-window-no-default-size
* loader/FrameLoader.cpp:
(WebCore::createWindow):
* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::getCurrentScreenMonitor):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
2020-04-16 Tomoki Imai <Tomoki.Imai@sony.com>
TextureMapper renders video element with "object-fit: cover" incorrectly
https://bugs.webkit.org/show_bug.cgi?id=210544
Reviewed by Žan Doberšek.
Propagate GraphicsLayer::contentsClippingRect information to TextureMapperLayer
to properly clip the outside of DOM element when the element has "object-fit: cover".
Unfortunately, the test is disabled on WebKitGTK due to bug 177536, bug 163528.
Test: compositing/video/video-object-fit.html
* platform/graphics/nicosia/NicosiaPlatformLayer.h:
(Nicosia::CompositionLayer::flushState):
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelf): Clip using propagated contentsClippingRect when rendering m_contentsLayer.
(WebCore::TextureMapperLayer::setContentsClippingRect):
* platform/graphics/texmap/TextureMapperLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setContentsClippingRect):
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2020-04-15 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Password obscuring dots drawn with the system font are too small
https://bugs.webkit.org/show_bug.cgi?id=209692
<rdar://problem/60788385>
Reviewed by Darin Adler.
The system font's U+2022 BULLET glyph got smaller. Instead, we should match
the native platform's behavior of using U+F79A. However, U+F79A is a PUA
character, meaning different fonts will draw it in arbitrary different ways.
Therefore, we should only use this character if we're drawing it with the
system font. Otherwise, we can take the old codepath and use U+2022 BULLET.
Tests: fast/text/text-security-disc-bullet-pua.html
platform/mac/fast/text/text-security-disc-bullet-pua-mac.html
platform/ios/fast/text/text-security-disc-bullet-pua-ios-new.html
platform/ios/fast/text/text-security-disc-bullet-pua-ios-old.html
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::text const):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::constructTextRun):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForStyle):
* rendering/SimpleLineLayoutCoverage.cpp:
(WebCore::SimpleLineLayout::printReason):
* rendering/SimpleLineLayoutCoverage.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::computeTextSecurityDiscShouldUsePUACodePoint const):
* rendering/style/RenderStyle.h:
2020-04-15 Jer Noble <jer.noble@apple.com>
REGRESSION (r260102): ASSERTION FAILED: m_arbitrators.contains(proxy) in WebKit::SharedArbitrator::endRoutingArbitrationForArbitrator
https://bugs.webkit.org/show_bug.cgi?id=210589
<rdar://problem/61844208>
Reviewed by Eric Carlson.
Track whether the session successfully entered routing arbitration and only call
leaveRoutingAbritration() if entering was sucessful.
* platform/audio/mac/AudioSessionMac.mm:
(WebCore::AudioSession::setCategory):
2020-04-15 Simon Fraser <simon.fraser@apple.com>
[Async overflow scroll] background-attachment:fixed needs to disable async overflow scrolling
https://bugs.webkit.org/show_bug.cgi?id=210581
Reviewed by Zalan Bujtas.
Start setting synchronousScrollingReasons on overflow scrolling nodes if the scrolling would move content
that has background-attachment:fixed (we can't use async scrolling there, because such content needs painting
on each scroll).
When style changes, we call FrameView::{add|remove}SlowRepaintObject(). That sets the "needsScrollingTreeUpdate"
compositing bit on the enclosing RenderLayer (note, any RenderLayer, not necessarily a scrolling one).
Setting that bit will ensure that RenderLayerCompositor does an "update backing and hierarchy" traversal,
and during this traversal, if we see a layer with the bit set, scrollingTreeState.needSynchronousScrollingReasonsUpdate
becomes true. At the end of the traversal this is used as a signal to call updateSynchronousScrollingNodes().
updateSynchronousScrollingNodes() needs to clear synchronousScrollingReasons on nodes that no longer need
to slow-scroll, and set it on those that do. To achieve this we use the set of slow-repaint renders from
FrameView, and the set of layers with scrolling nodes from RenderLayerCompositor, starting with the set of
all nodes, and pruning those known to be slow. synchronousScrollingReasons are cleared on the remainder.
Tests: scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-overflow-dynamic.html
scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-overflow.html
scrollingcoordinator/mac/fixed-backgrounds/fixed-background-on-overflow.html
* page/FrameView.cpp:
(WebCore::FrameView::addSlowRepaintObject):
(WebCore::FrameView::removeSlowRepaintObject):
* page/FrameView.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
(WebCore::RenderLayerCompositor::updateSynchronousScrollingNodes):
* rendering/RenderLayerCompositor.h:
2020-04-15 Andres Gonzalez <andresg_22@apple.com>
Add logging to core accessibility.
https://bugs.webkit.org/show_bug.cgi?id=210564
Reviewed by Chris Fleizach.
Added AXLogger class and AXTRACE macro. Used them in AXIsolatedTree.
* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXLogger.cpp: Added.
(WebCore::AXLogger::AXLogger):
(WebCore::AXLogger::~AXLogger):
* accessibility/AXLogger.h: Added.
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::AXIsolatedTree):
(WebCore::AXIsolatedTree::~AXIsolatedTree):
(WebCore::AXIsolatedTree::create):
(WebCore::AXIsolatedTree::nodeInTreeForID):
(WebCore::AXIsolatedTree::treeForID):
(WebCore::AXIsolatedTree::createTreeForPageID):
(WebCore::AXIsolatedTree::removeTreeForPageID):
(WebCore::AXIsolatedTree::treeForPageID):
(WebCore::AXIsolatedTree::nodeForID const):
(WebCore::AXIsolatedTree::objectsForIDs const):
(WebCore::AXIsolatedTree::generateSubtree):
(WebCore::AXIsolatedTree::createSubtree):
(WebCore::AXIsolatedTree::updateNode):
(WebCore::AXIsolatedTree::updateSubtree):
(WebCore::AXIsolatedTree::updateChildren):
(WebCore::AXIsolatedTree::focusedUIElement):
(WebCore::AXIsolatedTree::rootNode):
(WebCore::AXIsolatedTree::setRootNode):
(WebCore::AXIsolatedTree::setFocusedNode):
(WebCore::AXIsolatedTree::setFocusedNodeID):
(WebCore::AXIsolatedTree::removeNode):
(WebCore::AXIsolatedTree::removeSubtree):
(WebCore::AXIsolatedTree::appendNodeChanges):
(WebCore::AXIsolatedTree::applyPendingChanges):
* platform/Logging.h:
2020-04-15 Simon Fraser <simon.fraser@apple.com>
Lay the groundwork for SynchronousScrollingReason on overflow nodes
https://bugs.webkit.org/show_bug.cgi?id=210565
Reviewed by Tim Horton.
Make setSynchronousScrollingReasons() public on ScrollingCoordinator because we're going
to be calling it for overflow scrolling nodes.
Call ScrollingCoordinator::slowRepaintObjectsDidChange() not just when we go between
none some some slow-repaint objects, but whenever the set changes. slowRepaintObjectsDidChange()
is lightweight.
Minor cleanup in FrameView to avoid testing Page* nullness every time.
* page/FrameView.cpp:
(WebCore::FrameView::prepareForDetach):
(WebCore::FrameView::isScrollSnapInProgress const):
(WebCore::FrameView::usesAsyncScrolling const):
(WebCore::FrameView::addSlowRepaintObject):
(WebCore::FrameView::removeSlowRepaintObject):
(WebCore::FrameView::addViewportConstrainedObject):
(WebCore::FrameView::removeViewportConstrainedObject):
(WebCore::FrameView::scrollingCoordinator const):
(WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling const):
(WebCore::FrameView::isRubberBandInProgress const):
(WebCore::FrameView::requestScrollPositionUpdate):
(WebCore::FrameView::layoutOrVisualViewportChanged):
(WebCore::FrameView::performPostLayoutTasks):
(WebCore::FrameView::scrollableAreaSetChanged):
(WebCore::FrameView::wheelEvent):
(WebCore::FrameView::setScrollPinningBehavior):
* page/FrameView.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::slowRepaintObjectsDidChange):
(WebCore::ScrollingCoordinator::synchronousScrollingReasonsForFrameView const):
(WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons):
(WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously const):
(WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText const):
(WebCore::ScrollingCoordinator::frameViewHasSlowRepaintObjectsDidChange): Deleted.
(WebCore::ScrollingCoordinator::synchronousScrollingReasons const): Deleted.
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::setSynchronousScrollingReasons):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBacking):
2020-04-15 Jack Lee <shihchieh_lee@apple.com>
ASSERTION FAILED: !selectionToDelete.isNone() in TypingCommand::forwardDeleteKeyPressed
when deleting a UserSelect::None element.
https://bugs.webkit.org/show_bug.cgi?id=210530
<rdar://problem/58591480>
Reviewed by Geoffrey Garen.
Quit forwardDeleteKeyPressed() if FrameSelection::modify() returns empty selection.
Test: editing/deleting/forward-delete-UserSelect-None-element.html
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::forwardDeleteKeyPressed):
2020-04-15 Peng Liu <peng.liu6@apple.com>
Video elements don't return to the correct position when exiting fullscreen
https://bugs.webkit.org/show_bug.cgi?id=210529
Reviewed by Jer Noble.
Add WEBCORE_EXPORT to the function setNeedsDOMWindowResizeEvent().
* dom/Document.h:
2020-04-15 Wenson Hsieh <wenson_hsieh@apple.com>
[iPadOS] Some pages indefinitely zoom in and out due to idempotent text autosizing
https://bugs.webkit.org/show_bug.cgi?id=210551
<rdar://problem/56820674>
Reviewed by Tim Horton.
Rename m_initialScale and initialScale() on Page to m_initialScaleIgnoringContentSize and
initialScaleIgnoringContentSize(), respectively. See WebKit/ChangeLog for more details.
Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-reaches-stable-state.html
* page/Page.cpp:
(WebCore::Page::setInitialScaleIgnoringContentSize):
(WebCore::Page::setInitialScale): Deleted.
* page/Page.h:
(WebCore::Page::initialScaleIgnoringContentSize const):
(WebCore::Page::initialScale const): Deleted.
* style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjustmentForTextAutosizing):
2020-04-15 Chris Dumez <cdumez@apple.com>
REGRESSION (r258977): Crash under Document::visibilityStateChanged
https://bugs.webkit.org/show_bug.cgi?id=210555
Reviewed by Youenn Fablet.
Re-introduce null check of page in Document::visibilityStateChanged() which got inadvertently
dropped in r258977.
* dom/Document.cpp:
(WebCore::Document::visibilityStateChanged):
2020-04-15 Zalan Bujtas <zalan@apple.com>
REGRESSION( r260114): [ Mac and iOS ] imported/w3c/web-platform-tests/web-animations/timing-model/timelines/document-timelines.html is failing.
https://bugs.webkit.org/show_bug.cgi?id=210549
<rdar://problem/61828495>
Unreviewed.
Partial revert of r260114. See webkit.org/b/210559 for details.
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
2020-04-15 Antoine Quint <graouts@apple.com>
[Web Animations] Add support for `pseudoElement` on `KeyframeEffect` and `KeyframeEffectOptions`
https://bugs.webkit.org/show_bug.cgi?id=207290
<rdar://problem/59199003>
Reviewed by Antti Koivisto.
We add the required IDL bindings such that JS-originated Web Animations can target pseudo-elements, either via the KeyframeEffect.pseudoElement
property, or via the KeyframeEffectOptions.pseudoElement property, which is set on the object passed to the KeyframeEffect constrcutor and
Element.animate().
This means that a PseudoElement can be targeted by an animation even if it's not been created through style resolution by virtue of a ::before
or ::after selector and a "content" style rule. This means that when either the "target" or "pseudoElement" property of KeyframeEffect is set,
we ensure a PseudoElement is created and set on the host element if required. And additionally, we ensure that during style resolution, animations
are applied to such pseudo-elements with a new PseudoElement::isTargetedByKeyframeEffectRequiringPseudoElement() method that indicates that a
JS-originated KeyframeEffect targets this pseudo-element.
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::create): Handle the new KeyframeEffectOptions.pseudoElement property in the KeyframeEffect constructor.
(WebCore::KeyframeEffect::targetsPseudoElement const): Indicates whether this effect targets a pseudo-element and not a regular
element or a null target.
(WebCore::KeyframeEffect::targetElementOrPseudoElement const): Use the new targetsPseudoElement() method to determine whether a
pseudo-element is targeted. We also remove an assertion that only made sense when m_pseudoId could only be set via a CSS-originated
animation and another one when the only possible m_pseudoId values were PseudoId::Before and PseudoId::After.
(WebCore::KeyframeEffect::setTarget): Call the new didChangeTargetElementOrPseudoElement() method if the provided value differs
from the stored value for m_target.
(WebCore::KeyframeEffect::pseudoElement const): Return the matching normalized string with a `::` prefix for m_pseudoId if the target
is a pseudo-element. Note that PseudoElement::pseudoElementNameForEvents() will only return a string for "::before" and "::after" since
we only know how to animate these pseudo-elements.
(WebCore::KeyframeEffect::setPseudoElement): Determine a matching PseudoId, if any, for the provided string, and call the new
didChangeTargetElementOrPseudoElement() method if the provided value differs from the stored value for m_pseudoId.
(WebCore::KeyframeEffect::didChangeTargetElementOrPseudoElement): New method called when either m_target or m_pseudoId is changed
such that we can ensure the required PseudoElement is created if the animation targets a pseudo-element. Then we run the same logic
that we used to in KeyframeEffect::setTarget().
(WebCore::KeyframeEffect::requiresPseudoElement const): Indicates whether a PseudoElement must remain created for this KeyframeEffect,
which is only necessary for JS-originated effects targeting a pseudo-element.
* animation/KeyframeEffect.h:
* animation/KeyframeEffect.idl:
* animation/KeyframeEffectOptions.h:
* animation/KeyframeEffectOptions.idl:
* animation/KeyframeEffectStack.cpp:
(WebCore::KeyframeEffectStack::requiresPseudoElement const): Indicates whether one or more JS-originated keyframe effects in the stack target
the PseudoElement owning this stack.
* animation/KeyframeEffectStack.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::commitStyles): Use KeyframeEffect::targetsPseudoElement() to determine whether the animation's effect's target is a
pseudo-element, in which case we need to throw a NoModificationAllowedError exception.
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::rendererIsNeeded): Return true also when one or more JS-originated keyframe effects in the stack target this pseudo-element.
(WebCore::PseudoElement::isTargetedByKeyframeEffectRequiringPseudoElement): Return true when one or more JS-originated keyframe effects in the stack
target this pseudo-element.
* dom/PseudoElement.h:
* rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::createContentRenderers): Remove the assertion that the "content" property was set since it's valid for this function to now be called
due to JS-originated keyframe effects targeting the given pseudo-element. Instead we add an assertion that there are such keyframe effects in
case no "content" property was set.
(WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement): Only remove pseudo-elements if there are no JS-originated keyframe effects
targeting the specified pseudo-element.
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolvePseudoStyle): Allow animated style resolution for pseudo-elements targeted by JS-originated keyframe effects.
2020-04-15 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK4] Fix use of gtk init functions
https://bugs.webkit.org/show_bug.cgi?id=210550
Reviewed by Adrian Perez de Castro.
Add gtk_init and gtk_init_check receiving parameters to GtkVersioning.
* PlatformGTK.cmake:
* platform/graphics/PlatformDisplay.cpp:
* platform/gtk/GtkVersioning.h:
(gtk_init):
(gtk_init_check):
2020-04-15 Yusuke Suzuki <ysuzuki@apple.com>
import.meta.url: baseURL for a module script should be response URL, not request URL
https://bugs.webkit.org/show_bug.cgi?id=205294
Reviewed by Youenn Fablet.
The module should expose response URL as `import.meta.url` instead of request URL.
If redirection happens, this URL should be redirected one.
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::resolve):
(WebCore::ScriptModuleLoader::responseURLFromRequestURL):
(WebCore::ScriptModuleLoader::createImportMetaProperties):
(WebCore::ScriptModuleLoader::notifyFinished):
* bindings/js/ScriptModuleLoader.h:
2020-04-15 Jer Noble <jer.noble@apple.com>
isNullFunctionPointer() can fail for symbols not explicitly marked as weakly linked.
https://bugs.webkit.org/show_bug.cgi?id=210532
Reviewed by Tim Horton.
Symbols whose declarations are explicitly marked as weakly imported are guaranteed to be
NULL when the library containing those symbols is not available at runtime, or when the
symbol itself isn't present in the version of the library which is available at runtime. For
symbols which are not explicitly marked as weakly imported (because, e.g., the framework
itself is weakly imported), this technique can fail. Rather than test the nullity of a
random static C++ class method with isNullFunctionPointer(), explicitly mark as weak_import
a utility method added by the WebKit project, which conveniently is already used from within
LibWebRTCProviderCocoa, and test the nullity of that method instead.
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProvider::webRTCAvailable):
2020-04-15 Claudio Saavedra <csaavedra@igalia.com>
[GTK] Make PlatformScreen::screenDPI() GTK4-ready
https://bugs.webkit.org/show_bug.cgi?id=210543
Reviewed by Adrian Perez de Castro.
No new tests needed.
This method is using deprecated and removed APIs
from GDK. Guard the removed API usage so that it's only
used in GTK3 and update to use the replacement APIs otherwise.
Also, make it to also use the gtk-xft-dpi GtkSettings property.
This method is mostly used in response to a change in this
property, so ignoring its value doesn't seem a good idea.
The following priority is used:
1. (GTK3 only) query gdk_screen_get_resolution().
2. Use the GtkSettings::gtk-xft-dpi property.
3. Calculate the actual DPI from the monitor 0's properties.
4. If none of these succeed, use the default DPI, 96.
* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::screenDPI):
2020-04-15 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Remove IconGtk
https://bugs.webkit.org/show_bug.cgi?id=210546
Reviewed by Adrian Perez de Castro.
It's currently unused in GTK port since we never show an icon for file uploads.
* SourcesGTK.txt:
* platform/graphics/Icon.cpp:
* platform/graphics/Icon.h:
* platform/graphics/gtk/IconGtk.cpp: Removed.
2020-04-15 Adrian Perez de Castro <aperez@igalia.com>
[GTK4] Provide an alternative to gtk_widget_{get,is}_toplevel()
https://bugs.webkit.org/show_bug.cgi?id=210463
Reviewed by Carlos Garcia Campos.
Adapt utility functions to GTK4, and provide replacement implementations for the
gtk_widget_get_tolevel() and gtk_widget_is_toplevel() functions for GTK4 builds.
No new tests needed.
* platform/gtk/GtkUtilities.cpp:
(WebCore::gtkWindowGetOrigin): Added.
(WebCore::convertWidgetPointToScreenPoint): Move code used to find the window position
into a separate function, and use it to avoid the USE(GTK4) conditional here.
(WebCore::widgetIsOnscreenToplevelWindow): Adapt to make it work with GTK4.
* platform/gtk/GtkVersioning.h: Added.
(gtk_widget_is_toplevel): Alternative implementation for GTK4.
(gtk_widget_get_toplevel): Ditto.
(gtk_window_get_position): Ditto.
2020-04-15 Adrian Perez de Castro <aperez@igalia.com>
[GTK4] Adapt to cursor API changes
https://bugs.webkit.org/show_bug.cgi?id=210453
Reviewed by Carlos Garcia Campos.
No new tests needed.
* platform/gtk/CursorGtk.cpp:
(WebCore::fallbackCursor): Utility function which returns the "default" cursor for GTK4.
(WebCore::createNamedCursor): Adapt to the changes in the gdk_cursor_new_from_name().
(WebCore::createCustomCursor): Create a GdkTexture directly when the given Cairo surface is
in one of the pixel formats supported by gdk_memory_texture_new(), otherwise convert first;
then create a GdkCursor from the GdkTexture.
2020-04-14 Simon Fraser <simon.fraser@apple.com>
[Async overflow scroll] Backgrounds missing on gmail sometimes
https://bugs.webkit.org/show_bug.cgi?id=210506
<rdar://problem/60523869>
Reviewed by Zalan Bujtas.
When painting the scrolled contents layers of accelerated overflow:scroll, RenderBlock::paint()
needs to not short-circuit when the dirty rect is outside a clipping rect, because accelerated
overflow involves overdraw for tiles outside the visible area.
There were two code paths that made this mostly work: overflowRectForPaintRejection() tested for
usesCompositedScrolling(), and the #if PLATFORM(IOS_FAMILY) made it work on iOS.
For content involving flexbox, overflowRectForPaintRejection() gave the wrong answer because
flex layout would sometimes clear m_overflow, even on an overflow:scroll element.
So remove overflowRectForPaintRejection(), and instead revert to the simple visualOverflowRect(),
but first check a bit that's passed down from compositing code that indicates that
we're painting the contents of composited scroll
Test: compositing/scrolling/async-overflow-scrolling/mac/overflow-in-flex-empty-tiles.html
* rendering/PaintPhase.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paint):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::overflowRectForPaintRejection const): Deleted.
* rendering/RenderBox.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::paintForegroundForFragments):
2020-04-14 Zalan Bujtas <zalan@apple.com>
Content expanding is broken on icourse163.org
https://bugs.webkit.org/show_bug.cgi?id=210510
<rdar://problem/45951820>
Reviewed by Simon Fraser.
www.icourse163.org's animation code expects a decimal point in the rAF timestamp (millisecond resolution).
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
* page/Quirks.cpp:
(WebCore::Quirks::needsMillisecondResolutionForHighResTimeStamp const):
* page/Quirks.h:
2020-04-14 Peng Liu <peng.liu6@apple.com>
Adopt interface AVAudioRoutingArbiter for Mac
https://bugs.webkit.org/show_bug.cgi?id=210167
Reviewed by Eric Carlson.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::setCategory):
(WebCore::categoryName): Deleted.
* platform/audio/mac/AudioSessionMac.mm: Renamed from Source/WebCore/platform/audio/mac/AudioSessionMac.cpp.
(WebCore::AudioSession::setCategory):
(WebCore::AudioSession::categoryOverride const):
(WebCore::AudioSession::setCategoryOverride):
Fix unified build failures.
* platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.h:
2020-04-14 Youenn Fablet <youenn@apple.com>
ReadableStreamDefaultController::enqueue should check for worker terminated exception
https://bugs.webkit.org/show_bug.cgi?id=210485
Reviewed by Mark Lam.
Make sure to not assert in case of enqueue exception if we are in a terminating worker.
This is covered by WPT fetch/api/basic/stream-response.any.worker.html and fetch/api/basic/stream-safe-creation.any.worker.html.
* bindings/js/ReadableStreamDefaultController.h:
(WebCore::ReadableStreamDefaultController::enqueue):
2020-04-14 Youenn Fablet <youenn@apple.com>
Protect MediaStreamTrackPrivate and RealtimeMediaSource when iterating its observers
https://bugs.webkit.org/show_bug.cgi?id=210488
Reviewed by Eric Carlson.
Making sure explicitly that the track private and source remain alive while looping from its observers.
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::forEachObserver const):
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::forEachObserver const):
2020-04-14 James Craig <jcraig@apple.com>
AX: Smart Invert doesn't handle the picture elements on foxnews.com
<https://webkit.org/b/210472>
Reviewed by Chris Fleizach.
Tests: accessibilty/smart-invert.html
accessibilty/smart-invert-reference.html
Filled out more variants in the test cases, and removed the unnecessary :not() selector.
* css/html.css:
(@media (inverted-colors) img, picture, video):
(@media (inverted-colors) img:not(picture>img), picture, video): Deleted.
2020-04-14 Wenson Hsieh <wenson_hsieh@apple.com>
[iPadOS] Wikipedia articles lay out incorrectly in 1/3 multitasking window
https://bugs.webkit.org/show_bug.cgi?id=210501
<rdar://problem/54856323>
Reviewed by Tim Horton.
In a 1/3 multitasking window, Safari currently uses the `-[WKWebView _allowsViewportShrinkToFit]` SPI to force
pages to shrink down by fitting the content width to the view width. This legacy method of shrinking to fit
involves laying the page out at the normal view width (320px in 1/3 multitasking), and then scaling the page
down such that any amount of horizontal overflow fits within the view.
In iOS 13, a new style of shrinking to fit was introduced in support of two new features: page zoom controls
(accessible via the page formatting menu), and on-by-default page scaling when loading desktop sites on certain
models of iPad where the page width is less than cutoffs of 1112px (in landscape) and 1024px (in portrait). This
new method of shrinking to fit involves laying out at a larger width (computed from a combination of the minimum
effective device width and layout size scale factor), and scaling to fit the effective layout size scale factor
instead of the entire contents of the page. This means that while we may still get horizontal scrolling after
shrinking to fit, the overall layout of the page is preserved.
Currently, in 1/3 multitasking, Safari still relies on the former to scale pages down to fit, which means that
Wikipedia articles (among other websites) do not lay out sensibly. Moreover, even if Safari adopted the second
mechanism for shrinking to fit, layout issues would still exist (albeit to a lesser degree), since we'd still
attempt to shrink the content width down to fit due to the fact that the desktop version of Wikipedia doesn't
have a meta viewport. While we wouldn't get a broken layout, we'd still have a blank column running down the
right side of the page, which is less than ideal.
It's clear that in this case, attempting to shrink page content down to fit the view is suboptimal (at best, it
leads to a large portion of the page being blank; at worst, it completely breaks page layout). To address this
bug for now, add a parallel minimumEffectiveDeviceWidth value that takes effect when ignoring scaling
constraints (i.e. when we're in a multitasking window), and scale the page down to fit this value instead of
fitting the full content width when computing initial scale in `ViewportConfiguration::initialScaleFromSize`.
Maintaining this value separately from m_minimumEffectiveDeviceWidth makes it much easier to ensure that the
effects of this change are only ever active when the quirk is applied, and also when the view is embedded in a
multitasking window.
* page/Quirks.cpp:
(WebCore::Quirks::shouldLayOutAtMinimumWindowWidthWhenIgnoringScalingConstraints const):
Introduce a quirk to fix layout issues in multitasking mode on the desktop version of Wikipedia.
* page/Quirks.h:
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::initialScaleFromSize const):
(WebCore::ViewportConfiguration::setMinimumEffectiveDeviceWidth):
(WebCore::ViewportConfiguration::setMinimumEffectiveDeviceWidthWhenIgnoringScalingConstraints):
* page/ViewportConfiguration.h:
Add a minimum effective device width value that only takes effect when ignoring scaling constraints, and update
`shouldIgnoreMinimumEffectiveDeviceWidth()` and `minimumEffectiveDeviceWidth()` to not always return `true` and
`0` (respectively) when ignoring scaling constraints, if m_minimumEffectiveDeviceWidthWhenIgnoringScalingConstraints
is set.
(WebCore::ViewportConfiguration::minimumEffectiveDeviceWidth const):
(WebCore::ViewportConfiguration::shouldIgnoreMinimumEffectiveDeviceWidth const):
(WebCore::ViewportConfiguration::shouldShrinkToFitMinimumEffectiveDeviceWidthWhenIgnoringScalingConstraints const):
2020-04-14 Antoine Quint <graouts@apple.com>
Factor PseudoElement creation calls into a single Element::ensurePseudoElement(pseudoId) method
https://bugs.webkit.org/show_bug.cgi?id=210495
Reviewed by Antti Koivisto.
To support webkit.org/b/207290 we need a way to ensure a PseudoElement is available for ::before and ::after
pseudo-elements on a given Element. We now use a Element::ensurePseudoElement(pseudoId) method to do this and
replace existing places where we would do something similar.
* dom/Element.cpp:
(WebCore::Element::ensurePseudoElement):
* dom/Element.h:
* rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolvePseudoStyle):
2020-04-14 Simon Fraser <simon.fraser@apple.com>
Scroll snap in subframes is often broken
https://bugs.webkit.org/show_bug.cgi?id=210503
Reviewed by Darin Adler.
RenderBox::findEnclosingScrollableContainer() incorrectly consulted the scrollability
of the main frame, causing snapping in subframes to be broken any time the main frame
was not scrollable.
Test: tiled-drawing/scrolling/scroll-snap/scroll-snap-async-iframe.html
* rendering/RenderBox.cpp:
(WebCore::RenderBox::findEnclosingScrollableContainer const):
2020-04-14 Andres Gonzalez <andresg_22@apple.com>
Make WTR::AccessibilityUIElements calls to accessibilitySetValue run on AX secondary thread. web content
https://bugs.webkit.org/show_bug.cgi?id=210500
Reviewed by Chris Fleizach.
Removed _accessibilitySetTestValue since it is no longer used, use
_accessibilitySetValue instead.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper _accessibilitySetTestValue:forAttribute:]): Deleted.
2020-04-14 David Kilzer <ddkilzer@apple.com>
Add WARN_UNUSED_RETURN to decode methods in Source/WebCore
<https://webkit.org/b/210416>
<rdar://problem/61693462>
Reviewed by Alex Christensen.
* Modules/geolocation/GeolocationPositionData.h:
* Modules/indexeddb/IDBGetAllResult.h:
* Modules/indexeddb/IDBGetResult.h:
* Modules/indexeddb/IDBKeyData.h:
* Modules/indexeddb/IDBKeyRangeData.h:
* Modules/indexeddb/server/IDBSerialization.cpp:
(WebCore::decodeKey):
* Modules/indexeddb/shared/IDBCursorInfo.h:
* Modules/indexeddb/shared/IDBCursorRecord.h:
* Modules/indexeddb/shared/IDBDatabaseInfo.h:
* Modules/indexeddb/shared/IDBError.h:
* Modules/indexeddb/shared/IDBGetAllRecordsData.h:
* Modules/indexeddb/shared/IDBGetRecordData.h:
* Modules/indexeddb/shared/IDBIndexInfo.h:
* Modules/indexeddb/shared/IDBIterateCursorData.h:
* Modules/indexeddb/shared/IDBObjectStoreInfo.h:
* Modules/indexeddb/shared/IDBRequestData.h:
* Modules/indexeddb/shared/IDBResourceIdentifier.h:
* Modules/indexeddb/shared/IDBTransactionInfo.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::decodeTimeComparator):
* dom/EventInit.h:
* dom/ExceptionData.h:
* dom/SecurityPolicyViolationEvent.h:
* editing/FontAttributeChanges.h:
* editing/FontShadow.h:
* loader/CanvasActivityRecord.h:
* loader/FetchOptions.h:
(WebCore::FetchOptions::decodePersistent):
* platform/ContentFilterUnblockHandler.h:
* platform/DragItem.h:
* platform/KeyedCoding.h:
* platform/LinkIcon.h:
* platform/ThreadSafeDataBuffer.h:
* platform/audio/mac/CAAudioStreamDescription.h:
* platform/cf/KeyedDecoderCF.h:
* platform/generic/KeyedDecoderGeneric.h:
* platform/glib/KeyedDecoderGlib.h:
* platform/graphics/Region.h:
* platform/graphics/RemoteVideoSample.h:
(WebCore::RemoteVideoSample::decode):
* platform/mediastream/MediaConstraints.h:
(WebCore::MediaConstraint::decode):
(WebCore::NumericConstraint::decode):
(WebCore::StringConstraint::decode):
* platform/mediastream/RealtimeMediaSourceCapabilities.h:
* platform/mediastream/RealtimeMediaSourceSettings.h:
* platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:
* platform/network/HTTPHeaderMap.h:
* platform/network/NetworkLoadMetrics.h:
* platform/network/ResourceRequestBase.h:
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::decode):
* platform/network/SameSiteInfo.h:
* platform/network/SocketStreamError.h:
* platform/network/curl/ResourceRequest.h:
* platform/network/soup/ResourceRequest.h:
* platform/network/soup/ResourceResponse.h:
* rendering/EventRegion.h:
* workers/service/ServiceWorkerFetchResult.h:
- Add WARN_UNUSED_RETURN to all decode functions.
2020-04-14 Antoine Quint <graouts@apple.com>
[Web Animations] Store an Element / PseudoId pair to define the KeyframeEffect target
https://bugs.webkit.org/show_bug.cgi?id=210491
Reviewed by Antti Koivisto.
In preparation for webkit.org/b/207290 where we will expose the `pseudoElement` JS API on KeyframeEffect we now
use an Element / PseudoId (m_target / m_pseudoId) pair to specify an effect's target. In the cases where it matters,
such as accessing the various animation collections exposed through Element and the KeyframeEffectStack, we now use
the new KeyframeEffect::targetElementOrPseudoElement() method to access the Element or PseudoElement targeted with
the Element / PseudoId pair.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::removeAnimation):
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::initialize):
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::transitionDidComplete):
(WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange):
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::create):
(WebCore::KeyframeEffect::KeyframeEffect):
(WebCore::KeyframeEffect::copyPropertiesFromSource):
(WebCore::KeyframeEffect::getKeyframes):
(WebCore::KeyframeEffect::forceLayoutIfNeeded):
(WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes):
(WebCore::KeyframeEffect::computeCSSTransitionBlendingKeyframes):
(WebCore::KeyframeEffect::animationTimelineDidChange):
(WebCore::KeyframeEffect::updateEffectStackMembership):
(WebCore::KeyframeEffect::targetElementOrPseudoElement const):
(WebCore::KeyframeEffect::setTarget):
(WebCore::KeyframeEffect::apply):
(WebCore::KeyframeEffect::invalidate):
(WebCore::KeyframeEffect::getAnimatedStyle):
(WebCore::KeyframeEffect::applyPendingAcceleratedActions):
(WebCore::KeyframeEffect::document const):
(WebCore::KeyframeEffect::renderer const):
* animation/KeyframeEffect.h:
* animation/KeyframeEffectStack.cpp:
(WebCore::KeyframeEffectStack::addEffect):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setEffectInternal):
(WebCore::WebAnimation::setTimeline):
(WebCore::WebAnimation::persist):
* dom/Document.cpp:
(WebCore::Document::matchingAnimations):
* inspector/agents/InspectorAnimationAgent.cpp:
(WebCore::buildObjectForKeyframes):
(WebCore::InspectorAnimationAgent::requestEffectTarget):
2020-04-14 Simon Fraser <simon.fraser@apple.com>
[Async overflow scroll] Custom scrollbars on gmail don't show
https://bugs.webkit.org/show_bug.cgi?id=210438
<rdar://problem/61722541>
Reviewed by Tim Horton.
Custom scrollbars painted into the backing store of the scrolling element, but that
might have become an empty "simple container layer" causing the scroll bars to not
be painted anywhere.
Fix by making compositing layers for custom scrollbars. This is better than giving
backing store to the scroller's element, because that might be huge.
Test: scrollbars/async-overflow-custom-scrollbar.html
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::requiresLayerForScrollbar const):
(WebCore::RenderLayerBacking::requiresHorizontalScrollbarLayer const):
(WebCore::RenderLayerBacking::requiresVerticalScrollbarLayer const):
(WebCore::RenderLayerBacking::requiresScrollCornerLayer const):
* rendering/RenderLayerBacking.h:
2020-04-14 Claudio Saavedra <csaavedra@igalia.com>
[GTK] Adapt to GdkVisual deprecation and removal
https://bugs.webkit.org/show_bug.cgi?id=210489
Reviewed by Adrian Perez de Castro.
No new tests needed.
Update the GdkVisual used to get the screen depth per component in
GTK3 and use default values for GTK4, as visuals as an abstraction
are gone from GTK4. The use in WK is very limited so there's no
much gain from peeking into backend-specific values.
* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::screenDepth): Guard GdkVisual call and leave
default value for GTK4.
(WebCore::screenDepthPerComponent): Update API and ditto.
2020-04-14 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][WPE] Scrollbar handle has no minimum size
https://bugs.webkit.org/show_bug.cgi?id=209962
Reviewed by Adrian Perez de Castro.
Set a minimum thumb length.
* platform/adwaita/ScrollbarThemeAdwaita.cpp:
(WebCore::ScrollbarThemeAdwaita::minimumThumbLength):
2020-04-14 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] New scrollbar click behavior
https://bugs.webkit.org/show_bug.cgi?id=210002
Reviewed by Adrian Perez de Castro.
Use the same bahavior for mouse events when not rendering native scrollbars.
* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::ScrollbarThemeGtk::handleMousePressEvent):
2020-04-14 Antti Koivisto <antti@apple.com>
[CSS Selectors] Selectors Level 4 specificity calculation for pseudo classes
https://bugs.webkit.org/show_bug.cgi?id=210419
Reviewed by Simon Fraser.
CSS selector specification drafts at some point had a concept of "dynamic specificity" where
the specificity of a selector depended on the element it matched. It was only ever used with
:matches and :nth-child pseudo classes and has subsequently been removed. Selector specificity
can now always be computed statically.
There is a ton of code to support this obsolete feature. Remove it.
https://drafts.csswg.org/selectors-4/#specificity-rules
"The specificity of an :is(), :not(), or :has() pseudo-class is replaced by the specificity
of the most specific complex selector in its selector list argument.
Analogously, the specificity of an :nth-child() or :nth-last-child() selector is the specificity
of the pseudo class itself (counting as one pseudo-class selector) plus the specificity of the
most specific complex selector in its selector list argument (if any)."
* css/html.css:
Reorganize a :matches rule into a selector list to keep the exact specificites.
It matters here to select between listbox and menulist correctly based on the 'size' and 'multiple' attributes.
* css/CSSSelector.cpp:
(WebCore::selectorSpecificity):
(WebCore::maxSpecificity):
(WebCore::simpleSelectorSpecificityInternal):
(WebCore::CSSSelector::simpleSelectorSpecificity const):
Also handle nth here.
(WebCore::CSSSelector::specificity const):
(WebCore::simpleSelectorFunctionalPseudoClassStaticSpecificity): Deleted.
(WebCore::functionalPseudoClassStaticSpecificity): Deleted.
(WebCore::staticSpecificityInternal): Deleted.
(WebCore::CSSSelector::staticSpecificity const): Deleted.
Rename to just computeSpecificity(), there is no other kind than static.
* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::match const):
(WebCore::SelectorChecker::matchHostPseudoClass const):
(WebCore::SelectorChecker::matchRecursively const):
(WebCore::SelectorChecker::checkOne const):
(WebCore::SelectorChecker::matchSelectorList const):
SelectorChecker doesn't need to deal with specificity anymore.
* css/SelectorChecker.h:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addNthChildType):
(WebCore::SelectorCompiler::addPseudoClassType):
(WebCore::SelectorCompiler::constructFragmentsInternal):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
Neither does SelectorCompiler.
* cssjit/SelectorCompiler.h:
* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::selectorMatches const):
(WebCore::SelectorDataList::selectorClosest const):
* inspector/InspectorStyleSheet.cpp:
(WebCore::buildObjectForSelectorHelper):
(WebCore::selectorsFromSource):
(WebCore::InspectorStyleSheet::buildObjectForSelector):
(WebCore::InspectorStyleSheet::buildObjectForSelectorList):
(WebCore::InspectorStyleSheet::buildObjectForRule):
(WebCore::InspectorStyleSheet::buildArrayForRuleList):
(WebCore::hasDynamicSpecificity): Deleted.
* inspector/InspectorStyleSheet.h:
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::setRuleSelector):
(WebCore::InspectorCSSAgent::addRule):
(WebCore::InspectorCSSAgent::buildObjectForRule):
(WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::highlightSelector):
* style/ElementRuleCollector.cpp:
(WebCore::Style::ElementRuleCollector::ruleMatches):
Switch to get the specificity from the selector instead of computing it during selector checking.
* style/ElementRuleCollector.h:
2020-04-14 Carlos Garcia Campos <cgarcia@igalia.com>
[GLIB] Fix race condition in FileMonitor implementation
https://bugs.webkit.org/show_bug.cgi?id=210483
Reviewed by Adrian Perez de Castro.
This is causing flaky timeouts when running resource load statistics layout tests. The problem is that we assume
FileMonitor has the last reference of the platform monitor and it's deleted on g_object_unref(), but GLib keeps
another reference that is released later on a different thread if the monitor is still active. We just need to
ensure we cancel the monitor before calling g_object_unref().
* platform/FileMonitor.h:
* platform/glib/FileMonitorGLib.cpp:
(WebCore::FileMonitor::~FileMonitor):
(WebCore::FileMonitor::didChange):
(WebCore::FileMonitor::cancel):
2020-04-14 Charlie Turner <cturner@igalia.com>
[EME][CDMProxy] Fix waitingForKey logic
https://bugs.webkit.org/show_bug.cgi?id=210437
Reviewed by Xabier Rodriguez-Calvar.
startedWaitingForKey() was incorrectly flagged. It needs to signal on
the 0->1 transition, here it was only signalling on N->N+1 where N>0.
Also break ASSERTs into separate statements, it makes it easier in a
crash dump to see which conjuct fired.
Test: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-waiting-for-a-key.https.html
* platform/encryptedmedia/CDMProxy.cpp:
(WebCore::CDMInstanceProxy::startedWaitingForKey):
(WebCore::CDMInstanceProxy::stoppedWaitingForKey):
2020-04-14 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Bring back support for rendering scrollbars using the system appearance
https://bugs.webkit.org/show_bug.cgi?id=209805
Reviewed by Michael Catanzaro.
Bring back ScrollbarThemeGtk, RenderThemeGadget and RenderThemeWidget (renamed as RenderThemeScrollbar),
including only the code needed to render the scrollbars. ScrollbarThemeGtk inherits from ScrollbarThemeAdwaita
that is used when system appearance is disabled.
* PlatformGTK.cmake:
* SourcesGTK.txt:
* platform/adwaita/ScrollbarThemeAdwaita.cpp:
* platform/adwaita/ScrollbarThemeAdwaita.h:
* platform/gtk/RenderThemeGadget.cpp: Added.
(WebCore::RenderThemeGadget::create):
(WebCore::createStyleContext):
(WebCore::appendElementToPath):
(WebCore::RenderThemeGadget::RenderThemeGadget):
(WebCore::RenderThemeGadget::marginBox const):
(WebCore::RenderThemeGadget::borderBox const):
(WebCore::RenderThemeGadget::paddingBox const):
(WebCore::RenderThemeGadget::contentsBox const):
(WebCore::RenderThemeGadget::color const):
(WebCore::RenderThemeGadget::backgroundColor const):
(WebCore::RenderThemeGadget::opacity const):
(WebCore::RenderThemeGadget::state const):
(WebCore::RenderThemeGadget::setState):
(WebCore::RenderThemeGadget::minimumSize const):
(WebCore::RenderThemeGadget::preferredSize const):
(WebCore::RenderThemeGadget::render):
(WebCore::RenderThemeBoxGadget::RenderThemeBoxGadget):
(WebCore::RenderThemeBoxGadget::preferredSize const):
(WebCore::RenderThemeScrollbarGadget::RenderThemeScrollbarGadget):
(WebCore::RenderThemeScrollbarGadget::renderStepper):
* platform/gtk/RenderThemeGadget.h: Added.
(WebCore::RenderThemeGadget::context const):
* platform/gtk/RenderThemeScrollbar.cpp: Added.
(WebCore::widgetMap):
(WebCore::RenderThemeScrollbar::getOrCreate):
(WebCore::RenderThemeScrollbar::clearCache):
(WebCore::RenderThemeScrollbar::RenderThemeScrollbar):
(WebCore::RenderThemeScrollbar::stepper):
* platform/gtk/RenderThemeScrollbar.h: Added.
(WebCore::RenderThemeScrollbar::scrollbar const):
(WebCore::RenderThemeScrollbar::contents const):
(WebCore::RenderThemeScrollbar::slider const):
(WebCore::RenderThemeScrollbar::trough const):
* platform/gtk/ScrollbarThemeGtk.cpp: Added.
(WebCore::ScrollbarTheme::nativeTheme):
(WebCore::themeChangedCallback):
(WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
(WebCore::ScrollbarThemeGtk::setUseSystemAppearance):
(WebCore::ScrollbarThemeGtk::themeChanged):
(WebCore::ScrollbarThemeGtk::updateThemeProperties):
(WebCore::ScrollbarThemeGtk::hasButtons):
(WebCore::scrollbarPartStateFlags):
(WebCore::widgetTypeForScrollbar):
(WebCore::contentsRectangle):
(WebCore::ScrollbarThemeGtk::trackRect):
(WebCore::ScrollbarThemeGtk::backButtonRect):
(WebCore::ScrollbarThemeGtk::forwardButtonRect):
(WebCore::ScrollbarThemeGtk::paint):
(WebCore::ScrollbarThemeGtk::handleMousePressEvent):
(WebCore::ScrollbarThemeGtk::scrollbarThickness):
(WebCore::ScrollbarThemeGtk::minimumThumbLength):
* platform/gtk/ScrollbarThemeGtk.h: Added.
2020-04-14 Youenn Fablet <youenn@apple.com>
Add a timer to AVVideoCaptureSource to verify reception of frames
https://bugs.webkit.org/show_bug.cgi?id=210335
Reviewed by Eric Carlson.
Count the number of frames being captured.
Add a timer repeating every 3 seconds.
Timer starts/stops based on whether the session is running/is interrupted.
If the number of frames did not increase, fail the source.
Manually tested.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::captureFailed):
Explicitly call stop() instead of just setting m_isProducingData.
This ensures we release all resources and that we may not restart capturing after captureFailed().
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
(WebCore::AVVideoCaptureSource::verifyIsCapturing):
(WebCore::AVVideoCaptureSource::updateVerifyCapturingTimer):
(WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
(WebCore::AVVideoCaptureSource::captureSessionIsRunningDidChange):
2020-04-14 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r260024.
https://bugs.webkit.org/show_bug.cgi?id=210480
Regressed performance due to loss of specificity caching
(Requested by anttik on #webkit).
Reverted changeset:
"[CSS Selectors] Selectors Level 4 specificity calculation for
pseudo classes"
https://bugs.webkit.org/show_bug.cgi?id=210419
https://trac.webkit.org/changeset/260024
2020-04-13 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r260052.
https://bugs.webkit.org/show_bug.cgi?id=210479
Breaks iOS tests, needs more work (Requested by smfr on
#webkit).
Reverted changeset:
"Add ENABLE_CUSTOM_SCROLLBARS and define it for macOS and for
non-Cocoa platforms"
https://bugs.webkit.org/show_bug.cgi?id=210460
https://trac.webkit.org/changeset/260052
2020-04-13 Adrian Perez de Castro <aperez@igalia.com>
[GTK4] Use ThemeAdwaita instead of ThemeGtk
https://bugs.webkit.org/show_bug.cgi?id=210334
Reviewed by Carlos Garcia Campos.
No new tests needed.
* platform/adwaita/ThemeAdwaita.cpp: Build the Theme::singleton() factory also with USE(GTK4).
* platform/gtk/ThemeGtk.cpp: Conditionally build if !USE(GTK4).
(WebCore::ThemeGtk::ensurePlatformColors const): Add deprecation ignore guards.
* platform/gtk/ThemeGtk.h: Conditionally build if !USE(GTK4).
2020-04-13 Simon Fraser <simon.fraser@apple.com>
[Async overflow] Get scroll-snap working with async overflow scrolling on macOS
https://bugs.webkit.org/show_bug.cgi?id=210471
<rdar://problem/61643199>
Reviewed by Wenson Hsieh.
Obey the FIXME and move scroll-snap related code to the delegate so that it works for
both frame and overflow nodes.
Tests: tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-async-overflow-stateless.html
tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-async-overflow.html
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
(WebCore::convertToLayoutUnits): Deleted.
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::convertToLayoutUnits):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::updateFromStateNode):
2020-04-13 Zalan Bujtas <zalan@apple.com>
Do not cache definite height against perpendicular flex items.
https://bugs.webkit.org/show_bug.cgi?id=207603
<rdar://problem/59135373>
Reviewed by Simon Fraser.
RenderFlexibleBox::m_hasDefiniteHeight should not be set when the child we check against is a perpendicular item
because a perpendicular box's height is resolved against the containing block's width.
Test: fast/flexbox/unresolved-height-percentage-crash.html
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild):
2020-04-13 David Kilzer <ddkilzer@apple.com>
Replace use of Checked<size_t, RecordOverflow> with CheckedSize
<https://webkit.org/b/210461>
Reviewed by Mark Lam.
* platform/audio/ios/AudioFileReaderIOS.cpp:
(WebCore::createAudioBufferList):
* platform/graphics/ImageBufferBackend.cpp:
(WebCore::ImageBufferBackend::calculateBackendSize):
* platform/graphics/win/Direct2DUtilities.cpp:
(WebCore::Direct2D::createDirect2DImageSurfaceWithData):
* platform/graphics/win/ImageBufferDirect2DBackend.cpp:
(WebCore::ImageBufferDirect2DBackend::copyNativeImage const):
2020-04-13 Simon Fraser <simon.fraser@apple.com>
Add ENABLE_CUSTOM_SCROLLBARS and define it for macOS and for non-Cocoa platforms
https://bugs.webkit.org/show_bug.cgi?id=210460
Reviewed by Tim Horton.
Wrap all custom scrollbar and custom scroll corner code in ENABLE(CUSTOM_SCROLLBARS).
* page/FrameView.cpp:
(WebCore::FrameView::createScrollbar):
(WebCore::FrameView::updateScrollCorner):
* page/FrameView.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::createScrollbar):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::createScrollbar):
* rendering/RenderMenuList.cpp:
(RenderMenuList::createScrollbar):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::containingBlock const):
* rendering/RenderObject.h:
* rendering/RenderScrollbar.cpp:
* rendering/RenderScrollbar.h:
* rendering/RenderScrollbarPart.cpp:
* rendering/RenderScrollbarPart.h:
* rendering/RenderScrollbarTheme.cpp:
* rendering/RenderScrollbarTheme.h:
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::createScrollbar):
* rendering/RenderTextControlSingleLine.cpp:
* style/StyleResolver.cpp:
2020-04-13 Kenneth Russell <kbr@chromium.org>
Clean up more resources during WebGLLayer teardown
https://bugs.webkit.org/show_bug.cgi?id=210222
Reviewed by Dean Jackson.
Release OpenGL resources just before destruction of the underlying
OpenGL context.
* platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
(WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL):
* platform/graphics/cocoa/WebGLLayer.h:
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer releaseGLResources]):
(-[WebGLLayer dealloc]): Deleted.
2020-04-13 Noam Rosenthal <noam@webkit.org>
Background images should figure into visually non empty heuristic
https://bugs.webkit.org/show_bug.cgi?id=208501
Reviewed by Simon Fraser.
This makes the visually non-empty heuristic treat background images the same
as it treats regular images. This is in line with first contentful paint spec in paint timing:
https://w3c.github.io/paint-timing/.
Note that the pixel count is computed based on the image size rather than the box size, as the box size might not be known at this time.
This is equivalent to the pixel reporting done for RenderImage.
Border-images and masks are excluded, as per the spec.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::imageChanged):
Call incrementVisuallyNonEmptyPixelCountIfNeeded for background images
* rendering/RenderElement.cpp:
(WebCore::RenderElement::RenderElement):
* rendering/RenderBox.cpp:
(WebCore::RenderElement::incrementVisuallyNonEmptyPixelCountIfNeeded):
* rendering/RenderBox.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::incrementVisuallyNonEmptyPixelCountIfNeeded): Deleted.
* rendering/RenderImage.h:
Moved incrementVisuallyNonEmptyPixelCountIfNeeded from RenderImage to RenderElement
2020-04-13 Yusuke Suzuki <ysuzuki@apple.com>
module's default cross-origin value should be "anonymous"
https://bugs.webkit.org/show_bug.cgi?id=210326
Reviewed by Sam Weinig.
Tests: http/tests/security/cookie-module-import-propagate.html
http/tests/security/cookie-module-import.html
http/tests/security/cookie-module-propagate.html
http/tests/security/cookie-module.html
The original spec was using "omit" crossorigin for modules when crossorigin is not set / empty.
However, the spec is changed to sending requests with "same-origin" credentials ("anonymous" crossorigin mode)
by default. We should follow it.
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::requestModuleScript):
* dom/ScriptElementCachedScriptFetcher.cpp:
(WebCore::ScriptElementCachedScriptFetcher::requestModuleScript const):
* dom/ScriptElementCachedScriptFetcher.h:
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::PreloadRequest::resourceRequest):
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::script): While this is not directly related to this patch, added new tests found that we are returning
null StringView if the resource is zero byte. This totally works, but JSC::Parser has assertion that this is non-null
StringView. For zero byte CachedScript resource, we should return non-null empty StringView instead.
2020-04-13 Dean Jackson <dino@apple.com>
Add Apple's Reality files to AR System Preview
https://bugs.webkit.org/show_bug.cgi?id=210449
<rdar://problem/61732793>
Reviewed by Sam Weinig.
Add support for Apples .reality AR files - both the vendor MIME
Type and our UTI. These have been supported by WebKitAdditions for
a while. Move them into Open Source.
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::systemPreviewMIMETypes):
* platform/network/mac/UTIUtilities.mm:
(WebCore::UTIFromUnknownMIMEType):
2020-04-13 Per Arne Vollan <pvollan@apple.com>
[iOS] Remove unused UTType swizzler code
https://bugs.webkit.org/show_bug.cgi?id=210435
Unreviewed rollout of r258120.
* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/UTTypeRecordSwizzler.h: Removed.
* platform/cocoa/UTTypeRecordSwizzler.mm: Removed.
2020-04-13 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r260003.
https://bugs.webkit.org/show_bug.cgi?id=210441
Avoid using basic-authentication for tests (Requested by
yusukesuzuki on #webkit).
Reverted changeset:
"module's default cross-origin value should be "anonymous""
https://bugs.webkit.org/show_bug.cgi?id=210326
https://trac.webkit.org/changeset/260003
2020-04-13 Antti Koivisto <antti@apple.com>
[CSS Selectors] Selectors Level 4 specificity calculation for pseudo classes
https://bugs.webkit.org/show_bug.cgi?id=210419
Reviewed by Simon Fraser.
CSS selector specification drafts at some point had a concept of "dynamic specificity" where
the specificity of a selector depended on the element it matched. It was only ever used with
:matches and :nth-child pseudo classes and has subsequently been removed. Selector specificity
can now always be computed statically.
There is a ton of code to support this obsolete feature. Remove it.
https://drafts.csswg.org/selectors-4/#specificity-rules
"The specificity of an :is(), :not(), or :has() pseudo-class is replaced by the specificity
of the most specific complex selector in its selector list argument.
Analogously, the specificity of an :nth-child() or :nth-last-child() selector is the specificity
of the pseudo class itself (counting as one pseudo-class selector) plus the specificity of the
most specific complex selector in its selector list argument (if any)."
* css/html.css:
Reorganize a :matches rule into a selector list to keep the exact specificites.
It matters here to select between listbox and menulist correctly based on the 'size' and 'multiple' attributes.
* css/CSSSelector.cpp:
(WebCore::selectorSpecificity):
(WebCore::maxSpecificity):
(WebCore::simpleSelectorSpecificityInternal):
(WebCore::CSSSelector::simpleSelectorSpecificity const):
Also handle nth here.
(WebCore::CSSSelector::specificity const):
(WebCore::simpleSelectorFunctionalPseudoClassStaticSpecificity): Deleted.
(WebCore::functionalPseudoClassStaticSpecificity): Deleted.
(WebCore::staticSpecificityInternal): Deleted.
(WebCore::CSSSelector::staticSpecificity const): Deleted.
Rename to just computeSpecificity(), there is no other kind than static.
* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::match const):
(WebCore::SelectorChecker::matchHostPseudoClass const):
(WebCore::SelectorChecker::matchRecursively const):
(WebCore::SelectorChecker::checkOne const):
(WebCore::SelectorChecker::matchSelectorList const):
SelectorChecker doesn't need to deal with specificity anymore.
* css/SelectorChecker.h:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addNthChildType):
(WebCore::SelectorCompiler::addPseudoClassType):
(WebCore::SelectorCompiler::constructFragmentsInternal):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
Neither does SelectorCompiler.
* cssjit/SelectorCompiler.h:
* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::selectorMatches const):
(WebCore::SelectorDataList::selectorClosest const):
* inspector/InspectorStyleSheet.cpp:
(WebCore::buildObjectForSelectorHelper):
(WebCore::selectorsFromSource):
(WebCore::InspectorStyleSheet::buildObjectForSelector):
(WebCore::InspectorStyleSheet::buildObjectForSelectorList):
(WebCore::InspectorStyleSheet::buildObjectForRule):
(WebCore::InspectorStyleSheet::buildArrayForRuleList):
(WebCore::hasDynamicSpecificity): Deleted.
* inspector/InspectorStyleSheet.h:
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::setRuleSelector):
(WebCore::InspectorCSSAgent::addRule):
(WebCore::InspectorCSSAgent::buildObjectForRule):
(WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::highlightSelector):
* style/ElementRuleCollector.cpp:
(WebCore::Style::ElementRuleCollector::ruleMatches):
(WebCore::Style::ElementRuleCollector::collectMatchingRulesForList):
Switch to get the specificity from the selector instead of computing it during selector checking.
* style/ElementRuleCollector.h:
* style/RuleData.cpp:
(WebCore::Style::computeMatchesBasedOnRuleHash):
(WebCore::Style::RuleData::RuleData):
(WebCore::Style::computeMatchBasedOnRuleHash): Deleted.
* style/RuleData.h:
(WebCore::Style::RuleData::matchesBasedOnRuleHash const):
(WebCore::Style::RuleData::matchBasedOnRuleHash const): Deleted.
This can be a bit instead of an enum since there is no need to communicate specificity.
2020-04-13 David Kilzer <ddkilzer@apple.com>
KeyedDecoder functions in ResourceLoadStatistics.{cpp,h} should return bool and use WARN_UNUSED_RETURN
<https://webkit.org/b/210414>
<rdar://problem/61693118>
Reviewed by Alex Christensen.
* loader/ResourceLoadStatistics.cpp:
(WebCore::decodeHashCountedSet):
(WebCore::decodeHashSet):
(WebCore::decodeOptionSet):
(WebCore::decodeFontHashSet):
(WebCore::decodeCanvasActivityRecord):
(WebCore::ResourceLoadStatistics::decode):
* loader/ResourceLoadStatistics.h:
- Change decode functions to return `bool`.
- Add WARN_UNUSED_RETURN to all decode functions.
- Check the return value of all decode functions.
2020-04-13 Said Abou-Hallawa <sabouhallawa@apple.com>
When drawing an image srcRect and imageRect have to be in the orientation of destRect
https://bugs.webkit.org/show_bug.cgi?id=210364
Reviewed by Darin Adler.
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::drawImage):
Use the renderer to get the orientation of the image if it is available.
Otherwise fall back to computedStyle().
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw):
For async image decoding, we will use the none oriented size as the
sizeForDrawing. imageRect must be in the same orientation as destRect.
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawImage):
srcRect must be in the same orientation as destRect.
2020-04-13 Joonghun Park <jh718.park@samsung.com>
Unreviewed. Remove redundant move in return statement.
Return statement already returns rvalue,
so we don't need move here.
This patch removes the build warning below since r259922.
warning: redundant move in return statement [-Wredundant-move]
No new tests, no new behaviours.
* page/csp/ContentSecurityPolicyResponseHeaders.h:
(WebCore::ContentSecurityPolicyResponseHeaders::decode):
* platform/network/cf/CertificateInfoCFNet.cpp:
(WTF::Persistence::decodeSecTrustRef):
2020-04-13 Youenn Fablet <youenn@apple.com>
Fix mute/unmute of CoreAudioCapture sources after revision 257914
https://bugs.webkit.org/show_bug.cgi?id=210381
Reviewed by Eric Carlson.
Revert part of revision 257914 since we still need the active source registration/unregistration when capturing in web process.
Make sure mock factory delegates all active source handling to CoreAudioCaptureSourceFactory,
now that the mock factory is using CoreAudioCaptureSources with a mock share dunit.
Tests: platform/ios/mediastream/audio-muted-in-background-tab-gpu-process.html
platform/ios/mediastream/getUserMedia-single-capture-gpu-process.html
* platform/mediastream/RealtimeMediaSourceFactory.h:
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource):
(WebCore::CoreAudioCaptureSource::startProducingData):
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
2020-04-13 Michael Catanzaro <mcatanzaro@gnome.org>
Fix various build warnings
https://bugs.webkit.org/show_bug.cgi?id=210429
Reviewed by Mark Lam.
Fix -Wunused-parameter warning.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::texImage2DBase):
2020-04-13 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Pre-fill columnIntrinsicWidths vector
https://bugs.webkit.org/show_bug.cgi?id=210415
Reviewed by Antti Koivisto.
Vector<ColumnMinimumWidth> has a fixed number of entries (number of columns in the table).
(This patch also flips the shouldFlex flag to isFixedWidth. It reads better in the context of minimum _widths_).
Test: fast/layoutformattingcontext/table-with-column-spanner-first-row.html
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
2020-04-13 Adrian Perez de Castro <aperez@igalia.com>
[GTK4] Fix usage of GDK event functions in PlatformWheelEventGtk
https://bugs.webkit.org/show_bug.cgi?id=210160
Reviewed by Michael Catanzaro.
No new tests needed.
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent): Conditionally
use the new GDK event functions when building with GTK4.
2020-04-13 Yusuke Suzuki <ysuzuki@apple.com>
module's default cross-origin value should be "anonymous"
https://bugs.webkit.org/show_bug.cgi?id=210326
Reviewed by Sam Weinig.
The original spec was using "omit" crossorigin for modules when crossorigin is not set / empty.
However, the spec is changed to sending requests with "same-origin" credentials ("anonymous" crossorigin mode)
by default. We should follow it.
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::requestModuleScript):
* dom/ScriptElementCachedScriptFetcher.cpp:
(WebCore::ScriptElementCachedScriptFetcher::requestModuleScript const):
* dom/ScriptElementCachedScriptFetcher.h:
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::PreloadRequest::resourceRequest):
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::script): While this is not directly related to this patch, added new tests found that we are returning
null StringView if the resource is zero byte. This totally works, but JSC::Parser has assertion that this is non-null
StringView. For zero byte CachedScript resource, we should return non-null empty StringView instead.
2020-04-13 Charlie Turner <cturner@igalia.com>
[EME][GStreamer] remove m_cdmInstance ASSERT in cdmInstanceDetached
https://bugs.webkit.org/show_bug.cgi?id=210331
Reviewed by Xabier Rodriguez-Calvar.
In tests that reset the src very quickly, the MediaKeys can be
installed and then the src is reset before an attachment message
is sent. Hence, detachment can result in no CDM currently
existing.
Covered by imported/w3c/web-platform-tests/encrypted-media.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::cdmInstanceDetached): Only
assert if the CDM instance has been set before detachment.
(WebCore::MediaPlayerPrivateGStreamer::attemptToDecryptWithInstance):
Do not need the .get(), the operator== overload in RefPtr does
this for us, and it makes the code more consistent.
2020-04-13 Rob Buis <rbuis@igalia.com>
Remove return parameter from FrameLoader::closeURL
https://bugs.webkit.org/show_bug.cgi?id=210404
Reviewed by Manuel Rego Casasnovas.
Remove return parameter from FrameLoader::closeURL since it always
returns true and is never tested.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::closeURL):
* loader/FrameLoader.h:
2020-04-13 Rob Buis <rbuis@igalia.com>
Remove addExtraFieldsToSubresourceRequest
https://bugs.webkit.org/show_bug.cgi?id=210407
Reviewed by Darin Adler.
Remove addExtraFieldsToSubresourceRequest since it can be replaced by
calling addExtraFieldsToRequest. The loadType parameter is not taken
into account by defaultRequestCachingPolicy so FrameLoadType::Standard
rather than m_loadType is passed.
This patch also replaces the isMainResource boolean parameter with an enum.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::addExtraFieldsToRequest):
(WebCore::FrameLoader::loadPostRequest):
(WebCore::FrameLoader::loadResourceSynchronously):
(WebCore::FrameLoader::loadDifferentDocumentItem):
(WebCore::FrameLoader::addExtraFieldsToSubresourceRequest): Deleted.
* loader/FrameLoader.h:
* loader/PingLoader.cpp:
(WebCore::PingLoader::loadImage):
(WebCore::PingLoader::sendPing):
(WebCore::PingLoader::sendViolationReport):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):
2020-04-12 Darin Adler <darin@apple.com>
Fix a few mispellings of descendant and propagation
https://bugs.webkit.org/show_bug.cgi?id=210409
Reviewed by Mark Lam.
* dom/Element.cpp:
(WebCore::Element::dispatchWheelEvent): "propagation"
* dom/TreeScopeOrderedMap.cpp:
(WebCore::TreeScopeOrderedMap::getAllElementsById const):
"descendants". Also refactored this function a bit.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canShowControlsManager const):
"descendants"
* rendering/RenderFrameSet.cpp:
(WebCore::resetFrameRendererAndDescendants): "descendants"
(WebCore::RenderFrameSet::positionFrames): "descendants"
(WebCore::RenderFrameSet::positionFramesWithFlattening): "descendants"
2020-04-12 Darin Adler <darin@apple.com>
Refactor and tighten up the CSSVariableReferenceValue class
https://bugs.webkit.org/show_bug.cgi?id=210406
Reviewed by Anders Carlsson.
* css/CSSCustomPropertyValue.h: Remove uneeded forward declaration of
CSSVariableReferenceValue, since it's not used here. Added inclde of
CSSVariableData.h since the use of Variant in this class does require
that header, which we were getting indirectly before from
CSSVariableReferenceValue.h in some translation units.
* css/CSSVariableReferenceValue.cpp:
(WebCore::CSSVariableReferenceValue::CSSVariableReferenceValue): Moved here
from the header.
(WebCore::CSSVariableReferenceValue::create): Ditto.
(WebCore::CSSVariableReferenceValue::equals const): Ditto.
(WebCore::CSSVariableReferenceValue::customCSSText const): Use non-null to
indicate this is not serialized.
* css/CSSVariableReferenceValue.h: Reduced includes, inlining, marked
constructor explicit, removed unneeded m_serialized boolean.
* rendering/style/StyleCustomPropertyData.h: Remove unneeded include
of CSSVariableReferenceValue.h, not used here.
2020-04-12 Darin Adler <darin@apple.com>
Fix some strange uses of start/endOfDocument
https://bugs.webkit.org/show_bug.cgi?id=210408
Reviewed by Wenson Hsieh.
* editing/VisibleSelection.cpp:
(WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity):
Call startOfDocument and endOfDocument without unnecessarily turning a Position
into a VisiblePostion, since those functions just require any node from the document.
2020-04-12 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Add support for column spanners
https://bugs.webkit.org/show_bug.cgi?id=210403
Reviewed by Antti Koivisto.
Table width constraint computation with spanner support is as follows:
1. Collect each cells' width constraints.
2. Collect fixed column widths set by <colgroup>'s and <col>s.
3. Find the min/max width for each columns using the cell constraints and the <col> fixed widths but ignore column spans.
4. Distribute column spanning cells min/max widths.
5. Add them all up and return the computed min/max widths.
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::IntrinsicWidthConstraints::operator-=):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
* layout/tableformatting/TableFormattingContextGeometry.cpp:
(WebCore::Layout::TableFormattingContext::Geometry::intrinsicWidthConstraintsForCell):
* layout/tableformatting/TableGrid.cpp:
(WebCore::Layout::TableGrid::Columns::hasFixedColumnsOnly const):
* layout/tableformatting/TableGrid.h:
2020-04-12 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Column, Row and Cell boxes are always ContainerBoxes
https://bugs.webkit.org/show_bug.cgi?id=210402
Reviewed by Antti Koivisto.
These boxes are always ContainerBox types.
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutCell):
(WebCore::Layout::TableFormattingContext::ensureTableGrid):
(WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns):
* layout/tableformatting/TableGrid.cpp:
(WebCore::Layout::TableGrid::Column::Column):
(WebCore::Layout::TableGrid::Columns::addColumn):
(WebCore::Layout::TableGrid::Rows::addRow):
(WebCore::Layout::TableGrid::Row::Row):
(WebCore::Layout::TableGrid::Cell::Cell):
(WebCore::Layout::TableGrid::appendCell):
(WebCore::Layout::TableGrid::insertCell):
(WebCore::Layout::TableGrid::removeCell):
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::Column::box const):
(WebCore::Layout::TableGrid::Row::box const):
(WebCore::Layout::TableGrid::Cell::box const):
2020-04-12 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Add support for fixed width columns
https://bugs.webkit.org/show_bug.cgi?id=210401
Reviewed by Antti Koivisto.
This is in preparation for adding support for spanner cells.
Fixed width columns (<col> and <td>) don't participate in the spanner width distribution.
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::IntrinsicWidthConstraints::operator-=):
* layout/Verification.cpp:
(WebCore::Layout::areEssentiallyEqual):
(WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
(WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): Deleted.
(WebCore::Layout::TableFormattingContext::useAsContentLogicalWidth): Deleted.
* layout/tableformatting/TableFormattingContext.h:
* layout/tableformatting/TableFormattingContextGeometry.cpp:
(WebCore::Layout::TableFormattingContext::Geometry::intrinsicWidthConstraintsForCell):
* layout/tableformatting/TableGrid.cpp:
(WebCore::Layout::TableGrid::Column::isFixedWidth const):
(WebCore::Layout::TableGrid::Cell::isFixedWidth const):
(WebCore::Layout::TableGrid::Slot::Slot):
(WebCore::Layout::TableGrid::appendCell):
(WebCore::Layout::TableGrid::Column::setWidthConstraints): Deleted.
(WebCore::Layout::TableGrid::Column::widthConstraints const): Deleted.
(WebCore::Layout::TableGrid::Column::hasFixedWidth const): Deleted.
(WebCore::Layout::TableGrid::widthConstraints): Deleted.
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::setWidthConstraints):
(WebCore::Layout::TableGrid::widthConstraints):
(WebCore::Layout::TableGrid::Column::setHasFixedWidthCell):
(WebCore::Layout::TableGrid::Column::hasFixedWidthCell const):
(WebCore::Layout::TableGrid::Slot::cell const):
(WebCore::Layout::TableGrid::Slot::cell):
(WebCore::Layout::TableGrid::Slot::widthConstraints const):
(WebCore::Layout::TableGrid::Slot::setWidthConstraints):
(WebCore::Layout::TableGrid::Slot::hasColumnSpan const):
(WebCore::Layout::TableGrid::Slot::hasRowSpan const):
(WebCore::Layout::TableGrid::Slot::isColumnSpanned const):
(WebCore::Layout::TableGrid::Slot::isRowSpanned const):
(WebCore::Layout::TableGrid::hasComputedWidthConstraints const): Deleted.
2020-04-12 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Introduce dedicated SlotPosition/CellSpan structs
https://bugs.webkit.org/show_bug.cgi?id=210399
Reviewed by Antti Koivisto.
SlotPosition.column/row and CellSpan.column/row read better.
* layout/LayoutUnits.h:
(WebCore::Layout::SlotPosition::SlotPosition):
(WebCore::Layout::operator==):
(WTF::SlotPositionHash::hash):
(WTF::SlotPositionHash::equal):
(WTF::HashTraits<WebCore::Layout::SlotPosition>::emptyValue):
(WTF::HashTraits<WebCore::Layout::SlotPosition>::constructDeletedValue):
(WTF::HashTraits<WebCore::Layout::SlotPosition>::isDeletedValue):
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::setRowSpan):
(WebCore::Layout::Box::setColumnSpan):
(WebCore::Layout::Box::rowSpan const):
(WebCore::Layout::Box::columnSpan const):
* layout/layouttree/LayoutBox.h:
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
* layout/tableformatting/TableGrid.cpp:
(WebCore::Layout::TableGrid::Cell::Cell):
(WebCore::Layout::TableGrid::appendCell):
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::Cell::startColumn const):
(WebCore::Layout::TableGrid::Cell::endColumn const):
(WebCore::Layout::TableGrid::Cell::startRow const):
(WebCore::Layout::TableGrid::Cell::endRow const):
(WebCore::Layout::TableGrid::Cell::columnSpan const):
(WebCore::Layout::TableGrid::Cell::rowSpan const):
(WebCore::Layout::TableGrid::Cell::span const):
(WebCore::Layout::TableGrid::Cell::size const): Deleted.
2020-04-12 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Add table support to BlockFormattingContext::Geometry::inFlowWidthAndMargin
https://bugs.webkit.org/show_bug.cgi?id=210400
Reviewed by Antti Koivisto.
Use a slightly modified shrink-to-fit logic to compute the table width.
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
2020-04-12 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Cleanup class/struct/variable names in TableGrid/TableFormattingContext
https://bugs.webkit.org/show_bug.cgi?id=210397
Reviewed by Antti Koivisto.
This is in preparation for the column spanner work.
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutInFlowContent):
(WebCore::Layout::TableFormattingContext::layoutCell):
(WebCore::Layout::TableFormattingContext::positionTableCells):
(WebCore::Layout::TableFormattingContext::setComputedGeometryForRows):
(WebCore::Layout::TableFormattingContext::setComputedGeometryForSections):
(WebCore::Layout::TableFormattingContext::ensureTableGrid):
(WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
(WebCore::Layout::TableFormattingContext::useAsContentLogicalWidth):
(WebCore::Layout::TableFormattingContext::layoutTableCellBox): Deleted.
* layout/tableformatting/TableFormattingContext.h:
* layout/tableformatting/TableGrid.cpp:
(WebCore::Layout::TableGrid::Column::Column):
(WebCore::Layout::TableGrid::Column::hasFixedWidth const):
(WebCore::Layout::TableGrid::Columns::addColumn):
(WebCore::Layout::TableGrid::Columns::addAnonymousColumn):
(WebCore::Layout::TableGrid::Rows::addRow):
(WebCore::Layout::TableGrid::Row::Row):
(WebCore::Layout::TableGrid::Cell::Cell):
(WebCore::Layout::TableGrid::Slot::Slot):
(WebCore::Layout::TableGrid::slot):
(WebCore::Layout::TableGrid::appendCell):
(WebCore::Layout::TableGrid::insertCell):
(WebCore::Layout::TableGrid::removeCell):
(WebCore::Layout::TableGrid::widthConstraints):
(WebCore::Layout::TableGrid::ColumnsContext::addColumn): Deleted.
(WebCore::Layout::TableGrid::CellInfo::CellInfo): Deleted.
(WebCore::Layout::TableGrid::SlotInfo::SlotInfo): Deleted.
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::totalHorizontalSpacing const):
(WebCore::Layout::TableGrid::hasComputedWidthConstraints const):
(WebCore::Layout::TableGrid::Column::box const):
(WebCore::Layout::TableGrid::Columns::list):
(WebCore::Layout::TableGrid::Columns::list const):
(WebCore::Layout::TableGrid::Columns::size const):
(WebCore::Layout::TableGrid::Columns::logicalWidth const):
(WebCore::Layout::TableGrid::Row::logicalBottom const):
(WebCore::Layout::TableGrid::Row::box const):
(WebCore::Layout::TableGrid::Rows::list):
(WebCore::Layout::TableGrid::Rows::rowList const):
(WebCore::Layout::TableGrid::Rows::size const):
(WebCore::Layout::TableGrid::Cell::startColumn const):
(WebCore::Layout::TableGrid::Cell::endColumn const):
(WebCore::Layout::TableGrid::Cell::startRow const):
(WebCore::Layout::TableGrid::Cell::endRow const):
(WebCore::Layout::TableGrid::Cell::columnSpan const):
(WebCore::Layout::TableGrid::Cell::rowSpan const):
(WebCore::Layout::TableGrid::Cell::position const):
(WebCore::Layout::TableGrid::Cell::size const):
(WebCore::Layout::TableGrid::Cell::box const):
(WebCore::Layout::TableGrid::columns const):
(WebCore::Layout::TableGrid::columns):
(WebCore::Layout::TableGrid::rows const):
(WebCore::Layout::TableGrid::rows):
(WebCore::Layout::TableGrid::cells):
(WebCore::Layout::TableGrid::CellInfo::startColumn const): Deleted.
(WebCore::Layout::TableGrid::CellInfo::endColumn const): Deleted.
(WebCore::Layout::TableGrid::CellInfo::startRow const): Deleted.
(WebCore::Layout::TableGrid::CellInfo::endRow const): Deleted.
(WebCore::Layout::TableGrid::CellInfo::columnSpan const): Deleted.
(WebCore::Layout::TableGrid::CellInfo::rowSpan const): Deleted.
(WebCore::Layout::TableGrid::Column::columnBox const): Deleted.
(WebCore::Layout::TableGrid::ColumnsContext::columns): Deleted.
(WebCore::Layout::TableGrid::ColumnsContext::columns const): Deleted.
(WebCore::Layout::TableGrid::ColumnsContext::logicalWidth const): Deleted.
(WebCore::Layout::TableGrid::columnsContext const): Deleted.
(WebCore::Layout::TableGrid::columnsContext): Deleted.
2020-04-11 Jack Lee <shihchieh_lee@apple.com>
Infinite loop in InsertListCommand::doApply()
https://bugs.webkit.org/show_bug.cgi?id=210354
<rdar://problem/61427778>
Reviewed by Darin Adler.
Function startOfNextParagraph may return an empty position. Added null check to exit the while loop
and stop looking for next paragraph.
Test: editing/inserting/insert-list-end-of-table.html
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApply):
2020-04-11 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] [WK1] Touch Bar flashes when typing in Vietnamese in Mail
https://bugs.webkit.org/show_bug.cgi?id=210394
<rdar://problem/60099560>
Reviewed by Tim Horton.
See WebKitLegacy/mac/ChangeLog for more details.
Currently, many users of TemporarySelectionChange use it to temporarily avoid propagating selection changes to
the client layer during temporary selection changes. This involves creating a TemporarySelectionChange without
a new selection, but with the `IgnoreSelectionChanges` option specified, which makes us call `Editor::
setIgnoreSelectionChanges` to suppress selection change notifications.
Do a bit of cleanup in this area by introducing IgnoreSelectionChangeForScope, which wraps a
TemporarySelectionChange and makes it easier for a handful of call sites that currently use
TemporarySelectionChange to hide selection changes from the client layer to get their desired behavior.
Test: CandidateTests.DoNotHideCandidatesDuringTextReplacement
* editing/Editor.cpp:
(WebCore::Editor::respondToChangedSelection):
* editing/Editor.h:
(WebCore::TemporarySelectionChange::TemporarySelectionChange):
(WebCore::IgnoreSelectionChangeForScope::IgnoreSelectionChangeForScope):
* page/DragController.cpp:
(WebCore::DragController::performDragOperation):
(WebCore::DragController::insertDroppedImagePlaceholdersAtCaret):
Replace these:
`TemporarySelectionChange ignoreSelectionChanges { frame, WTF::nullopt, TemporarySelectionOption::IgnoreSelectionChanges };`
...with these instead:
`IgnoreSelectionChangeForScope ignoreSelectionChanges { *frame };`
2020-04-11 Simon Fraser <simon.fraser@apple.com>
[Async overflow] Can't scroll overflow:scroll in sideways-scrollable RTL document
https://bugs.webkit.org/show_bug.cgi?id=210389
Reviewed by Tim Horton.
ScrollingTree::handleWheelEvent() converts the event coordinates from view to "content"
coordinates, but we then jump into hit-testing on CALayers. In a sideways-scrollable
RTL document, the root content layer has a negative X offset which corresponds to
scrollOrigin; we need to map the point into the coordinate space of this layer
before entering layer-based hit-testing.
Tests: fast/scrolling/mac/async-scroll-overflow-rtl-zoomed.html
fast/scrolling/mac/async-scroll-overflow-rtl.html
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::scrollingNodeForPoint):
2020-04-10 Darin Adler <darin@apple.com>
Move more from live range to SimpleRange: callers of absoluteTextRects
https://bugs.webkit.org/show_bug.cgi?id=210369
Reviewed by Anders Carlsson.
* dom/Node.cpp:
(WebCore::Node::textRects const): Deleted.
* dom/Node.h: Updated for the above.
* dom/Range.cpp:
(WebCore::Range::absoluteBoundingBox const): Updated since absoluteTextRects
no longer has a RangeInFixedPosition* argument.
(WebCore::Range::absoluteTextRects const): Removed the unused RangeInFixedPosition*
argument.
* dom/Range.h: Got rid of unused RangeInFixedPosition type and also removed
RangeInFixedPosition* argument from the absoluteTextRects function. Later will
remove absoluteTextRects entirely.
* editing/Editor.cpp:
(WebCore::Editor::firstRectForRange const): Use RenderObject::absoluteTextQuads
and unitedBoundingBoxes rather than using RenderObject::absoluteBoundingBoxRectForRange.
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::detectContentInRange): Use SimpleRange rather than
live ranges.
* html/HTMLTextFormControlElement.cpp:
(WebCore::setContainerAndOffsetForRange): Moved from int to unsigned.
(WebCore::HTMLTextFormControlElement::selection const): Return Optional<SimpleRange>
rather than a live range.
* html/HTMLTextFormControlElement.h: Updated for the change above.
* page/TextIndicator.cpp:
(WebCore::initializeIndicator): Updated since absoluteTextRects no longer takes
a RangeInFixedPosition* argument.
* rendering/HighlightData.h: Removed stray obsolete declaration.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::absoluteBoundingBoxRectForRange): Deleted. Callers can
use absoluteTextQuads directly. We need to cut down on the number of separate
functions that are not really separate concepts, and this was used in only one place.
(WebCore::RenderObject::absoluteTextRects): Added. Replaces Range::absoluteTextRects
for all callers outside the live range class and will eventually replace it entirely.
* rendering/RenderObject.h: Updated for the above.
2020-04-11 Devin Rousso <drousso@apple.com>
REGRESSION (Safari 13.1?): Web Inspector: Debugger hang at breakpoint when using Keyboard Maestro
https://bugs.webkit.org/show_bug.cgi?id=210177
<rdar://problem/61485723>
Reviewed by Joseph Pecoraro.
Partial revert of r251036 <https://webkit.org/b/202716> to go back to using AppKit APIs
instead of `CFRunLoopRunInMode`. Only seems to affect WebKitLegacy.
* inspector/PageScriptDebugServer.h:
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::runEventLoopWhilePausedInternal):
(WebCore::PageScriptDebugServer::platformShouldContinueRunningEventLoopWhilePaused):
* inspector/mac/PageScriptDebugServerMac.mm: Added.
(WebCore::PageScriptDebugServer::platformShouldContinueRunningEventLoopWhilePaused):
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
2020-04-08 Darin Adler <darin@apple.com>
Use Node::length to replace Node::maxCharacterOffset and lastOffsetInNode; switch more offsets from int to unsigned
https://bugs.webkit.org/show_bug.cgi?id=210246
Reviewed by Antti Koivisto.
- The recently-added Node::length, which matches the DOM specification terminology
for node offsets as used in ranges, is the same as the existing maxCharacterOffset
and lastOffsetInNode functions. Deleted all uses of those and replaced them
with calls to Node::length. One of the benefits of this is that Node::length is
implemented more efficiently and is not a virtual function. Another is consistently
matching the DOM specification terminology.
- Many offsets, including the ones in live ranges, are currently implemented as signed
in WebKit, but are specified as unsigned in the DOM and HTML specifications. This
has very little observable effect from JavaScript that can affect website compatibility,
but it's still helpful to be consistent both with the specification and internally.
Accordingly, changed some of these to unsigned; more to come later.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::previousBoundary): Use length instead of
maxCharacterOffset.
* dom/CharacterData.cpp:
(WebCore::CharacterData::maxCharacterOffset const): Deleted.
* dom/CharacterData.h: Deleted maxCharacterOffset override.
* dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::shiftMarkers): Use length instead of
maxCharacterOffset.
* dom/Node.cpp:
(WebCore::Node::maxCharacterOffset const): Deleted.
* dom/Node.h: Deleted maxCharacterOffset.
* dom/Position.cpp:
(WebCore::Position::computeOffsetInContainerNode const): Use length instead
of lastOffsetInNode.
* dom/Position.h:
(WebCore::lastOffsetInNode): Deleted.
(WebCore::lastPositionInNode): Use length instead of lastOffsetInNode.
(WebCore::minOffsetForNode): Use length instead of maxCharacterOffset.
(WebCore::offsetIsBeforeLastNodeOffset): Ditto.
* dom/RangeBoundaryPoint.h:
(WebCore::RangeBoundaryPoint::setToEndOfNode): Use length instead of
maxCharacterOffset.
* editing/ApplyBlockElementCommand.cpp:
(WebCore::isNewLineAtPosition): Use length instead of maxCharacterOffset.
(WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded):
Ditto.
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::removeInlineStyle): Use length instead of
maxCharacterOffset.
* editing/Editing.cpp:
(WebCore::lastOffsetForEditing): Use length instead of mmaxCharacterOffset
and countChildNodes. Also improved the comment here.
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::styleAtSelectionStart): Use length instead of
maxCharacterOffset.
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApplyForSingleParagraph): Use length instead
of lastOffsetInNode.
* editing/TextIterator.cpp:
(WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
USe length instead of lastOffsetInNode.
* editing/VisibleUnits.cpp:
(WebCore::previousBoundary): Use length instead of maxCharacterOffset.
2020-04-10 Alex Christensen <achristensen@webkit.org>
PersistentCoders should use modern decoding syntax
https://bugs.webkit.org/show_bug.cgi?id=207497
Reviewed by Darin Adler.
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::showCertificate):
* loader/FetchOptions.h:
(WebCore::FetchOptions::decodePersistent):
* page/csp/ContentSecurityPolicyResponseHeaders.h:
(WebCore::ContentSecurityPolicyResponseHeaders::encode const):
(WebCore::ContentSecurityPolicyResponseHeaders::decode):
* platform/PasteboardCustomData.cpp:
(WebCore::PasteboardCustomData::fromSharedBuffer):
* platform/network/ResourceLoadPriority.h:
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::encodeBase const):
(WebCore::ResourceRequestBase::decodeBase):
* platform/network/cf/CertificateInfo.h:
(WTF::Persistence::decodeCFData):
(WTF::Persistence::decodeSecTrustRef):
(WTF::Persistence::decodeCertificateChain):
(WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::doPushChanges):
(WebCore::RegistrationDatabase::importRecords):
2020-04-10 Simon Fraser <simon.fraser@apple.com>
[macOS] Fix scrollbar display for async-scrolling overflow
https://bugs.webkit.org/show_bug.cgi?id=194101
Reviewed by Tim Horton.
We need to call positionOverflowControlsLayers() from RenderLayerBacking::updateGeometry(),
otherwise, on first load, scrollbar layers have no size because we try to position them
before we've created them.
Test: fast/scrolling/mac/overflow-scrollbars-should-be-visible.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::positionOverflowControls):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
2020-04-10 Simon Fraser <simon.fraser@apple.com>
[Async overflow] Can't scroll vertically while over a horizontal scroller in this content
https://bugs.webkit.org/show_bug.cgi?id=210356
<rdar://problem/60523731>
Reviewed by Tim Horton.
https://dozermapper.github.io/gitbook/documentation/customconverter.html has style
that triggers mismatched containing block and z-order layer trees, triggering the creation
of an "overflow scroll proxy node" in the scrolling tree.
If we encounter such a node in our ancestor tree walk while deciding which node to send
a wheel event too, we need to jump to the node that the proxy node is representing.
Test: fast/scrolling/mac/nested-overflow-proxy-node.html
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
2020-04-10 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, reverting r259764.
Causes layout test crashes under GuardMalloc
Reverted changeset:
"Release WebGLLayer earlier in ~GraphicsContextGLOpenGL"
https://bugs.webkit.org/show_bug.cgi?id=210213
https://trac.webkit.org/changeset/259764
2020-04-10 Peng Liu <peng.liu6@apple.com>
REGRESSION: (r259850)[ Mac wk1 Debug ] media/track/track-user-stylesheet.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=210350
Reviewed by Daniel Bates.
Revert the change in r259850.
* page/CaptionUserPreferences.cpp:
(WebCore::CaptionUserPreferences::setCaptionsStyleSheetOverride):
2020-04-10 Pinki Gyanchandani <pgyanchandani@apple.com>
Null ptr Deref in RadioButtonGroups::updateCheckedState
https://bugs.webkit.org/show_bug.cgi?id=210353
Reviewed by Chris Dumez.
This crash happened when the default checked setter was called for an input element and RadioButtonGroup was NULL.
Added condition to dereference the group only if it is non-null.
Test: fast/forms/input-element-default-checked-setter-crash.html
* dom/RadioButtonGroups.cpp:
(WebCore::RadioButtonGroups::updateCheckedState):
2020-04-10 Jack Lee <shihchieh_lee@apple.com>
ASSERTION FAILED: selection.isRange() in InsertListCommand::doApply
https://bugs.webkit.org/show_bug.cgi?id=210170
<rdar://problem/61410397>
Reviewed by Wenson Hsieh.
If selectionForParagraphIteration returns a non-range selection, there is no need for finding
multiple paragraphs. And since non-range selection is handled, the assertion can be removed.
Test: editing/inserting/insert-list-in-table-assert.html
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApply):
2020-04-10 Antti Koivisto <antti@apple.com>
[CSS Shadow Parts] Bad style sharing between sibling elements with different part attributes
https://bugs.webkit.org/show_bug.cgi?id=210249
<rdar://problem/61547528>
Reviewed by Daniel Bates.
Style sharing optimization was unconditionally allowed for elements that were styled with part pseudo element.
This could lead to miscomputed style.
Test case by Justin Fagnani.
Test: fast/css/shadow-parts/shadow-part-style-sharing.html
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::canShareStyleWithElement):
Only allow style sharing if parts match.
== Rolled over to ChangeLog-2020-04-10 ==