WebKit-https.git
5 months ago[JSC] Drop direct references to Intl constructors by rewriting Intl JS builtins in C++
ysuzuki@apple.com [Mon, 25 Feb 2019 18:32:18 +0000 (18:32 +0000)]
[JSC] Drop direct references to Intl constructors by rewriting Intl JS builtins in C++
https://bugs.webkit.org/show_bug.cgi?id=194976

Reviewed by Michael Saboff.

This patch paves the way to making IntlObject allocation lazy by removing direct references
to Intl constructors (Intl.Collator etc.) from builtin JS. To achieve that,

1. We implement String.prototype.toLocaleCompare and Number.prototype.toLocaleString in C++
   instead of JS builtins. Since these functions end up calling ICU C++ runtime, writing them in
   JS does not offer performance improvement.

2. We remove @DateTimeFormat constructor reference, and instead, exposing @dateTimeFormat function,
   which returns formatted string directly. We still have JS builtins for DateTimeFormat things
   because the initialization of its "options" JSObject involves many get_by_id / put_by_id things,
   which are efficient in JS. But we avoid exposing @DateTimeFormat directly, so that Intl constructors
   can be lazily allocated.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources.make:
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/BuiltinNames.h:
* builtins/DatePrototype.js:
(toLocaleString):
(toLocaleDateString):
(toLocaleTimeString):
* builtins/NumberPrototype.js: Removed.
* builtins/StringPrototype.js:
(intrinsic.StringPrototypeReplaceIntrinsic.replace):
(globalPrivate.getDefaultCollator): Deleted.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
(JSC::JSGlobalObject::defaultCollator):
* runtime/JSGlobalObject.h:
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncDateTimeFormat):
* runtime/JSGlobalObjectFunctions.h:
* runtime/NumberPrototype.cpp:
(JSC::NumberPrototype::finishCreation):
(JSC::throwVMToThisNumberError):
(JSC::numberProtoFuncToExponential):
(JSC::numberProtoFuncToFixed):
(JSC::numberProtoFuncToPrecision):
(JSC::numberProtoFuncToString):
(JSC::numberProtoFuncToLocaleString):
(JSC::numberProtoFuncValueOf):
* runtime/StringPrototype.cpp:
(JSC::StringPrototype::finishCreation):
(JSC::stringProtoFuncLocaleCompare):

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

5 months agoAdd tests mixing programmatic and user frame scrolling on iOS
commit-queue@webkit.org [Mon, 25 Feb 2019 18:26:09 +0000 (18:26 +0000)]
Add tests mixing programmatic and user frame scrolling on iOS
https://bugs.webkit.org/show_bug.cgi?id=194900

This patch adds tests initially written for bug 182868 but eventually
fixed by bug 194886. They involve mixing user and programmatic
scrolling.

Patch by Frederic Wang <fwang@igalia.com> on 2019-02-25
Reviewed by Antti Koivisto.

* fast/scrolling/ios/mixing-user-and-programmatic-scroll-001-expected.html: Added.
* fast/scrolling/ios/mixing-user-and-programmatic-scroll-001.html: Added.
* fast/scrolling/ios/mixing-user-and-programmatic-scroll-002-expected.html: Added.
* fast/scrolling/ios/mixing-user-and-programmatic-scroll-002.html: Added.
* fast/scrolling/ios/mixing-user-and-programmatic-scroll-003-expected.html: Added.
* fast/scrolling/ios/mixing-user-and-programmatic-scroll-003.html: Added.
* fast/scrolling/ios/mixing-user-and-programmatic-scroll-004-expected.html: Added.
* fast/scrolling/ios/mixing-user-and-programmatic-scroll-004.html: Added.
* fast/scrolling/ios/mixing-user-and-programmatic-scroll-005-expected.html: Added.
* fast/scrolling/ios/mixing-user-and-programmatic-scroll-005.html: Added.
* fast/scrolling/ios/mixing-user-and-programmatic-scroll-006-expected.html: Added.
* fast/scrolling/ios/mixing-user-and-programmatic-scroll-006.html: Added.

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

5 months ago[GTK] Enable PSON
mcatanzaro@igalia.com [Mon, 25 Feb 2019 18:04:07 +0000 (18:04 +0000)]
[GTK] Enable PSON
https://bugs.webkit.org/show_bug.cgi?id=194979

Reviewed by Žan Doberšek.

It is expected that this may introduce unexpected regressions, so it's appropriate to do
this at the start of a new release cycle.

* Shared/WebPreferencesDefaultValues.h:

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

5 months agofast/mediastream/MediaStream-video-element.html is flaky after r241821, marking as...
tsavell@apple.com [Mon, 25 Feb 2019 17:04:01 +0000 (17:04 +0000)]
fast/mediastream/MediaStream-video-element.html is flaky after r241821, marking as failure while waiting for fix.
https://bugs.webkit.org/show_bug.cgi?id=194916

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

5 months agoIndexedDB: IDBDatabase and IDBTransaction are leaked in layout tests
sihui_liu@apple.com [Mon, 25 Feb 2019 16:50:20 +0000 (16:50 +0000)]
IndexedDB: IDBDatabase and IDBTransaction are leaked in layout tests
https://bugs.webkit.org/show_bug.cgi?id=194709

Reviewed by Geoffrey Garen.

Source/WebCore:

When connection to IDB server is closed, IDBTransaction would abort without notifying IDBDatabase, so
IDBDatabase didn't clear its reference to IDBTransaction which created a reference cycle.

Also IDBTransaction didn't clear its reference to IDBRequest in this case and it led to another reference cycle
between IDBOpenDBRequest and IDBTransaction.

Test: storage/indexeddb/IDBObject-leak.html

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::connectionToServerLost):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::IDBTransaction):
(WebCore::IDBTransaction::~IDBTransaction):
(WebCore::IDBTransaction::connectionClosedFromServer):
* Modules/indexeddb/IDBTransaction.h:
* testing/Internals.cpp:
(WebCore::Internals::numberOfIDBTransactions const):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* TestExpectations:
* platform/wk2/TestExpectations:
* storage/indexeddb/IDBObject-leak-expected.txt: Added.
* storage/indexeddb/IDBObject-leak.html: Added.

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

5 months ago[WPE][GTK] Clean up handling of WEBKIT_FORCE_COMPLEX_TEXT
mcatanzaro@igalia.com [Mon, 25 Feb 2019 16:10:31 +0000 (16:10 +0000)]
[WPE][GTK] Clean up handling of WEBKIT_FORCE_COMPLEX_TEXT
https://bugs.webkit.org/show_bug.cgi?id=194614

Reviewed by Carlos Garcia Campos.

This environment variable is now enabled for WPE, not just for GTK.

It is now possible to use this environment variable to enable complex text, not just to
disable it.

WebProcessPool::setAlwaysUsesComplexTextCodePath is fixed to be respected even when this
environment variable is set, although WPE and GTK will never do so.

* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::WebProcessPool::platformInitialize):
(WebKit::WebProcessPool::platformInitializeWebProcess):

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

5 months agoAdd missing stream parameter. Unreviewed.
zalan@apple.com [Mon, 25 Feb 2019 15:50:23 +0000 (15:50 +0000)]
Add missing stream parameter. Unreviewed.

* page/DOMTimer.cpp:
(WebCore::DOMTimer::fired):

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

5 months ago[Flatpak] Add support for flatpak > 1.1.2
commit-queue@webkit.org [Mon, 25 Feb 2019 15:46:24 +0000 (15:46 +0000)]
[Flatpak] Add support for flatpak > 1.1.2
https://bugs.webkit.org/show_bug.cgi?id=194088

Flatpak 1.2 is now out so we need to support that
version now.

Patch by Thibault Saunier <tsaunier@igalia.com> on 2019-02-25
Reviewed by Michael Catanzaro.

* flatpak/flatpakutils.py:
(check_flatpak):
(FlatpakPackages.__init__):
(FlatpakPackages.__detect_packages):
(FlatpakPackages.__detect_packages.in):
(FlatpakRepos.update):

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

5 months agoUnreviewed build fix after r242032.
zalan@apple.com [Mon, 25 Feb 2019 15:07:35 +0000 (15:07 +0000)]
Unreviewed build fix after r242032.

* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):

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

5 months agoIncorrect use of String::foldCase for font family names
darin@apple.com [Mon, 25 Feb 2019 14:39:10 +0000 (14:39 +0000)]
Incorrect use of String::foldCase for font family names
https://bugs.webkit.org/show_bug.cgi?id=194895

Reviewed by Myles C. Maxfield.

* platform/graphics/FontCascadeDescription.cpp:
(WebCore::FontCascadeDescription::familiesEqualForTextAutoSizing): Use
familyNamesAreEqual instead of calling convertToASCIILowercase directly.
(WebCore::FontCascadeDescription::familyNamesAreEqual): Use AtomicString's
operator== when we want case sensitive family name comparisons. This is a special
case to accomodate CoreText, which uses "."-prefix names for internal fonts that
are treated case sensitively. (Ideally webpages would not use these fonts at all.)
(WebCore::FontCascadeDescription::familyNameHash): Use AtomicString's existingHash
when we want case sensitive family name hashing.
(WebCore::FontCascadeDescription::foldedFamilyName): Take a String instead of an
AtomicString so we can use this at an additional call site. Converting from an
AtomicString to a String if free and automatic at the existing call sites. Use
convertToASCIILowercase instead of foldCase for three reasons: 1) Other functions
here are folding only ASCII case by using ASCIICaseInsensitiveHash, and this one
must be consistent. 2) this is considerably faster, and 3) font family names don't
need arbitrary Unicode case folding, it's only A-Z that should be folded.
* platform/graphics/FontCascadeDescription.h: Take a String instead of AtomicString
in the foldedFamilyName function.

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::collectionForFamily): Instead of calling foldCase, use
FontCascadeDescription::foldedFamilyName to correctly fold font family names.

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

5 months agoUnreviewed WPE gardening. Adding a few failure expectations as well
zandobersek@gmail.com [Mon, 25 Feb 2019 13:06:03 +0000 (13:06 +0000)]
Unreviewed WPE gardening. Adding a few failure expectations as well
as updating a couple of port-specific test baselines.

* platform/wpe/TestExpectations:
* platform/wpe/fast/css/apple-system-colors-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-requestmediakeysystemaccess.https-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/mime-types/canPlayType-expected.txt:

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

5 months ago[WPE] Bump WPEBackend-fdo Jhbuild package to latest changes
zandobersek@gmail.com [Mon, 25 Feb 2019 11:55:14 +0000 (11:55 +0000)]
[WPE] Bump WPEBackend-fdo Jhbuild package to latest changes
https://bugs.webkit.org/show_bug.cgi?id=194998

Reviewed by Carlos Garcia Campos.

* wpe/jhbuild.modules: Bump the WPEBackend-fdo package, converting it
to a Git checkout and using the latest commit containing various fixes
and improvements.

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

5 months ago[EME][GStreamer] Replace caps field loop with gst_structure_remove_fields
cturner@igalia.com [Mon, 25 Feb 2019 10:15:31 +0000 (10:15 +0000)]
[EME][GStreamer] Replace caps field loop with gst_structure_remove_fields
https://bugs.webkit.org/show_bug.cgi?id=194992

Reviewed by Xabier Rodriguez-Calvar.

Refactoring, no new tests.

* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(transformCaps): Simplify the code a little. The idea to use this
utility function came from a review upstream here:
https://gitlab.freedesktop.org/gstreamer/gst-devtools/merge_requests/67

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

5 months ago[MSE][GStreamer] Batch player duration updates
aboya@igalia.com [Mon, 25 Feb 2019 10:11:57 +0000 (10:11 +0000)]
[MSE][GStreamer] Batch player duration updates
https://bugs.webkit.org/show_bug.cgi?id=194220

Reviewed by Xabier Rodriguez-Calvar.

This saves up a ton of CPU cycles doing layout unnecessarily when all
the appended frames extend the duration of the movie, like in
YTTV 2018 59.DASHLatencyVP9.

This patch is an optimization that introduces no new behavior.

* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::consumeAppsinkAvailableSamples):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::blockDurationChanges):
(WebCore::MediaPlayerPrivateGStreamerMSE::unblockDurationChanges):
(WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:

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

5 months ago[WPE] Add support for holepunch using an external video player
magomez@igalia.com [Mon, 25 Feb 2019 09:20:01 +0000 (09:20 +0000)]
[WPE] Add support for holepunch using an external video player
https://bugs.webkit.org/show_bug.cgi?id=194899

Reviewed by Xabier Rodriguez-Calvar.

.:

Add EXTERNAL_HOLEPUNCH option to the WPE port. Add a manual test to check the
feature. Rename and update the test for GStreamer holepunch to avoid confusion.

* ManualTests/wpe/video-player-holepunch-external.html: Added.
* ManualTests/wpe/video-player-holepunch-gstreamer.html: Renamed from ManualTests/wpe/video-player-holepunch.html.
* Source/cmake/OptionsWPE.cmake:

Source/WebCore:

Implement the holepunch feature to allow playback using an external player. This creates
a new dummy MediaPlayerPrivateHolePunch that accepts only the type "video/holepunch", and
whose goal is to just draw a transparent rectangle in the position where the video should be.
This can be used to allow a player placed on a lower plane than the browser to become visible.

Added ManualTest wpe/video-player-holepunch-external.html to test the feature.

* PlatformWPE.cmake:
* platform/HolePunch.cmake: Added.
* platform/graphics/MediaPlayer.cpp:
(WebCore::buildMediaEnginesVector):
* platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp: Added.
(WebCore::MediaPlayerPrivateHolePunch::MediaPlayerPrivateHolePunch):
(WebCore::MediaPlayerPrivateHolePunch::~MediaPlayerPrivateHolePunch):
(WebCore::MediaPlayerPrivateHolePunch::platformLayer const):
(WebCore::MediaPlayerPrivateHolePunch::naturalSize const):
(WebCore::MediaPlayerPrivateHolePunch::pushNextHolePunchBuffer):
(WebCore::MediaPlayerPrivateHolePunch::swapBuffersIfNeeded):
(WebCore::MediaPlayerPrivateHolePunch::proxy const):
(WebCore::mimeTypeCache):
(WebCore::MediaPlayerPrivateHolePunch::getSupportedTypes):
(WebCore::MediaPlayerPrivateHolePunch::supportsType):
(WebCore::MediaPlayerPrivateHolePunch::registerMediaEngine):
(WebCore::MediaPlayerPrivateHolePunch::notifyReadyState):
* platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h: Added.
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
(WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):

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

5 months agoIntroduce ContentChangeObserver class
zalan@apple.com [Mon, 25 Feb 2019 06:04:20 +0000 (06:04 +0000)]
Introduce ContentChangeObserver class
https://bugs.webkit.org/show_bug.cgi?id=194977
<rdar://problem/48338115>

Reviewed by Simon Fraser.

Source/WebCore:

This patch is about piping through all the related WK* calls.

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::platformSuspendOrStopActiveDOMObjects):
* loader/FrameLoader.cpp:
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::fired):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::clearTimeout):
* page/Frame.cpp:
(WebCore::Frame::willDetachPage):
* page/Page.h:
(WebCore::Page::contentChangeObserver):
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::mouseMoved):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
(WebCore::CheckForVisibilityChange::CheckForVisibilityChange):
(WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):

Source/WebKit:

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):

Source/WebKitLegacy/ios:

* WebCoreSupport/WebChromeClientIOS.mm:
(WebChromeClientIOS::observedContentChange):
(WebChromeClientIOS::clearContentChangeObservers):

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

5 months agoMigrate from "fixedPositionRect" to "layoutViewport" in the scrolling tree
simon.fraser@apple.com [Mon, 25 Feb 2019 06:03:22 +0000 (06:03 +0000)]
Migrate from "fixedPositionRect" to "layoutViewport" in the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=194984

Reviewed by Sam Weinig.

Rename "fixedPositionRect" to "layoutViewport" in scrolling tree code.

Remove ScrollingTree::fixedPositionRect() which was only used on iOS, to fetch the
current layout viewport rect. Instead, set the layout viewport on the root
node in ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling().
Source/WebCore:

* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
(WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling): Deleted.
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeFrameHostingNode.cpp:
(WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange):
* page/scrolling/ScrollingTreeFrameHostingNode.h:
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeNode.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/cocoa/ScrollingTreeFixedNode.h:
* page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
* page/scrolling/cocoa/ScrollingTreeStickyNode.h:
* page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):

Source/WebKit:

Add a WK2 Scrolling log channel.

* Platform/Logging.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::fixedPositionRect): Deleted.
* UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const):
(WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect const): Deleted.
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll):
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):

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

