Timeline
Mar 31, 2019:
- 11:51 PM Changeset in webkit [243688] by
-
- 21 edits in trunk/Source
[JSC] Butterfly allocation from LargeAllocation should try "realloc" behavior if collector thread is not active
https://bugs.webkit.org/show_bug.cgi?id=196160
Reviewed by Saam Barati.
Source/JavaScriptCore:
"realloc" can be effective in terms of peak/current memory footprint when realloc succeeds because,
- It does not allocate additional memory while expanding a vector
- It does not deallocate an old memory, just reusing the current memory by expanding, so that memory footprint is tight even before scavenging
We found that we can "realloc" large butterflies in certain conditions are met because,
- If it goes to LargeAllocation, this memory region is never reused until GC sweeps it.
- Butterflies are owned by owner JSObjects, so we know the lifetime of Butterflies.
This patch attempts to use "realloc" onto butterflies if,
- Butterflies are allocated in LargeAllocation kind
- Concurrent collector is not active
- Butterflies do not have property storage
The condition (2) is required to avoid deallocating butterflies while the concurrent collector looks into it. The condition (3) is
also required to avoid deallocating butterflies while the concurrent compiler looks into it.
We also change LargeAllocation mechanism to using "malloc" and "free" instead of "posix_memalign". This allows us to use "realloc"
safely in all the platforms. Since LargeAllocation uses alignment to distinguish LargeAllocation and MarkedBlock, we manually adjust
16B alignment by allocating 8B more memory in "malloc".
Speedometer2 and JetStream2 are neutral. RAMification shows about 1% progression (even in some of JIT tests).
- heap/AlignedMemoryAllocator.h:
- heap/CompleteSubspace.cpp:
(JSC::CompleteSubspace::tryAllocateSlow):
(JSC::CompleteSubspace::reallocateLargeAllocationNonVirtual):
- heap/CompleteSubspace.h:
- heap/FastMallocAlignedMemoryAllocator.cpp:
(JSC::FastMallocAlignedMemoryAllocator::tryAllocateMemory):
(JSC::FastMallocAlignedMemoryAllocator::freeMemory):
(JSC::FastMallocAlignedMemoryAllocator::tryReallocateMemory):
- heap/FastMallocAlignedMemoryAllocator.h:
- heap/GigacageAlignedMemoryAllocator.cpp:
(JSC::GigacageAlignedMemoryAllocator::tryAllocateMemory):
(JSC::GigacageAlignedMemoryAllocator::freeMemory):
(JSC::GigacageAlignedMemoryAllocator::tryReallocateMemory):
- heap/GigacageAlignedMemoryAllocator.h:
- heap/IsoAlignedMemoryAllocator.cpp:
(JSC::IsoAlignedMemoryAllocator::tryAllocateMemory):
(JSC::IsoAlignedMemoryAllocator::freeMemory):
(JSC::IsoAlignedMemoryAllocator::tryReallocateMemory):
- heap/IsoAlignedMemoryAllocator.h:
- heap/LargeAllocation.cpp:
(JSC::isAlignedForLargeAllocation):
(JSC::LargeAllocation::tryCreate):
(JSC::LargeAllocation::tryReallocate):
(JSC::LargeAllocation::LargeAllocation):
(JSC::LargeAllocation::destroy):
- heap/LargeAllocation.h:
(JSC::LargeAllocation::indexInSpace):
(JSC::LargeAllocation::setIndexInSpace):
(JSC::LargeAllocation::basePointer const):
- heap/MarkedSpace.cpp:
(JSC::MarkedSpace::sweepLargeAllocations):
(JSC::MarkedSpace::prepareForConservativeScan):
- heap/WeakSet.h:
(JSC::WeakSet::isTriviallyDestructible const):
- runtime/Butterfly.h:
- runtime/ButterflyInlines.h:
(JSC::Butterfly::reallocArrayRightIfPossible):
- runtime/JSObject.cpp:
(JSC::JSObject::ensureLengthSlow):
Source/WTF:
- wtf/FastMalloc.h:
(WTF::FastMalloc::tryRealloc):
- wtf/Gigacage.cpp:
(Gigacage::tryRealloc):
- wtf/Gigacage.h:
- 11:42 PM Changeset in webkit [243687] by
-
- 3 edits2 adds in trunk
Scroll position gets reset when overflow:scroll is inside grid
https://bugs.webkit.org/show_bug.cgi?id=196337
<rdar://problem/49385784>
Reviewed by Simon Fraser.
Fix scroll position when there are changes inside a grid item with "overflow: scroll".
Source/WebCore:
Test: fast/css-grid-layout/grid-item-content-scroll-position.html
- rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock): Use beginUpdateScrollInfoAfterLayoutTransaction()
and endAndCommitUpdateScrollInfoAfterLayoutTransaction().
LayoutTests:
- fast/css-grid-layout/grid-item-content-scroll-position-expected.txt: Added.
- fast/css-grid-layout/grid-item-content-scroll-position.html: Added.
- 7:03 PM Changeset in webkit [243686] by
-
- 4 edits in trunk/Source/WebCore
Reduce the size of Node::deref by eliminating an explicit parentNode check
https://bugs.webkit.org/show_bug.cgi?id=195776
Reviewed by Darin Adler.
Address post-commit review comments.
- dom/Document.cpp:
(WebCore::Document::removedLastRef):
- dom/Node.cpp:
(WebCore::Node::~Node):
(WebCore::Node::removedLastRef):
- dom/Node.h:
(WebCore::Node::deref):
(WebCore::Node::setParentNode):
- 6:38 PM Changeset in webkit [243685] by
-
- 3 edits in trunk/Tools
[Win][WebKit] MiniBrowser should support high DPI display
https://bugs.webkit.org/show_bug.cgi?id=196391
Reviewed by Alex Christensen.
- MiniBrowser/win/WebKitBrowserWindow.cpp:
(WebKitBrowserWindow::WebKitBrowserWindow): Call resetZoom to set the page zoom factor.
(WebKitBrowserWindow::resetZoom): Changed the default page zoom factor from 1 to the device scale factor.
- MiniBrowser/win/stdafx.h: Define WEBCORE_EXPORT.
- 1:01 PM Changeset in webkit [243684] by
-
- 3 edits2 adds in trunk
[iOS] Crash when changing inputmode for certain types of focusable elements
https://bugs.webkit.org/show_bug.cgi?id=196431
<rdar://problem/49454962>
Reviewed by Tim Horton.
Source/WebKit:
The crash is happening because WebPage::focusedElementDidChangeInputMode assumes that the document's focused
element must be the same as m_focusedElement in WebPage. However, this is not the case, since m_focusedElement
is only set for certain types of elements that require user input (e.g. text fields, editable content, select
menus, etc.). The function then attempts to dereference m_focusedElement, which may be null if the document's
focused element doesn't fall into one of the aforementioned categories.
To fix this, bail if the element that is changing inputmode is not equal to the WebPage's current focused
element. See below for more details.
Test: fast/forms/change-inputmode-crash.html
- WebProcess/WebPage/WebPage.cpp:
(WebKit::isTextFormControlOrEditableContent):
Clean up some existing logic by introducing a helper method for determining whether an element should
propagate inputmode attribute changes to the UI process. Also, check the element type using type traits instead
of checking against the tag name.
(WebKit::WebPage::elementDidFocus):
(WebKit::WebPage::focusedElementDidChangeInputMode):
LayoutTests:
Add a layout test that exercises the edge case; see WebKit ChangeLogs for more details.
- fast/forms/change-inputmode-crash-expected.txt: Added.
- fast/forms/change-inputmode-crash.html: Added.
- 12:29 PM Changeset in webkit [243683] by
-
- 14 edits in trunk
Remove more i386 specific configurations
https://bugs.webkit.org/show_bug.cgi?id=196430
Reviewed by Alexey Proskuryakov.
Source/JavaScriptCore:
- Configurations/FeatureDefines.xcconfig:
ENABLE_WEB_AUTHN_macosx can now be enabled unconditionally on macOS.
- Configurations/ToolExecutable.xcconfig:
ARC can be enabled unconditionally now.
Source/WebCore:
- Configurations/FeatureDefines.xcconfig:
ENABLE_WEB_AUTHN_macosx can now be enabled unconditionally on macOS.
Source/WebCore/PAL:
- Configurations/FeatureDefines.xcconfig:
ENABLE_WEB_AUTHN_macosx can now be enabled unconditionally on macOS.
Source/WebKit:
- Configurations/BaseTarget.xcconfig:
WK_HAVE_CORE_PREDICTION can now be enabled unconditionally.
- Configurations/FeatureDefines.xcconfig:
ENABLE_WEB_AUTHN_macosx can now be enabled unconditionally on macOS.
Source/WebKitLegacy/mac:
- Configurations/FeatureDefines.xcconfig:
ENABLE_WEB_AUTHN_macosx can now be enabled unconditionally on macOS.
Tools:
- TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
ENABLE_WEB_AUTHN_macosx and ENABLE_WEB_RTC_macosx can now be enabled unconditionally on macOS.
- 10:37 AM Changeset in webkit [243682] by
-
- 24 edits1 move in trunk
[iOS] WebKit should consult the navigation response policy delegate before previewing a QuickLook document
https://bugs.webkit.org/show_bug.cgi?id=196433
<rdar://problem/49293305>
Reviewed by Tim Horton.
Source/WebCore:
When ResourceLoader would encounter a response with a MIME type that QuickLook supports, the
response would be implicitly allowed and a QuickLook preview would be generated. After
generating, the client's navigation response policy delegate would be notified of the
preview response, but not the underlying response. Notably, the preview response has a URL
scheme of "x-apple-ql-id", does not include any underlying HTTP headers, and usually has a
MIME type of "text/html" or "application/pdf" rather than the underlying response MIME type.
To allow clients to make better navigation response policy decisions, this patch changes the
above behavior for WKWebView clients that have linked against a version of WebKit that
includes this change. Rather than notifying the client's navigation response policy delegate
of the preview response, we notify the client of the underlying response. Only if the client
responds with a policy of "allow" will the QuickLook preview response be loaded (without
another call to the navigation response policy delegate).
Non-WKWebView clients and clients that have linked against a version of WebKit that does not
include this change will retain the original behavior.
Covered by existing layout tests and new and existing API tests.
- WebCore.xcodeproj/project.pbxproj:
- loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::shouldCreatePreviewLoaderForResponse const):
(WebCore::SubresourceLoader::didReceiveResponse):
- loader/ios/PreviewLoader.h:
- loader/ios/PreviewLoader.mm:
(-[WebPreviewLoader initWithResourceLoader:resourceResponse:]):
(-[WebPreviewLoader _loadPreviewIfNeeded]):
(-[WebPreviewLoader connection:didReceiveData:lengthReceived:]):
(-[WebPreviewLoader connectionDidFinishLoading:]):
(-[WebPreviewLoader connection:didFailWithError:]):
(WebCore::PreviewLoader::create):
(WebCore::PreviewLoader::didReceiveResponse):
(-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]): Deleted.
(WebCore::PreviewLoader::shouldCreateForMIMEType): Deleted.
- page/Settings.yaml:
- platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::canShowMIMEType):
- platform/network/ios/PreviewConverter.h:
- platform/network/ios/PreviewConverter.mm:
(WebCore::PreviewConverter::supportsMIMEType):
Source/WebKit:
Added WKWebViewConfiguration SPI for setting the QuickLook navigation response policy
decision behavior. The configuration setting defaults to YES for clients linked on or after
this WebKit change and NO otherwise.
- NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions):
- Shared/WebPreferences.yaml:
- Shared/ios/QuickLookDocumentData.cpp:
(WebKit::QuickLookDocumentData::isEmpty const):
- Shared/ios/QuickLookDocumentData.h:
- UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
- UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(defaultShouldDecidePolicyBeforeLoadingQuickLookPreview):
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration encodeWithCoder:]):
(-[WKWebViewConfiguration initWithCoder:]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _shouldDecidePolicyBeforeLoadingQuickLookPreview]):
(-[WKWebViewConfiguration _setShouldDecidePolicyBeforeLoadingQuickLookPreview:]):
- UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
- UIProcess/Cocoa/VersionChecks.h:
- WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.cpp:
(WebKit::WebPreviewLoaderClient::didReceiveDataArray):
Source/WTF:
- wtf/NeverDestroyed.h:
(WTF::NeverDestroyed::operator->):
(WTF::NeverDestroyed::operator-> const):
Tools:
Enhanced API test coverage to include all navigation response policy decisions in both
linked-before and linked-on-or-after modes. Also added new expectations for all tests.
- TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
- TestWebKitAPI/Tests/WebCore/ios/PreviewConverter.cpp: Renamed from Tools/TestWebKitAPI/Tests/WebCore/ios/PreviewLoader.cpp.
(TestWebKitAPI::TEST):
- TestWebKitAPI/Tests/WebKitCocoa/QuickLook.mm:
(readFile):
(-[QuickLookDelegate initWithExpectedFileURL:responsePolicy:]):
(-[QuickLookDelegate initWithExpectedFileURL:previewMIMEType:responsePolicy:]):
(-[QuickLookDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
(-[QuickLookDelegate _webView:didStartLoadForQuickLookDocumentInMainFrameWithFileName:uti:]):
(-[QuickLookDelegate _webView:didFinishLoadForQuickLookDocumentInMainFrame:]):
(-[QuickLookDelegate webView:didFailProvisionalNavigation:withError:]):
(-[QuickLookDelegate _webViewWebProcessDidCrash:]):
(-[QuickLookDelegate _downloadDidStart:]):
(-[QuickLookDelegate _download:didReceiveResponse:]):
(-[QuickLookDelegate _download:didReceiveData:]):
(-[QuickLookDelegate _download:decideDestinationWithSuggestedFilename:completionHandler:]):
(-[QuickLookDelegate _downloadDidFinish:]):
(-[QuickLookDelegate _download:didFailWithError:]):
(-[QuickLookDelegate _downloadDidCancel:]):
(-[QuickLookDelegate verifyDownload]):
(runTest):
(runTestDecideBeforeLoading):
(runTestDecideAfterLoading):
(TEST):
(-[QuickLookAsyncDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
(-[QuickLookPasswordDelegate _webViewDidRequestPasswordForQuickLookDocument:]):
(-[QuickLookFrameLoadDelegate webView:didFinishLoadForFrame:]):
(-[QuickLookNavigationDelegate _webView:didStartLoadForQuickLookDocumentInMainFrameWithFileName:uti:]): Deleted.
(-[QuickLookNavigationDelegate _webView:didFinishLoadForQuickLookDocumentInMainFrame:]): Deleted.
(-[QuickLookNavigationDelegate webView:didFinishNavigation:]): Deleted.
(-[QuickLookAsyncNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]): Deleted.
(-[QuickLookAsyncNavigationDelegate _webView:didStartLoadForQuickLookDocumentInMainFrameWithFileName:uti:]): Deleted.
(-[QuickLookAsyncNavigationDelegate _webView:didFinishLoadForQuickLookDocumentInMainFrame:]): Deleted.
(-[QuickLookAsyncNavigationDelegate webView:didFinishNavigation:]): Deleted.
(-[QuickLookDecidePolicyDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]): Deleted.
(-[QuickLookDecidePolicyDelegate webView:didFailProvisionalNavigation:withError:]): Deleted.
(-[QuickLookDecidePolicyDelegate _webViewWebProcessDidCrash:]): Deleted.
(-[QuickLookPasswordNavigationDelegate _webViewDidRequestPasswordForQuickLookDocument:]): Deleted.
Mar 30, 2019:
- 3:07 PM Changeset in webkit [243681] by
-
- 4 edits2 adds in trunk
gl.readPixels with type gl.FLOAT does not work
https://bugs.webkit.org/show_bug.cgi?id=171432
<rdar://problem/31905150>
Reviewed by Antoine Quint.
Source/WebCore:
Our validation code was identifying readPixels of
type FLOAT as invalid, for three reasons:
- we didn't support the FLOAT type at all.
- we only allowed the combination of RGBA and
UNSIGNED_BYTE in WebGL 1 [*].
- if we had a framebuffer of format RGBA, we assumed
we could only read into a Uint8 ArrayBuffer.
[*] This bug isn't completely fixed, so I opened
https://bugs.webkit.org/show_bug.cgi?id=196418
Test: fast/canvas/webgl/readPixels-float.html
- html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::readPixels):
- flip the logic in a conditional that was clearly wrong yet thankfully had no impact.
- support type FLOAT when the relevant extension is enabled.
- allow FLOAT as a valid type (see new bug above)
- create a new macro for CHECK_COMPONENT_COUNT
- update the existing macros to not be case statements, so that we can put logic in the switch.
LayoutTests:
New test that exercises reading a framebuffer object
with a floating point texture attached.
- platform/ios/TestExpectations: Skip this test on iOS, where floating-point
FBOs are not supported.
- fast/canvas/webgl/readPixels-float-expected.txt: Added.
- fast/canvas/webgl/readPixels-float.html: Added.
- 11:34 AM WebKitGTK/2.24.x edited by
- (diff)
- 11:32 AM WebKitGTK/2.24.x edited by
- (diff)
- 11:32 AM WebKitGTK/2.24.x edited by
- (diff)
- 10:50 AM Changeset in webkit [243680] by
-
- 2 edits in trunk/Source/WebCore
Try to fix Windows build.
- platform/graphics/RoundedRect.cpp:
(WebCore::approximateAsRegion):
- 9:38 AM Changeset in webkit [243679] by
-
- 2 edits in trunk/Source/WebCore
Web Inspector: JSC Sampling Profiler thread not getting subtracted in CPU Usage Timeline
https://bugs.webkit.org/show_bug.cgi?id=196419
<rdar://problem/49444023>
Reviewed by Devin Rousso.
- page/ResourceUsageThread.cpp:
(WebCore::ResourceUsageThread::addObserver):
We forgot to call the function that would setup platform state
allowing us to subtract out the sampling profiler thread.
- 7:09 AM Changeset in webkit [243678] by
-
- 3 edits2 adds in trunk
[ContentChangeObserver] Add iFrame elements to the list of "considered clickable" elements.
https://bugs.webkit.org/show_bug.cgi?id=196410
<rdar://problem/49436828>
Reviewed by Simon Fraser.
Source/WebCore:
163.com constructs an iFrame to display the login pane on hover. This patch ensures that we take iFrames into account while observing for visible content change by considering iFrame elements "clickable".
(While iFrames don't necessarily have clickable content, we can't just sit and wait until they are fully loaded.)
Test: fast/events/touch/ios/content-observation/iframe-is-shown-on-hover.html
- page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::StyleChangeScope::isConsideredClickable const):
LayoutTests:
- fast/events/touch/ios/content-observation/iframe-is-shown-on-hover-expected.txt: Added.
- fast/events/touch/ios/content-observation/iframe-is-shown-on-hover.html: Added.
- 6:47 AM Changeset in webkit [243677] by
-
- 3 edits2 adds in trunk
[ContentChangeObserver] Subframe load should not reset content observation on the mainframe
https://bugs.webkit.org/show_bug.cgi?id=196408
<rdar://problem/49436797>
Reviewed by Simon Fraser.
Source/WebKit:
Hover intent fails when an unrelated frame commits a load the same time.
cancelPotentialTapInFrame is called from didCommitLoad, but what we are looking for here is the user initiated cancel of a tap (cancelPotentialTap).
(If the current frame navigates away, willDetachPage takes care of canceling the observation.)
- WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::cancelPotentialTap):
(WebKit::WebPage::cancelPotentialTapInFrame):
LayoutTests:
- fast/events/touch/ios/content-observation/hover-while-loading-subframe-expected.txt: Added.
- fast/events/touch/ios/content-observation/hover-while-loading-subframe.html: Added.
- 4:09 AM Changeset in webkit [243676] by
-
- 2 edits in trunk/Tools
[CMake] add testdfg as target with build-jsc
https://bugs.webkit.org/show_bug.cgi?id=196393
Reviewed by Saam Barati.
Added testdfg as one of the targets to build when
using CMake.
- Scripts/build-jsc:
- 2:19 AM Changeset in webkit [243675] by
-
- 3 edits in trunk/Source/WebCore
Try to fix Windows build.
- platform/graphics/Region.cpp:
- platform/graphics/RoundedRect.cpp:
- 1:28 AM Changeset in webkit [243674] by
-
- 15 edits2 adds in trunk
Hit-testing of boxes over scrollers should account for border-radius
https://bugs.webkit.org/show_bug.cgi?id=195374
<rdar://problem/48649993>
Reviewed by Simon Fraser.
Source/WebCore:
Test: fast/scrolling/ios/border-radious-event-region.html
- page/Frame.h:
- platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::dumpProperties const):
Testing support.
- platform/graphics/GraphicsLayerClient.h:
- platform/graphics/RoundedRect.cpp:
(WebCore::approximateAsRegion):
Add a function to approximate RoundedRects as Regions.
It cuts away rectangles from the corners following the corner shapes.
More rectangles are cut for larger radii.
- platform/graphics/RoundedRect.h:
- rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):
Use the new interface to get rounded corners right.
In rectangle case this takes optimized paths.
- rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerTreeAsText):
- testing/Internals.cpp:
(WebCore::toLayerTreeFlags):
- testing/Internals.h:
- testing/Internals.idl:
LayoutTests:
- fast/scrolling/ios/border-radius-event-region-expected.txt: Added.
- fast/scrolling/ios/border-radius-event-region.html: Added.
- fast/scrolling/ios/overflow-scroll-overlap-2-expected.txt: