Commit Graph

233106 Commits

Author SHA1 Message Date
Leorize bfa6894640 Preliminary work on the switch to BUrlSession
This is a basic adaption of the current WebKit to make use of
BUrlSession. It's done enough for HaikuLauncher to compile, however I've
not managed to throughly test it due as my VM died.
2021-01-28 20:45:49 +01:00
Leorize b07f99d2ef Preliminary support for output-to-BDataIO 2021-01-28 20:45:48 +01:00
Leorize fb627e96a5 platform/network/haiku: rework networking backend
Main changes in this commit:
- BUrlProtocolHandler is splitted into two classes:
  - BUrlProtocolHandler for managing the request lifetime.
  - BUrlRequestWrapper for handling events from requests spawned by
    BUrlProtocolHandler.

  The separation allow the events handling code to be greatly
  simplified, and code for handling events and managing request
  are now properly separated.

  In the future this enables BUrlProtocolHandler to be the
  synchronization/serialization point, allowing BUrlRequestWrapper to
  interface with BUrlRequest directly instead of going through
  BUrlProtocolAsynchronousRequest, which should allow for better
  performance.

- Redirection and authentication are now handled manually by the backend
  instead of delegating to BUrlRequest.

- Code style has been adjusted to match WebKit official style guideline.
2021-01-28 20:45:47 +01:00
Leorize 5cac3ffbdc MediaPlayerPrivateHaiku: remove unused references to BUrlRequest 2021-01-28 20:45:45 +01:00
Alexander von Gluck IV ee042b725e Haiku: New files making up the Haiku WebKit port 2021-01-17 17:50:18 -06:00
Alexander von Gluck IV e0c954b248 haiku: Shared Webkit source modifications for Haiku support 2021-01-17 17:50:04 -06:00
Wenson Hsieh 6d796db246 Unreviewed, fix the internal iOS build after r271559
Fix the build with IOS_TOUCH_EVENTS enabled.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::handleTouchEvent): Deleted.
(WebCore::RenderLayer::registerAsTouchEventListenerForScrolling): Deleted.
(WebCore::RenderLayer::unregisterAsTouchEventListenerForScrolling): Deleted.

Remove a few undeclared method definitions. These methods were relocated to `RenderLayerScrollableArea`.

* rendering/RenderLayerScrollableArea.cpp:

Remove several methods that have duplicate implementations.

Canonical link: https://commits.webkit.org/233100@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-17 21:06:49 +00:00
Fujii Hironori d22da28c9e [non-Cocoa] Add a new AuxiliaryProcessMainBase class for auxiliary processes without singleton()
https://bugs.webkit.org/show_bug.cgi?id=220615

Reviewed by Don Olmstead.

non-Cocoa ports auxiliary processes are using AuxiliaryProcessMain
as the entry points. AuxiliaryProcessMain supports both kinds of
auxiliary processes with and without singleton() method by using
initializeAuxiliaryProcess template function. However, all
initializeAuxiliaryProcess look similar code. They can share more
code.

Added a AuxiliaryProcessMainBaseNoSingleton template class for
auxiliary processes without singleton().

Moved the code that was in AuxiliaryProcessMain to
AuxiliaryProcessMainBase::run() to remove
takeInitializationParameters().

* GPUProcess/gstreamer/GPUProcessMainGStreamer.cpp:
(WebKit::GPUProcessMain):
(WebKit::initializeAuxiliaryProcess<GPUProcess>): Deleted.
* GPUProcess/playstation/GPUProcessMainPlayStation.cpp:
(WebKit::GPUProcessMain):
(WebKit::initializeAuxiliaryProcess<GPUProcess>): Deleted.
* GPUProcess/win/GPUProcessMainWin.cpp:
(WebKit::GPUProcessMain):
(WebKit::initializeAuxiliaryProcess<GPUProcess>): Deleted.
* NetworkProcess/curl/NetworkProcessMainCurl.cpp:
(WebKit::NetworkProcessMain):
(WebKit::initializeAuxiliaryProcess<NetworkProcess>): Deleted.
* NetworkProcess/soup/NetworkProcessMainSoup.cpp:
(WebKit::NetworkProcessMain):
(WebKit::initializeAuxiliaryProcess<NetworkProcess>): Deleted.
* Shared/AuxiliaryProcessMain.h:
(WebKit::AuxiliaryProcessMainBase::platformInitialize):
(WebKit::AuxiliaryProcessMainBase::platformFinalize):
(WebKit::AuxiliaryProcessMainBase::initializeAuxiliaryProcess):
(WebKit::AuxiliaryProcessMainBase::run):
(WebKit::AuxiliaryProcessMainBaseNoSingleton::process):
(WebKit::AuxiliaryProcessMain):
(WebKit::AuxiliaryProcessMainBase::initializationParameters): Deleted.
(WebKit::AuxiliaryProcessMainBase::takeInitializationParameters): Deleted.
(WebKit::initializeAuxiliaryProcess): Deleted.
* Shared/unix/AuxiliaryProcessMain.cpp:
(WebKit::AuxiliaryProcessMainCommon::parseCommandLine):
(WebKit::AuxiliaryProcessMainBase::parseCommandLine): Deleted.
* Shared/win/AuxiliaryProcessMainWin.cpp:
(WebKit::AuxiliaryProcessMainCommon::parseCommandLine):
(WebKit::AuxiliaryProcessMainBase::parseCommandLine): Deleted.
* WebProcess/gtk/WebProcessMainGtk.cpp:
(WebKit::WebProcessMain):
* WebProcess/playstation/WebProcessMainPlayStation.cpp:
(WebKit::WebProcessMain):
* WebProcess/win/WebProcessMainWin.cpp:
(WebKit::WebProcessMain):
* WebProcess/wpe/WebProcessMainWPE.cpp:
(WebKit::WebProcessMain):

Canonical link: https://commits.webkit.org/233099@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271563 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-17 19:55:10 +00:00
Zalan Bujtas 09e5152cc1 [LFC][IFC] No need to maintain the "is considered empty" bit anymore.
https://bugs.webkit.org/show_bug.cgi?id=220228

Reviewed by Antti Koivisto.

Now that isConsideredEmpty() bit is only used as input to line breaking, let's change it to a more
focused check and remove the concept of "is considered empty" completely.

* layout/inlineformatting/InlineContentBreaker.cpp:
(WebCore::Layout::InlineContentBreaker::processInlineContent):
(WebCore::Layout::InlineContentBreaker::processOverflowingContent const):
* layout/inlineformatting/InlineContentBreaker.h:
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::initialize):
(WebCore::Layout::Line::removeTrailingTrimmableContent):
(WebCore::Layout::Line::append):
(WebCore::Layout::Line::appendTextContent):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::isConsideredEmpty const): Deleted.
* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::close):
(WebCore::Layout::LineBuilder::handleInlineContent):


Canonical link: https://commits.webkit.org/233098@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271562 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-17 14:44:37 +00:00
Youenn Fablet 48c0bbe484 Add CoreMedia aavds entitlement to WebContent and GPU processes
https://bugs.webkit.org/show_bug.cgi?id=220238

Reviewed by Brent Fulgham.

Manually tested.

* Scripts/process-entitlements.sh:


Canonical link: https://commits.webkit.org/233097@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271561 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-17 12:36:52 +00:00
Yusuke Suzuki aacd54f678 Add JSC API configuring GC signals in Linux
https://bugs.webkit.org/show_bug.cgi?id=220641

Reviewed by Mark Lam.

Source/JavaScriptCore:

Add JSConfigureSignalForGC function for Linux and FreeBSD (non Apple, non Windows platforms).

* API/JSBase.cpp:
(JSConfigureSignalForGC):
* API/JSBasePrivate.h:

Source/WTF:

In Linux and FreeBSD, we need to use signals to suspend and resume threads.
By default, we are using SIGUSR1, but it is possible that some embedders want to use
the other signals since they are using SIGUSR1 already. To work-around that, this
patch offers the way for embedders to configure signals.