5 months agoWeb Inspector: Change the InspectorOverlay to use native rather than canvas
drousso@apple.com [Mon, 25 Feb 2019 04:41:53 +0000 (04:41 +0000)]
Web Inspector: Change the InspectorOverlay to use native rather than canvas
https://bugs.webkit.org/show_bug.cgi?id=105023
<rdar://problem/13443692>

Reviewed by Brian Burg.

.:

* ManualTests/inspector/overlay-nodes.html: Added.
* ManualTests/inspector/overlay-rulers.html: Added.

Source/JavaScriptCore:

* inspector/protocol/OverlayTypes.json: Removed.
Now that the overlay is entirely generated in C++, we no longer need the special prototol
types for transferring data to a JavaScript context.

* inspector/protocol/Debugger.json:
* inspector/agents/InspectorDebuggerAgent.h:
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::setOverlayMessage): Deleted.
Remove `Debugger.setOverlayMessage` command as it hasn't been used and is no longer supported.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources.make:

Source/WebCore:

Should be no change in observed functionality.

* inspector/InspectorOverlay.h:
* inspector/InspectorOverlay.cpp:
(WebCore::truncateWithEllipsis): Added.
(WebCore::localPointToRootPoint): Added.
(WebCore::contentsQuadToCoordinateSystem):
(WebCore::effectiveElementForNode): Added.
(WebCore::quadToPath): Added.
(WebCore::drawOutlinedQuadWithClip): Added.
(WebCore::drawOutlinedQuad): Added.
(WebCore::drawFragmentHighlight): Added.
(WebCore::drawShapeHighlight): Added.
(WebCore::InspectorOverlay::paint):
(WebCore::InspectorOverlay::setIndicating):
(WebCore::InspectorOverlay::shouldShowOverlay const):
(WebCore::InspectorOverlay::update):
(WebCore::InspectorOverlay::setShowPaintRects): Added.
(WebCore::InspectorOverlay::showPaintRect):
(WebCore::InspectorOverlay::updatePaintRectsTimerFired):
(WebCore::InspectorOverlay::drawNodeHighlight):
(WebCore::InspectorOverlay::drawQuadHighlight):
(WebCore::InspectorOverlay::drawPaintRects):
(WebCore::InspectorOverlay::drawBounds): Added.
(WebCore::InspectorOverlay::drawRulers):
(WebCore::InspectorOverlay::drawElementTitle): Added.
(WebCore::contentsQuadToPage): Deleted.
(WebCore::InspectorOverlay::setPausedInDebuggerMessage): Deleted.
(WebCore::buildObjectForPoint): Deleted.
(WebCore::buildObjectForRect): Deleted.
(WebCore::buildArrayForQuad): Deleted.
(WebCore::buildObjectForHighlight): Deleted.
(WebCore::buildObjectForSize): Deleted.
(WebCore::InspectorOverlay::setShowingPaintRects): Deleted.
(WebCore::buildArrayForRendererFragments): Deleted.
(WebCore::localPointToRoot): Deleted.
(WebCore::appendPathCommandAndPoints): Deleted.
(WebCore::appendPathSegment): Deleted.
(WebCore::buildObjectForShapeOutside): Deleted.
(WebCore::buildObjectForElementData): Deleted.
(WebCore::InspectorOverlay::buildHighlightObjectForNode const): Deleted.
(WebCore::InspectorOverlay::buildObjectForHighlightedNodes const): Deleted.
(WebCore::InspectorOverlay::drawPausedInDebuggerMessage): Deleted.
(WebCore::InspectorOverlay::overlayPage): Deleted.
(WebCore::InspectorOverlay::forcePaint): Deleted.
(WebCore::InspectorOverlay::reset): Deleted.
(WebCore::evaluateCommandInOverlay): Deleted.
(WebCore::InspectorOverlay::evaluateInOverlay): Deleted.
(WebCore::InspectorOverlay::freePage): Deleted.

* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::setShowPaintRects):
Drive-by: rename `setShowingPaintRects` to better match the protocol.
* inspector/agents/page/PageDebuggerAgent.h:
* inspector/agents/page/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::PageDebuggerAgent):
(WebCore::PageDebuggerAgent::setOverlayMessage): Deleted.
Remove `Debugger.setOverlayMessage` command as it hasn't been used and is no longer supported.

* inspector/InspectorController.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::createLazyAgents):
(WebCore::InspectorController::disconnectFrontend):
(WebCore::InspectorController::disconnectAllFrontends):
(WebCore::InspectorController::buildObjectForHighlightedNodes const): Deleted.

* testing/Internals.h:
* testing/Internals.idl:
* testing/Internals.cpp:
(WebCore::Internals::inspectorHighlightObject): Deleted.

* inspector/InspectorOverlayPage.css: Removed.
* inspector/InspectorOverlayPage.html: Removed.
* inspector/InspectorOverlayPage.js: Removed.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:

Source/WebInspectorUI:

* UserInterface/Base/Main.js:
(WI.initializeTarget):

* UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/11.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/12.2/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js:
* Versions/Inspector-iOS-10.0.json:
* Versions/Inspector-iOS-10.3.json:
* Versions/Inspector-iOS-11.0.json:
* Versions/Inspector-iOS-11.3.json:
* Versions/Inspector-iOS-12.0.json:
* Versions/Inspector-iOS-12.2.json:
* Versions/Inspector-iOS-8.0.json:
* Versions/Inspector-iOS-9.0.json:
* Versions/Inspector-iOS-9.3.json:
Remove `Debugger.setOverlayMessage` command as it hasn't been used and is no longer supported.

LayoutTests:

* http/tests/inspector/dom/shapes-test.js: Removed.
* inspector/dom/hideHighlight.html: Removed.
* inspector/dom/hideHighlight-expected.txt: Removed.
* inspector/dom/highlight-shape-outside.html: Removed.
* inspector/dom/highlight-shape-outside-expected.txt: Removed.
* inspector/dom/highlight-shape-outside-margin.html: Removed.
* inspector/dom/highlight-shape-outside-margin-expected.txt: Removed.
* inspector/dom/highlightFrame.html: Removed.
* inspector/dom/highlightFrame-expected.txt: Removed.
* inspector/dom/highlightNode.html: Removed.
* inspector/dom/highlightNode-expected.txt: Removed.
* inspector/dom/highlightNodeList.html: Removed.
* inspector/dom/highlightNodeList-expected.txt: Removed.
* inspector/dom/highlightSelector.html: Removed.
* inspector/dom/highlightSelector-expected.txt: Removed.
* platform/mac/TestExpectations:

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

5 months agoWeb Inspector: provide a way to make searches case sensitive or use a regular expression
drousso@apple.com [Mon, 25 Feb 2019 04:27:46 +0000 (04:27 +0000)]
Web Inspector: provide a way to make searches case sensitive or use a regular expression
https://bugs.webkit.org/show_bug.cgi?id=192527
Source/WebInspectorUI:

Reviewed by Joseph Pecoraro.

* UserInterface/Base/SearchUtilities.js: Added.
(WI.SearchUtilities.get defaultSettings):
(WI.SearchUtilities.createSettings):
(WI.SearchUtilities.regExpForString):
(WI.SearchUtilities.createSettingsButton):
(WI.SearchUtilities.createSettingsButton.toggleActive):
* UserInterface/Views/Main.css:
(.search-settings): Added.
(.search-settings > .glyph): Added.
(.search-settings:active > .glyph): Added.
(.search-settings.active > .glyph): Added.
(.search-settings:active.active > .glyph): Added.
Create static utility class for handling settings related to searching/filtering.

* UserInterface/Base/Setting.js:
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createGeneralSettingsView):
Create default search settings that apply across WebInspector, unless a more specific
setting has been created that overrides it (e.g. the navigation sidebar or Search tab).

* UserInterface/Views/SearchSidebarPanel.js:
(WI.SearchSidebarPanel):
(WI.SearchSidebarPanel.prototype.performSearch.forEachMatch):
(WI.SearchSidebarPanel.prototype.performSearch.resourceCallback):
(WI.SearchSidebarPanel.prototype.performSearch.resourcesCallback):
(WI.SearchSidebarPanel.prototype.performSearch.searchScripts.scriptCallback):
(WI.SearchSidebarPanel.prototype.performSearch.searchScripts):
(WI.SearchSidebarPanel.prototype.performSearch.domSearchResults):
(WI.SearchSidebarPanel.prototype.performSearch.domCallback):
(WI.SearchSidebarPanel.prototype.performSearch):
* UserInterface/Views/SearchSidebarPanel.css:
(.sidebar > .panel.navigation.search > .search-bar):
(.sidebar > .panel.navigation.search > .search-bar > input[type="search"]):
Add a (*) settings "gear" after each `<input type="search">` that shows a contextmenu with
checkboxes for each search setting. Any settings changed for each input take precedence over
the default settings, but will match the corresponding default setting if it's changed.

* UserInterface/Views/SearchResultTreeElement.js:
(WI.SearchResultTreeElement.truncateAndHighlightTitle):
Use the length of the found text, rather than the length of the query.

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype._highlightSearchResults):
* UserInterface/Views/DataGrid.js:
(WI.DataGrid.prototype._updateFilter):
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype.performSearch):
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype._urlFilterDidChange):
* UserInterface/Views/ResourceHeadersContentView.js:
(WI.ResourceHeadersContentView.prototype._perfomSearchOnKeyValuePairs):
* UserInterface/Views/ResourceSecurityContentView.js:
(WI.ResourceSecurityContentView.prototype._perfomSearchOnKeyValuePairs):
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.customPerformSearch.searchResultCallback):
(WI.SourceCodeTextEditor.prototype.customPerformSearch):
* UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype.performSearch):
Use the default search settings when searching/filtering.

* UserInterface/Views/SearchBar.css:
(.search-bar > input[type="search"]:placeholder-shown::-webkit-search-cancel-button): Added.
Drive-by: prevent the (x) from appearing when no text has been entered.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Main.html:

LayoutTests:

<rdar://problem/46800955>

Reviewed by Joseph Pecoraro.

* inspector/debugger/search-scripts.html:
* inspector/debugger/search-scripts-expected.txt:

* inspector/page/searchInResources.html:
* inspector/page/searchInResources-expected.txt:

* inspector/page/resources/search-script.js:
* inspector/page/resources/search-stylesheet.css:
* inspector/page/resources/search-worker.js:
* inspector/page/resources/search-xhr.txt:

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

5 months agoWeb Inspector: make debounce Proxy into its own class
drousso@apple.com [Mon, 25 Feb 2019 03:04:01 +0000 (03:04 +0000)]
Web Inspector: make debounce Proxy into its own class
https://bugs.webkit.org/show_bug.cgi?id=194721

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

The `debounce`/`throttle` functions leveraged a `Proxy` to intercept the function call and
replace it with a "delayed" version. The issue with this is that it set the identifier for
the timer on the function itself, which is shared across all instances of a given class.
When different instances call the same delayed function, they'd clobber eachother's attempts
to delay work.

* UserInterface/Base/Debouncer.js: Added.
(Debouncer):
(Debouncer.prototype.force):
(Debouncer.prototype.delayForTime):
(Debouncer.prototype.delayForFrame):
(Debouncer.prototype.delayForMicrotask):
(Debouncer.prototype.cancel):
(Debouncer.prototype._execute):
* UserInterface/Base/Throttler.js: Added.
(Throttler):
(Throttler.prototype.force):
(Throttler.prototype.fire):
(Throttler.prototype.cancel):
(Throttler.prototype._execute):
* UserInterface/Base/Utilities.js:

* UserInterface/Views/BezierEditor.js:
(WI.BezierEditor):
* UserInterface/Views/ContentBrowser.js:
(WI.ContentBrowser):
(WI.ContentBrowser.prototype._contentViewSelectionPathComponentDidChange):
(WI.ContentBrowser.prototype._contentViewSupplementalRepresentedObjectsDidChange):
(WI.ContentBrowser.prototype._currentContentViewDidChange):
(WI.ContentBrowser.prototype._dispatchCurrentRepresentedObjectsDidChangeEvent): Deleted.
* UserInterface/Views/DOMTreeUpdater.js:
(WI.DOMTreeUpdater):
(WI.DOMTreeUpdater.prototype._nodeAttributeModified):
(WI.DOMTreeUpdater.prototype._nodeInserted):
(WI.DOMTreeUpdater.prototype._nodeRemoved):
* UserInterface/Views/NavigationSidebarPanel.js:
(WI.NavigationSidebarPanel):
(WI.NavigationSidebarPanel.prototype.closed):
(WI.NavigationSidebarPanel.prototype.showEmptyContentPlaceholder):
(WI.NavigationSidebarPanel.prototype.hideEmptyContentPlaceholder):
(WI.NavigationSidebarPanel.prototype.updateFilter):
(WI.NavigationSidebarPanel.prototype.shown):
(WI.NavigationSidebarPanel.prototype._updateContentOverflowShadowVisibility):
(WI.NavigationSidebarPanel.prototype._treeElementAddedOrChanged):
(WI.NavigationSidebarPanel.prototype._treeElementDisclosureDidChange):
* UserInterface/Views/RecordingContentView.js:
(WI.RecordingContentView):
(WI.RecordingContentView.prototype.updateActionIndex):
(WI.RecordingContentView.prototype.hidden):
* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WI.ResourceDetailsSidebarPanel.prototype._refreshRelatedResourcesSection):
(WI.ResourceDetailsSidebarPanel.prototype._applyResourceEventListeners):
(WI.ResourceDetailsSidebarPanel):
* UserInterface/Views/ShaderProgramContentView.js:
(WI.ShaderProgramContentView):
* UserInterface/Views/SpringEditor.js:
(WI.SpringEditor.prototype._resetPreviewAnimation):
* UserInterface/Views/TreeElement.js:
(WI.TreeElement.prototype.set hidden):
(WI.TreeElement.prototype.didChange):
(WI.TreeElement.prototype._attach):
(WI.TreeElement.prototype._detach):
(WI.TreeElement.prototype.collapse):
(WI.TreeElement.prototype.expand):
(WI.TreeElement.prototype.reveal):
* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline):
(WI.TreeOutline.prototype.registerScrollVirtualizer):
(WI.TreeOutline.prototype.get updateVirtualizedElementsDebouncer): Added.
(WI.TreeOutline.prototype._updateVirtualizedElements): Added.
(WI.TreeOutline.prototype.updateVirtualizedElements.walk): Deleted.
(WI.TreeOutline.prototype.updateVirtualizedElements): Deleted.
* UserInterface/Views/WebSocketContentView.js:
(WI.WebSocketContentView):
(WI.WebSocketContentView.prototype.shown):
(WI.WebSocketContentView.prototype._updateFramesSoon):
(WI.WebSocketContentView.prototype._updateFrames):

* UserInterface/Main.html:
* UserInterface/Test.html:
* .eslintrc:

LayoutTests:

* inspector/unit-tests/debouncer.html: Renamed from inspector/unit-tests/debounce.html:.
* inspector/unit-tests/debouncer-expected.txt: Renamed from inspector/unit-tests/debounce-expected.txt.
* inspector/unit-tests/throttler.html: Renamed from inspector/unit-tests/throttle.html:.
* inspector/unit-tests/throttler-expected.txt: Renamed from inspector/unit-tests/throttle-expected.txt.
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:

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

5 months agoUnreviewed, fix indentation.
nvasilyev@apple.com [Mon, 25 Feb 2019 02:23:43 +0000 (02:23 +0000)]
Unreviewed, fix indentation.

* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.markModified):

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

5 months ago[JSC] Lazily create sentinel Map and Set buckets
ysuzuki@apple.com [Mon, 25 Feb 2019 02:17:35 +0000 (02:17 +0000)]
[JSC] Lazily create sentinel Map and Set buckets
https://bugs.webkit.org/show_bug.cgi?id=194975

Reviewed by Saam Barati.

If VM::canUseJIT() returns false, we can lazily initialize sentinel Map and Set buckets.
This patch adds getters to VM which lazily allocate these buckets. We eagerly initialize
them if VM::canUseJIT() returns true since they can be touched from DFG and FTL.

* bytecode/BytecodeIntrinsicRegistry.cpp:
(JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
(JSC::BytecodeIntrinsicRegistry::sentinelMapBucketValue):
(JSC::BytecodeIntrinsicRegistry::sentinelSetBucketValue):
* bytecode/BytecodeIntrinsicRegistry.h:
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGOperations.cpp:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetMapBucketNext):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetMapBucket):
(JSC::FTL::DFG::LowerDFGToB3::compileGetMapBucketNext):
* runtime/MapConstructor.cpp:
(JSC::mapPrivateFuncMapBucketNext):
* runtime/SetConstructor.cpp:
(JSC::setPrivateFuncSetBucketNext):
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::sentinelSetBucketSlow):
(JSC::VM::sentinelMapBucketSlow):
* runtime/VM.h:
(JSC::VM::sentinelSetBucket):
(JSC::VM::sentinelMapBucket):

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

