⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Timeline



Feb 20, 2019:

9:59 PM Changeset in webkit [241862] by ysuzuki@apple.com
  • 5 edits in trunk/Source/JavaScriptCore

[JSC] Remove WatchpointSet creation for SymbolTable entries if VM::canUseJIT() returns false
https://bugs.webkit.org/show_bug.cgi?id=194891

Reviewed by Geoffrey Garen.

WatchpointSet in SymbolTable is used to fold the value into a constant in JIT tiers. And it is
not useful under the non-JIT mode. This patch avoids creation of WatchpointSet in SymbolTable
if VM::canUseJIT() returns false.

  • llint/LowLevelInterpreter32_64.asm:
  • llint/LowLevelInterpreter64.asm:
  • runtime/SymbolTable.cpp:

(JSC::SymbolTableEntry::addWatchpoint): Deleted.

  • runtime/SymbolTable.h:

(JSC::SymbolTableEntry::isWatchable const):
(JSC::SymbolTableEntry::watchpointSet):

9:48 PM Changeset in webkit [241861] by mitz@apple.com
  • 9 copies
    1 add in releases/Apple/Safari Technology Preview 76

Added a tag for Safari Technology Preview release 76.

7:32 PM Changeset in webkit [241860] by Simon Fraser
  • 2 edits in trunk/Source/WebCore

REGRESSION (240698): Fixed position banners flicker and move when scrolling on iOS
https://bugs.webkit.org/show_bug.cgi?id=194889
rdar://problem/47755552

Reviewed by Tim Horton.

After r240698 we could commit scrolling changes for a fixed node where the "viewportRectAtLastLayout" and the layer
position were mismatched; this happened when AsyncScrollingCoordinator::reconcileScrollingState() came back from the UI process
with an unstable update and set a new layoutViewport, then some other layout triggered a compositing tree update. During the tree
update, we'd update the fixed scrolling node with the new viewport, and an old layer position.

Fix by ensuring that we only update the geometry info for a scrolling tree node when we update layer geometry for the corresponding
layer.

Not currently testable.

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):

7:28 PM Changeset in webkit [241859] by Antti Koivisto
  • 3 edits
    2 adds in trunk

Make programmatic frame scrolling work on iOS
https://bugs.webkit.org/show_bug.cgi?id=194886

Reviewed by Simon Fraser.

Source/WebKit:

  • UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:

(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):

Don't move based on the layout scroll position. This just overrides the user scroll position.
Remove ScrolledContentsLayer checks, we only need to deal with the ScrollContainerLayer here.

(WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition):

Scroll the UIScrollView correctly. This is called as a result of setting the RequestedScrollPosition property.
Remove scroll origin code, it doesn't look correct (and is untested).

LayoutTests:

Test by Frederic Wang.

  • fast/scrolling/ios/programmatic-scroll-iframe-expected.html: Added.
  • fast/scrolling/ios/programmatic-scroll-iframe.html: Added.
6:55 PM Changeset in webkit [241858] by don.olmstead@sony.com
  • 2 edits in trunk/Tools

[CMake][Win] Only build DumpRenderTree when WebKit Legacy is enabled
https://bugs.webkit.org/show_bug.cgi?id=194884

Reviewed by Michael Catanzaro.

  • PlatformWin.cmake:
6:45 PM Changeset in webkit [241857] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebInspectorUI

Web Inspector: RTL: Scripts Timeline loading indicator has incorrect margins
https://bugs.webkit.org/show_bug.cgi?id=194882

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2019-02-20
Reviewed by Matt Baker.

  • UserInterface/Views/TimelineRecordingContentView.css:

(.content-view.timeline-recording > .content-browser .recording-progress > .status > .indeterminate-progress-spinner):

5:36 PM Changeset in webkit [241856] by commit-queue@webkit.org
  • 3 edits in trunk/Source/WTF

URL percent-encode operations should use checked arithmetic for buffer allocation length
https://bugs.webkit.org/show_bug.cgi?id=194877
<rdar://problem/48212062>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-02-20
Reviewed by Tim Horton.

  • wtf/URLHelpers.cpp:

(WTF::URLHelpers::userVisibleURL):

  • wtf/cocoa/NSURLExtras.mm:

(WTF::dataWithUserTypedString):

5:25 PM Changeset in webkit [241855] by Chris Dumez
  • 7 edits in trunk/Source/WebKit

[PSON] Make sure hung processes are not kept alive by suspended pages or process caching
https://bugs.webkit.org/show_bug.cgi?id=194881
<rdar://problem/48249014>

Reviewed by Geoffrey Garen.

After we construct a SuspendedPageProxy and before we send the IPC to the WebProcess to
ask it to suspend, start a 10 seconds timer. If the process does not answer the request
to suspend before the timer fires, we destroy the SuspendedPageProxy so that we do not
keep a hung process around.

For the WebProcessCache, we now call WebProcessProxy::isResponsive() on the process
before adding it to the cache. Internally, this relies on an IPC handshake with the
WebProcess. If the process is not responsive, we do not add it to the cache and we
shut it down. If it is responsive then we proceed normally with adding it to the
cache.

  • UIProcess/SuspendedPageProxy.cpp:

(WebKit::SuspendedPageProxy::SuspendedPageProxy):
(WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
(WebKit::SuspendedPageProxy::suspensionTimedOut):

  • UIProcess/SuspendedPageProxy.h:
  • UIProcess/WebProcessCache.cpp:

(WebKit::WebProcessCache::addProcessIfPossible):
(WebKit::WebProcessCache::addProcess):

  • UIProcess/WebProcessCache.h:
  • UIProcess/WebProcessProxy.cpp:

(WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
(WebKit::WebProcessProxy::maybeShutDown):
(WebKit::WebProcessProxy::isResponsive):

  • UIProcess/WebProcessProxy.h:
5:09 PM Changeset in webkit [241854] by Chris Dumez
  • 2 edits in trunk/Tools

Add API test for <rdar://problem/47471222>
https://bugs.webkit.org/show_bug.cgi?id=194847

Reviewed by Alex Christensen.

  • TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
4:51 PM Changeset in webkit [241853] by Chris Dumez
  • 2 edits in trunk/Source/WebKit

Unreviewed build fix after r241823.

  • UIProcess/SuspendedPageProxy.h:
4:48 PM Changeset in webkit [241852] by dino@apple.com
  • 7 edits
    16 deletes in trunk

Rotation animations sometimes use the wrong origin (affects apple.com)
https://bugs.webkit.org/show_bug.cgi?id=194878
<rdar://problem/43908047>

Reviewed by Simon Fraser.

Source/WebCore:

Some versions of CoreAnimation apply additive animations in reverse
order. Detect this and reverse the list of animations we provide.

Update the existing animations/additive-transform-animations.html test to
be a ref-test that would identify this failure. Previously it relied on
a pixel test.

  • platform/graphics/ca/GraphicsLayerCA.cpp: Use

HAVE_CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED to decide whether or
not to flip the list of animations (and mark the correct ones as
additive).

(WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):

Source/WTF:

  • wtf/Platform.h: Add HAVE(CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED).

LayoutTests:

Update an old pixel test to be a new ref test, and remove all the old platform-specific
-expected versions.

  • animations/additive-transform-animations-expected.png: Removed.
  • animations/additive-transform-animations.html:
  • legacy-animation-engine/animations/additive-transform-animations-expected.png: Removed.
  • legacy-animation-engine/animations/additive-transform-animations.html:
  • platform/gtk/animations/additive-transform-animations-expected.png: Removed.
  • platform/gtk/animations/additive-transform-animations-expected.txt: Removed.
  • platform/gtk/legacy-animation-engine/animations/additive-transform-animations-expected.png: Removed.
  • platform/gtk/legacy-animation-engine/animations/additive-transform-animations-expected.txt: Removed.
  • platform/ios/animations/additive-transform-animations-expected.txt: Removed.
  • platform/ios/legacy-animation-engine/animations/additive-transform-animations-expected.txt: Removed.
  • platform/mac/animations/additive-transform-animations-expected.txt: Removed.
  • platform/mac/legacy-animation-engine/animations/additive-transform-animations-expected.txt: Removed.
  • platform/win/animations/additive-transform-animations-expected.txt: Removed.
  • platform/win/legacy-animation-engine/animations/additive-transform-animations-expected.txt: Removed.
  • platform/wincairo/animations/additive-transform-animations-expected.txt: Removed.
  • platform/wincairo/legacy-animation-engine/animations/additive-transform-animations-expected.txt: Removed.
  • platform/wpe/animations/additive-transform-animations-expected.txt: Removed.
  • platform/wpe/legacy-animation-engine/animations/additive-transform-animations-expected.txt: Removed.
4:19 PM Changeset in webkit [241851] by don.olmstead@sony.com
  • 3 edits in trunk/Source/WebCore

[Win] Guard CF usage in RenderThemeWin
https://bugs.webkit.org/show_bug.cgi?id=194875

Reviewed by Alex Christensen.

No new tests. No change in behavior.

Add #if USE(CF) checks to RenderThemeWin so it can compile without CF support.

  • rendering/RenderThemeWin.cpp:

(WebCore::RenderThemeWin::stringWithContentsOfFile):
(WebCore::RenderThemeWin::mediaControlsStyleSheet):
(WebCore::RenderThemeWin::mediaControlsScript):

  • rendering/RenderThemeWin.h:
4:12 PM Changeset in webkit [241850] by achristensen@apple.com
  • 3 edits in trunk/Source/WebKit

Unreviewed, rolling out r241838.

Broke API tests

Reverted changeset:

"Resolve WebsiteDataStore/HTTPCookieStore ref cycle"
https://bugs.webkit.org/show_bug.cgi?id=194868
https://trac.webkit.org/changeset/241838

4:10 PM Changeset in webkit [241849] by mark.lam@apple.com
  • 9 edits in trunk/Source/JavaScriptCore

Add code to validate expected GC activity modelled by doesGC() against what the runtime encounters.
https://bugs.webkit.org/show_bug.cgi?id=193938
<rdar://problem/47616277>

Reviewed by Michael Saboff, Saam Barati, and Robin Morisset.

In DFG::SpeculativeJIT::compile() and FTL::LowerDFGToB3::compileNode(), before
emitting code / B3IR for each DFG node, we emit a write to set Heap::m_expectDoesGC
to the value returned by doesGC() for that node. In the runtime (i.e. in allocateCell()
and functions that can resolve a rope), we assert that Heap::m_expectDoesGC is
true.

This validation code is currently only enabled for debug builds. It is disabled
for release builds by default, but it can easily be made to run on release builds
as well by forcing ENABLE_DFG_DOES_GC_VALIDATION to 1 in Heap.h.

To allow this validation code to run on release builds as well, the validation uses
RELEASE_ASSERT instead of ASSERT.

To ensure that Heap.h is #include'd for all files that needs to do this validation
(so that the validation code is accidentally disabled), we guard the validation
code with an if conditional on constexpr bool validateDFGDoesGC (instead of using
a #if ENABLE(DFG_DOES_GC_VALIDATION)). This way, if Heap.h isn't #include'd, the
validation code will fail to build (no silent failures).

Currently, all JSC tests and Layout tests should pass with this validation enabled
in debug builds. We'll only see new failures if there's a regression or if new
tests reveal a previously untested code path that has an undetected issue.

  • dfg/DFGOSRExit.cpp:

(JSC::DFG::OSRExit::executeOSRExit):
(JSC::DFG::OSRExit::compileExit):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileNode):

  • ftl/FTLOSRExitCompiler.cpp:

(JSC::FTL::compileStub):

  • heap/Heap.h:

(JSC::Heap::expectDoesGC const):
(JSC::Heap::setExpectDoesGC):
(JSC::Heap::addressOfExpectDoesGC):

  • jit/JITArithmetic.cpp:

(JSC::JIT::emit_compareAndJump):

  • runtime/JSCellInlines.h:

(JSC::tryAllocateCellHelper):

  • runtime/JSString.h:

(JSC::jsSingleCharacterString):
(JSC::JSString::toAtomicString const):
(JSC::JSString::toExistingAtomicString const):
(JSC::JSString::value const):
(JSC::JSString::tryGetValue const):
(JSC::JSRopeString::unsafeView const):
(JSC::JSRopeString::viewWithUnderlyingString const):
(JSC::JSString::unsafeView const):

4:06 PM Changeset in webkit [241848] by rniwa@webkit.org
  • 3 edits in trunk/Source/WebCore

Crash in DOMWindowExtension::suspendForPageCache
https://bugs.webkit.org/show_bug.cgi?id=194871

Reviewed by Chris Dumez.

This is a speculative fix for a crash in DOMWindowExtension::suspendForPageCache.

We think it's possible for DOMWindowExtension::suspendForPageCache notifying the clients via
dispatchWillDisconnectDOMWindowExtensionFromGlobalObject to remove other DOMWindowExtension's.
Check that each DOMWindowProperty is still in m_properties before invoking suspendForPageCache
to avoid the crash.

  • page/DOMWindow.cpp:

(WebCore::DOMWindow::willDestroyCachedFrame):
(WebCore::DOMWindow::willDestroyDocumentInFrame):
(WebCore::DOMWindow::willDetachDocumentFromFrame):
(WebCore::DOMWindow::suspendForPageCache):
(WebCore::DOMWindow::resumeFromPageCache):

  • page/DOMWindowExtension.cpp:

(WebCore::DOMWindowExtension::suspendForPageCache):

4:03 PM Changeset in webkit [241847] by ysuzuki@apple.com
  • 15 edits in trunk/Source/bmalloc

[bmalloc] bmalloc::Heap is allocated even though we use system malloc mode
https://bugs.webkit.org/show_bug.cgi?id=194836

Reviewed by Mark Lam.

Previously, bmalloc::Heap holds DebugHeap, and delegates allocation and deallocation to debug heap.
However, bmalloc::Heap is large. We would like to avoid initialization of bmalloc::Heap under the
system malloc mode.

This patch extracts out DebugHeap from bmalloc::Heap, and logically puts this in a boundary of
bmalloc::api. bmalloc::api delegates allocation and deallocation to DebugHeap if DebugHeap is enabled.
Otherwise, using bmalloc's usual mechanism. The challenge is that we would like to keep bmalloc fast
path fast.

  1. For IsoHeaps, we use the similar techniques done in Cache. If the debug mode is enabled, we always go to the slow path of the IsoHeap allocation, and keep IsoTLS::get() returning nullptr. In the slow path, we just fallback to the usual bmalloc::api::tryMalloc implementation. This is efficient because bmalloc continues using the fast path.
  1. For the other APIs, like freeLargeVirtual, we just put DebugHeap check because this API itself takes fair amount of time. Then debug heap check does not matter.
  • bmalloc/Allocator.cpp:

(bmalloc::Allocator::reallocateImpl):

  • bmalloc/Cache.cpp:

(bmalloc::Cache::tryAllocateSlowCaseNullCache):
(bmalloc::Cache::allocateSlowCaseNullCache):
(bmalloc::Cache::deallocateSlowCaseNullCache):
(bmalloc::Cache::tryReallocateSlowCaseNullCache):
(bmalloc::Cache::reallocateSlowCaseNullCache):
(): Deleted.
(bmalloc::debugHeap): Deleted.

  • bmalloc/DebugHeap.cpp:
  • bmalloc/DebugHeap.h:

(bmalloc::DebugHeap::tryGet):

  • bmalloc/Heap.cpp:

(bmalloc::Heap::Heap):
(bmalloc::Heap::footprint):
(bmalloc::Heap::tryAllocateLarge):
(bmalloc::Heap::deallocateLarge):

  • bmalloc/Heap.h:

(bmalloc::Heap::debugHeap): Deleted.

  • bmalloc/IsoTLS.cpp:

(bmalloc::IsoTLS::IsoTLS):
(bmalloc::IsoTLS::isUsingDebugHeap): Deleted.
(bmalloc::IsoTLS::debugMalloc): Deleted.
(bmalloc::IsoTLS::debugFree): Deleted.

  • bmalloc/IsoTLS.h:
  • bmalloc/IsoTLSInlines.h:

(bmalloc::IsoTLS::allocateSlow):
(bmalloc::IsoTLS::deallocateSlow):

  • bmalloc/ObjectType.cpp:

(bmalloc::objectType):

  • bmalloc/ObjectType.h:
  • bmalloc/Scavenger.cpp:

(bmalloc::Scavenger::Scavenger):

  • bmalloc/bmalloc.cpp:

(bmalloc::api::tryLargeZeroedMemalignVirtual):
(bmalloc::api::freeLargeVirtual):
(bmalloc::api::scavenge):
(bmalloc::api::isEnabled):
(bmalloc::api::setScavengerThreadQOSClass):
(bmalloc::api::commitAlignedPhysical):
(bmalloc::api::decommitAlignedPhysical):
(bmalloc::api::enableMiniMode):

3:34 PM Changeset in webkit [241846] by Wenson Hsieh
  • 5 edits in trunk/Source/WebKit

REGRESSION: [ iOS ] Layout Test editing/input/ios/rtl-keyboard-input-on-focus.html is a Timeout
https://bugs.webkit.org/show_bug.cgi?id=194601
<rdar://problem/48080316>

Reviewed by Tim Horton.

Following r241311, if a web view becomes first responder and is then moved offscreen (or obscured, hidden, or in
the case of WebKitTestRunner, its UIWindow loses its status as keyWindow), we end up holding on to the input
view update deferral token indefinitely, waiting for the current focused element to be blurred or refocused.

This also manifests other user-facing bugs, the most common of which is the keyboard occasionally remaining
onscreen after typing a URL in the unified field in MobileSafari and hitting Return, in the case where there is
no autofocused element on the page.

To fix this, when becoming the first responder, additionally install a callback to detect when the page is
finished handling the activity state change, and invalidate the input deferral token then. This retains the
behavior where calling -becomeFirstResponder on the web view while a different view is focused will keep the
keyboard stable, since the focused element message from the web process should be dispatched when handling the
activity state change within the web process.

Of course, the web process may not be responsive at all while the web view is still in the view hierarchy, in
which case we may still end up deferring input view updates indefinitely. In this case, we maintain a separate
watchdog timer with a short delay, after which we unconditionally invalidate the token.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):

Move the implementation of installActivityStateChangeCompletionHandler into cross-platform code.

  • UIProcess/WebPageProxy.h:
  • UIProcess/ios/WKContentView.mm:
  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView cleanupInteraction]):