* wtf/Threading.h:
* wtf/WTFConfig.h:
* wtf/posix/ThreadingPOSIX.cpp:
(WTF::Thread::signalHandlerSuspendResume):
(WTF::Thread::initializePlatformThreading):
(WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
(WTF::Thread::initializeCurrentTLS):
(WTF::Thread::suspend):
(WTF::Thread::resume):
* wtf/threads/Signals.cpp:
(WTF::addSignalHandler):
* wtf/win/ThreadingWin.cpp:
(WTF::Thread::initializeCurrentTLS):

Canonical link: https://commits.webkit.org/233096@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271560 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-17 08:50:49 +00:00
Nikolas Zimmermann 22e0c65af5 Separate scrolling code out of RenderLayer
https://bugs.webkit.org/show_bug.cgi?id=60305

Reviewed by Simon Fraser.

Move all scrolling/overflow handling out of RenderLayer, to
streamline its interface and make it re-usable for layer
types that do not need nor support scrolling/overflow.

Many variables tracking scrolling/overflow state were migrated to
RenderLayerScrollableArea, which is only created if the renderer
corresponding to the layer has a CSS 'resize' property != 'none',
has potentially scrollable overflow content or <marquee>.

For the common case (no scrollable overflow), the RenderLayer
overhead is reduced: less memory, less state tracking.

Covered by existing tests.

* WebCore.xcodeproj/project.pbxproj: Make RenderLayerScrollableArea.h
include work in WebKit project.
* accessibility/AccessibilityRenderObject.cpp: Adapt to the fact that
RenderLayer is no longer a ScrollableArea.
(WebCore::AccessibilityRenderObject::getScrollableAreaIfScrollable const):
* html/TextFieldInputType.cpp: Adapt to the fact that RenderLayer is
no longer a ScrollableArea.
(WebCore::TextFieldInputType::elementDidBlur):
* page/EventHandler.cpp: Ditto.
(WebCore::EventHandler::enclosingScrollableArea):
(WebCore::EventHandler::handleWheelEventInAppropriateEnclosingBox):
* page/FrameView.cpp: Ditto.
(WebCore::FrameView::enclosingScrollableArea const):
* page/ios/FrameIOS.mm: Ditto.
(WebCore::Frame::overflowScrollPositionChangedForNode):
* page/mac/EventHandlerMac.mm:
(WebCore::scrollableAreaForBox):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::requiresLayerWithScrollableArea const): Decides
whether a RenderLayer needs a RenderLayerScrollableArea. The presence
of resize/marquee/overflow triggers creation of a
RenderLayerScrollableArea object.
* rendering/RenderBox.h:
* rendering/RenderLayer.cpp: Move all overflow/resize/marquee/scroll
handling to RenderLayerScrollableArea and adapt the affected code.
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::~RenderLayer):
(WebCore::RenderLayer::currentScrollType const):
(WebCore::RenderLayer::scrollAnimator const):
(WebCore::RenderLayer::scrollOffset const):
(WebCore::RenderLayer::scrollToOffset):
(WebCore::RenderLayer::scrollToXPosition):
(WebCore::RenderLayer::scrollToYPosition):
(WebCore::RenderLayer::setScrollPosition):
(WebCore::RenderLayer::scrollByRecursively):
(WebCore::RenderLayer::setRequiresScrollPositionReconciliation):
(WebCore::RenderLayer::setAdjustForIOSCaretWhenScrolling):
(WebCore::RenderLayer::setScrollShouldClearLatchedState):
(WebCore::RenderLayer::shouldPlaceBlockDirectionScrollbarOnLeft const):
(WebCore::RenderLayer::containsDirtyOverlayScrollbars const):
(WebCore::RenderLayer::hasScrollableOrRubberbandableAncestor):
(WebCore::RenderLayer::marquee const):
(WebCore::RenderLayer::updateLayerPositionsAfterDocumentScroll):
(WebCore::RenderLayer::hitTestOverflowControls):
(WebCore::RenderLayer::paintOverflowControls):
(WebCore::RenderLayer::paintResizer):
(WebCore::RenderLayer::paintScrollCorner):
(WebCore::RenderLayer::paintOverlayScrollbars):
(WebCore::RenderLayer::reachableTotalContentsSize const):
(WebCore::RenderLayer::horizontalScrollbarHiddenByStyle const):
(WebCore::RenderLayer::verticalScrollbarHiddenByStyle const):
(WebCore::RenderLayer::setPostLayoutScrollPosition):
(WebCore::RenderLayer::panScrollFromPoint):
(WebCore::RenderLayer::scrollPosition const):
(WebCore::RenderLayer::layerForHorizontalScrollbar const):
(WebCore::RenderLayer::layerForVerticalScrollbar const):
(WebCore::RenderLayer::horizontalScrollbar const):
(WebCore::RenderLayer::verticalScrollbar const):
(WebCore::RenderLayer::scrollingMayRevealBackground const):
(WebCore::RenderLayer::hasScrollableHorizontalOverflow const):
(WebCore::RenderLayer::hasScrollableVerticalOverflow const):
(WebCore::RenderLayer::verticalScrollbarWidth const):
(WebCore::RenderLayer::horizontalScrollbarHeight const):
(WebCore::RenderLayer::scroll):
(WebCore::RenderLayer::setConstrainsScrollingToContentEdge):
(WebCore::RenderLayer::updateLayerPositions):
(WebCore::RenderLayer::updateLayerPositionsAfterScroll):
(WebCore::RenderLayer::updateLayerPosition):
(WebCore::RenderLayer::enclosingFrameRenderLayer const):
(WebCore::RenderLayer::enclosingContainingBlockLayer const):
(WebCore::RenderLayer::enclosingScrollableLayer const):
(WebCore::frameElementAndViewPermitScroll):
(WebCore::RenderLayer::allowsCurrentScroll const):
(WebCore::RenderLayer::scrollRectToVisible):
(WebCore::RenderLayer::resize):
(WebCore::RenderLayer::visibleSize const):
(WebCore::RenderLayer::overflowControlsRects const):
(WebCore::RenderLayer::debugDescription const):
(WebCore::RenderLayer::offsetFromResizeCorner const):
(WebCore::RenderLayer::scrollWidth const):
(WebCore::RenderLayer::scrollHeight const):
(WebCore::RenderLayer::updateScrollInfoAfterLayout):
(WebCore::RenderLayer::canUseCompositedScrolling const):
(WebCore::RenderLayer::hasCompositedScrollableOverflow const):
(WebCore::RenderLayer::hasOverlayScrollbars const):
(WebCore::RenderLayer::usesCompositedScrolling const):
(WebCore::RenderLayer::isPointInResizeControl const):
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::paintOverflowControlsForFragments):
(WebCore::RenderLayer::hitTest):
(WebCore::RenderLayer::hitTestLayer):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h: Ditto.
(WebCore::RenderLayer::hasScrollbars const):
(WebCore::RenderLayer::hasHorizontalScrollbar const):
(WebCore::RenderLayer::hasVerticalScrollbar const):
(WebCore::RenderLayer::scrollToXOffset):
(WebCore::RenderLayer::scrollToYOffset):
* rendering/RenderLayerBacking.cpp: Adapt to the fact that
RenderLayer is no longer a ScrollableArea.
(WebCore::RenderLayerBacking::updateOverflowControlsLayers):
* rendering/RenderLayerCompositor.cpp: Adapt to the fact that
RenderLayer is no longer a ScrollableArea.
(WebCore::RenderLayerCompositor::parentRelativeScrollableRect const):
(WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
(WebCore::RenderLayerCompositor::scrollableAreaForScrollingNodeID const):
* rendering/RenderLayerModelObject.cpp: Adapt to the fact that
RenderLayer is no longer a ScrollableArea.
(WebCore::RenderLayerModelObject::styleDidChange):
* rendering/RenderLayerScrollableArea.cpp: Mostly moved from
RenderLayer.
(WebCore::RenderLayerScrollableArea::RenderLayerScrollableArea):
(WebCore::RenderLayerScrollableArea::~RenderLayerScrollableArea):
(WebCore::RenderLayerScrollableArea::storeScrollPosition):
(WebCore::RenderLayerScrollableArea::handleTouchEvent):
(WebCore::RenderLayerScrollableArea::registerAsTouchEventListenerForScrolling):
(WebCore::RenderLayerScrollableArea::unregisterAsTouchEventListenerForScrolling):
(WebCore::RenderLayerScrollableArea::scrollableAreaBoundingBox const):
(WebCore::RenderLayerScrollableArea::isUserScrollInProgress const):
(WebCore::RenderLayerScrollableArea::isRubberBandInProgress const):
(WebCore::RenderLayerScrollableArea::forceUpdateScrollbarsOnMainThreadForPerformanceTesting const):
(WebCore::RenderLayerScrollableArea::usesAsyncScrolling const):
(WebCore::RenderLayerScrollableArea::setPostLayoutScrollPosition):
(WebCore::RenderLayerScrollableArea::applyPostLayoutScrollPositionIfNeeded):
(WebCore::RenderLayerScrollableArea::scrollToXPosition):
(WebCore::RenderLayerScrollableArea::scrollToYPosition):
(WebCore::RenderLayerScrollableArea::setScrollPosition):
(WebCore::RenderLayerScrollableArea::clampScrollOffset const):
(WebCore::RenderLayerScrollableArea::requestScrollPositionUpdate):
(WebCore::RenderLayerScrollableArea::scrollToOffset):
(WebCore::RenderLayerScrollableArea::scrollTo):
(WebCore::RenderLayerScrollableArea::updateCompositingLayersAfterScroll):
(WebCore::RenderLayerScrollableArea::scrollWidth const):
(WebCore::RenderLayerScrollableArea::scrollHeight const):
(WebCore::RenderLayerScrollableArea::updateMarqueePosition):
(WebCore::RenderLayerScrollableArea::createOrDestroyMarquee):
(WebCore::RenderLayerScrollableArea::scrollsOverflow const):
(WebCore::RenderLayerScrollableArea::canUseCompositedScrolling const):
(WebCore::RenderLayerScrollableArea::setScrollOffset):
(WebCore::RenderLayerScrollableArea::scrollingNodeID const):
(WebCore::RenderLayerScrollableArea::handleWheelEventForScrolling):
(WebCore::RenderLayerScrollableArea::visibleContentRectInternal const):
(WebCore::RenderLayerScrollableArea::overhangAmount const):
(WebCore::RenderLayerScrollableArea::scrollCornerRect const):
(WebCore::RenderLayerScrollableArea::isScrollCornerVisible const):
(WebCore::RenderLayerScrollableArea::convertFromScrollbarToContainingView const):
(WebCore::RenderLayerScrollableArea::convertFromContainingViewToScrollbar const):
(WebCore::RenderLayerScrollableArea::visibleSize const):
(WebCore::RenderLayerScrollableArea::contentsSize const):
(WebCore::RenderLayerScrollableArea::reachableTotalContentsSize const):
(WebCore::RenderLayerScrollableArea::availableContentSizeChanged):
(WebCore::RenderLayerScrollableArea::shouldSuspendScrollAnimations const):
(WebCore::RenderLayerScrollableArea::didStartScroll):
(WebCore::RenderLayerScrollableArea::didEndScroll):
(WebCore::RenderLayerScrollableArea::didUpdateScroll):
(WebCore::RenderLayerScrollableArea::overflowControlsRects const):
(WebCore::RenderLayerScrollableArea::scrollbarOffset const):
(WebCore::RenderLayerScrollableArea::invalidateScrollbarRect):
(WebCore::RenderLayerScrollableArea::invalidateScrollCornerRect):
(WebCore::scrollbarHiddenByStyle):
(WebCore::RenderLayerScrollableArea::horizontalScrollbarHiddenByStyle const):
(WebCore::RenderLayerScrollableArea::verticalScrollbarHiddenByStyle const):
(WebCore::rendererForScrollbar):
(WebCore::RenderLayerScrollableArea::createScrollbar):
(WebCore::RenderLayerScrollableArea::destroyScrollbar):
(WebCore::RenderLayerScrollableArea::setHasHorizontalScrollbar):
(WebCore::RenderLayerScrollableArea::setHasVerticalScrollbar):
(WebCore::RenderLayerScrollableArea::enclosingScrollableArea const):
(WebCore::RenderLayerScrollableArea::isScrollableOrRubberbandable):
(WebCore::RenderLayerScrollableArea::hasScrollableOrRubberbandableAncestor):
(WebCore::RenderLayerScrollableArea::verticalScrollbarWidth const):
(WebCore::RenderLayerScrollableArea::horizontalScrollbarHeight const):
(WebCore::RenderLayerScrollableArea::hasOverflowControls const):
(WebCore::RenderLayerScrollableArea::positionOverflowControls):
(WebCore::RenderLayerScrollableArea::overflowTop const):
(WebCore::RenderLayerScrollableArea::overflowBottom const):
(WebCore::RenderLayerScrollableArea::overflowLeft const):
(WebCore::RenderLayerScrollableArea::overflowRight const):
(WebCore::RenderLayerScrollableArea::computeScrollDimensions):
(WebCore::RenderLayerScrollableArea::computeHasCompositedScrollableOverflow):
(WebCore::RenderLayerScrollableArea::hasScrollableHorizontalOverflow const):
(WebCore::RenderLayerScrollableArea::hasScrollableVerticalOverflow const):
(WebCore::RenderLayerScrollableArea::hasHorizontalOverflow const):
(WebCore::RenderLayerScrollableArea::hasVerticalOverflow const):
(WebCore::styleRequiresScrollbar):
(WebCore::styleDefinesAutomaticScrollbar):
(WebCore::RenderLayerScrollableArea::updateScrollbarsAfterLayout):
(WebCore::RenderLayerScrollableArea::updateScrollInfoAfterLayout):
(WebCore::RenderLayerScrollableArea::overflowControlsIntersectRect const):
(WebCore::RenderLayerScrollableArea::showsOverflowControls const):
(WebCore::RenderLayerScrollableArea::paintOverflowControls):
(WebCore::RenderLayerScrollableArea::paintScrollCorner):
(WebCore::RenderLayerScrollableArea::drawPlatformResizerImage):
(WebCore::RenderLayerScrollableArea::paintResizer):
(WebCore::RenderLayerScrollableArea::hitTestOverflowControls):
(WebCore::RenderLayerScrollableArea::scroll):
(WebCore::RenderLayerScrollableArea::isActive const):
(WebCore::RenderLayerScrollableArea::lastKnownMousePositionInView const):
(WebCore::RenderLayerScrollableArea::isHandlingWheelEvent const):
(WebCore::RenderLayerScrollableArea::useDarkAppearance const):
(WebCore::RenderLayerScrollableArea::updateSnapOffsets):
(WebCore::RenderLayerScrollableArea::isScrollSnapInProgress const):
(WebCore::RenderLayerScrollableArea::paintOverlayScrollbars):
(WebCore::RenderLayerScrollableArea::hitTestResizerInFragments const):
(WebCore::RenderLayerScrollableArea::layerForHorizontalScrollbar const):
(WebCore::RenderLayerScrollableArea::layerForVerticalScrollbar const):
(WebCore::RenderLayerScrollableArea::layerForScrollCorner const):
(WebCore::RenderLayerScrollableArea::scrollingMayRevealBackground const):
(WebCore::RenderLayerScrollableArea::updateScrollbarsAfterStyleChange):
(WebCore::RenderLayerScrollableArea::updateScrollableAreaSet):
(WebCore::RenderLayerScrollableArea::updateScrollCornerStyle):
(WebCore::RenderLayerScrollableArea::clearScrollCorner):
(WebCore::RenderLayerScrollableArea::updateResizerStyle):
(WebCore::RenderLayerScrollableArea::clearResizer):
(WebCore::RenderLayerScrollableArea::updateAllScrollbarRelatedStyle):
(WebCore::RenderLayerScrollableArea::usesCompositedScrolling const):
(WebCore::adjustedScrollDelta):
(WebCore::RenderLayerScrollableArea::panScrollFromPoint):
(WebCore::RenderLayerScrollableArea::updateScrollPosition):
(WebCore::RenderLayerScrollableArea::scrollByRecursively):
(WebCore::RenderLayerScrollableArea::updateLayerPositionsAfterDocumentScroll):
(WebCore::RenderLayerScrollableArea::updateLayerPositionsAfterOverflowScroll):
(WebCore::RenderLayerScrollableArea::usesMockScrollAnimator const):
(WebCore::RenderLayerScrollableArea::logMockScrollAnimatorMessage const):
(WebCore::RenderLayerScrollableArea::debugDescription const):
* rendering/RenderLayerScrollableArea.h:
* rendering/RenderListBox.cpp: Adapt to the fact that
RenderLayer is no longer a ScrollableArea.
(WebCore::RenderListBox::enclosingScrollableArea const):
* rendering/RenderObject.cpp: Add 'S' state in debug output,
indicating whether the RenderLayer has a RenderLayerScrollableArea.
(WebCore::outputRenderTreeLegend):
(WebCore::RenderObject::outputRenderObject const):
* rendering/RenderObject.h: Add friendship with
RenderLayerScrollableArea.
* testing/Internals.cpp: Adapt to the fact that
RenderLayer is no longer a ScrollableArea.
(WebCore::Internals::scrollBySimulatingWheelEvent):
(WebCore:: const):

Canonical link: https://commits.webkit.org/233095@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271559 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-17 00:26:19 +00:00
Zalan Bujtas aca3664b36 [LFC][IFC] Do not use LineBox::isConsideredEmpty when checking if inline box stretches the line box.
https://bugs.webkit.org/show_bug.cgi?id=220259

Reviewed by Antti Koivisto.

1. Inline box always have a strut in standards mode and it stretches the line box even when the inline box itself has no content.
<!DOCTYPE html><div>this is a ~100px tall line<span style="font-size: 100px;"></span></div>

2. except when the line is completely empty (the inline box still has a strut but it does not affect the line box).
<!DOCTYPE html><div><span style="font-size: 100px;"></span><span style="font-size: 200px;"></span></div>

3. but not empty like this:
<!DOCTYPE html><div><span style="font-size: 100px;"></span><br></div>

4. or this:
<!DOCTYPE html><div><span style="font-size: 100px;"></span><img src="foo" style="width: 0px; height: 0px;"></div>

While #2 produces a 0px tall line box, #1, #3 and #4 produce ~100px tall lines.
This change also enables us to remove LineBox:isConsideredEmpty().

* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::LineBoxBuilder::build):
(WebCore::Layout::LineBoxBuilder::computeLineBoxHeightAndAlignInlineLevelBoxesVertically):
* layout/inlineformatting/InlineFormattingContextQuirks.cpp:
(WebCore::Layout::InlineFormattingContext::Quirks::inlineLevelBoxAffectsLineBox const):
* layout/inlineformatting/InlineLineBox.cpp:
(WebCore::Layout::LineBox::LineBox):
(WebCore::Layout::m_isConsideredEmpty): Deleted.
* layout/inlineformatting/InlineLineBox.h:
(WebCore::Layout::LineBox::horizontalAlignmentOffset const):
(WebCore::Layout::LineBox::isConsideredEmpty const): Deleted.
* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::layoutInlineContent):
* layout/inlineformatting/InlineLineBuilder.h:


Canonical link: https://commits.webkit.org/233094@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-16 14:28:39 +00:00
Rob Buis 107420fec4 https://bugs.webkit.org/show_bug.cgi?id=220224
Support transferred min/max block size for aspect-ratio

Patch by Rob Buis <rbuis@igalia.com> on 2021-01-15
Reviewed by Darin Adler.

Source/WebCore:

Add logic to transfer min-height/max-height for minmax logical width
calculation in case aspect-ratio should be applied [1]. Both absolute
and normally positioned elements are handled.

[1] https://drafts.csswg.org/css-sizing-4/#aspect-ratio-size-transfers

* rendering/RenderBox.cpp:
(WebCore::RenderBox::constrainLogicalWidthInFragmentByMinMax const):
(WebCore::RenderBox::computePositionedLogicalWidth const):
(WebCore::RenderBox::computeMinMaxLogicalWidthFromAspectRatio const):
* rendering/RenderBox.h:

LayoutTests:

Enable some tests that pass now.

* TestExpectations:

Canonical link: https://commits.webkit.org/233093@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271554 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-16 07:57:56 +00:00
Lauro Moura 30dd5f78f6 [GLIB] Gardening a couple failures
Unreviewed test gardening.

* platform/glib/TestExpectations:

Canonical link: https://commits.webkit.org/233092@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271553 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-16 04:15:40 +00:00
Ling Ho 3d7cd7378c Bugzilla patch upload no longer displays the agreement for some users
https://bugs.webkit.org/show_bug.cgi?id=220678