5 months agoFinish removing String::format
darin@apple.com [Sun, 24 Feb 2019 23:57:25 +0000 (23:57 +0000)]
Finish removing String::format
https://bugs.webkit.org/show_bug.cgi?id=194893

Reviewed by Daniel Bates.

Source/JavaScriptCore:

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::nameForRegister): Use makeString instead of String::format,
using the new "pad" function.

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::lastModified const): Use makeString and pad.
* html/FTPDirectoryDocument.cpp:
(WebCore::processFileDateString): Ditto.

* mathml/MathMLElement.cpp:
(WebCore::convertToPercentageIfNeeded): Use makeString and FormattedNumber.

* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::ResourceUsageOverlay::platformDraw): Use makeString and pad.

* page/linux/ResourceUsageOverlayLinux.cpp:
(WebCore::cpuUsageString): Use makeString, FormattedNumber, and pad.
(WebCore::gcTimerString): Use String::number.

* platform/DateComponents.cpp:
(WebCore::DateComponents::toStringForTime const): Use makeString and pad.
(WebCore::DateComponents::toString const): Ditto.

* platform/LocalizedStrings.cpp: Removed comment that mentioned String::format,
and that was also inaccurate.

* platform/audio/HRTFElevation.cpp:
(WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
Use makeString and pad.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawText): Ditto.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::formatMediaControlsTime const): Ditto.

Source/WebKit:

* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::getAssertion): Use makeString, attempting to fix
a problem where we passed an NSData * to format with a "%s"."

Source/WebKitLegacy/win:

* FullscreenVideoController.cpp:
(timeToString): Use makeString and pad.

Source/WTF:

* wtf/Assertions.cpp:
(WTF::createWithFormatAndArguments): Moved this here from WTFString.cpp.
(WTFLog): Use WTF::createWithFormatAndArguments instead of String::format.

* wtf/HexNumber.h: Deleted unneeded toString function.

* wtf/text/StringConcatenate.h: Got rid of unneeded forward declaration of
StringTypeAdapter, since that's now in Forward.h. Tweaked formatting of templates
a bit. Use function templates for writeTo functions rather than having two of each.
Removed unused toString functions. Optimized case where we use have a UChar* and
a length of zero to not force the result to be 16-bit. Also gets rid of a small
NO_RETURN_DUE_TO_CRASH mess that we don't need. Refactored constructors to use some
static member helper functions to compute string lengths. Added the pad function
and the PaddingSpecification struct template, so we can add padding to anything
we can turn into a string. Got rid of the special case overload for single
arguments, since it only worked for things that the String constructor can handle.
Instead we will now use StringTypeAdapter, which works for more types. Possibly
less optimal for some special cases, which we could specialize for later if we like.
* wtf/text/StringConcatenateNumbers.h: Ditto.
* wtf/text/StringOperators.h: Ditto.
* wtf/text/StringView.h: Ditto.

* wtf/text/WTFString.cpp:
(WTF::createWithFormatAndArguments): Deleted.
(WTF::String::format): Deleted.
* wtf/text/WTFString.h: Deleted declaration of String::format.

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

5 months ago[WPE][GTK] Remove user agent quirk for washingtonpost.com
mcatanzaro@igalia.com [Sun, 24 Feb 2019 22:39:39 +0000 (22:39 +0000)]
[WPE][GTK] Remove user agent quirk for washingtonpost.com
https://bugs.webkit.org/show_bug.cgi?id=194981

Reviewed by Žan Doberšek.

Source/WebCore:

Remove user agent quirk for washingtonpost.com because we support JPEG 2000 now.

* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresChromeBrowser):

Tools:

* TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:
(TestWebKitAPI::TEST):

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

5 months ago[WPE] Install MemoryPressureHandler in UIProcess
mcatanzaro@igalia.com [Sun, 24 Feb 2019 22:37:38 +0000 (22:37 +0000)]
[WPE] Install MemoryPressureHandler in UIProcess
https://bugs.webkit.org/show_bug.cgi?id=194617

Reviewed by Žan Doberšek.

Currently only GTK and Cocoa ports run MemoryPressureHandler in the UI process. WPE should
too.

We need @no-unify to avoid changing the unified source bundles under API/, which are
notoriously fragile. (WebMemoryPressureHandler.cpp sorts just above API/.)

* SourcesWPE.txt:
* UIProcess/WebMemoryPressureHandler.cpp:
(WebKit::installMemoryPressureHandler):
* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::WebProcessPool::platformInitialize):

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

5 months agoRemove dead code: AdjacencyList::justOneChild()
rmorisset@apple.com [Sun, 24 Feb 2019 03:18:33 +0000 (03:18 +0000)]
Remove dead code: AdjacencyList::justOneChild()
https://bugs.webkit.org/show_bug.cgi?id=194965

Reviewed by Sam Weinig.

* dfg/DFGAdjacencyList.h:
(JSC::DFG::AdjacencyList::justOneChild const): Deleted.

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

5 months agoGive DrawingAreas their own identifiers
cdumez@apple.com [Sun, 24 Feb 2019 03:03:10 +0000 (03:03 +0000)]
Give DrawingAreas their own identifiers
https://bugs.webkit.org/show_bug.cgi?id=194969
<rdar://problem/48154508>

Unreviewed, fix API test debug assertion failures after r241988.
We do not support sending an ObjectIdentifier that is 0 via IPC so update WebPageProxy::CreateNewPage
IPC to return an Optional<WebPageCreationParameters> instead of a WebPageCreationParameters. It returns
nullopt when there this no UIClient or the client did not create the page, instead of returning a
default-initialized WebPageCreationParameters.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::createNewPage):
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createWindow):

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

5 months agoUnreviewed, fix find/replace error from r232178
mcatanzaro@igalia.com [Sun, 24 Feb 2019 00:57:25 +0000 (00:57 +0000)]
Unreviewed, fix find/replace error from r232178

Looks like this was the only such error in that commit.

* wtf/URLHelpers.cpp:
(WTF::URLHelpers::isLookalikeCharacter):

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

5 months agoRemove remnants of iOS WK1 scrolling tree code
simon.fraser@apple.com [Sun, 24 Feb 2019 00:03:37 +0000 (00:03 +0000)]
Remove remnants of iOS WK1 scrolling tree code
https://bugs.webkit.org/show_bug.cgi?id=194980

Reviewed by Sam Weinig.

Source/WebCore:

Remove ScrollingTreeIOS and ScrollingCoordinatorIOS which were never instantiated,
to reduce maintenance costs and simplify.

Merge ScrollingTreeFrameScrollingNodeIOS into ScrollingTreeFrameScrollingNodeRemoteIOS
since that was the only concrete subclass, removing code which never applies to iOS WK2
(e.g. the synchronous scrolling code path).

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/FrameView.h:
* page/scrolling/ScrollingCoordinator.cpp:
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeNode.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::handleWheelEvent):
* page/scrolling/ScrollingTreeScrollingNode.h:
(WebCore::ScrollingTreeScrollingNode::updateLayersAfterDelegatedScroll): Deleted.
(WebCore::ScrollingTreeScrollingNode::scrollableAreaSize const): Deleted.
(WebCore::ScrollingTreeScrollingNode::totalContentsSize const): Deleted.
(WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsets const): Deleted.
(WebCore::ScrollingTreeScrollingNode::verticalSnapOffsets const): Deleted.
(WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsetRanges const): Deleted.
(WebCore::ScrollingTreeScrollingNode::verticalSnapOffsetRanges const): Deleted.
(WebCore::ScrollingTreeScrollingNode::currentHorizontalSnapPointIndex const): Deleted.
(WebCore::ScrollingTreeScrollingNode::currentVerticalSnapPointIndex const): Deleted.
(WebCore::ScrollingTreeScrollingNode::setCurrentHorizontalSnapPointIndex): Deleted.
(WebCore::ScrollingTreeScrollingNode::setCurrentVerticalSnapPointIndex): Deleted.
(WebCore::ScrollingTreeScrollingNode::useDarkAppearanceForScrollbars const): Deleted.
(WebCore::ScrollingTreeScrollingNode::lastCommittedScrollPosition const): Deleted.
(WebCore::ScrollingTreeScrollingNode::reachableContentsSize const): Deleted.
(WebCore::ScrollingTreeScrollingNode::parentRelativeScrollableRect const): Deleted.
(WebCore::ScrollingTreeScrollingNode::scrollOrigin const): Deleted.
(WebCore::ScrollingTreeScrollingNode::totalContentsSizeForRubberBand const): Deleted.
(WebCore::ScrollingTreeScrollingNode::setTotalContentsSizeForRubberBand): Deleted.
(WebCore::ScrollingTreeScrollingNode::horizontalScrollElasticity const): Deleted.
(WebCore::ScrollingTreeScrollingNode::verticalScrollElasticity const): Deleted.
(WebCore::ScrollingTreeScrollingNode::hasEnabledHorizontalScrollbar const): Deleted.
(WebCore::ScrollingTreeScrollingNode::hasEnabledVerticalScrollbar const): Deleted.
(WebCore::ScrollingTreeScrollingNode::canHaveScrollbars const): Deleted.
(WebCore::ScrollingTreeScrollingNode::expectsWheelEventTestTrigger const): Deleted.
(WebCore::ScrollingTreeScrollingNode::scrollContainerLayer const): Deleted.
(WebCore::ScrollingTreeScrollingNode::scrolledContentsLayer const): Deleted.
* page/scrolling/ios/ScrollingCoordinatorIOS.h: Removed.
* page/scrolling/ios/ScrollingCoordinatorIOS.mm: Removed.
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: Removed.
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Removed.
* page/scrolling/ios/ScrollingTreeIOS.cpp: Removed.
* page/scrolling/ios/ScrollingTreeIOS.h: Removed.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):

Source/WebKit:

Remove ScrollingTreeIOS and ScrollingCoordinatorIOS which were never instantiated.

Merge ScrollingTreeFrameScrollingNodeIOS into ScrollingTreeFrameScrollingNodeRemoteIOS,
removing code which never applies to iOS WK2 (e.g. the synchronous scrolling code path).

* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::ScrollingTreeFrameScrollingNodeRemoteIOS):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::minimumScrollPosition const):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::maximumScrollPosition const):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollPosition):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:

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

5 months ago[WebGPU] Buffer updates part 1: async mapping functions, unmap, and destroy
justin_fan@apple.com [Sat, 23 Feb 2019 23:24:27 +0000 (23:24 +0000)]
[WebGPU] Buffer updates part 1: async mapping functions, unmap, and destroy
https://bugs.webkit.org/show_bug.cgi?id=194665

Reviewed by Dean Jackson.

Source/WebCore:

Test: map-write-buffers.html. Other tests updated to match new API.

* Modules/webgpu/WebGPUBindGroupDescriptor.cpp: Added.
(WebCore::validateBufferBindingType): Ensure buffer binding usages match the binding type.
(WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Logic moved out from WebGPUDevice.cpp.
* Modules/webgpu/WebGPUBindGroupDescriptor.h:
* Modules/webgpu/WebGPUBuffer.cpp: Added GPUBuffer functionality.
(WebCore::WebGPUBuffer::create):
(WebCore::WebGPUBuffer::WebGPUBuffer):
(WebCore::WebGPUBuffer::mapReadAsync):
(WebCore::WebGPUBuffer::mapWriteAsync):
(WebCore::WebGPUBuffer::unmap):
(WebCore::WebGPUBuffer::destroy):
(WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback): Register a mapping request on the GPUBuffer, if valid.
* Modules/webgpu/WebGPUBuffer.h:
(WebCore::WebGPUBuffer::buffer const):
(WebCore::WebGPUBuffer::mapping const): Deleted.
* Modules/webgpu/WebGPUBuffer.idl: Update to latest API and enable every function except setSubData.
* Modules/webgpu/WebGPUCommandBuffer.cpp:
(WebCore::WebGPUCommandBuffer::beginRenderPass): Renamed descriptor conversion method.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createBuffer const): Update to non-nullable return type.
(WebCore::WebGPUDevice::createBindGroup const): Move descriptor validation logic to descriptor implementation.
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPURenderPassDescriptor.cpp:
(WebCore::WebGPURenderPassDescriptor::asGPURenderPassDescriptor const): Renamed from validateAndConvertToGPUVersion.
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::setVertexBuffers): Add validation for submitted buffers.
* platform/graphics/gpu/GPUBuffer.cpp: Added.
(WebCore::GPUBuffer::PendingMappingCallback::PendingMappingCallback): New struct for retaining a reference to mapping callbacks.
* platform/graphics/gpu/GPUBuffer.h: Add functionality to retain callbacks and usage bits.
(WebCore::GPUBuffer::isVertex const):
(WebCore::GPUBuffer::isUniform const):
(WebCore::GPUBuffer::isStorage const):
(WebCore::GPUBuffer::isReadOnly const):
(WebCore::GPUBuffer::PendingMapPromise::create):
(WebCore::GPUBuffer::isMappable const):
(WebCore::GPUBuffer::isMapWriteable const):
(WebCore::GPUBuffer::isMapReadable const):
(WebCore::GPUBuffer::mapping const): Deleted.
* platform/graphics/gpu/GPUBufferUsage.h: enum class cannot be logical ORed together.
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateBuffer const): Renamed from createBuffer.
(WebCore::GPUDevice::createBuffer const): Deleted.
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::tryCreateSharedBuffer): Attempt to create a MTLBuffer with shared memory.
(WebCore::GPUBuffer::tryCreate): No longer use Gigacage-allocated memory for MTLBuffer.
(WebCore::GPUBuffer::GPUBuffer):
(WebCore::GPUBuffer::~GPUBuffer):
(WebCore::GPUBuffer::registerMappingCallback): Register the provided callback to be executed when the staging buffer can be safely exposed.
(WebCore::GPUBuffer::stagingBufferForRead): Prepare the arrayBuffer for reading and run the mapping callback.
(WebCore::GPUBuffer::stagingBufferForWrite): Ditto, but for writing.
(WebCore::GPUBuffer::unmap): If needed, copy the staging ArrayBuffer to the MTLBuffer. Unregister any mapping callback.
(WebCore::GPUBuffer::destroy): Stub implementation for now. Frees the MTLBuffer as soon as possible.
(WebCore::GPUBuffer::create): Deleted.
* platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
(WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Ensure only read-only GPUBuffers are used as read-only on the GPU.

Add symbols for new files:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

LayoutTests:

Rewrite buffers.html -> map-write-buffers.html to test new functionality. Rewrite other affected
tests to use mapWriteAsync.

* webgpu/buffer-resource-triangles.html:
* webgpu/buffers-expected.txt: Renamed to map-write-buffers-expected.txt.
* webgpu/buffers.html: Renamed to map-write-buffers.html.
* webgpu/depth-enabled-triangle-strip.html:
* webgpu/map-write-buffers-expected.txt: Renamed from buffers-expected.txt.
* webgpu/map-write-buffers.html: Renamed from buffers.html.
* webgpu/vertex-buffer-triangle-strip.html:

* platform/mac/TestExpectations: Skip all webgpu tests on macOS 10.12 bots.

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

5 months agoUnreviewed, fix -Wunused-param warning
mcatanzaro@igalia.com [Sat, 23 Feb 2019 20:49:39 +0000 (20:49 +0000)]
Unreviewed, fix -Wunused-param warning

* jsc.cpp:

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

5 months agoAdd an exception check and some assertions in StringPrototype.cpp.
mark.lam@apple.com [Sat, 23 Feb 2019 18:15:41 +0000 (18:15 +0000)]
Add an exception check and some assertions in StringPrototype.cpp.
https://bugs.webkit.org/show_bug.cgi?id=194962
<rdar://problem/48013416>

Reviewed by Yusuke Suzuki and Saam Barati.

Source/JavaScriptCore:

* runtime/StringPrototype.cpp:
(JSC::jsSpliceSubstrings):
(JSC::jsSpliceSubstringsWithSeparators):
(JSC::operationStringProtoFuncReplaceRegExpEmptyStr):

Source/WTF:

Add an AssertNoOverflow overflow handler which allows us to do CheckedArithmetic
for assertion purpose only on debug builds but sacrifices no performance on
release builds.

* wtf/CheckedArithmetic.h:
(WTF::AssertNoOverflow::overflowed):
(WTF::AssertNoOverflow::clearOverflow):
(WTF::AssertNoOverflow::crash):
(WTF::AssertNoOverflow::hasOverflowed const):
(WTF::observesOverflow):
(WTF::observesOverflow<AssertNoOverflow>):
(WTF::safeAdd):
(WTF::safeSub):
(WTF::safeMultiply):
(WTF::Checked::operator+=):
(WTF::Checked::operator-=):
(WTF::Checked::operator*=):
(WTF::operator+):
(WTF::operator-):
(WTF::operator*):

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

5 months agoAdd new mac target numbers
keith_miller@apple.com [Sat, 23 Feb 2019 18:01:16 +0000 (18:01 +0000)]
Add new mac target numbers
https://bugs.webkit.org/show_bug.cgi?id=194955

Reviewed by Tim Horton.

Source/bmalloc:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/JavaScriptCore:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/ThirdParty/ANGLE:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/ThirdParty/libwebrtc:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/WebCore:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/WebCore/PAL:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/WebInspectorUI:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/WebKit:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/WTF:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Tools:

* DumpRenderTree/mac/Configurations/Base.xcconfig:
* DumpRenderTree/mac/Configurations/DebugRelease.xcconfig:
* MiniBrowser/Configurations/Base.xcconfig:
* TestWebKitAPI/Configurations/Base.xcconfig:
* WebKitTestRunner/Configurations/Base.xcconfig:

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

5 months agoAX: WebKit is incorrectly mapping the <meter> element to progressbar
cfleizach@apple.com [Sat, 23 Feb 2019 16:11:41 +0000 (16:11 +0000)]
AX: WebKit is incorrectly mapping the <meter> element to progressbar
https://bugs.webkit.org/show_bug.cgi?id=164051
<rdar://problem/29055615>

Reviewed by Joanmarie Diggs.

Source/WebCore:

Add a specific role for meter and map that to the appropriate mac role.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::canHaveChildren const):
(WebCore::AccessibilityNodeObject::isProgressIndicator const):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
(WebCore::AccessibilityObject::isRangeControl const):
(WebCore::AccessibilityObject::computedRoleString const):
* accessibility/AccessibilityObjectInterface.h:
* accessibility/AccessibilityProgressIndicator.cpp:
(WebCore::AccessibilityProgressIndicator::roleValue const):
* accessibility/AccessibilityProgressIndicator.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant const):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):