(-[WKContentView _cancelPreviousResetInputViewDeferralRequest]):
(-[WKContentView _scheduleResetInputViewDeferralAfterBecomingFirstResponder]):
(-[WKContentView _resetInputViewDeferral]):
(-[WKContentView becomeFirstResponderForWebView]):
(-[WKContentView resignFirstResponderForWebView]):
(-[WKContentView _commitPotentialTapFailed]):
(-[WKContentView _didNotHandleTapAsClick:]):
(-[WKContentView _didCompleteSyntheticClick]):

Funnel all existing calls that reset _inputViewDeferralToken to nullptr, such that they go through a helper
method instead that also cancels any scheduled requests to clear the token.

  • WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:

(WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):

Respond to all pending callbacks after handling the activity state change.

3:30 PM Changeset in webkit [241845] by Chris Dumez
  • 5 edits in trunk

Regression(PSON) "Reload without content extensions" does not work when the main resource is blocked
https://bugs.webkit.org/show_bug.cgi?id=194872
<rdar://problem/47924500>

Reviewed by Alex Christensen.

Source/WebKit:

[WKWebView _reloadWithoutContentBlockers] relies on a ReloadOption flag that is passed to WebCore
instead of using WebsitePolicies.contentBlockersEnabled flag. If the reload causes a process swap
due to PSON, then the new process does not know about this ReloadOption and fails to honor it.

Since the modern way to do this is WebsitePolicies, and since WebsitePolicies are properly
propagated cross-process in case of process swap, this patch updates _reloadWithoutContentBlockers
to set a flag on the Navigation which we use to later set the WebsitePolicies.contentBlockersEnabled
flag in WebPageProxy::receivedNavigationPolicyDecision().

  • UIProcess/API/APINavigation.h:

(API::Navigation::setUserContentExtensionsEnabled):
(API::Navigation::userContentExtensionsEnabled const):

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::reload):
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):

Tools:

Add API test coverage.

  • TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
3:26 PM Changeset in webkit [241844] by Truitt Savell
  • 2 edits in trunk/Source/WebKit

Unreviewed, rolling out r241817.

Caused 4 API failures

Reverted changeset:

"[GTK] Epiphany searching for plugins even if plugins are
disabled"
https://bugs.webkit.org/show_bug.cgi?id=194352
https://trac.webkit.org/changeset/241817

3:25 PM WebKitGTK/2.24.x edited by Adrian Perez de Castro
(diff)
3:25 PM Changeset in webkit [241843] by jer.noble@apple.com
  • 1 edit
    1 add in trunk/Tools

Add a git utility method that allows the caller to determine if a specific commitish is within a specified range of commits.
https://bugs.webkit.org/show_bug.cgi?id=191332

Reviewed by Dean Jackson.

  • Scripts/git-is-in-range: Added.
3:21 PM WebKitGTK/StableRelease edited by Adrian Perez de Castro
(diff)
2:52 PM Changeset in webkit [241842] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebCore

Always call CompletionHandlers after r240909
https://bugs.webkit.org/show_bug.cgi?id=194823

Patch by Alex Christensen <achristensen@webkit.org> on 2019-02-20
Reviewed by Ryosuke Niwa.

  • loader/PolicyChecker.cpp:

(WebCore::PolicyChecker::checkNavigationPolicy):
(WebCore::PolicyChecker::checkNewWindowPolicy):

2:37 PM Changeset in webkit [241841] by aestes@apple.com
  • 25 edits in trunk

[Xcode] Add SDKVariant.xcconfig to various Xcode projects
https://bugs.webkit.org/show_bug.cgi?id=194869

Rubber-stamped by Jer Noble.

Source/bmalloc:

  • bmalloc.xcodeproj/project.pbxproj:

Source/JavaScriptCore:

Source/ThirdParty/ANGLE:

  • ANGLE.xcodeproj/project.pbxproj:

Source/ThirdParty/libwebrtc:

  • libwebrtc.xcodeproj/project.pbxproj:

Source/WebCore:

  • WebCore.xcodeproj/project.pbxproj:

Source/WebInspectorUI:

  • WebInspectorUI.xcodeproj/project.pbxproj:

Source/WebKit:

  • WebKit.xcodeproj/project.pbxproj:

Source/WebKitLegacy:

  • WebKitLegacy.xcodeproj/project.pbxproj:

Source/WTF:

  • WTF.xcodeproj/project.pbxproj:

Tools:

  • DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
  • ImageDiff/ImageDiff.xcodeproj/project.pbxproj:
  • MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj:
  • MobileMiniBrowser/MobileMiniBrowser.xcodeproj/project.pbxproj:
  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
2:28 PM Changeset in webkit [241840] by commit-queue@webkit.org
  • 5 edits
    2 adds in trunk

drawImage() clears the canvas if it's the source of the image and globalCompositeOperation is "copy"
https://bugs.webkit.org/show_bug.cgi?id=194746

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-02-20
Reviewed by Dean Jackson.

Source/WebCore:

Test: fast/canvas/canvas-drawImage-composite-copy.html

If the source canvas of drawImage() is the same as the destination and
globalCompositeOperation is set to "copy", copy the srcRect from the
canvas to a temporary buffer before calling clearCanvas() then drawImage
from this temporary buffer.

  • html/canvas/CanvasRenderingContext2DBase.cpp:

(WebCore::CanvasRenderingContext2DBase::drawImage):

  • platform/graphics/ImageBuffer.cpp:

(WebCore::ImageBuffer::copyRectToBuffer):

  • platform/graphics/ImageBuffer.h:

LayoutTests:

  • fast/canvas/canvas-drawImage-composite-copy-expected.html: Added.
  • fast/canvas/canvas-drawImage-composite-copy.html: Added.
2:25 PM Changeset in webkit [241839] by Jon Davis
  • 2 edits in trunk/Websites/webkit.org

Added macOS Mojave builds to the WebKit Build Archives.
https://bugs.webkit.org/show_bug.cgi?id=190908

Reviewed by Lucas Forschler.

  • wp-content/themes/webkit/build-archives.php:
2:22 PM Changeset in webkit [241838] by commit-queue@webkit.org
  • 3 edits in trunk/Source/WebKit

Resolve WebsiteDataStore/HTTPCookieStore ref cycle
https://bugs.webkit.org/show_bug.cgi?id=194868

Patch by Alex Christensen <achristensen@webkit.org> on 2019-02-20
Reviewed by Geoffrey Garen.

  • UIProcess/API/APIHTTPCookieStore.cpp:

(API::HTTPCookieStore::HTTPCookieStore):
(API::HTTPCookieStore::cookies):
(API::HTTPCookieStore::setCookie):
(API::HTTPCookieStore::deleteCookie):
(API::HTTPCookieStore::registerObserver):
(API::HTTPCookieStore::unregisterObserver):
(API::HTTPCookieStore::cookieManagerDestroyed):
(API::HTTPCookieStore::registerForNewProcessPoolNotifications):
(API::HTTPCookieStore::ref const):
(API::HTTPCookieStore::deref const):

  • UIProcess/API/APIHTTPCookieStore.h:
2:22 PM Changeset in webkit [241837] by ysuzuki@apple.com
  • 5 edits in trunk/Source/bmalloc

[bmalloc] DebugHeap::malloc does not have "try" version.
https://bugs.webkit.org/show_bug.cgi?id=194837

Reviewed by Mark Lam.

Since DebugHeap::malloc does not have "try" version, our tryAllocate implementation does not work well with DebugHeap.
This patch adds crashOnFailure flag to DebugHeap::malloc.

  • bmalloc/Cache.cpp:

(bmalloc::Cache::tryAllocateSlowCaseNullCache):
(bmalloc::Cache::allocateSlowCaseNullCache):

  • bmalloc/DebugHeap.cpp:

(bmalloc::DebugHeap::malloc):

  • bmalloc/DebugHeap.h:
  • bmalloc/IsoTLS.cpp:

(bmalloc::IsoTLS::debugMalloc):

2:22 PM Changeset in webkit [241836] by Truitt Savell
  • 2 edits in trunk/LayoutTests

[ Mac WK2 ] REGRESSION (r231450) Layout Test http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe-with-enforced-and-report-policies.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=194350

Unreviewed test gardening.

Patch by Shawn Roberts <Shawn Roberts> on 2019-02-20

  • platform/mac-wk2/TestExpectations: Marking as flaky until a fix lands
2:04 PM Changeset in webkit [241835] by Truitt Savell
  • 2 edits in trunk/LayoutTests

[ Mac WK1 ] REGRESSION (r230006) Layout Test media/modern-media-controls/compact-media-controls/compact-media-controls-layout.html is a flaky text diff failure
https://bugs.webkit.org/show_bug.cgi?id=194309

Unreviewed test gardening.

Patch by Shawn Roberts <Shawn Roberts> on 2019-02-20

  • platform/mac-wk1/TestExpectations: Marking as flaky until a fix lands
1:49 PM Changeset in webkit [241834] by Truitt Savell
  • 3 edits in trunk/LayoutTests

[ Mac WK2 iOS Debug ] REGRESSION (r240713) Layout Test scrollingcoordinator/scrolling-tree/fixed-inside-frame.html is flaky failure
https://bugs.webkit.org/show_bug.cgi?id=194253

Unreviewed test gardening.

Patch by Shawn Roberts <Shawn Roberts> on 2019-02-20

  • platform/ios-wk2/TestExpectations: Marking as flaky until a fix lands
  • platform/mac-wk2/TestExpectations: ditto
1:38 PM Changeset in webkit [241833] by dbates@webkit.org
  • 2 edits in trunk/Source/WebCore/PAL

Attempt to fix the Apple Internal build following r241828
(https://trac.webkit.org/changeset/241828/webkit)

Conditionally include a private header.

  • pal/spi/ios/UIKitSPI.h:
1:30 PM Changeset in webkit [241832] by ysuzuki@apple.com
  • 8 edits in trunk/Source/bmalloc

[bmalloc] bmalloc::Cache should not be instantiated if we are using system malloc
https://bugs.webkit.org/show_bug.cgi?id=194811

Reviewed by Mark Lam.

bmalloc::Cache is very large. It is 13KB. Since it exists per HeapKind, it takes 40KB.
But this is meaningless if we are under the system malloc mode by using "Malloc=1". We
found that it continues using so much dirty memory region even under the system malloc mode.
This patch avoids instantiation of bmalloc::Cache under the system malloc mode.

  • bmalloc/Allocator.cpp:

(bmalloc::Allocator::Allocator):
(bmalloc::Allocator::tryAllocate):
(bmalloc::Allocator::allocateImpl):
(bmalloc::Allocator::reallocateImpl):
(bmalloc::Allocator::allocateSlowCase):
Allocator is a per Cache object. So we no longer need to keep m_debugHeap. If debug heap is enabled,
Allocator is never created.

  • bmalloc/Allocator.h:
  • bmalloc/Cache.cpp:

(bmalloc::debugHeap):
(bmalloc::Cache::Cache):
(bmalloc::Cache::tryAllocateSlowCaseNullCache):
(bmalloc::Cache::allocateSlowCaseNullCache):
(bmalloc::Cache::deallocateSlowCaseNullCache):
(bmalloc::Cache::tryReallocateSlowCaseNullCache):
(bmalloc::Cache::reallocateSlowCaseNullCache):

  • bmalloc/Cache.h:

(bmalloc::Cache::tryAllocate):
(bmalloc::Cache::tryReallocate):
If the debug heap mode is enabled, we keep Cache::getFast() returning nullptr. And in the slow path case, we use debugHeap.
This makes bmalloc fast path fast, while we avoid Cache instantiation.

  • bmalloc/Deallocator.cpp:

(bmalloc::Deallocator::Deallocator):
(bmalloc::Deallocator::scavenge):
(bmalloc::Deallocator::deallocateSlowCase):

  • bmalloc/Deallocator.h:

Ditto for Deallocator.

  • bmalloc/bmalloc.cpp:

(bmalloc::api::isEnabled):
We used getFastCase() for Heap. But it is basically wrong since we do not have any guarantee that someone already initializes
Heap when this is called. Previously, luckily, Cache is initialized, and Cache initialized Heap. But Cache initialization is removed
for system malloc mode and now PerProcess<PerHeapKind<Heap>>::getFastCase() returns nullptr at an early phase. This patch just uses
Environment::isDebugHeapEnabled() instead.

1:24 PM Changeset in webkit [241831] by Truitt Savell
  • 2 edits in trunk/LayoutTests

[ Mac WK2 ] REGRESSION (r239333) Flaky ASSERTION FAILED: m_uncommittedState.state == State::Committed on http/tests/cookies/same-site/fetch-after-top-level-navigation-from-cross-origin-page.html
https://bugs.webkit.org/show_bug.cgi?id=194225

Unreviewed test gardening.

Patch by Shawn Roberts <Shawn Roberts> on 2019-02-20

  • platform/mac-wk2/TestExpectations: Marking as flaky while waiting for fix to land
1:08 PM Changeset in webkit [241830] by Simon Fraser
  • 2 edits in trunk/Source/WebCore

REGRESSION (r241788>): ASSERTION FAILED: !m_normalFlowListDirty in TestWebKitAPI.WebKit.ResizeReversePaginatedWebView test
https://bugs.webkit.org/show_bug.cgi?id=194866

Reviewed by Antti Koivisto.

r241788 removed some calls that updated layer lists (normal flow and z-order) during compositing updates, causing
a later call to RenderLayerCompositor::recursiveRepaintLayer() to assert when the lists were dirty. Fix by updating
the lists in RenderLayerCompositor::recursiveRepaintLayer(), as we do in various other places.

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::recursiveRepaintLayer):

12:27 PM Changeset in webkit [241829] by pvollan@apple.com
  • 2 edits in trunk/Source/WebKit

[iOS] Open sandbox for specific call.
https://bugs.webkit.org/show_bug.cgi?id=194860
<rdar://problem/48166729>

Reviewed by Brent Fulgham.

  • Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
12:25 PM Changeset in webkit [241828] by dbates@webkit.org
  • 6 edits in trunk/Source/WebCore

[iOS] Tweak UI for focus rings
https://bugs.webkit.org/show_bug.cgi?id=194864
<rdar://problem/47831886>

Reviewed by Brent Fulgham.

Source/WebCore:

Make use of UIKit constants to make focus rings pretty.

  • platform/graphics/cocoa/GraphicsContextCocoa.mm:

(WebCore::drawFocusRingAtTime):

Source/WebCore/PAL:

Expose more SPI.

  • pal/ios/UIKitSoftLink.h:
  • pal/ios/UIKitSoftLink.mm:
  • pal/spi/ios/UIKitSPI.h:
11:56 AM Changeset in webkit [241827] by Truitt Savell
  • 2 edits in trunk/LayoutTests