Reviewed by Alexey Proskuryakov.

* template/en/default/attachment/patchlegalese.html.tmpl:


Canonical link: https://commits.webkit.org/233091@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271552 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-16 03:47:52 +00:00
Simon Fraser b08e2ca9ac Scroll position is lost when homing out and resuming Safari on iOS
https://bugs.webkit.org/show_bug.cgi?id=220676

Reviewed by Tim Horton.

When homing out on iOS, UIKit snapshotting causes multiple web view resizes, which runs
the dynamicViewportSizeUpdate() logic. This can trigger programmatic scrolls via
FrameView::setContentsSize(), which get stored in the scrolling state tree. When
that tree is committed on resume, we then erroneously apply the programmatic
scrolls.

Fix by ignoring requested scroll positions updates when snapshotting, as we do when
we're in the page cache.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):


Canonical link: https://commits.webkit.org/233090@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271551 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-16 03:44:38 +00:00
Alexey Proskuryakov a26249e4b6 Build fixes with newer clang
https://bugs.webkit.org/show_bug.cgi?id=220679

Reviewed by Mark Lam.

Source/JavaScriptCore:

Class needs type casting to be used as map key in Objective-C. After https://reviews.llvm.org/D67983,
Objective-C++ also requires this (see discussion there for why it's OK to just cast).

* API/JSWrapperMap.mm: (-[JSWrapperMap classInfoForClass:]):

Tools:

* DumpRenderTree/mac/LayoutTestHelper.m:
(lockDownDiscreteGraphics):
(addSleepAssertions):
Added "static" to functions without prototypes.


Canonical link: https://commits.webkit.org/233089@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271550 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-16 03:38:30 +00:00
Ryosuke Niwa 1181563224 Release assert in Document::updateStyleIfNeeded() via PrintContext::end() inside HTMLTitleElement::insertedIntoAncestor and removedFromAncestor
https://bugs.webkit.org/show_bug.cgi?id=218496

Reviewed by Darin Adler.

Remove the title element to eliminiate the non-determinism.

* http/tests/loading/redirect-with-no-location-crash-expected.txt:
* http/tests/loading/redirect-with-no-location-crash.html:
* platform/wk2/http/tests/loading/redirect-with-no-location-crash-expected.txt:


Canonical link: https://commits.webkit.org/233088@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271549 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-16 01:32:28 +00:00
Yusuke Suzuki 2479a3cd22 [JSC] Clean up DFGPreciseLocalClobberize to avoid duplicate code
https://bugs.webkit.org/show_bug.cgi?id=220670

Reviewed by Filip Pizlo.

This patch cleans up DFGPreciseLocalClobberize by extracting code to lambda to remove duplicate code.

* dfg/DFGPreciseLocalClobberize.h:
(JSC::DFG::PreciseLocalClobberizeAdaptor::readTop):

Canonical link: https://commits.webkit.org/233087@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271544 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-16 00:02:24 +00:00
Wenson Hsieh ccca19ad1c [iOS] Emoji keyboard covers text field on twitter.com/messages
https://bugs.webkit.org/show_bug.cgi?id=220664
<rdar://problem/68400471>

Reviewed by Devin Rousso.

Source/WebKit:

After iOS 14, the emoji software keyboard layout now includes a search field that can be used to filter for
specific emojis. This slightly increases the overall height of the software keyboard when the emoji keyplane is
active; in turn, this means that if the selection or caret is positioned right above the top of the software
keyboard when the normal (alphabetic) keyplane is active, switching to the emoji keyplane will cause the
keyboard to overlap the selection, making it difficult to see inserted text.

To address this, add a mechanism to detect when a change in the bounds of the software keyboard causes a visible
selection or caret rect to become overlapped, and react by scrolling to keep the selection visible. This has the
effect of fixing this bug by scrolling to reveal the text field after switching to the emoji keyboard, but it
also has the effect of scrolling to keep the selection visible after detaching a connected hardware keyboard,
in the case where it would've otherwise been overlapped by the (much taller) software keyboard that appears.

Test: editing/selection/ios/scroll-to-reveal-selection-when-showing-software-keyboard.html

* UIProcess/API/ios/WKWebViewIOS.h:
* UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _selectionRectIsFullyVisibleAndNonEmpty]):

Add an internal helper to check whether the selection bounds are fully visible.

(-[WKWebView _scrollToRevealSelectionIfNeeded]):
(-[WKWebView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
(-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):

In the case where changing input view bounds causes a previously visible selection to become overlapped, call
`-_scrollToRevealSelectionIfNeeded` to make the selection visible again.

(-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
(-[WKContentView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Deleted.

Drive-by fix: remove the unused `insideFixed:` parameter from this adjacent method.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView rectToRevealWhenZoomingToFocusedElement]):
(-[WKContentView _zoomToRevealFocusedElement]):
(rectToRevealWhenZoomingToFocusedElement): Deleted.

Pull this into the `-rectToRevealWhenZoomingToFocusedElement` internal helper method instead, and use the new
`selectionBoundingRectInRootViewCoordinates` method below.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::selectionBoundingRectInRootViewCoordinates const):

Pull out code to compute the selection bounding rect (for both ranged and caret selections) into a method on
`WebPageProxy`, so that it can be used in `WKContentView` and `WKWebView`.

LayoutTests:

Add a test to verify that after disconnecting a hardware keyboard and showing the software keyboard, we scroll
up to reveal the caret in a focused text field.

* editing/selection/ios/scroll-to-reveal-selection-when-showing-software-keyboard-expected.txt: Added.
* editing/selection/ios/scroll-to-reveal-selection-when-showing-software-keyboard.html: Added.


Canonical link: https://commits.webkit.org/233086@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271543 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 23:57:17 +00:00
Peng Liu debae5a6c0 (REGRESSION) Playback pauses upon entering PiP via media controls on trailers.apple.com
https://bugs.webkit.org/show_bug.cgi?id=220669

Reviewed by Jer Noble.

Add a quirk to disable the "webkitendfullscreen" event when a video enters picture-in-picture
from fullscreen for the sites which cannot handle the event properly.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::enterFullscreen):
* page/Quirks.cpp:
(WebCore::Quirks::shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk const):
* page/Quirks.h:


Canonical link: https://commits.webkit.org/233085@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271542 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 23:47:13 +00:00
Jonathan Bedard 61d32422ed [webkitscmpy] Cache credentials from keychain
https://bugs.webkit.org/show_bug.cgi?id=220671
<rdar://problem/73262349>

Reviewed by Dewei Zhu.

* Scripts/libraries/webkitscmpy/setup.py: Bump version.
* Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
* Scripts/libraries/webkitscmpy/webkitscmpy/remote/git_hub.py:
(GitHub.credentials): Cache credentials from keychain even when not specified by the user.


Canonical link: https://commits.webkit.org/233084@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271540 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 23:32:35 +00:00
Alex Christensen 50f539ec6c REGRESSION(r267763) Uploading zipped directories does not work on iOS
https://bugs.webkit.org/show_bug.cgi?id=220666
<rdar://problem/72940505>

Patch by Alex Christensen <achristensen@webkit.org> on 2021-01-15
Reviewed by Geoffrey Garen.

r267763 removed indexedDatabaseTempBlobDirectoryExtensionHandle with no replacement, which used to give the network process
read/write access to /tmp inside the parent process's container.  This seems to have been unused for IndexedDB, but it was used
by createTemporaryZipArchive when uploading directories, such as Pages, Numbers, and Keynote documents.

Unfortunately the unit test added by r248139 is macOS-only because WKOpenPanelParameters is only available on macOS and it would
require a large and risky amount of refactoring to add SPI on iOS to test this because iOS uses WKFileUploadPanel instead.
I did manually verify that the bug is fixed using my phone, though.

* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::sendCreationParametersToNewProcess):

Canonical link: https://commits.webkit.org/233083@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271537 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 22:58:01 +00:00
Chris Fleizach 759f3e0ebd AX: increment/decrement synthetic arrow events don't work in ARIA slider examples
https://bugs.webkit.org/show_bug.cgi?id=220626
<rdar://problem/73228924>

Reviewed by Zalan Bujtas.

Source/WebCore:

keyCode is still expected to be filled in with standard codes for arrow keys.

Updated test: accessibility/keyevents-posted-for-increment-actions.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::postKeyboardKeysForValueChange):

LayoutTests:

* accessibility/keyevents-posted-for-increment-actions-expected.txt:
* accessibility/keyevents-posted-for-increment-actions.html:


Canonical link: https://commits.webkit.org/233082@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271536 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 22:54:07 +00:00
Chris Dumez de3abed76c [GPUProcess] Move DOM / Canvas rendering off the main thread in the GPUProcess
https://bugs.webkit.org/show_bug.cgi?id=220476

Reviewed by Simon Fraser.