LayoutTests:

* platform/mac-wk2/accessibility/roles-exposed-expected.txt:
* platform/mac/accessibility/meter-element-expected.txt:
* platform/mac/accessibility/roles-exposed-expected.txt:

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

5 months agoGive DrawingAreas their own identifiers
cdumez@apple.com [Sat, 23 Feb 2019 05:30:19 +0000 (05:30 +0000)]
Give DrawingAreas their own identifiers
https://bugs.webkit.org/show_bug.cgi?id=194969
<rdar://problem/48154508>

Reviewed by Geoffrey Garen.

Give DrawingAreas their own identifiers instead of using the pageID. It will make the IPC more robust now that a
WebPageProxy can have several drawing areas with PSON.

* Shared/DrawingAreaInfo.h:
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/AcceleratedDrawingAreaProxy.cpp:
(WebKit::AcceleratedDrawingAreaProxy::sendUpdateBackingStoreState):
(WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):
(WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing):
(WebKit::AcceleratedDrawingAreaProxy::destroyNativeSurfaceHandleForCompositing):
* UIProcess/DrawingAreaProxy.cpp:
(WebKit::DrawingAreaProxy::DrawingAreaProxy):
(WebKit::DrawingAreaProxy::~DrawingAreaProxy):
(WebKit::DrawingAreaProxy::messageSenderConnection const):
(WebKit::DrawingAreaProxy::sendMessage):
(WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::identifier const):
(WebKit::DrawingAreaProxy::process const):
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::update):
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::initializeWebPage):
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::deviceScaleFactorDidChange):
(WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
(WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
(WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd):
(WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
(WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
(WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::initializeWebPage):
(WebKit::WebPageProxy::createNewPage):
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange):
(WebKit::TiledCoreAnimationDrawingAreaProxy::colorSpaceDidChange):
(WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
(WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
(WebKit::TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom):
(WebKit::TiledCoreAnimationDrawingAreaProxy::commitTransientZoom):
(WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
(WebKit::AcceleratedDrawingArea::layerHostDidFlushLayers):
(WebKit::AcceleratedDrawingArea::sendDidUpdateBackingStoreState):
* WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::DrawingArea):
(WebKit::DrawingArea::removeMessageReceiverIfNeeded):
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::identifier const):
(WebKit::DrawingArea::send):
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
(WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
(WebKit::DrawingAreaImpl::display):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::sendEnterAcceleratedCompositingModeIfNeeded):
(WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
(WebKit::TiledCoreAnimationDrawingArea::setLayerHostingMode):

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

5 months agoFix a legacy animation test. The <!-- webkit-test-runner --> was inside the <style>.
simon.fraser@apple.com [Sat, 23 Feb 2019 05:14:34 +0000 (05:14 +0000)]
Fix a legacy animation test. The <!-- webkit-test-runner --> was inside the <style>.

* legacy-animation-engine/animations/additive-transform-animations.html:

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

5 months agoCrash in SWServerJobQueue::runNextJobSynchronously
rniwa@webkit.org [Sat, 23 Feb 2019 05:05:03 +0000 (05:05 +0000)]
Crash in SWServerJobQueue::runNextJobSynchronously
https://bugs.webkit.org/show_bug.cgi?id=194974

Reviewed by Geoffrey Garen.

We suspect the crash is happening due to m_jobQueue being empty in runNextJobSynchronously
or there is a timer heap corruption again :(

Exit early when m_jobQueue is empty. Also add a debug assert that this should never happen
but convert an existing release assert to a debug assert since this appears to be hitting
too frequently in wild.

* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::runNextJobSynchronously):

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

5 months ago[Cocoa] Do not suppress deprecation warnings when calling sandbox_extension_issue_file
aestes@apple.com [Sat, 23 Feb 2019 04:50:56 +0000 (04:50 +0000)]
[Cocoa] Do not suppress deprecation warnings when calling sandbox_extension_issue_file
https://bugs.webkit.org/show_bug.cgi?id=194971
<rdar://problem/35786264>

Reviewed by Tim Horton.

sandbox_extension_issue_file is not actually deprecated.

* Shared/mac/SandboxExtensionMac.mm:
(WebKit::SandboxExtensionImpl::sandboxExtensionForType):

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

5 months agoClean up the setScrollPosition/setScrollPositionWithoutContentEdgeConstraints confusi...
simon.fraser@apple.com [Sat, 23 Feb 2019 04:40:08 +0000 (04:40 +0000)]
Clean up the setScrollPosition/setScrollPositionWithoutContentEdgeConstraints confusion in the scrolling tree nodes
https://bugs.webkit.org/show_bug.cgi?id=194968

Reviewed by Antti Koivisto.

Having both setScrollPosition() and setScrollPositionWithoutContentEdgeConstraints() is confusing because
you can't tell which is the bottleneck. So add a 'clamp' parameter to setScrollPosition() and merge them.

ScrollingTreeFrameScrollingNodeMac::setScrollPosition() replicates a bit of code but future cleanups will
reduce that.

* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::setScrollPosition): Deleted. This was the same as the base class method.
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::setScrollPosition):
(WebCore::ScrollingTreeScrollingNode::clampScrollPosition const):
(WebCore::ScrollingTreeScrollingNode::scrollBy):
(WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints): Deleted.
(WebCore::ScrollingTreeScrollingNode::scrollByWithoutContentEdgeConstraints): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints): Deleted. Did nothing.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): Deleted.
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): Deleted.
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollByWithoutContentEdgeConstraints):
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::delta const):
* platform/ScrollTypes.h:

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

5 months agoAX: Treat AXChildrenInNavigationOrder as AXChildren before adding support for aria...
commit-queue@webkit.org [Sat, 23 Feb 2019 04:31:33 +0000 (04:31 +0000)]
AX: Treat AXChildrenInNavigationOrder as AXChildren before adding support for aria-flowto
https://bugs.webkit.org/show_bug.cgi?id=194923

Patch by Eric Liang <ericliang@apple.com> on 2019-02-22
Reviewed by Chris Fleizach.

Source/WebCore:

Added AXChildrenInNavigationOrder attribute that returns the same array as from AXChildren. It prevents AppKit from reordering elements from the fallback AXChildren attribute.

Test: accessibility/mac/children-in-navigation-order-returns-children.html

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

LayoutTests:

Added test to check AXChildrenInNavigationOrder returns non-empty array from AXChildren.
* accessibility/mac/children-in-navigation-order-returns-children-expected.txt: Added.
* accessibility/mac/children-in-navigation-order-returns-children.html: Added.

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

5 months agoWeb Inspector: Timelines: add UI for preventing auto-stop
drousso@apple.com [Sat, 23 Feb 2019 04:17:58 +0000 (04:17 +0000)]
Web Inspector: Timelines: add UI for preventing auto-stop
https://bugs.webkit.org/show_bug.cgi?id=194956

Reviewed by Joseph Pecoraro.

Add a checkbox to the navigation area of the Timelines tab that controls whether recordings
automatically stop (e.g. after "load" or a period of inactivity).

* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView):
(WI.TimelineRecordingContentView.prototype.get navigationItems):
(WI.TimelineRecordingContentView.prototype._handleAutoStopCheckboxCheckedDidChange): Added.
(WI.TimelineRecordingContentView.prototype._handleTimelinesAutoStopSettingChanged): Added.

* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager):
(WI.TimelineManager.prototype.capturingStopped):
(WI.TimelineManager.prototype._stopAutoRecordingSoon):
(WI.TimelineManager.prototype._resetAutoRecordingMaxTimeTimeout):
(WI.TimelineManager.prototype._resetAutoRecordingDeadTimeTimeout):
(WI.TimelineManager.prototype._handleTimelinesAutoStopSettingChanged):

* UserInterface/Base/Setting.js:
* Localizations/en.lproj/localizedStrings.js:

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

5 months agoREGRESSION(r?): Web Inspector: Popovers have inset shadows
drousso@apple.com [Sat, 23 Feb 2019 04:10:00 +0000 (04:10 +0000)]
REGRESSION(r?): Web Inspector: Popovers have inset shadows
https://bugs.webkit.org/show_bug.cgi?id=192963
<rdar://problem/46888679>

Reviewed by Brian Burg.

* UserInterface/Views/Popover.js:
(WI.Popover.prototype._drawBackground):
(WI.Popover.prototype._drawBackground.isolate): Added.
* UserInterface/Views/Popover.css:
(.popover):

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

5 months agoWeb Inspector: Styles Redesign: clicking CSS property or selector should always selec...
drousso@apple.com [Sat, 23 Feb 2019 04:07:58 +0000 (04:07 +0000)]
Web Inspector: Styles Redesign: clicking CSS property or selector should always select its text
https://bugs.webkit.org/show_bug.cgi?id=180791
<rdar://problem/36038366>

Reviewed by Brian Burg.

* UserInterface/Views/SpreadsheetSelectorField.js:
(WI.SpreadsheetSelectorField):
(WI.SpreadsheetSelectorField.prototype.startEditing):
(WI.SpreadsheetSelectorField.prototype.stopEditing):
(WI.SpreadsheetSelectorField.prototype._handleMouseDown): Added.
(WI.SpreadsheetSelectorField.prototype._handleMouseUp): Added.
(WI.SpreadsheetSelectorField.prototype._handleFocus): Deleted.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
(.spreadsheet-css-declaration .selector.editing:focus, .spreadsheet-css-declaration .selector > .matched): Added.
(.spreadsheet-css-declaration .selector.spreadsheet-selector-field):
(.spreadsheet-css-declaration .selector:focus, .spreadsheet-css-declaration .selector > .matched): Deleted.

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

5 months ago[WinCairo] Enable wk1/wk2 suffix for platform search path.
basuke.suzuki@sony.com [Sat, 23 Feb 2019 04:05:55 +0000 (04:05 +0000)]
[WinCairo] Enable wk1/wk2 suffix for platform search path.
https://bugs.webkit.org/show_bug.cgi?id=194846

Reviewed by Don Olmstead.

Tools:

Added _search_paths() and _port_specific_expectations_files() for
WinCairoPort.

* Scripts/webkitpy/port/win.py:
(WinCairoPort.default_baseline_search_path):
(WinCairoPort):
(WinCairoPort._port_specific_expectations_files):
(WinCairoPort._search_paths):

LayoutTests:

Added WebKitLegacy specific TestExpectations.

* platform/wincairo-wk1/TestExpectations: Added.
* platform/wincairo/TestExpectations:

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

5 months agoProcessSwap.PageOverlayLayerPersistence fails on iOS and in debug builds
timothy_horton@apple.com [Sat, 23 Feb 2019 02:38:02 +0000 (02:38 +0000)]
ProcessSwap.PageOverlayLayerPersistence fails on iOS and in debug builds
https://bugs.webkit.org/show_bug.cgi?id=194963

Reviewed by Dean Jackson.

Source/WebCore:

Tested by existing failing API test.

* page/Page.cpp:
(WebCore::Page::installedPageOverlaysChanged): Deleted.
* page/Page.h:
(WebCore::Page::pageOverlayController):
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::installedPageOverlaysChanged):
(WebCore::PageOverlayController::detachViewOverlayLayers):
(WebCore::PageOverlayController::installPageOverlay):
(WebCore::PageOverlayController::uninstallPageOverlay):
(WebCore::PageOverlayController::willDetachRootLayer): Deleted.
* page/PageOverlayController.h:
As intended by r240940, move installedPageOverlaysChanged to PageOverlayController.
Also, make it ignore isInWindow state; otherwise, if you install a overlay
and then come into window, nothing installs the root layer. There is no
need for this code to follow in-window state manually anymore since
the DrawingArea and RenderLayerCompositor just hook the layers up when needed.

Make some methods private, and make detachViewOverlayLayers only touch
*view* overlays, so that we don't detach the document-relative root
layer when you drop to having no view overlays. This maintains
existing behavior because nothing was calling PageOverlayController::detachViewOverlayLayers.

Now there are no callers of willDetachRootLayer, so remove it.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
Do a `contains` check instead of `equals`, because in debug builds we
put the GraphicsLayer pointer in a prefix.

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

5 months agoRotation animations sometimes use the wrong origin (affects apple.com)
dino@apple.com [Sat, 23 Feb 2019 02:10:58 +0000 (02:10 +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.

Forgot another expected results file.

* legacy-animation-engine/animations/additive-transform-animations-expected.html: Added.

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

5 months agoWeb Inspector: Dark Mode: DOM Content Loaded blue marker is too dark
nvasilyev@apple.com [Sat, 23 Feb 2019 01:51:15 +0000 (01:51 +0000)]
Web Inspector: Dark Mode: DOM Content Loaded blue marker is too dark
https://bugs.webkit.org/show_bug.cgi?id=194970
<rdar://problem/48330126>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TimelineRuler.css:
(@media (prefers-color-scheme: dark)):
(.timeline-ruler > .markers > .marker.dom-content-event):
Make the marker lighter for the dark mode.

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

5 months agoSkip the test added in r241932 on iOS for now.
rniwa@webkit.org [Sat, 23 Feb 2019 01:03:55 +0000 (01:03 +0000)]
Skip the test added in r241932 on iOS for now.

* platform/ios/TestExpectations:

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

5 months ago[iOS] Callout menu overlaps in-page controls when editing a comment in github.com...
wenson_hsieh@apple.com [Sat, 23 Feb 2019 00:48:16 +0000 (00:48 +0000)]
[iOS] Callout menu overlaps in-page controls when editing a comment in github.com's issue tracker
https://bugs.webkit.org/show_bug.cgi?id=194873
<rdar://problem/46701974>

Reviewed by Tim Horton.

Source/WebKit:

On the topic of supporting web-based rich text editors on iOS, one problematic area has always been handling
conflicts between platform UI (i.e., the system callout menu) and in-page text editing controls. This issue
comes up in websites that don't use the "hidden contenteditable" approach to rich text editing, but also show
additional controls in a toolbar or contextual menu above the selection. In these cases, what often happens is
that system controls overlap controls in the page.

Luckily, the iOS callout menu (i.e. the private UICalloutBar) is capable of presenting with a list of "evasion
rects" to avoid; if the callout bar would normally intersect with one of these rects, then a different
orientation that does not intersect with one of these rects is chosen instead. Currently, the only rect added
here by UIKit when presenting the callout menu is the bounding rect of the on-screen keyboard, but after
<rdar://problem/48128337>, we now have a generalized mechanism for offering additional evasion rects before
UIKit presents the callout menu.

This patch adopts the mechanism introduced in <rdar://problem/48128337>, and introduces a heuristic for
determining the approximate location of controls in the page which might overlap the callout menu. This
heuristic works by hit-testing for clickable (but non-editable) nodes above the bounds of the selection, which
are additionally not hit-tested by advancing outwards from any of the other edges of the selection bounds.
Additionally, any hit-tested nodes whose bounding rects are very large (relative to the content view size) are
ignored (this deals with scenarios where the body or a large container element has a click handler). We then add
the bounding rects of each of the nodes that fit this criteria to the list of rects for UIKit to avoid when
presenting the system callout menu.

The result is that WebKit will, by default, avoid overlapping anything that looks like controls in the page when
showing a callout menu in editable content. In practice, this fixes overlapping controls on most websites that
roll their own context menu or toolbar in their rich text editor.

Test: editing/selection/ios/avoid-showing-callout-menu-over-controls.html

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
(-[WKContentView requestRectsToEvadeForSelectionCommandsWithCompletionHandler:]):
(-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):

Drive-by: handle null completion handler arguments more gracefully, by raising an NSException and bailing before
attempting to invoke a nil block.

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

See above for more detail.

* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::requestEvasionRectsAboveSelection):

Tools:

Add a couple of UIScriptController methods to make callout menu testing on iOS easier (see below).

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::menuRect const):
(WTR::UIScriptController::isShowingMenu const):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::menuRect const):

