don.olmstead@sony.com [Thu, 21 Feb 2019 02:55:50 +0000 (02:55 +0000)]
[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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241858
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Thu, 21 Feb 2019 02:45:24 +0000 (02:45 +0000)]
Web Inspector: RTL: Scripts Timeline loading indicator has incorrect margins
https://bugs.webkit.org/show_bug.cgi?id=194882
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-02-20
Reviewed by Matt Baker.
* UserInterface/Views/TimelineRecordingContentView.css:
(.content-view.timeline-recording > .content-browser .recording-progress > .status > .indeterminate-progress-spinner):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241857
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Thu, 21 Feb 2019 01:36:04 +0000 (01:36 +0000)]
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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241856
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Thu, 21 Feb 2019 01:25:46 +0000 (01:25 +0000)]
[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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241855
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Thu, 21 Feb 2019 01:09:39 +0000 (01:09 +0000)]
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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241854
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Thu, 21 Feb 2019 00:51:57 +0000 (00:51 +0000)]
Unreviewed build fix after r241823.
* UIProcess/SuspendedPageProxy.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241853
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
dino@apple.com [Thu, 21 Feb 2019 00:48:37 +0000 (00:48 +0000)]
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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241852
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
don.olmstead@sony.com [Thu, 21 Feb 2019 00:19:16 +0000 (00:19 +0000)]
[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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241851
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
achristensen@apple.com [Thu, 21 Feb 2019 00:12:44 +0000 (00:12 +0000)]
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
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241850
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
mark.lam@apple.com [Thu, 21 Feb 2019 00:10:43 +0000 (00:10 +0000)]
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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241849
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
rniwa@webkit.org [Thu, 21 Feb 2019 00:06:27 +0000 (00:06 +0000)]
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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241848
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
ysuzuki@apple.com [Thu, 21 Feb 2019 00:03:17 +0000 (00:03 +0000)]
[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.
2. 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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241847
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
wenson_hsieh@apple.com [Wed, 20 Feb 2019 23:34:50 +0000 (23:34 +0000)]
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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241846
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Wed, 20 Feb 2019 23:30:03 +0000 (23:30 +0000)]
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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241845
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
tsavell@apple.com [Wed, 20 Feb 2019 23:26:54 +0000 (23:26 +0000)]
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
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241844
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
jer.noble@apple.com [Wed, 20 Feb 2019 23:25:23 +0000 (23:25 +0000)]
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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241843
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Wed, 20 Feb 2019 22:52:18 +0000 (22:52 +0000)]
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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241842
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
aestes@apple.com [Wed, 20 Feb 2019 22:37:28 +0000 (22:37 +0000)]
[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:
* JavaScriptCore.xcodeproj/project.pbxproj:
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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241841
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Wed, 20 Feb 2019 22:28:13 +0000 (22:28 +0000)]
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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241840
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
jond@apple.com [Wed, 20 Feb 2019 22:25:23 +0000 (22:25 +0000)]
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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241839
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Wed, 20 Feb 2019 22:22:17 +0000 (22:22 +0000)]
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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241838
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
ysuzuki@apple.com [Wed, 20 Feb 2019 22:22:07 +0000 (22:22 +0000)]
[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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241837
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
tsavell@apple.com [Wed, 20 Feb 2019 22:22:07 +0000 (22:22 +0000)]
[ 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 <sroberts@apple.com> on 2019-02-20
* platform/mac-wk2/TestExpectations: Marking as flaky until a fix lands
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241836
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
tsavell@apple.com [Wed, 20 Feb 2019 22:04:04 +0000 (22:04 +0000)]
[ 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 <sroberts@apple.com> on 2019-02-20
* platform/mac-wk1/TestExpectations: Marking as flaky until a fix lands
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241835
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
tsavell@apple.com [Wed, 20 Feb 2019 21:49:53 +0000 (21:49 +0000)]
[ 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 <sroberts@apple.com> on 2019-02-20
* platform/ios-wk2/TestExpectations: Marking as flaky until a fix lands
* platform/mac-wk2/TestExpectations: ditto
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241834
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
dbates@webkit.org [Wed, 20 Feb 2019 21:38:40 +0000 (21:38 +0000)]
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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241833
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
ysuzuki@apple.com [Wed, 20 Feb 2019 21:30:40 +0000 (21:30 +0000)]
[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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241832
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
tsavell@apple.com [Wed, 20 Feb 2019 21:24:56 +0000 (21:24 +0000)]
[ 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 <sroberts@apple.com> on 2019-02-20
* platform/mac-wk2/TestExpectations: Marking as flaky while waiting for fix to land
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241831
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
simon.fraser@apple.com [Wed, 20 Feb 2019 21:08:44 +0000 (21:08 +0000)]
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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241830
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
pvollan@apple.com [Wed, 20 Feb 2019 20:27:13 +0000 (20:27 +0000)]
[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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241829
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
dbates@webkit.org [Wed, 20 Feb 2019 20:25:28 +0000 (20:25 +0000)]
[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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241828
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
tsavell@apple.com [Wed, 20 Feb 2019 19:56:14 +0000 (19:56 +0000)]
[ 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 <sroberts@apple.com> on 2019-02-20
* platform/mac-wk2/TestExpectations: Marking as flaky while waiting for fix to land
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241827
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
achristensen@apple.com [Wed, 20 Feb 2019 19:43:44 +0000 (19:43 +0000)]
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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241826
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
timothy@apple.com [Wed, 20 Feb 2019 19:28:28 +0000 (19:28 +0000)]
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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241825
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Wed, 20 Feb 2019 19:23:28 +0000 (19:23 +0000)]
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
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241824
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Wed, 20 Feb 2019 19:19:26 +0000 (19:19 +0000)]
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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241823
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
zalan@apple.com [Wed, 20 Feb 2019 19:15:32 +0000 (19:15 +0000)]
[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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241822
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Wed, 20 Feb 2019 18:34:44 +0000 (18:34 +0000)]
[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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241821
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
don.olmstead@sony.com [Wed, 20 Feb 2019 18:23:19 +0000 (18:23 +0000)]
[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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241820
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Wed, 20 Feb 2019 18:15:00 +0000 (18:15 +0000)]
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 <sroberts@apple.com> on 2019-02-20
* platform/ios-simulator-wk2/TestExpectations: Updating test expectations while waiting for a fix
* platform/mac-wk2/TestExpectations: ditto
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241819
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Wed, 20 Feb 2019 18:05:40 +0000 (18:05 +0000)]
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
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241818
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Wed, 20 Feb 2019 17:11:33 +0000 (17:11 +0000)]
[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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241817
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
carlosgc@webkit.org [Wed, 20 Feb 2019 14:34:51 +0000 (14:34 +0000)]
[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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241816
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
aperez@igalia.com [Wed, 20 Feb 2019 10:16:00 +0000 (10:16 +0000)]
[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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241790
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
ysuzuki@apple.com [Wed, 20 Feb 2019 01:51:50 +0000 (01:51 +0000)]
[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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241789
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
simon.fraser@apple.com [Wed, 20 Feb 2019 01:39:34 +0000 (01:39 +0000)]
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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241788
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
joepeck@webkit.org [Wed, 20 Feb 2019 01:35:31 +0000 (01:35 +0000)]
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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241787
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
krollin@apple.com [Wed, 20 Feb 2019 01:31:11 +0000 (01:31 +0000)]
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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241786
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
tsavell@apple.com [Wed, 20 Feb 2019 00:38:20 +0000 (00:38 +0000)]
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
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241785
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
joepeck@webkit.org [Wed, 20 Feb 2019 00:07:28 +0000 (00:07 +0000)]
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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241784
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
rmorisset@apple.com [Tue, 19 Feb 2019 23:27:16 +0000 (23:27 +0000)]
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 (x^C) 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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241783
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Tue, 19 Feb 2019 23:18:27 +0000 (23:18 +0000)]
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
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241782
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
rmorisset@apple.com [Tue, 19 Feb 2019 23:17:17 +0000 (23:17 +0000)]
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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241781
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
rniwa@webkit.org [Tue, 19 Feb 2019 23:07:52 +0000 (23:07 +0000)]
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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241780
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
antti@apple.com [Tue, 19 Feb 2019 22:57:11 +0000 (22:57 +0000)]
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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241779
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
achristensen@apple.com [Tue, 19 Feb 2019 22:51:29 +0000 (22:51 +0000)]
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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241778
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
achristensen@apple.com [Tue, 19 Feb 2019 22:49:13 +0000 (22:49 +0000)]
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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241777
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
tsavell@apple.com [Tue, 19 Feb 2019 22:42:53 +0000 (22:42 +0000)]
[ 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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241776
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
zalan@apple.com [Tue, 19 Feb 2019 22:36:50 +0000 (22:36 +0000)]
Fix post-commit feedback.
Unreviewed.
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingPair::intersects const):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241775
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
zalan@apple.com [Tue, 19 Feb 2019 22:33:43 +0000 (22:33 +0000)]
[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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241774
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Tue, 19 Feb 2019 22:28:03 +0000 (22:28 +0000)]
[ 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 <sroberts@apple.com> 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
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241773
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
mark.lam@apple.com [Tue, 19 Feb 2019 22:03:54 +0000 (22:03 +0000)]
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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241772
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
dino@apple.com [Tue, 19 Feb 2019 21:47:13 +0000 (21:47 +0000)]
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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241771
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
keith_miller@apple.com [Tue, 19 Feb 2019 20:45:52 +0000 (20:45 +0000)]
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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241770
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
ysuzuki@apple.com [Tue, 19 Feb 2019 20:14:57 +0000 (20:14 +0000)]
[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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241769
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
rmorisset@apple.com [Tue, 19 Feb 2019 20:01:42 +0000 (20:01 +0000)]
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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241768
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Tue, 19 Feb 2019 16:42:21 +0000 (16:42 +0000)]
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
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241761
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
graouts@webkit.org [Tue, 19 Feb 2019 10:45:48 +0000 (10:45 +0000)]
[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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241760
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Tue, 19 Feb 2019 10:22:14 +0000 (10:22 +0000)]
pytest is not correctly auto-installed
https://bugs.webkit.org/show_bug.cgi?id=194707
Patch by Pablo Saavedra <psaavedra@igalia.com> on 2019-02-19
Reviewed by Carlos Garcia Campos.
* Scripts/webkitpy/thirdparty/__init__.py:
(AutoinstallImportHook._install_pytest):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241759
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
tzagallo@apple.com [Tue, 19 Feb 2019 10:04:53 +0000 (10:04 +0000)]
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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241758
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Tue, 19 Feb 2019 09:18:08 +0000 (09:18 +0000)]
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 <pecoraro@apple.com> on 2019-02-19
Reviewed by Matt Baker.
* UserInterface/Views/TimelineRecordingContentView.css:
(.content-view.timeline-recording > .content-browser .recording-progress > .status):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241757
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
dinfuehr@igalia.com [Tue, 19 Feb 2019 07:15:57 +0000 (07:15 +0000)]
[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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241756
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
achristensen@apple.com [Tue, 19 Feb 2019 03:43:35 +0000 (03:43 +0000)]
Adjust test expectations after r241754
https://bugs.webkit.org/show_bug.cgi?id=194510
* platform/wk2/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241755
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
achristensen@apple.com [Tue, 19 Feb 2019 03:03:02 +0000 (03:03 +0000)]
Revert functional part of r241451
https://bugs.webkit.org/show_bug.cgi?id=194510
Source/WebKit:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
It caused crashes and assertions on Linux and Cocoa without safe browsing, which
means it's fundamentally flawed in some way. The testing piping was fine.
LayoutTests:
* platform/wk2/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241754
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
mark.lam@apple.com [Tue, 19 Feb 2019 02:32:10 +0000 (02:32 +0000)]
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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241753
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Tue, 19 Feb 2019 02:29:02 +0000 (02:29 +0000)]
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
darin@apple.com [Tue, 19 Feb 2019 02:04:33 +0000 (02:04 +0000)]
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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241751
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Tue, 19 Feb 2019 00:52:40 +0000 (00:52 +0000)]
Web Inspector: Provide a way to avoid a recording auto-stop on reload
https://bugs.webkit.org/show_bug.cgi?id=194793
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-02-18
Reviewed by Matt Baker.
* Localizations/en.lproj/localizedStrings.js:
New tooltip.
* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.prototype.willAutoStop):
(WI.TimelineManager.prototype.relaxAutoStop):
Getter and relaxer for auto stop behavior.
* UserInterface/Views/AuditNavigationSidebarPanel.js:
(WI.AuditNavigationSidebarPanel.prototype.showDefaultContentView):
Drive-by fix some whitespace issues.
* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView):
(WI.TimelineTabContentView.prototype._showRecordButton):
(WI.TimelineTabContentView.prototype._showContinueButton):
(WI.TimelineTabContentView.prototype._updateNavigationBarButtons):
(WI.TimelineTabContentView.prototype._capturingStartedOrStopped):
(WI.TimelineTabContentView.prototype._globalModifierKeysDidChange):
(WI.TimelineTabContentView.prototype._continueButtonClicked):
Show a "continue" like icon instead of the usual stop button when
a recording would auto-stop and the alt key is down. When pressed
this button will relax the auto-stop and continue the recording
until explicitly stopped by the user.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241750
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
wenson_hsieh@apple.com [Tue, 19 Feb 2019 00:43:40 +0000 (00:43 +0000)]
[iOS] Support pasting item-provider-backed data on the pasteboard as attachment elements
https://bugs.webkit.org/show_bug.cgi?id=194670
<rdar://problem/
39066529>
Reviewed by Tim Horton.
Source/WebCore:
Adds support for pasting files on the pasteboard as attachment elements, if the attachment element runtime
switch is enabled. Currently, the only types of data that can be pasted as attachments are images, which take a
special codepath in WebContentReader::readImage.
This patch adds a readDataBuffer method that converts a given blob of data from the pasteboard into an
attachment-element-backed representation in the DOM (i.e. either an attachment element or image element that
contains an attachment element). In the case where the given pasteboard item has been explicitly marked as an
attachment (via the preferredPresentationStyle hint) and the item has at least one type representation that
conforms to "public.content", we take this codepath instead of first attempting the web content reading types
supported by default in WebKit.
See below for more detail.
Test: WKAttachmentTestsIOS.InsertPastedFilesAsAttachments
* editing/Editor.cpp:
(WebCore::Editor::clientReplacementURLForResource): Deleted.
* editing/Editor.h:
* editing/WebContentReader.h:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::mimeTypeFromContentType):
(WebCore::contentTypeIsSuitableForInlineImageRepresentation):
(WebCore::createFragmentAndAddResources):
(WebCore::sanitizeMarkupWithArchive):
Remove all logic for handling subresource URL replacement. See WebKit ChangeLog for more details on this.
(WebCore::WebContentReader::readImage):
(WebCore::attachmentForFilePath):
(WebCore::attachmentForData):
Add a helper that creates an attachment element for a given blob of data and content type. The logic here is
quite similar to that of attachmentForFilePath, and we should find a way to either merge them, or pull out more
of their similarities into helper functions.
(WebCore::WebContentReader::readDataBuffer):
(WebCore::replaceSubresourceURLsWithURLsFromClient): Deleted.
Remove more logic for handling subresource URL replacement. See WebKit ChangeLog for more details on this.
* loader/EmptyClients.cpp:
* page/EditorClient.h:
* platform/Pasteboard.h:
* platform/PasteboardItemInfo.h:
(WebCore::PasteboardItemInfo::contentTypeForHighestFidelityItem const):
(WebCore::PasteboardItemInfo::pathForHighestFidelityItem const):
(WebCore::PasteboardItemInfo::encode const):
(WebCore::PasteboardItemInfo::decode):
Add contentTypesByFidelity to PasteboardItemInfo, instead of requesting this information using a separate IPC
message. This means we can also remove getTypesByFidelityForItemAtIndex, and just use the item's types in
fidelity order instead.
* platform/PasteboardStrategy.h:
* platform/PlatformPasteboard.h:
* platform/ios/AbstractPasteboard.h:
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::read):
Shave off (potentially many) sync IPC messages to the UI process by pulling each call to
informationForItemAtIndex out of the inner loop when reading web content.
(WebCore::Pasteboard::readRespectingUTIFidelities):
Shave off one extraneous sync IPC message by rolling the types in fidelity order into the request for
PasteboardItemInfo, instead of being sent in a separate message.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::informationForItemAtIndex):
Populate contentTypesForFileUpload in the case where UIPasteboard is used (i.e. copy and paste).
(WebCore::PlatformPasteboard::getTypesByFidelityForItemAtIndex): Deleted.
* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard pasteboardTypesByFidelityForItemAtIndex:]): Deleted.
Source/WebKit:
Remove all IPC plumbing for getTypesByFidelityForItemAtIndex, now that the types in fidelity order have been
rolled into PasteboardItemInfo.
Additionally, remove support for subresource URL replacement. This feature was originally added with the
intention that private clients (i.e. Mail) would intercept pasted or dropped images and replace their URLs.
However, since <rdar://problem/
43216836>, our strategy for this scenario has changed, such that WebKit now
handles the drop/paste, and later delivers the image data to the client via NSFileWrappers in the UI process.
At this time, there are no adopters of this SPI, and no adopters of the V2 injected bundle editing client. As
such, we can simply revert all of this to its state prior to the introduction of the replacement URL SPI, with
the exception to changes in WKBundlePageEditorClient.h, wherein there is a nonzero (but likely tiny) chance of
completely breaking binary compatability with any third parties on macOS which may have tried to adopt
subresource URL replacement.
* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::getPasteboardTypesByFidelityForItemAtIndex): Deleted.
* UIProcess/WebPasteboardProxy.h:
* UIProcess/WebPasteboardProxy.messages.in:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformActionForWebView:withSender:]):
Return YES for -paste: in the case where:
1. The pasteboard contains items that are explicitly marked as attachments.
2. The selection is richly contenteditable.
3. Attachment elements are enabled.
Among other things, this allows the callout bar on iOS to show the "Paste" action.
* WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
(API::InjectedBundle::EditorClient::performTwoStepDrop):
(API::InjectedBundle::EditorClient::replacementURLForResource): Deleted.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
* WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
(WebKit::InjectedBundlePageEditorClient::replacementURLForResource): Deleted.
* WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::replacementURLForResource): Deleted.
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::getTypesByFidelityForItemAtIndex): Deleted.
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
Source/WebKitLegacy/mac:
* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::replacementURLForResource): Deleted.
* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::getTypesByFidelityForItemAtIndex): Deleted.
Source/WebKitLegacy/win:
* WebCoreSupport/WebEditorClient.cpp:
(WebEditorClient::replacementURLForResource): Deleted.
* WebCoreSupport/WebEditorClient.h:
Tools:
Remove code and tests for subresource URL replacement, and also add a new test to verify that copied data can be
pasted in an editable area as attachment elements.
* TestWebKitAPI/Tests/WebKitCocoa/BundleEditingDelegatePlugIn.mm:
(-[BundleEditingDelegatePlugIn webProcessPlugIn:didCreateBrowserContextController:]):
(-[BundleEditingDelegatePlugIn _webProcessPlugInBrowserContextController:replacementURLForResource:mimeType:]): Deleted.
* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(TestWebKitAPI::TEST):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241749
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
dbates@webkit.org [Tue, 19 Feb 2019 00:15:34 +0000 (00:15 +0000)]
Clean up and modernize RenderThemeIOS::paintCheckboxDecorations()
https://bugs.webkit.org/show_bug.cgi?id=194785
Reviewed by Simon Fraser.
Change from early return to else-clause to make the states clearer and make it more straightforward
to share more common code. Use constexpr, allocate temporary vectors with inline capacity, and
switch to uniform initializer syntax.
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintCheckboxDecorations):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241748
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
dbates@webkit.org [Tue, 19 Feb 2019 00:10:35 +0000 (00:10 +0000)]
[iOS] Focus ring for checkboxes, radio buttons, buttons and search fields should hug tighter to the contour
https://bugs.webkit.org/show_bug.cgi?id=193599
<rdar://problem/
47399602>
Reviewed by Simon Fraser.
Source/WebCore:
For now, iOS uses a 3px outline width for its focus rings. Do not inset the focus ring on iOS
for text fields, textareas, keygens, and selects so as to match the visual appearance of all
the other controls.
Tests: fast/forms/ios/focus-button.html
fast/forms/ios/focus-checkbox.html
fast/forms/ios/focus-checked-checkbox.html
fast/forms/ios/focus-checked-radio.html
fast/forms/ios/focus-radio.html
fast/forms/ios/focus-reset-button.html
fast/forms/ios/focus-search-field.html
fast/forms/ios/focus-submit-button.html
fast/forms/ios/focus-text-field.html
fast/forms/ios/focus-textarea.html
* css/html.css:
(:focus): Use 3px outline width.
(input:focus, textarea:focus, keygen:focus, select:focus): Guard this code to exclude it when building for iOS.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintBoxDecorations): Add FIXME comment.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintOutline): Call RenderTheme::adjustPaintRect() to adjust the paint rect.
Otherwise, the focus rings for radios and checkboxes are drawn at the wrong y-coordinate and are not snug.
LayoutTests:
Ideally we should find a way to write non-pixel tests for focus rings. For now, add some mismatch ref
tests.
We cannot write a "good" mismatch ref test for <select> at the moment since there is no way to defocus
a <select> without closing its popup. We also cannot change outline-color when outline-style: auto is
used and outline-style: auto is needed to get shrink-wrapped focus rings :(
* fast/forms/ios/focus-button-expected-mismatch.html: Added.
* fast/forms/ios/focus-button.html: Added.
* fast/forms/ios/focus-checkbox-expected-mismatch.html: Added.
* fast/forms/ios/focus-checkbox.html: Added.
* fast/forms/ios/focus-checked-checkbox-expected-mismatch.html: Added.
* fast/forms/ios/focus-checked-checkbox.html: Added.
* fast/forms/ios/focus-checked-radio-expected-mismatch.html: Added.
* fast/forms/ios/focus-checked-radio.html: Added.
* fast/forms/ios/focus-radio-expected-mismatch.html: Added.
* fast/forms/ios/focus-radio.html: Added.
* fast/forms/ios/focus-reset-button-expected-mismatch.html: Added.
* fast/forms/ios/focus-reset-button.html: Added.
* fast/forms/ios/focus-search-field-expected-mismatch.html: Added.
* fast/forms/ios/focus-search-field.html: Added.
* fast/forms/ios/focus-submit-button-expected-mismatch.html: Added.
* fast/forms/ios/focus-submit-button.html: Added.
* fast/forms/ios/focus-text-field-expected-mismatch.html: Added.
* fast/forms/ios/focus-text-field.html: Added.
* fast/forms/ios/focus-textarea-expected-mismatch.html: Added.
* fast/forms/ios/focus-textarea.html: Added.
* platform/ios/TestExpectations: Skip the tests for now on iOS we do not build with ENABLE(FULL_KEYBOARD_ACCESS) enabled.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241747
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Mon, 18 Feb 2019 23:40:50 +0000 (23:40 +0000)]
[css-grid] Handle indefinite percentages in fit-content()
https://bugs.webkit.org/show_bug.cgi?id=194509
Patch by Oriol Brufau <obrufau@igalia.com> 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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241746
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Mon, 18 Feb 2019 23:40:44 +0000 (23:40 +0000)]
exitFullscreen should not instantiate a new model/interface mapping.
https://bugs.webkit.org/show_bug.cgi?id=191988
rdar://problem/
42327939
Patch by Jeremy Jones <jeremyj@apple.com> on 2019-02-18
Reviewed by Jer Noble.
This change is a speculative fix for a crash that cannot be reproduced.
Somehow, exitFullscreen is being requested after didCleanupFullscreen has completed.
This change should allow us to prevent the crash in release, and assert in debug.
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenManagerProxy::exitFullscreen):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241745
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Mon, 18 Feb 2019 23:27:07 +0000 (23:27 +0000)]
Web Inspector: Fix a typo causing assertions in ConsoleManager
https://bugs.webkit.org/show_bug.cgi?id=194792
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-02-18
Reviewed by Matt Baker.
* UserInterface/Controllers/ConsoleManager.js:
(WI.ConsoleManager.prototype.initializeLogChannels):
Extra comma produced an undefined value in the list.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241744
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
wilander@apple.com [Mon, 18 Feb 2019 23:13:58 +0000 (23:13 +0000)]
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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241743
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
jer.noble@apple.com [Mon, 18 Feb 2019 23:12:33 +0000 (23:12 +0000)]
-[AVSampleBufferDisplayLayer player]: Unrecognized selector crash
https://bugs.webkit.org/show_bug.cgi?id=194790
<rdar://problem/
33866742>
Reviewed by Jon Lee.
Ensure that a WebVideoContainerLayer's sole sublayer is actually an AVPlayerLayer (and not
an AVSampleBufferDisplayLayer) before reporting that the layer type is LayerTypeAVPlayerLayer.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241742
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
ysuzuki@apple.com [Mon, 18 Feb 2019 22:58:46 +0000 (22:58 +0000)]
[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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241741
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
nvasilyev@apple.com [Mon, 18 Feb 2019 22:45:55 +0000 (22:45 +0000)]
Web Inspector: Styles: typing ";" shouldn't focus on the next property when there's open parenthesis or comment
https://bugs.webkit.org/show_bug.cgi?id=194789
Reviewed by Matt Baker.
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._handleValueBeforeInput):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241740
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Mon, 18 Feb 2019 22:44:06 +0000 (22:44 +0000)]
Web Inspector: Better categorize CPU usage per-thread / worker
https://bugs.webkit.org/show_bug.cgi?id=194564
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-02-18
Reviewed by Devin Rousso.
Source/JavaScriptCore:
* inspector/protocol/CPUProfiler.json:
Add additional properties per-Event, and new per-Thread object info.
Source/WebCore:
Test: inspector/cpu-profiler/threads.html
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::workerThreadsMutex):
(WebCore::WorkerThread::workerThreadCount):
(WebCore::WorkerThread::WorkerThread):
(WebCore::WorkerThread::~WorkerThread):
(WebCore::WorkerThread::workerThread):
(WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):
* workers/WorkerThread.h:
(WebCore::WorkerThread::identifier const):
Expose the set of all WorkerThreads.
* inspector/agents/InspectorCPUProfilerAgent.cpp:
(WebCore::InspectorCPUProfilerAgent::collectSample):
Send inspector additional per-thread data.
* page/ResourceUsageData.h:
(WebCore::WorkerCPUInfo::WorkerCPUInfo):
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::ThreadInfo::ThreadInfo):
(WebCore::threadInfos):
(WebCore::ResourceUsageThread::platformCollectCPUData):
(WebCore::threadSendRights): Deleted.
(WebCore::cpuUsage): Deleted.
Compute per-thread values on cocoa ports.
* page/linux/ResourceUsageThreadLinux.cpp:
(WebCore::ResourceUsageThread::platformCollectCPUData):
Stub per-thread values on linux ports.
Source/WebInspectorUI:
* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.prototype.cpuProfilerTrackingUpdated):
* UserInterface/Models/CPUTimelineRecord.js:
(WI.CPUTimelineRecord.prototype.get mainThreadUsage):
(WI.CPUTimelineRecord.prototype.get webkitThreadUsage):
(WI.CPUTimelineRecord.prototype.get workerThreadUsage):
(WI.CPUTimelineRecord.prototype.get unknownThreadUsage):
Build a better record from the protocol events.
Source/WTF:
* wtf/Threading.h:
* wtf/Threading.cpp:
(WTF::Thread::allThreadsMutex):
(WTF::Thread::create):
(WTF::Thread::didExit):
Add a set of all WTF::Thread created threads.
LayoutTests:
* inspector/cpu-profiler/resources/busy-worker.js: Added.
* inspector/cpu-profiler/threads-expected.txt: Added.
* inspector/cpu-profiler/threads.html: Added.
Test that WebKit receives per-Thread CPU usage numbers.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241739
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
jer.noble@apple.com [Mon, 18 Feb 2019 22:43:10 +0000 (22:43 +0000)]
Uncaught Exception crash in MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus()
https://bugs.webkit.org/show_bug.cgi?id=194786
Reviewed by Eric Carlson.
Convert a runtime crash to a debug assert by wrapping the call to -[AVPlayer removeObserver:forKeyPath:]
in an exception handler.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241738
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
pvollan@apple.com [Mon, 18 Feb 2019 22:43:07 +0000 (22:43 +0000)]
It should be possible to get the mouse event modifiers for a page overlay client.
https://bugs.webkit.org/show_bug.cgi?id=189621
<rdar://problem/
44437279>
Reviewed by Daniel Bates.
When access to the WindowServer is blocked, [NSEvent modifierFlags] always returns 0.
This can be fixed by swizzling the class method, and getting the cached modifiers from
PlatformKeyboardEvent.
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::currentModifierFlags):
(WebKit::WebProcess::platformInitializeProcess):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241737
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
achristensen@apple.com [Mon, 18 Feb 2019 21:34:26 +0000 (21:34 +0000)]
Fix API test after r241728
https://bugs.webkit.org/show_bug.cgi?id=194723
* TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
(TEST):
The test should check the default preference value, not make sure the preference is NO after setting it to YES :/
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241736
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
achristensen@apple.com [Mon, 18 Feb 2019 21:30:29 +0000 (21:30 +0000)]
WebPageProxy::didFinishDocumentLoadForFrame() crashing in WPE and GTK+ ports
https://bugs.webkit.org/show_bug.cgi?id=194774
Patch by Claudio Saavedra <csaavedra@igalia.com> on 2019-02-18
Reviewed by Alex Christensen.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
Null check navigation before using it.
This is a regression from r241451.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241735
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
dbates@webkit.org [Mon, 18 Feb 2019 21:16:19 +0000 (21:16 +0000)]
[iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
https://bugs.webkit.org/show_bug.cgi?id=192824
<rdar://problem/
47100332>
Reviewed by Wenson Hsieh.
Source/WebCore:
When building with USE(UIKIT_KEYBOARD_ADDITIONS) enabled, normalize input strings for some more key codes
now that hardware key events to non-editable elements use the same code path as for editable elements.
* platform/ios/KeyEventIOS.mm:
(WebCore::windowsKeyCodeForCharCode): Demarcate mappings that are only needed when building with
!USE(UIKIT_KEYBOARD_ADDITIONS) in the hope that one day we can remove this code.
(WebCore::isFunctionKey): Ditto.
* platform/ios/WebEvent.mm:
(normalizedStringWithAppKitCompatibilityMapping): Normalize some more input strings when building with
USE(UIKIT_KEYBOARD_ADDITIONS) enabled.
Source/WebCore/PAL:
Expose more enumerators.
* pal/spi/cocoa/IOKitSPI.h:
Source/WebKit:
Use the same code path for key events to editable elements and non-editable elements.
Currently we have different code paths for hardware key events depending on whether the active element
is editable or non-editable. Historically to support dispatching DOM keyboard events for hardware key
presses this differentiation was a necessary workaround for UIKit's event processing precedence of
interpreting key events for system text editing commands and app commands before dispatching unhandled
key events to WebKit. This workaround intercepted raw key UIEvents and manually reconstructed a
WebEvent from it. However there is not enough information in an UIEvent to reconstruct a WebEvent that
is identical to the WebEvent that UIKit would have dispatched. In particular, keyup UIEvents always have
empty modified and unmodified input strings. The UIKit keyboard machinery maintains additional state
that is necessary to manufacture the correct WebEvent corresponding to a UIEvent.
As a side benefit of this change, with the exception of modifier flag changes, both hardware and software
key events use the same code path.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView shouldShowAutomaticKeyboardUI]): Extracted code from _requiresKeyboardWhenFirstResponder
(-[WKContentView _disableAutomaticKeyboardUI]): Implement UIKit SPI to prevent showing the keyboard UI
when there is no focused element now that we are no longer intercepting key UIEvents. Formerly the
keyboard UI was disabled as a side effect of not becoming first responder when there was no focused
element (by returning NO in -_requiresKeyboardWhenFirstResponder).
(-[WKContentView _requiresKeyboardWhenFirstResponder]): Always return YES when building with USE(UIKIT_KEYBOARD_ADDITIONS)
so that we always accept key events. Instead of selectively replying to create a keyboard as a means of
hiding the automatic keyboard UI we now implement _disableAutomaticKeyboardUI to selectively hide the
automatic keyboard UI.
(-[WKContentView applyAutocorrection:toString:withCompletionHandler:]): If we are not in an editable
element then we cannot perform the replacement. This logic was necessary now that we always require a
keyboard.
(-[WKContentView requestAutocorrectionContextWithCompletionHandler:]): If we are not in an editable
element then return an autocorrection object that indicates that we could not compute this data. This
logic was necessary now that we always require a keyboard.
(-[WKContentView textInputTraits]): Do not update traits when the keyboard is going to be dismissed
now that we require a keyboard when first responder even if the focused element is non-editable.
(-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Skip logic for re-sending UIEvents to UIKit
as UIKit now processes the event first. This logic was necessary in order to finally allow UIKit
its chance to interpret the UIEvent, we intercepted, for app key commands.
(-[WKContentView _elementDidBlur]): Call [self _endEditing] so that we dismiss any open form controls
(e.g. a <select> popover menu). Currently this happens either by -_requiresKeyboardWhenFirstResponder
responding NO when switching to another field or pressing Tab or Shift + Tab key command, which we will
no longer use when building with USE(UIKIT_KEYBOARD_ADDITIONS) once I land <https://bugs.webkit.org/show_bug.cgi?id=193048>.
* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectPopover initWithView:hasGroups:]): Do not assign ourself as the keyboard delegate. Otherwise,
type ahead and tab cycling will not work. Currently type ahead and tab cycling work by using the non-
editable code path via -_handleKeyUIEvent. Now that we no longer differentiate between key events for
editable and non-editable elements we need to ensure that the WKContentView is the keyboard delegate
when the popover is presented.
Tools:
Fix a bug where the wrong usage code was used for F13 thru F24.
* WebKitTestRunner/ios/HIDEventGenerator.mm:
(keyCodeForDOMFunctionKey):
LayoutTests:
Update tests and expected results. As it turns out fixing the bug in WebKitTestRunner/ios/HIDEventGenerator.mm
so that we now dispatch key events for F17 thru F24 exposed a bug in UIKit. See <rdar://problem/
47128940>.
This same bug is also responsible for a lack of key events when the Insert key is pressed.
Added sub-test for Tab key to keypress-keys-in-non-editable-element.html. Changed expected result in test
keypress-keys-in-non-editable-element.html for the forward delete key to expect failure. We expect that pressing
the forward delete key will not dispatch a keypress to match the behavior on Mac. This will be addressed by a
UIKit fix.
* fast/events/ios/keydown-keyup-special-keys-in-non-editable-element-expected.txt:
* fast/events/ios/keydown-keyup-special-keys-in-non-editable-element.html:
* fast/events/ios/keypress-keys-in-non-editable-element-expected.txt:
* fast/events/ios/keypress-keys-in-non-editable-element.html:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241734
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
tzagallo@apple.com [Mon, 18 Feb 2019 20:55:45 +0000 (20:55 +0000)]
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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241733
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
drousso@apple.com [Mon, 18 Feb 2019 20:11:16 +0000 (20:11 +0000)]
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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241732
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
jiewen_tan@apple.com [Mon, 18 Feb 2019 19:47:03 +0000 (19:47 +0000)]
Tell Networking Process to not optimize load
https://bugs.webkit.org/show_bug.cgi?id=194753
<rdar://problem/
48143603>
Reviewed by Brent Fulgham.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241731
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
dino@apple.com [Mon, 18 Feb 2019 19:09:39 +0000 (19:09 +0000)]
iOS Safari will not load USDZ in QLPreview when opening as BLOB
https://bugs.webkit.org/show_bug.cgi?id=194766
<rdar://problem/
42769186>
Reviewed by Wenson Hsieh.
A download from a Blob URL can happen effectively instantly, which means
that the loadHandler on the registerItemForTypeIdentifier method might not have
been called yet, and we haven't been told what the completionHandler is.
In this case, keep a record of the URL we finished with, and call the completionHandler
right away.
* UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Add a new private member variable: _downloadedURL.
(-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]): Call the completionHandler
right away if we've finished.
(-[_WKPreviewControllerDataSource finish:]): Remember that we've finished by recording the URL.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241730
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
eric.carlson@apple.com [Mon, 18 Feb 2019 18:38:03 +0000 (18:38 +0000)]
Add MSE logging configuration
https://bugs.webkit.org/show_bug.cgi?id=194719
<rdar://problem/
48122151>
Reviewed by Joseph Pecoraro.
Source/JavaScriptCore:
* inspector/ConsoleMessage.cpp:
(Inspector::messageSourceValue):
* inspector/protocol/Console.json:
* inspector/scripts/codegen/generator.py:
* runtime/ConsoleTypes.h:
Source/WebCore:
No new tests, updated inspector/console/webcore-logging.html.
* dom/Document.cpp:
(WebCore::messageSourceForWTFLogChannel): Recognize the MSE logging channel.
* inspector/agents/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::getLoggingChannels): Ditto.
Source/WebInspectorUI:
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Models/ConsoleMessage.js:
* UserInterface/Models/IssueMessage.js:
(WI.IssueMessage):
* UserInterface/Views/LogContentView.js:
(WI.LogContentView):
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createGeneralSettingsView):
Source/WebKitLegacy/mac:
* WebCoreSupport/WebChromeClient.mm:
(stringForMessageSource): Recognize the MSE message source.
LayoutTests:
* inspector/console/webcore-logging-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241729
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
achristensen@apple.com [Mon, 18 Feb 2019 18:34:41 +0000 (18:34 +0000)]
Disable safe browsing in WKWebView and remove its WKPreferences API
https://bugs.webkit.org/show_bug.cgi?id=194723
<rdar://problem/
48122993>
Reviewed by Geoffrey Garen.
Source/WebKit:
* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences setSafeBrowsingEnabled:]): Deleted.
(-[WKPreferences isSafeBrowsingEnabled]): Deleted.
Tools:
* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
* TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
(TEST):
(safeBrowsingView):
Make tests use SPI instead of API.
LayoutTests:
* platform/mac-wk2/http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt:
This test has results that depend on timing, and I need to update its results when I disable safe browsing.
I've done this several times before. See r237876 for an example.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241728
268f45cc-cd09-0410-ab3c-
d52691b4dbfc