Source/WebCore:

Make some caches thread-safe now that we do rendering off the main thread in
the GPUProcess.

No new tests, covered by existing tests.

* platform/graphics/ImageBuffer.h:
* platform/graphics/MediaPlayer.h:
* platform/graphics/ShadowBlur.cpp:
(WebCore::ScratchBuffer::ScratchBuffer):
(WebCore::ScratchBuffer::getScratchBuffer):
(WebCore::ScratchBuffer::setCachedShadowValues):
(WebCore::ScratchBuffer::setCachedInsetShadowValues):
(WebCore::ScratchBuffer::scheduleScratchBufferPurge):
(WebCore::ScratchBuffer::purgeTimerFired):
(WebCore::ScratchBuffer::clearScratchBuffer):
(WebCore::ScratchBuffer::singleton):
(WebCore::ScratchBuffer::lock):
(WebCore::ShadowBlur::drawRectShadowWithTiling):
(WebCore::ShadowBlur::drawInsetShadowWithTiling):
* platform/graphics/cg/ImageBufferUtilitiesCG.cpp:
(WebCore::utiFromImageBufferMIMEType):
* platform/graphics/cg/SubimageCacheWithTimer.cpp:
(WebCore::SubimageCacheWithTimer::SubimageCacheWithTimer):
(WebCore::SubimageCacheWithTimer::pruneCacheTimerFired):
(WebCore::SubimageCacheWithTimer::subimage):
(WebCore::SubimageCacheWithTimer::clearImageAndSubimages):
(WebCore::SubimageCacheWithTimer::clearAll):
(WebCore::SubimageCacheWithTimer::subimageCache):
* platform/graphics/cg/SubimageCacheWithTimer.h:
* platform/network/mac/UTIUtilities.mm:
(WebCore::UTIFromUnknownMIMEType):
(WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):
(WebCore::UTIFromMIMETypeCachePolicy::createKeyForStorage):
(WebCore::cacheUTIFromMimeType):
(WebCore::UTIFromMIMEType):
* platform/text/cf/HyphenationCF.cpp:
* platform/text/hyphen/HyphenationLibHyphen.cpp:
https://bugs.webkit.org/show_bug.cgi?id=220476

Source/WebKit:

Move DOM / Canvas rendering off the main thread (and on a high-priority serial WorkQueue) in the
GPUProcess by making RemoteRenderingBackend a WorkQueueMessageReceiver. There is a serial WorkQueue
per RemoteRenderingBackend, which means each WebPage gets its own WorkQueue.

A/B testing shows this mostly perf-neutral (could be a slight progression on some hardware). I believe
this new architecture should also give us more optimization opportunities in the future. For example,
we may be able to more aggressively wait on the cross-process semaphore when waiting for new DisplayList
entries without worrying about blocking the main thread.

I have run layout tests in Debug on both macOS & iOS with the GPUProcess enabled and I believe I
have fixed all the crashes that were discovered.

* GPUProcess/GPUConnectionToWebProcess.cpp:
(WebKit::GPUConnectionToWebProcess::GPUConnectionToWebProcess):
(WebKit::GPUConnectionToWebProcess::didClose):
(WebKit::GPUConnectionToWebProcess::createRenderingBackend):
(WebKit::GPUConnectionToWebProcess::RemoteRenderingBackendWrapper::RemoteRenderingBackendWrapper):
(WebKit::GPUConnectionToWebProcess::RemoteRenderingBackendWrapper::~RemoteRenderingBackendWrapper):
* GPUProcess/GPUConnectionToWebProcess.h:
(WebKit::GPUConnectionToWebProcess::remoteMediaPlayerManagerProxy):
* GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::create):
(WebKit::RemoteRenderingBackend::RemoteRenderingBackend):
(WebKit::RemoteRenderingBackend::~RemoteRenderingBackend):
(WebKit::RemoteRenderingBackend::disconnect):
(WebKit::RemoteRenderingBackend::messageSenderConnection const):
(WebKit::RemoteRenderingBackend::applyMediaItem):
(WebKit::RemoteRenderingBackend::createImageBuffer):
(WebKit::RemoteRenderingBackend::wakeUpAndApplyDisplayList):
(WebKit::RemoteRenderingBackend::getImageData):
(WebKit::RemoteRenderingBackend::getDataURLForImageBuffer):
(WebKit::RemoteRenderingBackend::getDataForImageBuffer):
(WebKit::RemoteRenderingBackend::getBGRADataForImageBuffer):
(WebKit::RemoteRenderingBackend::cacheNativeImage):
(WebKit::RemoteRenderingBackend::cacheFont):
(WebKit::RemoteRenderingBackend::deleteAllFonts):
(WebKit::RemoteRenderingBackend::releaseRemoteResource):
(WebKit::RemoteRenderingBackend::didCreateSharedDisplayListHandle):
* GPUProcess/graphics/RemoteRenderingBackend.h:
* GPUProcess/graphics/RemoteRenderingBackend.messages.in:
* GPUProcess/media/RemoteLegacyCDMProxy.cpp:
(WebKit::RemoteLegacyCDMProxy::cdmMediaPlayer const):
* GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
(WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer):
(WebKit::RemoteMediaPlayerManagerProxy::deleteMediaPlayer):
(WebKit::RemoteMediaPlayerManagerProxy::didReceivePlayerMessage):
(WebKit::RemoteMediaPlayerManagerProxy::didReceiveSyncPlayerMessage):
(WebKit::RemoteMediaPlayerManagerProxy::mediaPlayer):
* GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
* Platform/SharedMemory.h:
* Shared/ShareableBitmap.cpp:
(WebKit::ShareableBitmap::ShareableBitmap):
(WebKit::ShareableBitmap::~ShareableBitmap):
* Shared/ShareableBitmap.h:
* Shared/cg/ShareableBitmapCG.cpp:
(WebKit::ShareableBitmap::createGraphicsContext):
(WebKit::ShareableBitmap::releaseBitmapContextData):
(WebKit::ShareableBitmap::releaseDataProviderData):

Source/WTF:

Add trait function that gets called TinyLRUCache to convert the key before storing
it. It is useful for clients that need to call isolatedCopy() on the key String before
storing it.

* wtf/TinyLRUCache.h:
(WTF::TinyLRUCachePolicy::createKeyForStorage):
(WTF::TinyLRUCache::get):


Canonical link: https://commits.webkit.org/233081@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271533 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 21:51:52 +00:00
Jonathan Bedard b23b8f9358 [webkitscmpy] Make UI parsing for parent commits more flexible
https://bugs.webkit.org/show_bug.cgi?id=220661
<rdar://problem/73256932>

Reviewed by Dewei Zhu.

* Scripts/libraries/webkitscmpy/setup.py: Bump version.
* Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
* Scripts/libraries/webkitscmpy/webkitscmpy/remote/git_hub.py:
(GitHub.__init__): Handle commit links in the UI using both 'commits/' URLs and 'tree-commit/'.


Canonical link: https://commits.webkit.org/233080@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271532 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 20:57:16 +00:00
Jer Noble 31de79be7d Playback fails at marketwatch.com
https://bugs.webkit.org/show_bug.cgi?id=220646
<rdar://72950166>

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

Test: media/media-play-promise-reject-play-notallowed-audio.html

When audio playback is blocked by settings, the HTMLMediaElement must load its source
media's metadata in order to determine whether the media should be allowed to play without a
user gesture. If a play promise is pending, the expectation is that those promises will
reject with a NotAllowedError to indicate that a user gesture is needed. However, by calling
pauseInternal() to block (possibly) existing playback, this causes those promises to be
rejected with an AbortError, as if the pause() method had been called. Call
scheduleRejectPendingPlayPromises() with NotAllowedError to ensure the correct error is used
to reject.

Drive-by fix: no reason to dispatch and call rejectPendingPlayPromises() or
resolvePendingPlayPromises() if there are no promises to reject or resolve, and not calling
these methods makes the logs less noisy.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::scheduleResolvePendingPlayPromises):
(WebCore::HTMLMediaElement::scheduleRejectPendingPlayPromises):
(WebCore::HTMLMediaElement::setVolume):
(WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack):
(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
(WebCore::HTMLMediaElement::updateShouldPlay):

LayoutTests:

* media/media-play-promise-reject-play-notallowed-audio-expected.txt: Added.
* media/media-play-promise-reject-play-notallowed-audio.html: Added.

Canonical link: https://commits.webkit.org/233079@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271531 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 20:53:32 +00:00
Jer Noble f58fec6918 CRASH in MediaSourcePrivateAVFObjC::removeSourceBuffer()
https://bugs.webkit.org/show_bug.cgi?id=220647
<rdar://73173684>

Reviewed by Darin Adler.

In exceptional circumstances, the MediaPlayerPrivateMediaSourceAVFObjC can be destroyed before
MediaSourcePrivateAVFObjC, which leaves behind a null WeakPtr. Null check m_player before
using everywhere in MediaSourcePrivateAVFObjC.

Drive-by fix: it would be invalid to pass in a null player to MediaSourcePrivateAVFObjC::create(),
so modify that method to take a reference rather than a pointer.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load):
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::create):
(WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC):
(WebCore::MediaSourcePrivateAVFObjC::removeSourceBuffer):
(WebCore::MediaSourcePrivateAVFObjC::durationChanged):
(WebCore::MediaSourcePrivateAVFObjC::markEndOfStream):
(WebCore::MediaSourcePrivateAVFObjC::readyState const):
(WebCore::MediaSourcePrivateAVFObjC::setReadyState):
(WebCore::MediaSourcePrivateAVFObjC::waitForSeekCompleted):
(WebCore::MediaSourcePrivateAVFObjC::seekCompleted):
(WebCore::MediaSourcePrivateAVFObjC::currentMediaTime const):
(WebCore::MediaSourcePrivateAVFObjC::sourceBufferPrivateDidChangeActiveState):
(WebCore::MediaSourcePrivateAVFObjC::sourceBufferKeyNeeded):
(WebCore::MediaSourcePrivateAVFObjC::setSourceBufferWithSelectedVideo):


Canonical link: https://commits.webkit.org/233078@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271530 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 20:43:12 +00:00
Alex Christensen a91ec2e76b Remove non-inclusively named WKBrowsingContextGroup SPI
https://bugs.webkit.org/show_bug.cgi?id=220604

Patch by Alex Christensen <achristensen@webkit.org> on 2021-01-15
Reviewed by Anders Carlsson.

Once rdar://problem/73167624 has been integrated, we can remove the old SPI, which has been replaced in r263099

* UIProcess/API/Cocoa/WKBrowsingContextGroup.h:
* UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
(-[WKBrowsingContextGroup addUserStyleSheet:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:mainFrameOnly:]): Deleted.
(-[WKBrowsingContextGroup addUserScript:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:injectionTime:mainFrameOnly:]): Deleted.

Canonical link: https://commits.webkit.org/233077@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271529 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 20:33:47 +00:00
Patrick Angle b0638031cc Web Inspector: Font Details sidebar - Improve line wrapping of table row titles when space is available
https://bugs.webkit.org/show_bug.cgi?id=219997

Reviewed by Devin Rousso.

Adjust the width of the title in each row to 105px, which provides space for both `Historical Figures` which is
an always-present row and `Optical Size (opsz)` which is a registed variation axis and is used in numerous
fonts including San Francisco. This overrides the normal fixed width of these titles of 85px, which causes these
and numerous other unregistered axis names and tags to wrap their title more aggresively than is stricly
necessary.

* UserInterface/Views/FontDetailsPanel.css:
(.sidebar > .panel.details.style-font > .content .details-section > .content > .group > .row.simple > .label):


Canonical link: https://commits.webkit.org/233076@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271528 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 20:22:41 +00:00
Chris Dumez 004d2fb039 [GPUProcess] Improve the GPUProcess' memory pressure handler
https://bugs.webkit.org/show_bug.cgi?id=220659

Reviewed by Simon Fraser.

Improve the GPUProcess' memory pressure handler to clear things like the IOSurfacePool
and the SubimageCacheWithTimer.

Source/WebCore:

* page/MemoryRelease.cpp:
(WebCore::releaseGraphicsMemory):
(WebCore::platformReleaseGraphicsMemory):
* page/MemoryRelease.h:
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::platformReleaseGraphicsMemory):

Source/WebKit:

* GPUProcess/GPUProcess.cpp:
(WebKit::GPUProcess::lowMemoryHandler):
(WebKit::GPUProcess::initializeGPUProcess):
(WebKit::GPUProcess::prepareToSuspend):
* GPUProcess/GPUProcess.h:


Canonical link: https://commits.webkit.org/233075@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271526 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 18:29:08 +00:00
Antoine Quint 41cbcc00b7 Reversed transform animation not applied alongside other transform animations
https://bugs.webkit.org/show_bug.cgi?id=218655
<rdar://problem/71116284>

Reviewed by Simon Fraser.

Source/WebCore:

Tests: webanimations/combining-transform-animations-with-different-acceleration-capabilities-2.html
       webanimations/combining-transform-animations-with-different-acceleration-capabilities-3.html
       webanimations/combining-transform-animations-with-different-acceleration-capabilities.html

While, in theory, animations for a transform-related CSS property (translate, rotate, scale and transform)
can be accelerated, there are various reasons why it might not, in fact, run accelerated.

One example is that the timing function is not something we can translate in terms Core Animation can
understand, such as the steps() timing function. In this case, the KeyframeEffect itself is aware of
the limitation and the method KeyframeEffect::canBeAccelerated() returns false.

Another example is that the playback rate of the animation is not 1, which we currently don't support for
Core Animation animations (see bug 211839). In this case, GraphicsLayerCA is where the impossibility to
run an animation accelerated is determined.

While we support running transform-related animations with or without acceleration, one thing we cannot
support is, for the same element, running some transform-related animations with acceleration, and some
without.

Thus, regardless of where we determine that a transform-related animation cannot be accelerated, we need
to send this information up to the KeyframeEffectStack in which this animation's effect belongs to make
sure that any other transform-related animation that may already be running accelerated no longer does
and continues running without acceleration.

There are two locations where we determine that a transform-related animation cannot be accelerated:

    1. in DocumentTimeline::applyPendingAcceleratedAnimations() under which we start, update or stop
       accelerated animations that have been invalidated since the last page rendering,
    2. in KeyframeEffect::updateAcceleratedActions() which is called for each page rendering, including
       animations that cannot be accelerated.

In the first case, we catch situations where an animation that could have been accelerated but failed
to be started due to the internal logic of GraphicsLayerCA. We use the new KeyframeEffect method
applyPendingAcceleratedActions() return value to determine this, and for each effect where the result
indicates that a transform-related animation could not be accelerated, we add the KeyframeEffectStack
to which it belongs and, once we're done with updating all effects, call the new
stopAcceleratingTransformRelatedProperties() method on the keyframe effect stack.

In the second case, we catch situations where an animation is known to not be able to run accelerated
even without involving GraphicsLayerCA. We check whether the animation targets a transform-related
property and if it is active, and if so call stopAcceleratingTransformRelatedProperties()
on the keyframe effect stack there as well.

When KeyframeEffectStack::stopAcceleratingTransformRelatedProperties() is called, we go
through all the registered effects and call stopAcceleratingTransformRelatedProperties(). This new
KeyframeEffect method will either add a pending accelerated action to stop the accelerated animation,
or if we're currently apply accelerated actions (ie. during DocumentTimeline::applyPendingAcceleratedAnimations()),
we stop the accelerated animation right away.

In both cases we know not to try running this animation again with acceleration by setting m_runningAccelerated
to RunningAccelerated::No.

* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::applyPendingAcceleratedAnimations):
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::isTargetingTransformRelatedProperty const):
(WebCore::KeyframeEffect::isRunningAcceleratedTransformRelatedAnimation const):
(WebCore::KeyframeEffect::updateAcceleratedActions):
(WebCore::KeyframeEffect::applyPendingAcceleratedActions):
(WebCore::KeyframeEffect::stopAcceleratingTransformRelatedProperties):
* animation/KeyframeEffect.h:
* animation/KeyframeEffectStack.cpp:
(WebCore::KeyframeEffectStack::stopAcceleratingTransformRelatedProperties):
* animation/KeyframeEffectStack.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::applyPendingAcceleratedActions): Deleted.
* animation/WebAnimation.h:
* animation/WebAnimationTypes.h:

LayoutTests:

Add new tests that start a transform-related animation that runs accelerated, then add another
transform-related animation that either initially or eventually is not accelerated. In all cases,
we check that once the second animation is no longer accelerated that the first animation is also
no longer accelerated.

* platform/win/TestExpectations:
* webanimations/combining-transform-animations-with-different-acceleration-capabilities-2-expected.txt: Added.
* webanimations/combining-transform-animations-with-different-acceleration-capabilities-2.html: Added.
* webanimations/combining-transform-animations-with-different-acceleration-capabilities-3-expected.txt: Added.
* webanimations/combining-transform-animations-with-different-acceleration-capabilities-3.html: Added.
* webanimations/combining-transform-animations-with-different-acceleration-capabilities-expected.txt: Added.
* webanimations/combining-transform-animations-with-different-acceleration-capabilities.html: Added.


Canonical link: https://commits.webkit.org/233074@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271524 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 17:47:18 +00:00
Tomoki Imai 8a077349c7 When non-integer tabindex is set, the behavior of element should be same as the tabindex is omitted.
https://bugs.webkit.org/show_bug.cgi?id=220648

Reviewed by Antti Koivisto.

Source/WebCore:

When non-integer tabindex is specified, the element should behave the same way as the tabindex is omitted.
https://html.spec.whatwg.org/multipage/interaction.html#attr-tabindex

WebKit didn't overwrite the internal tabindex value when the new value is non-integer.

Test: LayoutTests\fast\html\tabindex-overwrite-with-non-integer.html

* html/HTMLElement.cpp:
(WebCore::HTMLElement::parseAttribute): If the new value cannot be parsed as the integer, clear the existing tabindex.

LayoutTests:

Add LayoutTest case for tabindex which is overwritten by non-integers.
When non-integer tabindex is specified, the element should behave the same way as the tabindex is omitted.
https://html.spec.whatwg.org/multipage/interaction.html#attr-tabindex

* fast/html/tabindex-overwrite-with-non-integer-expected.txt: Added.
* fast/html/tabindex-overwrite-with-non-integer.html: Added.


Canonical link: https://commits.webkit.org/233073@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271523 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 16:53:46 +00:00
Philippe Normand 5dee56befe [Flatpak SDK] Cargo recipes improvements
https://bugs.webkit.org/show_bug.cgi?id=220656