Add a function to query the bounds of the callout menu in content coordinates.

(WTR::UIScriptController::isShowingMenu const):

Add a function to query whether the callout menu is shown (i.e., has finished its appearance animation).

* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/cocoa/TestRunnerWKWebView.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::rectForMenuAction const):
(WTR::UIScriptController::menuRect const):
(WTR::UIScriptController::isShowingMenu const):
(WTR::findViewInHierarchyOfType): Deleted.

LayoutTests:

Add a test to ensure that the we dodge clickable elements when showing the callout bar.

* editing/selection/ios/avoid-showing-callout-menu-over-controls-expected.txt: Added.
* editing/selection/ios/avoid-showing-callout-menu-over-controls.html: Added.
* resources/ui-helper.js:
(window.UIHelper.waitForMenuToShow.return.new.Promise):
(window.UIHelper.waitForMenuToShow):
(window.UIHelper.menuRect):
(window.UIHelper):

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

5 months ago[iOS] Break a reference cycle between PreviewLoader and ResourceLoader
aestes@apple.com [Sat, 23 Feb 2019 00:41:58 +0000 (00:41 +0000)]
[iOS] Break a reference cycle between PreviewLoader and ResourceLoader
https://bugs.webkit.org/show_bug.cgi?id=194964
<rdar://problem/48279441>

Reviewed by Alex Christensen.

When a document's QuickLook preview is loaded, a reference cycle is created between
PreviewLoader and ResourceLoader. Break the cycle by clearing m_previewLoader in
ResourceLoader::releaseResources().

Fixes leaks detected by `run-webkit-tests --leaks LayoutTests/quicklook`.

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::releaseResources):

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

5 months agoUnreviewed build fix: need a WebCore:: namespace on ScrollingEventResult.
simon.fraser@apple.com [Sat, 23 Feb 2019 00:13:49 +0000 (00:13 +0000)]
Unreviewed build fix: need a WebCore:: namespace on ScrollingEventResult.

* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:

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

5 months agoDFGBytecodeParser should not declare that a node won't clobberExit if DFGFixupPhase...
rmorisset@apple.com [Sat, 23 Feb 2019 00:05:11 +0000 (00:05 +0000)]
DFGBytecodeParser should not declare that a node won't clobberExit if DFGFixupPhase can later declare it does clobberExit
https://bugs.webkit.org/show_bug.cgi?id=194953
<rdar://problem/47595253>

Reviewed by Saam Barati.

JSTests:

I could not make this work without the infinite loop, so I am using a watchdog to be able to use it as a regression test.

* stress/has-indexed-property-with-worsening-array-mode.js: Added.

Source/JavaScriptCore:

For each node that
(a) may or may not clobberExit depending on their arrayMode
(b) and get their arrayMode from profiling information in DFGBytecodeParser
(c) and can have their arrayMode refined by DFGFixupPhase,
We must make sure to be conservative in the DFGBytecodeParser and treat it as if it unconditionnally clobbered the exit.
Otherwise we will hit a validation failure after fixup if the next node was marked ExitValid and exits to the same semantic origin.

The list of nodes that fit (a) is:
- StringCharAt
- HasIndexProperty
- GetByVal
- PutByValDirect
- PutByVal
- PutByValAlias
- GetIndexedPropertyStorage

Out of these, the following also fit (b) and (c):
- HasIndexedProperty
- GetByVal
- PutByValDirect
- PutByVal

GetByVal already had "m_exitOK = false; // GetByVal must be treated as if it clobbers exit state, since FixupPhase may make it generic."
So we just have to fix the other three the same way.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::ByteCodeParser::handlePutByVal):

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

5 months agoCrash under IDBServer::IDBConnectionToClient::identifier() const
sihui_liu@apple.com [Fri, 22 Feb 2019 23:41:16 +0000 (23:41 +0000)]
Crash under IDBServer::IDBConnectionToClient::identifier() const
https://bugs.webkit.org/show_bug.cgi?id=194843
<rdar://problem/48203102>

Reviewed by Geoffrey Garen.

UniqueIDBDatabase should ignore requests from connections that are already closed.

Tests are hard to create without some tricks on UniqueIDBDatabase so this fix is verified manually.
One test is created by adding delay to UniqueIDBDatabase::openBackingStore on the background thread to make sure
disconnection of web process happens before UniqueIDBDatabase::didOpenBackingStore, because didOpenBackingStore
may start a version change transaction and ask for identifier from the connection that is already gone.

* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::connectionToClientClosed):
* Modules/indexeddb/server/IDBConnectionToClient.h:
(WebCore::IDBServer::IDBConnectionToClient::isClosed):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::clearStalePendingOpenDBRequests):
(WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
(WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

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

5 months agoB3ReduceStrength: missing peephole optimizations for binary operations
rmorisset@apple.com [Fri, 22 Feb 2019 22:54:23 +0000 (22:54 +0000)]
B3ReduceStrength: missing peephole optimizations for binary operations
https://bugs.webkit.org/show_bug.cgi?id=194252

Reviewed by Saam Barati.

Adds several sets of optimizations for BitAnd, BitOr and BitXor.
Using BitAnd distributivity over BitOr and BitXor:
  Turn any of these (for Op == BitOr || Op == BitXor):
        Op(BitAnd(x1, x2), BitAnd(x1, x3))
        Op(BitAnd(x2, x1), BitAnd(x1, x3))
        Op(BitAnd(x1, x2), BitAnd(x3, x1))
        Op(BitAnd(x2, x1), BitAnd(x3, x1))
   Into this: BitAnd(Op(x2, x3), x1)
   And any of these:
        Op(BitAnd(x1, x2), x1)
        Op(BitAnd(x2, x1), x1)
        Op(x1, BitAnd(x1, x2))
        Op(x1, BitAnd(x2, x1))
   Into this: BitAnd(Op(x2, x1), x1)
   This second set is equivalent to doing x1 => BitAnd(x1, x1), and then applying the first set.
Using de Morgan laws (we represent not as BitXor with allOnes):
  BitAnd(BitXor(x1, allOnes), BitXor(x2, allOnes)) => BitXor(BitOr(x1, x2), allOnes)
  BitOr(BitXor(x1, allOnes), BitXor(x2, allOnes) => BitXor(BitAnd(x1, x2), allOnes)
  BitOr(BitXor(x, allOnes), c) => BitXor(BitAnd(x, ~c), allOnes)
  BitAnd(BitXor(x, allOnes), c) => BitXor(BitOr(x, ~c), allOnes)
The latter two are equivalent to doing c => BitXor(~c, allOnes), and then applying the former two.

All of these transformations either reduce the number of operations (which we always do when possible), or bring the expression closer to having:
  - BitXor with all ones at the outermost
  - then BitAnd
  - then other BitXor
  - then BitOr at the innermost.
These transformations that don't directly reduce the number of operations are still useful for normalization (helping things like CSE), and also can enable
more optimizations (for example BitXor with all ones can easily cancel each other once they are all at the outermost level).

* b3/B3ReduceStrength.cpp:
* b3/testb3.cpp:
(JSC::B3::testBitAndNotNot):
(JSC::B3::testBitAndNotImm):
(JSC::B3::testBitOrAndAndArgs):
(JSC::B3::testBitOrAndSameArgs):
(JSC::B3::testBitOrNotNot):
(JSC::B3::testBitOrNotImm):
(JSC::B3::testBitXorAndAndArgs):
(JSC::B3::testBitXorAndSameArgs):
(JSC::B3::run):

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

5 months agoRegression(PSON) Unable to preview password-protected documents on iCloud.com
cdumez@apple.com [Fri, 22 Feb 2019 21:17:37 +0000 (21:17 +0000)]
Regression(PSON) Unable to preview password-protected documents on iCloud.com
https://bugs.webkit.org/show_bug.cgi?id=194954
<rdar://problem/48127957>

Reviewed by Alex Christensen.

Source/WebKit:

Make sure the ProvisionalPageProxy forwards to the WebPageProxy the QuickLook-related
IPC on iOS.

* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
(WebKit::ProvisionalPageProxy::didReceiveMessage):
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
(WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrameShared):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
(-[PSONNavigationDelegate _webViewDidRequestPasswordForQuickLookDocument:]):
(-[PSONNavigationDelegate _webView:didStartLoadForQuickLookDocumentInMainFrameWithFileName:uti:]):
(-[PSONNavigationDelegate _webView:didFinishLoadForQuickLookDocumentInMainFrame:]):

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

5 months ago[iOS] Sandbox should allow mach lookups related to media capturing
pvollan@apple.com [Fri, 22 Feb 2019 20:44:28 +0000 (20:44 +0000)]
[iOS] Sandbox should allow mach lookups related to media capturing
https://bugs.webkit.org/show_bug.cgi?id=194951
<rdar://problem/48013875>

Reviewed by Brent Fulgham.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

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

5 months ago[JSC] putNonEnumerable in JSWrapperMap is too costly
ysuzuki@apple.com [Fri, 22 Feb 2019 20:20:49 +0000 (20:20 +0000)]
[JSC] putNonEnumerable in JSWrapperMap is too costly
https://bugs.webkit.org/show_bug.cgi?id=194935

Reviewed by Mark Lam.

When we convert Objective-C blocks to JS objects, we need to set up a corresponding function object correctly.
During this allocation, we call [JSValue defineProperty:descriptor] to connect a "prototype" object and "constructor" object.
The problem is that this API has a particularly costly implementation:

    [[_context globalObject][@"Object"] invokeMethod:@"defineProperty" withArguments:@[ self, key, descriptor ]];

This wraps each JS objects appear in this code with Objective-C wrapper. And we convert a NSDictionary to JSObject, which
has "writable", "enumerable", "configurable", "value" fields, and call the "defineProperty" JS function through Objective-C wrapper.
This allocates many Objective-C wrappers and JS objects for descriptors. Since JSC has a direct C++ API "defineOwnProperty", we should
bypass these Objective-C APIs and call JSC's code directly.

This patch changes `putNonEnumerable` implementation, from calling [JSValue defineProperty:descriptor] to calling JSC C++ code directly.
We do not change [JSValue defineProperty:descriptor] implementation for now because of two reasons. (1) This is not used in our benchmarks
except for this (converting an Objective-C block to a JS object) one path. And (2) even if we were to re-write [JSValue defineProperty:descriptor]
to be more optimized, we would still want to call the JSC C++ version of defineProperty directly here to avoid NSDictionary allocation for a descriptor.

* API/APIUtils.h:
(setException):
* API/JSWrapperMap.mm:
(putNonEnumerable):
(copyMethodsToObject):
(-[JSObjCClassInfo allocateConstructorAndPrototypeInContext:]):
(-[JSObjCClassInfo wrapperForObject:inContext:]):

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

5 months agoUnreviewed, build fix after r241954
ysuzuki@apple.com [Fri, 22 Feb 2019 19:15:42 +0000 (19:15 +0000)]
Unreviewed, build fix after r241954
https://bugs.webkit.org/show_bug.cgi?id=194939

Renaming setCanAccessHeap was incomplete.

* runtime/SmallStrings.cpp:
(JSC::SmallStrings::initializeCommonStrings):
* runtime/VM.cpp:
(JSC::VM::~VM):

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

5 months ago[JSC] SmallStringsStorage is unnecessary
ysuzuki@apple.com [Fri, 22 Feb 2019 19:04:40 +0000 (19:04 +0000)]
[JSC] SmallStringsStorage is unnecessary
https://bugs.webkit.org/show_bug.cgi?id=194939

Reviewed by Mark Lam.

SmallStrings hold common small JSStrings. Their underlying StringImpl is also held by SmallStringsStorage.
But it is duplicate since we can get StringImpl from small JSStrings. This patch removes SmallStringsStorage,
and get StringImpls from JSStrings if necessary.

We also add m_canAccessHeap flag to SmallStrings. At the time of VM destruction, JSStrings are destroyed when
VM's Heap is finalized. We must not touch JSStrings before VM's heap (and JSStrings in SmallStrings) is initialized,
and after VM's Heap is destroyed. We add this m_canAccessHeap flag to allow users to get StringImpl during the
this sensitive period. If m_canAccessHeap is false, we get StringImpl from AtomicStringImpl::add.

* runtime/SmallStrings.cpp:
(JSC::SmallStrings::initializeCommonStrings):
(JSC::SmallStrings::singleCharacterStringRep):
(JSC::SmallStringsStorage::rep): Deleted.
(JSC::SmallStringsStorage::SmallStringsStorage): Deleted.
(JSC::SmallStrings::createSingleCharacterString): Deleted.
* runtime/SmallStrings.h:
(JSC::SmallStrings::setCanAccessHeap):
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::~VM):

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

5 months agoWeb Inspector: Remove unused Timeline record selection code path
commit-queue@webkit.org [Fri, 22 Feb 2019 18:46:29 +0000 (18:46 +0000)]
Web Inspector: Remove unused Timeline record selection code path
https://bugs.webkit.org/show_bug.cgi?id=194931

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-02-22
Reviewed by Devin Rousso.

* UserInterface/Views/TimelineOverview.js:
(WI.TimelineOverview):
(WI.TimelineOverview.prototype.userSelectedRecord): Deleted.
* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView):
(WI.TimelineRecordingContentView.prototype.timelineOverviewUserSelectedRecord): Deleted.
* UserInterface/Views/TimelineView.js:
(WI.TimelineView.prototype.userSelectedRecordFromOverview): Deleted.

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

5 months ago[GTK] Navigation gesture improvements
commit-queue@webkit.org [Fri, 22 Feb 2019 18:46:25 +0000 (18:46 +0000)]
[GTK] Navigation gesture improvements
https://bugs.webkit.org/show_bug.cgi?id=194943

Patch by Alexander Mikhaylenko <exalm7659@gmail.com> on 2019-02-22
Reviewed by Michael Catanzaro.

Cancel the gesture if progress is less than 0.5 and velocity is not high enough.

Allow to continue the gesture during animation. Introduce finished state to be used
when showing snapshot after the animation ends.

Fix duration calculation, also slow it down so that the initial velocity matches
what it was during the gesture.

* UIProcess/ViewGestureController.h: Add shouldCancel() and State::Finishing to SwipeProgressTracker.
* UIProcess/gtk/ViewGestureControllerGtk.cpp:
(WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
Fix velocity calculation, allow scrolling during State::Animating.
(WebKit::ViewGestureController::SwipeProgressTracker::shouldCancel): Added.
(WebKit::ViewGestureController::SwipeProgressTracker::startAnimation): Use shouldCancel() and fix duration calculation.
(WebKit::ViewGestureController::SwipeProgressTracker::endAnimation): Set state to State::Finishing when the animation ends.

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

5 months agoREGRESSION(PSON) Scroll position is sometimes not restored on history navigation
cdumez@apple.com [Fri, 22 Feb 2019 18:24:57 +0000 (18:24 +0000)]
REGRESSION(PSON) Scroll position is sometimes not restored on history navigation
https://bugs.webkit.org/show_bug.cgi?id=194924
<rdar://problem/48216125>

Reviewed by Geoffrey Garen.

Source/WebKit:

When process-swapping, we would create a new WebPage in the new process, which would
call restoreSessionInternal() to restore the HistoryItems based on the UIProcess's
backforward list. The issue is that this session restoring would send HistoryItem
updates back to the UIProcess. Without PSON, this would be unnecessary but harmless.
With PSON though, this may end up overwriting values set by the previous process,
such as the scroll position.

Address the issue by temporarily disabling the HistoryItem update notifications to
the UIProcess while restoring a session.

* UIProcess/API/Cocoa/WKBackForwardListItem.mm:
(-[WKBackForwardListItem _scrollPosition]):
* UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::restoreSessionInternal):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

5 months agoInput type "formatSetInlineTextDirection" is dispatched when changing paragraph-level...
wenson_hsieh@apple.com [Fri, 22 Feb 2019 17:09:27 +0000 (17:09 +0000)]
Input type "formatSetInlineTextDirection" is dispatched when changing paragraph-level text direction
https://bugs.webkit.org/show_bug.cgi?id=194703
<rdar://problem/48111775>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Currently, when changing text direction, WebKit always sends input events of type formatSetInlineTextDirection,
even when changing paragraph text direction. Instead, we should be emitting formatSetBlockTextDirection in this
scenario. This is problematic when using the context menus on macOS to change writing direction, since changing
"Selection Direction" is currently indistinguishable from changing "Paragraph Direction".

To fix this, we split EditAction::SetWritingDirection into EditAction::SetInlineWritingDirection and
EditAction::SetBlockWritingDirection, which emit inline and block text direction input events, respectively.

Tests: fast/events/before-input-events-prevent-block-text-direction.html
       fast/events/before-input-events-prevent-inline-text-direction.html

* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::apply):
* editing/EditAction.cpp:
(WebCore::undoRedoLabel):
* editing/EditAction.h:
* editing/EditCommand.cpp:
(WebCore::inputTypeNameForEditingAction):
* editing/Editor.cpp:
(WebCore::inputEventDataForEditingStyleAndAction):
(WebCore::Editor::setBaseWritingDirection):
* editing/EditorCommand.cpp:
(WebCore::executeMakeTextWritingDirectionLeftToRight):
(WebCore::executeMakeTextWritingDirectionNatural):
(WebCore::executeMakeTextWritingDirectionRightToLeft):

