https://bugs.webkit.org/show_bug.cgi?id=223702
Reviewed by Antti Koivisto.
LayoutTests/imported/w3c:
Import the border-spacing interpolation test with its 120 tests passing.
* web-platform-tests/css/css-tables/animations/border-spacing-interpolation-expected.txt: Added.
* web-platform-tests/css/css-tables/animations/border-spacing-interpolation.html: Added.
Source/WebCore:
Test: imported/w3c/web-platform-tests/css/css-tables/animations/border-spacing-interpolation.html
While we already supported animation of border-spacing, we did not correctly clip the interpolated
value to 0.
* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
Canonical link: https://commits.webkit.org/235725@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274978 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=223669
Reviewed by Tim Horton.
Source/WebCore:
DisplayRefreshMonitor code involves some non-trivial object
fan-out and WebProcess/UI Process interaction, and it deserves
a log channel.
* platform/Logging.h:
* platform/graphics/DisplayRefreshMonitor.cpp:
(WebCore::DisplayRefreshMonitor::displayDidRefresh):
* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::monitorForClient):
(WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
Source/WebKit:
DisplayRefreshMonitor code involves some non-trivial object
fan-out and WebProcess/UI Process interaction, and it deserves
a log channel.
* Platform/Logging.h:
* WebProcess/WebPage/mac/DisplayRefreshMonitorMac.cpp:
(WebKit::DisplayRefreshMonitorMac::displayLinkFired):
Canonical link: https://commits.webkit.org/235724@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274977 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=223674
Patch by Philippe Normand <pnormand@igalia.com> on 2021-03-24
Reviewed by Kenneth Russell.
Source/WebCore:
When the srcObject is directly set on a media element, the corresponding URL might still be
empty, so we need to ensure the URI corresponding to the MediaSource blob is not empty,
otherwise uridecodebin would fail to create the right source element.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::load):
LayoutTests:
* platform/glib/TestExpectations:
Canonical link: https://commits.webkit.org/235723@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=223704
<rdar://problem/74611683>
Reviewed by Tim Horton.
We kept these API around after updating the names to give clients
time to adopt the new versions. We can remove them now.
* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView pauseAllMediaPlayback:]): Deleted.
(-[WKWebView suspendAllMediaPlayback:]): Deleted.
(-[WKWebView resumeAllMediaPlayback:]): Deleted.
(-[WKWebView closeAllMediaPresentations:]): Deleted.
(-[WKWebView requestMediaPlaybackState:]): Deleted.
Canonical link: https://commits.webkit.org/235721@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274969 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=223708
<rdar://75788877>
Reviewed by Chris Dumez.
There is a test that deallocates a _WKUserInitiatedAction before anything calls InitializeWebKit2.
Calling constructInWrapper calls InitializeWebKit2.
Since r274227 it has been asserting s_mainRunLoop in RunLoop::isMain. This fixes it.
We don't have test infrastructure to test this in WebKit because TestWebKitAPI initializes the main thread for us before doing anything.
* UIProcess/API/APIUserInitiatedAction.h:
* UIProcess/API/Cocoa/_WKUserInitiatedAction.mm:
(-[_WKUserInitiatedAction init]):
Canonical link: https://commits.webkit.org/235719@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274967 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=223700
<rdar://problem/75357965>
Reviewed by Tim Horton.
The iOS form control refresh added a magnifier symbol to
the default appearance of <input type="search">. On iPhone, google.com
uses <input type="search"> for their search field, while drawing their
own magnifier symbol. As a result, two magnifier symbols appear.
Note that on macOS and iPadOS, google.com uses an <input type="text">,
which means this problem is only observed on iPhone. Ideally, google.com
should adopt <input type="text"> on the iPhone version of the site,
matching the other platforms. However, in the meantime, we can hide our
symbol using a quirk.
* html/shadow/TextControlInnerElements.cpp:
(WebCore::SearchFieldResultsButtonElement::SearchFieldResultsButtonElement):
Hide the symbol if the quirk applies.
* page/Quirks.cpp:
(WebCore::Quirks::shouldHideSearchFieldResultsButton const):
Add a quirk to hide the magnifier symbol on google.com and other country
domains.
* page/Quirks.h:
Canonical link: https://commits.webkit.org/235718@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274965 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=223694
Reviewed by Geoffrey Garen.
Source/WTF:
Update StringToIntegerConversion to deal with overflows in a well-defined manner,
by relying on CheckedArithmetics. This addresses undefined behavior reborted by
UBSan:
- wtf/text/StringToIntegerConversion.h:94:30: runtime error: signed integer overflow: 2147483640 + 8 cannot be represented in type 'int'
- wtf/text/StringToIntegerConversion.h:104:17: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
* wtf/text/StringToIntegerConversion.h:
(WTF::toIntegralType):
Tools:
Add API test coverage.
* TestWebKitAPI/Tests/WTF/StringView.cpp:
(TestWebKitAPI::TEST):
Canonical link: https://commits.webkit.org/235712@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274959 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=223697
Reviewed by Darin Adler.
Make sure FrameView::incrementVisuallyNonEmptyPixelCount() deals with overflows in a well-defined
manner. This fixes the following reports from UBSan:
- Source/WebCore/page/FrameView.h:990:50: runtime error: signed integer overflow: 65537 * 65537 cannot be represented in type 'int'
- Source/WebCore/page/FrameView.h:990:50: runtime error: signed integer overflow: 65536 * 65536 cannot be represented in type 'int'
- Source/WebCore/page/FrameView.h:990:50: runtime error: signed integer overflow: 1116300 * 558150 cannot be represented in type 'int'
- Source/WebCore/page/FrameView.h:990:50: runtime error: signed integer overflow: -33554432 * -33554432 cannot be represented in type 'int'
* page/FrameView.h:
(WebCore::FrameView::incrementVisuallyNonEmptyPixelCount):
Canonical link: https://commits.webkit.org/235711@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274958 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=223252
Patch by Rob Buis <rbuis@igalia.com> on 2021-03-24
Reviewed by Sam Weinig.
LayoutTests/imported/w3c:
Update test results because of not supporting style in contain property.
* web-platform-tests/css/css-contain/content-visibility/content-visibility-026-expected.txt:
* web-platform-tests/css/css-contain/parsing/contain-computed-expected.txt:
* web-platform-tests/css/css-contain/parsing/contain-valid-expected.txt:
Source/WebCore:
Address post land review comments.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeContain):
* rendering/style/RenderStyleConstants.h:
* style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueContain):
Canonical link: https://commits.webkit.org/235710@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274957 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=223665
Reviewed by Simon Fraser.
Source/WebCore:
Update to the latest draft spec, which dramatically reduces the complexity of color-mix()
by remove per-component adjusters.
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::normalizeWhitenessBlackness):
(WebCore::CSSPropertyParserHelpers::consumeColorMixColorSpaceAndComma):
(WebCore::CSSPropertyParserHelpers::consumeColorMixComponent):
(WebCore::CSSPropertyParserHelpers::normalizedMixPercentages):
(WebCore::CSSPropertyParserHelpers::makeColorTypeByNormalizingComponentsAfterMix):
(WebCore::CSSPropertyParserHelpers::makeColorTypeByNormalizingComponentsAfterMix<HWBA<float>>):
(WebCore::CSSPropertyParserHelpers::makeColorTypeByNormalizingComponentsAfterMix<HSLA<float>>):
(WebCore::CSSPropertyParserHelpers::fixupHueComponentsPriorToMix):
(WebCore::CSSPropertyParserHelpers::mixColorComponentsInColorSpace):
(WebCore::CSSPropertyParserHelpers::mixColorComponents):
(WebCore::CSSPropertyParserHelpers::parseColorMixFunctionParameters):
(WebCore::CSSPropertyParserHelpers::HueColorAdjuster::fixupAnglesForInterpolation): Deleted.
(WebCore::CSSPropertyParserHelpers::HueColorAdjuster::HueColorAdjuster): Deleted.
(WebCore::CSSPropertyParserHelpers::ColorAdjuster::ColorAdjuster): Deleted.
(WebCore::CSSPropertyParserHelpers::consumeAdjuster): Deleted.
(WebCore::CSSPropertyParserHelpers::consumeAndUpdateAdjusterAtIndex): Deleted.
(WebCore::CSSPropertyParserHelpers::consumeAndUpdateAdjuster): Deleted.
(WebCore::CSSPropertyParserHelpers::consumeAdjusters): Deleted.
(WebCore::CSSPropertyParserHelpers::consumeMixComponents): Deleted.
(WebCore::CSSPropertyParserHelpers::normalizeAdjusterValues): Deleted.
(WebCore::CSSPropertyParserHelpers::remainingAdjustment): Deleted.
(WebCore::CSSPropertyParserHelpers::mixComponent): Deleted.
(WebCore::CSSPropertyParserHelpers::mixComponentAtIndex): Deleted.
(WebCore::CSSPropertyParserHelpers::mix): Deleted.
(WebCore::CSSPropertyParserHelpers::parseColorMixFunctionParametersUsingAdjusters): Deleted.
Update to the new syntax and remove component adjusters. They may come back for color-adjust()
in the future.
* platform/graphics/ColorModels.h:
* platform/graphics/ColorTypes.h:
(WebCore::clampedComponent):
(WebCore::assertInRange):
* platform/graphics/ColorUtilities.h:
(WebCore::invertedColorWithOverriddenAlpha):
Add support in the color models for annotating more about each component, now including
the type (angle, number or percentage). This allows algorithms generic algorithms to
operate on abstract color type components without specializing for each color type.
LayoutTests:
* fast/css/parsing-color-mix-expected.txt:
* fast/css/parsing-color-mix.html:
Update test and results for vastly simplified color-mix().
Canonical link: https://commits.webkit.org/235704@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274947 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=223663
Reviewed by Darin Adler.
Address undefined behavior found by UBSan in DateMath.h
Release/usr/local/include/wtf/DateMath.h:247:39: runtime error: nan is outside the range of representable values of type 'int'
Release/usr/local/include/wtf/DateMath.h:221:29: runtime error: nan is outside the range of representable values of type 'int'
Release/usr/local/include/wtf/DateMath.h:165:38: runtime error: signed integer overflow: -2147483648 - 1 cannot be represented in type 'int'
* wtf/DateMath.h:
(WTF::daysFrom1970ToYear):
Cast year to a double *before* substracting 1 instead of *after*. This works around the fact that INT_MIN-1 would not
fit in an int and would be undefined behavior.
(WTF::dayInYear):
(WTF::msToYear):
Deal with the double potentially being NaN before casting to an int, since
casting NaN to an int type has undefined behavior.
Canonical link: https://commits.webkit.org/235703@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274946 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=223666
Reviewed by Mark Lam.
JSTests:
Added tests for dotAll. Also made sure that we test both JIT and non-JIT execution.
* stress/regexp-dot-match-nonBMP.js:
Source/JavaScriptCore:
In checkCharacterClassDontAdvanceInputForNonBMP(), we need to check for input.readChecked() returning -1
and return that the character class didn't match.
* yarr/YarrInterpreter.cpp:
(JSC::Yarr::Interpreter::checkCharacterClassDontAdvanceInputForNonBMP):
Canonical link: https://commits.webkit.org/235702@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274945 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=223657
<rdar://75757727>
Reviewed by Alex Christensen.
Source/WebKit:
Tested by TestWebKitAPI.
Update the WKWebView API to match final review comments. Deprecate the prior draft API so that we
can smoothly transition away from the original methods.
* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView loadSimulatedRequest:response:responseData:]):
(-[WKWebView loadSimulatedRequest:withResponse:responseData:]):
(-[WKWebView loadSimulatedRequest:responseHTMLString:]):
(-[WKWebView loadSimulatedRequest:withResponseHTMLString:]):
Tools:
Update tests to use the final API, while still exercising the existing API.
* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewLoadAPIs.mm:
(TEST):
Canonical link: https://commits.webkit.org/235701@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274944 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=223693
Patch by Zan Dobersek <zdobersek@igalia.com> on 2021-03-24
Reviewed by Philippe Normand.
On some iMX platforms we require the use of imxvideoconvert_g2d element
in order to properly convert the visual buffers before they can be
rendered through our pipeline. We expect to require this buffer if it's
present in the GStreamer plugin registry on the system.
We search for this element and, if found, add it to the sink and
position it at the beginning, before the glupload element.
Based on an approach outlined by Gabriel Valcazar.
* platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp:
(webKitGLVideoSinkConstructed):
Canonical link: https://commits.webkit.org/235700@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274943 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=223625
Reviewed by Yusuke Suzuki.
The code was doing a lot of wrong things by making bad assumptions about the
invariants of PutByIdVariants. Replace PutByIdVariants never have object
property condition sets, since we always replace on the self object (and don't
look at the prototype chain). This patch clears up the code to make it
clearer what the invariants are.
With respect to the original fix about not emitting a PutByOffset for a
Replace on a Structure that has an unfired replacement watchpoint set,
that was already handled by the PutByIdStatus::computeFor variant we're
calling inside of constant folding. It will return TakesSlowPathif it
encounters a Replace where the Structure still has an unfired watchpoint.
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::tryFoldAsPutByOffset):
Canonical link: https://commits.webkit.org/235699@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274942 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=223530
Patch by Sihui Liu <sihui_liu@appe.com> on 2021-03-24
Reviewed by Tim Horton.
For animated resize, UI process sets layer transform to fit new size until web process picks up size change and
paints. It is possible that UI process receives a commit during animated resize and the commit is not for the
animated resize (web process commits before animated resize). In this case, our current implementation is: if
SPI client species there will be no other update (!_waitingForEndAnimatedResize), we change layer transform to
reflect change of the middle commit.
However, that commit does not mean web process issues new paint, so the adjustment can be wrong. We find the
handling of middle commits causes issues in SPI client's use case (rdar://47623140). Also by manual testing,
it's not clear how the code can benefit current SPI clients. It seems to cause the same trouble sometimes. So
let's just remove it.
* UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _didCommitLayerTreeDuringAnimatedResize:]):
Canonical link: https://commits.webkit.org/235698@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274941 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=223684
Fixes this error:
error: invalid 'static_cast' from type 'uintptr_t' {aka 'unsigned
int'} to type 'GLNativeWindowType' {aka 'void*'}
; an invalid 'static_cast' from type error for ARMv7 (rpi3 and mesa driver)
by using the same solution chosen in
https://bugs.webkit.org/show_bug.cgi?id=179511:
EGLNativeWindowType can be aliased to a different type depending (at least) on the EGL
implementation, its build options, and the libepoxy build options. Using "static_cast"
works when it is a numeric value and the width of the value needs to be optionally
extended to 64 bits (e.g. the EGL type is "int" in a 32-bit CPU) but not for pointers,
and using "reinterpret_cast" works when the size of a pointer is 64 bits but not in other
cases. Therefore it seems reasonable to use a plain C cast expression to solve this
particular situation.
https://trac.webkit.org/changeset/274869/webkit
Reviewed by Philippe Normand.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::createGLContext):
Canonical link: https://commits.webkit.org/235695@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274937 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=223664
<rdar://problem/75754750>
Reviewed by Wenson Hsieh.
Source/WebCore:
No new tests, no change in behavior.
* Modules/geolocation/Geolocation.cpp:
(WebCore::isRequestFromIBooks):
* bindings/js/CommonVM.cpp:
(WebCore::globalConstRedeclarationShouldThrow):
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::initMouseEventQuirk):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::requiresFullscreenForVideoPlayback const):
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::currentRunLoop):
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::CocoaApplication::isIBooks):
(WebCore::MacApplication::isIBooks): Deleted.
(WebCore::IOSApplication::isIBooks): Deleted.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::synchronousWillSendRequestEnabled):
* rendering/RenderBox.cpp:
(WebCore::allowMinMaxPercentagesInAutoHeightBlocksQuirk):
Transition to a single bundle check for Books, since the quirks are generally
about book content, not about the app's behavior. Long-term, we should
get rid of these entirely (some are no longer necessary, and the rest
should turn into switches that Books can toggle).
Source/WebKitLegacy/mac:
* WebView/WebViewData.mm:
(currentRunLoop):
Canonical link: https://commits.webkit.org/235689@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274931 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=223648
Reviewed by Chris Dumez.
Future work will require that it's possible to create a DisplayRefreshMonitor
without having a DisplayRefreshMonitorClient. It was also weird that the way to
create a DisplayRefreshMonitor was via the DisplayRefreshMonitorClient, so
this change fixes both by adding DisplayRefreshMonitorFactory.
In WK2, the drawing areas are DisplayRefreshMonitorFactories. If there is no
factory, we fall back to the default implementations.
Source/WebCore:
* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* loader/EmptyClients.cpp:
(WebCore::EmptyDisplayRefreshMonitorFactory::sharedEmptyDisplayRefreshMonitorFactory):
(WebCore::EmptyChromeClient::displayRefreshMonitorFactory const):
(WebCore::EmptyChromeClient::createDisplayRefreshMonitor const): Deleted.
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::displayRefreshMonitorFactory const):
(WebCore::ChromeClient::createDisplayRefreshMonitor const): Deleted.
* page/RenderingUpdateScheduler.cpp:
(WebCore::RenderingUpdateScheduler::displayRefreshMonitorFactory const):
(WebCore::RenderingUpdateScheduler::createDisplayRefreshMonitor const): Deleted.
* page/RenderingUpdateScheduler.h:
* platform/graphics/DisplayRefreshMonitor.cpp:
(WebCore::DisplayRefreshMonitor::create):
* platform/graphics/DisplayRefreshMonitor.h:
* platform/graphics/DisplayRefreshMonitorClient.cpp:
(WebCore::DisplayRefreshMonitorClient::DisplayRefreshMonitorClient): Deleted.
* platform/graphics/DisplayRefreshMonitorClient.h:
* platform/graphics/DisplayRefreshMonitorFactory.h: Copied from Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.cpp.
* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::monitorForClient):
* platform/graphics/GraphicsLayerUpdater.cpp:
(WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater):
(WebCore::GraphicsLayerUpdater::displayRefreshMonitorFactory const):
(WebCore::GraphicsLayerUpdater::createDisplayRefreshMonitor const): Deleted.
* platform/graphics/GraphicsLayerUpdater.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::displayRefreshMonitorFactory):
(WebCore::RenderLayerCompositor::createDisplayRefreshMonitor const): Deleted.
* rendering/RenderLayerCompositor.h:
Source/WebKit:
Remove DrawingAreaMac.cpp since its code was entirely related to creating
DisplayRefreshMonitorMac objects.
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::displayRefreshMonitorFactory const):
(WebKit::WebChromeClient::createDisplayRefreshMonitor const): Deleted.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::createDisplayRefreshMonitor): Deleted.
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::createDisplayRefreshMonitor):
* WebProcess/WebPage/mac/DisplayRefreshMonitorMac.cpp: Renamed from Source/WebKit/WebProcess/WebPage/mac/DrawingAreaMac.cpp.
(WebKit::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
(WebKit::DisplayRefreshMonitorMac::~DisplayRefreshMonitorMac):
(WebKit::DisplayRefreshMonitorMac::requestRefreshCallback):
(WebKit::DisplayRefreshMonitorMac::displayLinkFired):
* WebProcess/WebPage/mac/DisplayRefreshMonitorMac.h: Copied from Source/WebCore/platform/graphics/GraphicsLayerUpdater.h.
(WebKit::DisplayRefreshMonitorMac::create):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::createDisplayRefreshMonitor):
Canonical link: https://commits.webkit.org/235687@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274929 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=222635
<rdar://problem/74395950>
Source/WebCore:
Reviewed by Youenn Fablet.
Fix capitalization error. Add a new function to mark the service
worker document loader as app-bound.
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setLastNavigationWasAppBound):
(WebCore::DocumentLoader::setlastNavigationWasAppBound): Deleted.
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::setLastNavigationWasAppBound):
* workers/service/context/ServiceWorkerThreadProxy.h:
Source/WebKit:
Reviewed by Youenn Fablet.
Mark the service worker document loader as app-bound or not when
initiating a fetch event.
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::startFetch):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::createDocumentLoader):
Fix capitalization error.
Tools:
API test coverage for fetched and synthetic responses to make sure
they are marked as app-bound or not based on the main request.
Reviewed by Youenn Fablet.
* TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
Canonical link: https://commits.webkit.org/235686@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274928 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=220076
<rdar://problem/72565020>
Patch by Dean Jackson <yolo@apple.com> on 2021-03-23
Reviewed by Sam Weinig.
Source/WTF:
Turn the Metal backend for ANGLE on, moving the feature
from Internal to Experimental.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
* Scripts/Preferences/WebPreferencesInternal.yaml:
LayoutTests:
Updated results for WebGL 2 content with the Metal ANGLE
backend. See https://bugs.webkit.org/show_bug.cgi?id=222239
* platform/mac/TestExpectations:
* platform/ios-simulator-wk2/TestExpectations:
* platform/ios-simulator/TestExpectations:
* platform/ios-wk2/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:
* platform/wk2/TestExpectations:
Canonical link: https://commits.webkit.org/235685@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274927 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=223650
Reviewed by Darin Adler.
Source/WTF:
Update the clampTo() template specialization that converts floating types into integer types so that
it deals with NaN inputs in a well-defined manner. Previously, it would simply cast the NaN to the
integer type, which was undefined behavior. We now return the minimum range boundary for the output
when the input is NaN.
* wtf/MathExtras.h:
(clampTo):
Tools:
The bindings generator used by WebKitTestRunner was converting all numbers into double and
passing that to the implementation, no matter the IDL type (e.g. unsigned long). As a result,
there may be a type mismatch between the value the bindings are passing and the implementation
function getting called. This implicit conversion has undefined behavior in some cases and it
triggers UBSan errors. To address the issue, we now call clampTo<NativeNumberType>() on the
double before passing it to the implementation. This makes sure we pass the implementation
the type it expects and that the conversion is well-defined.
* WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
(_generateImplementationFile):
(_nativeNumericType):
(_platformType):
(_platformTypeConstructor):
(_platformTypeVariableDeclaration):
Canonical link: https://commits.webkit.org/235683@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274919 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=223619
Reviewed by Don Olmstead.
Implemented inspector-resource:// URL scheme handler for WinCairo
port. Mac port did it in Bug 179904.
http/tests/inspector tests were crashing due to
RELEASE_ASSERT_WITH_SECURITY_IMPLICATION failure (See Bug 223566).
* PlatformWin.cmake:
* UIProcess/Inspector/win/InspectorResourceURLSchemeHandler.cpp: Added.
(WebKit::InspectorResourceURLSchemeHandler::platformStartTask):
* UIProcess/Inspector/win/InspectorResourceURLSchemeHandler.h: Added.
* UIProcess/Inspector/win/WebInspectorUIProxyWin.cpp:
(WebKit::WebInspectorUIProxy::platformCreateFrontendPage):
(WebKit::WebInspectorUIProxy::inspectorPageURL):
(WebKit::WebInspectorUIProxy::inspectorTestPageURL):
* WebProcess/Inspector/win/WebInspectorUIWin.cpp:
(WebKit::WebInspectorUI::localizedStringsURL const):
(WebKit::RemoteWebInspectorUI::localizedStringsURL const):
Canonical link: https://commits.webkit.org/235682@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274912 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=223629
Source/JavaScriptCore:
<rdar://problem/75619217>
Reviewed by Mark Lam.
The functor for WeakGCMap::ensureValue must not invoke GC. GC can prune entries in WeakGCMap.
So we can modify underlying HashMap while we are just touching it for HashMap::ensure. This
can corrupt HashMap. To ensure this invariant, we put DisallowGC for WeakGCMap::ensureValue.
So we cannot invoke GC in the functor of that function (otherwise, assertion hits).
And we use DeferGC in createCustomGetterFunction / createCustomSetterFunction to avoid invoking
GC in WeakGCMap::ensureValue. This defers GC invocation until this DeferGC scope is destroyed,
and ensures that functor invoked by WeakGCMap::ensureValue will not cause GC.
* runtime/JSObject.cpp:
(JSC::createCustomGetterFunction):
(JSC::createCustomSetterFunction):
(JSC::JSObject::getOwnPropertyDescriptor):
* runtime/WeakGCMap.h:
Source/WebCore:
Reviewed by Mark Lam.
Test: js/dom/weak-gc-map-ensure-value-should-not-invoke-gc.html
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::createCrossOriginFunction):
(WebCore::JSDOMGlobalObject::createCrossOriginGetterSetter):
LayoutTests:
Reviewed by Mark Lam.
* js/dom/weak-gc-map-ensure-value-should-not-invoke-gc-expected.txt: Added.
* js/dom/weak-gc-map-ensure-value-should-not-invoke-gc.html: Added.
Canonical link: https://commits.webkit.org/235681@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274911 268f45cc-cd09-0410-ab3c-d52691b4dbfc