Patch by Philippe Normand <pnormand@igalia.com> on 2021-01-15
Reviewed by Adrian Perez de Castro.

* elements/freedesktop-sdk.bst: Update junction.
* elements/sdk/cargo-c.bst: Properly separate build command from install command.
* elements/sdk/gst-plugin-closedcaption.bst: Ditto.
* elements/sdk/gst-plugin-dav1d.bst: Ditto.

Canonical link: https://commits.webkit.org/233072@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271522 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 15:24:47 +00:00
Rob Buis 1ee9f0ffbe Mark only child for layout
https://bugs.webkit.org/show_bug.cgi?id=218554

Patch by Rob Buis <rbuis@igalia.com> on 2021-01-15
Reviewed by Antti Koivisto.

Mark only child for layout in applyStretchAlignmentToChildIfNeeded.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):

Canonical link: https://commits.webkit.org/233071@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271521 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 14:57:59 +00:00
Zalan Bujtas e652c669d1 [LFC] Rename inNoQuirksMode to inStandardsMode
https://bugs.webkit.org/show_bug.cgi?id=220655

Reviewed by Antti Koivisto.

"inStandardsMode" reads better.

* layout/LayoutState.h:
(WebCore::Layout::LayoutState::inStandardsMode const):
(WebCore::Layout::LayoutState::inNoQuirksMode const): Deleted.
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::LineBoxBuilder::LineBoxBuilder):
* layout/inlineformatting/InlineFormattingContextQuirks.cpp:
(WebCore::Layout::InlineFormattingContext::Quirks::initialLineHeight const):
(WebCore::Layout::InlineFormattingContext::Quirks::inlineLevelBoxAffectsLineBox const):


Canonical link: https://commits.webkit.org/233070@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271520 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 14:39:33 +00:00
Philippe Normand 2263d8633a [Flatpak SDK] Update GStreamer and Mesa
https://bugs.webkit.org/show_bug.cgi?id=220237

Reviewed by Adrian Perez de Castro.

This patch updates several SDK components:

- GStreamer 1.18.0 -> 1.18.2
- Mesa 20.1.10 -> 20.3.2

Additionally some libdrm-related cleanups are included, since we have our own version of
this component, it is better to use it everywhere instead of the upstream SDK version, to
avoid collisions.

This patch also updates the pipenv dependencies used by Buildstream.

* Pipfile.lock:
* elements/freedesktop-sdk.bst:
* elements/qt5/qtbase.bst:
* elements/qt5/qtwayland.bst:
* elements/sdk/gst-libav.bst:
* elements/sdk/gst-plugins-bad.bst:
* elements/sdk/gst-plugins-base.bst:
* elements/sdk/gst-plugins-good.bst:
* elements/sdk/gst-plugins-ugly.bst:
* elements/sdk/gstreamer.bst:
* elements/sdk/mesa.bst:
* elements/sdk/xorg-server.bst:
* patches/mesa/0004-mesa-clear-texture-s-views-when-texture-is-remove.patch: Removed.
* patches/mesa/mesa_libdrm_deps.patch:

Canonical link: https://commits.webkit.org/233069@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271519 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 14:10:33 +00:00
Philippe Normand c6348f371f [Flatpak SDK] Updates for gst-build and gst-plugins-rs support
https://bugs.webkit.org/show_bug.cgi?id=220418

Reviewed by Adrian Perez de Castro.

This patch:

- bumps from Meson 0.55.3 to Meson 0.56.1 in the FDO junction
- includes cargo-c in the SDK, this is a new dependency for gst-build (only if
  gst-plugins-rs is enabled though)
- includes the latest release of the rsclosedcaption GStreamer plugin in the SDK. This
  plugin includes several elements (ccconverter, cea608tott) that will be useful in order to
  support CEA608 rendering in WebKit GStreamer ports.

* elements/freedesktop-sdk.bst:
* elements/sdk-platform.bst:
* elements/sdk/cargo-c.bst: Added.
* elements/sdk/gst-plugin-closedcaption.bst: Added.
* files/gst-plugin-closedcaption/Cargo.lock: Added.
* patches/fdo-0001-meson-Bump-to-0.56.1.patch: Added.

Canonical link: https://commits.webkit.org/233068@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271518 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 14:03:20 +00:00
Philippe Normand a99025c75a [GStreamer] Clean-up the TextSink
https://bugs.webkit.org/show_bug.cgi?id=220651

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

The GStreamer sink used to collect WebVTT cues is now more self-contained and uses the
player only to hand-off samples to the corresponding TextTrack implementation for further
processing. This is only a refactoring, existing tests in media/track cover this change.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleTextSample):
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/TextSinkGStreamer.cpp:
(webkitTextSinkHandleSample):
(webkitTextSinkConstructed):
(webkitTextSinkQuery):
(webkit_text_sink_class_init):
(webkitTextSinkNew):
* platform/graphics/gstreamer/TextSinkGStreamer.h:

Tools:

* Scripts/webkitpy/style/checker.py: Add GStreamer TextSink implementation to GObject
classes allow-list.

Canonical link: https://commits.webkit.org/233067@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 13:59:34 +00:00
Zalan Bujtas 84133b2fbf [LFC][Integration] REGRESSION (r270123) facebook.com birthday dropdown do not work when creating new account
https://bugs.webkit.org/show_bug.cgi?id=220638
<rdar://problem/73175259>

Reviewed by Simon Fraser.

Source/WebCore:

This patch fixes incorrect hittest results when the hittest target
1. participates in the modern line layout and
2. prior to the hittesting its style changes in a way that it does not trigger layout.
e.g.
<div><div id=inner style="display: inline-block; visibility: hidden"><div></div>
<script>inner.style.visibility = "visible"</script>

Any subsequent hittest will miss the inner <div> as the loop in LineLayout::hitTest() early returns due to stale style information.
The reason why we end up with stale style is because we only update the layout box's style when the style diff >= StyleDifference::Layout () in RenderBox::styleDidChange.

Test: fast/inline-block/hittest-fails-on-inline-block-with-visibility-change.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleDidChange):

LayoutTests:

* fast/inline-block/hittest-fails-on-inline-block-with-visibility-change-expected.txt: Added.
* fast/inline-block/hittest-fails-on-inline-block-with-visibility-change.html: Added.


Canonical link: https://commits.webkit.org/233066@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271516 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 12:39:41 +00:00
Antoine Quint 15a4537bfa REGRESSION(r269813): PLT5 regressed by 0.5%
https://bugs.webkit.org/show_bug.cgi?id=220652
<rdar://problem/71517335>

Reviewed by Antti Koivisto.

In r269813 we added support for animating more pseudo-elements besides ::after and ::before. However, the only other
pseudo-element we realistically should be supporting animations for at this juncture is ::marker. So instead of
calling Style::TreeResolver::resolvePseudoStyle() for all public pseudo-elements, we call it for ::after, ::before
and ::marker alone.

* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):


Canonical link: https://commits.webkit.org/233065@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271515 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 11:23:31 +00:00
Rob Buis 3a7d793eb3 Use event loop to set title
https://bugs.webkit.org/show_bug.cgi?id=218496

Patch by Rob Buis <rbuis@igalia.com> on 2021-01-15
Reviewed by Ryosuke Niwa.

Source/WebCore:

Use event loop to set title to avoid calling WebFrameLoaderClient
within HTMLTitleElement::insertedIntoAncestor.

* dom/Document.cpp:
(WebCore::Document::updateTitle):
* dom/Document.h:

Tools:

Adapt unit tests to wait for title change tasks
to be processed.

* TestWebKitAPI/Tests/WebKit/PageLoadState.cpp:
(TestWebKitAPI::didChangeTitle):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
(TEST):

LayoutTests:

Adapt tests to make sure pending title change tasks
are processed before the test is done.

* fast/dom/title-text-property-2.html:
* fast/dom/title-text-property-assigning-empty-string.html:
* fast/dom/title-text-property.html:
* http/tests/globalhistory/history-delegate-basic-title-expected.txt:
* http/tests/globalhistory/history-delegate-basic-title.html:
* http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt:
* http/tests/loading/basic-auth-load-URL-with-consecutive-slashes.html:
* http/tests/loading/redirect-with-no-location-crash-expected.txt:
* http/tests/loading/redirect-with-no-location-crash.html:
* platform/mac-wk2/TestExpectations:
* platform/win/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt: Copied from LayoutTests/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt.
* platform/wk2/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt:
* platform/wk2/http/tests/loading/redirect-with-no-location-crash-expected.txt:

Canonical link: https://commits.webkit.org/233064@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271514 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 10:51:27 +00:00
Philippe Normand 8c70467073 [GStreamer] UI<->WebPocess IPC needed for enumerateDevices support
https://bugs.webkit.org/show_bug.cgi?id=220542

Reviewed by Eric Carlson.

Source/WebCore:

* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::ensureGStreamerInitialized): Re-instate release assert ensuring this code path is
not hit from the UIProcess.

Source/WebKit:

For GLib ports the UIProcess will now send a message to the WebProcess to retrieve the
MediaStream devices. This is required because we want to avoid initializing GStreamer in the
UIProcess as much as possible.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::platformGetMediaStreamDevices):
(WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
* UIProcess/glib/UserMediaPermissionRequestManagerProxyGLib.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::platformGetMediaStreamDevices):
* WebProcess/glib/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::validateUserMediaRequestConstraints):
(WebKit::UserMediaCaptureManager::getMediaStreamDevices):
* WebProcess/glib/UserMediaCaptureManager.h:
* WebProcess/glib/UserMediaCaptureManager.messages.in:

Canonical link: https://commits.webkit.org/233063@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271513 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 09:45:56 +00:00
Philippe Normand b55f59ae81 [GStreamer] Clean-up the TextCombiner
https://bugs.webkit.org/show_bug.cgi?id=220463

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

The code style now conforms WebKit's. The GhostPad subclass moved to its own code unit,
because the WEBKIT_DEFINE_TYPE cannot be used multiple times in the same file (it defines a
parent_class symbol). The GhostPad was also decoupled as much as possible from the Combiner.
Most mentions of the funnel GStreamer element were made more generic because we might need
to use a different element in situations where the pipeline is playbin3-based, which requires
the concat element.

No new tests, existing tests cover this patch.

* platform/GStreamer.cmake:
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::gstElementFactoryEquals):
* platform/graphics/gstreamer/GStreamerCommon.h:
* platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
(webKitTextCombinerHandleCapsEvent):
(webkitTextCombinerRequestNewPad):
(webkitTextCombinerReleasePad):
(webKitTextCombinerConstructed):
(webkit_text_combiner_class_init):
(webkitTextCombinerNew):
* platform/graphics/gstreamer/TextCombinerGStreamer.h:
* platform/graphics/gstreamer/TextCombinerPadGStreamer.cpp: Added.
(webkitTextCombinerPadEvent):
(webkitTextCombinerPadGetProperty):
(webkitTextCombinerPadSetProperty):
(webkitTextCombinerPadConstructed):
(webkit_text_combiner_pad_class_init):
(webKitTextCombinerPadLeakInternalPadRef):
* platform/graphics/gstreamer/TextCombinerPadGStreamer.h: Copied from Source/WebCore/platform/graphics/gstreamer/TextCombinerGStreamer.h.

Tools:

* Scripts/webkitpy/style/checker.py: Add GStreamer TextCombiner implementation to GObject
classes allow-list.

Canonical link: https://commits.webkit.org/233062@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271512 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 09:27:06 +00:00
Ross Kirsling 89fb7ed0e6 Unreviewed. Add skips for Big Sur-dependent test262 tests.
* test262/config.yaml:

Canonical link: https://commits.webkit.org/233061@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271511 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 07:24:48 +00:00
Julian Gonzalez 66bee05590 Crash from CompositeEditCommand::moveParagraphs() being passed null end
https://bugs.webkit.org/show_bug.cgi?id=220630

Patch by Julian Gonzalez <julian_a_gonzalez@apple.com> on 2021-01-14
Reviewed by Ryosuke Niwa.

Source/WebCore:

If the start or end VisiblePositions inside InsertListCommand::unlistifyParagraph()
are null VisiblePositions (even if they are not null Positions), passing them to the
call to moveParagraphs() at the end of the function isn't meaningful and will result
in a crash - so return early in this case.

Test: editing/inserting/paragraph-outdent-crash.html

* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::unlistifyParagraph):

LayoutTests:

Add a test to verify that the crash here is resolved, and also remove a newline
from another related test that now renders one fewer newline
(in that case, the ultimate bug is similar, so the result should be similar).

* editing/inserting/insert-list-in-iframe-in-list-expected.txt:
* editing/inserting/paragraph-outdent-crash-expected.txt: Added.
* editing/inserting/paragraph-outdent-crash.html: Added.

Canonical link: https://commits.webkit.org/233060@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271510 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 07:14:48 +00:00
Ross Kirsling 9a4d04a39a [JSC] Correctly handle escaped keyword identifiers
https://bugs.webkit.org/show_bug.cgi?id=220634

Reviewed by Yusuke Suzuki.

JSTests:

* stress/escaped-keyword-identifiers.js: Added.
* test262/expectations.yaml: Mark 16 test cases as passing.

Source/JavaScriptCore:

When `let`, `await`, and `yield` are accepted as identifiers, they should be accepted even in escaped form.
This patch ensures this behavior for variable, parameter, and label names.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::isArrowFunctionParameters):
(JSC::Parser<LexerType>::parseStatementListItem):
(JSC::Parser<LexerType>::parseVariableDeclarationList):
(JSC::Parser<LexerType>::parseFormalParameters):
(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::Parser<LexerType>::parseClass):
(JSC::Parser<LexerType>::parseAssignmentExpression):
(JSC::Parser<LexerType>::parsePrimaryExpression):
Make use of new parser functions.

* parser/Parser.h:
(JSC::isContextualKeyword): Renamed from isAnyContextualKeyword.
(JSC::Parser::matchSpecIdentifier): Allow escaped contextual keywords.
(JSC::Parser::matchIdentifierOrPossiblyEscapedContextualKeyword): Added.
(JSC::Parser::isAllowedIdentifierLet): Renamed from isLETMaskedAsIDENT.
(JSC::Parser::isPossiblyEscapedLet): Added.
(JSC::Parser::isDisallowedIdentifierAwait): Added.
(JSC::Parser::isAllowedIdentifierAwait): Added.
(JSC::Parser::isPossiblyEscapedAwait): Added.
(JSC::Parser::canUseIdentifierAwait): Added.
(JSC::Parser::isDisallowedIdentifierYield): Added.
(JSC::Parser::isAllowedIdentifierYield): Renamed from isYIELDMaskedAsIDENT.
(JSC::Parser::isPossiblyEscapedYield): Added.
(JSC::Parser::canUseIdentifierYield): Added.
(JSC::Parser::matchAllowedEscapedContextualKeyword): Added.
(JSC::Parser::disallowedIdentifierAwaitReason): Fix mistake (left over from previous patch).
(JSC::isIdentifierOrAnyContextualKeyword): Deleted.
(JSC::isSafeContextualKeyword): Deleted.
(JSC::Parser::isDisallowedIdentifierLet): Deleted.

* parser/ParserTokens.h:
Remove obsolete notion of "safe contextual keyword".


Canonical link: https://commits.webkit.org/233059@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271509 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 05:55:48 +00:00
Simon Fraser 7cabee7f2f [Async scrolling] Slow-scrolling reasons should not propagate across frame boundaries
https://bugs.webkit.org/show_bug.cgi?id=220635

Reviewed by Tim Horton.

Source/WebCore:

We should be able to do fast scrolling of the main frame when a subframe has background-attachment:fixed
content in it, but currently we propagate the "slow scrolling reasons" up to the root of
the scrolling tree, which crosses frame boundaries.

This is a partial fix for the problem; ThreadedScrollingTree::canUpdateLayersOnScrollingThread()
is still consulting tree-wide state.

Test: scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-overflow-in-iframe.html

* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::propagateSynchronousScrollingReasons):
(WebCore::ThreadedScrollingTree::canUpdateLayersOnScrollingThread const):
* page/scrolling/ThreadedScrollingTree.h:

LayoutTests:

* scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-overflow-in-iframe-expected.txt: Added.
* scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-overflow-in-iframe.html: Added.


Canonical link: https://commits.webkit.org/233058@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271508 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 05:12:47 +00:00
Aditya Keerthi 4eb77f268a [Cocoa] Strip DataDetectors links when copying content to the pasteboard
https://bugs.webkit.org/show_bug.cgi?id=220526
<rdar://problem/71045590>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Currently, when DataDetectors links are written to the pasteboard when
copied. This is problematic, since clicking on a DataDetector link
outside of a valid context results in an attempt to open an invalid
URL. Instead, DataDetectors links should be stripped when copied.

To remove the link, while preserving any custom styles, the <a> element
created by Data Detection is replaced with a <span> element. Any
attributes and styles added by WebKit are removed as a part of this
transformation.

Tests: editing/pasteboard/copy-paste-data-detected-links.html
       CopyRTF.StripsDataDetectedLinks
       PasteWebArchive.StripsDataDetectedLinks

* editing/cocoa/DataDetection.h:
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::isDataDetectorElement):

Add a helper to check if an element was created through Data Detection.

* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::_addLinkForElement):

Do not add NSLinkAttributeName for DataDetectors links.

(HTMLConverter::_exitElement):

Factor out link creation logic.

* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::spanReplacementForElement):

Centralize the logic that determines whether or not an element should
be replaced by a <span>. Previously, this only applied to <slot>
elements. Now, it applies to <slot> and DataDetectors links.

(WebCore::StyledMarkupAccumulator::appendStartTag):

If the element was created through DataDetection, append a <span>
rather than an <a>, to drop the link. The DataDetectors and href
attributes are also dropped from the markup string. Finally, remove
the text decoration style that was added by WebKit to style the
DataDetectors link.

(WebCore::StyledMarkupAccumulator::appendEndTag):

Consult shouldReplaceElementWithSpan when appending the end tag.

Tools:

Added API tests to verify DataDetectors links are not preserved when
copying/pasting WebArchives and rich text.

* TestWebKitAPI/Tests/WebKitCocoa/CopyRTF.mm:
(StripsDataDetectorsLinks):
* TestWebKitAPI/Tests/WebKitCocoa/PasteWebArchive.mm:
(StripsDataDetectorsLinks):

LayoutTests:

Added a test which copies content containing two data detected links
and verifies that the links are removed.

* editing/pasteboard/copy-paste-data-detected-links-expected.txt: Added.
* editing/pasteboard/copy-paste-data-detected-links.html: Added.


Canonical link: https://commits.webkit.org/233057@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271507 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-15 02:00:26 +00:00