Source/WebKitLegacy/win:

* WebCoreSupport/WebEditorClient.cpp:
(undoNameForEditAction):

LayoutTests:

Rebaseline some existing tests to expect input events of type "formatSetBlockTextDirection" instead of
"formatSetInlineTextDirection" when changing paragraph text direction; additionally, add a new layout test that
changes the inline text direction in some Bidi text, and verify that "formatSetInlineTextDirection" is emitted
in this scenario, and that calling `preventDefault()` in the beforeinput event handler causes no change to be
made.

* editing/input/ios/rtl-keyboard-input-on-focus-expected.txt:
* fast/events/before-input-events-prevent-block-text-direction-expected.txt: Added.
* fast/events/before-input-events-prevent-block-text-direction.html: Renamed from LayoutTests/fast/events/before-input-events-prevent-text-direction.html.
* fast/events/before-input-events-prevent-inline-text-direction-expected.txt: Added.
* fast/events/before-input-events-prevent-inline-text-direction.html: Added.
* fast/events/before-input-events-prevent-text-direction-expected.txt: Removed.

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

5 months agoUnreviewed, disable API test added in r241928 on iOS.
cdumez@apple.com [Fri, 22 Feb 2019 16:48:38 +0000 (16:48 +0000)]
Unreviewed, disable API test added in r241928 on iOS.

The cache is not enabled on devices with less than 3GB of RAM.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

5 months agoRemove stripLeadingAndTrailingWhitespace from MathMLElement.cpp
commit-queue@webkit.org [Fri, 22 Feb 2019 16:31:17 +0000 (16:31 +0000)]
Remove stripLeadingAndTrailingWhitespace from MathMLElement.cpp
https://bugs.webkit.org/show_bug.cgi?id=160172

Patch by Rob Buis <rbuis@igalia.com> on 2019-02-22
Reviewed by Frédéric Wang.

Remove stripLeadingAndTrailingWhitespace and use stripLeadingAndTrailingHTTPSpaces
from HTTPParsers instead.

No new tests, already covered by MathML tests.

* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::stripLeadingAndTrailingWhitespace): Deleted.
* mathml/MathMLElement.h:
* mathml/MathMLPresentationElement.cpp:
(WebCore::MathMLPresentationElement::parseMathMLLength):
* mathml/MathMLTokenElement.cpp:
(WebCore::MathMLTokenElement::convertToSingleCodePoint):

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

5 months agoUpdate some media logging
eric.carlson@apple.com [Fri, 22 Feb 2019 13:52:18 +0000 (13:52 +0000)]
Update some media logging
https://bugs.webkit.org/show_bug.cgi?id=194915

Reviewed by Jer Noble.

No new tests, no functional change.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::evictCodedFrames):
(WebCore::SourceBuffer::provideMediaData):
(WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::checkPlaybackTargetCompatablity):
(WebCore::HTMLMediaElement::loadResource):
(WebCore::HTMLMediaElement::updateActiveTextTrackCues):
(WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const):
(WebCore::HTMLMediaElement::seekTask):
(WebCore::HTMLMediaElement::playInternal):
(WebCore::HTMLMediaElement::pauseInternal):
(WebCore::HTMLMediaElement::setLoop):
(WebCore::HTMLMediaElement::setControls):
(WebCore::HTMLMediaElement::sourceWasRemoved):

* html/MediaElementSession.cpp:
(WebCore::convertEnumerationToString):

* html/MediaElementSession.h:
(WTF::LogArgument<WebCore::MediaPlaybackDenialReason>::toString):

* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):

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

5 months agoFix unitless usage of mathsize
commit-queue@webkit.org [Fri, 22 Feb 2019 10:42:43 +0000 (10:42 +0000)]
Fix unitless usage of mathsize
https://bugs.webkit.org/show_bug.cgi?id=194940

Patch by Rob Buis <rbuis@igalia.com> on 2019-02-22
Reviewed by Frédéric Wang.

Source/WebCore:

Convert unitless lengths to percentage values to correct the computed
font size.

* mathml/MathMLElement.cpp:
(WebCore::convertToPercentageIfNeeded):
(WebCore::MathMLElement::collectStyleForPresentationAttribute):

LayoutTests:

Tests lengths-1.html and length-3.html now pass.

* TestExpectations:

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

5 months agoUnreviewed. Bump version numbers
aperez@igalia.com [Fri, 22 Feb 2019 09:18:24 +0000 (09:18 +0000)]
Unreviewed. Bump version numbers

* Source/cmake/OptionsWPE.cmake:

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

5 months agoCache CompactVariableMap::Handle instead of VariableEnvironment for UnlinkedFunctionE...
tzagallo@apple.com [Fri, 22 Feb 2019 09:08:35 +0000 (09:08 +0000)]
Cache CompactVariableMap::Handle instead of VariableEnvironment for UnlinkedFunctionExecutable
https://bugs.webkit.org/show_bug.cgi?id=194706

Reviewed by Saam Barati.

In https://bugs.webkit.org/show_bug.cgi?id=194583 we started using a
CompactVariableMap::Handle instead of VariableEnvironment for
UnlinkedFunctionExecutables, but we were creating the full environment
to encode the executable in the bytecode cache. This patch changes it so
that we cache the handle instead of the environment. This avoids duplicating
the VariableEnvironment whenever we have to cache two handles that point
to the environment.

* bytecode/UnlinkedFunctionExecutable.h:
* parser/VariableEnvironment.cpp:
(JSC::CompactVariableMap::get):
* parser/VariableEnvironment.h:
* runtime/CachedTypes.cpp:
(JSC::CachedCompactVariableEnvironment::encode):
(JSC::CachedCompactVariableEnvironment::decode const):
(JSC::CachedCompactVariableMapHandle::encode):
(JSC::CachedCompactVariableMapHandle::decode const):
(JSC::CachedFunctionExecutable::encode):
(JSC::CachedFunctionExecutable::decode const):
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):

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

5 months agoUnreviewed. Bump version numbers
carlosgc@webkit.org [Fri, 22 Feb 2019 07:32:29 +0000 (07:32 +0000)]
Unreviewed. Bump version numbers

* Source/cmake/OptionsGTK.cmake:

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

5 months ago[WPE][GTK] No API documentation generated for WebKitUserContentFilterStore
aperez@igalia.com [Fri, 22 Feb 2019 07:19:38 +0000 (07:19 +0000)]
[WPE][GTK] No API documentation generated for WebKitUserContentFilterStore
https://bugs.webkit.org/show_bug.cgi?id=194908

Reviewed by Carlos Garcia Campos.

* UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Add entry for webkit_user_content_filter_store_get_type().
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add entry for WebKitUserContentFilterStore.
* UIProcess/API/wpe/docs/wpe-docs.sgml: Ditto.

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

5 months agowpewebkit-2.23.90 Failing to build on Fedora
carlosgc@webkit.org [Fri, 22 Feb 2019 07:06:03 +0000 (07:06 +0000)]
wpewebkit-2.23.90 Failing to build on Fedora
https://bugs.webkit.org/show_bug.cgi?id=194922

Unreviewed. Fix path to WebKitUserContentFilterStore.h in WPE_API_INSTALLED_HEADERS.

* PlatformWPE.cmake:

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

5 months agoHardcode Visual Viewports on everywhere except iOS WK1
simon.fraser@apple.com [Fri, 22 Feb 2019 07:04:03 +0000 (07:04 +0000)]
Hardcode Visual Viewports on everywhere except iOS WK1
https://bugs.webkit.org/show_bug.cgi?id=194928

Reviewed by Zalan Bujtas.
Source/WebCore:

Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
change the default value of the Setting to 'true', and hardcode WebView on iOS to
set it to false. The setting has shipped for several years and there's no need to turn
it off now.

Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
Visual Viewports are not enabled.

Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
that only runs in WK2

* page/Settings.yaml:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
(WebCore::AsyncScrollingCoordinator::visualViewportEnabled const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
(WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
(WebCore::ScrollingStateFrameScrollingNode::setVisualViewportEnabled): Deleted.
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::visualViewportEnabled const): Deleted.
(WebCore::ScrollingTree::setVisualViewportEnabled): Deleted.
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):

Source/WebKit:

Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
change the default value of the Setting to 'true', and hardcode WebView on iOS to
set it to false. The setting has shipped for several years and there's no need to turn
it off now.

Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
Visual Viewports are not enabled.

Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
that only runs in WK2

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
(ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _visualViewportEnabled]): Deleted.
(-[WKPreferences _setVisualViewportEnabled:]): Deleted.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
(WebKit::RemoteScrollingCoordinatorProxy::visualViewportEnabled const): Deleted.
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect const):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::computeCustomFixedPositionRect const):
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::computeElementLayout):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getFocusedElementInformation):
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::updateVisibleContentRects):

Source/WebKitLegacy/mac:

Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
change the default value of the Setting to 'true', and hardcode WebView on iOS to
set it to false. The setting has shipped for several years and there's no need to turn
it off now.

Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
Visual Viewports are not enabled.

Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
that only runs in WK2

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences visualViewportEnabled]): Deleted.
(-[WebPreferences setVisualViewportEnabled:]): Deleted.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Tools:

Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
change the default value of the Setting to 'true', and hardcode WebView on iOS to
set it to false. The setting has shipped for several years and there's no need to turn
it off now.

Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
Visual Viewports are not enabled.

Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
that only runs in WK2

* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController init]):
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController visualViewportEnabled]): Deleted.
(-[SettingsController toggleVisualViewportEnabled:]): Deleted.
* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController didChangeSettings]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController didChangeSettings]):

LayoutTests:

Remove "(visual viewport enabled 1)" from scrolling tree dumps. Remove calls
to "internals.settings.setVisualViewportEnabled(true)"

* fast/dom/elementFromPoint-scaled-scrolled-layout-viewport.html:
* fast/events/ios/rotation/resources/rotation-utils.js:
* fast/visual-viewport/client-coordinates-relative-to-layout-viewport.html:
* fast/visual-viewport/client-rects-relative-to-layout-viewport-zoomed.html:
* fast/visual-viewport/client-rects-relative-to-layout-viewport.html:
* fast/visual-viewport/nonzoomed-rects.html:
* fast/visual-viewport/resize-event-fired-window-resized.html:
* fast/visual-viewport/resize-event-fired.html:
* fast/visual-viewport/rtl-nonzoomed-rects.html:
* fast/visual-viewport/rtl-zoomed-rects.html:
* fast/visual-viewport/rubberbanding-viewport-rects-extended-background.html:
* fast/visual-viewport/rubberbanding-viewport-rects-header-footer.html:
* fast/visual-viewport/rubberbanding-viewport-rects.html:
* fast/visual-viewport/scroll-event-fired.html:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-expected.txt:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-then-up-expected.txt:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-then-up.html:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down.html:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolling-layers-state-expected.txt:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolling-layers-state.html:
* fast/visual-viewport/viewport-dimensions-exclude-custom-scrollbars.html:
* fast/visual-viewport/viewport-dimensions-exclude-scrollbars.html:
* fast/visual-viewport/viewport-dimensions-iframe.html:
* fast/visual-viewport/viewport-dimensions-under-page-zoom.html:
* fast/visual-viewport/viewport-dimensions.html:
* fast/visual-viewport/visual-viewport-same-object.html:
* fast/visual-viewport/zoomed-fixed-header-and-footer.html:
* fast/visual-viewport/zoomed-fixed-scroll-down-then-up.html:
* fast/visual-viewport/zoomed-fixed.html:
* fast/visual-viewport/zoomed-rects.html:
* fast/visual-viewport/zoomed-scroll-into-view-fixed.html:
* fast/visual-viewport/zoomed-scroll-to-anchor-in-position-fixed.html:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/remove-coordinated-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt:
* scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt:
* scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt:
* scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt:
* scrollingcoordinator/scrolling-tree/remove-coordinated-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt:
* scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt:
* scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt:
* scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order-expected.txt:
* scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt:
* scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling.html: Don't insert the first scrolling tree
dump until the end, to avoid it affecting main frame height before we get the second layer tree.
* tiled-drawing/scrolling/clamp-out-of-bounds-scrolls-expected.txt:
* tiled-drawing/scrolling/fixed/absolute-inside-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/absolute-inside-out-of-view-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/fixed-in-overflow-expected.txt:
* tiled-drawing/scrolling/fixed/fixed-position-out-of-view-expected.txt:
* tiled-drawing/scrolling/fixed/fixed-position-out-of-view-negative-zindex-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars-with-header-and-footer-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars-zoomed-expected.txt:
* tiled-drawing/scrolling/fixed/negative-scroll-offset-expected.txt:
* tiled-drawing/scrolling/fixed/negative-scroll-offset-in-view-expected.txt:
* tiled-drawing/scrolling/fixed/nested-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/percentage-inside-fixed-expected.txt:
* tiled-drawing/scrolling/frames/scroll-region-after-frame-layout-expected.txt:
* tiled-drawing/scrolling/scrolling-tree-after-scroll-expected.txt:
* tiled-drawing/scrolling/scrolling-tree-slow-scrolling-expected.txt:
* tiled-drawing/scrolling/sticky/negative-scroll-offset-expected.txt:
* tiled-drawing/scrolling/sticky/sticky-horizontal-expected.txt:
* tiled-drawing/scrolling/sticky/sticky-vertical-expected.txt:

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

5 months ago[GTK] Epiphany searching for plugins even if plugins are disabled
carlosgc@webkit.org [Fri, 22 Feb 2019 07:02:05 +0000 (07:02 +0000)]
[GTK] Epiphany searching for plugins even if plugins are disabled
https://bugs.webkit.org/show_bug.cgi?id=194352

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@241933 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoSome refinements for Node and Document
darin@apple.com [Fri, 22 Feb 2019 06:46:37 +0000 (06:46 +0000)]
Some refinements for Node and Document
https://bugs.webkit.org/show_bug.cgi?id=194764

Reviewed by Ryosuke Niwa.

Source/WebCore:

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::press): Use shadowHost instead of
deprecatedShadowAncestorNode.
(WebCore::AccessibilityObject::axObjectCache const): Tweak coding style.
(WebCore::AccessibilityObject::focusedUIElement const): Use existing page
function to streamline.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::accessKey const): Use
attributeWithoutSynchronization for efficiency and consistency with other
code working with the accesskey attribute.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::childrenChanged): Added call to
invalidateAccessKeyCache, replacing old scheme tied to style recalculation.

* dom/DecodedDataDocumentParser.cpp:
(WebCore::DecodedDataDocumentParser::appendBytes): Update for name and return
type change of createDecoderIfNeeded to decoder.
(WebCore::DecodedDataDocumentParser::flush): Ditto.