[ Mac WK2 ] REGRESSION (r238519) Layout Test fast/repaint/placeholder-after-caps-lock-hidden.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=194170

Unreviewed test gardening.

Patch by Shawn Roberts <Shawn Roberts> on 2019-02-20

  • platform/mac-wk2/TestExpectations: Marking as flaky while waiting for fix to land
11:43 AM Changeset in webkit [241826] by achristensen@apple.com
  • 7 edits in trunk/Source/WebKit

Move API::HTTPCookieStore ownership from API::WebsiteDataStore to WebKit::WebsiteDataStore
https://bugs.webkit.org/show_bug.cgi?id=194842

Reviewed by Geoff Garen.

We need a way to get from WebKit::WebsiteDataStore to API::HTTPCookieStore. It can't be done before this.
This made an existing reference cycle easier to see, and we should fix it in a followup patch.

  • UIProcess/API/APIWebsiteDataStore.cpp:

(API::WebsiteDataStore::httpCookieStore):

  • UIProcess/API/APIWebsiteDataStore.h:
  • UIProcess/WebsiteData/WebsiteDataStore.cpp:

(WebKit::WebsiteDataStore::cookieStore):

  • UIProcess/WebsiteData/WebsiteDataStore.h:
11:28 AM Changeset in webkit [241825] by timothy@apple.com
  • 15 edits in trunk

RenderThemeIOS should use RenderTheme's color cache instead of its own.
https://bugs.webkit.org/show_bug.cgi?id=194822
rdar://problem/48208296

Reviewed by Tim Horton.

Source/WebCore:

Tested by fast/css/apple-system-colors.html.

  • css/CSSValueKeywords.in:
  • css/parser/CSSPropertyParser.cpp:

(WebCore::isAppleLegacyCssValueKeyword):

  • platform/graphics/Color.h:
  • platform/graphics/cg/ColorCG.cpp:

(WebCore::makeRGBAFromCGColor):
(WebCore::Color::Color):

  • rendering/RenderThemeIOS.h:
  • rendering/RenderThemeIOS.mm:

(WebCore::RenderThemeIOS::systemColor const):

  • rendering/RenderThemeMac.mm:

(WebCore::RenderThemeMac::systemColor const):

Source/WebCore/PAL:

  • pal/ios/UIKitSoftLink.h:
  • pal/ios/UIKitSoftLink.mm:
  • pal/spi/ios/UIKitSPI.h:

LayoutTests:

  • platform/ios/fast/css/apple-system-colors-expected.txt: Rebased for -apple-system-purple.
  • platform/win/fast/css/apple-system-colors-expected.txt: Rebased for invalid color now

that -apple-system colors are macOS and iOS only.

11:23 AM Changeset in webkit [241824] by commit-queue@webkit.org
  • 8 edits
    4 adds in trunk

Fix crash when opening Web Inspector after a WebSocket was blocked by content extensions
https://bugs.webkit.org/show_bug.cgi?id=194819

Patch by Loïc Yhuel <loic.yhuel@softathome.com> on 2019-02-20
Reviewed by Joseph Pecoraro.

Source/WebCore:

Test: http/tests/inspector/network/contentextensions/blocked-websocket-crash.html

  • Modules/websockets/WebSocketChannel.h:

(WebCore::WebSocketChannel::hasCreatedHandshake):

  • inspector/agents/page/PageNetworkAgent.cpp:

Ignore WebSocketChannel without an WebSocketHandshake, which would crash in InspectorNetworkAgent::enable.

LayoutTests:

  • TestExpectations: Skip the test by default, like http/tests/contentextensions
  • http/tests/inspector/network/contentextensions/blocked-websocket-crash-expected.txt: Added.
  • http/tests/inspector/network/contentextensions/blocked-websocket-crash.html: Added.
  • http/tests/inspector/network/contentextensions/blocked-websocket-crash.html.json: Added.
  • platform/gtk/TestExpectations: Unskip the test
  • platform/mac-wk2/TestExpectations: Ditto
  • platform/wpe/TestExpectations: Ditto
11:19 AM Changeset in webkit [241823] by Chris Dumez
  • 7 edits in trunk

Regression(PSON) Crash under WebKit::WebPageProxy::decidePolicyForNavigationActionSync
https://bugs.webkit.org/show_bug.cgi?id=194857
<rdar://problem/47759323>

Reviewed by Alex Christensen.

Source/WebKit:

The ProvisionalPageProxy was blindly forwarding the DecidePolicyForNavigationActionSync
synchronous IPC to the WebPageProxy, without passing it the process the IPC came from.
As a result, WebPageProxy::decidePolicyForNavigationActionSync() would try to look up
a WebFrameProxy using the provided frameID from the wrong process and we would end up
hitting a RELEASE_ASSERT().

  • UIProcess/ProvisionalPageProxy.cpp:

(WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
(WebKit::ProvisionalPageProxy::didReceiveSyncMessage):

  • UIProcess/ProvisionalPageProxy.h:
  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
(WebKit::WebPageProxy::decidePolicyForNavigationActionSyncShared):

  • UIProcess/WebPageProxy.h:

Tools:

Add API test coverage.

  • TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
11:15 AM Changeset in webkit [241822] by Alan Bujtas
  • 6 edits in trunk/Source/WebCore

[LFC][Floats] Make FloatAvoider::resetPosition implicit
https://bugs.webkit.org/show_bug.cgi?id=194855

Reviewed by Antti Koivisto.

Let's compute the initial top/left position during c'tor time.
This is in preparation for fixing formatting root box placement in a float context.

  • layout/floats/FloatAvoider.cpp:

(WebCore::Layout::FloatAvoider::resetPosition): Deleted.

  • layout/floats/FloatAvoider.h:

(WebCore::Layout::FloatAvoider::displayBox):
(WebCore::Layout::FloatAvoider::initialVerticalPosition const): Deleted.

  • layout/floats/FloatBox.cpp:

(WebCore::Layout::FloatBox::FloatBox):
(WebCore::Layout::FloatBox::initialVerticalPosition const):

  • layout/floats/FloatBox.h:
  • layout/floats/FloatingContext.cpp:

(WebCore::Layout::FloatingContext::floatingPosition const):

10:34 AM Changeset in webkit [241821] by Chris Dumez
  • 5 edits in trunk/Tools

[WKTR] Avoid starting new NetworkProcesses unnecessarily when running the layout tests
https://bugs.webkit.org/show_bug.cgi?id=194829
<rdar://problem/47889906>

Reviewed by Alexey Proskuryakov.

Every time the TestOptions were changing we were creating both a new Web view and
a new WKContext, which would start a new Network process. In most cases, we only
need to contruct a new Web view and we do can keep reusing the same WKContext.
This patch implements this optimization and thus avoids spinning a lot of new
Network processes while running the layout tests.

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::generateContextConfiguration const):
(WTR::TestController::generatePageConfiguration):
(WTR::TestController::createWebViewWithOptions):
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):

  • WebKitTestRunner/TestController.h:
  • WebKitTestRunner/TestOptions.h:

(WTR::TestOptions::ContextOptions::hasSameInitializationOptions const):
(WTR::TestOptions::ContextOptions::shouldEnableProcessSwapOnNavigation const):
(WTR::TestOptions::hasSameInitializationOptions const):
(WTR::TestOptions::shouldEnableProcessSwapOnNavigation const): Deleted.

  • WebKitTestRunner/cocoa/TestControllerCocoa.mm:

(WTR::TestController::platformAddTestOptions const):

10:23 AM Changeset in webkit [241820] by don.olmstead@sony.com
  • 4 edits in trunk/Source

[MSVC] Fix compilation errors with lambdas in Service Workers
https://bugs.webkit.org/show_bug.cgi?id=194841

Reviewed by Alex Christensen.

Source/WebCore:

No new tests. No change in behavior.

MSVC has problems with the scoping of this within a nested lambda. In these cases this is
referring to the enclosing lambda according to MSVC. This patch works around this behavior
through by using the protectedThis pattern in WebKit code.

  • workers/service/server/RegistrationDatabase.cpp:

(WebCore::RegistrationDatabase::openSQLiteDatabase):

Source/WebKit:

  • WebProcess/Storage/ServiceWorkerClientFetch.cpp:

(WebKit::ServiceWorkerClientFetch::didReceiveRedirectResponse):

10:15 AM Changeset in webkit [241819] by commit-queue@webkit.org
  • 3 edits in trunk/LayoutTests

REGRESSION (r240727) [ Mac iOS ] Layout Test http/tests/workers/service/basic-register-exceptions.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=194368

Unreviewed test gardening.

Patch by Shawn Roberts <Shawn Roberts> on 2019-02-20

  • platform/ios-simulator-wk2/TestExpectations: Updating test expectations while waiting for a fix
  • platform/mac-wk2/TestExpectations: ditto
10:05 AM Changeset in webkit [241818] by commit-queue@webkit.org
  • 7 edits in trunk/Source/bmalloc

Unreviewed, rolling out r241789.
https://bugs.webkit.org/show_bug.cgi?id=194856

GuardMalloc crashes (Requested by yusukesuzuki on #webkit).

Reverted changeset:

"[bmalloc] bmalloc::Cache should not be instantiated if we are
using system malloc"
https://bugs.webkit.org/show_bug.cgi?id=194811
https://trac.webkit.org/changeset/241789

9:11 AM Changeset in webkit [241817] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebKit

[GTK] Epiphany searching for plugins even if plugins are disabled
https://bugs.webkit.org/show_bug.cgi?id=194352

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2019-02-20
Reviewed by Michael Catanzaro.

Check pluginsEnabled setting before trying to get plugins from UI process.

  • WebProcess/Plugins/WebPluginInfoProvider.cpp:

(WebKit::WebPluginInfoProvider::populatePluginCache):

6:34 AM Changeset in webkit [241816] by Carlos Garcia Campos
  • 7 edits in trunk/Source/WebKit

[WPE] Send client host fd and library name as web process creation parameters
https://bugs.webkit.org/show_bug.cgi?id=194494

Reviewed by Žan Doberšek.

Instead of using command line arguments. The code is simpler and we don't need wpe specific code in process
launcher glib implementation.

  • Shared/WebProcessCreationParameters.cpp:

(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):

  • Shared/WebProcessCreationParameters.h:
  • UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:

(WebKit::ProcessLauncher::launchProcess):

  • UIProcess/glib/WebProcessPoolGLib.cpp:

(WebKit::WebProcessPool::platformInitializeWebProcess):

  • WebProcess/glib/WebProcessGLib.cpp:

(WebKit::WebProcess::platformInitializeWebProcess):

  • WebProcess/wpe/WebProcessMainWPE.cpp:
5:10 AM Changeset in webkit [241815] by Carlos Garcia Campos
  • 1 copy in releases/WebKitGTK/webkit-2.23.91

WebKitGTK 2.23.91

5:09 AM Changeset in webkit [241814] by Carlos Garcia Campos
  • 4 edits in releases/WebKitGTK/webkit-2.24

Unreviewed. Update OptionsGTK.cmake and NEWS for 2.23.91 release

.:

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

Source/WebKit:

  • gtk/NEWS: Add release notes for 2.23.91.
4:45 AM Changeset in webkit [241813] by Carlos Garcia Campos
  • 30 edits
    4 adds in releases/WebKitGTK/webkit-2.24

Merge r241790 - [WPE][GTK] Enable support for CONTENT_EXTENSIONS
https://bugs.webkit.org/show_bug.cgi?id=167941

Reviewed by Carlos Garcia Campos.

Source/WebCore:

  • platform/gtk/po/POTFILES.in: Added WebKitUserContentFilterStore.cpp

to the list of files with translatable strings.

Source/WebKit:

Adds new API to manage a collection of content extensions on disk (including compilation
of new ones) using WebKitUserContentFilterStore; the associated WebKitUserContentFilter
type (which represents a compiled content extension); and the functions needed to enable
and disable them for a given WebKitUserContentManager.

The WebKitUserContentFilterStore public API is expressed in abstract terms of "saving"
filters into the store (which involves compiling the JSON source rule set); and "loading"
them back as main operations. This way we do not disclose to users of the API any detail
about compilation, nor how contents are laid out on disk, and the documentation explicitly
tells about only using the provided functions to manipulate the on-disk contents. This
way we allow ourselves some leeway if the implementation needs changing in the future.

  • PlatformGTK.cmake: Added WebKitUserContentFilterStore.h to the list of public API headers.
  • PlatformWPE.cmake: Ditto.
  • SourcesGTK.txt: Added WebKitUserContentFilterStore.cpp
  • SourcesWPE.txt: Ditto.
  • UIProcess/API/glib/WebKitError.cpp: Add definition of webkit_user_content_filter_error_quark().
  • UIProcess/API/glib/WebKitUserContent.cpp: Added WebKitUserContentFilter.

(_WebKitUserContentFilter::_WebKitUserContentFilter):
(webkit_user_content_filter_ref):
(webkit_user_content_filter_unref):
(webkit_user_content_filter_get_identifier):
(webkitUserContentFilterCreate):
(webkitUserContentFilterGetContentRuleList):

  • UIProcess/API/glib/WebKitUserContentFilterStore.cpp: Added.

(toGError): Utility function to convert content extension error codes to GError.
(webkit_user_content_filter_store_class_init):
(webkit_user_content_filter_store_new):
(webkit_user_content_filter_store_get_path):
(webkitUserContentFilterStoreSaveBytes): Common function used as final step for all the
functions which save (compile) JSON rule sets into the store, to avoid duplicating code.
(webkit_user_content_filter_store_save):
(webkit_user_content_filter_store_save_finish):
(webkit_user_content_filter_store_save_from_file):
(webkit_user_content_filter_store_save_from_file_finish):
(webkit_user_content_filter_store_remove):
(webkit_user_content_filter_store_remove_finish):
(webkit_user_content_filter_store_load):
(webkit_user_content_filter_store_lookup_finish):
(webkit_user_content_filter_store_fetch_identifiers):
(webkit_user_content_filter_store_fetch_identifiers_finish):

  • UIProcess/API/glib/WebKitUserContentManager.cpp: Added definitions for the new API

functions to add and remove filters from an user content manager.
(webkit_user_content_manager_add_filter):
(webkit_user_content_manager_remove_filter):
(webkit_user_content_manager_remove_all_filters):

  • UIProcess/API/glib/WebKitUserContentPrivate.h: Added declarations for

webkitUserContentFilterCreate() and webkitUserContentFilterGetContentRuleList().

  • UIProcess/API/gtk/WebKitAutocleanups.h: Added autocleanups for WebKitUserContentFilter

and WebKitUserContentFilterStore.

  • UIProcess/API/gtk/WebKitError.h: Added declarations for WEBKIT_USER_CONTENT_FILTER_ERROR

plus the associated webkit_user_content_filter_error_quark() function and
WebKitUserContentFilterErrror enum.

  • UIProcess/API/gtk/WebKitUserContent.h: Added declarations for WebKitUserContentFilter

and its associated functions.

  • UIProcess/API/gtk/WebKitUserContentFilterStore.h: Added.
  • UIProcess/API/gtk/WebKitUserContentManager.h: Added declarations for the functions to

add and remove filters from the user content manager.

  • UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Added new API functions and types to

be included in the documentation.

  • UIProcess/API/gtk/webkit2.h: Added inclusion of WebKitUserContentFilterStore.h
  • UIProcess/API/wpe/WebKitError.h: Same as for the GTK port header.
  • UIProcess/API/wpe/WebKitUserContent.h: Same as for the GTK port header.
  • UIProcess/API/wpe/WebKitUserContentFilterStore.h: Added.
  • UIProcess/API/wpe/WebKitUserContentManager.h: Same as for the GTK port header.
  • UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Added new API functions and types to be

included in the documentation.

  • UIProcess/API/wpe/webkit.h: Added inclusion of WebKitUserContentFilterStore.h

Source/WTF:

Add specialization of the refGPtr() and derefGPtr() templates for GMappedFile.

  • wtf/glib/GRefPtr.cpp:

(WTF::refGPtr): Added.
(WTF::derefGPtr): Added.

  • wtf/glib/GRefPtr.h: Declare template specializations.

Tools:

  • MiniBrowser/gtk/main.c:

(filterSavedCallback): Added.
(main): Support loading a JSON rule set file for content filtering.

  • MiniBrowser/wpe/main.cpp:

(filterSavedCallback): Added.
(main): Support loading a JSON rule set file for content filtering.

  • TestWebKitAPI/Tests/WebKitGLib/TestWebKitUserContentFilterStore.cpp: Added.

(WTF::refGPtr): Added locally for WebKitUserContentFilter, as it would not be used anywhere else.
(WTF::derefGPtr): Ditto.
(testEmptyStore):
(testSaveInvalidFilter):
(testSaveLoadFilter):
(testSavedFilterIdentifierMatch):
(testRemoveFilter):
(testSaveMultipleFilters):
(testSaveFilterFromFile):
(testFilterPersistence):
(beforeAll):
(afterAll):

  • TestWebKitAPI/Tests/WebKitGLib/TestWebKitUserContentManager.cpp:

(removeOldInjectedContentAndResetLists): Also reset content filters.
(isCSSBlockedForURLAtPath): Added. Tests whether the test filter, which blocks a
CSS style sheet, has blocked the load of the CSS by looking at the resulting style of
the element affected by the style sheet.
(getUserContentFilter): Added. Stores the test filter in a WebKitUserContentFilterStore
and returns it to be used by tests.
(testUserContentManagerContentFilter): Added. Tests whether adding and removing a filter
from the WebKitUserContentManager results in the a CSS style sheet being blocked.
(serverCallback): Add support for serving a CSS style sheet for testing.
(beforeAll): Add call to testUserContentManagerContentFilter().

  • TestWebKitAPI/glib/CMakeLists.txt: Added TestWebKitUserContentFilterStore.
4:45 AM Changeset in webkit [241812] by Carlos Garcia Campos
  • 7 edits in releases/WebKitGTK/webkit-2.24/Source/bmalloc

Merge r241789 - [bmalloc] bmalloc::Cache should not be instantiated if we are using system malloc
https://bugs.webkit.org/show_bug.cgi?id=194811

Reviewed by Mark Lam.

bmalloc::Cache is very large. It is 13KB. Since it exists per HeapKind, it takes 40KB.
But this is meaningless if we are under the system malloc mode by using "Malloc=1". We
found that it continues using so much dirty memory region even under the system malloc mode.
This patch avoids instantiation of bmalloc::Cache under the system malloc mode.

  • bmalloc/Allocator.cpp:

(bmalloc::Allocator::Allocator):
(bmalloc::Allocator::tryAllocate):
(bmalloc::Allocator::allocateImpl):
(bmalloc::Allocator::reallocateImpl):
(bmalloc::Allocator::allocateSlowCase):
Allocator is a per Cache object. So we no longer need to keep m_debugHeap. If debug heap is enabled,
Allocator is never created.

  • bmalloc/Allocator.h:
  • bmalloc/Cache.cpp:

(bmalloc::debugHeap):
(bmalloc::Cache::Cache):
(bmalloc::Cache::tryAllocateSlowCaseNullCache):
(bmalloc::Cache::allocateSlowCaseNullCache):
(bmalloc::Cache::deallocateSlowCaseNullCache):
(bmalloc::Cache::tryReallocateSlowCaseNullCache):
(bmalloc::Cache::reallocateSlowCaseNullCache):

  • bmalloc/Cache.h:

(bmalloc::Cache::tryAllocate):
(bmalloc::Cache::tryReallocate):
If the debug heap mode is enabled, we keep Cache::getFast() returning nullptr. And in the slow path case, we use debugHeap.
This makes bmalloc fast path fast, while we avoid Cache instantiation.

  • bmalloc/Deallocator.cpp:

(bmalloc::Deallocator::Deallocator):
(bmalloc::Deallocator::scavenge):
(bmalloc::Deallocator::deallocateSlowCase):

  • bmalloc/Deallocator.h:

Ditto for Deallocator.

4:45 AM Changeset in webkit [241811] by Carlos Garcia Campos
  • 11 edits
    4 adds in releases/WebKitGTK/webkit-2.24

Merge r241788 - REGRESSION (r238090): Toggling visibility on the <html> element can result in a blank web view
https://bugs.webkit.org/show_bug.cgi?id=194827
rdar://problem/47620594

Reviewed by Antti Koivisto.

Source/WebCore:

Incremental compositing updates, added in rr238090, use repaints as a trigger for re-evaluating
layer configurations, since a repaint implies that a layer gains painted content. This is done
via the call to setNeedsCompositingConfigurationUpdate() in RenderLayerBacking::setContentsNeedDisplay{InRect}.
The RenderView's layer is opted out of this to avoid doing lots of redundant layer config recomputation
for the root. The configuration state that matters here is whether the layer contains painted content,
and therefore needs backing store; this is computed by RenderLayerBacking::isSimpleContainerCompositingLayer(),
and feeds into GraphicsLayer::drawsContent().

However, if <html> starts as "visibility:hidden" or "opacity:0", as some sites do to hide incremental loading,
then we'll fail to recompute 'drawsContent' for the root and leave the root with drawsContent=false, which
causes RenderLayerBacking::setContentsNeedDisplay{InRect} to short-circuit, and then we paint nothing.

Ironically, 'drawsContent' doesn't actually save any backing store for the root, since it has no affect on
the root tile caches; we always make tiles. So the simple fix here is to change RenderLayerBacking::isSimpleContainerCompositingLayer()
to always return false for the RenderView's layer (the root).

Testing this was tricky; ref testing doesn't work because we force repaint, and we normally skip
properties of the root in layer tree dumps to hide WK1/WK2 differences. Therefore I had to add
LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES and fix RenderLayerBacking::shouldDumpPropertyForLayer to
respect it.

Test: compositing/visibility/root-visibility-toggle.html

  • page/Frame.h:
  • platform/graphics/GraphicsLayer.cpp:

(WebCore::GraphicsLayer::dumpProperties const):

  • platform/graphics/GraphicsLayerClient.h:

(WebCore::GraphicsLayerClient::shouldDumpPropertyForLayer const):

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
(WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const):

  • rendering/RenderLayerBacking.h:
  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::layerTreeAsText):

  • testing/Internals.cpp:

(WebCore::toLayerTreeFlags):

  • testing/Internals.h:
  • testing/Internals.idl:

LayoutTests:

Test dumps layer tree with RenderLayerBacking::shouldDumpPropertyForLayer to show that the root has (drawsContent 1)

  • compositing/visibility/root-visibility-toggle-expected.txt: Added.
  • compositing/visibility/root-visibility-toggle.html: Added.
  • platform/mac-wk1/compositing/visibility/root-visibility-toggle-expected.txt: Added.
4:45 AM Changeset in webkit [241810] by Carlos Garcia Campos
  • 3 edits in releases/WebKitGTK/webkit-2.24/Source/JavaScriptCore

Merge r241783 - B3-O2 incorrectly optimizes this subtest
https://bugs.webkit.org/show_bug.cgi?id=194625

Reviewed by Saam Barati.

Trivial fix. Instead of doing

if (!cond) foo else bar => if (cond) bar else foo

B3LowerToAir was doing

if (xC) foo else bar => if (cond) bar else foo whenever C&1, even if C was for example 3.

  • b3/B3LowerToAir.cpp:
  • b3/testb3.cpp:

(JSC::B3::testBitNotOnBooleanAndBranch32):
(JSC::B3::testNotOnBooleanAndBranch32): Added.

4:45 AM Changeset in webkit [241809] by Carlos Garcia Campos
  • 2 edits in releases/WebKitGTK/webkit-2.24/Source/JavaScriptCore

Merge r241781 - CachedCall should not consider it UNLIKELY that it will not stack overflow
https://bugs.webkit.org/show_bug.cgi?id=194831

Reviewed by Mark Lam.

  • interpreter/CachedCall.h:

(JSC::CachedCall::CachedCall):

4:45 AM Changeset in webkit [241808] by Carlos Garcia Campos
  • 3 edits
    2 adds in releases/WebKitGTK/webkit-2.24

Merge r241780 - REGRESSION(r240909): Release assertion in FrameLoader::loadPostRequest when opening new window
https://bugs.webkit.org/show_bug.cgi?id=194820

Reviewed by Geoffrey Garen.

Source/WebCore:

This release assertion was wrong. The invocation of PolicyChecker::checkNewWindowPolicy in FrameLoader
doesn’t require PolicyChecker's load type to be set in PolicyChecker because FrameLoader's
continueLoadAfterNewWindowPolicy invokes loadWithNavigationAction which sets the load type later,
and we don't rely on PolicyChecker's load type until then.

Fixed the crash by removing relese asserts before invoking checkNewWindowPolicy accordingly.

This patch reverts r241015 since it too was asserting that PolicyChecker's load type is set before
invoking checkNewWindowPolicy which is not the right assumption.

Test: fast/loader/navigate-with-post-to-new-target-after-back-forward-navigation.html

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadPostRequest):

LayoutTests:

Added a regression test.

  • fast/loader/navigate-with-post-to-new-target-after-back-forward-navigation-expected.txt: Added.
  • fast/loader/navigate-with-post-to-new-target-after-back-forward-navigation.html: Added.
4:45 AM Changeset in webkit [241807] by Carlos Garcia Campos
  • 2 edits in releases/WebKitGTK/webkit-2.24/Source/WebKit

Merge r241777 - Remove assertion introduced in r229683
https://bugs.webkit.org/show_bug.cgi?id=194825
<rdar://problem/47628258>

Reviewed by Geoffrey Garen.

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
If we reach this code and the form's original Document's Frame has been destroyed,
we have already been told to submit the form so do so, just like we do if the WebPage
has been destroyed. This is a rare edge case having to do with the timing of Frame
destruction and decidePolicyForNavigationAction response, which unfortunately does not
reproduce with a test case unless the timing of IPC is just right.

4:44 AM Changeset in webkit [241806] by Carlos Garcia Campos
  • 2 edits in releases/WebKitGTK/webkit-2.24/Source/JavaScriptCore

Merge r241772 - Fix DFG doesGC() for TryGetById and ProfileType nodes.
https://bugs.webkit.org/show_bug.cgi?id=194821
<rdar://problem/48206690>

Reviewed by Saam Barati.

Fix doesGC() for the following nodes:

ProfileType:

calls operationProcessTypeProfilerLogDFG(), which can calculatedClassName(),
which can call JSString::tryGetValue(), which can resolve a rope.

TryGetById:

calls operationTryGetByIdOptimize(), which can startWatchingPropertyForReplacements()
on a structure, which can allocate StructureRareData.

  • dfg/DFGDoesGC.cpp:

(JSC::DFG::doesGC):

4:44 AM Changeset in webkit [241805] by Carlos Garcia Campos
  • 7 edits
    2 adds in releases/WebKitGTK/webkit-2.24/Source/JavaScriptCore

Merge r241769 - [JSC] Introduce JSNonDestructibleProxy for JavaScriptCore.framework's GlobalThis
https://bugs.webkit.org/show_bug.cgi?id=194799

Reviewed by Saam Barati.

JSProxy is destructible one because we have JSWindowProxy which has ref counted object.
However, JavaScriptCore.framework's JSProxy for GlobalThis does not need to be destructible.
This is important since we need to separate Heap subspaces between destructible and non-destructible objects.
If we can put more and more objects in non-destructible status, we can get rid of low-usage MarkedBlock.
This patch adds JSNonDestructibleProxy, which is not destructible JSProxy. While it inherits JSDestructibleObject,
we can make the subclass still non-destructible thanks to Subspace mechanism. This drops one more low-usage MarkedBlock.

  • CMakeLists.txt:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Sources.txt:
  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::resetPrototype):
(JSC::JSGlobalObject::finishCreation):

  • runtime/JSNonDestructibleProxy.cpp: Added.
  • runtime/JSNonDestructibleProxy.h: Added.

(JSC::JSNonDestructibleProxy::subspaceFor):
(JSC::JSNonDestructibleProxy::create):
(JSC::JSNonDestructibleProxy::createStructure):
(JSC::JSNonDestructibleProxy::JSNonDestructibleProxy):

  • runtime/JSProxy.h:

(JSC::JSProxy::JSProxy):

4:44 AM Changeset in webkit [241804] by Carlos Garcia Campos
  • 2 edits in releases/WebKitGTK/webkit-2.24/Source/JavaScriptCore

Merge r241768 - B3ReduceStrength::simplifyCFG() could do a lot more on each iteration
https://bugs.webkit.org/show_bug.cgi?id=194475

Reviewed by Saam Barati.

B3ReduceStrength::simplifyCFG() does three optimizations (which I will call A, B and C):

  • A makes any terminal that points to a block that is empty except for a jump point to that jump's target instead.
  • B transforms any branch or switch that points to a single block into a jump
  • C finds blocks ending with jumps, whose successor has a single predecessor, and inline that successor block in place of the jump

It currently is limited in the following way:

  • A and C can only fire once per block per iteration
  • B can create jumps that would trigger A, but they may not be seen until the next iteration

Both problems are mitigated by going through the blocks in post-order, so that when a block is optimized most of its successors have already been optimized.
In a sense it is the symmetric of the peephole optimizer that goes in pre-order so that when an instruction is optimized most of its children have already been optimized.

On JetStream2 it reduces the average number of iterations from 3.35 to 3.24.

  • b3/B3ReduceStrength.cpp:
4:44 AM Changeset in webkit [241803] by Carlos Garcia Campos
  • 2 edits in releases/WebKitGTK/webkit-2.24/Tools

Merge r241759 - pytest is not correctly auto-installed
https://bugs.webkit.org/show_bug.cgi?id=194707

Patch by Pablo Saavedra <Pablo Saavedra> on 2019-02-19
Reviewed by Carlos Garcia Campos.

  • Scripts/webkitpy/thirdparty/init.py:

(AutoinstallImportHook._install_pytest):

4:44 AM Changeset in webkit [241802] by Carlos Garcia Campos
  • 5 edits in releases/WebKitGTK/webkit-2.24/Source/JavaScriptCore

Merge r241758 - Move bytecode cache-related filesystem code out of CodeCache
https://bugs.webkit.org/show_bug.cgi?id=194675

Reviewed by Saam Barati.

The code is only used for the bytecode-cache tests, so it should live in
jsc.cpp rather than in the CodeCache. The logic now lives in ShellSourceProvider,
which overrides the a virtual method in SourceProvider, cacheBytecode,
in order to write the cache to disk.

  • jsc.cpp:

(ShellSourceProvider::create):
(ShellSourceProvider::~ShellSourceProvider):
(ShellSourceProvider::cachePath const):
(ShellSourceProvider::loadBytecode):
(ShellSourceProvider::ShellSourceProvider):
(jscSource):
(GlobalObject::moduleLoaderFetch):
(functionDollarEvalScript):
(runWithOptions):

  • parser/SourceProvider.h:

(JSC::SourceProvider::cacheBytecode const):

  • runtime/CodeCache.cpp:

(JSC::writeCodeBlock):

  • runtime/CodeCache.h:

(JSC::CodeCacheMap::fetchFromDiskImpl):

4:44 AM Changeset in webkit [241801] by Carlos Garcia Campos
  • 4 edits in releases/WebKitGTK/webkit-2.24

Merge r241756 - [ARM] Fix crash with sampling profiler
https://bugs.webkit.org/show_bug.cgi?id=194772

Reviewed by Mark Lam.

JSTests:

Do not skip test since crash with sampling profiler is now fixed.

  • stress/sampling-profiler-richards.js:

Source/JavaScriptCore:

sampling-profiler-richards.js was crashing with an enabled sampling profiler. add32
did not update the stack pointer in a single instruction. The src register was first
moved into the stack pointer, the immediate imm was added in a subsequent instruction.

This was problematic when a signal handler was invoked before applying the immediate,
when the stack pointer is still set to the temporary value. Avoid this by calculating src+imm in
a temporary register and then move it in one go into the stack pointer.

  • assembler/MacroAssemblerARMv7.h:

(JSC::MacroAssemblerARMv7::add32):

4:44 AM Changeset in webkit [241800] by Carlos Garcia Campos
  • 2 edits in releases/WebKitGTK/webkit-2.24/Source/JavaScriptCore

Merge r241753 - Fix DFG doesGC() for CompareEq/Less/LessEq/Greater/GreaterEq and CompareStrictEq nodes.
https://bugs.webkit.org/show_bug.cgi?id=194800
<rdar://problem/48183773>

Reviewed by Yusuke Suzuki.

Fix doesGC() for the following nodes:

CompareEq:
CompareLess:
CompareLessEq:
CompareGreater:
CompareGreaterEq:
CompareStrictEq:

Only return false (i.e. does not GC) for child node use kinds that have
been vetted to not do anything that can GC. For all other use kinds
(including StringUse and BigIntUse), we return true (i.e. does GC).

  • dfg/DFGDoesGC.cpp:

(JSC::DFG::doesGC):

4:44 AM Changeset in webkit [241799] by Carlos Garcia Campos
  • 47 edits
    1 copy
    1 add in releases/WebKitGTK/webkit-2.24/Source