* dom/Document.cpp:
(WebCore::Document::elementForAccessKey): Renamed from getElementForAccessKey
to match WebKit coding style. Changed to use unique_ptr instead of separate
boolean to keep track of map validity status.
(WebCore::Document::buildAccessKeyCache): Renamed from buildAccessKeyMap to
clarify that this is a cache. Changed to use composedTreeDescendants rather
than explicit calls to shadowRoot. Use add instead of set so that first element
in document order wins, instead of last element in document order. Updated
to make a new map in a new unique_ptr instead of populating a map.
(WebCore::Document::invalidateAccessKeyCacheSlowCase): Renamed from
invalidateAccessKeyMap, and left an inline part in the header so the fast case
of quickly checking for a null pointer can be inlined.
(WebCore::Document::doctype const): Use downcast instead of static_cast.
(WebCore::Document::scheduleStyleRecalc): Moved call to invalidateAccessKeyMap
from here to childrenChanged and accesskey attribute change handling.
(WebCore::Document::processFormatDetection): Set m_isTelephoneNumberParsingAllowed
directly since this is the only place that does it and we don't need to factor
that one line of code into a function.
(WebCore::Document::getOverrideStyle): Moved to header since it's just a stub
that always returns nullptr and can be inlined.
(WebCore::Document::setIsTelephoneNumberParsingAllowed): Deleted.
(WebCore::Document::ensureTemplateDocument): Removed nullptr frame argument to
the create function, since Document::create now always involves no frame.
(WebCore::Document::didAssociateFormControl): Changed argument type to a reference
and simplified the logic with a local variable.
(WebCore::Document::didAssociateFormControlsTimerFired): Simplified the null
checks and rearranged things so that m_associatedFormControls will always
get cleared even if the document is no longer associated with a page.

* dom/Document.h: Removed unnnecessary explicit values for enumerations (first
value is always zero, etc.) and formatted simple enumerations in a single line
for easier reading. Moved Document::create fucntion bodies out of line, removed
the frame argument from the simple "create with URL" overload and made the frame
argument for createNonRenderedPlaceholder be a reference rather than a pointer.
Renamed getElementByAccessKey to elementForAccessKey, invalidateAccessKeyMap to
invalidateAccessKeyCache, buildAccessKeyMap to buildAccessKeCache,
m_elementsByAccessKey to m_accessKeyCache and changed its type.
Removed bogus "DOM methods" comment, unused setParserFeature friend declaration,
setIsTelephoneNumberParsingAllowed function, and m_accessKeyMapValid flag.

* dom/Document.idl: Added comment highlighting that getOverrideStyle is just a
placeholder returning null.

* dom/Element.cpp:
(WebCore::Element::attributeChanged): Call invalidateAccessKeyCache when the
value of the accesskey attribute is changed. Also moved the class attribute code
so the attributes here are in alphabetical order (only class and id were out of
alphabetical order).

* dom/Node.cpp:
(WebCore::Node::isDescendantOrShadowDescendantOf const): Rewrote to no longer
use deprecatedShadowAncestorNode and used boolean operators to make it a
single line and easier to understand. Also added a FIXME since the
containsIncludingShadowDOM function is so similar, yet differently written.
(WebCore::Node::contains const): Rewrote as a single line to make this easier
to read and to *slightly* improve the speed in the "this == node" case.
(WebCore::Node::containsIncludingHostElements const): Use downcast.
(WebCore::Node::deprecatedShadowAncestorNode const): Deleted.

* dom/Node.h: Deleted now-unused deprecatedShadowAncestorNode.

* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplacementFragment::ReplacementFragment): Rewrote to use shadowHost
instead of deprecatedShadowAncestorNode.

* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::resetFormOwner): Pass reference to
didAssociateFormControl.
(WebCore::FormAssociatedElement::formAttributeChanged): Ditto.

* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::parseAttribute): Removed special case for accesskey
attribute, because we want to call the base class parseAttribute in that case.

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::insertedIntoAncestor): Pass reference to
didAssociateFormControl.

* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::parseAttribute): Removed special case for accesskey
attribute with mysterious FIXME, because we want to call the base class
parseAttribute in that case. The old code had no effect before; the access key
logic would still find the attribute; if the goal is to ignore the attribute
for these elements we will need a different solution.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::parseAttribute): Ditto.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::DocumentLoader): Removed code that was always passing
nullptr as the frame for the newly created DocumentWriter. It used m_frame, but
m_frame was always null.
(WebCore::DocumentLoader::attachToFrame): Pass reference to DocumentWriter::setFrame.

* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::DocumentWriter): Deleted. The old version set m_frame to
the passed in frame, which was always nullptr, and initialized some booleans and an
enumeration, which are now initialized in the class definition.
(WebCore::DocumentWriter::createDocument): Pass a reference for the frame.
(WebCore::DocumentWriter::begin): Updated now that State is an enum class.
(WebCore::DocumentWriter::decoder): Renamed from createDecoderIfNeeded and changed
to return a reference.
(WebCore::DocumentWriter::addData): Use RELEASE_ASSERT instead of if/CRASH and
updated now that State is an enum class.
(WebCore::DocumentWriter::insertDataSynchronously): Updated now that State is an
enum class.
(WebCore::DocumentWriter::end): Ditto.

* loader/DocumentWriter.h: Removed unneeded include and forward declaration.
Removed the frame pointer argument to the constructor, caller was always passing a
nullptr. Changed argument to setFrame to be a reference. Renamed createDecoderIfNeeded
to decoder and changed it to return a reference. Initialized m_frame,
m_hasReceivedSomeData, m_encodingWasChosenByUser, and m_state here so we don't need
to initialize them in a constructor. Renamed the enum from WriterState to State since
it's a member of DocumentWriter already, and made it an enum class rather than ending
each enumeration value with WritingState.

* page/DragController.cpp:
(WebCore::isEnabledColorInput): Removed boolean argument setToShadowAncestor. The
one caller that formerly passed true now calls the new hasEnabledColorInputAsShadowHost
function instead.
(WebCore::hasEnabledColorInputAsShadowHost): Added.
(WebCore::elementUnderMouse): Use shadowHost instead of deprecatedShadowAncestorNode.
Also added FIXME since it seems this should instead be using parentElementInComposedTree.
(WebCore::DragController::concludeEditDrag): Removed "false" argument to isEnabledColorInput.
(WebCore::DragController::canProcessDrag): Removed "true" argument to isEnabledColorInput
and added call to hasEnabledColorInputAsShadowHost. Also put the value of the node to drag
into a local variable to simplify code.
(WebCore::DragController::draggableElement const): Removed "false" argument to isEnabledColorInput.

* page/EventHandler.cpp:
(WebCore::EventHandler::handleAccessKey): Update name of elementForAccessKey.

* page/FocusController.cpp:
(WebCore::clearSelectionIfNeeded): Use shadowHost instead of deprecatedShadowAncestorNode.

* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::createPageForServiceWorker): Pass reference instead of pointer for frame to
Document::createNonRenderedPlaceholder.

Source/WebInspectorUI:

* UserInterface/Models/NativeFunctionParameters.js: Removed getOverrideStyle
because this deprecated non-working function is no longer something web authors
should be thinking about or typing.

Source/WebKit:

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
(webkit_dom_document_get_override_style): Changed to return nullptr directly instead of
calling a bunch of WebCore code first. No real value in checking arguments or doing any work.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::shouldAlwaysUsePluginDocument const): Deleted.
No need to override the function inherited from the base class, nor to keep track of the
unnecessary task of implementing this some day.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Updated for the above.

Source/WebKitLegacy/mac:

* DOM/DOMDocument.mm:
(-[DOMDocument getOverrideStyle:pseudoElement:]): Return nil without calling
through to WebCore or even looking at the arguments.
(-[DOMDocument getOverrideStyle::]): Ditto.

LayoutTests:

fast/forms/access-key-shadow-and-ordering-expected.txt: Added.
fast/forms/access-key-shadow-and-ordering.html: Added.

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

5 months agoFix the test failure following r241918
dbates@webkit.org [Fri, 22 Feb 2019 06:46:06 +0000 (06:46 +0000)]
Fix the test failure following r241918
(https://bugs.webkit.org/show_bug.cgi?id=194906)

For some reason strict cookies are sent via HTTP in WK1 and not in WK2. Will investigate in <https://bugs.webkit.org/show_bug.cgi?id=194933>.
This sub-test failure occurs with and without the patch. As the primary purpose of this test
was to ensure correctness for Same Site lax cookies, I've amended the test and test result
for now.

* http/tests/cookies/same-site/user-load-cross-site-redirect-expected.txt:
* http/tests/cookies/same-site/user-load-cross-site-redirect.php:

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

5 months agoRemoved a duplicate ChangeLog entry.
aestes@apple.com [Fri, 22 Feb 2019 04:29:53 +0000 (04:29 +0000)]
Removed a duplicate ChangeLog entry.

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

5 months agoUpdate JSScript SPI based on feedback
sbarati@apple.com [Fri, 22 Feb 2019 04:21:54 +0000 (04:21 +0000)]
Update JSScript SPI based on feedback
https://bugs.webkit.org/show_bug.cgi?id=194517

Reviewed by Keith Miller.

This patch updates the JSScript SPI in the following ways:
- JSScript can now represent both modules and programs. This is a property
of the script determined during creation.
- JSScript now takes a sourceURL during construction. For modules, this acts
as the module identifier.
- JSScript now has SPI for writing the cache out to disk. We don't do this
automatically.
- JSScript will load the bytecode cache on creation if it exists.
- We retrofit these new requirements on the prior JSScript SPI that
we're going to remove as soon as we can: https://bugs.webkit.org/show_bug.cgi?id=194909.
Previous SPI assumes all JSScripts are modules. Previous SPI also assigns
a sourceURL to the JSScript based on what the module loader decided the
identifier should be. We'll remove this once we remove the old SPI.

This patch also adds SPI to JSContext to evaluate a JSScript. For modules,
this is like returning the result of doing dynamic import. For programs,
this does normal program evaluation.

This patch also fixes a bug in generateBytecode/generateModuleBytecode where
we would try to cache the bytecode even if recursivelyGenerateUnlinkedCodeBlock
returned null. E.g, if the script had a syntax error.

When writing tests, I also discovered that someone previously broke
testapi. This patch also fixes those failures. They were broken when
we switched to using a testapiScripts directory to hold our test .js
scripts.

* API/JSAPIGlobalObject.h:
* API/JSAPIGlobalObject.mm:
(JSC::JSAPIGlobalObject::moduleLoaderResolve):
(JSC::JSAPIGlobalObject::moduleLoaderFetch):
(JSC::JSAPIGlobalObject::loadAndEvaluateJSScriptModule):
* API/JSBase.cpp:
(JSEvaluateScriptInternal):
(JSEvaluateScript):
* API/JSBaseInternal.h: Added.
* API/JSContext.mm:
(-[JSContext evaluateScript:withSourceURL:]):
(-[JSContext evaluateJSScript:]):
* API/JSContextPrivate.h:
* API/JSScript.h:
* API/JSScript.mm:
(+[JSScript scriptWithSource:inVirtualMachine:]):
(+[JSScript scriptFromASCIIFile:inVirtualMachine:withCodeSigning:andBytecodeCache:]):
(createError):
(+[JSScript scriptOfType:inVirtualMachine:withSourceURL:andSource:andBytecodeCache:error:]):
(+[JSScript scriptOfType:inVirtualMachine:memoryMappedFromASCIIFile:withSourceURL:andBytecodeCache:error:]):
(-[JSScript cacheBytecodeWithError:]):
(-[JSScript sourceURL]):
(-[JSScript type]):
(-[JSScript jsSourceCode]):
(-[JSScript writeCache:]):
(-[JSScript setSourceURL:]):
(-[JSScript forceRecreateJSSourceCode]):
(-[JSScript writeCache]): Deleted.
(-[JSScript jsSourceCode:]): Deleted.
* API/JSScriptInternal.h:
* API/tests/FunctionOverridesTest.cpp:
(testFunctionOverrides):
* API/tests/testapi.c:
(main):
* API/tests/testapi.mm:
(tempFile):
(testModuleBytecodeCache):
(testProgramBytecodeCache):
(testBytecodeCacheWithSyntaxError):
(testProgramJSScriptException):
(testLoadBasicFileLegacySPI):
(+[JSContextMemoryMappedLoaderDelegate newContext]):
(-[JSContextMemoryMappedLoaderDelegate context:fetchModuleForIdentifier:withResolveHandler:andRejectHandler:]):
(testLoadBasicFile):
(+[JSContextAugmentedLoaderDelegate newContext]):
(-[JSContextAugmentedLoaderDelegate context:fetchModuleForIdentifier:withResolveHandler:andRejectHandler:]):
(testJSScriptURL):
(testObjectiveCAPI):
(testBytecodeCache): Deleted.
* API/tests/testapiScripts/foo.js: Added.
* JavaScriptCore.xcodeproj/project.pbxproj:
* runtime/Completion.cpp:
(JSC::generateBytecode):
(JSC::generateModuleBytecode):

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

5 months agoDiscard cached processes when clearing website data store
rniwa@webkit.org [Fri, 22 Feb 2019 02:58:40 +0000 (02:58 +0000)]
Discard cached processes when clearing website data store
https://bugs.webkit.org/show_bug.cgi?id=194894

Reviewed by Chris Dumez.

Source/WebKit:

Clear the process cache when clearing the website data store so that there is no way to infer
which site the user had visited by observing for which sites WebContent processes had been cached.

There is one sublty in WebsiteDataStore::removeData that we have to delay the clearing of
the web process cache until the next run loop because SuspendedPageProxy::~SuspendedPageProxy
invokes WebProcessProxy::maybeShutDown in the next run loop. We also have to disable the process
cache during this time as it would otherwise trigger the responsiveness check of WebContent process
can take arbitrarily long time.

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _processCacheCapacity]): Added for testing.
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::addProcess): Avoid adding web processes to the cache while the suspended
pages are being cleared.
* UIProcess/WebProcessCache.h:
(WebKit::WebProcessCache::disabled const): Added.
(WebKit::WebProcessCache::setDisabled): Added.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::handleMemoryPressureWarning):
(WebKit::WebProcessPool::clearSuspendedPages): Added.
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):

Tools:

Added a test case.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
(TestWebKitAPI.ProcessSwap.NumberOfCachedProcesses): Added.

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

5 months agoAdd more doesGC() assertions.
mark.lam@apple.com [Fri, 22 Feb 2019 02:02:32 +0000 (02:02 +0000)]
Add more doesGC() assertions.
https://bugs.webkit.org/show_bug.cgi?id=194911
<rdar://problem/48285723>

Reviewed by Saam Barati and Yusuke Suzuki.

* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::compileOSRExit):
- Set expectDoesGC here because we no longer have to worry about missing store
  barriers in optimized code after this point.  This will prevent false positive
  assertion failures arising from functions called beneath compileOSRExit().

(JSC::DFG::OSRExit::compileExit):
- Add a comment to explain why the generated ramp needs to set expectDoesGC even
  though compileOSRExit() also sets it.  Reason: compileOSRExit() is only called
  for the first OSR from this code origin, the generated ramp is called for many
  subsequents OSR exits from this code origin.

* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
- Added a comment for the equivalent reason to the one above.

(JSC::FTL::compileFTLOSRExit):
- Set expectDoesGC here because we no longer have to worry about missing store
  barriers in optimized code after this point.  This will prevent false positive
  assertion failures arising from functions called beneath compileFTLOSRExit().

* heap/CompleteSubspace.cpp:
(JSC::CompleteSubspace::tryAllocateSlow):
* heap/CompleteSubspaceInlines.h:
(JSC::CompleteSubspace::allocateNonVirtual):
- assert expectDoesGC.

* heap/DeferGC.h:
(JSC::DeferGC::~DeferGC):
- assert expectDoesGC.
- Also added WTF_FORBID_HEAP_ALLOCATION to DeferGC, DeferGCForAWhile, and DisallowGC
  because all 3 should be stack allocated RAII objects.

* heap/GCDeferralContext.h:
* heap/GCDeferralContextInlines.h:
(JSC::GCDeferralContext::~GCDeferralContext):
- Added WTF_FORBID_HEAP_ALLOCATION.
- assert expectDoesGC.

* heap/Heap.cpp:
(JSC::Heap::collectNow):
(JSC::Heap::collectAsync):
(JSC::Heap::collectSync):
(JSC::Heap::stopIfNecessarySlow):
(JSC::Heap::collectIfNecessaryOrDefer):
* heap/HeapInlines.h:
(JSC::Heap::acquireAccess):
(JSC::Heap::stopIfNecessary):
* heap/LargeAllocation.cpp:
(JSC::LargeAllocation::tryCreate):
* heap/LocalAllocatorInlines.h:
(JSC::LocalAllocator::allocate):
- conservatively assert expectDoesGC on these functions that may trigger a GC
  though they don't always do.

* runtime/DisallowScope.h:
- DisallowScope should be stack allocated because it's an RAII object.

* runtime/JSCellInlines.h:
(JSC::tryAllocateCellHelper):
- Remove the expectDoesGC assertion because it is now covered by assertions in
  CompleteSubspace, LargeAllocation, and LocalAllocator.

* runtime/RegExpMatchesArray.h:
(JSC::createRegExpMatchesArray):
- assert expectDoesGC.

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

5 months agoClicking "Go Back" on a safe browsing warning before a WKWebView has loaded any page...
commit-queue@webkit.org [Fri, 22 Feb 2019 01:58:34 +0000 (01:58 +0000)]
Clicking "Go Back" on a safe browsing warning before a WKWebView has loaded any page should request to close the WKWebView
https://bugs.webkit.org/show_bug.cgi?id=194914
<rdar://problem/47586889>

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

Source/WebKit:

* UIProcess/API/APIUIClient.h:
(API::UIClient::didShowSafeBrowsingWarning):
(API::UIClient::didClickGoBackFromSafeBrowsingWarning): Deleted.
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::didClickGoBackFromSafeBrowsingWarning): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
(-[SafeBrowsingNavigationDelegate webViewDidClose:]):
(TEST):
(-[SafeBrowsingNavigationDelegate _webViewDidClickGoBackFromSafeBrowsingWarning:]): Deleted.

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

5 months agoTurn a high-value UI-side-compositing assertion into a release assert
timothy_horton@apple.com [Fri, 22 Feb 2019 01:51:32 +0000 (01:51 +0000)]
Turn a high-value UI-side-compositing assertion into a release assert
https://bugs.webkit.org/show_bug.cgi?id=194887

Reviewed by Simon Fraser.

* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
There is absolutely no situation in which this assert should fire
if WebKit is behaving correctly, and it will basically always result
in a UI process crash (or at least confusion), so make it a release assert.
This would have saved us a lot of stress in bug 194845.

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

5 months ago[MSVC] Fix compilation errors with lambdas in ResourceLoadStatistics
don.olmstead@sony.com [Fri, 22 Feb 2019 01:05:08 +0000 (01:05 +0000)]
[MSVC] Fix compilation errors with lambdas in ResourceLoadStatistics
https://bugs.webkit.org/show_bug.cgi?id=194913

Reviewed by Brent Fulgham.

MSVC has problems with the scoping of `this` within a nested lambda. To work around the
behavior the enclosing lambda's wrapping of `this` is used within the nested lambda.

* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):

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

5 months ago[JSC] Use Fast Malloc as much as possible
ysuzuki@apple.com [Fri, 22 Feb 2019 01:04:01 +0000 (01:04 +0000)]
[JSC] Use Fast Malloc as much as possible
https://bugs.webkit.org/show_bug.cgi?id=194316

Reviewed by Mark Lam.

We should use Fast Malloc as much as possible to offer the whole memory view to bmalloc.

* inspector/scripts/codegen/cpp_generator_templates.py:
* inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result:
* inspector/scripts/tests/generic/expected/enum-values.json-result:
* inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result:
* jit/ExecutableAllocator.h:
* jsc.cpp:
* runtime/JSRunLoopTimer.h:
* tools/VMInspector.h:
* wasm/WasmThunks.h:

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

5 months agoLeak of CFErrorRef objects (1.92 Kbytes) in com.apple.WebKit.WebContent.Development...
ddkilzer@apple.com [Fri, 22 Feb 2019 00:03:25 +0000 (00:03 +0000)]
Leak of CFErrorRef objects (1.92 Kbytes) in com.apple.WebKit.WebContent.Development running WebKit layout tests on iOS Simulator
<https://webkit.org/b/194761>

Reviewed by Myles Maxfield.

* WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm:
(WTR::activateSystemCoreWebFonts): Log `error` to console if
CTFontManagerRegisterFontsForURL() fails (macOS only).  Update
to use ARC-compliant cast.
(WTR::activateFonts): Change `0` to `nullptr`.  Update to use
ARC-compliant cast.
(WTR::installFakeHelvetica): Log `error` to console if
CTFontManagerRegisterFontsForURL() fails, but only on supported
platforms (macOS Mojave/iOS 12 and newer, not iOS Simulator).
Call CFRelease() on `error` to fix the leak.  Update to use
ARC-compliant cast.
(WTR::uninstallFakeHelvetica): Update to use ARC-compliant
cast.

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

5 months agoFix API test crashes after r241855.
cdumez@apple.com [Thu, 21 Feb 2019 23:59:29 +0000 (23:59 +0000)]
Fix API test crashes after r241855.

Reviewed by Ryosuke Niwa.

* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::addProcessIfPossible):

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

5 months agoSame Site Lax cookies are not sent with cross-site redirect from client-initiated...
dbates@webkit.org [Thu, 21 Feb 2019 23:54:40 +0000 (23:54 +0000)]
Same Site Lax cookies are not sent with cross-site redirect from client-initiated load
https://bugs.webkit.org/show_bug.cgi?id=194906
<rdar://problem/44305947>

Reviewed by Brent Fulgham.

Source/WebCore:

Ensure that a request for a top-level navigation is annotated as such regardless of whether
the request has a computed Same Site policy.

"New loads" initiated by a the client (Safari) either by API or a human either explicitly
typing a URL in the address bar or Command + clicking a hyperlink to open it in a new window/tab
are always considered Same Site. This is by definition from the spec. [1] as we aren't navigating
from an existing page. (Command + click should be thought of as a convenience to the user from
having to copy the hyperlink's URL, create a new window, and paste the URL into the address bar).
Currently the frame loader marks a request as a top-level navigation if and only if the request
does not have a pre-computed Same Site policy. However, "New loads" have a pre-computed Same Site
policy. So, these loads would never be marked as a top-level navigation by the frame loading code.
Therefore, if the "new load" turned out to be a cross-site redirect then WebKit would incorrectly
tell the networking stack that the load was a cross-site, non-top-level navigation, and per the
Same Site spec [2], the networking stack would not send Same Site Lax cookies. Instead,
WebKit should unconditionally ensure that requests are marked as a top-level navigation, if applicable.

[1] See Note for (1) in  <https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-02#section-5.2>
[2] <https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-02#section-5.3.7.1>

Test: http/tests/cookies/same-site/user-load-cross-site-redirect.php

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::addExtraFieldsToRequest): Unconditionally update the request's top-
level navigation bit.
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setAsIsolatedCopy): Unconditionally copy a request's top-
level navigation bit.

LayoutTests:

Add a test that is representative of a user loading a cross-site page that redirects
to a page that expects Same Site Lax cookies.

* http/tests/cookies/same-site/user-load-cross-site-redirect-expected.txt: Added.
* http/tests/cookies/same-site/user-load-cross-site-redirect.php: Added.

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

5 months agoFlaky API Test: TestWebKitAPI.ProcessSwap.SuspendedPageLimit
cdumez@apple.com [Thu, 21 Feb 2019 23:53:11 +0000 (23:53 +0000)]
Flaky API Test: TestWebKitAPI.ProcessSwap.SuspendedPageLimit
https://bugs.webkit.org/show_bug.cgi?id=194481

Reviewed by Alex Christensen.

Give the processes a chance to shutdown and wait until we reached the expected number
of processes.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

5 months agoFix the macOS build
timothy_horton@apple.com [Thu, 21 Feb 2019 23:16:20 +0000 (23:16 +0000)]
Fix the macOS build

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

5 months agoLayout Test fast/text/international/khmer-selection.html is crashing
pvollan@apple.com [Thu, 21 Feb 2019 23:12:36 +0000 (23:12 +0000)]
Layout Test fast/text/international/khmer-selection.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=191368

Reviewed by Brent Fulgham.

Source/WebCore:

GlyphBuffer's offset array wasn't getting filled by UniscribeController.
Our underlining code requires this array.

Uniscribe gives us a character -> glyph mapping, so we just have to compute
the inverse and give it to the GlyphBuffer.

This patch is written by Myles C. Maxfield.

Test: fast/text/international/khmer-selection.html.

* platform/graphics/GlyphBuffer.h:
(WebCore::GlyphBuffer::add):
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::DrawGlyphs::generateGlyphBuffer const):
* platform/graphics/win/UniscribeController.cpp:
(WebCore::UniscribeController::advance):
(WebCore::UniscribeController::itemizeShapeAndPlace):
(WebCore::UniscribeController::shapeAndPlaceItem):
* platform/graphics/win/UniscribeController.h:

LayoutTests:

* platform/win/TestExpectations:

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

5 months agocontentfiltering tests leak documents
aestes@apple.com [Thu, 21 Feb 2019 23:11:58 +0000 (23:11 +0000)]
contentfiltering tests leak documents
https://bugs.webkit.org/show_bug.cgi?id=189434
<rdar://44239943>

Reviewed by Simon Fraser.

Changed ContentFilter to capture the blocked Frame as a WeakPtr to break a reference cycle.

This fixes world leaks in several tests in LayoutTests/contentfiltering/.

* bindings/js/ScriptController.h:
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::didDecide):

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

5 months agoIndexedDB: leak UniqueIDBDatabase in layout tests
sihui_liu@apple.com [Thu, 21 Feb 2019 23:06:23 +0000 (23:06 +0000)]
IndexedDB: leak UniqueIDBDatabase in layout tests
https://bugs.webkit.org/show_bug.cgi?id=194870
<rdar://problem/48163812>

Reviewed by Geoffrey Garen.

UniqueIDBDatabase owns a pointer to itself after it is hard closed. It should release the pointer when it
receives confirmation from clients and all pending tasks are done. UniqueIDBDatabase already checks whether the
pointer should be released when a database task finishes, but it didn't perform a check when a confirm message
is received.

No new test as the order of task completion and confirmation arrival is uncertain.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::confirmDidCloseFromServer):

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

5 months agoFix ProcessSwap.PageOverlayLayerPersistence on macOS
timothy_horton@apple.com [Thu, 21 Feb 2019 22:55:05 +0000 (22:55 +0000)]
Fix ProcessSwap.PageOverlayLayerPersistence on macOS

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
I am a backwards.

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

5 months agocontentfiltering tests leak documents
aestes@apple.com [Thu, 21 Feb 2019 22:51:13 +0000 (22:51 +0000)]
contentfiltering tests leak documents
https://bugs.webkit.org/show_bug.cgi?id=189434
<rdar://44239943>

Reviewed by Simon Fraser.

Changed ContentFilter to capture the blocked Frame as a WeakPtr to break a reference cycle.

This fixes world leaks in several tests in LayoutTests/contentfiltering/.

* bindings/js/ScriptController.h:
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::didDecide):

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

5 months agoFix ProcessSwap.PageOverlayLayerPersistence on macOS
timothy_horton@apple.com [Thu, 21 Feb 2019 22:50:14 +0000 (22:50 +0000)]
Fix ProcessSwap.PageOverlayLayerPersistence on macOS

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
We can't find the UI-side layer on macOS because we don't use UI-side compositing.
We could force on UI-side compositing, but I feel like the test might be more
valuable exercising the normal path on each platform (though the original
bug was also UI-side specific). Though we can't validate that the overlay
layer was installed successfully, there are layout tests that do that.

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

5 months agoRotation animations sometimes use the wrong origin (affects apple.com)
dino@apple.com [Thu, 21 Feb 2019 22:36:32 +0000 (22:36 +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.

Forgot the expected results file.

* animations/additive-transform-animations-expected.html: Added.

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

5 months agoAPI::HTTPCookieStore should expose setCookies()
achristensen@apple.com [Thu, 21 Feb 2019 22:34:17 +0000 (22:34 +0000)]
API::HTTPCookieStore should expose setCookies()
https://bugs.webkit.org/show_bug.cgi?id=194861

Reviewed by Brent Fulgham.

Pass a Vector<Cookie> instead of just one cookie at a time.
This will add the ability to set multiple cookies without an IPC roundtrip per cookie.

* NetworkProcess/Cookies/WebCookieManager.cpp:
(WebKit::WebCookieManager::setCookie):
* NetworkProcess/Cookies/WebCookieManager.h:
* NetworkProcess/Cookies/WebCookieManager.messages.in:
* UIProcess/API/APIHTTPCookieStore.cpp:
(API::HTTPCookieStore::setCookies):
(API::HTTPCookieStore::setCookie): Deleted.
* UIProcess/API/APIHTTPCookieStore.h:
* UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
(-[WKHTTPCookieStore setCookie:completionHandler:]):
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::setCookies):
(WebKit::WebCookieManagerProxy::setCookie): Deleted.
* UIProcess/WebCookieManagerProxy.h:

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

5 months agoMove UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
commit-queue@webkit.org [Thu, 21 Feb 2019 21:43:43 +0000 (21:43 +0000)]
Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
https://bugs.webkit.org/show_bug.cgi?id=194531
<rdar://problem/47714562>

Patch by Antoine Quint <graouts@apple.com> on 2019-02-21
Reviewed by Tim Horton.

Follow-up commit to ensure this SPI is only called on newer versions of iOS.

Source/WebKit:

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cancelPointersForGestureRecognizer:]):

Source/WTF:

* wtf/Platform.h:

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

5 months agoCrash under RemoteLayerTreePropertyApplier::applyProperties when reattaching to old...
timothy_horton@apple.com [Thu, 21 Feb 2019 21:34:26 +0000 (21:34 +0000)]
Crash under RemoteLayerTreePropertyApplier::applyProperties when reattaching to old process
https://bugs.webkit.org/show_bug.cgi?id=194845
<rdar://problem/47944579>

Reviewed by Antti Koivisto.

Source/WebKit:

New test: ProcessSwap.PageOverlayLayerPersistence

* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged):
Keep track of all properties that have ever changed on a layer, so we
can re-send them if a layer moves between contexts.

* WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::~DrawingArea):
(WebKit::DrawingArea::removeMessageReceiverIfNeeded):
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::layerHostDidFlushLayers):
Make it possible to tear down DrawingArea's MessageReceiver before it is destroyed,
so that we can keep two DrawingAreas alive in a single process for a short time.

(WebKit::DrawingArea::adoptLayersFromDrawingArea):
Add adoptLayersFromDrawingArea; see below for its only useful implementation.

* WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp:
(WebKit::GraphicsLayerCARemote::GraphicsLayerCARemote):
(WebKit::GraphicsLayerCARemote::~GraphicsLayerCARemote):
(WebKit::GraphicsLayerCARemote::createPlatformCALayer):
(WebKit::GraphicsLayerCARemote::createPlatformCALayerForEmbeddedView):
(WebKit::GraphicsLayerCARemote::moveToContext):
* WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h:
Make it possible to move a GraphicsLayerCARemote between RemoteLayerTreeContexts.

* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::create):
(WebKit::PlatformCALayerRemote::createForEmbeddedView):
(WebKit::PlatformCALayerRemote::~PlatformCALayerRemote):
(WebKit::PlatformCALayerRemote::moveToContext):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
(WebKit::PlatformCALayerRemoteCustom::create):
(WebKit::PlatformCALayerRemoteCustom::clone const):
Make it possible to move a PlatformCALayerRemote between RemoteLayerTreeContexts.

* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::~RemoteLayerTreeContext):
(WebKit::RemoteLayerTreeContext::adoptLayersFromContext):
(WebKit::RemoteLayerTreeContext::layerDidEnterContext):
(WebKit::RemoteLayerTreeContext::layerWillLeaveContext):
(WebKit::RemoteLayerTreeContext::graphicsLayerDidEnterContext):
(WebKit::RemoteLayerTreeContext::graphicsLayerWillLeaveContext):
(WebKit::RemoteLayerTreeContext::layerWasCreated): Deleted.
(WebKit::RemoteLayerTreeContext::layerWillBeDestroyed): Deleted.
Keep track of all GraphicsLayerCARemote instances in the context, like we
do for PlatformCALayerRemote, so that we can update their context backpointers if needed.

Also make it possible to move all outstanding layers to a new context.

* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::adoptLayersFromDrawingArea):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
When doing a DrawingArea swap, transition all layers from the old context
to the new one. In order to do this, we temporarily keep both DrawingAreas
alive, but make use of the new mechanism to remove the old one's MessageReceiver
before installing the new one, so that destroying the old one later doesn't
remove it (avoiding re-introducing bug 189481).

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

5 months ago[CMake][Win] Fix !USE(CF) build of WebCore
don.olmstead@sony.com [Thu, 21 Feb 2019 21:06:37 +0000 (21:06 +0000)]
[CMake][Win] Fix !USE(CF) build of WebCore
https://bugs.webkit.org/show_bug.cgi?id=194879

Reviewed by Konstantin Tokarev.

* PlatformAppleWin.cmake:
* PlatformWin.cmake:
* PlatformWinCairo.cmake:

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