Merge r241751 - Continue reducing use of String::format, now focusing on hex: "%p", "%x", etc.
https://bugs.webkit.org/show_bug.cgi?id=194752

Reviewed by Daniel Bates.

Source/JavaScriptCore:

  • heap/HeapSnapshotBuilder.cpp:

(JSC::HeapSnapshotBuilder::json): Added back the "0x" that was removed when changing
this file to use appendUnsignedAsHex instead of "%p". The intent at that time was to
keep behavior the same, so let's do that.

  • parser/Lexer.cpp:

(JSC::Lexer<T>::invalidCharacterMessage const): Use makeString and hex instead of
String::format and "%04x".

Source/WebCore:

  • Modules/websockets/WebSocket.cpp: Added an include of HexNumber.h. This previously

got included because of Logger.h, but that no longer pulls in HexNumber.h.

  • css/CSSMarkup.cpp: Removed unneeded include of StringBuffer.h.
  • css/CSSPrimitiveValue.cpp: Ditto.
  • css/CSSUnicodeRangeValue.cpp:

(WebCore::CSSUnicodeRangeValue::customCSSText const): Use makeString and hex instead
of String::format and "%x".

  • html/HTMLMediaElement.h:

(WTF::ValueToString<WebCore::TextTrackCue::string): Use a non-template function,
TextTrackCure::debugString, so we don't need to use HextNumber.h in a header.

  • html/canvas/WebGLRenderingContextBase.cpp:

(GetErrorString): Use makeString and hex instead of String::format and "%04x".

  • html/track/TextTrackCue.cpp:

(WebCore::TextTrackCue::debugString const): Added. Moved string conversion here
from HTMLMediaElement.h and use makeString instead of String::format. Also use
the word "debug" to make it clear that it's not OK to use this string, with a
pointer value serialized into it, outside of debugging.

  • html/track/TextTrackCue.h: Added TextTrackCue::debugString.
  • page/linux/ResourceUsageOverlayLinux.cpp:

(WebCore::formatByteNumber): Use makeString and FormattedNumber::fixedWidth
instead of String::format and "%.1f" etc.

  • platform/cocoa/KeyEventCocoa.mm:

(WebCore::keyIdentifierForCharCode): Use the new hex function here instead of
the old code that did each of the four characters explicitly.

  • platform/gamepad/mac/HIDGamepad.cpp:

(WebCore::HIDGamepad::HIDGamepad): Use makeString instead of String::format.

  • platform/graphics/Color.cpp:

(WebCore::Color::nameForRenderTreeAsText const): Use hex instead of doing each
digit separately.

  • platform/graphics/FloatPolygon.cpp:

(WebCore::FloatPolygonEdge::debugString const): Added. Moved string conversion here
from the header and use makeString instead of String::format. Also use
the word "debug" to make it clear that it's not OK to use this string, with a
pointer value serialized into it, outside of debugging.

  • platform/graphics/FloatPolygon.h: Updated for the above.
  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::setName): Use makeString instead of String::format.
(WebCore::GraphicsLayerCA::recursiveCommitChanges): DItto.

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:

(WebCore::MediaPlayerPrivateGStreamer::load): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Ditto.

  • platform/gtk/PlatformKeyboardEventGtk.cpp:

(WebCore::PlatformKeyboardEvent::keyIdentifierForGdkKeyCode): Ditto.

  • platform/libwpe/PlatformKeyboardEventLibWPE.cpp:

(WebCore::PlatformKeyboardEvent::keyIdentifierForWPEKeyCode): Ditto.

  • platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:

(WebCore::GStreamerVideoEncoder::makeElement): Ditto.
(WebCore::GStreamerVideoEncoder::InitEncode): Ditto.

  • platform/text/TextCodecLatin1.cpp: Removed unneeded include of StringBuffer.h

and "using namespace WTF".

  • platform/win/GDIObjectCounter.cpp:

(WebCore::GDIObjectCounter::GDIObjectCounter): Use makeString instead of String::format.

  • platform/win/KeyEventWin.cpp:

(WebCore::keyIdentifierForWindowsKeyCode): Ditto.

  • rendering/FloatingObjects.cpp:

(WebCore::FloatingObject::debugString const): Added. Moved string conversion here
from the header and use makeString instead of String::format. Also use
the word "debug" to make it clear that it's not OK to use this string, with a
pointer value serialized into it, outside of debugging.

  • rendering/FloatingObjects.h: Updated for the above.
  • rendering/RenderFragmentContainer.cpp:

(WebCore::RenderFragmentContainer::debugString const): Added. Moved string
conversion here from the header and use makeString instead of String::format.
Also use the word "debug" to make it clear that it's not OK to use this string,
with a pointer value serialized into it, outside of debugging.

  • rendering/RenderFragmentContainer.h: Updated for the above.
  • rendering/RenderFragmentedFlow.h: Ditto.
  • testing/Internals.cpp:

(WebCore::Internals::address): Use makeString instead of String::format.

Source/WebCore/PAL:

  • pal/FileSizeFormatter.cpp:

(fileSizeDescription): Use makeString instead of String::format.

Source/WebKit:

  • Platform/IPC/win/ConnectionWin.cpp:

(IPC::Connection::createServerAndClientIdentifiers): Use makeString instead of
String::format.

  • Shared/win/WebEventFactory.cpp:

(WebKit::keyIdentifierFromEvent): Ditto.

  • UIProcess/API/APINavigation.cpp:

(API::Navigation::loggingString const): Use hex instead of String::format.

  • UIProcess/SuspendedPageProxy.cpp:

(WebKit::SuspendedPageProxy::loggingString const): Ditto.

  • UIProcess/WebBackForwardList.cpp:

(WebKit::WebBackForwardList::loggingString): Added a "0x".

  • UIProcess/gtk/InputMethodFilter.cpp:

(WebKit::InputMethodFilter::logHandleKeyboardEventForTesting): Use makeString and hex
instead of String::format and "%x".
(WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting):
Ditto.

Source/WTF:

  • WTF.xcodeproj/project.pbxproj: Added HexNumber.cpp and Logger.cpp.
  • wtf/CMakeLists.txt: Ditto.
  • wtf/HexNumber.cpp: Added.

(WTF::Internal::appendHex): Non-inline, non-template hex formatting logic.

  • wtf/HexNumber.h:

(WTF::Internal::appendHex): Refactored main logic of appendUnsignedAsHex and
appendUnsignedAsHexFixedSize so they can be reused in a function named hex for
use with StringTypeAdapter.
(WTF::appendUnsignedAsHex): Ditto.
(WTF::appendUnsignedAsHexFixedSize): Ditto.
(WTF::hex): Added.
(WTF::StringTypeAdapter<HexNumberBuffer>): Added.

  • wtf/Logger.cpp: Added.

(WTF::Logger::LogSiteIdentifier::toString const): Made this a non-template
function and moved it here so that we don't need to include HexNumber.h
in Logger.h. Since HexNumber.h has substantial code in it, it's good if we
don't include it in any other headers.

  • wtf/Logger.h:

(WTF::LogArgument<Logger::LogSiteIdentifier>::toString): Changed to call
a non-template function, LogSiteIdentifier::toString.

  • wtf/text/StringConcatenateNumbers.h: Replaced overloaded writeTo functions

with function templates and used StringImpl::copyCharacters instead of
hand-written loops.

4:43 AM Changeset in webkit [241798] by Carlos Garcia Campos
  • 4 edits
    2 adds in releases/WebKitGTK/webkit-2.24

Merge r241746 - [css-grid] Handle indefinite percentages in fit-content()
https://bugs.webkit.org/show_bug.cgi?id=194509

Patch by Oriol Brufau <Oriol Brufau> on 2019-02-18
Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

Import WPT test.

  • web-platform-tests/css/css-grid/layout-algorithm/grid-fit-content-percentage-expected.txt: Added.
  • web-platform-tests/css/css-grid/layout-algorithm/grid-fit-content-percentage.html: Added.
  • web-platform-tests/css/css-grid/layout-algorithm/w3c-import.log:

Source/WebCore:

Test: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-fit-content-percentage.html

If the size of the grid container depends on the size of its tracks,
a percentage in fit-content() is indefinite. Without this patch, some
places treated this case as fit-content(0), which prevented the grid
container from growing enough to contain the max-content contribution
of its grid items.

This patch treats such fit-content() as minmax(auto, max-content),
but once the size of the grid container is known and it is laid out
"for real", then the percentage is definite and it's used.

  • rendering/GridTrackSizingAlgorithm.cpp:

(WebCore::GridTrackSizingAlgorithm::gridTrackSize const):
(WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):

4:43 AM Changeset in webkit [241797] by Carlos Garcia Campos
  • 6 edits
    3 adds in releases/WebKitGTK/webkit-2.24

Merge r241743 - Check the existence of the frame in Document::hasFrameSpecificStorageAccess() and Document::setHasFrameSpecificStorageAccess()
https://bugs.webkit.org/show_bug.cgi?id=194777
<rdar://problem/47731945>

Reviewed by Geoffrey Garen and Chris Dumez.

Source/WebCore:

Test: http/tests/storageAccess/remove-requesting-iframe.html

  • dom/Document.cpp:

(WebCore::Document::hasFrameSpecificStorageAccess const):

Now checks for the existence of the frame.

(WebCore::Document::setHasFrameSpecificStorageAccess):

Now checks for the existence of the frame.

  • loader/ResourceLoadObserver.cpp:

(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):

Now checks that the session ID is valid.

Source/WebKit:

  • NetworkProcess/NetworkConnectionToWebProcess.cpp:

(WebKit::NetworkConnectionToWebProcess::logUserInteraction):

Now returns early if the incoming session ID is invalid.
Added an ASSERT to help us find other call sites passing invalid session IDs.

LayoutTests:

  • http/tests/storageAccess/remove-requesting-iframe-expected.txt: Added.
  • http/tests/storageAccess/remove-requesting-iframe.html: Added.
  • http/tests/storageAccess/resources/request-storage-access-and-immediately-postmessage-iframe.html: Added.
4:43 AM Changeset in webkit [241796] by Carlos Garcia Campos
  • 5 edits
    1 add in releases/WebKitGTK/webkit-2.24

Merge r241741 - [JSC] Add LazyClassStructure::getInitializedOnMainThread
https://bugs.webkit.org/show_bug.cgi?id=194784
<rdar://problem/48154820>

Reviewed by Mark Lam.

JSTests:

  • stress/lazy-initialization-done-a-priori-if-jit-enabled.js: Added.

(getProperties):
(getRandomProperty):
(i.catch):

Source/JavaScriptCore:

LazyClassStructure::get and LazyProperty::get functions do not allow compiler threads to call them. But for booleanPrototype, numberPrototype and symbolPrototype cases,
we would like to call them from compiler threads. We eagerly initialize them if VM::canUseJIT() is true, so that compiler threads can safely call LazyClassStructure::get
and LazyProperty::get for booleanPrototype, numberPrototype and symbolPrototype. But still assertion hits because the assertion requires that these functions need to be
called in non compiler threads. Calling getConcurrently() is not possible since symbolPrototype() function is called from both the main thread and compiler threads,
and we would like to lazily initialize SymbolPrototype object if it is called from the main thread, which can happen with non-JIT configuration.

This patch adds getInitializedOnMainThread(). Compiler threads can call it only when we know that the value is already initialized on the main thread. The main thread
can call it at anytime and this function lazily initializes the value. This is useful to make some of prototypes lazy with non-JIT configuration: With non-JIT configuration,
this function is always called from the main thread and it initializes the value lazily. Non-JIT configuration does not care about compiler threads since they do not exist.
With JIT configuration, we eagerly initialize them in JSGlobalObject::init so that getInitializedOnMainThread() always succeeds.

Basically, getInitializedOnMainThread() is get with different assertion location: While get always crashes if it is called from compiler threads, getInitializedOnMainThread()
crashes only when actual initialization happens on compiler threads. We do not merge them since get is still useful to find accidental initialization from compiler threads.

  • runtime/JSGlobalObject.h:

(JSC::JSGlobalObject::booleanPrototype const):
(JSC::JSGlobalObject::numberPrototype const):
(JSC::JSGlobalObject::symbolPrototype const):

  • runtime/LazyClassStructure.h:

(JSC::LazyClassStructure::getInitializedOnMainThread const):
(JSC::LazyClassStructure::prototypeInitializedOnMainThread const):
(JSC::LazyClassStructure::constructorInitializedOnMainThread const):

  • runtime/LazyProperty.h:

(JSC::LazyProperty::get const):
(JSC::LazyProperty::getInitializedOnMainThread const):

4:43 AM Changeset in webkit [241795] by Carlos Garcia Campos
  • 7 edits
    1 add in releases/WebKitGTK/webkit-2.24

Merge r241733 - Bytecode cache should a have a boot-specific validation
https://bugs.webkit.org/show_bug.cgi?id=194769
<rdar://problem/48149509>

Reviewed by Keith Miller.

Source/JavaScriptCore:

Add the boot UUID to the cached bytecode to enforce that it is not reused
across reboots.

  • runtime/CachedTypes.cpp:

(JSC::Encoder::malloc):
(JSC::GenericCacheEntry::GenericCacheEntry):
(JSC::GenericCacheEntry::tag const):
(JSC::CacheEntry::CacheEntry):
(JSC::CacheEntry::decode const):
(JSC::GenericCacheEntry::decode const):
(JSC::encodeCodeBlock):

Source/WTF:

Add helper to get kern.bootsessionuuid from sysctl

  • wtf/UUID.cpp:

(WTF::bootSessionUUIDString):

  • wtf/UUID.h:

Tools:

Add test for WTF::bootSessionUUIDString()

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WTF/UUID.cpp: Added.

(TEST):

4:43 AM Changeset in webkit [241794] by Carlos Garcia Campos
  • 3 edits in releases/WebKitGTK/webkit-2.24/Source/WebInspectorUI

Merge r241732 - Web Inspector: duplicate left double quotation mark (\u201C) in 'Unable to show certificate for “%s“.'
https://bugs.webkit.org/show_bug.cgi?id=194782
<rdar://problem/48159683>

Reviewed by Joseph Pecoraro.

  • UserInterface/Models/Resource.js:

(WI.Resource.prototype.async showCertificate):

  • Localizations/en.lproj/localizedStrings.js:
4:43 AM Changeset in webkit [241793] by Carlos Garcia Campos
  • 2 edits in releases/WebKitGTK/webkit-2.24/JSTests

Merge r241662 - [ARM] Test gardening: Test running out of executable memory
https://bugs.webkit.org/show_bug.cgi?id=194771

Unreviewed. Do not run test without LLInt, test is running out of executable
memory on ARM otherwise.

  • stress/tagged-template-object-collect.js:
4:43 AM Changeset in webkit [241792] by Carlos Garcia Campos
  • 2 edits in releases/WebKitGTK/webkit-2.24/JSTests

Merge r241661 - Unreviewed, skip the test on platforms without sampling profiler

  • stress/sampling-profiler-stack-trace-with-double-quote-in-function-name.js:

(platformSupportsSamplingProfiler.foo):
(platformSupportsSamplingProfiler.test):
(platformSupportsSamplingProfiler):
(foo): Deleted.
(test): Deleted.

4:43 AM Changeset in webkit [241791] by Carlos Garcia Campos
  • 17 edits in releases/WebKitGTK/webkit-2.24/Source/JavaScriptCore

Merge r241649 - [JSC] JSWrapperObject should not be destructible
https://bugs.webkit.org/show_bug.cgi?id=194743

Reviewed by Saam Barati.

JSWrapperObject should be just a wrapper object for JSValue, thus, it should not be a JSDestructibleObject.
Currently it is destructible object because DateInstance uses it. This patch changes Base of DateInstance from
JSWrapperObject to JSDestructibleObject, and makes JSWrapperObject non-destructible.

  • runtime/BigIntObject.cpp:

(JSC::BigIntObject::BigIntObject):

  • runtime/BooleanConstructor.cpp:

(JSC::BooleanConstructor::finishCreation):

  • runtime/BooleanObject.cpp:

(JSC::BooleanObject::BooleanObject):

  • runtime/BooleanObject.h:
  • runtime/DateInstance.cpp:

(JSC::DateInstance::DateInstance):
(JSC::DateInstance::finishCreation):

  • runtime/DateInstance.h:
  • runtime/DatePrototype.cpp:

(JSC::dateProtoFuncGetTime):
(JSC::dateProtoFuncSetTime):
(JSC::setNewValueFromTimeArgs):
(JSC::setNewValueFromDateArgs):
(JSC::dateProtoFuncSetYear):

  • runtime/JSCPoison.h:
  • runtime/JSWrapperObject.h:

(JSC::JSWrapperObject::JSWrapperObject):

  • runtime/NumberObject.cpp:

(JSC::NumberObject::NumberObject):

  • runtime/NumberObject.h:
  • runtime/StringConstructor.cpp:

(JSC::StringConstructor::finishCreation):

  • runtime/StringObject.cpp:

(JSC::StringObject::StringObject):

  • runtime/StringObject.h:

(JSC::StringObject::internalValue const):

  • runtime/SymbolObject.cpp:

(JSC::SymbolObject::SymbolObject):

  • runtime/SymbolObject.h:
2:16 AM Changeset in webkit [241790] by Adrian Perez de Castro
  • 30 edits
    4 adds in trunk

[WPE][GTK] Enable support for CONTENT_EXTENSIONS
https://bugs.webkit.org/show_bug.cgi?id=167941

Reviewed by Carlos Garcia Campos.

Source/WebCore:

  • platform/gtk/po/POTFILES.in: Added WebKitUserContentFilterStore.cpp

to the list of files with translatable strings.

Source/WebKit:

Adds new API to manage a collection of content extensions on disk (including compilation
of new ones) using WebKitUserContentFilterStore; the associated WebKitUserContentFilter
type (which represents a compiled content extension); and the functions needed to enable
and disable them for a given WebKitUserContentManager.

The WebKitUserContentFilterStore public API is expressed in abstract terms of "saving"
filters into the store (which involves compiling the JSON source rule set); and "loading"
them back as main operations. This way we do not disclose to users of the API any detail
about compilation, nor how contents are laid out on disk, and the documentation explicitly
tells about only using the provided functions to manipulate the on-disk contents. This
way we allow ourselves some leeway if the implementation needs changing in the future.

  • PlatformGTK.cmake: Added WebKitUserContentFilterStore.h to the list of public API headers.
  • PlatformWPE.cmake: Ditto.
  • SourcesGTK.txt: Added WebKitUserContentFilterStore.cpp
  • SourcesWPE.txt: Ditto.
  • UIProcess/API/glib/WebKitError.cpp: Add definition of webkit_user_content_filter_error_quark().
  • UIProcess/API/glib/WebKitUserContent.cpp: Added WebKitUserContentFilter.

(_WebKitUserContentFilter::_WebKitUserContentFilter):
(webkit_user_content_filter_ref):
(webkit_user_content_filter_unref):
(webkit_user_content_filter_get_identifier):
(webkitUserContentFilterCreate):
(webkitUserContentFilterGetContentRuleList):

  • UIProcess/API/glib/WebKitUserContentFilterStore.cpp: Added.

(toGError): Utility function to convert content extension error codes to GError.
(webkit_user_content_filter_store_class_init):
(webkit_user_content_filter_store_new):
(webkit_user_content_filter_store_get_path):
(webkitUserContentFilterStoreSaveBytes): Common function used as final step for all the
functions which save (compile) JSON rule sets into the store, to avoid duplicating code.
(webkit_user_content_filter_store_save):
(webkit_user_content_filter_store_save_finish):
(webkit_user_content_filter_store_save_from_file):
(webkit_user_content_filter_store_save_from_file_finish):
(webkit_user_content_filter_store_remove):
(webkit_user_content_filter_store_remove_finish):
(webkit_user_content_filter_store_load):
(webkit_user_content_filter_store_lookup_finish):
(webkit_user_content_filter_store_fetch_identifiers):
(webkit_user_content_filter_store_fetch_identifiers_finish):

  • UIProcess/API/glib/WebKitUserContentManager.cpp: Added definitions for the new API

functions to add and remove filters from an user content manager.
(webkit_user_content_manager_add_filter):
(webkit_user_content_manager_remove_filter):
(webkit_user_content_manager_remove_all_filters):

  • UIProcess/API/glib/WebKitUserContentPrivate.h: Added declarations for

webkitUserContentFilterCreate() and webkitUserContentFilterGetContentRuleList().

  • UIProcess/API/gtk/WebKitAutocleanups.h: Added autocleanups for WebKitUserContentFilter

and WebKitUserContentFilterStore.

  • UIProcess/API/gtk/WebKitError.h: Added declarations for WEBKIT_USER_CONTENT_FILTER_ERROR

plus the associated webkit_user_content_filter_error_quark() function and
WebKitUserContentFilterErrror enum.

  • UIProcess/API/gtk/WebKitUserContent.h: Added declarations for WebKitUserContentFilter

and its associated functions.

  • UIProcess/API/gtk/WebKitUserContentFilterStore.h: Added.
  • UIProcess/API/gtk/WebKitUserContentManager.h: Added declarations for the functions to

add and remove filters from the user content manager.

  • UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Added new API functions and types to

be included in the documentation.

  • UIProcess/API/gtk/webkit2.h: Added inclusion of WebKitUserContentFilterStore.h
  • UIProcess/API/wpe/WebKitError.h: Same as for the GTK port header.
  • UIProcess/API/wpe/WebKitUserContent.h: Same as for the GTK port header.
  • UIProcess/API/wpe/WebKitUserContentFilterStore.h: Added.
  • UIProcess/API/wpe/WebKitUserContentManager.h: Same as for the GTK port header.
  • UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Added new API functions and types to be

included in the documentation.

  • UIProcess/API/wpe/webkit.h: Added inclusion of WebKitUserContentFilterStore.h

Source/WTF:

Add specialization of the refGPtr() and derefGPtr() templates for GMappedFile.

  • wtf/glib/GRefPtr.cpp:

(WTF::refGPtr): Added.
(WTF::derefGPtr): Added.

  • wtf/glib/GRefPtr.h: Declare template specializations.

Tools:

  • MiniBrowser/gtk/main.c:

(filterSavedCallback): Added.
(main): Support loading a JSON rule set file for content filtering.

  • MiniBrowser/wpe/main.cpp:

(filterSavedCallback): Added.
(main): Support loading a JSON rule set file for content filtering.

  • TestWebKitAPI/Tests/WebKitGLib/TestWebKitUserContentFilterStore.cpp: Added.

(WTF::refGPtr): Added locally for WebKitUserContentFilter, as it would not be used anywhere else.
(WTF::derefGPtr): Ditto.
(testEmptyStore):
(testSaveInvalidFilter):
(testSaveLoadFilter):
(testSavedFilterIdentifierMatch):
(testRemoveFilter):
(testSaveMultipleFilters):
(testSaveFilterFromFile):
(testFilterPersistence):
(beforeAll):
(afterAll):

  • TestWebKitAPI/Tests/WebKitGLib/TestWebKitUserContentManager.cpp:

(removeOldInjectedContentAndResetLists): Also reset content filters.
(isCSSBlockedForURLAtPath): Added. Tests whether the test filter, which blocks a
CSS style sheet, has blocked the load of the CSS by looking at the resulting style of
the element affected by the style sheet.
(getUserContentFilter): Added. Stores the test filter in a WebKitUserContentFilterStore
and returns it to be used by tests.
(testUserContentManagerContentFilter): Added. Tests whether adding and removing a filter
from the WebKitUserContentManager results in the a CSS style sheet being blocked.
(serverCallback): Add support for serving a CSS style sheet for testing.
(beforeAll): Add call to testUserContentManagerContentFilter().

  • TestWebKitAPI/glib/CMakeLists.txt: Added TestWebKitUserContentFilterStore.

Feb 19, 2019:

5:51 PM Changeset in webkit [241789] by ysuzuki@apple.com
  • 7 edits in trunk/Source/bmalloc

[bmalloc] bmalloc::Cache should not be instantiated if we are using system malloc
https://bugs.webkit.org/show_bug.cgi?id=194811

Reviewed by Mark Lam.

bmalloc::Cache is very large. It is 13KB. Since it exists per HeapKind, it takes 40KB.
But this is meaningless if we are under the system malloc mode by using "Malloc=1". We
found that it continues using so much dirty memory region even under the system malloc mode.
This patch avoids instantiation of bmalloc::Cache under the system malloc mode.

  • bmalloc/Allocator.cpp:

(bmalloc::Allocator::Allocator):
(bmalloc::Allocator::tryAllocate):
(bmalloc::Allocator::allocateImpl):
(bmalloc::Allocator::reallocateImpl):
(bmalloc::Allocator::allocateSlowCase):
Allocator is a per Cache object. So we no longer need to keep m_debugHeap. If debug heap is enabled,
Allocator is never created.

  • bmalloc/Allocator.h:
  • bmalloc/Cache.cpp:

(bmalloc::debugHeap):
(bmalloc::Cache::Cache):
(bmalloc::Cache::tryAllocateSlowCaseNullCache):
(bmalloc::Cache::allocateSlowCaseNullCache):
(bmalloc::Cache::deallocateSlowCaseNullCache):
(bmalloc::Cache::tryReallocateSlowCaseNullCache):
(bmalloc::Cache::reallocateSlowCaseNullCache):

  • bmalloc/Cache.h:

(bmalloc::Cache::tryAllocate):
(bmalloc::Cache::tryReallocate):
If the debug heap mode is enabled, we keep Cache::getFast() returning nullptr. And in the slow path case, we use debugHeap.
This makes bmalloc fast path fast, while we avoid Cache instantiation.

  • bmalloc/Deallocator.cpp:

(bmalloc::Deallocator::Deallocator):
(bmalloc::Deallocator::scavenge):
(bmalloc::Deallocator::deallocateSlowCase):

  • bmalloc/Deallocator.h:

Ditto for Deallocator.

5:39 PM Changeset in webkit [241788] by Simon Fraser
  • 11 edits
    4 adds in trunk

REGRESSION (r238090): Toggling visibility on the <html> element can result in a blank web view
https://bugs.webkit.org/show_bug.cgi?id=194827
rdar://problem/47620594

Reviewed by Antti Koivisto.

Source/WebCore:

Incremental compositing updates, added in rr238090, use repaints as a trigger for re-evaluating
layer configurations, since a repaint implies that a layer gains painted content. This is done
via the call to setNeedsCompositingConfigurationUpdate() in RenderLayerBacking::setContentsNeedDisplay{InRect}.
The RenderView's layer is opted out of this to avoid doing lots of redundant layer config recomputation
for the root. The configuration state that matters here is whether the layer contains painted content,
and therefore needs backing store; this is computed by RenderLayerBacking::isSimpleContainerCompositingLayer(),
and feeds into GraphicsLayer::drawsContent().

However, if <html> starts as "visibility:hidden" or "opacity:0", as some sites do to hide incremental loading,
then we'll fail to recompute 'drawsContent' for the root and leave the root with drawsContent=false, which
causes RenderLayerBacking::setContentsNeedDisplay{InRect} to short-circuit, and then we paint nothing.

Ironically, 'drawsContent' doesn't actually save any backing store for the root, since it has no affect on
the root tile caches; we always make tiles. So the simple fix here is to change RenderLayerBacking::isSimpleContainerCompositingLayer()
to always return false for the RenderView's layer (the root).

Testing this was tricky; ref testing doesn't work because we force repaint, and we normally skip
properties of the root in layer tree dumps to hide WK1/WK2 differences. Therefore I had to add
LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES and fix RenderLayerBacking::shouldDumpPropertyForLayer to
respect it.

Test: compositing/visibility/root-visibility-toggle.html

  • page/Frame.h:
  • platform/graphics/GraphicsLayer.cpp:

(WebCore::GraphicsLayer::dumpProperties const):

  • platform/graphics/GraphicsLayerClient.h:

(WebCore::GraphicsLayerClient::shouldDumpPropertyForLayer const):

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
(WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const):

  • rendering/RenderLayerBacking.h:
  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::layerTreeAsText):

  • testing/Internals.cpp:

(WebCore::toLayerTreeFlags):

  • testing/Internals.h:
  • testing/Internals.idl:

LayoutTests:

Test dumps layer tree with RenderLayerBacking::shouldDumpPropertyForLayer to show that the root has (drawsContent 1)

  • compositing/visibility/root-visibility-toggle-expected.txt: Added.
  • compositing/visibility/root-visibility-toggle.html: Added.
  • platform/mac-wk1/compositing/visibility/root-visibility-toggle-expected.txt: Added.
5:35 PM Changeset in webkit [241787] by Joseph Pecoraro
  • 19 edits
    1 add in trunk

Web Inspector: Improve ES6 Class instances in Heap Snapshot instances view
https://bugs.webkit.org/show_bug.cgi?id=172848
<rdar://problem/25709212>

Reviewed by Mark Lam.

JSTests:

  • typeProfiler/inheritance.js:

Rewrite the test slightly for clarity. The hoisting was confusing.

  • heapProfiler/class-names.js: Added.

(MyES5Class):
(MyES6Class):
(MyES6Subclass):
Test object types and improved class names.

  • heapProfiler/driver/driver.js:

(CheapHeapSnapshotNode):
(CheapHeapSnapshot):
(createCheapHeapSnapshot):
(HeapSnapshot):
(createHeapSnapshot):
Update snapshot parsing from version 1 to version 2.

Source/JavaScriptCore:

  • heap/HeapSnapshotBuilder.h:
  • heap/HeapSnapshotBuilder.cpp:

Update the snapshot version. Change the node's 0 | 1 internal value
to be a 32bit bit flag. This is nice in that it is both compatible
with the previous snapshot version and the same size. We can use more
flags in the future.

(JSC::HeapSnapshotBuilder::json):
In cases where the classInfo gives us "Object" check for a better
class name by checking (o).proto.constructor.name. We avoid this
check in cases where (o).hasOwnProperty("constructor") which is the
case for most Foo.prototype objects. Otherwise this would get the
name of the Foo superclass for the Foo.prototype object.

  • runtime/JSObject.cpp:

(JSC::JSObject::calculatedClassName):
Handle some possible edge cases that were not handled before, such as
a JSObject without a GlobalObject or an object which doesn't
have a default getPrototype. Try to make the code a little clearer.

Source/WebInspectorUI:

  • UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:

(HeapSnapshot):
Support the new snapshot version. The only thing that changes are the
node flags, and its actually completely compatible with version 1.

(HeapSnapshot.updateCategoriesAndMetadata):
List the count of object type instances in each class category.

(HeapSnapshot.prototype.serializeNode):
Include whether or not the node is an object type.

  • UserInterface/Proxies/HeapSnapshotNodeProxy.js:

(WebInspector.HeapSnapshotNodeProxy):
(WebInspector.HeapSnapshotNodeProxy.deserialize):
Add a new Node isObjectType property based on the new data.

  • UserInterface/Views/HeapSnapshotClassDataGridNode.js:

(WebInspector.HeapSnapshotClassDataGridNode.prototype.createCellContent):

  • UserInterface/Views/HeapSnapshotClusterContentView.js:

(WebInspector.HeapSnapshotClusterContentView.iconStyleClassNameForClassName):
If a class contains 50% or more object type instances then treat it as such
instead of defaulting to native.

  • UserInterface/Views/HeapSnapshotDataGridTree.js:

(WebInspector.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):

  • UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:

(WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCellContent):
We can be more specific than the default if the individual instance is
known to be an object type.

LayoutTests:

  • inspector/unit-tests/heap-snapshot-expected.txt:
  • inspector/unit-tests/heap-snapshot.html:

Update for the new node flag.

5:31 PM Changeset in webkit [241786] by Keith Rollin
  • 2 edits in trunk/Tools

Add timing information to build output
https://bugs.webkit.org/show_bug.cgi?id=194839
<rdar://problem/48219609>

Reviewed by Alexey Proskuryakov.

Configure xcodebuild with -ShowBuildOperationDuration, causing it to
emit each project's build time to its output. E.g.,

BUILD SUCCEEDED [0.132 sec]

  • Scripts/webkitdirs.pm:

(XcodeOptions):

4:38 PM Changeset in webkit [241785] by Truitt Savell
  • 20 edits
    1 delete in trunk

Unreviewed, rolling out r241784.

Broke all OpenSource builds.

Reverted changeset:

"Web Inspector: Improve ES6 Class instances in Heap Snapshot
instances view"
https://bugs.webkit.org/show_bug.cgi?id=172848
https://trac.webkit.org/changeset/241784

4:07 PM Changeset in webkit [241784] by Joseph Pecoraro
  • 19 edits
    1 add in trunk

Web Inspector: Improve ES6 Class instances in Heap Snapshot instances view
https://bugs.webkit.org/show_bug.cgi?id=172848
<rdar://problem/25709212>

Reviewed by Mark Lam.

JSTests:

  • typeProfiler/inheritance.js:

Rewrite the test slightly for clarity. The hoisting was confusing.

  • heapProfiler/class-names.js: Added.

(MyES5Class):
(MyES6Class):
(MyES6Subclass):
Test object types and improved class names.

  • heapProfiler/driver/driver.js:

(CheapHeapSnapshotNode):
(CheapHeapSnapshot):
(createCheapHeapSnapshot):
(HeapSnapshot):
(createHeapSnapshot):
Update snapshot parsing from version 1 to version 2.

Source/JavaScriptCore:

  • heap/HeapSnapshotBuilder.h:
  • heap/HeapSnapshotBuilder.cpp:

Update the snapshot version. Change the node's 0 | 1 internal value
to be a 32bit bit flag. This is nice in that it is both compatible
with the previous snapshot version and the same size. We can use more
flags in the future.

(JSC::HeapSnapshotBuilder::json):
In cases where the classInfo gives us "Object" check for a better
class name by checking (o).proto.constructor.name. We avoid this
check in cases where (o).hasOwnProperty("constructor") which is the
case for most Foo.prototype objects. Otherwise this would get the
name of the Foo superclass for the Foo.prototype object.

  • runtime/JSObject.cpp:

(JSC::JSObject::calculatedClassName):
Handle some possible edge cases that were not handled before, such as
a JSObject without a GlobalObject or an object which doesn't
have a default getPrototype. Try to make the code a little clearer.

Source/WebInspectorUI:

  • UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:

(HeapSnapshot):
Support the new snapshot version. The only thing that changes are the
node flags, and its actually completely compatible with version 1.

(HeapSnapshot.updateCategoriesAndMetadata):
List the count of object type instances in each class category.

(HeapSnapshot.prototype.serializeNode):
Include whether or not the node is an object type.

  • UserInterface/Proxies/HeapSnapshotNodeProxy.js:

(WebInspector.HeapSnapshotNodeProxy):
(WebInspector.HeapSnapshotNodeProxy.deserialize):
Add a new Node isObjectType property based on the new data.

  • UserInterface/Views/HeapSnapshotClassDataGridNode.js:

(WebInspector.HeapSnapshotClassDataGridNode.prototype.createCellContent):

  • UserInterface/Views/HeapSnapshotClusterContentView.js:

(WebInspector.HeapSnapshotClusterContentView.iconStyleClassNameForClassName):
If a class contains 50% or more object type instances then treat it as such
instead of defaulting to native.

  • UserInterface/Views/HeapSnapshotDataGridTree.js:

(WebInspector.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):

  • UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:

(WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCellContent):
We can be more specific than the default if the individual instance is
known to be an object type.

LayoutTests:

  • inspector/unit-tests/heap-snapshot-expected.txt:
  • inspector/unit-tests/heap-snapshot.html:

Update for the new node flag.

3:27 PM Changeset in webkit [241783] by rmorisset@apple.com
  • 3 edits in trunk/Source/JavaScriptCore

B3-O2 incorrectly optimizes this subtest
https://bugs.webkit.org/show_bug.cgi?id=194625

Reviewed by Saam Barati.

Trivial fix. Instead of doing

if (!cond) foo else bar => if (cond) bar else foo

B3LowerToAir was doing

if (xC) foo else bar => if (cond) bar else foo whenever C&1, even if C was for example 3.

  • b3/B3LowerToAir.cpp:
  • b3/testb3.cpp:

(JSC::B3::testBitNotOnBooleanAndBranch32):
(JSC::B3::testNotOnBooleanAndBranch32): Added.

3:18 PM Changeset in webkit [241782] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WTF

Unreviewed, rolling out r241770.
https://bugs.webkit.org/show_bug.cgi?id=194833

Caused crashes (Requested by smfr on #webkit).

Reverted changeset:

"Code quality cleanup in NeverDestroyed"
https://bugs.webkit.org/show_bug.cgi?id=194824
https://trac.webkit.org/changeset/241770

3:17 PM Changeset in webkit [241781] by rmorisset@apple.com
  • 2 edits in trunk/Source/JavaScriptCore

CachedCall should not consider it UNLIKELY that it will not stack overflow
https://bugs.webkit.org/show_bug.cgi?id=194831

Reviewed by Mark Lam.

  • interpreter/CachedCall.h:

(JSC::CachedCall::CachedCall):

3:07 PM Changeset in webkit [241780] by rniwa@webkit.org
  • 3 edits
    2 adds in trunk

REGRESSION(r240909): Release assertion in FrameLoader::loadPostRequest when opening new window
https://bugs.webkit.org/show_bug.cgi?id=194820

Reviewed by Geoffrey Garen.

Source/WebCore:

This release assertion was wrong. The invocation of PolicyChecker::checkNewWindowPolicy in FrameLoader
doesn’t require PolicyChecker's load type to be set in PolicyChecker because FrameLoader's
continueLoadAfterNewWindowPolicy invokes loadWithNavigationAction which sets the load type later,
and we don't rely on PolicyChecker's load type until then.

Fixed the crash by removing relese asserts before invoking checkNewWindowPolicy accordingly.

This patch reverts r241015 since it too was asserting that PolicyChecker's load type is set before
invoking checkNewWindowPolicy which is not the right assumption.

Test: fast/loader/navigate-with-post-to-new-target-after-back-forward-navigation.html

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadPostRequest):

LayoutTests:

Added a regression test.

  • fast/loader/navigate-with-post-to-new-target-after-back-forward-navigation-expected.txt: Added.
  • fast/loader/navigate-with-post-to-new-target-after-back-forward-navigation.html: Added.
2:57 PM Changeset in webkit [241779] by Antti Koivisto
  • 3 edits in trunk/Source/WebKit

Pass rootContentsLayer to Mac remote layer tree
https://bugs.webkit.org/show_bug.cgi?id=194828

Reviewed by Simon Fraser.

Make this code path work again.

  • Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:

(ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
(ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):

  • UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:

(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):

2:51 PM Changeset in webkit [241778] by achristensen@apple.com
  • 13 edits in trunk/Source/WebKit

Reduce use of LegacySync IPC messages
https://bugs.webkit.org/show_bug.cgi?id=194783

Reviewed by Geoffrey Garen.

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::handleSynchronousMessage):

  • UIProcess/WebProcessPool.h:
  • UIProcess/WebProcessPool.messages.in:
  • UIProcess/WebProcessProxy.cpp:

(WebKit::WebProcessProxy::getPlugins):
(WebKit::WebProcessProxy::shouldTerminate):

  • UIProcess/WebProcessProxy.h:
  • UIProcess/WebProcessProxy.messages.in:
  • WebProcess/Plugins/PluginProcessConnection.cpp:

(WebKit::PluginProcessConnection::setException):

  • WebProcess/Plugins/PluginProcessConnection.h:
  • WebProcess/Plugins/PluginProcessConnection.messages.in:
  • WebProcess/Plugins/PluginProxy.cpp:

(WebKit::PluginProxy::didCreatePlugin):
(WebKit::PluginProxy::didFailToCreatePlugin):
(WebKit::PluginProxy::proxiesForURL):
(WebKit::PluginProxy::cookiesForURL):
(WebKit::PluginProxy::getAuthenticationInfo):
(WebKit::PluginProxy::getPluginElementNPObject):
(WebKit::PluginProxy::evaluate):
(WebKit::PluginProxy::createPluginContainer):

  • WebProcess/Plugins/PluginProxy.h:
  • WebProcess/Plugins/PluginProxy.messages.in:
2:49 PM Changeset in webkit [241777] by achristensen@apple.com
  • 2 edits in trunk/Source/WebKit

Remove assertion introduced in r229683
https://bugs.webkit.org/show_bug.cgi?id=194825
<rdar://problem/47628258>

Reviewed by Geoffrey Garen.

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
If we reach this code and the form's original Document's Frame has been destroyed,
we have already been told to submit the form so do so, just like we do if the WebPage
has been destroyed. This is a rare edge case having to do with the timing of Frame
destruction and decidePolicyForNavigationAction response, which unfortunately does not
reproduce with a test case unless the timing of IPC is just right.

2:42 PM Changeset in webkit [241776] by Truitt Savell
  • 2 edits in trunk/LayoutTests

[ iOS ] Layout Tests in editing/pasteboard/data-transfer-set-data-* are flaky Timeouts
https://bugs.webkit.org/show_bug.cgi?id=188892

Unreviewed test gardening.

  • platform/ios/TestExpectations:
2:36 PM Changeset in webkit [241775] by Alan Bujtas
  • 2 edits in trunk/Source/WebCore

Fix post-commit feedback.

Unreviewed.

  • layout/floats/FloatingContext.cpp:

(WebCore::Layout::FloatingPair::intersects const):

2:33 PM Changeset in webkit [241774] by Alan Bujtas
  • 4 edits in trunk

[LFC][Floats] Remove redundant intersecting logic
https://bugs.webkit.org/show_bug.cgi?id=194804

Reviewed by Antti Koivisto.

Source/WebCore:

floatAvoider.overflowsContainingBlock() check already (and properly) takes care of the far left/right case (see comment).

  • layout/floats/FloatingContext.cpp:

(WebCore::Layout::FloatingContext::floatingPosition const):
(WebCore::Layout::FloatingPair::intersects const):

Tools:

  • LayoutReloaded/misc/LFC-passing-tests.txt:
2:28 PM Changeset in webkit [241773] by commit-queue@webkit.org
  • 3 edits in trunk/LayoutTests

[ Mac WK2 iOS ] REGRESSION (r231008) Layout Test http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=194826

Unreviewed test gardening.

Patch by Shawn Roberts <Shawn Roberts> on 2019-02-19

  • platform/ios-wk2/TestExpectations: Marking Debug flaky while waiting for bug fix
  • platform/mac-wk2/TestExpectations: Marking Mac WK2 flaky while waiting for bug fix
2:03 PM Changeset in webkit [241772] by mark.lam@apple.com
  • 2 edits in trunk/Source/JavaScriptCore

Fix DFG doesGC() for TryGetById and ProfileType nodes.
https://bugs.webkit.org/show_bug.cgi?id=194821
<rdar://problem/48206690>

Reviewed by Saam Barati.

Fix doesGC() for the following nodes:

ProfileType:

calls operationProcessTypeProfilerLogDFG(), which can calculatedClassName(),
which can call JSString::tryGetValue(), which can resolve a rope.

TryGetById:

calls operationTryGetByIdOptimize(), which can startWatchingPropertyForReplacements()
on a structure, which can allocate StructureRareData.

  • dfg/DFGDoesGC.cpp:

(JSC::DFG::doesGC):

1:47 PM Changeset in webkit [241771] by dino@apple.com
  • 3 edits in trunk/Tools

Clean-up output from generate-xcfilelists so it can be filtered
https://bugs.webkit.org/show_bug.cgi?id=194795

Reviewed by Joseph Pecoraro (and Keith Rollin).

Replace the "..." with "GXCF:" in generate-xcfilelists output, and
make a slight tweak to filter-build-webkit so such lines are marked
as plain.

  • Scripts/filter-build-webkit:
  • Scripts/generate-xcfilelists:
12:45 PM Changeset in webkit [241770] by keith_miller@apple.com
  • 2 edits in trunk/Source/WTF

Code quality cleanup in NeverDestroyed
https://bugs.webkit.org/show_bug.cgi?id=194824

Reviewed by Yusuke Suzuki.

First, move data members to the end of the class per WebKit
style. Also, add forbid heap allocation since we expect the
NeverDestroyed classes to be static.

  • wtf/NeverDestroyed.h:
12:14 PM Changeset in webkit [241769] by ysuzuki@apple.com
  • 7 edits
    2 adds in trunk/Source/JavaScriptCore

[JSC] Introduce JSNonDestructibleProxy for JavaScriptCore.framework's GlobalThis
https://bugs.webkit.org/show_bug.cgi?id=194799

Reviewed by Saam Barati.

JSProxy is destructible one because we have JSWindowProxy which has ref counted object.
However, JavaScriptCore.framework's JSProxy for GlobalThis does not need to be destructible.
This is important since we need to separate Heap subspaces between destructible and non-destructible objects.
If we can put more and more objects in non-destructible status, we can get rid of low-usage MarkedBlock.
This patch adds JSNonDestructibleProxy, which is not destructible JSProxy. While it inherits JSDestructibleObject,
we can make the subclass still non-destructible thanks to Subspace mechanism. This drops one more low-usage MarkedBlock.

  • CMakeLists.txt:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Sources.txt:
  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::resetPrototype):
(JSC::JSGlobalObject::finishCreation):

  • runtime/JSNonDestructibleProxy.cpp: Added.
  • runtime/JSNonDestructibleProxy.h: Added.

(JSC::JSNonDestructibleProxy::subspaceFor):
(JSC::JSNonDestructibleProxy::create):
(JSC::JSNonDestructibleProxy::createStructure):
(JSC::JSNonDestructibleProxy::JSNonDestructibleProxy):

  • runtime/JSProxy.h:

(JSC::JSProxy::JSProxy):

12:01 PM Changeset in webkit [241768] by rmorisset@apple.com
  • 2 edits in trunk/Source/JavaScriptCore

B3ReduceStrength::simplifyCFG() could do a lot more on each iteration
https://bugs.webkit.org/show_bug.cgi?id=194475

Reviewed by Saam Barati.

B3ReduceStrength::simplifyCFG() does three optimizations (which I will call A, B and C):

  • A makes any terminal that points to a block that is empty except for a jump point to that jump's target instead.
  • B transforms any branch or switch that points to a single block into a jump
  • C finds blocks ending with jumps, whose successor has a single predecessor, and inline that successor block in place of the jump

It currently is limited in the following way:

  • A and C can only fire once per block per iteration
  • B can create jumps that would trigger A, but they may not be seen until the next iteration

Both problems are mitigated by going through the blocks in post-order, so that when a block is optimized most of its successors have already been optimized.
In a sense it is the symmetric of the peephole optimizer that goes in pre-order so that when an instruction is optimized most of its children have already been optimized.

On JetStream2 it reduces the average number of iterations from 3.35 to 3.24.

  • b3/B3ReduceStrength.cpp:
11:05 AM Changeset in webkit [241767] by Alan Coon
  • 9 edits in branches/safari-608.1.5.1-branch

Cherry-pick r241752. rdar://problem/48055151

REGRESSION (PSON): Can't access optumbank.com from myuhc.com
https://bugs.webkit.org/show_bug.cgi?id=194797
<rdar://problem/48055151>

Reviewed by Geoffrey Garen.

Source/WebKit:

The issue was caused by us mistakenly process-swapping for a same-site server side redirect.
The reason we were getting it wrong is because the logic in
WebProcessPool::processForNavigationInternal() was expecting page.process() to be the source
process and page.pageLoadState().url() to be the source URL. Those assumptions are incorrect
when a server-side redirect occurs in a provisional process. In such case, the source process
is the ProvisionalPageProxy's process and the source URL is the provisional URL, not the
committed one.

  • UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::didPerformServerRedirect): (WebKit::ProvisionalPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame): (WebKit::ProvisionalPageProxy::didReceiveMessage):
  • UIProcess/ProvisionalPageProxy.h: Make sure the provisional page forwards IPC related to server-side redirects to the page so that the client gets informed.
  • UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedNavigationPolicyDecision): (WebKit::WebPageProxy::didPerformServerRedirect): (WebKit::WebPageProxy::didPerformServerRedirectShared):
  • UIProcess/WebPageProxy.h:
  • UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigation): (WebKit::WebProcessPool::processForNavigationInternal):
  • UIProcess/WebProcessPool.h:

Tools:

Add API test coverage.

  • TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

11:05 AM Changeset in webkit [241766] by Alan Coon
  • 12 edits in branches/safari-608.1.5.1-branch/Source

Cherry-pick r241721. rdar://problem/47677951

AX: PSON: Going back from apple.com to search results, cannot interact with HTML content. Disabling Swap Processes on Cross-Site Navigation resolves the issue.
https://bugs.webkit.org/show_bug.cgi?id=194742

Reviewed by Chris Dumez.

Source/WebCore:

With the new process model, WebProcess hits a case where it tries to send the "page loaded" notification before VoiceOver
had a chance to register for any notifications. This leads to those notifications being dropped (and thus this bug).

This change instead asks the UIProcess to send the notification, which we know VoiceOver has registered for, and can reliably
receive notifications.

It also sends the notification for "load failures," which to the VO users' perspective amounts to the same thing as a successful
page load.

  • accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):

Source/WebKit:

Re-initialize the accessibility web process tokens when swapping processes.
Send page load notifications from the UIProcess instead of the WebProcess to improve reliability.

  • UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::didFinishLoadForMainFrame): (WebKit::PageClientImpl::didFailLoadForMainFrame):
  • WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::reinitializeWebPage):
  • WebProcess/WebPage/WebPage.h:
  • WebProcess/WebPage/gtk/WebPageGtk.cpp: (WebKit::WebPage::platformReinitialize): (WebKit::WebPage::platformDetach): Deleted. (WebKit::WebPage::platformEditorState const): Deleted. (WebKit::WebPage::updateAccessibilityTree): Deleted. (WebKit::WebPage::performDefaultBehaviorForKeyEvent): Deleted. (WebKit::WebPage::platformCanHandleRequest): Deleted. (WebKit::WebPage::platformUserAgent const): Deleted. (WebKit::WebPage::getCenterForZoomGesture): Deleted. (WebKit::WebPage::setInputMethodState): Deleted. (WebKit::WebPage::collapseSelectionInFrame): Deleted.
  • WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::platformReinitialize):
  • WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformReinitialize):
  • WebProcess/WebPage/win/WebPageWin.cpp: (WebKit::WebPage::platformReinitialize):
  • WebProcess/WebPage/wpe/WebPageWPE.cpp: (WebKit::WebPage::platformReinitialize):

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

11:05 AM Changeset in webkit [241765] by Alan Coon
  • 2 edits in branches/safari-608.1.5.1-branch/Source/WebKit

Cherry-pick r241641. rdar://problem/47833813

NetworkDataTask should check its client before calling shouldCaptureExtraNetworkLoadMetrics
https://bugs.webkit.org/show_bug.cgi?id=194732

Reviewed by Geoffrey Garen.

NetworkDataTask may be kept alive if refing it after its NetworkLoad is gone.
This might happen for instance in DownloadManager or when checking for TLS certificates.
In that case, if the NetworkLoad gets destroyed, it clears the client of the NetworkDataTask.
To ensure that NetworkDataTask does not try to use its client, add a null check.

  • NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics const):

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

11:05 AM Changeset in webkit [241764] by Alan Coon
  • 2 edits in branches/safari-608.1.5.1-branch/Source/WebKit

Cherry-pick r241631. rdar://problem/48126255

[PSON] Disable WebContent process cache on devices with less than 3GB of RAM
https://bugs.webkit.org/show_bug.cgi?id=194726
<rdar://problem/48126255>

Reviewed by Geoffrey Garen.

  • UIProcess/WebProcessCache.cpp: (WebKit::WebProcessCache::updateCapacity):

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

11:05 AM Changeset in webkit [241763] by Alan Coon
  • 4 edits in branches/safari-608.1.5.1-branch

Cherry-pick r241606. rdar://problem/47884404

Regression(PSON) Navigating quickly back and forth can lead to getting 'about:blank' in the backforward list
https://bugs.webkit.org/show_bug.cgi?id=194717
<rdar://problem/47884404>

Reviewed by Brady Eidson.

Source/WebKit:

When the client does a history navigation, the UIProcess sends a WebPage::GoToBackForwardItem IPC to the
WebProcess and the WebProcess sends a WebPageProxy::BackForwardGoToItem IPC back to the UIProcess to
update the current item in the BackForwardList. This means that there is a slight delay between the
point a client requests a history navigation and the point where the BackForwardList's current item gets
update. This delay is pre-existing behavior and not new to PSON.

However, with PSON enabled, if we decide to process-swap for the history navigation, we'll tell the
previous (committed) process to ignore the load and we ask a new (provisional) process to do the history
navigation. When the previous process receives the request to ignore the history navigation, it restores
the History's current item to the one previous the navigation, which sends a WebPageProxy::GoToBackForwardItem
IPC to the UIProcess to update the BackForwardList as well. In parallel, the new process starts the
history navigation and also sends a WebPageProxy::GoToBackForwardItem to update the BackForwardList's
current item as well. We end up with a race between the 2 GoToBackForwardItem IPC messages coming from
the old and new process. If the old process's message loses the race, we end up with the wrong current
history item getting set in the UIProcess. Later, when we commit the provisional load and try to suspend
the previous page, we would save the SuspendedPage on the *wrong* BackForwardList item. If one tries to
load this BackForwardList item later, we'll use its SuspendedPage and try to unsuspend it. However,
because the PageCache entry is saved on another HistoryItem than the one getting loaded in the WebProcess
side, we attempt to do a regular load instead of a PageCache restore. We end up failing the load because
pages cannot trigger new loads while in page cache. Because the load fails, we end up loading the
initial empty document and this is how we end up with 'about:blank' in the back forward list.

To address the issue, update WebPageProxy::backForwardGoToItem() to ignore messages from the old/committed
WebProcess when there is a pending provisional load. If the committed processes starts a legit new
load, it would clear any existing pending provisional load before attempting the call backForwardGoToItem().
As a result, ignoring such messages from the old processes when there is a pending provisional load is
safe.

In the future, we should probably move more of the history / backForwardList management to the UIProcess
to avoid this sort of issues. This would be a much larger refactoring though so I am going with this
simpler fix that is easily cherry-pickable for now.

  • UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::suspendCurrentPageIfPossible): (WebKit::WebPageProxy::continueNavigationInNewProcess): (WebKit::WebPageProxy::backForwardGoToItem):

Tools:

Add API test coverage.

  • TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

11:05 AM Changeset in webkit [241762] by Alan Coon
  • 29 edits
    2 adds in branches/safari-608.1.5.1-branch

Cherry-pick r241556. rdar://problem/46793397

[PSON] Introduce a WebContent Process cache
https://bugs.webkit.org/show_bug.cgi?id=194594
<rdar://problem/46793397>

Reviewed by Geoff Garen.

Source/WebCore:

Update localizable strings.

  • en.lproj/Localizable.strings:

Source/WebKit:

Introduce a WebContent Process cache to reduce the number of process launches when
process swap on navigation is enabled, and to reduce the power cost of the feature.

If a WebProcess loaded pages from a single registrable domain then it is eligible
for the cache. When process-swapping on navigation to a new registrable domain, we
now attempt to retrieve a process from the cache for the domain in question instead
of always launching a new one.

The WebProcess cache currently has the following attributes:

  • It may contains 4 processes per GB of RAM the machine has, up to 30 processes.
  • WebProcesses automatically get evicted from the cache after 30 minutes.
  • If the application is no longer the active app, then the cache will get cleared after 5 minutes.
  • WebProcesses that are in the cache are reported as "(Cached)" in Activity Monitor.

The WebProcess cache is currently disabled by default and can by enabled by the
client via SPI.

  • Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::WebBackForwardListItem):
  • Shared/WebBackForwardListItem.h: (WebKit::WebBackForwardListItem::lastProcessIdentifier const): (WebKit::WebBackForwardListItem::setLastProcessIdentifier): Add new lastProcessIdentifier data member that reflects which process this item was last loaded in. It is normally identical to the identifier of the process that created the item but it gets overriden in case of cross-site client-side redirect, since a new process takes over the item in this case.
  • Sources.txt: Add new source file.
  • UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy):
  • UIProcess/API/APIProcessPoolConfiguration.h:
  • UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationUsesWebProcessCache): (WKContextConfigurationSetUsesWebProcessCache):
  • UIProcess/API/C/WKContextConfigurationRef.h:
  • UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
  • UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration setUsesWebProcessCache:]): (-[_WKProcessPoolConfiguration usesWebProcessCache]): Add new SPI to enable the WebProcess cache.
  • UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _webProcessCountIgnoringPrewarmedAndCached]):
  • UIProcess/API/Cocoa/WKProcessPoolPrivate.h: Add new SPI for testing which returns the number of WebProcesses ignoring both prewarmed and cached ones.
  • UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::registerNotificationObservers): (WebKit::WebProcessPool::unregisterNotificationObservers): Add application active state observers as the WebProcess cache gets cleared when the application resigns active state for more than 5 minutes.
  • UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::loadRequest): When doing a load in a new process with the BackForwardList locked (i.e. client-side redirect), make sure we update the last process identifier for the BackForwardListItem. This is important because the logic in WebProcessPool::processForNavigation() relies on this identifier to select which process to do the history navigation into, and we want to do the load in the post-redirect process, not the pre-redirect one.
  • UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared): Tell the WebProcess whenever a main frame provisional load is started, providing the URL.
  • UIProcess/WebProcessCache.cpp: Added. (WebKit::WebProcessCache::WebProcessCache): (WebKit::WebProcessCache::addProcess): (WebKit::WebProcessCache::takeProcess): (WebKit::WebProcessCache::updateMaximumSize): (WebKit::WebProcessCache::clear): (WebKit::WebProcessCache::setApplicationIsActive): (WebKit::WebProcessCache::evictProcess): (WebKit::WebProcessCache::CachedProcess::CachedProcess): (WebKit::WebProcessCache::CachedProcess::~CachedProcess): (WebKit::WebProcessCache::CachedProcess::takeProcess): (WebKit::WebProcessCache::CachedProcess::evictionTimerFired):
  • UIProcess/WebProcessCache.h: Added. (WebKit::WebProcessCache::maximumSize): (WebKit::WebProcessCache::size const): (WebKit::WebProcessCache::CachedProcess::process): Add process cache implementation.
  • UIProcess/WebProcessPool.cpp: (WebKit::m_webProcessCache): WebProcessCache is stored on the WebProcessPool via m_webProcessCache data member.

(WebKit::WebProcessPool::~WebProcessPool):
Clear the WebProcess cache in the destructor.

(WebKit::WebProcessPool::setApplicationIsActive):
Notify the WebProcessCache whenever the application's active state changes.

(WebKit::WebProcessPool::createWebPage):
If the state of PSON changes via the experimental features menu, dynamically
update the WebProcessCache's size. This is needed because the cache is disabled
when PSON is disabled.

(WebKit::WebProcessPool::handleMemoryPressureWarning):
Clear the WebProcess cache on memory pressure.

(WebKit::WebProcessPool::processForNavigationInternal):
Query the WebProcessCache before attempting to create a new WebProcess for a cross-site
navigation.

(WebKit::WebProcessPool::findReusableSuspendedPageProcess):
This logic was split out of processForNavigationInternal() to reduce the size
of the method.

  • UIProcess/WebProcessPool.h:
  • UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::setIsInProcessCache): Update the isInProcessCache flag on the WebProcessProxy and send an IPC to the WebContent process so that it can update its name in Activity Monitor. We also need to stop holding a strong reference to the WebProcessPool whenever the process is in the cache, similarly to what we do for pre-warmed processes, given that such processes should not keep the process pool alive.

(WebKit::WebProcessProxy::addExistingWebPage):
Assert that we never try to add a page to a cached process, it should be taken out of the
cache before use.

(WebKit::WebProcessProxy::hasProvisionalPageWithID const):
(WebKit::WebProcessProxy::isAllowedToUpdateBackForwardItem const):
(WebKit::WebProcessProxy::updateBackForwardItem):
In case of client-side redirects, the previous process would sometimes send an IPC causing
the UIProcess' backforward list item to get updated with the pre-redirect URL after we've
already redirected. This previously would be unlikely to occur because we do not suspend
client-redirect pages and their process would normally exit before getting a chance to send
the IPC. However, with the process cache, the bug became obvious as the process would stay
alive and send up the "bad" IPC. To address the issue, we now only let the IPC update the
item if the item's page is (still) associated with the process. In the future, we may want
to update the IPC so that it gets sent to the WebPageProxy instead of the WebProcessProxy.

(WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
If a cached WebProcess crashes, remove it from the cache so that we do not attempt to use
it for a load later.

(WebKit::WebProcessProxy::canBeAddedToWebProcessCache const):
Only cache WebProcesses that have loaded a single registrable domain. Also prevent caching
for service worker and inspector processes.

(WebKit::WebProcessProxy::maybeShutDown):
If the process is cacheable, add it to the cache instead of shutting it down right away.

(WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
Make sure we do not attempt to terminate a processes that is in the cache.

(WebKit::WebProcessProxy::didStartProvisionalLoadForMainFrame):
Whenever a main frame provisional load starts, make sure we update the process's associated
registrable domain. nullopt indicates that there is no associated domain yet. Null string
indicates that the process is associated with several registrable domain and is therefore
not eligible for caching.

  • UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::registrableDomain const): (WebKit::WebProcessProxy::isInProcessCache const): (WebKit::WebProcessProxy::provisionalPageCount const): Add convenience getters.
  • WebKit.xcodeproj/project.pbxproj: Add new files to project.
  • WebProcess/WebProcess.cpp: (WebKit::WebProcess::setIsInProcessCache):
  • WebProcess/WebProcess.h:
  • WebProcess/WebProcess.messages.in:
  • WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::updateProcessName): Update the WebProcess' name in Activity Monitor whenever it goes into or out of the WebProcess cache.

Tools:

Update API tests to turn on the WebContent Process cache.

  • TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

8:42 AM Changeset in webkit [241761] by commit-queue@webkit.org
  • 8 edits
    1 delete in trunk

Unreviewed, rolling out r241722.
https://bugs.webkit.org/show_bug.cgi?id=194801

Causing time outs and EWS failures after expectation file was
added. (Requested by ShawnRoberts on #webkit).

Reverted changeset:

"IndexedDB: leak IDBDatabase and IDBTransacstion in layout
tests"
https://bugs.webkit.org/show_bug.cgi?id=194709
https://trac.webkit.org/changeset/241722

8:06 AM WebKitGTK/2.22.x edited by cturner@igalia.com
(diff)
2:45 AM Changeset in webkit [241760] by graouts@webkit.org
  • 5 edits
    2 adds in trunk

[iOS] "touch-action: none" should not prevent text selection or tapping on a link
https://bugs.webkit.org/show_bug.cgi?id=194812
<rdar://problem/47901131>

Reviewed by Dean Jackson.

Source/WebKit:

We shouldn't prevent all gestures to be disabled when "touch-action: none" is set and instead follow the same code path we would use should
"pan-x", "pan-y" or "pinch-zoom" be used.

  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView _handleTouchActionsForTouchEvent:]):

LayoutTests:

Add a new test which checks that tapping on a link with "touch-action: none" does not prevent navigation.

  • pointerevents/ios/over-enter-out-leave.html:
  • pointerevents/ios/touch-action-none-link-traversal-expected.txt: Added.
  • pointerevents/ios/touch-action-none-link-traversal.html: Added.
  • pointerevents/utils.js: Since we now have two tests performing a tap, we add a ui.tap() method which is a wrapper for uiController.singleTapAtPoint().

(const.ui.new.UIController.prototype.tap):

2:22 AM Changeset in webkit [241759] by commit-queue@webkit.org
  • 2 edits in trunk/Tools

pytest is not correctly auto-installed
https://bugs.webkit.org/show_bug.cgi?id=194707

Patch by Pablo Saavedra <Pablo Saavedra> on 2019-02-19
Reviewed by Carlos Garcia Campos.

  • Scripts/webkitpy/thirdparty/init.py:

(AutoinstallImportHook._install_pytest):

2:04 AM Changeset in webkit [241758] by Tadeu Zagallo
  • 5 edits in trunk/Source/JavaScriptCore

Move bytecode cache-related filesystem code out of CodeCache
https://bugs.webkit.org/show_bug.cgi?id=194675

Reviewed by Saam Barati.

The code is only used for the bytecode-cache tests, so it should live in
jsc.cpp rather than in the CodeCache. The logic now lives in ShellSourceProvider,
which overrides the a virtual method in SourceProvider, cacheBytecode,
in order to write the cache to disk.

  • jsc.cpp:

(ShellSourceProvider::create):
(ShellSourceProvider::~ShellSourceProvider):
(ShellSourceProvider::cachePath const):
(ShellSourceProvider::loadBytecode):
(ShellSourceProvider::ShellSourceProvider):
(jscSource):
(GlobalObject::moduleLoaderFetch):
(functionDollarEvalScript):
(runWithOptions):

  • parser/SourceProvider.h:

(JSC::SourceProvider::cacheBytecode const):

  • runtime/CodeCache.cpp:

(JSC::writeCodeBlock):

  • runtime/CodeCache.h:

(JSC::CodeCacheMap::fetchFromDiskImpl):

1:18 AM Changeset in webkit [241757] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebInspectorUI

Web Inspector: Scripts timeline on-going-recording text looks poor in dark mode
https://bugs.webkit.org/show_bug.cgi?id=194809

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2019-02-19
Reviewed by Matt Baker.

  • UserInterface/Views/TimelineRecordingContentView.css:

(.content-view.timeline-recording > .content-browser .recording-progress > .status):

Note: See TracTimeline for information about the timeline view.